-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #312 from dappradar/aave-integration
aavev3 [bsc, zksync-era]
- Loading branch information
Showing
3 changed files
with
48 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import formatter from '../../../../util/formatter'; | ||
import { ITvlParams, ITvlReturn } from '../../../../interfaces/ITvl'; | ||
import aaveV3 from '../../../../util/calculators/aaveV3'; | ||
|
||
const START_BLOCK = 33571625; | ||
const POOL_DATA_PROVIDER_V3 = '0x41585C50524fb8c3899B43D7D797d9486AAc94DB'; | ||
|
||
async function tvl(params: ITvlParams): Promise<Partial<ITvlReturn>> { | ||
const { block, chain, provider, web3 } = params; | ||
if (block < START_BLOCK) { | ||
return {}; | ||
} | ||
|
||
const balances = await aaveV3.getTvl( | ||
POOL_DATA_PROVIDER_V3, | ||
block, | ||
chain, | ||
web3, | ||
); | ||
|
||
formatter.convertBalancesToFixed(balances); | ||
return { balances }; | ||
} | ||
export { tvl }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import formatter from '../../../../util/formatter'; | ||
import { ITvlParams, ITvlReturn } from '../../../../interfaces/ITvl'; | ||
import aaveV3 from '../../../../util/calculators/aaveV3'; | ||
|
||
const START_BLOCK = 43708965; | ||
const POOL_DATA_PROVIDER_V3 = '0x48B96565291d1B23a014bb9f68E07F4B2bb3Cd6D'; | ||
|
||
async function tvl(params: ITvlParams): Promise<Partial<ITvlReturn>> { | ||
const { block, chain, provider, web3 } = params; | ||
if (block < START_BLOCK) { | ||
return {}; | ||
} | ||
|
||
const balances = await aaveV3.getTvl( | ||
POOL_DATA_PROVIDER_V3, | ||
block, | ||
chain, | ||
web3, | ||
); | ||
|
||
formatter.convertBalancesToFixed(balances); | ||
return { balances }; | ||
} | ||
export { tvl }; |