I'm doing project involving analysis of popular liquidity pools, such as Uniswap and Balancer. For doing that, I need to fetch various data about these pools.

To my understanding, Balancer has a function looking like r1^w1 * r2^w2 * r3^w3 * ... * rn^wn = C. How can I get in Python (using web3 library) values of r (reserves of tokens), w (weights), and also fees that are taken in case of performing swap?

In case of Uniswap I can do it via calling some functions in Uniswap contract. But for Balancer I couldn't find such contract, maybe another method should be used here.

1 Answer 1


You may look into the protocol's subgraphs.

E.g. https://docs.balancer.fi/reference/subgraph/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.