Chainflip Protocol: TheCross-Chain Liquidity Network

0xseeder
4 min readJul 12, 2023

--

Chainflip Protocol is a decentralized cross-chain protocol that enables trustless asset swaps between different blockchains. It aims to bridge the gap between various blockchain networks, allowing users to easily transfer assets from one chain to another without relying on centralized exchanges.

The Chainflip protocol utilizes an innovative mechanism known as “cryptographic bonds” to establish trust between participants. These bonds act as collateral, ensuring that both parties involved in an asset swap fulfill their obligations. Chainflip also utilizes atomic swaps, a technology that enables the direct exchange of different cryptocurrencies without the need for intermediaries.

By providing a decentralized and secure solution, Chainflip aims to improve interoperability between blockchains, enhance liquidity, and provide users with greater flexibility in managing their assets.

Tokenomics

The Chainflip protocol has its native utility token called FLIP. FLIP tokens play a crucial role within the Chainflip ecosystem. Here are some key aspects of Chainflip’s tokenomics:

  1. Governance: FLIP token holders have the ability to participate in the protocol’s decision-making process through governance voting. They can vote on proposals related to network upgrades, fee adjustments, and other changes.
  2. Transaction Fees: FLIP tokens are used to pay for transaction fees on the Chainflip protocol. These fees help incentivize validators and maintain the security and stability of the network.
  3. Staking: FLIP tokens can be staked by users to participate in the protocol’s consensus mechanism and become validators. Validators are responsible for validating transactions and ensuring the smooth functioning of the network. In return, they receive rewards for their services.
  4. Bonding: FLIP tokens are used as collateral when participants engage in asset swaps on the Chainflip protocol. This helps ensure the trustless nature of the swaps and protects against potential fraudulent activity.
  5. Liquidity Mining: Chainflip may also implement liquidity mining programs, where users can earn additional FLIP tokens by providing liquidity to pools or participating in specific activities within the protocol.

It’s important to note that specific details of the tokenomics are subject to change as the protocol evolves and new features are introduced.

JIT AMM Core Features

  • The JIT AMM is implemented directly on the State Chain in the ‘pools’ pallet. Written in Rust, it’s a substrate rewrite of the Uniswap v3 design on Ethereum with several changes and additions running in a custom execution envrinment.
  • Range orders work as they normally do in Uniswap v3. Liqudity remains deployed until the LP submits an extrinsic which removes it from the pool and returns the remaining funds and fees to their liquidity account balance.
  • Limit orders are layered on top of the existing range order system. Limit orders are fully consumed by swaps, and the resulting funds are returned directly to the LP’s balance.
  • Swaps will take all of the liquidity from both limit and range orders in each price ‘tick’ before moving on to the next. Limit orders are consumed before range orders in each price tick.
  • As soon as a swap deposit is Witnessed, the event which triggers the swap is automatically executed at the end of each block.
  • Incoming swaps are bundled per direction and per pool. If multiple buy or sell swaps appear in a block, the pools pallet will treat those buys or sells as a single larger buy or sell swap to be executed in one step. This is to prevent frontrunning and to make JIT quoting simpler to calculate for LPs.
  • Every block, swaps are executed per pool in a pre-determined order. All sells for each pool will be processed (BTC to USD, ETH to USD, SOL to USD, and so on) followed by all buys in each pool (USD to BTC, USD to ETH, USD to SOL, and so on). This ensures that multi-pool routes can always be completed in one block for fast settlement of trades.
  • Limit orders are maker-only, meaning they can never be executed against each other, as would be the case in a traditional matching engine. This means it is possible to have a buy order at a price higher than the lowest sell order, and vice versa. This eliminates some potential MEV and simple frontrunning possibilities.

Conclusion

The Chainflip AMM protocol is an implementation of a potentially new class of AMM called a “Just In Time AMM” (JIT AMM), which is a decentralised method of getting users close to market prices at all times in spite of the unique challenges faced by a multichain AMM like Chainflip. It is also a way to give free trade flow to market makers who can integrate the AMM into their existing flow sources.

Links and socials:

Official Website: https://chainflip.io/
Discord: https://discord.gg/chainflip-community
Twitter: https://twitter.com/Chainflip
Telegram: https://t.me/chainflip_io_chat

About the Author:

ENS: 0xseeder.eth
Twitter: https://twitter.com/rapgmac
Link3: https://link3.to/0xseeder

--

--