-
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 #549 from balancer/bpt-price-error
BPT Price Fetch Error - Separating in chunk of 10, coingecko only allows 10 token prices per request now;
- Loading branch information
Showing
4 changed files
with
86 additions
and
48 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
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