Examples

Approach

We have 4 pools:

  • A liquidity pool (L pool) with a pool of DAI and a pool of ETH.

The L pool is the pool used by the exchange to borrow assets for the hedging.

  • An exchange pool (E pool) with a pool of DAI and a pool of ETH The E pool is the pool kept by the exchange to remain solvent at any time and this is where the hedges are stored.

Assumptions

  • The spot price of ETHDAI is equal to 100

  • There is no leverage, i.e. all positions are fully funded

  • There are no transaction fees

  • We consider a yearly futures

  • The borrowing rate is determined using the Aave formulas which depend on the utilisation ratio of each pool

  • The futures prices are derived using the borrowing rates of each asset.

Buy example

Pricing

The initial pool is as below:

A user wants to buy 1 futures, hence the new liquidity pool would be

The price to buy 1 futures is P=100*exp(1*0.013)=101.31

Execution

  • Trader buys 1 ETH at 101.31 DAI on the futures market

  • Protocol borrows 100 DAI at 1.3% from the B pool and hence will owe 100*exp(0.013)=101.31 DAI in 1 year

  • Protocol buys 1 ETH with the borrowed DAI and put them in the E pool.

Sell example

Pricing

The initial pool is as below:

A user wants to sell 1 futures, hence the new liquidity pool would be

The price to sell 1 futures is P=100*exp(-1*0.0135)=98.66

Execution

  • Trader sells 1 Futures for 98.66 DAI on the futures market

  • Protocol borrows 0.9866 ETH from the liquidity pool at 1.35% and hence will owe 0.9866*exp(1*0.0135)=1ETH in 3 months

  • Protocol sells 0.9866 ETH in the spot market for 98.66 DAI

Last updated