-
Notifications
You must be signed in to change notification settings - Fork 92
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 #141 from balancer-labs/develop
Release 0.1.22
- Loading branch information
Showing
125 changed files
with
10,318 additions
and
1,598 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
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 @@ | ||
v18.3.0 |
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
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,17 @@ | ||
/** | ||
* Display APRs for pool ids hardcoded under `const ids` | ||
* Run command: yarn examples:run ./examples/data/token-yields.ts | ||
*/ | ||
import { BalancerSDK } from '../../src/modules/sdk.module'; | ||
import { yieldTokens } from '../../src/modules/data/token-yields/tokens/aave'; | ||
|
||
const sdk = new BalancerSDK({ network: 1, rpcUrl: '' }); | ||
const { data } = sdk; | ||
|
||
const main = async () => { | ||
const tokenYield = await data.tokenYields.find(yieldTokens.waDAI); | ||
|
||
console.log(yieldTokens.waDAI, tokenYield); | ||
}; | ||
|
||
main(); |
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
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
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
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,31 @@ | ||
/** | ||
* Display APRs for pool ids hardcoded under `const ids` | ||
* Run command: yarn examples:run ./examples/pools/aprs.ts | ||
*/ | ||
import dotenv from 'dotenv'; | ||
import { BalancerSDK } from '../../src/modules/sdk.module'; | ||
|
||
dotenv.config(); | ||
|
||
const sdk = new BalancerSDK({ | ||
network: 137, | ||
rpcUrl: `${process.env.ALCHEMY_URL?.replace( | ||
'eth-mainnet', | ||
'polygon-mainnet.g' | ||
)}`, | ||
}); | ||
|
||
const { pools } = sdk; | ||
|
||
const main = async () => { | ||
const pool = await pools.find( | ||
'0x0297e37f1873d2dab4487aa67cd56b58e2f27875000100000000000000000002' | ||
); | ||
|
||
if (pool) { | ||
const apr = await pools.apr(pool); | ||
console.log(pool.id, apr); | ||
} | ||
}; | ||
|
||
main(); |
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,39 @@ | ||
/** | ||
* Display APRs for pool ids hardcoded under `const ids` | ||
* Run command: yarn examples:run ./examples/pools/aprs.ts | ||
*/ | ||
import dotenv from 'dotenv'; | ||
import { BalancerSDK } from '../../src/modules/sdk.module'; | ||
|
||
dotenv.config(); | ||
|
||
const sdk = new BalancerSDK({ | ||
network: 1, | ||
rpcUrl: `${process.env.ALCHEMY_URL}`, | ||
}); | ||
|
||
const { pools } = sdk; | ||
|
||
const main = async () => { | ||
const list = ( | ||
await pools.where( | ||
(pool) => | ||
pool.poolType != 'Element' && | ||
pool.poolType != 'AaveLinear' && | ||
pool.poolType != 'LiquidityBootstrapping' | ||
) | ||
) | ||
.sort((a, b) => parseFloat(b.totalLiquidity) - parseFloat(a.totalLiquidity)) | ||
.slice(0, 30); | ||
|
||
list.forEach(async (pool) => { | ||
try { | ||
const apr = await pools.apr(pool); | ||
console.log(pool.id, apr); | ||
} catch (e) { | ||
console.log(e); | ||
} | ||
}); | ||
}; | ||
|
||
main(); |
Oops, something went wrong.