safe-transaction-service
safe-transaction-service copied to clipboard
Add an oracle for Balancer V2 Pools
What is needed?
Right now, fiat prices are only shown for Balancer V1 LP tokens. Because the V2 is quite big already, it makes sense to support V2 LP tokens too.
Background
Example: https://etherscan.io/address/0xA6F548DF93de924d73be7D25dC02554c6bD66dB5 Price on zerion: https://app.zerion.io/invest/asset/B-50WBTC-50WETH-0xa6f548df93de924d73be7d25dc02554c6bd66db5
How to calculate the price
- No idea
- It looks like the weighted pool contract doesn't expose token addresses, we'd have to retrieve them from the storage
- Docs on maths behind the pool https://docs.balancer.fi/concepts/math/weighted-math https://dev.balancer.fi/resources/pool-math/weighted-math