project screenshot 1
project screenshot 2
project screenshot 3
project screenshot 4
project screenshot 5
project screenshot 6

Liquorice

A MEV-aware trading platform with a "brokerage" type of execution. Instead of placing limit orders, makers give "commitment" to execute the trade at a certain price plus their markup. Auction based execution system helps makers filter out toxic flow from uneducated flow

Liquorice

Created At

Scaling Ethereum 2023

Project Description

Currently onchain trading space is dominated by AMM (uniswap), RFQ/limit order (1inch) protocols and some occasional order book exchanges which often use offchain mechanisms mixed with onchain (dydx).

All protocols have their pros and cons but most suffer from similar issues: a) MEV (Miner Extractable Value) and toxic flow which apply shadow tax to traders and make life of makers more complicated (sandwich attacks, frontrunning etc) b) Being a market maker is hard and it is especially hard in DEFI. In AMM impermanent loss eats most of makers' profit. Fewer market makers means less liquidity and less liquidity means lower trading activity.

Liquorice is trying to address these problems in accordance with the following principles:

-Auction system is used to give makers a very efficient method to fight off toxic flow. Orders are first matched and sent to an auction where makers can decide what orders to execute and what not

-Separation of LPs from market makers. Proffesional players price the market and carry market risk. Liquidity providers supply them with liquidity via undercollateralized loans (similar to AAVE logic)

-Onchain mechanims. Even in case oracles are used, swap of coins occurs in accordance with onchain data where participants first look at onchain data and then confirm the transaction.

We plan to continue developing liquorice after Hackaton. For hackaton we gave it a first try and implemented the following logic:

  1. First market maker can place a "commitment" into a protocol such as "I am ready to sell 10 Matic against USDC for whatever price oracle will show in next block plus 5 basis points". Details of his commitment are recorded and displayd in the price ladder for everyone to see.

  2. Then taker comes to the protocol and says "I want to buy 4 MATIC at oracle price plus markup and I specify max affordable markup to be 7 basis points". If taker specified max affordable markup to be 3 basis points then protocol would reject the order as their is no matching maker order lower than 5 basis ppoints of markup.

  3. Taker and maker orders are matched and they are first placed into "auction" where makers has two seconds to cancel an order if he doesn't like the price. With liquorice we target specifically makers who, example, have VIP9 on binance or other centralized exchange. With liquourice they can use their edge to price DEFI users according to onchain protocol while makers can use their edge on CEXs to hedge their trades in guaranteed profit (they just need to apply enough of markup on liquorice). But makers are not safe from toxic flow such as latency attack and this is where we need auction system to help them price users on liquorice safely. Example, maker can receive auction data and compare it to current market price on binace where he has VIP9. If maker sees that binance price is far from auction price, maker cancels an order and thus doesn't lose money. In ideal world, other makers with appropriate markup level should have an opportunity to fill taker order after initial maker canceled but in current implementation we do not have it yet.

  4. After two seconds passed, coins are swapped between addresses of taker and maker in accordance with auction data

Our goal is to make sure that liquorice can provide makers with a super convenient and cheap mechanism to price the market which shall attract onchain oriented traders thanks to vast available liquidity and tight spreads without counterparty risk for themselves.

How it's Made

We currently deployed contract on Polygon Mumbai testnet. Backend is a single solidity smart contract "liquorice" which can be found in our attached git (folder src). We use chainlink oracle to feed the price of MATIC/USD into smart contract. Ideally Oracle should be customed for particular makers on a specific exchange such as binance MATIC/USDC spot feed but it is not for the demo.

We implemented a basic trading gui via react to showcase the protocol which can be found in our git as well.

Please check our git where we provided schematic representation of how protocol works.

background image mobile

Join the mailing list

Get the latest news and updates