-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BETS/wstETH pool not returning bptPrice #548
Comments
The bptPrice function is fetching 88 tokens at the same time, the max allowed by coingecko is 10 |
Is there a way to fetch only one? |
Yeah, but to find this bpt price, our flow is fetching prices for 88 tokens, so I separated our coingecko requests into chunks of 10, because now they have paid plan and free plan, and the free plan can fetch only 10 tokens per request :/
|
Thanks for your answer @lgahdl! |
Hi @brunoguerios, seems now the error is price = await balancer.pools.bptPrice(
await balancer.pools.find('0x26cc136e9b8fd65466f193a8e5710661ed9a98270002000000000000000005ad')
) |
Thanks for reporting @RomualdH - I created a new issue so we can keep track of it. We'll get to it as soon as possible. |
Hi @RomualdH, the coingecko API reduced their rate limit to 5 instead of 30 requests per minute today, I added a new config to add coingecko API Key, if you have a paid plan you will be able to initialize the SDK with your coingecko API Key: const balancerSDK = new BalancerSDK({
network: 1,
rpcUrl: 'https://rpc.ankr.com/eth',
coingecko: {
coingeckoApiKey: 'YOUR_API_KEY',
tokensPerPriceRequest: 30
},
}) PR: #557 |
Hi @lgahdl, is there a way to calculate the bpt price based on its underlaying tokens? |
Yes, but why do we need the price feed from CG if we have the weight of each token in the pool? That wouldn't be enough to calculate the price? |
No, it's not enough. Price in the end means USD value. You need each token USD value + weight to calculate the bptPrice. |
Can't I calculate wstETH price from it's wstETH/USDC pool, and then BETS price from wstETH/BETS pool based on the number of tokens weight (8020)? |
You sure can 👍 |
Do you have a snippet to help me calculate it please? |
I managed to do it with APIs and this formula |
BETS/wstETH pool on mainnet is apparently not returning a bptPrice. Was working before apparently.
The text was updated successfully, but these errors were encountered: