P0
and Bob wants to use XHedge to divide some BCH into a pair of LeverNFT/HedgeNFT. He must provide the following arguments:CR0
CRmin
Vh
Pc
MT
A=(1+CR0)*Vh/P0
. After that Bob gets a LeverNFT and a HedgeNFT, which can be transferred to other persons. In some scenarios, these NFT can be both burnt and the BCH locked because of them will be liquidated:P1
and the locked BCH cannot meet the minimum collateral rate (A < (1+CRmin)*Vh/P1
), then the owner of HedgeNFT can initiate liquidation. The owner of HedgeNFT can get min(A, (1+Pc)*Vh/P1)
and the owner of LeverNFT, max(0, A-(1+Pc)*Vh/P1)
.MT
, any owner of these two NFTs can initiate liquidation. At the liquidation moment, if BCH's price is P2
, then the owner of HedgeNFT can get min(A, Vh/P2)
and the owner of LeverNFT, max(0, A-Vh/P2)
. The owner of HedgeNFT secures the value of her asset, while the owner of LeverNFT enlarges her risk and benefit.A
:P
is large enough for P>P0*CR0
, she can withdraw some BCH to shrink A (reduce the margin), as long as A is no less than (1+CR0)*Vh/P
after withdrawing. And, from the coins withdrawn by her, 0.5% is deducted and paid to the owner of HedgeNFT as a compensation fee.price β duration
products through the price0CumulativeLast
and price1CumulativeLast
functions, and the pool's token reserve through the getReserves
function.price β duration
product is sampled once at each pool, while the token reserve can be sampled multiple times and the smallest value will be kept at last.