Price Oracle
The whole model stands on the mark price. This is the most sensitive part of the protocol.
The problem
The spot price of a small token can be moved with little capital. A manipulated price would let an attacker open positions cheaply, or push honest traders into liquidation. An oracle for emerging tokens has to make that expensive.
Current design
The prototype uses signed prices.
Read
A price service reads the token's price from its most liquid pool and refuses tokens whose liquidity is below a minimum.
Sign
The service signs the price together with the token, a timestamp, the chain and the contract it is meant for.
Submit
The trader's transaction submits the signed price just before acting. The contract accepts it only if the signature is valid and the price is recent.
A signature made for one chain or contract cannot be reused on another.