Introducing Pika Exchange Feature: Bot-less Liquidation
What is Pika Exchange?
Pika Protocol consists of Pika Stablecoin and Pika Exchange. Pika Exchange is an inverse perpetual swap exchange that allows you to take positions of over 10x leverage. Pika adopts the virtual AMM model where minimum liquidity is needed to bootstrap the trading. Also, instead of keeping the leverage positions inside the exchange, the positions are tokenized into NFTs via ERC1155 standards, which allows traders to transfer or use tokens in the whole DeFi system.
In this and next few posts, we’d like to share a few other important features of Pika Exchange to make sure you understand it better. This post will focus on how liquidation works for Pika Exchange.
The Liquidation Problem
Liquidations are normally triggered by external bots for most decentralized derivatives exchanges, where bots consistently check each user’s margin position for liquidation opportunities. The liquidation is often triggered on a per user basis when the margin falls below a certain requirement. Bots are normally rewarded by part of the liquidated user’s balance as incentive.
During the big price movement, this type of liquidation mechanism often has problems. Since bots need to liquidate each user one by one, it is often the case that bots are not fast enough to take care of all the positions that need to be liquidated, resulting in loss of insurance funds for the protocol.
There are many examples in DeFi that shows this liquidation model has issues. On 03/12/2020, many DeFi protocols suffers from insolvency caused by huge price drop. If the same thing happens again right now, that will result in a even bigger chain reaction.
In fact, in a recent ETH crash last month, an exchange’s insurance fund suffers from a big loss because there are not enough bots to do the liquidation.
How Liquidation Works for Pika Exchange
Pika Exchange adopts the bot-less liquidation mechanism, where each trade execution automatically checks if there are positions to liquidate. Also, instead of checking each user’s account, Pika Exchange simply invalidates a set of strike prices that is to be liquidated. Each leverage token of Pika Exchange has a strike price, at which the value of the position is equal to 0. The leveraged tokens with invalidated strike prices can no longer be traded back to the protocol, meaning the value of which is 0.
So how is the liquidation price determined? In any exchange that supports leverage positions, there is always a price buffer to liquidate the positions before the collateral is depleted, which is used to protect exchanges from insolvency. Pika Exchange will have a buffer value of 93% for liquidation at its launch.
Long position example:
- A user opens a 5x long position of ETH/USD at price $1000.
- Since Pika is an inverse perpetual exchange, this position is interpreted by protocol as 5x short position of USD/ETH at price 1/1000.
- The strike price of the inverse short position: 1/1000 –1/1000 / leverage = 0.0008.
- The strike price of the long position: 1 / 0.0008 = $1250.
- The liquidation price of the inverse short position: 0.0008/0.93 = 0.00086.
- The liquidation price of the long position 1/0.00086 = $1163.
Short position example:
- A user opens a 5x short position of ETH/USD at price $1000.
- Since Pika is an inverse perpetual exchange, this position is interpreted by protocol as 5x long position of USD/ETH at price 1/1000.
- The strike price of the inverse long position: 1/1000 + 1/1000 / leverage = 0.0012.
- The strike price of the short position: 1 / 0.0012 = $833.
- The liquidation price of the inverse long position: 0.0012 * 0.93 = 0.001116.
- The liquidation price of the short position 1/0.001116 = $896.
In short, relying on external bots for liquidation on a per user basis could be risky during large price movement. Pika Exchange removes the bot dependency and liquidate much faster by invalidating price ranges. We believe this is a much better liquidation practice for DeFi space, which protects protocols from insolvency, resulting in protection for all the users.
Note: credits are given to Alpha Finance for inspiration.