How it works
Contango protocol synthesises expirable positions by using spot exchanges and borrowing and lending at a fixed rate, i.e. cash flows of expirable positions are replicated through fixed interest rate markets. The different steps are realized atomically, i.e. in one transaction each time a trader buys or sells an expirable. If for any reason the transaction fails then no position will be taken neither by the trader nor by the protocol.
Below are presented the steps to open an expirable position.
Steps to open a position on ETHDAI.
Below are presented the steps to close an expirable position.
Steps to close a position on ETHDAI.
In order to quote a price to a trader, Contango simulates what would happen in a real execution and enriches the answer with min/max values, also simulating how the position status would look like after execution. To achieve that Contango uses the "preview" functions provided by the underlying protocols.