Automated Market Maker (AMM)

CompliFi AMM high-level architecture closely resembles that of typical non-derivative AMMs, such as Uniswap. It offers users two ways to interact with it - either to swap assets against its pool or to become a liquidity provider that collects trading fees.

The AMM's key innovations are focused on handling extremely volatile assets, and those generated by the CompliFi issuance protocol. In particular, the AMM reprices derivatives prior to trading in every block, dramatically decreasing the scope for impermanent losses. Just as importantly, the AMM algorithmically manages LP risk by preventing excessive market exposure of its pool. This is done by enforcing fixed exposure limits and through a dynamic fee mechanism that links a given transaction's fee to the change in pool risk that it causes.

Transaction Structure

All AMM pools contain two assets - long and short position tokens in a given derivative - and offer terms of trade between them. The issuance protocol is, in a sense, also a market in its own right. It offers users to mint and redeem derivatives - effectively to swap between a collateral asset (e.g. USDC) and a portfolio containing equal amounts of long and short position tokens. CompliFi app connects these two markets through atomical transactions, allowing users to seamlessly trade between a collateral asset and any individual derivative.

There are numerous useful ways to combine issuance and trading. Here are some of the key composite transactions that the CompliFi app employs, based on the ETx5 derivative as an example:

Swap from USDC to ETHx5 Up:

  1. Use USDC to mint a symmetric ETHx5 Up and Down portfolio (issuance protocol)

  2. Swap ETHx5 Down for ETHx5 Up (AMM)

  3. Return combined amounts of ETHx5 Up from steps (1) and (2) to user

Swap from ETHx5 Up to USDC:

  1. Swap a portion of ETHx5 balance to create a symmetric Up-Down portfolio (AMM)

  2. Redeem symmetric Up-Down portfolio for USDC (issuance protocol)

Add liquidity to ETHx5 pool:

  1. Use USDC to mint a symmetric ETHx5 Up and Down portfolio (issuance protocol)

  2. Perform a swap such that the resulting Up-Down proportion in the portfolio is the same as in the pool (AMM)

  3. Add liquidity to the pool in return for LP tokens (AMM)