CurveV1 Integration Handbook

CurveV1 Integration Handbook

Pessimistic.io

Check out: github.com/manifoldfinance/curve-integration

Originally posted at blog.pessimistic.io!


  • It’s vital to keep in mind that component addresses (SwapsMetapool factory, etc.) cannot be hardcoded; instead, you must always obtain them via an AddressProvider because they can rotate.
  • Registry.Swaps is a very gas-intensive component, in particular the functions get_best_rate and exchange_with_best_rate, therefore, you should not use them on-chain.
  • It is better to use Swaps.exchange in conjunction with Swaps.get_best_rate performed off-chain. 
  • You can’t expect all the lending pools (and the corresponding DepositZaps contracts) to implement the same API. For example, there are old and new DepositZaps whose methods may differ in return values or argument types.
  • Also, the old lending pools (and their DepositZaps) do not implement some of the methods that the newer pools have (e.g. remove_liquidity_one_coin). Also, try not to process Curve pools in a loop!
  • You also need to separately check API for each of the lending pools!
  • In both metapools and lending pools, swaps can be made in underlying tokens and wrapped versions (cTokens in a Compound pool). To swap underlying tokens use exchange_underlying!

Report Page