OptiFi Market Maker (OMM) utilizes oracle to retrieve key market information such as spot prices and implied volatilities. However, to manage orderbook market risk, it also utilizes the widely popular constant product formula combined with Trade Capacity metrics to build neatly spaced bids and ask orders on each orderbook relative to market values implied by spot prices and implied volatilities.
Constant Product Formula
A Constant Product Formula, popularized by Uniswap:
Which can be expressed in terms of token X balance, token Y balance and their “constant” balance K. In spot exchanges, users submit balances X and Y in two different currencies and OMM maintains trading price to keep the total balance of currencies the same.
Using the above formula, we can find price points at which OMM is willing to buy or sell Bitcoin.
For example, the current BTCUSDC spot price is $40,000/BTC and total Liquidity is 10 BTCUSDC. Furthermore, let's assume that the Trade Capacity is 2.5 BTC (25% of the pool), i.e. there are no outstanding positions:
The above quantities, can then be converted into incremental, smaller buy and sell quantities at a different price level looking just like an orderbook:
One point to note – if someone was to trade all bids or asks, the average price they would achieve for buying or selling all 2.5 BTC would be equivalent to exactly $53,333 and $32,000 respectively – just as implied by the constant product formula.
OMM utilizes this approach to build its delta BID and ASK orderbook quantities and quote price levels. The quote prices are then used to price options contracts together with oracle implied volatilities to submit bid/ask orders to options orderbooks. Furthermore, quote prices will be used to provide liquidity in the Perpetual Future orderbook.