# Triangular Swaps

At Divergence v1, one swaps collateral tokens for calls or puts. A virtual curve is used to triangulate the relative value of calls, puts and collaterals as follows:

A Divergence v1 pool handles three assets: a call, a put, and a collateral token. **Using the virtual curve, one swaps an amount of options premiums for a certain payout expected at settlement**. The buyer obtains the right to receive this expected payout, represented by the options tokens.

The virtual curve tracks the squared root of the cross rate between call and put options. This cross rate is the relative value of puts quoted by calls. The put-call parity is used to compute the value of calls and puts quoted by collateral.

The current price of a call is 0.40 collateral. Per put-call parity, the price of a put must be 1 - 0.40 = 0.60 collateral. Therefore, the current sqrtPrice tracked by the virtual curve is sqrt(put price/call price) = sqrt(0.60/0.40).

When one swaps collaterals for calls, the call price rises. The put price must fall because of put-call parity. So, the cross rate of calls and puts drops. Conversely, the put price increases because of a put purchase. The call price declines accordingly, raising the cross rate.

The price of a call is 0.40 collateral, and the current sqrtPrice is sqrt(0.60/0.40). A buyer swaps for calls, and the call price rises to 0.45 collateral. Per put-call parity, the new put price must be 1-0.45 = 0.55 collateral. The sqrtPrice declines to sqrt(0.55/0.45).

The price of a put is 0.60 collateral, and the current sqrtPrice is sqrt(0.60/0.40). A buyer swaps for puts, and the put price rises to 0.70 collateral. Per put-call parity, the new call price must be 1-0.70 = 0.30 collateral. The sqrtPrice rises to sqrt(0.70/0.30).

**One can receive the same amount of call or put tokens when a liquidity range is crossed entirely from above, or below.** This liquidity range has to observe put-call parity:

Premiums for Calls + Premiums for Puts = Payoff for Calls (Puts)

It must be noted that premiums for calls (puts) can serve as *expected returns* for puts (calls) sold in the same liquidity range. If this put-call parity** **is broken, it generates triangular arbitrage within a pool. So, the pool has to triangulate the transactions as such:

1️ receives a collateral value of calls (or puts) as options premium

2️ combines with a collateral value of puts (or calls) and reserves the payout for settlement

3️ mints call (or put) tokens for the buyer

This triangulation process ensures that, for the same liquidity range**, a long call and a long put can settle each other, regardless of the outcome**.

Alice buys a call and Bob buys a put. At settlement, one pockets 1 DAI, retrieving paid premium plus return. And the other loses the premium. If the underlying price settles below the strike price, Alice’s premium ends up with Bob. Otherwise, Bob’s premium goes to Alice.

Last updated