Skip to main content

Overview

Overview

Image above shows the flow of deposits and withdrawals to different rebalancers via Cargo Labs.

Starting from left to right, a user goes to cargo UI and deposits/withdraws from CLPToken via a Proxy. Both CLPToken and Proxy contracts are deployed by the CLPFactory, which has all existing CLPToken addresses registered in its state.

The proxy is implemented to allow adding new features to each CLPToken while keeping the state unaltered on upgrades (supply, user balances, etc).

Each CLPToken is connected to a CargoIntegration contract, i.e a contract that inherits from ICargoIntegration. This interface was created to abstract the differences between rebalancers.

Each CargoIntegration knows how to integrate with one rebalancer, being able to call mint/burn on any pools of that rebalancers pools. Existing CargoIntegrations at the moment of writing are the ones shown in the green rectangle in the figure, one integration contract for G-UNI (Arrakis) and one for Popsicle. CargoIntegration contracts use the CLPFactory to validate if a call is coming from a CLP (security protection, only calls from CLPTokens registered in the CLPFactory are allowed).

Finally, inside the blue rectangle on image above, are the rebalancers pools, there are usually fungible wrappers on top of a Uniswap V3 position. The LP tokens minted by the rebalancers stay in the possession of the CLPToken contracts, and we give back to the user CLP (Cargo LP) tokens which are fungible as well and minted/burned in a 1:1 fashion with the rebalancer LP token.