I’m proposing an update to the Curve adapter:
The previous adapter relied on a now deprecated subgraph with the following limitations:
- Relied on a single registry for its list of pools, therefore not tracking many pools
- Did not track v2 pools for volatile assets
- Approximated fees by multiplying swap volume with fees, but did not take into consideration fees charged on liquidity additions and removal
- Did not track newer deployments on chains like Optimism and xDai
- Excluded pools with rebasing tokens and lending tokens, which are some of the protocol’s largest source of fess
This adapter uses a newer version of the Curve subgraph (https://github.com/curvefi/volume-subgraphs) which tracks all of the protocol pools across all the chains where Curve is deployed and which are supported by the Graph.
The subgraph uses the growth rate of the pool’s virtual price (i.e. revenue to LPs from fees) for v1 (stable swap) pools and the growth rate of ((xcp_profit + xcp_profit_a) / 1e18 - 1) for v2 (crypto swap) pools. In both cases it deducts from this the profits accrued from rebases and interest for lending pools so as to only account for revenue generated from trading fees.
Note that the fees are an estimate of the fees generated by the pool and therefore may differ, on a day to day basis, from the amount of fees actually claimed by the protocol (as claims on some pools may only happen once a week for instance). On the whole, however, the two values (estimated and claimed) converge toward the same amount of total accumulated fees.