Skip to content

Commit 402425c

Browse files
committed
spark savings fix
1 parent ccec5f2 commit 402425c

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const sparkSavingsAbi = {
1+
const sparkSavingsAbi = {
22
totalAssets: {
33
inputs: [],
44
name: 'totalAssets',
@@ -20,4 +20,6 @@ export const sparkSavingsAbi = {
2020
stateMutability: 'view',
2121
type: 'function',
2222
},
23-
} as const;
23+
};
24+
25+
module.exports = { sparkSavingsAbi };

src/adaptors/spark-savings/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
const axios = require('axios')
22
const sdk = require('@defillama/sdk')
3+
const BigNumber = require('bignumber.js')
4+
const {sparkSavingsAbi} = require('./abi.js')
35

4-
import { Pool } from '../../types/Pool'
5-
import { sparkSavingsAbi } from './abi'
6-
import { BigNumber } from 'bignumber.js'
6+
import type { Pool } from '../../types/Pool'
77

88
const sparkBaseUrl = 'https://app.spark.fi/savings'
99

@@ -136,11 +136,10 @@ function rateToApy(rate: string): number {
136136
}
137137

138138
// high precision pow function for correct calculations
139-
function pow(a: BigNumber, b: number): BigNumber {
139+
function pow(a: any, b: number): any {
140140
return BigNumber.clone({ POW_PRECISION: 60 }).prototype.pow.apply(a, [b])
141141
}
142142

143143
module.exports = {
144-
timetravel: false,
145144
apy: getPools,
146-
}
145+
}

0 commit comments

Comments
 (0)