-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separating coingecko token prices requests by chunks of 10, coingecko is only allowing 10 tokens per request in the free plan, they have a paid plan for more token prices (https://www.coingecko.com/en/api/pricing);
- Loading branch information
Luiz Gustavo Abou Hatem De Liz
committed
Nov 28, 2023
1 parent
f89012c
commit 37e995d
Showing
2 changed files
with
62 additions
and
22 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,19 @@ | ||
import { BalancerSDK } from '@balancer-labs/sdk'; | ||
|
||
const sdk = new BalancerSDK({ | ||
network: 1, | ||
rpcUrl: 'https://rpc.ankr.com/eth', | ||
}); | ||
|
||
const bptPriceExample = async () => { | ||
const poolId = | ||
'0x26cc136e9b8fd65466f193a8e5710661ed9a98270002000000000000000005ad'; | ||
const pool = await sdk.pools.find(poolId); | ||
if (!pool) { | ||
throw new Error('Pool not found'); | ||
} | ||
const bptPrice = await sdk.pools.bptPrice(pool); | ||
console.log('bpt price: ', bptPrice); | ||
}; | ||
|
||
bptPriceExample().catch((error) => console.error(error)); |
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