💱Swap Options Tokens
A specialized AMM built for binary options trading.
Within the Divergence ecosystem, there are three types of participants:
- Market makers: Provide liquidity to earn fees, option premiums, and incentives.
- Hedgers: Purchase "Spear" or "Shield" and hold them until settlement or sell at target prices.
- Traders: Trade "Spear" and/or "Shield" to gain volatility risk exposure per different strategies.
"Spear" and "Shield" Tokens are fungible "virtual tokens" available for trading prior to expiration dates. A healthy and active trading market for option tokens not only promotes better price discovery but also ensures proper risk transfer and mitigation.
Similar to other AMM (Automatic Market Maker) systems, the Divergence marketplace also utilizes a bonding curve for option token pricing and allows users to buy and sell tokens as price takers:
Because of the pricing properties of binary instruments, theoretically, the price sum of "Spear" and “Shield” shall always equal 1 collateral. If in any case the equation is not met, arbitragers could step in and profit as below:
- When "Spear" and "Shield" < 1 Collateral
An arbitrager could purchase 1 "Spear" and 1"Shield" at a cost of less than 1 collateral. Because at the expiration date, one of "Spear" and "Shield‘’ will be worth 1 collateral while the other one will be worth 0, the arbitrageur could claim 1 collateral and earn a risk-free profit.
- When "Spear" and "Shield" > 1 Collateral
An arbitrageur could borrow 1 "Spear" and 1 "Shield" and sell both on the market for over 1 collateral instantly, and payback "Spear" and "Shield" at only 1 collateral.
Thus, instead of allowing arbitrageurs to drive prices towards equilibrium and LPs being potentially taken advantage of, we've built the equation into the pricing algorithm.
Divergence DEX builds a new bonding curve model based on the Uniswap constant product formula, 1) it fixes the price sum of "Spear“ and "Shield" constantly at 1 collateral, 2) and caps the maximum price for "Spear" or “Shield” at no more than 1 collateral.
👀This means when you buy Spear, your order will send the Spear price higher and push lower the Shield price. The same is true for the opposite. Market buying and selling decide on the price of these options tokens after a market is created.
The initial price for the "Spear" and "Shield" will be determined by the liquidity provider creating the pool. Technically, it requires the liquidity provider to be able to properly price the probabilities for the underlying assets. In markets where the LP is neutral about the price of the underlying, the "Spear" and "Shield" can be priced close to a 50 - 50 split or 0.5 collateral for each.
After the initiation of the market, Spear and Shield are exchanged with collateral in peer-to-pool swaps using the constant product formula:
Num(Spear) * Collateral(Spear) = K(Spear)
Num(Shield) * Collateral(Shield) = K(Shield)
When a transaction occurs on Spear or Shield, their respective K value is held constant, whereas the K value for the opposite side is adjusted, in accordance with the pricing structure:
Collateral(Spear)/Num(Spear) + Collateral(Shield)/Num(Shield) = 1
Large purchases relative to the size of the Spear or Shield reserve can cause price slippages. In the case where a disproportionately large amount of collateral is deposited into the contract to purchase Spear or Shield, the max(Price(Spear)) and max(Price(Shield)) are fixed at no more than 1 collateral. The decimal precision levels of max(Price(Spear)) and max(Price(Shield)) are set by a utility function that accounts for the decimal value of the collateral in use.
On Divergence V1, Spear and Shield can be bought and sold before a 30-minute trading halt period till options expiry. If you wish to get out of an options position before expiry, make sure you sell before 07:30 UTC. Please also take into consideration of the time required to complete this transaction on-chain.
There will be a trading cut-off every 30 minutes prior to expiration. During this period, each binary option pool will prepare for settlement and is not available for trading. This is also a protection mechanism to LPs against potentially being picked off near expiry.
1️⃣Seed liquidity pool
For example, in the initial round, 500 DAI is used to seed the pool, 500 Spear plus 500 Shield are minted with an initial price of 0.8 DAI and 0.2 DAI, respectively:
Num (Spear) = 500
Collateral (Spear) = 400
Num (Shield) = 500
Collateral (Shield) = 100
K (Spear) = 500*400 = 200,000
K (Shield) = 500*100 = 50,000
A buyer sends 20 DAI to the pool and plans to purchase Spear. To hold the K(Spear) constant, this increase in the amount of Collateral(Spear) requires the Num(Spear) to be reduced. The difference in Num(Spear) from its previous value is the amount of Spear to be received by the buyer.
Buyer sends：20 DAI
Collateral (Spear) = 400 + 20 = 420 DAI
Num (Spear) = 200,000 / 420 = 476.19
Buyer receives：500 - 476.19 = 23.81 Spear
Average purchase price: 20/23.81 = 0.8340 DAI
Price for Spear after the trade: 420/476.19 = 0.8820 DAI
3️⃣Update Shield side
Required by the binary options pricing structure, the price for Shield is correspondingly updated to 1-0.8820 = 0.1180 DAI, and the K(Shield) is adjusted in accordance with the pricing bonding curve:
Num (Shield) = 500
Collateral (Shield) = 500 * 0.1180 = 59 DAI
K (Shield) = 500 * 59 = 29,500
Collateral (Surplus) = 100 - 59 + 0 = 41 DAI
The previous buyer sends 20 Spear to the pool to sell Spear. To hold the K (Spear) constant, this increase in the amount of Num (Spear) requires the Collateral (Spear) to be reduced. The difference in Collateral (Spear) from its previous value is the DAI to be received by the seller.
Seller sends：20 Spear
Num (Spear) = 476.19 + 20 = 496.19
Collateral (Spear) = 200,000 / 496.19 = 403.07 DAI
Buyer receives：420 - 403.07 = 16.93 DAI
Average sell price: 16.93/20 = 0.8465 DAI
Price for Spear after the trade: 403.07/496.19 = 0.8123 DAI
5️⃣Update Shield side
Required by the binary options pricing structure, the price for Shield is correspondingly updated to 1-0.8123 = 0.1877 DAI, and the K(Shield) is adjusted in accordance with the pricing bonding curve:
Num (Shield) = 500
Collateral (Shield) = 500 * 0.1877 = 93.85 DAI
K (Shield) = 500 * 93.85 = 46,925
Collateral (Surplus) = 41 - (93.85 - 59) = 6.15 DAI
Spear or Shield, though traded in a similar way, they are not spot tokens, instead, they are contractual rights for a fixed payout at settlement. 3 major factors will influence their value:
1️⃣Current Price of the Underlying vs Strike Price
When you trade on Divergence, you’ll notice that there are many strike prices. These strike prices can be above and below the current price of your chosen underlying asset.
Spear and Shield with a strike price that is either right at (or very close to) the current price are called “at-the-money” options. These strikes become either more “in-the-money” or “out-of-money” as the price of the asset rises or falls. “In-the-money” options give you the right to buy or sell the asset at a better price than the current price. “Out-of-money” options are the opposite.
Theoretically, "in-the-money" options are more expensive, whereas “out-of-money” options are relatively cheaper, and "at-the-money" options are in the middle.
2️⃣Time to Expiration
The more time there is until expiration, the more time there is for an underlying asset to move in price and become “in-the-money” or “out-of-the-money”.
Because of this, time means more value for an option. For the same strike price, the Spear and Shield with a longer expiration are more valuable.
How likely is it that Spear or Shield end up “in-the-money” at expiration? This is the essential question to ask because trading options are like betting on probability.
In general, if you believe the current price is under-estimating the probability for Spear or Shield to expire in the money, it is a buying opportunity. If you believe the current price is over-estimating the probability for Spear or Shield to expire in the money, it is a selling opportunity.