[Collateral(Total) - Potential Claim] * (1-Withdrawal Fee) * Pool Share
Num (Shield) = 500
Num (Spear) = 496.19
Collateral (Shield) = 93.85 DAI
Collateral (Spear) = 403.07 DAI
Collateral (Surplus) = 6.15 DAI
K (Shield) = 46,925
K (Spear) = 200,000
Shield price = 93.85 / 500 = 0.1877 DAI
Spear price = 403.07 / 496.19 = 0.8123 DAI
Spear Open Interest = 3.81
Shield Opne Interest = 0
Mint Spear & Shield per increase of collateral (spear & shield)
Num (Shield) = 500 + 500 * [800 / (93.85 + 403.07)] = 1,304.96
Num (Spear) = 496.19 + 496.19 * [800 / (93.85 + 403.07)] = 1,295.01
800 DAI split among Collateral (Shield) & Collateral (Spear) :
Collateral (Shield) = 93.85 DAI + 800 * [93.85/(93.85+403.07)] = 244.94
Collateral (Spear) = 403.07 DAI + 800 * [403.07/(93.85+403.07)] = 1,051.98
Pool share for the new LP = 800 / (800 + 93.85 + 403.07 + 6.15) = 61.39%
Shield price = 244.94 / 1,304.96 = 0.1877 DAI - remain unchange
K (Shield) = 244.94 * 1,304.96 = 319,636.90
Spear price = 1,051.98 / 1,295.01 = 0.8123 DAI - remain unchange
K (Spear) = 1,051.98 * 1,295.01 = 1,362,324.62
Collateral (Surplus) = 6.15 DAI - remain unchange
Num (Spear) & Num (Shield) burnt per pool share:
Num (Shield) = 1,304.96 - 1,304.96 * 38.61% = 801.11
Num (Spear) = 1,295.01 - 1,295.01 * 38.61% = 795.00
Collateral for highest potential claim be reserved:
Th greater open interest of Spear & Shield is 3.81, 3.81 DAI is reserved
Withdrawalable = (244.94+1,051.98+6.15-3.81)*(1-0.5%)*38.61%=499.14 DAI
Collateral (Shield) = 244.94 * (1-38.61%) = 150.37 DAI
Collateral (Spear) = 1,051.98 * (1-38.61%) = 645.81 DAI
Total deduct from Collateral (Shield) & Collateral (Spear) is 500.74 DAI
Thus Collateral (Surplus) shall increase by 1.60 DAI (500.74 - 499.14)
The LP's pool share will be burnt, and the second LP now owns 100%
Shield price = 150.37 / 801.11 = 0.1877 DAI - remain unchange
K (Shield) = 150.37 * 801.11 = 120,462.91
Spear price = 645.81 / 795.00 = 0.8123 DAI - remain unchange
K (Spear) = 645.81 * 795.00 = 513,418.95
Num (Spear) & Num (Shield) burnt per pool share:
Num (Shield) = 804.90 - 804.90 * 100% = 0
Num (Spear) = 798.76 - 798.76 * 100% = 0
Collateral for highest potential claim be reserved:
The greater open interest of Spear & Shield is 3.81, 3.81 DAI is reserved
Withdrawalable = (150.37+645.81+7.75-3.81) * (1-0.7%) * 100% = 794.52 DAI
Collateral (Shield) = 150.37 * 0% = 0 DAI
Collateral (Spear) = 645.81 * 0% = 0 DAI
Total deduct from Collateral (Shield) & Collateral (Spear) is 796.18 DAI
Thus Collateral (Surplus) shall increase by 1.66 DAI (796.18 - 794.52)
The LP's pool share will be burnt, now system is acting as ultimate LP
Shield price = 0.1877 DAI - remain unchanged
K (Shield) will indefinitely approach 0
Spear price = 0.8123 DAI - remain unchanged
K (Spear) will indefinitely approach 0