BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Mark Price Liquidation #130

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

Right now last-price triggers liquidations. This is a problem because anyone who can punch through the orderbooks can trigger a high probability liquidation cascade. Huge fragility point.

A simple mark pricing we can adopt is a 2 or 3 block TWAP for Bitcoin and an 8 block TWAP for Litecoin to trigger liquidations. Combining this with a decent slope of 20% liquidations, it can work pretty well most of the time.

The danger is that in extreme situations it renders the system more likely to liquidate people in negative territory, there's still a big arbitrage opportunity, but in the case of TOTAL/ALL that's only true once we have a borrow feature where people can be spot-short against BTC or LTC. So, in reality ALL/LTC is going to be a volatile pair, it might be worth making the parameters for funding, liquidation increments and so forth softer for ALL/LTC and TOTAL/BTC than for BTC/USD and LTC/USD.

Eg. 10% increments every time you run under the maintenance margin for most contracts, 20% increments for ALL/LTC and TOTAL/BTC contracts. Since you're taking a super volatile low-cap asset and pricing it in a high volatility large-cap asset, the total volatility in the pairs should be lower than the US equivalent.

patrickdugan commented 4 years ago

For Oracles TWAP of last N blocks of Oracle prints and VWAP of the Contracts, or if this is not easily feasible just the TWAP for N blocks. Since we can add circuit-breaker logic to Oracles to limit damage in the event of a key-compromise/hijacking, a long N interval is not necessary, 2-3 blocks will serve this purpose.

For Native VWAP of relevant token pairs over 2-3 blocks will be applied as Mark Price.

santos177 commented 4 years ago

working on mark-price branch