SorellaLabs / brontes

A blazingly fast general purpose blockchain analytics engine specialized in systematic mev detection
https://book.brontes.xyz
Apache License 2.0
512 stars 26 forks source link

Balancer Vault #799

Open 0xvanbeethoven opened 3 weeks ago

0xvanbeethoven commented 3 weeks ago

Protocol Name

Balancer

Protocol Description

Balancer Vault: See: 0xBA12222222228d8Ba445958a75a0704d566BF2C8

Functions to Support

batchSwap() flashLoan() swap()

Normalized Action Types

NormalizedBatch NormalizedFlashloan NormalizedSwap

Is it a Proxy?

Discovery Mechanism Requirements

Unsure if necesary

Additional Context

See: https://etherscan.io/address/0xba12222222228d8ba445958a75a0704d566bf2c8#code

Docs: https://docs.balancer.fi/concepts/vault/#gas-efficient-batch-swaps https://docs.balancer.fi/concepts/vault/swaps.html

Code of Conduct

mendesfabio commented 3 weeks ago

hey this is Fábio from Balancer - very excited about brontes and looking forward to try it!

I thought about creating an issue to discuss / try to understand some things but maybe I can use this one. My first question is: doesn't brontes already have a Balancer V2 classifier for the functions you listed? 🤔 what I'm missing?

Besides, I would like to point out there are some swaps on Balancer V2 that are actually single-side add/remove liquidity - could that cause any issues? I don't see any handling for it but what happens is you have a swap where either token in or token out is the LP token itself and that probably shouldn't be classified as NormalizedSwap

Last, and very minor detail, but I think V2 pool registrations should be moved to discovery.rs? From a quick look other classifiers follow this and only Balancer is incosistent.

https://github.com/SorellaLabs/brontes/blob/b0b17bcf1088cfeb209b38efec6e4baaac1a32f9/crates/brontes-classifier/src/classifiers/balancer/balancer_v2.rs#L190