Old Matrixswap Whitepaper
This is the old Matrixswap whitepaper, for reference.
Matrixswap is a decentralized virtual-AMM-based perpetual swaps trading protocol deployed on the Polkadot, Cardano and Polygon [Ethereum Layer 2] blockchain. Unlike traditional AMMs, users can long or short any assets' perpetual contracts with up to 10x leverage. While most decentralized derivative trading platforms face liquidity concerns, the Matrixswap vAMM offers infinite on-chain liquidity.
Matrixswap also offers a DEX aggregator that features multi-token swaps, allowing users to batch several tokens under one transaction.
Matrixswap aims to be a fully community-owned and governed Defi protocol in the long run.
What makes Matrixswap attractive and unique as a trading platform are the below key features,
- 1.While most decentralized derivative trading platforms face liquidity concerns, Matrixswap vAMM offers trades with up to 10x leverage with infinite on-chain liquidity,
- 2.100% on-chain and 100% non-custodial trading,
- 3.By interacting with Matrixswap's vAMM smart contracts, users can gain exposure to derivatives for any assets on the market,
- 4.Matrixswap aims to deploy on multiple blockchains: Polygon, Polkadot and Cardano. By leveraging cross-chain bridges, Matrixswap aims to unlock liquidity from different blockchain networks thereby empowering traders with maximum capital efficiency,
- 5.Matrixswap provides users an Emergency Nuke Button (DEX aggregator) that allows users to convert multiple (or all) tokens into one single asset under one transaction. This is made possible by the nature of the underlying blockchain (low fees, high throughput) and shared liquidity amongst DEXs,
- 6.The Matrixswap platform utility and governance token MATRIX is built with a strong token economic design. 50% of the platform trading fees will be allocated towards token swapback order to offset rewards token emission.
Matrixswap's main component is "THE MATRIX" which acts as the core and interacts with other components in the eco-system.
Perpetual Swaps are cryptocurrency derivatives that enable traders to speculate on the valuation of specific underlying assets. Perpetual contracts have two key features:
(i) There are no expiry dates on contracts. Contracts are effective until traders close their positions.
(ii) The underlying asset itself is never traded, therefore custody issues are mitigated.- The swap price closely tracks the price of the underlying asset by utilizing funding rates. A mechanism that ensures the convergence of the perpetual MarkPrice to the IndexPrice.
In general, the main difference of perpetual contract trading on Matrixswap is that all assets and trades are stored and executed on-chain. Unlike Binance, Bitmex perp contracts, Matrixswap doesn't rely on counterparties and there is no risk of centralized off-chain servers. With Matrixswap, users have full custody of their own funds.
Matrixswap's vAMM (pioneered by perp.fi) uses the same x*y=k constant product formula as most AMMs do. However, as the word virtual suggests, The vAMM itself does not contain an actual asset pool (k). Instead, the actual assets (traders' collateral) are kept in a smart contract vault that oversees all of the vAMM's collateral. In other words, Matrixswap uses vAMMs as price discovery mechanisms, not for spot trading. This allows Martixswap to operate with infinite liquidity with zero impermanent loss for stakeholders, as liquidity providers aren’t required.
The vAMM acts as an independent settlement market, all profits and losses are directly settled in a collateral vault.
Let's first look at how a position is opened:
- 1.Trader Neo sends 100 USDC to the Clearing House on Matrixswap and declares to use that fund as the initial margin to open a 3x leveraged long position.
- 2.Clearing House then deposits the 100 USDC into the Collateral Vault. Matrixswap subsequently updates the virtual token amount in vAMM based on the initial margin value, long or short position, and leverage amount.
Now let's look at how Neo can profit from his position:
Let's assume we have 1,000 vDOT and 10,000 vUSDC in the vAMM as its initial state.
Step 1: Neo uses 100 USDC as the margin to open a 3x leveraged long position, the amount of USDC in vAMMs changes to 10,300 (10,000+100*3), the amount of DOT changes to 970.87 (1,000*10,000/10,300), calculated by x*y=k , Neo is now credited with 29.13 DOT (1,000-970.87).
Step 2: Following Neo, Trader Morpheus uses 100 USDC to open a long position with 5x leverage. vAMM credits him 44.95 DOT (970.87-925.92).
Step 3: Neo sees that the price has gone up, decides to close his position, and realizes a profit of 29.35 USDC
Step 4: Seeing the price dropped, Morpheus went to close his position to prevent further damage, only to find out that he lost -29.35 USDC
While traditional AMMs k-value is the equal value of asset x*y in a given liquidity pool, vAMM's k-value is a number set by the protocol's architect to ensure optimal trading experience in The Matrix. At the project's early stage, the Matrixswap core contributors will act as the protocol's architect for setting k-value for each vAMMs. A few factors are taken into consideration in the process of setting k-value:
- 1.Underlying asset trading volume
- 2.Underlying asset pool value
- 3.Underlying asset index price volatility
- 4.Platform open interest
When the margin ratio of the trader becomes lower than the maintenance margin ratio (now set at 6.25%, subject to changes from ZionDAO), liquidation will be triggered.
Liquidations are triggered by Agents. As a reward for providing this service, they earn 1.25% of the remaining notional. The remaining margin will be deposited into the Insurance Fund.
To ensure perpetual contracts price inside The Matrix converges with index price in the real world, Matrixswap introduces an hourly funding rate. Whether the perpetual is trading at a premium (longs pay shorts) or at a discount (shorts pay longs). The funding payment is calculated by position size * (TWAP of perpetual - TWAP of Index)/24.
Matrixswap utilizes the same funding rate formula as FTX does, as shown below:
All TWAP data will be sourced from the Oracle.
A trading fee of 0.1% is charged when opening and closing positions in Matrixswap. It is important to note that the fees are not collected as revenue for the protocol, but as insurance backup for the system. 50% of the trading fees will be deposited into the Insurance Fund, a vault that ensures the stability of the protocol. In the event of unexpected losses from the liquidation process, the Insurance Fund will absorb the losses. The other 50% of the trading fees will be allocated towards the following events:
- 1.Swapback of platform token MATRIX for single token stakers
- 2.Lottery prizes
- 3.Trading competition prizes
Matrixswap's main component is "THE MATRIX" which acts as the core of the entire eco-system and interacts with the following 4 major components,
(i) Construct - interoperable cross-chain bridges,
(ii) Nebuchadnezzar - a DEX aggregator,
(iii) Oracle - a price feed data source,
(iv) ZionDAO - a decentralized governance mechanism.
In order for users to bridge liquidity from one chain to another, Matrixswap relies on partnered projects to offer secured and reliable cross-chain bridges.
Nebuchadnezzar is a DEX aggregator that connects with high-volume AMMs operating on the Polkadot, Polygon and Cardano networks. Nebuchadnezzar aims to provide traders the ability to swap multiple tokens into one single asset under one transaction in the event of an emergency. This is made possible by the nature of the underlying blockchains (low fees, high throughput) and shared liquidity amongst AMMs.
Nebuchadnezzar DEX aggregator
Matrixswap Market Oracle nodes receive information on the time-weighted average price (TWAP) of assets. Upon mainnet launch, Matrixswap oracle providers will provide TWAP information for all assets (major coins & shit coins) by utilizing our own nodes that interact with DEXs' API for market pairs' real-time data. As a starting point, we will utilize Kylin data oracle as our real-time index price feed for stable coins and major assets, as they provide the oracle solutions in the Polkadot/ Substrate framework. Each provider will be the data supplier of each asset. For example, provider k is the sole provider for asset k.
In the near future, Matrixswap plans to incorporate Chainlink oracle price feeds in addition to Kylin, as it increases security and network validations.
Matrixswap Market Oracle Solution
MATRIX token is the governance token of Matrixswap and it possesses the right to propose changes to the protocol, voting rights to proposals, and overall project direction through ZionDAO.
Considering Matrixswap would still be at its early stage upon Mainnet launch, the Matrixswap core contributors will spearhead the decision-making and execution of the project in order to ensure long-term growth. As the platform matures and we have a robust on-chain governance mechanism in place, the Matrixswap core contributers will let the community govern decisions and executions. During this period, we will still hear the community's voice and factor in their interest for every step we take. Community's feedback will be obtained from Telegram, Discord and also through external voting platforms as and when needed.
ZionDAO will be launched approximately 6 - 9 months after the Mainnet launch.
At this stage, we expect the ZionDAO community council will be able to propose, vote, and implement upgrades and changes to Matrixswap by staking MATRIX. The major implementation and the deployment of the smart contracts will still be done by the Matrixswap core contributers.
The scope of governance would be extended to include but not limited to:
- Market Listings,
- Token Bridge Asset Whitelist,
- vAMM Fee Structure,
- Nebuchadnezzar DEX Whitelist,
- Trading Fees,
- Platform Usage Required Token Amount,
- Oracle Providers.