Why launching a Spot AMM?
Answering where this fits into Kriya's derivatives-first orderbook based DEX infra
As most of you already know, this week, we’re launching an AMM-based spot exchange on the Sui Devnet. It seems counter-intuitive to most, given we ourselves believe that an on-chain orderbook is a better method for price discovery and our broader vision is to build derivatives products.
Spoiler alert! our beliefs and vision are still the same
Then why the hell a spot AMM?
Some Context
Like many things in the world, the choice of architecture isn’t as binary. AMMs are good at some things, Orderbooks are better at some.
Briefly put:
(Sourced from an article I wrote a while ago)
(Some credit to smart folks over at 0x for this)
Given these tradeoffs, AMMs tend to be better at:
Democratizing the ability to market make (via LP tokens)
Exchange of highly correlated trading pairs
Stablecoins of different issuers
Different tokenized versions (fractional, fungible) of the same digital asset
Overcollateralized stablecoin lending/borrowing
Kriya System Design
Let’s try to divide the Kriya DEX architecture into these mutually exclusive components:
Trade Matching Engine
Margin Engine
Computation
Liquidation
UX Modules
Funds Deposit
Collateral Management
LP staking
The trade matching engine is on-chain logic of matching open orders of parties with complementary requirements. This will be an orderbook.
The margin engine is responsible for calculating the amount of capital required to open and maintain a trade position. Once the maintenance margin is breached, the margin engine is also responsible for initiating liquidation (ie closing the position by placing a trade on the matching engine)
Additionally, there are some UX-related modules to make the trading seamless.
AMM: The glue that binds it all
Now if one looks at the benefits of AMMs and the pain points that users might face in each of our modules, many use cases of an AMM appear in the Kriya architecture.
Eliminating trivial Barriers in Funds Deposit: What if you have USDT in your Sui wallet but only the FTT/USDC perp is listed on Kriya? We’ll make the deposit seamless by taking it through our stablecoin AMM pool
Access to Market Making: Retail users can’t market make on orderbooks. Kriya will run its own market-making bots as well. We’ll tokenize that bot and allow users to LP into it to earn yield. We’ll leverage this AMM architecture to price these LP positions.
Fair Liquidation: In case of blackswan events where rapid liquidations occur, the orderbook dries up and the insurance fund has to be utilized. This AMM will be the price discovery method for closing positions (ensuring a fairer distribution of socialized loss, not first come first serve as an orderbook might)
Price Parity: Later, this Spot AMM DEX will only be the major source of spot liquidity backing physically settled perps and options on Kriya DEX. Ensuring the protocol’s control over price parity between spot and derivatives
Given that
Sui-Move is new itself and vanilla AMM math-wise isn’t very complicated.
The AMM is an important component of DEX the infra that will play a vital role in aggregating liquidity across all orderbooks on Kriya
We decided to build our own AMM, rather than outsourcing this module to a partner. And seeing the support we got on twitter, we thought of launching the spot DEX early while we build the perp DEX. We see it as an opportunity to get feedback on our product thinking and get the community involved at an early stage.
We’ll be launching an incentivized testing program soon.
Subscribe for more updates from our team. Please comment your queries here, looking forward to some friendly banter on AMM vs CLOB 😁
The test token did not arrive in my Sui wallet.
However, he wrote: "successfully minted 500 coins". With greetings, Robert
Great Project