SWAP type DEX oracle compensation method

According to AMM calculation, SWAP LP token amount = sqrt(x,y), x, y is the amount of tokens in escrow agreement.

Let’s see the trading pairs before BurgerSwap was hacked: BURGER-xBURGER

1.Client deposit 170.111835 BURGER and 119.957429 xBURGER to form the LP, client get 142.8436 token, we can see sqrt(170.111835*119.957429)=142.85, which is the same amount of LP token amount.

2. After BurgerSwap was hacked, the trading pairs: BURGER-xBURGER

0.014028BURGER and 0.012807xBURGER formed LP, created 0.1840478 LP, 0.184045 is much bigger than sqrt(0.012807*0.0140283)=0.0134, the assets are not enough to cover the debt.

3. LP custody contract has 21810 BURGER and 26915.38 xBURGER, which should generate sqrt(21810*26915.38)=24228.587 LP, but in fact it released 5,223,829.943172 LP. The debt is much bigger than asset, which requires judgement where should be compensated or not.

We can see the LP token escrow agreement:

Last updated