O3 Swap V2 (Interchange)

The Interchange for networks in Web 3.0.

Introduction

O3 Swap’s version 2, officially named ‘O3 Interchange’, will be a cross-chain DEX like no other in that it provides services aside from bridging the same token across different chains, but rather swaps heterogeneous or different digital assets too. In addition to aggregating DEXs on the source chain as V1 did, O3 Interchange will also aggregate DEXs on the destination chain. That means users will have more choices for their destination asset.

O3 Interchange was designed by a team dedicated to building an interoperable aggregator for Web 3.0 that provides a universal solution for cross-chain trading. The design closely aligns with the O3 community's feedback to push the boundaries of what's currently technologically possible. O3 Labs will continue to closely follow the existing cross-chain solutions on the marketplace and will continually improve the protocol according to the wishes of $O3's holders via the O3 DAO which should be refined and released sometime at the end of Q1 of 2022 or in Q2 of 2022.

The new cross-chain mechanisms of Swap and Bridge allow for simple one-time confirmation transactions. Additionally, they'll be able to support more EVM-compatible chains and tokens. Separately, the O3 Labs team will also provide a Gas Station to solve the gas fee demand on each chain. Through Interchange and with stops at our Gas Station, users can better access the Web 3.0 superhighway.

1. O3 Interchange Layer Structure

1.1 Application Layer

O3 Swap: O3 Swap V1 only supported aggregating DEXs on the source chain, but O3 Interchange, which is the updated and full version of V1, now can also aggregate DEXs on the destination chain via a cross-chain aggregator. This means that cross-chain swaps on V2 will have a more diverse set of token offerings to swap from and to.

O3 Bridge: Based on PTMCs (Pegged Token Management Contracts) and pToken AMM Pools, O3 Bridge will allow users to safely bridge their tokens from one chain to another through the use of a sleek user interface, instantly with one-time transaction confirmations.

O3 Gas Station: Considering there’s no better solution to meet the huge demand in gas fees in the current market, the O3 Gas Station is developed based on the O3 Swap to provide users with a simple interface and powerful function. Users no longer need to buy ETH/BNB/MATIC/etc... on centralized exchanges (CEXs) and withdraw to their decentralized wallets frequently. This costs valuable time and money. Instead, they can exchange these gas tokens directly within our gas station with little fuss.

O3 Wallet: The brand new O3 Wallet focuses on being a mobile cross-chain tool, where the main functions, like Swap and Gas Station, will be integrated into one app with our proprietary UI. Others like Hub and Vault will also be included in the O3 Wallet Mobile APP progressively, stage by stage.

1.2 Protocol Layer

O3 Aggregators: Aggregate the liquidity from DEXs on various chains, provide abundantly supported tokens to swap, and look for the most cost-efficient routings.

PTMCs (Pegged Token Management Contracts): A series of smart contracts on different chains manage pTokens’ burning on the source chain and minting on the destination chain. Each pToken on each chain has an independent PTMC. These PTMCs will be run by a relay network - Poly Network.

1.3 Liquidity Layer

DEXs: DEXs integrated by the O3 Aggregator help users swap between different assets. We can integrate multiple DEXs on different chains.

NPAPs (nativeToken & peggedToken AMM Pools): An AMM pool consists of an amount of Token and an amount of its pegged token(pToken). These pools are operated by the protocol automatically during cross-chain transactions, so there are no extra steps for users to interact with them. Only when it comes to adding liquidity or converting between Token and pToken via Barter for arbitrage opportunities will users need to take that step on their own.

By deploying pToken AMM pools, numerous hot and niche long-tail tokens from projects looking for exposure can be supported for cross-chain transactions on O3 Swap V2 easily and frequently.

1.4 Network Layer

All EVM networks can be supported in a short time by simply deploying PTMCs and integrating with O3 aggregators. Supported networks will be synchronized on Swap, Bridge, and the O3 Gas Station.

2. Cross-chain System

Steps

  1. Select the input asset from the source chain, and the output asset from the destination chain, and input the amount. Submit for inquiry.

  2. The O3 Aggregator then looks for the best price from DEXs, recommends the most cost-efficient route, and shows the quote. Confirm the transaction.

  3. Source chain: ETH will be swapped to USDC from a DEX, then bartered to pUSDC from the USDC/pUSDC pool. After being approved by PTMCs on the source chain, pUSDC will be burned.

  4. Destination chain: The same amount of pUSDC will be minted after approval by the PTMCs on the destination chain, then bartered to USDC from the USDC/pUSDC pool. This USDC amount can then be swapped to BNB from a DEX by the aggregator or directly transferred to the user's address on the destination chain.

3. Liquidity (Hub)

3.1 Liquidity Solution

All liquidity is deposited in the AMM pools consisting of Tokens and pTokens. For example, users can deposit either A, or pA, or A + pA. Depositing A + pA instead of only A or pA can reduce price impact and give you more LP tokens.

Liquidity Entry Chain

There is a critical mechanism named Liquidity Entry Chain, which is set to a Token that its pToken has to be pegged from. This mechanism ensures that each pToken on each chain comes from a real Token deposited on its Liquidity Entry Chain and has its value guaranteed rather than being minted from nowhere. A Liquidity Entry Chain can be the Ethereum mainnet, BNB Chain, or any other public chain.

Take A as an example, if its Liquidity Entry Chain is Ethereum mainnet, then users can Peg A within Ethereum mainnet or from it to other chains to get pA. On the contrary, users can also Unpeg pA back to Ethereum mainnet to redeem their A.

3.2 Convert

Users can convert between Token and pToken via 1:1 Peg or Barter.

Peg

Peg Token to pToken or Unpeg pToken to Token at a 1:1 ratio. Peg can happen within a token's Liquidity Entry Chain or from it to other chains. Unpeg can happen within a token's Liquidity Entry Chain or from other chains to it.

Barter

Barter between Token and pToken directly from the AMM pools within the same chains. There might be a slippage during bartering. The default slippage is set to 1%.

To be clear, you may earn or lose a small percentage of your exchange when bartering between Tokens and pTokens.

3.3 Arbitrage

The initial Token:pToken ratio in an AMM pool is 1:1, but it’ll be fluctuating as barters happen. So sometimes users may barter more Tokens or pTokens, and that's where users can arbitrage by Bartering. More importantly, these arbitrages are also constantly balancing that ratio and the liquidity among different pools, which makes cross-chain trading more lossless.

Take A as an example, its Liquidity Entry Chain is the Ethereum mainnet and the pool has more A than pA. At some point in the pool on the BNB Chain, the amount of A is getting lower than pA's, then users can Barter m*A for n*pA (n>m), and Unpeg n*pA to Ethereum mainnet to get n*A. The profit of this arbitrage ≈ (n-m) * A, and both the pools got more balanced at the same time.

4. Risks & Disclaimer

Caution should be exercised when interacting with any smart contract or dApp. While risks are attempted to be mitigated through testing, audits, and bug bounties, there is always a risk of vulnerabilities in smart contract code.

This doc is for general information based on O3 Swap V2 (Interchange)’s development. It should not be considered professional financial investment advice and used in the evaluation of making any investment decision.

New updates and changes might not be updated immediately within this doc. The latest product updates and information are subject to the official Twitter announcement.

Last updated