tx · BpiEY6rsMhGhvFnGbbw8BCEqCrA2XNzgrgP5VdCGbZE3 3MuzRcW6fRnqCC76KgKznZP68qsWB1J6shn: -0.07500000 Waves 2023.03.23 21:54 [2503024] smart account 3MuzRcW6fRnqCC76KgKznZP68qsWB1J6shn > SELF 0.00000000 Waves
{ "type": 13, "id": "BpiEY6rsMhGhvFnGbbw8BCEqCrA2XNzgrgP5VdCGbZE3", "fee": 7500000, "feeAssetId": null, "timestamp": 1679597693296, "version": 2, "chainId": 84, "sender": "3MuzRcW6fRnqCC76KgKznZP68qsWB1J6shn", "senderPublicKey": "EjNbd48ENcnJ4wjBkASdYJHavM8QHrAbFDbJ46ffyUcU", "proofs": [ "4oQUjfe2FDW5uYjYmCDygrgsCvPEeFB2yiApHWsCo22oAutmTwD32EXWB8B3SdhCxHyEzwzz6w96nVPSEAppJJ2y" ], "script": "base64:BgKAAQgCEgASABIAEgASAwoBARIDCgEBEhAKDgEBAQEBAQEBAQEBAQEBEhUKEwEBAQEBAQEICAgBAQEBAQEBAQESBgoEAQEBCBIDCgEBEgQKAgEBEgYKBAEBAQQSBAoCCAESABIAEgASAwoBCBIECgIIARIDCgEBEgASABIAEgQKAggIrwEADGtfYmFzZU9yYWNsZQIMa19iYXNlT3JhY2xlAA1rX3F1b3RlT3JhY2xlAg1rX3F1b3RlT3JhY2xlAAlrX2JhbGFuY2UCCWtfYmFsYW5jZQAKa19zZXF1ZW5jZQIKa19zZXF1ZW5jZQAOa19wb3NpdGlvblNpemUCDmtfcG9zaXRpb25TaXplABBrX3Bvc2l0aW9uTWFyZ2luAhBrX3Bvc2l0aW9uTWFyZ2luABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAhZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAhJrX3Bvc2l0aW9uRnJhY3Rpb24AEmtfcG9zaXRpb25TZXF1ZW5jZQIS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KwCAgkArAICCQCsAgICB3N0YXR1c18JAKUIAQUEdGhpcwIBXwkA2AQBCAUCdHgCaWQHCQACAQIudW5hYmxlIHRvIHZlcmlmeTogYWRtaW4gbm90IHNldCBpbiBjb29yZGluYXRvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tledZdJEA=", "height": 2503024, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5ZRYXQTdiyFXSxtvpq1MceAw1Eqf2z6Kd6BWHJB7ZHz1 Next: 7GX6k16jNdeL7SbAwX3q2g8jUrvEhc6jbb5Cf8NKX13y Diff:
Old | New | Differences | |
---|---|---|---|
1705 | 1705 | @Callable(i) | |
1706 | 1706 | func migratePosition (_trader) = { | |
1707 | 1707 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
1708 | - | if (isDefined(positionSizeOpt)) | |
1708 | + | if (if (isDefined(positionSizeOpt)) | |
1709 | + | then isDefined(addressFromString(_trader)) | |
1710 | + | else false) | |
1709 | 1711 | then { | |
1710 | 1712 | let pSize = getIntegerValue(this, toCompositeKey(k_positionSize, _trader)) | |
1711 | 1713 | let pMargin = getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)) | |
1712 | 1714 | let pNotional = getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)) | |
1713 | 1715 | let pFraction = getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)) | |
1714 | - | let pTimestamp = | |
1715 | - | let pFee = | |
1716 | + | let pTimestamp = valueOrElse(getInteger(this, toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), lastBlock.timestamp) | |
1717 | + | let pFee = valueOrElse(getInteger(this, toCompositeKey(k_positionFee, _trader)), fee()) | |
1716 | 1718 | let pSequence = getIntegerValue(this, toCompositeKey(k_positionSequence, _trader)) | |
1717 | 1719 | let pDirection = getDirection(pSize) | |
1718 | 1720 | let positionKey = ((_trader + "_") + toString(pDirection)) | |
1728 | 1730 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1729 | 1731 | if ((sync == sync)) | |
1730 | 1732 | then { | |
1731 | - | let $ | |
1732 | - | let positionSize = $ | |
1733 | - | let positionMargin = $ | |
1734 | - | let pon = $ | |
1735 | - | let positionLstUpdCPF = $ | |
1736 | - | let positionTimestamp = $ | |
1737 | - | let $ | |
1738 | - | let positionNotional = $ | |
1739 | - | let unrealizedPnl = $ | |
1740 | - | let $ | |
1741 | - | let remainMargin = $ | |
1742 | - | let badDebt = $ | |
1743 | - | let fundingPayment = $ | |
1744 | - | let rolloverFee = $ | |
1733 | + | let $t08251182647 = getPosition(_trader, _direction) | |
1734 | + | let positionSize = $t08251182647._1 | |
1735 | + | let positionMargin = $t08251182647._2 | |
1736 | + | let pon = $t08251182647._3 | |
1737 | + | let positionLstUpdCPF = $t08251182647._4 | |
1738 | + | let positionTimestamp = $t08251182647._5 | |
1739 | + | let $t08265082763 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
1740 | + | let positionNotional = $t08265082763._1 | |
1741 | + | let unrealizedPnl = $t08265082763._2 | |
1742 | + | let $t08276682990 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl) | |
1743 | + | let remainMargin = $t08276682990._1 | |
1744 | + | let badDebt = $t08276682990._2 | |
1745 | + | let fundingPayment = $t08276682990._3 | |
1746 | + | let rolloverFee = $t08276682990._4 | |
1745 | 1747 | throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee))) | |
1746 | 1748 | } | |
1747 | 1749 | else throw("Strict value is not equal to itself.") | |
1761 | 1763 | ||
1762 | 1764 | @Callable(i) | |
1763 | 1765 | func view_getTerminalAmmPrice () = { | |
1764 | - | let $ | |
1765 | - | let terminalQuoteAssetReserve = $ | |
1766 | - | let terminalBaseAssetReserve = $ | |
1766 | + | let $t08372583806 = getTerminalAmmState() | |
1767 | + | let terminalQuoteAssetReserve = $t08372583806._1 | |
1768 | + | let terminalBaseAssetReserve = $t08372583806._2 | |
1767 | 1769 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
1768 | 1770 | throw(toString(price)) | |
1769 | 1771 | } | |
1776 | 1778 | if ((sync == sync)) | |
1777 | 1779 | then { | |
1778 | 1780 | let underlyingPrice = getOraclePrice() | |
1779 | - | let $ | |
1780 | - | let shortPremiumFraction = $ | |
1781 | - | let longPremiumFraction = $ | |
1782 | - | let premiumToVault = $ | |
1781 | + | let $t08436584443 = getFunding() | |
1782 | + | let shortPremiumFraction = $t08436584443._1 | |
1783 | + | let longPremiumFraction = $t08436584443._2 | |
1784 | + | let premiumToVault = $t08436584443._3 | |
1783 | 1785 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1784 | 1786 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1785 | 1787 | throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_baseOracle = "k_baseOracle" | |
5 | 5 | ||
6 | 6 | let k_quoteOracle = "k_quoteOracle" | |
7 | 7 | ||
8 | 8 | let k_balance = "k_balance" | |
9 | 9 | ||
10 | 10 | let k_sequence = "k_sequence" | |
11 | 11 | ||
12 | 12 | let k_positionSize = "k_positionSize" | |
13 | 13 | ||
14 | 14 | let k_positionMargin = "k_positionMargin" | |
15 | 15 | ||
16 | 16 | let k_positionOpenNotional = "k_positionOpenNotional" | |
17 | 17 | ||
18 | 18 | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
19 | 19 | ||
20 | 20 | let k_positionSequence = "k_positionSequence" | |
21 | 21 | ||
22 | 22 | let k_positionFee = "k_positionFee" | |
23 | 23 | ||
24 | 24 | let k_positionLastUpdatedTimestamp = "k_positionTimestamp" | |
25 | 25 | ||
26 | 26 | let k_initialized = "k_initialized" | |
27 | 27 | ||
28 | 28 | let k_paused = "k_paused" | |
29 | 29 | ||
30 | 30 | let k_closeOnly = "k_closeOnly" | |
31 | 31 | ||
32 | 32 | let k_fee = "k_fee" | |
33 | 33 | ||
34 | 34 | let k_rolloverFee = "k_rollover_fee" | |
35 | 35 | ||
36 | 36 | let k_fundingPeriod = "k_fundingPeriod" | |
37 | 37 | ||
38 | 38 | let k_initMarginRatio = "k_initMarginRatio" | |
39 | 39 | ||
40 | 40 | let k_maintenanceMarginRatio = "k_mmr" | |
41 | 41 | ||
42 | 42 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
43 | 43 | ||
44 | 44 | let k_partialLiquidationRatio = "k_partLiquidationRatio" | |
45 | 45 | ||
46 | 46 | let k_spreadLimit = "k_spreadLimit" | |
47 | 47 | ||
48 | 48 | let k_maxPriceImpact = "k_maxPriceImpact" | |
49 | 49 | ||
50 | 50 | let k_maxPriceSpread = "k_maxPriceSpread" | |
51 | 51 | ||
52 | 52 | let k_maxOpenNotional = "k_maxOpenNotional" | |
53 | 53 | ||
54 | 54 | let k_feeToStakersPercent = "k_feeToStakersPercent" | |
55 | 55 | ||
56 | 56 | let k_maxOracleDelay = "k_maxOracleDelay" | |
57 | 57 | ||
58 | 58 | let k_fundingMode = "k_fundingMode" | |
59 | 59 | ||
60 | 60 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
61 | 61 | ||
62 | 62 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
63 | 63 | ||
64 | 64 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
65 | 65 | ||
66 | 66 | let k_longFundingRate = "k_longFundingRate" | |
67 | 67 | ||
68 | 68 | let k_shortFundingRate = "k_shortFundingRate" | |
69 | 69 | ||
70 | 70 | let k_quoteAssetReserve = "k_qtAstR" | |
71 | 71 | ||
72 | 72 | let k_baseAssetReserve = "k_bsAstR" | |
73 | 73 | ||
74 | 74 | let k_quoteAssetWeight = "k_qtAstW" | |
75 | 75 | ||
76 | 76 | let k_baseAssetWeight = "k_bsAstW" | |
77 | 77 | ||
78 | 78 | let k_totalPositionSize = "k_totalPositionSize" | |
79 | 79 | ||
80 | 80 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
81 | 81 | ||
82 | 82 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
83 | 83 | ||
84 | 84 | let k_openInterestNotional = "k_openInterestNotional" | |
85 | 85 | ||
86 | 86 | let k_openInterestShort = "k_openInterestShort" | |
87 | 87 | ||
88 | 88 | let k_openInterestLong = "k_openInterestLong" | |
89 | 89 | ||
90 | 90 | let k_lastTx = "k_lastTx" | |
91 | 91 | ||
92 | 92 | let k_coordinatorAddress = "k_coordinatorAddress" | |
93 | 93 | ||
94 | 94 | let k_vault_address = "k_vault_address" | |
95 | 95 | ||
96 | 96 | let k_admin_address = "k_admin_address" | |
97 | 97 | ||
98 | 98 | let k_quote_asset = "k_quote_asset" | |
99 | 99 | ||
100 | 100 | let k_staking_address = "k_staking_address" | |
101 | 101 | ||
102 | 102 | let k_miner_address = "k_miner_address" | |
103 | 103 | ||
104 | 104 | let k_orders_address = "k_orders_address" | |
105 | 105 | ||
106 | 106 | let k_referral_address = "k_referral_address" | |
107 | 107 | ||
108 | 108 | let k_nft_manager_address = "k_nft_manager_address" | |
109 | 109 | ||
110 | 110 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
114 | 114 | ||
115 | 115 | ||
116 | 116 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
123 | 123 | ||
124 | 124 | ||
125 | 125 | func vaultAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_vault_address)), "Vault not set") | |
126 | 126 | ||
127 | 127 | ||
128 | 128 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set") | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
132 | 132 | ||
133 | 133 | ||
134 | 134 | func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set") | |
135 | 135 | ||
136 | 136 | ||
137 | 137 | func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set") | |
138 | 138 | ||
139 | 139 | ||
140 | 140 | let k_token_param = "k_token_param" | |
141 | 141 | ||
142 | 142 | let k_token_type = "k_token_type" | |
143 | 143 | ||
144 | 144 | let FEE_REDUCTION_TOKEN_TYPE = "fee_reduction" | |
145 | 145 | ||
146 | 146 | let DIR_LONG = 1 | |
147 | 147 | ||
148 | 148 | let DIR_SHORT = 2 | |
149 | 149 | ||
150 | 150 | let SECONDS = 1000 | |
151 | 151 | ||
152 | 152 | let DECIMAL_NUMBERS = 6 | |
153 | 153 | ||
154 | 154 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
155 | 155 | ||
156 | 156 | let MINUTES_IN_YEAR = (525600 * DECIMAL_UNIT) | |
157 | 157 | ||
158 | 158 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
159 | 159 | ||
160 | 160 | let PNL_OPTION_SPOT = 1 | |
161 | 161 | ||
162 | 162 | let PNL_OPTION_ORACLE = 2 | |
163 | 163 | ||
164 | 164 | let FUNDING_ASYMMETRIC = 1 | |
165 | 165 | ||
166 | 166 | let FUNDING_SYMMETRIC = 2 | |
167 | 167 | ||
168 | 168 | func s (_x) = (toString(_x) + ",") | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
172 | 172 | ||
173 | 173 | ||
174 | 174 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
175 | 175 | ||
176 | 176 | ||
177 | 177 | func bdivd (_x,_y) = fraction(_x, toBigInt(DECIMAL_UNIT), _y, HALFEVEN) | |
178 | 178 | ||
179 | 179 | ||
180 | 180 | func bmuld (_x,_y) = fraction(_x, _y, toBigInt(DECIMAL_UNIT), HALFEVEN) | |
181 | 181 | ||
182 | 182 | ||
183 | 183 | func abs (_x) = if ((_x > 0)) | |
184 | 184 | then _x | |
185 | 185 | else -(_x) | |
186 | 186 | ||
187 | 187 | ||
188 | 188 | func vmax (_x,_y) = if ((_x >= _y)) | |
189 | 189 | then _x | |
190 | 190 | else _y | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
194 | 194 | ||
195 | 195 | ||
196 | 196 | func intOr (k,def) = valueOrElse(getInteger(this, k), def) | |
197 | 197 | ||
198 | 198 | ||
199 | 199 | func strA (_address,_key) = { | |
200 | 200 | let val = valueOrErrorMessage(getString(_address, _key), ("No value for key " + _key)) | |
201 | 201 | val | |
202 | 202 | } | |
203 | 203 | ||
204 | 204 | ||
205 | 205 | func intA (_address,_key) = { | |
206 | 206 | let val = valueOrErrorMessage(getInteger(_address, _key), ("No value for key " + _key)) | |
207 | 207 | val | |
208 | 208 | } | |
209 | 209 | ||
210 | 210 | ||
211 | 211 | func cbalance () = int(k_balance) | |
212 | 212 | ||
213 | 213 | ||
214 | 214 | func fee () = int(k_fee) | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func rolloverFeeRate () = int(k_rolloverFee) | |
218 | 218 | ||
219 | 219 | ||
220 | 220 | func initMarginRatio () = int(k_initMarginRatio) | |
221 | 221 | ||
222 | 222 | ||
223 | 223 | func qtAstR () = int(k_quoteAssetReserve) | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func bsAstR () = int(k_baseAssetReserve) | |
227 | 227 | ||
228 | 228 | ||
229 | 229 | func qtAstW () = intOr(k_quoteAssetWeight, DECIMAL_UNIT) | |
230 | 230 | ||
231 | 231 | ||
232 | 232 | func bsAstW () = intOr(k_baseAssetWeight, DECIMAL_UNIT) | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func totalPositionSize () = int(k_totalPositionSize) | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func openInterestNotional () = int(k_openInterestNotional) | |
239 | 239 | ||
240 | 240 | ||
241 | 241 | func openInterestShort () = int(k_openInterestShort) | |
242 | 242 | ||
243 | 243 | ||
244 | 244 | func openInterestLong () = int(k_openInterestLong) | |
245 | 245 | ||
246 | 246 | ||
247 | 247 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
248 | 248 | ||
249 | 249 | ||
250 | 250 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
251 | 251 | ||
252 | 252 | ||
253 | 253 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
254 | 254 | ||
255 | 255 | ||
256 | 256 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
257 | 257 | ||
258 | 258 | ||
259 | 259 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
260 | 260 | ||
261 | 261 | ||
262 | 262 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
263 | 263 | ||
264 | 264 | ||
265 | 265 | func partialLiquidationRatio () = int(k_partialLiquidationRatio) | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func spreadLimit () = int(k_spreadLimit) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func maxPriceImpact () = int(k_maxPriceImpact) | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func maxPriceSpread () = int(k_maxPriceSpread) | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func maxOpenNotional () = int(k_maxOpenNotional) | |
278 | 278 | ||
279 | 279 | ||
280 | 280 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
284 | 284 | ||
285 | 285 | ||
286 | 286 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func lastSequence () = intOr(k_sequence, 0) | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func feeToStakersPercent () = int(k_feeToStakersPercent) | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func maxOracleDelay () = int(k_maxOracleDelay) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func fundingMode () = intOr(k_fundingMode, FUNDING_ASYMMETRIC) | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func lastTimestamp () = lastBlock.timestamp | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller)) | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
311 | 311 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
312 | 312 | if (if (_largerThanOrEqualTo) | |
313 | 313 | then (0 > remainingMarginRatio) | |
314 | 314 | else false) | |
315 | 315 | then throw(((("Invalid margin: " + toString(_marginRatio)) + " < ") + toString(_baseMarginRatio))) | |
316 | 316 | else if (if (!(_largerThanOrEqualTo)) | |
317 | 317 | then (remainingMarginRatio >= 0) | |
318 | 318 | else false) | |
319 | 319 | then throw(((("Invalid margin: " + toString(_marginRatio)) + " > ") + toString(_baseMarginRatio))) | |
320 | 320 | else true | |
321 | 321 | } | |
322 | 322 | ||
323 | 323 | ||
324 | 324 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
325 | 325 | then throw("Should not be called with _positionSize == 0") | |
326 | 326 | else if ((_positionSize > 0)) | |
327 | 327 | then latestLongCumulativePremiumFraction() | |
328 | 328 | else latestShortCumulativePremiumFraction() | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func getPosition (_trader,_direction) = { | |
332 | 332 | let positionKey = ((_trader + "_") + toString(_direction)) | |
333 | 333 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, positionKey)) | |
334 | 334 | match positionSizeOpt { | |
335 | 335 | case positionSize: Int => | |
336 | 336 | $Tuple5(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, positionKey)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedTimestamp, positionKey))) | |
337 | 337 | case _ => | |
338 | 338 | $Tuple5(0, 0, 0, 0, 0) | |
339 | 339 | } | |
340 | 340 | } | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func getDirection (_positionSize) = if ((0 > _positionSize)) | |
344 | 344 | then DIR_SHORT | |
345 | 345 | else DIR_LONG | |
346 | 346 | ||
347 | 347 | ||
348 | 348 | func getPositionFee (_trader) = { | |
349 | 349 | let positionFeeOpt = getInteger(this, toCompositeKey(k_positionFee, _trader)) | |
350 | 350 | match positionFeeOpt { | |
351 | 351 | case positionFee: Int => | |
352 | 352 | positionFee | |
353 | 353 | case _ => | |
354 | 354 | fee() | |
355 | 355 | } | |
356 | 356 | } | |
357 | 357 | ||
358 | 358 | ||
359 | 359 | func requireOpenPosition (_trader,_direction) = if ((getPosition(_trader, _direction)._1 == 0)) | |
360 | 360 | then throw("No open position") | |
361 | 361 | else true | |
362 | 362 | ||
363 | 363 | ||
364 | 364 | func getOracleData (key) = { | |
365 | 365 | let oracleDataStr = getString(this, key) | |
366 | 366 | if (if (isDefined(oracleDataStr)) | |
367 | 367 | then (value(oracleDataStr) != "") | |
368 | 368 | else false) | |
369 | 369 | then { | |
370 | 370 | let oracleData = split(value(oracleDataStr), ",") | |
371 | 371 | let oracleAddress = valueOrErrorMessage(addressFromString(oracleData[0]), ("Invalid oracle address in: " + value(oracleDataStr))) | |
372 | 372 | let priceKey = oracleData[1] | |
373 | 373 | let blockKey = oracleData[2] | |
374 | 374 | let openKey = oracleData[3] | |
375 | 375 | $Tuple4(oracleAddress, priceKey, blockKey, openKey) | |
376 | 376 | } | |
377 | 377 | else unit | |
378 | 378 | } | |
379 | 379 | ||
380 | 380 | ||
381 | 381 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
382 | 382 | ||
383 | 383 | ||
384 | 384 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
385 | 385 | ||
386 | 386 | ||
387 | 387 | func closeOnly () = valueOrElse(getBoolean(this, k_closeOnly), false) | |
388 | 388 | ||
389 | 389 | ||
390 | 390 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
391 | 391 | then { | |
392 | 392 | let newBase = (bsAstR() - _baseAssetAmount) | |
393 | 393 | if ((0 >= newBase)) | |
394 | 394 | then throw("Tx lead to base asset reserve <= 0, revert") | |
395 | 395 | else $Tuple3((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount)) | |
396 | 396 | } | |
397 | 397 | else { | |
398 | 398 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
399 | 399 | if ((0 >= newQuote)) | |
400 | 400 | then throw("Tx lead to base quote reserve <= 0, revert") | |
401 | 401 | else $Tuple3(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount)) | |
402 | 402 | } | |
403 | 403 | ||
404 | 404 | ||
405 | 405 | func calcInvariant (_qtAstR,_bsAstR) = { | |
406 | 406 | let bqtAstR = toBigInt(_qtAstR) | |
407 | 407 | let bbsAstR = toBigInt(_bsAstR) | |
408 | 408 | bmuld(bqtAstR, bbsAstR) | |
409 | 409 | } | |
410 | 410 | ||
411 | 411 | ||
412 | 412 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
413 | 413 | let _qtAstR = qtAstR() | |
414 | 414 | let _bsAstR = bsAstR() | |
415 | 415 | let _qtAstW = qtAstW() | |
416 | 416 | let _bsAstW = bsAstW() | |
417 | 417 | let quoteAssetAmountAdjusted = divd(_quoteAssetAmount, _qtAstW) | |
418 | 418 | let k = calcInvariant(_qtAstR, _bsAstR) | |
419 | 419 | let quoteAssetReserveAfter = if (_isAdd) | |
420 | 420 | then (_qtAstR + quoteAssetAmountAdjusted) | |
421 | 421 | else (_qtAstR - quoteAssetAmountAdjusted) | |
422 | 422 | let baseAssetReserveAfter = toInt(bdivd(k, toBigInt(quoteAssetReserveAfter))) | |
423 | 423 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
424 | 424 | let amountBaseAssetBought = if (_isAdd) | |
425 | 425 | then amountBaseAssetBoughtAbs | |
426 | 426 | else -(amountBaseAssetBoughtAbs) | |
427 | 427 | let $t01550515675 = updateReserve(_isAdd, quoteAssetAmountAdjusted, amountBaseAssetBoughtAbs) | |
428 | 428 | let quoteAssetReserveAfter1 = $t01550515675._1 | |
429 | 429 | let baseAssetReserveAfter1 = $t01550515675._2 | |
430 | 430 | let totalPositionSizeAfter1 = $t01550515675._3 | |
431 | 431 | let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
432 | 432 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
433 | 433 | let priceDiff = abs((priceBefore - marketPrice)) | |
434 | 434 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
435 | 435 | let maxPriceImpactValue = maxPriceImpact() | |
436 | 436 | if ((priceImpact > maxPriceImpactValue)) | |
437 | 437 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_qtAstR)) + " before base asset: ") + toString(_bsAstR)) + " quote asset amount to exchange: ") + toString(_quoteAssetAmount)) + " price before: ") + toString(priceBefore)) + " marketPrice: ") + toString(marketPrice))) | |
438 | 438 | else $Tuple4(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1) | |
439 | 439 | } | |
440 | 440 | ||
441 | 441 | ||
442 | 442 | func calcRolloverFee (_oldPositionMargin,_oldPositionLastUpdatedTimestamp) = { | |
443 | 443 | let positionMinutes = ((((lastTimestamp() - _oldPositionLastUpdatedTimestamp) / 1000) / 60) * DECIMAL_UNIT) | |
444 | 444 | let rolloverFee = divd(muld(muld(_oldPositionMargin, positionMinutes), rolloverFeeRate()), MINUTES_IN_YEAR) | |
445 | 445 | rolloverFee | |
446 | 446 | } | |
447 | 447 | ||
448 | 448 | ||
449 | 449 | func calcRemainMarginWithFundingPaymentAndRolloverFee (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_oldPositionLastUpdatedTimestamp,_marginDelta) = { | |
450 | 450 | let fundingPayment = if ((_oldPositionSize != 0)) | |
451 | 451 | then { | |
452 | 452 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
453 | 453 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
454 | 454 | } | |
455 | 455 | else 0 | |
456 | 456 | let rolloverFee = calcRolloverFee(_oldPositionMargin, _oldPositionLastUpdatedTimestamp) | |
457 | 457 | let signedMargin = (((_marginDelta - rolloverFee) - fundingPayment) + _oldPositionMargin) | |
458 | 458 | let $t01834218469 = if ((0 > signedMargin)) | |
459 | 459 | then $Tuple2(0, abs(signedMargin)) | |
460 | 460 | else $Tuple2(abs(signedMargin), 0) | |
461 | 461 | let remainMargin = $t01834218469._1 | |
462 | 462 | let badDebt = $t01834218469._2 | |
463 | 463 | $Tuple4(remainMargin, badDebt, fundingPayment, rolloverFee) | |
464 | 464 | } | |
465 | 465 | ||
466 | 466 | ||
467 | 467 | func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
468 | 468 | let priceBefore = divd(muld(_quoteAssetReserve, _quoteAssetWeight), muld(_baseAssetReserve, _baseAssetWeight)) | |
469 | 469 | if ((_baseAssetAmount == 0)) | |
470 | 470 | then throw("Invalid base asset amount") | |
471 | 471 | else { | |
472 | 472 | let k = calcInvariant(_quoteAssetReserve, _baseAssetReserve) | |
473 | 473 | let baseAssetPoolAmountAfter = if (_isAdd) | |
474 | 474 | then (_baseAssetReserve + _baseAssetAmount) | |
475 | 475 | else (_baseAssetReserve - _baseAssetAmount) | |
476 | 476 | let quoteAssetAfter = toInt(bdivd(k, toBigInt(baseAssetPoolAmountAfter))) | |
477 | 477 | let quoteAssetDelta = abs((quoteAssetAfter - _quoteAssetReserve)) | |
478 | 478 | let quoteAssetSold = muld(quoteAssetDelta, _quoteAssetWeight) | |
479 | 479 | let maxPriceImpactValue = maxPriceImpact() | |
480 | 480 | let $t01973119893 = updateReserve(!(_isAdd), quoteAssetDelta, _baseAssetAmount) | |
481 | 481 | let quoteAssetReserveAfter1 = $t01973119893._1 | |
482 | 482 | let baseAssetReserveAfter1 = $t01973119893._2 | |
483 | 483 | let totalPositionSizeAfter1 = $t01973119893._3 | |
484 | 484 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
485 | 485 | let priceDiff = abs((priceBefore - marketPrice)) | |
486 | 486 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
487 | 487 | if (if ((priceImpact > maxPriceImpactValue)) | |
488 | 488 | then _checkMaxPriceImpact | |
489 | 489 | else false) | |
490 | 490 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_quoteAssetReserve)) + " before base asset: ") + toString(_baseAssetReserve)) + " base asset amount to exchange: ") + toString(_baseAssetAmount)) + " price before: ") + toString(priceBefore)) + " market price: ") + toString(marketPrice))) | |
491 | 491 | else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, (totalLongPositionSize() - (if (_isAdd) | |
492 | 492 | then abs(_baseAssetAmount) | |
493 | 493 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
494 | 494 | then abs(_baseAssetAmount) | |
495 | 495 | else 0)), priceImpact) | |
496 | 496 | } | |
497 | 497 | } | |
498 | 498 | ||
499 | 499 | ||
500 | 500 | func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), qtAstW(), bsAstR(), bsAstW()) | |
501 | 501 | ||
502 | 502 | ||
503 | 503 | func getOraclePriceValue (oracle,priceKey,blockKey) = { | |
504 | 504 | let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey)) | |
505 | 505 | if ((blockKey != "")) | |
506 | 506 | then { | |
507 | 507 | let currentBlock = lastBlock.height | |
508 | 508 | let lastOracleBlock = valueOrErrorMessage(getInteger(oracle, blockKey), ((("Can not get oracle block. Oracle: " + toString(oracle)) + " key: ") + blockKey)) | |
509 | 509 | if (((currentBlock - lastOracleBlock) > maxOracleDelay())) | |
510 | 510 | then throw(((("Oracle stale data. Last oracle block: " + toString(lastOracleBlock)) + " current block: ") + toString(currentBlock))) | |
511 | 511 | else lastValue | |
512 | 512 | } | |
513 | 513 | else lastValue | |
514 | 514 | } | |
515 | 515 | ||
516 | 516 | ||
517 | 517 | func getOraclePrice () = { | |
518 | 518 | let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data") | |
519 | 519 | let baseOraclePrice = getOraclePriceValue(baseOracle._1, baseOracle._2, baseOracle._3) | |
520 | 520 | let quoteOracle = getOracleData(k_quoteOracle) | |
521 | 521 | let quoteOraclePrice = if (isDefined(quoteOracle)) | |
522 | 522 | then { | |
523 | 523 | let quoteOracleV = value(quoteOracle) | |
524 | 524 | getOraclePriceValue(quoteOracleV._1, quoteOracleV._2, quoteOracleV._3) | |
525 | 525 | } | |
526 | 526 | else DECIMAL_UNIT | |
527 | 527 | divd(baseOraclePrice, quoteOraclePrice) | |
528 | 528 | } | |
529 | 529 | ||
530 | 530 | ||
531 | 531 | func isMarketClosed () = { | |
532 | 532 | let baseOracle = valueOrErrorMessage(getOracleData(k_baseOracle), "No base asset oracle data") | |
533 | 533 | let oracle = baseOracle._1 | |
534 | 534 | let openKey = baseOracle._4 | |
535 | 535 | if ((openKey != "")) | |
536 | 536 | then { | |
537 | 537 | let isOpen = valueOrErrorMessage(getBoolean(oracle, openKey), ((("Can not get oracle is open/closed. Oracle: " + toString(oracle)) + " key: ") + openKey)) | |
538 | 538 | !(isOpen) | |
539 | 539 | } | |
540 | 540 | else false | |
541 | 541 | } | |
542 | 542 | ||
543 | 543 | ||
544 | 544 | func absPriceDiff (_oraclePrice,_quoteAssetReserve,_baseAssetReserve,_qtAstW,_bsAstW) = { | |
545 | 545 | let priceAfter = divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
546 | 546 | let averagePrice = divd((_oraclePrice + priceAfter), (2 * DECIMAL_UNIT)) | |
547 | 547 | let absPriceDiff = divd(abs((_oraclePrice - priceAfter)), averagePrice) | |
548 | 548 | absPriceDiff | |
549 | 549 | } | |
550 | 550 | ||
551 | 551 | ||
552 | 552 | func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = { | |
553 | 553 | let oraclePrice = getOraclePrice() | |
554 | 554 | let _qtAstW = qtAstW() | |
555 | 555 | let _bsAstW = bsAstW() | |
556 | 556 | let absPriceDiffBefore = absPriceDiff(oraclePrice, qtAstR(), bsAstR(), _qtAstW, _bsAstW) | |
557 | 557 | let absPriceDiffAfter = absPriceDiff(oraclePrice, _quoteAssetReserve, _baseAssetReserve, _qtAstW, _bsAstW) | |
558 | 558 | if (if ((absPriceDiffAfter > maxPriceSpread())) | |
559 | 559 | then (absPriceDiffAfter > absPriceDiffBefore) | |
560 | 560 | else false) | |
561 | 561 | then throw(((("Price spread " + toString(absPriceDiffAfter)) + " > max price spread ") + toString(maxPriceSpread()))) | |
562 | 562 | else true | |
563 | 563 | } | |
564 | 564 | ||
565 | 565 | ||
566 | 566 | func requireNotOverMaxOpenNotional (_longOpenNotional,_shortOpenNotional) = { | |
567 | 567 | let _maxOpenNotional = maxOpenNotional() | |
568 | 568 | if ((_longOpenNotional > _maxOpenNotional)) | |
569 | 569 | then throw(((("Long open notional " + toString(_longOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
570 | 570 | else if ((_shortOpenNotional > _maxOpenNotional)) | |
571 | 571 | then throw(((("Short open notional " + toString(_shortOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
572 | 572 | else true | |
573 | 573 | } | |
574 | 574 | ||
575 | 575 | ||
576 | 576 | func getSpotPrice () = { | |
577 | 577 | let _quoteAssetReserve = qtAstR() | |
578 | 578 | let _baseAssetReserve = bsAstR() | |
579 | 579 | let _qtAstW = qtAstW() | |
580 | 580 | let _bsAstW = bsAstW() | |
581 | 581 | divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
582 | 582 | } | |
583 | 583 | ||
584 | 584 | ||
585 | 585 | func isOverFluctuationLimit () = { | |
586 | 586 | let oraclePrice = getOraclePrice() | |
587 | 587 | let currentPrice = getSpotPrice() | |
588 | 588 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
589 | 589 | } | |
590 | 590 | ||
591 | 591 | ||
592 | 592 | func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
593 | 593 | let positionSizeAbs = abs(_positionSize) | |
594 | 594 | let isShort = (0 > _positionSize) | |
595 | 595 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
596 | 596 | then { | |
597 | 597 | let outPositionNotional = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight)._1 | |
598 | 598 | outPositionNotional | |
599 | 599 | } | |
600 | 600 | else muld(positionSizeAbs, getOraclePrice()) | |
601 | 601 | positionNotional | |
602 | 602 | } | |
603 | 603 | ||
604 | 604 | ||
605 | 605 | func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight,_option) = if ((_positionSize == 0)) | |
606 | 606 | then throw("Invalid position size") | |
607 | 607 | else { | |
608 | 608 | let isShort = (0 > _positionSize) | |
609 | 609 | let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight) | |
610 | 610 | let unrealizedPnl = if (isShort) | |
611 | 611 | then (_positionOpenNotional - positionNotional) | |
612 | 612 | else (positionNotional - _positionOpenNotional) | |
613 | 613 | $Tuple2(positionNotional, unrealizedPnl) | |
614 | 614 | } | |
615 | 615 | ||
616 | 616 | ||
617 | 617 | func getPositionNotionalAndUnrealizedPnl (_trader,_direction,_option) = { | |
618 | 618 | let $t02778827928 = getPosition(_trader, _direction) | |
619 | 619 | let positionSize = $t02778827928._1 | |
620 | 620 | let positionMargin = $t02778827928._2 | |
621 | 621 | let positionOpenNotional = $t02778827928._3 | |
622 | 622 | let positionLstUpdCPF = $t02778827928._4 | |
623 | 623 | getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option) | |
624 | 624 | } | |
625 | 625 | ||
626 | 626 | ||
627 | 627 | func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional) | |
628 | 628 | ||
629 | 629 | ||
630 | 630 | func getMarginRatioByOption (_trader,_direction,_option) = { | |
631 | 631 | let $t02846028613 = getPosition(_trader, _direction) | |
632 | 632 | let positionSize = $t02846028613._1 | |
633 | 633 | let positionMargin = $t02846028613._2 | |
634 | 634 | let pon = $t02846028613._3 | |
635 | 635 | let positionLastUpdatedCPF = $t02846028613._4 | |
636 | 636 | let positionTimestamp = $t02846028613._5 | |
637 | 637 | let $t02861928724 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, _option) | |
638 | 638 | let positionNotional = $t02861928724._1 | |
639 | 639 | let unrealizedPnl = $t02861928724._2 | |
640 | 640 | let $t02872928941 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLastUpdatedCPF, positionTimestamp, unrealizedPnl) | |
641 | 641 | let remainMargin = $t02872928941._1 | |
642 | 642 | let badDebt = $t02872928941._2 | |
643 | 643 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
644 | 644 | } | |
645 | 645 | ||
646 | 646 | ||
647 | 647 | func getMarginRatio (_trader,_direction) = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
648 | 648 | ||
649 | 649 | ||
650 | 650 | func getPartialLiquidationAmount (_trader,_positionSize) = { | |
651 | 651 | let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader, getDirection(_positionSize)), maintenanceMarginRatio()))) | |
652 | 652 | let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio) | |
653 | 653 | let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false) | |
654 | 654 | let maxExchangedQuoteAssetAmount = swapResult._1 | |
655 | 655 | let priceImpact = swapResult._7 | |
656 | 656 | if ((maxPriceImpact() > priceImpact)) | |
657 | 657 | then maxExchangedPositionSize | |
658 | 658 | else muld(abs(_positionSize), partialLiquidationRatio()) | |
659 | 659 | } | |
660 | 660 | ||
661 | 661 | ||
662 | 662 | func internalClosePosition (_trader,_direction,_size,_fee,_minQuoteAssetAmount,_addToMargin,_checkMaxPriceImpact,_liquidate) = { | |
663 | 663 | let $t03010430272 = getPosition(_trader, _direction) | |
664 | 664 | let oldPositionSize = $t03010430272._1 | |
665 | 665 | let oldPositionMargin = $t03010430272._2 | |
666 | 666 | let oldPositionOpenNotional = $t03010430272._3 | |
667 | 667 | let oldPositionLstUpdCPF = $t03010430272._4 | |
668 | 668 | let oldPositionTimestamp = $t03010430272._5 | |
669 | 669 | let isLongPosition = (oldPositionSize > 0) | |
670 | 670 | let absOldPositionSize = abs(oldPositionSize) | |
671 | 671 | if (if ((absOldPositionSize >= _size)) | |
672 | 672 | then (_size > 0) | |
673 | 673 | else false) | |
674 | 674 | then { | |
675 | 675 | let isPartialClose = (absOldPositionSize > _size) | |
676 | 676 | let $t03056431015 = swapOutput((oldPositionSize > 0), _size, _checkMaxPriceImpact) | |
677 | 677 | let exchangedQuoteAssetAmount = $t03056431015._1 | |
678 | 678 | let quoteAssetReserveAfter = $t03056431015._2 | |
679 | 679 | let baseAssetReserveAfter = $t03056431015._3 | |
680 | 680 | let totalPositionSizeAfter = $t03056431015._4 | |
681 | 681 | let exchangedPositionSize = if ((oldPositionSize > 0)) | |
682 | 682 | then -(_size) | |
683 | 683 | else _size | |
684 | 684 | let $t03123031454 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
685 | 685 | let oldPositionNotional = $t03123031454._1 | |
686 | 686 | let unrealizedPnl = $t03123031454._2 | |
687 | 687 | let realizedRatio = divd(abs(exchangedPositionSize), absOldPositionSize) | |
688 | 688 | let realizedPnl = muld(unrealizedPnl, realizedRatio) | |
689 | 689 | let $t03179532041 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, unrealizedPnl) | |
690 | 690 | let remainMarginBefore = $t03179532041._1 | |
691 | 691 | let x1 = $t03179532041._2 | |
692 | 692 | let x2 = $t03179532041._3 | |
693 | 693 | let rolloverFee = $t03179532041._4 | |
694 | 694 | let positionBadDebt = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, realizedPnl)._2 | |
695 | 695 | let realizedCloseFee = muld(muld(oldPositionNotional, realizedRatio), _fee) | |
696 | 696 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
697 | 697 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
698 | 698 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
699 | 699 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
700 | 700 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
701 | 701 | let $t03344733833 = if ((newPositionSize == 0)) | |
702 | 702 | then $Tuple2(0, 0) | |
703 | 703 | else $Tuple2(abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize)) | |
704 | 704 | let newPositionOpenNotional = $t03344733833._1 | |
705 | 705 | let newPositionLstUpdCPF = $t03344733833._2 | |
706 | 706 | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
707 | 707 | let marginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
708 | 708 | let newPositionMarginWithSameRatio = if ((oldPositionSize > 0)) | |
709 | 709 | then (muld((newPositionOpenNotional + unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter) | |
710 | 710 | else (muld((newPositionOpenNotional - unrealizedPnlAfter), marginRatio) - unrealizedPnlAfter) | |
711 | 711 | let marginToTraderRaw = ((remainMarginBefore - (newPositionMarginWithSameRatio + unrealizedPnlAfter)) - realizedCloseFee) | |
712 | 712 | let marginToTrader = if ((0 > marginToTraderRaw)) | |
713 | 713 | then if (_liquidate) | |
714 | 714 | then 0 | |
715 | 715 | else throw("Invalid internalClosePosition params: unable to pay fee") | |
716 | 716 | else marginToTraderRaw | |
717 | 717 | let newPositionMargin = if (_addToMargin) | |
718 | 718 | then (newPositionMarginWithSameRatio + marginToTrader) | |
719 | 719 | else newPositionMarginWithSameRatio | |
720 | 720 | if (if ((_minQuoteAssetAmount != 0)) | |
721 | 721 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
722 | 722 | else false) | |
723 | 723 | then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount))) | |
724 | 724 | else $Tuple17(newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, positionBadDebt, realizedPnl, if (if (_addToMargin) | |
725 | 725 | then isPartialClose | |
726 | 726 | else false) | |
727 | 727 | then 0 | |
728 | 728 | else marginToTrader, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() - openNotionalDelta), (totalLongPositionSize() - (if (isLongPosition) | |
729 | 729 | then abs(exchangedPositionSize) | |
730 | 730 | else 0)), (totalShortPositionSize() - (if (!(isLongPosition)) | |
731 | 731 | then abs(exchangedPositionSize) | |
732 | 732 | else 0)), (openInterestLong() - (if (isLongPosition) | |
733 | 733 | then openNotionalDelta | |
734 | 734 | else 0)), (openInterestShort() - (if (!(isLongPosition)) | |
735 | 735 | then openNotionalDelta | |
736 | 736 | else 0)), (realizedCloseFee + rolloverFee), exchangedQuoteAssetAmount) | |
737 | 737 | } | |
738 | 738 | else throw(((("Invalid internalClosePosition params: invalid position size: " + toString(_size)) + " max: ") + toString(absOldPositionSize))) | |
739 | 739 | } | |
740 | 740 | ||
741 | 741 | ||
742 | 742 | func getTerminalAmmState () = { | |
743 | 743 | let _positionSize = totalPositionSize() | |
744 | 744 | if ((_positionSize == 0)) | |
745 | 745 | then $Tuple2(qtAstR(), bsAstR()) | |
746 | 746 | else { | |
747 | 747 | let direction = (_positionSize > 0) | |
748 | 748 | let $t03708037259 = swapOutput(direction, abs(_positionSize), false) | |
749 | 749 | let currentNetMarketValue = $t03708037259._1 | |
750 | 750 | let terminalQuoteAssetReserve = $t03708037259._2 | |
751 | 751 | let terminalBaseAssetReserve = $t03708037259._3 | |
752 | 752 | $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve) | |
753 | 753 | } | |
754 | 754 | } | |
755 | 755 | ||
756 | 756 | ||
757 | 757 | func getQuoteAssetWeight (baseAssetReserve,totalPositionSize,quoteAssetReserve,targetPrice) = { | |
758 | 758 | let b = toBigInt(baseAssetReserve) | |
759 | 759 | let sz = toBigInt(totalPositionSize) | |
760 | 760 | let q = toBigInt(quoteAssetReserve) | |
761 | 761 | let p = toBigInt(targetPrice) | |
762 | 762 | let k = bmuld(q, b) | |
763 | 763 | let newB = (b + sz) | |
764 | 764 | let newQ = bdivd(k, newB) | |
765 | 765 | let z = bdivd(newQ, newB) | |
766 | 766 | let result = bdivd(p, z) | |
767 | 767 | toInt(result) | |
768 | 768 | } | |
769 | 769 | ||
770 | 770 | ||
771 | 771 | func getSyncTerminalPrice (_terminalPrice,_qtAstR,_bsAstR) = { | |
772 | 772 | let _positionSize = totalPositionSize() | |
773 | 773 | if ((_positionSize == 0)) | |
774 | 774 | then { | |
775 | 775 | let newQtAstW = divd(muld(_terminalPrice, _bsAstR), _qtAstR) | |
776 | 776 | $Tuple3(newQtAstW, DECIMAL_UNIT, 0) | |
777 | 777 | } | |
778 | 778 | else { | |
779 | 779 | let direction = (_positionSize > 0) | |
780 | 780 | let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1 | |
781 | 781 | let newQtAstW = getQuoteAssetWeight(_bsAstR, _positionSize, _qtAstR, _terminalPrice) | |
782 | 782 | let newBsAstW = DECIMAL_UNIT | |
783 | 783 | let marginToVault = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, _qtAstR, newQtAstW, _bsAstR, newBsAstW, PNL_OPTION_SPOT)._2 | |
784 | 784 | $Tuple3(newQtAstW, newBsAstW, marginToVault) | |
785 | 785 | } | |
786 | 786 | } | |
787 | 787 | ||
788 | 788 | ||
789 | 789 | func getFunding () = { | |
790 | 790 | let underlyingPrice = getOraclePrice() | |
791 | 791 | let spotPrice = getSpotPrice() | |
792 | 792 | let premium = (spotPrice - underlyingPrice) | |
793 | 793 | if (if (if ((totalShortPositionSize() == 0)) | |
794 | 794 | then true | |
795 | 795 | else (totalLongPositionSize() == 0)) | |
796 | 796 | then true | |
797 | 797 | else isMarketClosed()) | |
798 | 798 | then $Tuple3(0, 0, 0) | |
799 | 799 | else if ((0 > premium)) | |
800 | 800 | then { | |
801 | 801 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
802 | 802 | if ((fundingMode() == FUNDING_ASYMMETRIC)) | |
803 | 803 | then { | |
804 | 804 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
805 | 805 | $Tuple3(shortPremiumFraction, longPremiumFraction, 0) | |
806 | 806 | } | |
807 | 807 | else { | |
808 | 808 | let shortTotalPremiumFraction = abs(muld(shortPremiumFraction, totalShortPositionSize())) | |
809 | 809 | let longTotalPremiumFraction = abs(muld(shortPremiumFraction, totalLongPositionSize())) | |
810 | 810 | let premiumToVault = (shortTotalPremiumFraction - longTotalPremiumFraction) | |
811 | 811 | $Tuple3(shortPremiumFraction, shortPremiumFraction, premiumToVault) | |
812 | 812 | } | |
813 | 813 | } | |
814 | 814 | else { | |
815 | 815 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
816 | 816 | if ((fundingMode() == FUNDING_ASYMMETRIC)) | |
817 | 817 | then { | |
818 | 818 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
819 | 819 | $Tuple3(shortPremiumFraction, longPremiumFraction, 0) | |
820 | 820 | } | |
821 | 821 | else { | |
822 | 822 | let longTotalPremiumFraction = abs(muld(longPremiumFraction, totalLongPositionSize())) | |
823 | 823 | let shortTotalPremiumFraction = abs(muld(longPremiumFraction, totalShortPositionSize())) | |
824 | 824 | let premiumToVault = (longTotalPremiumFraction - shortTotalPremiumFraction) | |
825 | 825 | $Tuple3(longPremiumFraction, longPremiumFraction, premiumToVault) | |
826 | 826 | } | |
827 | 827 | } | |
828 | 828 | } | |
829 | 829 | ||
830 | 830 | ||
831 | 831 | func getAdjustedFee (_artifactId,_baseFeeDiscount) = { | |
832 | 832 | let baseFeeRaw = fee() | |
833 | 833 | let baseFee = muld(baseFeeRaw, _baseFeeDiscount) | |
834 | 834 | let $t04183442329 = if ((_artifactId != "")) | |
835 | 835 | then { | |
836 | 836 | let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId)) | |
837 | 837 | if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE)) | |
838 | 838 | then { | |
839 | 839 | let reduction = intA(nftManagerAddress(), toCompositeKey(k_token_param, _artifactId)) | |
840 | 840 | let adjustedFee = muld(baseFee, reduction) | |
841 | 841 | $Tuple2(adjustedFee, true) | |
842 | 842 | } | |
843 | 843 | else throw("Invalid attached artifact") | |
844 | 844 | } | |
845 | 845 | else $Tuple2(baseFee, false) | |
846 | 846 | let adjustedFee = $t04183442329._1 | |
847 | 847 | let burnArtifact = $t04183442329._2 | |
848 | 848 | $Tuple2(adjustedFee, burnArtifact) | |
849 | 849 | } | |
850 | 850 | ||
851 | 851 | ||
852 | 852 | func getForTraderWithArtifact (_trader,_artifactId) = { | |
853 | 853 | let doGetFeeDiscount = invoke(minerAddress(), "computeFeeDiscount", [_trader], nil) | |
854 | 854 | if ((doGetFeeDiscount == doGetFeeDiscount)) | |
855 | 855 | then { | |
856 | 856 | let feeDiscount = match doGetFeeDiscount { | |
857 | 857 | case x: Int => | |
858 | 858 | x | |
859 | 859 | case _ => | |
860 | 860 | throw("Invalid computeFeeDiscount result") | |
861 | 861 | } | |
862 | 862 | let $t04267542749 = getAdjustedFee(_artifactId, feeDiscount) | |
863 | 863 | let adjustedFee = $t04267542749._1 | |
864 | 864 | let burnArtifact = $t04267542749._2 | |
865 | 865 | $Tuple2(adjustedFee, burnArtifact) | |
866 | 866 | } | |
867 | 867 | else throw("Strict value is not equal to itself.") | |
868 | 868 | } | |
869 | 869 | ||
870 | 870 | ||
871 | 871 | func getArtifactId (i) = { | |
872 | 872 | let artifactId = if ((size(i.payments) > 1)) | |
873 | 873 | then toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifactId")) | |
874 | 874 | else "" | |
875 | 875 | artifactId | |
876 | 876 | } | |
877 | 877 | ||
878 | 878 | ||
879 | 879 | func distributeFee (_feeAmount) = { | |
880 | 880 | let feeToStakers = muld(_feeAmount, feeToStakersPercent()) | |
881 | 881 | let feeToVault = (_feeAmount - feeToStakers) | |
882 | 882 | $Tuple2(feeToStakers, feeToVault) | |
883 | 883 | } | |
884 | 884 | ||
885 | 885 | ||
886 | 886 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _feeToStakersPercent), IntegerEntry(k_rolloverFee, _rolloverFee), IntegerEntry(k_fundingMode, _fundingMode)] | |
887 | 887 | ||
888 | 888 | ||
889 | 889 | func updateFunding (_nextFundingBlock,_latestLongCumulativePremiumFraction,_latestShortCumulativePremiumFraction,_longFundingRate,_shortFundingRate) = [IntegerEntry(k_nextFundingBlock, _nextFundingBlock), IntegerEntry(k_latestLongCumulativePremiumFraction, _latestLongCumulativePremiumFraction), IntegerEntry(k_latestShortCumulativePremiumFraction, _latestShortCumulativePremiumFraction), IntegerEntry(k_longFundingRate, _longFundingRate), IntegerEntry(k_shortFundingRate, _shortFundingRate)] | |
890 | 890 | ||
891 | 891 | ||
892 | 892 | func incrementPositionSequenceNumber (_isNewPosition,_trader,_direction) = { | |
893 | 893 | let positionKey = ((_trader + "_") + toString(_direction)) | |
894 | 894 | if (_isNewPosition) | |
895 | 895 | then { | |
896 | 896 | let currentSequence = lastSequence() | |
897 | 897 | [IntegerEntry(toCompositeKey(k_positionSequence, positionKey), (currentSequence + 1)), IntegerEntry(k_sequence, (currentSequence + 1))] | |
898 | 898 | } | |
899 | 899 | else nil | |
900 | 900 | } | |
901 | 901 | ||
902 | 902 | ||
903 | 903 | func updatePositionFee (_isNewPosition,_trader,_direction,_fee) = { | |
904 | 904 | let positionKey = ((_trader + "_") + toString(_direction)) | |
905 | 905 | if (_isNewPosition) | |
906 | 906 | then [IntegerEntry(toCompositeKey(k_positionFee, positionKey), _fee)] | |
907 | 907 | else nil | |
908 | 908 | } | |
909 | 909 | ||
910 | 910 | ||
911 | 911 | func updatePosition (_trader,_size,_margin,_openNotional,_latestCumulativePremiumFraction,_latestTimestamp) = { | |
912 | 912 | let direction = getDirection(_size) | |
913 | 913 | let positionKey = ((_trader + "_") + toString(direction)) | |
914 | 914 | [IntegerEntry(toCompositeKey(k_positionSize, positionKey), _size), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), _latestCumulativePremiumFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), _latestTimestamp)] | |
915 | 915 | } | |
916 | 916 | ||
917 | 917 | ||
918 | 918 | func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
919 | 919 | ||
920 | 920 | ||
921 | 921 | func updateAmmWeights (_qtAstW,_bsAstW) = [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
922 | 922 | ||
923 | 923 | ||
924 | 924 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize,_totalLongOpenNotional,_totalShortOpenNotional) = { | |
925 | 925 | let _qtAstW = qtAstW() | |
926 | 926 | let _bsAstW = bsAstW() | |
927 | 927 | if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
928 | 928 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
929 | 929 | else (updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize), IntegerEntry(k_openInterestLong, _totalLongOpenNotional), IntegerEntry(k_openInterestShort, _totalShortOpenNotional)]) | |
930 | 930 | } | |
931 | 931 | ||
932 | 932 | ||
933 | 933 | func deletePosition (_trader,_direction) = { | |
934 | 934 | let positionKey = ((_trader + "_") + toString(_direction)) | |
935 | 935 | [DeleteEntry(toCompositeKey(k_positionSize, positionKey)), DeleteEntry(toCompositeKey(k_positionMargin, positionKey)), DeleteEntry(toCompositeKey(k_positionOpenNotional, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey)), DeleteEntry(toCompositeKey(k_positionFee, positionKey)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey))] | |
936 | 936 | } | |
937 | 937 | ||
938 | 938 | ||
939 | 939 | func withdraw (_address,_amount) = { | |
940 | 940 | let balance = assetBalance(this, quoteAsset()) | |
941 | 941 | if ((_amount > balance)) | |
942 | 942 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
943 | 943 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
944 | 944 | } | |
945 | 945 | ||
946 | 946 | ||
947 | 947 | func updateBalance (i) = if ((0 > i)) | |
948 | 948 | then throw("Balance") | |
949 | 949 | else [IntegerEntry(k_balance, i)] | |
950 | 950 | ||
951 | 951 | ||
952 | 952 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
953 | 953 | ||
954 | 954 | ||
955 | 955 | func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact) | |
956 | 956 | then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)] | |
957 | 957 | else nil | |
958 | 958 | ||
959 | 959 | ||
960 | 960 | @Callable(i) | |
961 | 961 | func pause () = if ((i.caller != adminAddress())) | |
962 | 962 | then throw("Invalid pause params") | |
963 | 963 | else [BooleanEntry(k_paused, true)] | |
964 | 964 | ||
965 | 965 | ||
966 | 966 | ||
967 | 967 | @Callable(i) | |
968 | 968 | func unpause () = if ((i.caller != adminAddress())) | |
969 | 969 | then throw("Invalid unpause params") | |
970 | 970 | else [BooleanEntry(k_paused, false)] | |
971 | 971 | ||
972 | 972 | ||
973 | 973 | ||
974 | 974 | @Callable(i) | |
975 | 975 | func setCloseOnly () = if ((i.caller != adminAddress())) | |
976 | 976 | then throw("Invalid setCloseOnly params") | |
977 | 977 | else [BooleanEntry(k_closeOnly, true)] | |
978 | 978 | ||
979 | 979 | ||
980 | 980 | ||
981 | 981 | @Callable(i) | |
982 | 982 | func unsetCloseOnly () = if ((i.caller != adminAddress())) | |
983 | 983 | then throw("Invalid unsetCloseOnly params") | |
984 | 984 | else [BooleanEntry(k_closeOnly, false)] | |
985 | 985 | ||
986 | 986 | ||
987 | 987 | ||
988 | 988 | @Callable(i) | |
989 | 989 | func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
990 | 990 | then true | |
991 | 991 | else (0 >= _quoteAssetAmount)) | |
992 | 992 | then throw("Invalid addLiquidity params") | |
993 | 993 | else { | |
994 | 994 | let _qtAstR = qtAstR() | |
995 | 995 | let _bsAstR = bsAstR() | |
996 | 996 | let _qtAstW = qtAstW() | |
997 | 997 | let _bsAstW = bsAstW() | |
998 | 998 | let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
999 | 999 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
1000 | 1000 | let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR) | |
1001 | 1001 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
1002 | 1002 | let $t05100451155 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter) | |
1003 | 1003 | let newQuoteAssetWeight = $t05100451155._1 | |
1004 | 1004 | let newBaseAssetWeight = $t05100451155._2 | |
1005 | 1005 | let marginToVault = $t05100451155._3 | |
1006 | 1006 | let doExchangePnL = if ((marginToVault != 0)) | |
1007 | 1007 | then { | |
1008 | 1008 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
1009 | 1009 | if ((doExchangePnL == doExchangePnL)) | |
1010 | 1010 | then nil | |
1011 | 1011 | else throw("Strict value is not equal to itself.") | |
1012 | 1012 | } | |
1013 | 1013 | else nil | |
1014 | 1014 | if ((doExchangePnL == doExchangePnL)) | |
1015 | 1015 | then (updateAmmReserves(qtAstRAfter, bsAstRAfter) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1016 | 1016 | else throw("Strict value is not equal to itself.") | |
1017 | 1017 | } | |
1018 | 1018 | ||
1019 | 1019 | ||
1020 | 1020 | ||
1021 | 1021 | @Callable(i) | |
1022 | 1022 | func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
1023 | 1023 | then true | |
1024 | 1024 | else (_quoteAssetAmount >= 0)) | |
1025 | 1025 | then throw("Invalid removeLiquidity params") | |
1026 | 1026 | else { | |
1027 | 1027 | let _qtAstR = qtAstR() | |
1028 | 1028 | let _bsAstR = bsAstR() | |
1029 | 1029 | let _qtAstW = qtAstW() | |
1030 | 1030 | let _bsAstW = bsAstW() | |
1031 | 1031 | let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
1032 | 1032 | let qtAstRAfter = (_qtAstR - _quoteAssetAmount) | |
1033 | 1033 | let baseAssetAmountToRemove = abs((divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR)) | |
1034 | 1034 | let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove) | |
1035 | 1035 | let $t05225152402 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter) | |
1036 | 1036 | let newQuoteAssetWeight = $t05225152402._1 | |
1037 | 1037 | let newBaseAssetWeight = $t05225152402._2 | |
1038 | 1038 | let marginToVault = $t05225152402._3 | |
1039 | 1039 | let doExchangePnL = if ((marginToVault != 0)) | |
1040 | 1040 | then { | |
1041 | 1041 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
1042 | 1042 | if ((doExchangePnL == doExchangePnL)) | |
1043 | 1043 | then nil | |
1044 | 1044 | else throw("Strict value is not equal to itself.") | |
1045 | 1045 | } | |
1046 | 1046 | else nil | |
1047 | 1047 | if ((doExchangePnL == doExchangePnL)) | |
1048 | 1048 | then (updateAmmReserves(qtAstRAfter, bsAstRAfter) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1049 | 1049 | else throw("Strict value is not equal to itself.") | |
1050 | 1050 | } | |
1051 | 1051 | ||
1052 | 1052 | ||
1053 | 1053 | ||
1054 | 1054 | @Callable(i) | |
1055 | 1055 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _fundingPeriod)) | |
1056 | 1056 | then true | |
1057 | 1057 | else (0 >= _initMarginRatio)) | |
1058 | 1058 | then true | |
1059 | 1059 | else (0 >= _mmr)) | |
1060 | 1060 | then true | |
1061 | 1061 | else (0 >= _liquidationFeeRatio)) | |
1062 | 1062 | then true | |
1063 | 1063 | else (0 >= _fee)) | |
1064 | 1064 | then true | |
1065 | 1065 | else (0 >= _spreadLimit)) | |
1066 | 1066 | then true | |
1067 | 1067 | else (0 >= _maxPriceImpact)) | |
1068 | 1068 | then true | |
1069 | 1069 | else (0 >= _partialLiquidationRatio)) | |
1070 | 1070 | then true | |
1071 | 1071 | else (0 >= _maxPriceSpread)) | |
1072 | 1072 | then true | |
1073 | 1073 | else (0 >= _maxOpenNotional)) | |
1074 | 1074 | then true | |
1075 | 1075 | else (0 >= _feeToStakersPercent)) | |
1076 | 1076 | then true | |
1077 | 1077 | else (_feeToStakersPercent > DECIMAL_UNIT)) | |
1078 | 1078 | then true | |
1079 | 1079 | else (0 >= _maxOracleDelay)) | |
1080 | 1080 | then true | |
1081 | 1081 | else (0 >= _rolloverFee)) | |
1082 | 1082 | then true | |
1083 | 1083 | else if ((_fundingMode != FUNDING_SYMMETRIC)) | |
1084 | 1084 | then (_fundingMode != FUNDING_ASYMMETRIC) | |
1085 | 1085 | else false) | |
1086 | 1086 | then true | |
1087 | 1087 | else !(initialized())) | |
1088 | 1088 | then true | |
1089 | 1089 | else (i.caller != adminAddress())) | |
1090 | 1090 | then throw("Invalid changeSettings params") | |
1091 | 1091 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode) | |
1092 | 1092 | ||
1093 | 1093 | ||
1094 | 1094 | ||
1095 | 1095 | @Callable(i) | |
1096 | 1096 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_baseOracleData,_quoteOracleData,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay,_rolloverFee,_fundingMode) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
1097 | 1097 | then true | |
1098 | 1098 | else (0 >= _bsAstR)) | |
1099 | 1099 | then true | |
1100 | 1100 | else (0 >= _fundingPeriod)) | |
1101 | 1101 | then true | |
1102 | 1102 | else (0 >= _initMarginRatio)) | |
1103 | 1103 | then true | |
1104 | 1104 | else (0 >= _mmr)) | |
1105 | 1105 | then true | |
1106 | 1106 | else (0 >= _liquidationFeeRatio)) | |
1107 | 1107 | then true | |
1108 | 1108 | else (0 >= _fee)) | |
1109 | 1109 | then true | |
1110 | 1110 | else (0 >= _spreadLimit)) | |
1111 | 1111 | then true | |
1112 | 1112 | else (0 >= _maxPriceImpact)) | |
1113 | 1113 | then true | |
1114 | 1114 | else (0 >= _partialLiquidationRatio)) | |
1115 | 1115 | then true | |
1116 | 1116 | else (0 >= _maxPriceSpread)) | |
1117 | 1117 | then true | |
1118 | 1118 | else (0 >= _maxOpenNotional)) | |
1119 | 1119 | then true | |
1120 | 1120 | else (0 >= _feeToStakersPercent)) | |
1121 | 1121 | then true | |
1122 | 1122 | else (_feeToStakersPercent > DECIMAL_UNIT)) | |
1123 | 1123 | then true | |
1124 | 1124 | else (0 >= _maxOracleDelay)) | |
1125 | 1125 | then true | |
1126 | 1126 | else (0 >= _rolloverFee)) | |
1127 | 1127 | then true | |
1128 | 1128 | else if ((_fundingMode != FUNDING_SYMMETRIC)) | |
1129 | 1129 | then (_fundingMode != FUNDING_ASYMMETRIC) | |
1130 | 1130 | else false) | |
1131 | 1131 | then true | |
1132 | 1132 | else initialized()) | |
1133 | 1133 | then true | |
1134 | 1134 | else (i.caller != this)) | |
1135 | 1135 | then throw("Invalid initialize parameters") | |
1136 | 1136 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay, _rolloverFee, _fundingMode)) ++ updateFunding((lastTimestamp() + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_baseOracle, _baseOracleData), StringEntry(k_quoteOracle, _quoteOracleData), StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator)))]) | |
1137 | 1137 | ||
1138 | 1138 | ||
1139 | 1139 | ||
1140 | 1140 | @Callable(i) | |
1141 | 1141 | func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink) = { | |
1142 | 1142 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1143 | 1143 | if ((sync == sync)) | |
1144 | 1144 | then { | |
1145 | 1145 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1146 | 1146 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1147 | 1147 | then { | |
1148 | 1148 | let _trader = getActualCaller(i) | |
1149 | 1149 | let _rawAmount = i.payments[0].amount | |
1150 | 1150 | let _assetId = i.payments[0].assetId | |
1151 | 1151 | let _assetIdStr = toBase58String(value(_assetId)) | |
1152 | 1152 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1153 | 1153 | if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
1154 | 1154 | then (_direction != DIR_SHORT) | |
1155 | 1155 | else false) | |
1156 | 1156 | then true | |
1157 | 1157 | else (0 >= _rawAmount)) | |
1158 | 1158 | then true | |
1159 | 1159 | else !(initialized())) | |
1160 | 1160 | then true | |
1161 | 1161 | else !(isQuoteAsset)) | |
1162 | 1162 | then true | |
1163 | 1163 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
1164 | 1164 | then true | |
1165 | 1165 | else paused()) | |
1166 | 1166 | then true | |
1167 | 1167 | else closeOnly()) | |
1168 | 1168 | then true | |
1169 | 1169 | else isMarketClosed()) | |
1170 | 1170 | then throw("Invalid increasePosition parameters") | |
1171 | 1171 | else { | |
1172 | 1172 | let $t05847258621 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1173 | 1173 | let adjustedFee = $t05847258621._1 | |
1174 | 1174 | let burnArtifact = $t05847258621._2 | |
1175 | 1175 | let _amount = divd(_rawAmount, (muld(adjustedFee, _leverage) + DECIMAL_UNIT)) | |
1176 | 1176 | let distributeFeeAmount = (_rawAmount - _amount) | |
1177 | 1177 | let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)]) | |
1178 | 1178 | if ((referrerFeeAny == referrerFeeAny)) | |
1179 | 1179 | then { | |
1180 | 1180 | let referrerFee = match referrerFeeAny { | |
1181 | 1181 | case x: Int => | |
1182 | 1182 | x | |
1183 | 1183 | case _ => | |
1184 | 1184 | throw("Invalid referrerFee") | |
1185 | 1185 | } | |
1186 | 1186 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1187 | 1187 | let $t05911759297 = getPosition(_trader, _direction) | |
1188 | 1188 | let oldPositionSize = $t05911759297._1 | |
1189 | 1189 | let oldPositionMargin = $t05911759297._2 | |
1190 | 1190 | let oldPositionOpenNotional = $t05911759297._3 | |
1191 | 1191 | let oldPositionLstUpdCPF = $t05911759297._4 | |
1192 | 1192 | let oldPositionTimestamp = $t05911759297._5 | |
1193 | 1193 | let isNewPosition = (oldPositionSize == 0) | |
1194 | 1194 | let isSameDirection = if ((oldPositionSize > 0)) | |
1195 | 1195 | then (_direction == DIR_LONG) | |
1196 | 1196 | else (_direction == DIR_SHORT) | |
1197 | 1197 | let expandExisting = if (!(isNewPosition)) | |
1198 | 1198 | then isSameDirection | |
1199 | 1199 | else false | |
1200 | 1200 | let isAdd = (_direction == DIR_LONG) | |
1201 | 1201 | let $t05958662719 = if (if (isNewPosition) | |
1202 | 1202 | then true | |
1203 | 1203 | else expandExisting) | |
1204 | 1204 | then { | |
1205 | 1205 | let openNotional = muld(_amount, _leverage) | |
1206 | 1206 | let $t06009560268 = swapInput(isAdd, openNotional) | |
1207 | 1207 | let amountBaseAssetBought = $t06009560268._1 | |
1208 | 1208 | let quoteAssetReserveAfter = $t06009560268._2 | |
1209 | 1209 | let baseAssetReserveAfter = $t06009560268._3 | |
1210 | 1210 | let totalPositionSizeAfter = $t06009560268._4 | |
1211 | 1211 | if (if ((_minBaseAssetAmount != 0)) | |
1212 | 1212 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
1213 | 1213 | else false) | |
1214 | 1214 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
1215 | 1215 | else { | |
1216 | 1216 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
1217 | 1217 | let totalLongOpenInterestAfter = (openInterestLong() + (if ((newPositionSize > 0)) | |
1218 | 1218 | then openNotional | |
1219 | 1219 | else 0)) | |
1220 | 1220 | let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize)) | |
1221 | 1221 | then openNotional | |
1222 | 1222 | else 0)) | |
1223 | 1223 | let $t06081461089 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, _amount) | |
1224 | 1224 | let remainMargin = $t06081461089._1 | |
1225 | 1225 | let x1 = $t06081461089._2 | |
1226 | 1226 | let x2 = $t06081461089._3 | |
1227 | 1227 | let rolloverFee = $t06081461089._4 | |
1228 | 1228 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
1229 | 1229 | then throw("Over max spread limit") | |
1230 | 1230 | else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter))) | |
1231 | 1231 | then throw("Over max open notional") | |
1232 | 1232 | else $Tuple14(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), lastTimestamp(), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
1233 | 1233 | then abs(amountBaseAssetBought) | |
1234 | 1234 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
1235 | 1235 | then abs(amountBaseAssetBought) | |
1236 | 1236 | else 0)), totalLongOpenInterestAfter, totalShortOpenInterestAfter, rolloverFee) | |
1237 | 1237 | } | |
1238 | 1238 | } | |
1239 | 1239 | else { | |
1240 | 1240 | let openNotional = muld(_amount, _leverage) | |
1241 | 1241 | let $t06240762535 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), _direction, PNL_OPTION_SPOT) | |
1242 | 1242 | let oldPositionNotional = $t06240762535._1 | |
1243 | 1243 | let unrealizedPnl = $t06240762535._2 | |
1244 | 1244 | if ((oldPositionNotional > openNotional)) | |
1245 | 1245 | then throw("Use decreasePosition to decrease position size") | |
1246 | 1246 | else throw("Close position first") | |
1247 | 1247 | } | |
1248 | 1248 | let newPositionSize = $t05958662719._1 | |
1249 | 1249 | let newPositionRemainMargin = $t05958662719._2 | |
1250 | 1250 | let newPositionOpenNotional = $t05958662719._3 | |
1251 | 1251 | let newPositionLatestCPF = $t05958662719._4 | |
1252 | 1252 | let newPositionTimestamp = $t05958662719._5 | |
1253 | 1253 | let baseAssetReserveAfter = $t05958662719._6 | |
1254 | 1254 | let quoteAssetReserveAfter = $t05958662719._7 | |
1255 | 1255 | let totalPositionSizeAfter = $t05958662719._8 | |
1256 | 1256 | let openInterestNotionalAfter = $t05958662719._9 | |
1257 | 1257 | let totalLongAfter = $t05958662719._10 | |
1258 | 1258 | let totalShortAfter = $t05958662719._11 | |
1259 | 1259 | let totalLongOpenInterestAfter = $t05958662719._12 | |
1260 | 1260 | let totalShortOpenInterestAfter = $t05958662719._13 | |
1261 | 1261 | let rolloverFee = $t05958662719._14 | |
1262 | 1262 | let $t06272562796 = distributeFee((feeAmount + rolloverFee)) | |
1263 | 1263 | let feeToStakers = $t06272562796._1 | |
1264 | 1264 | let feeToVault = $t06272562796._2 | |
1265 | 1265 | let stake = if ((_amount >= rolloverFee)) | |
1266 | 1266 | then invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), (_amount - rolloverFee))]) | |
1267 | 1267 | else invoke(vaultAddress(), "withdrawLocked", [(rolloverFee - _amount)], nil) | |
1268 | 1268 | if ((stake == stake)) | |
1269 | 1269 | then { | |
1270 | 1270 | let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1271 | 1271 | if ((depositVault == depositVault)) | |
1272 | 1272 | then { | |
1273 | 1273 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
1274 | 1274 | if ((notifyFee == notifyFee)) | |
1275 | 1275 | then { | |
1276 | 1276 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1277 | 1277 | if ((notifyNotional == notifyNotional)) | |
1278 | 1278 | then ((((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF, newPositionTimestamp) ++ incrementPositionSequenceNumber(isNewPosition, _trader, _direction)) ++ updatePositionFee(isNewPosition, _trader, _direction, adjustedFee)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ transferFee(feeToStakers)) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doBurnArtifact(burnArtifact, i)) | |
1279 | 1279 | else throw("Strict value is not equal to itself.") | |
1280 | 1280 | } | |
1281 | 1281 | else throw("Strict value is not equal to itself.") | |
1282 | 1282 | } | |
1283 | 1283 | else throw("Strict value is not equal to itself.") | |
1284 | 1284 | } | |
1285 | 1285 | else throw("Strict value is not equal to itself.") | |
1286 | 1286 | } | |
1287 | 1287 | else throw("Strict value is not equal to itself.") | |
1288 | 1288 | } | |
1289 | 1289 | } | |
1290 | 1290 | else throw("Strict value is not equal to itself.") | |
1291 | 1291 | } | |
1292 | 1292 | else throw("Strict value is not equal to itself.") | |
1293 | 1293 | } | |
1294 | 1294 | ||
1295 | 1295 | ||
1296 | 1296 | ||
1297 | 1297 | @Callable(i) | |
1298 | 1298 | func addMargin (_direction) = { | |
1299 | 1299 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1300 | 1300 | if ((sync == sync)) | |
1301 | 1301 | then { | |
1302 | 1302 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1303 | 1303 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1304 | 1304 | then { | |
1305 | 1305 | let _trader = toString(i.caller) | |
1306 | 1306 | let _amount = i.payments[0].amount | |
1307 | 1307 | let _assetId = i.payments[0].assetId | |
1308 | 1308 | let _assetIdStr = toBase58String(value(_assetId)) | |
1309 | 1309 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1310 | 1310 | if (if (if (if (if (!(isQuoteAsset)) | |
1311 | 1311 | then true | |
1312 | 1312 | else !(requireOpenPosition(toString(i.caller), _direction))) | |
1313 | 1313 | then true | |
1314 | 1314 | else !(initialized())) | |
1315 | 1315 | then true | |
1316 | 1316 | else paused()) | |
1317 | 1317 | then true | |
1318 | 1318 | else isMarketClosed()) | |
1319 | 1319 | then throw("Invalid addMargin parameters") | |
1320 | 1320 | else { | |
1321 | 1321 | let $t06504365223 = getPosition(_trader, _direction) | |
1322 | 1322 | let oldPositionSize = $t06504365223._1 | |
1323 | 1323 | let oldPositionMargin = $t06504365223._2 | |
1324 | 1324 | let oldPositionOpenNotional = $t06504365223._3 | |
1325 | 1325 | let oldPositionLstUpdCPF = $t06504365223._4 | |
1326 | 1326 | let oldPositionTimestamp = $t06504365223._5 | |
1327 | 1327 | let stake = invoke(vaultAddress(), "addLocked", nil, [AttachedPayment(quoteAsset(), _amount)]) | |
1328 | 1328 | if ((stake == stake)) | |
1329 | 1329 | then { | |
1330 | 1330 | let rolloverFee = calcRolloverFee(oldPositionMargin, oldPositionTimestamp) | |
1331 | 1331 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1332 | 1332 | then { | |
1333 | 1333 | let $t06550865567 = distributeFee(rolloverFee) | |
1334 | 1334 | let feeToStakers = $t06550865567._1 | |
1335 | 1335 | let feeToVault = $t06550865567._2 | |
1336 | 1336 | let unstake = invoke(vaultAddress(), "withdrawLocked", [feeToStakers], nil) | |
1337 | 1337 | if ((unstake == unstake)) | |
1338 | 1338 | then { | |
1339 | 1339 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil) | |
1340 | 1340 | if ((lockBadDebt == lockBadDebt)) | |
1341 | 1341 | then transferFee(feeToStakers) | |
1342 | 1342 | else throw("Strict value is not equal to itself.") | |
1343 | 1343 | } | |
1344 | 1344 | else throw("Strict value is not equal to itself.") | |
1345 | 1345 | } | |
1346 | 1346 | else nil | |
1347 | 1347 | if ((doTransferFeeToStakers == doTransferFeeToStakers)) | |
1348 | 1348 | then ((updatePosition(_trader, oldPositionSize, ((oldPositionMargin - rolloverFee) + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF, lastTimestamp()) ++ updateBalance(((cbalance() + _amount) - rolloverFee))) ++ doTransferFeeToStakers) | |
1349 | 1349 | else throw("Strict value is not equal to itself.") | |
1350 | 1350 | } | |
1351 | 1351 | else throw("Strict value is not equal to itself.") | |
1352 | 1352 | } | |
1353 | 1353 | } | |
1354 | 1354 | else throw("Strict value is not equal to itself.") | |
1355 | 1355 | } | |
1356 | 1356 | else throw("Strict value is not equal to itself.") | |
1357 | 1357 | } | |
1358 | 1358 | ||
1359 | 1359 | ||
1360 | 1360 | ||
1361 | 1361 | @Callable(i) | |
1362 | 1362 | func removeMargin (_amount,_direction) = { | |
1363 | 1363 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1364 | 1364 | if ((sync == sync)) | |
1365 | 1365 | then { | |
1366 | 1366 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1367 | 1367 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1368 | 1368 | then { | |
1369 | 1369 | let _trader = toString(i.caller) | |
1370 | 1370 | if (if (if (if (if ((0 >= _amount)) | |
1371 | 1371 | then true | |
1372 | 1372 | else !(requireOpenPosition(_trader, _direction))) | |
1373 | 1373 | then true | |
1374 | 1374 | else !(initialized())) | |
1375 | 1375 | then true | |
1376 | 1376 | else paused()) | |
1377 | 1377 | then true | |
1378 | 1378 | else isMarketClosed()) | |
1379 | 1379 | then throw("Invalid removeMargin parameters") | |
1380 | 1380 | else { | |
1381 | 1381 | let $t06697167151 = getPosition(_trader, _direction) | |
1382 | 1382 | let oldPositionSize = $t06697167151._1 | |
1383 | 1383 | let oldPositionMargin = $t06697167151._2 | |
1384 | 1384 | let oldPositionOpenNotional = $t06697167151._3 | |
1385 | 1385 | let oldPositionLstUpdCPF = $t06697167151._4 | |
1386 | 1386 | let oldPositionTimestamp = $t06697167151._5 | |
1387 | 1387 | let $t06715767406 = calcRemainMarginWithFundingPaymentAndRolloverFee(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, oldPositionTimestamp, -(_amount)) | |
1388 | 1388 | let remainMargin = $t06715767406._1 | |
1389 | 1389 | let badDebt = $t06715767406._2 | |
1390 | 1390 | let fundingPayment = $t06715767406._3 | |
1391 | 1391 | let rolloverFee = $t06715767406._4 | |
1392 | 1392 | if ((badDebt != 0)) | |
1393 | 1393 | then throw("Invalid removed margin amount") | |
1394 | 1394 | else { | |
1395 | 1395 | let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional) | |
1396 | 1396 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
1397 | 1397 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1398 | 1398 | else { | |
1399 | 1399 | let $t06779267851 = distributeFee(rolloverFee) | |
1400 | 1400 | let feeToStakers = $t06779267851._1 | |
1401 | 1401 | let feeToVault = $t06779267851._2 | |
1402 | 1402 | let doTransferFeeToStakers = if ((rolloverFee > 0)) | |
1403 | 1403 | then { | |
1404 | 1404 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(feeToVault)], nil) | |
1405 | 1405 | if ((lockBadDebt == lockBadDebt)) | |
1406 | 1406 | then transferFee(feeToStakers) | |
1407 | 1407 | else throw("Strict value is not equal to itself.") | |
1408 | 1408 | } | |
1409 | 1409 | else nil | |
1410 | 1410 | if ((doTransferFeeToStakers == doTransferFeeToStakers)) | |
1411 | 1411 | then { | |
1412 | 1412 | let unstake = invoke(vaultAddress(), "withdrawLocked", [(_amount + feeToStakers)], nil) | |
1413 | 1413 | if ((unstake == unstake)) | |
1414 | 1414 | then (((updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize), lastTimestamp()) ++ withdraw(i.caller, _amount)) ++ updateBalance(((cbalance() - _amount) - rolloverFee))) ++ doTransferFeeToStakers) | |
1415 | 1415 | else throw("Strict value is not equal to itself.") | |
1416 | 1416 | } | |
1417 | 1417 | else throw("Strict value is not equal to itself.") | |
1418 | 1418 | } | |
1419 | 1419 | } | |
1420 | 1420 | } | |
1421 | 1421 | } | |
1422 | 1422 | else throw("Strict value is not equal to itself.") | |
1423 | 1423 | } | |
1424 | 1424 | else throw("Strict value is not equal to itself.") | |
1425 | 1425 | } | |
1426 | 1426 | ||
1427 | 1427 | ||
1428 | 1428 | ||
1429 | 1429 | @Callable(i) | |
1430 | 1430 | func closePosition (_size,_direction,_minQuoteAssetAmount,_addToMargin) = { | |
1431 | 1431 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1432 | 1432 | if ((sync == sync)) | |
1433 | 1433 | then { | |
1434 | 1434 | let ensureCalledOnce = invoke(this, "ensureCalledOnce", nil, nil) | |
1435 | 1435 | if ((ensureCalledOnce == ensureCalledOnce)) | |
1436 | 1436 | then { | |
1437 | 1437 | let _trader = getActualCaller(i) | |
1438 | 1438 | let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller") | |
1439 | 1439 | let positionFee = getPositionFee(_trader) | |
1440 | 1440 | if (if (if (if (if (if (!(requireOpenPosition(_trader, _direction))) | |
1441 | 1441 | then true | |
1442 | 1442 | else !(initialized())) | |
1443 | 1443 | then true | |
1444 | 1444 | else paused()) | |
1445 | 1445 | then true | |
1446 | 1446 | else (0 >= _size)) | |
1447 | 1447 | then true | |
1448 | 1448 | else (0 > _minQuoteAssetAmount)) | |
1449 | 1449 | then true | |
1450 | 1450 | else isMarketClosed()) | |
1451 | 1451 | then throw("Invalid closePosition parameters") | |
1452 | 1452 | else { | |
1453 | 1453 | let oldPositionTimestamp = getPosition(_trader, _direction)._5 | |
1454 | 1454 | let $t07006770670 = internalClosePosition(_trader, _direction, _size, positionFee, _minQuoteAssetAmount, _addToMargin, true, true) | |
1455 | 1455 | let newPositionSize = $t07006770670._1 | |
1456 | 1456 | let newPositionMargin = $t07006770670._2 | |
1457 | 1457 | let newPositionOpenNotional = $t07006770670._3 | |
1458 | 1458 | let newPositionLstUpdCPF = $t07006770670._4 | |
1459 | 1459 | let positionBadDebt = $t07006770670._5 | |
1460 | 1460 | let realizedPnl = $t07006770670._6 | |
1461 | 1461 | let marginToTrader = $t07006770670._7 | |
1462 | 1462 | let quoteAssetReserveAfter = $t07006770670._8 | |
1463 | 1463 | let baseAssetReserveAfter = $t07006770670._9 | |
1464 | 1464 | let totalPositionSizeAfter = $t07006770670._10 | |
1465 | 1465 | let openInterestNotionalAfter = $t07006770670._11 | |
1466 | 1466 | let totalLongAfter = $t07006770670._12 | |
1467 | 1467 | let totalShortAfter = $t07006770670._13 | |
1468 | 1468 | let totalLongOpenInterestAfter = $t07006770670._14 | |
1469 | 1469 | let totalShortOpenInterestAfter = $t07006770670._15 | |
1470 | 1470 | let realizedFee = $t07006770670._16 | |
1471 | 1471 | if ((positionBadDebt > 0)) | |
1472 | 1472 | then throw("Invalid closePosition parameters: bad debt") | |
1473 | 1473 | else if ((oldPositionTimestamp >= lastTimestamp())) | |
1474 | 1474 | then throw("Invalid closePosition parameters: wait at least 1 block before closing the position") | |
1475 | 1475 | else { | |
1476 | 1476 | let isPartialClose = (newPositionSize != 0) | |
1477 | 1477 | let withdrawAmount = (marginToTrader + realizedFee) | |
1478 | 1478 | let ammBalance = (cbalance() - withdrawAmount) | |
1479 | 1479 | let ammNewBalance = if ((0 > ammBalance)) | |
1480 | 1480 | then 0 | |
1481 | 1481 | else ammBalance | |
1482 | 1482 | let unstake = invoke(vaultAddress(), "withdrawLocked", [withdrawAmount], nil) | |
1483 | 1483 | if ((unstake == unstake)) | |
1484 | 1484 | then { | |
1485 | 1485 | let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), realizedFee)]) | |
1486 | 1486 | if ((referrerFeeAny == referrerFeeAny)) | |
1487 | 1487 | then { | |
1488 | 1488 | let referrerFee = match referrerFeeAny { | |
1489 | 1489 | case x: Int => | |
1490 | 1490 | x | |
1491 | 1491 | case _ => | |
1492 | 1492 | throw("Invalid referrerFee") | |
1493 | 1493 | } | |
1494 | 1494 | let $t07164271715 = distributeFee((realizedFee - referrerFee)) | |
1495 | 1495 | let feeToStakers = $t07164271715._1 | |
1496 | 1496 | let feeToVault = $t07164271715._2 | |
1497 | 1497 | let depositVault = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1498 | 1498 | if ((depositVault == depositVault)) | |
1499 | 1499 | then { | |
1500 | 1500 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, realizedFee], nil) | |
1501 | 1501 | if ((notifyFee == notifyFee)) | |
1502 | 1502 | then { | |
1503 | 1503 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1504 | 1504 | if ((notifyNotional == notifyNotional)) | |
1505 | 1505 | then (((((if (isPartialClose) | |
1506 | 1506 | then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp()) | |
1507 | 1507 | else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ (if ((marginToTrader > 0)) | |
1508 | 1508 | then withdraw(_traderAddress, marginToTrader) | |
1509 | 1509 | else nil)) ++ updateBalance(ammNewBalance)) ++ transferFee(feeToStakers)) | |
1510 | 1510 | else throw("Strict value is not equal to itself.") | |
1511 | 1511 | } | |
1512 | 1512 | else throw("Strict value is not equal to itself.") | |
1513 | 1513 | } | |
1514 | 1514 | else throw("Strict value is not equal to itself.") | |
1515 | 1515 | } | |
1516 | 1516 | else throw("Strict value is not equal to itself.") | |
1517 | 1517 | } | |
1518 | 1518 | else throw("Strict value is not equal to itself.") | |
1519 | 1519 | } | |
1520 | 1520 | } | |
1521 | 1521 | } | |
1522 | 1522 | else throw("Strict value is not equal to itself.") | |
1523 | 1523 | } | |
1524 | 1524 | else throw("Strict value is not equal to itself.") | |
1525 | 1525 | } | |
1526 | 1526 | ||
1527 | 1527 | ||
1528 | 1528 | ||
1529 | 1529 | @Callable(i) | |
1530 | 1530 | func liquidate (_trader,_direction) = { | |
1531 | 1531 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1532 | 1532 | if ((sync == sync)) | |
1533 | 1533 | then { | |
1534 | 1534 | let spotMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_SPOT) | |
1535 | 1535 | let liquidationMarginRatio = if (isOverFluctuationLimit()) | |
1536 | 1536 | then { | |
1537 | 1537 | let oracleMarginRatio = getMarginRatioByOption(_trader, _direction, PNL_OPTION_ORACLE) | |
1538 | 1538 | vmax(spotMarginRatio, oracleMarginRatio) | |
1539 | 1539 | } | |
1540 | 1540 | else spotMarginRatio | |
1541 | 1541 | if (if (if (if (if (!(requireMoreMarginRatio(liquidationMarginRatio, maintenanceMarginRatio(), false))) | |
1542 | 1542 | then true | |
1543 | 1543 | else !(requireOpenPosition(_trader, _direction))) | |
1544 | 1544 | then true | |
1545 | 1545 | else !(initialized())) | |
1546 | 1546 | then true | |
1547 | 1547 | else paused()) | |
1548 | 1548 | then true | |
1549 | 1549 | else isMarketClosed()) | |
1550 | 1550 | then throw("Unable to liquidate") | |
1551 | 1551 | else { | |
1552 | 1552 | let isPartialLiquidation = if (if ((spotMarginRatio > liquidationFeeRatio())) | |
1553 | 1553 | then (partialLiquidationRatio() > 0) | |
1554 | 1554 | else false) | |
1555 | 1555 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1556 | 1556 | else false | |
1557 | 1557 | let oldPositionSize = getPosition(_trader, _direction)._1 | |
1558 | 1558 | let positionSizeAbs = abs(oldPositionSize) | |
1559 | 1559 | let $t07421374536 = if (isPartialLiquidation) | |
1560 | 1560 | then { | |
1561 | 1561 | let liquidationSize = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1562 | 1562 | let liquidationRatio = divd(abs(liquidationSize), positionSizeAbs) | |
1563 | 1563 | $Tuple2(liquidationRatio, abs(liquidationSize)) | |
1564 | 1564 | } | |
1565 | 1565 | else $Tuple2(0, positionSizeAbs) | |
1566 | 1566 | let liquidationRatio = $t07421374536._1 | |
1567 | 1567 | let liquidationSize = $t07421374536._2 | |
1568 | 1568 | let $t07454275198 = internalClosePosition(_trader, _direction, if (isPartialLiquidation) | |
1569 | 1569 | then liquidationSize | |
1570 | 1570 | else positionSizeAbs, liquidationFeeRatio(), 0, true, false, true) | |
1571 | 1571 | let newPositionSize = $t07454275198._1 | |
1572 | 1572 | let newPositionMargin = $t07454275198._2 | |
1573 | 1573 | let newPositionOpenNotional = $t07454275198._3 | |
1574 | 1574 | let newPositionLstUpdCPF = $t07454275198._4 | |
1575 | 1575 | let positionBadDebt = $t07454275198._5 | |
1576 | 1576 | let realizedPnl = $t07454275198._6 | |
1577 | 1577 | let marginToTrader = $t07454275198._7 | |
1578 | 1578 | let quoteAssetReserveAfter = $t07454275198._8 | |
1579 | 1579 | let baseAssetReserveAfter = $t07454275198._9 | |
1580 | 1580 | let totalPositionSizeAfter = $t07454275198._10 | |
1581 | 1581 | let openInterestNotionalAfter = $t07454275198._11 | |
1582 | 1582 | let totalLongAfter = $t07454275198._12 | |
1583 | 1583 | let totalShortAfter = $t07454275198._13 | |
1584 | 1584 | let totalLongOpenInterestAfter = $t07454275198._14 | |
1585 | 1585 | let totalShortOpenInterestAfter = $t07454275198._15 | |
1586 | 1586 | let liquidationPenalty = $t07454275198._16 | |
1587 | 1587 | let feeToLiquidator = (liquidationPenalty / 2) | |
1588 | 1588 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1589 | 1589 | let ammBalance = (cbalance() - liquidationPenalty) | |
1590 | 1590 | let newAmmBalance = if ((0 > ammBalance)) | |
1591 | 1591 | then 0 | |
1592 | 1592 | else ammBalance | |
1593 | 1593 | let lockBadDebt = if ((positionBadDebt > 0)) | |
1594 | 1594 | then { | |
1595 | 1595 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [(positionBadDebt + liquidationPenalty)], nil) | |
1596 | 1596 | if ((lockBadDebt == lockBadDebt)) | |
1597 | 1597 | then nil | |
1598 | 1598 | else throw("Strict value is not equal to itself.") | |
1599 | 1599 | } | |
1600 | 1600 | else nil | |
1601 | 1601 | if ((lockBadDebt == lockBadDebt)) | |
1602 | 1602 | then { | |
1603 | 1603 | let unstake = invoke(vaultAddress(), "withdrawLocked", [liquidationPenalty], nil) | |
1604 | 1604 | if ((unstake == unstake)) | |
1605 | 1605 | then { | |
1606 | 1606 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1607 | 1607 | if ((depositInsurance == depositInsurance)) | |
1608 | 1608 | then { | |
1609 | 1609 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1610 | 1610 | if ((notifyNotional == notifyNotional)) | |
1611 | 1611 | then ((((if (isPartialLiquidation) | |
1612 | 1612 | then updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, lastTimestamp()) | |
1613 | 1613 | else deletePosition(_trader, _direction)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1614 | 1614 | else throw("Strict value is not equal to itself.") | |
1615 | 1615 | } | |
1616 | 1616 | else throw("Strict value is not equal to itself.") | |
1617 | 1617 | } | |
1618 | 1618 | else throw("Strict value is not equal to itself.") | |
1619 | 1619 | } | |
1620 | 1620 | else throw("Strict value is not equal to itself.") | |
1621 | 1621 | } | |
1622 | 1622 | } | |
1623 | 1623 | else throw("Strict value is not equal to itself.") | |
1624 | 1624 | } | |
1625 | 1625 | ||
1626 | 1626 | ||
1627 | 1627 | ||
1628 | 1628 | @Callable(i) | |
1629 | 1629 | func payFunding () = { | |
1630 | 1630 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1631 | 1631 | if ((sync == sync)) | |
1632 | 1632 | then { | |
1633 | 1633 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
1634 | 1634 | if (if (if ((fundingBlockTimestamp > lastTimestamp())) | |
1635 | 1635 | then true | |
1636 | 1636 | else !(initialized())) | |
1637 | 1637 | then true | |
1638 | 1638 | else paused()) | |
1639 | 1639 | then throw(((("Invalid funding block timestamp: " + toString(lastTimestamp())) + " < ") + toString(fundingBlockTimestamp))) | |
1640 | 1640 | else { | |
1641 | 1641 | let underlyingPrice = getOraclePrice() | |
1642 | 1642 | let $t07732377401 = getFunding() | |
1643 | 1643 | let shortPremiumFraction = $t07732377401._1 | |
1644 | 1644 | let longPremiumFraction = $t07732377401._2 | |
1645 | 1645 | let premiumToVault = $t07732377401._3 | |
1646 | 1646 | let doPayFundingToVault = if ((premiumToVault > 0)) | |
1647 | 1647 | then { | |
1648 | 1648 | let doPayFundingToVault = invoke(vaultAddress(), "exchangeFreeAndLocked", [-(premiumToVault)], nil) | |
1649 | 1649 | if ((doPayFundingToVault == doPayFundingToVault)) | |
1650 | 1650 | then nil | |
1651 | 1651 | else throw("Strict value is not equal to itself.") | |
1652 | 1652 | } | |
1653 | 1653 | else nil | |
1654 | 1654 | if ((doPayFundingToVault == doPayFundingToVault)) | |
1655 | 1655 | then updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1656 | 1656 | else throw("Strict value is not equal to itself.") | |
1657 | 1657 | } | |
1658 | 1658 | } | |
1659 | 1659 | else throw("Strict value is not equal to itself.") | |
1660 | 1660 | } | |
1661 | 1661 | ||
1662 | 1662 | ||
1663 | 1663 | ||
1664 | 1664 | @Callable(i) | |
1665 | 1665 | func syncTerminalPriceToOracle () = { | |
1666 | 1666 | let _qtAstR = qtAstR() | |
1667 | 1667 | let _bsAstR = bsAstR() | |
1668 | 1668 | let $t07845478820 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR) | |
1669 | 1669 | let newQuoteAssetWeight = $t07845478820._1 | |
1670 | 1670 | let newBaseAssetWeight = $t07845478820._2 | |
1671 | 1671 | let marginToVault = $t07845478820._3 | |
1672 | 1672 | let marginToVaultAdj = if (if ((0 > marginToVault)) | |
1673 | 1673 | then (abs(marginToVault) > cbalance()) | |
1674 | 1674 | else false) | |
1675 | 1675 | then -(cbalance()) | |
1676 | 1676 | else marginToVault | |
1677 | 1677 | let doExchangePnL = if ((marginToVaultAdj != 0)) | |
1678 | 1678 | then { | |
1679 | 1679 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVaultAdj], nil) | |
1680 | 1680 | if ((doExchangePnL == doExchangePnL)) | |
1681 | 1681 | then nil | |
1682 | 1682 | else throw("Strict value is not equal to itself.") | |
1683 | 1683 | } | |
1684 | 1684 | else nil | |
1685 | 1685 | if ((doExchangePnL == doExchangePnL)) | |
1686 | 1686 | then (updateBalance((cbalance() + marginToVaultAdj)) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1687 | 1687 | else throw("Strict value is not equal to itself.") | |
1688 | 1688 | } | |
1689 | 1689 | ||
1690 | 1690 | ||
1691 | 1691 | ||
1692 | 1692 | @Callable(i) | |
1693 | 1693 | func ensureCalledOnce () = if ((i.caller != this)) | |
1694 | 1694 | then throw("Invalid saveCurrentTxId parameters") | |
1695 | 1695 | else { | |
1696 | 1696 | let txId = toBase58String(i.transactionId) | |
1697 | 1697 | let lastTx = valueOrElse(getString(this, k_lastTx), "") | |
1698 | 1698 | if ((lastTx != txId)) | |
1699 | 1699 | then [StringEntry(k_lastTx, txId)] | |
1700 | 1700 | else throw("Can not call vAMM methods twice in one tx") | |
1701 | 1701 | } | |
1702 | 1702 | ||
1703 | 1703 | ||
1704 | 1704 | ||
1705 | 1705 | @Callable(i) | |
1706 | 1706 | func migratePosition (_trader) = { | |
1707 | 1707 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
1708 | - | if (isDefined(positionSizeOpt)) | |
1708 | + | if (if (isDefined(positionSizeOpt)) | |
1709 | + | then isDefined(addressFromString(_trader)) | |
1710 | + | else false) | |
1709 | 1711 | then { | |
1710 | 1712 | let pSize = getIntegerValue(this, toCompositeKey(k_positionSize, _trader)) | |
1711 | 1713 | let pMargin = getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)) | |
1712 | 1714 | let pNotional = getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)) | |
1713 | 1715 | let pFraction = getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)) | |
1714 | - | let pTimestamp = | |
1715 | - | let pFee = | |
1716 | + | let pTimestamp = valueOrElse(getInteger(this, toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), lastBlock.timestamp) | |
1717 | + | let pFee = valueOrElse(getInteger(this, toCompositeKey(k_positionFee, _trader)), fee()) | |
1716 | 1718 | let pSequence = getIntegerValue(this, toCompositeKey(k_positionSequence, _trader)) | |
1717 | 1719 | let pDirection = getDirection(pSize) | |
1718 | 1720 | let positionKey = ((_trader + "_") + toString(pDirection)) | |
1719 | 1721 | [DeleteEntry(toCompositeKey(k_positionSize, _trader)), DeleteEntry(toCompositeKey(k_positionMargin, _trader)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader)), DeleteEntry(toCompositeKey(k_positionLastUpdatedTimestamp, _trader)), DeleteEntry(toCompositeKey(k_positionFee, _trader)), DeleteEntry(toCompositeKey(k_positionSequence, _trader)), IntegerEntry(toCompositeKey(k_positionSize, positionKey), pSize), IntegerEntry(toCompositeKey(k_positionMargin, positionKey), pMargin), IntegerEntry(toCompositeKey(k_positionOpenNotional, positionKey), pNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, positionKey), pFraction), IntegerEntry(toCompositeKey(k_positionLastUpdatedTimestamp, positionKey), pTimestamp), IntegerEntry(toCompositeKey(k_positionFee, positionKey), pFee), IntegerEntry(toCompositeKey(k_positionSequence, positionKey), pSequence)] | |
1720 | 1722 | } | |
1721 | 1723 | else throw(("Nothing to migrate for " + _trader)) | |
1722 | 1724 | } | |
1723 | 1725 | ||
1724 | 1726 | ||
1725 | 1727 | ||
1726 | 1728 | @Callable(i) | |
1727 | 1729 | func view_calcRemainMarginWithFundingPayment (_trader,_direction) = { | |
1728 | 1730 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1729 | 1731 | if ((sync == sync)) | |
1730 | 1732 | then { | |
1731 | - | let $ | |
1732 | - | let positionSize = $ | |
1733 | - | let positionMargin = $ | |
1734 | - | let pon = $ | |
1735 | - | let positionLstUpdCPF = $ | |
1736 | - | let positionTimestamp = $ | |
1737 | - | let $ | |
1738 | - | let positionNotional = $ | |
1739 | - | let unrealizedPnl = $ | |
1740 | - | let $ | |
1741 | - | let remainMargin = $ | |
1742 | - | let badDebt = $ | |
1743 | - | let fundingPayment = $ | |
1744 | - | let rolloverFee = $ | |
1733 | + | let $t08251182647 = getPosition(_trader, _direction) | |
1734 | + | let positionSize = $t08251182647._1 | |
1735 | + | let positionMargin = $t08251182647._2 | |
1736 | + | let pon = $t08251182647._3 | |
1737 | + | let positionLstUpdCPF = $t08251182647._4 | |
1738 | + | let positionTimestamp = $t08251182647._5 | |
1739 | + | let $t08265082763 = getPositionNotionalAndUnrealizedPnl(_trader, _direction, PNL_OPTION_SPOT) | |
1740 | + | let positionNotional = $t08265082763._1 | |
1741 | + | let unrealizedPnl = $t08265082763._2 | |
1742 | + | let $t08276682990 = calcRemainMarginWithFundingPaymentAndRolloverFee(positionSize, positionMargin, positionLstUpdCPF, positionTimestamp, unrealizedPnl) | |
1743 | + | let remainMargin = $t08276682990._1 | |
1744 | + | let badDebt = $t08276682990._2 | |
1745 | + | let fundingPayment = $t08276682990._3 | |
1746 | + | let rolloverFee = $t08276682990._4 | |
1745 | 1747 | throw(((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader, _direction))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional)) + s(rolloverFee))) | |
1746 | 1748 | } | |
1747 | 1749 | else throw("Strict value is not equal to itself.") | |
1748 | 1750 | } | |
1749 | 1751 | ||
1750 | 1752 | ||
1751 | 1753 | ||
1752 | 1754 | @Callable(i) | |
1753 | 1755 | func view_getPegAdjustCost (_price) = { | |
1754 | 1756 | let _qtAstR = qtAstR() | |
1755 | 1757 | let _bsAstR = bsAstR() | |
1756 | 1758 | let result = getSyncTerminalPrice(_price, _qtAstR, _bsAstR) | |
1757 | 1759 | throw(toString(result._3)) | |
1758 | 1760 | } | |
1759 | 1761 | ||
1760 | 1762 | ||
1761 | 1763 | ||
1762 | 1764 | @Callable(i) | |
1763 | 1765 | func view_getTerminalAmmPrice () = { | |
1764 | - | let $ | |
1765 | - | let terminalQuoteAssetReserve = $ | |
1766 | - | let terminalBaseAssetReserve = $ | |
1766 | + | let $t08372583806 = getTerminalAmmState() | |
1767 | + | let terminalQuoteAssetReserve = $t08372583806._1 | |
1768 | + | let terminalBaseAssetReserve = $t08372583806._2 | |
1767 | 1769 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
1768 | 1770 | throw(toString(price)) | |
1769 | 1771 | } | |
1770 | 1772 | ||
1771 | 1773 | ||
1772 | 1774 | ||
1773 | 1775 | @Callable(i) | |
1774 | 1776 | func view_getFunding () = { | |
1775 | 1777 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1776 | 1778 | if ((sync == sync)) | |
1777 | 1779 | then { | |
1778 | 1780 | let underlyingPrice = getOraclePrice() | |
1779 | - | let $ | |
1780 | - | let shortPremiumFraction = $ | |
1781 | - | let longPremiumFraction = $ | |
1782 | - | let premiumToVault = $ | |
1781 | + | let $t08436584443 = getFunding() | |
1782 | + | let shortPremiumFraction = $t08436584443._1 | |
1783 | + | let longPremiumFraction = $t08436584443._2 | |
1784 | + | let premiumToVault = $t08436584443._3 | |
1783 | 1785 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
1784 | 1786 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
1785 | 1787 | throw(((((s(longFunding) + s(shortFunding)) + s(getSpotPrice())) + s(getOraclePrice())) + s(premiumToVault))) | |
1786 | 1788 | } | |
1787 | 1789 | else throw("Strict value is not equal to itself.") | |
1788 | 1790 | } | |
1789 | 1791 | ||
1790 | 1792 | ||
1791 | 1793 | ||
1792 | 1794 | @Callable(i) | |
1793 | 1795 | func computeSpotPrice () = { | |
1794 | 1796 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1795 | 1797 | if ((sync == sync)) | |
1796 | 1798 | then { | |
1797 | 1799 | let result = getSpotPrice() | |
1798 | 1800 | $Tuple2(nil, result) | |
1799 | 1801 | } | |
1800 | 1802 | else throw("Strict value is not equal to itself.") | |
1801 | 1803 | } | |
1802 | 1804 | ||
1803 | 1805 | ||
1804 | 1806 | ||
1805 | 1807 | @Callable(i) | |
1806 | 1808 | func computeFeeForTraderWithArtifact (_trader,_artifactId) = { | |
1807 | 1809 | let result = getForTraderWithArtifact(_trader, _artifactId) | |
1808 | 1810 | $Tuple2(nil, result) | |
1809 | 1811 | } | |
1810 | 1812 | ||
1811 | 1813 | ||
1812 | 1814 | @Verifier(tx) | |
1813 | 1815 | func verify () = { | |
1814 | 1816 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
1815 | 1817 | if (isDefined(coordinatorStr)) | |
1816 | 1818 | then { | |
1817 | 1819 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
1818 | 1820 | if (isDefined(admin)) | |
1819 | 1821 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
1820 | 1822 | else throw("unable to verify: admin not set in coordinator") | |
1821 | 1823 | } | |
1822 | 1824 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1823 | 1825 | } | |
1824 | 1826 |
github/deemru/w8io/026f985 216.64 ms ◑