tx · LVMi8pJCQZCz7X2k3uFZr9hjWeVpd7hFmBwjzKPicwL 3N9uNMVY8Zk9skA5TdXGFc1SE7mDnPSXJm4: -0.01000000 Waves 2022.04.28 11:17 [2028069] smart account 3N9uNMVY8Zk9skA5TdXGFc1SE7mDnPSXJm4 > SELF 0.00000000 Waves
{ "type": 13, "id": "LVMi8pJCQZCz7X2k3uFZr9hjWeVpd7hFmBwjzKPicwL", "fee": 1000000, "feeAssetId": null, "timestamp": 1651133887921, "version": 2, "chainId": 84, "sender": "3N9uNMVY8Zk9skA5TdXGFc1SE7mDnPSXJm4", "senderPublicKey": "CiVjpR925KQth7HYnMz9BwBMN2UbKp51VHgNsTdqFSs3", "proofs": [ "PqsLoVUDV7KY5RaPj6bDfGCcXFE1mzRpMaMgCKbz8DweacFYSss2hq6cEk33ey1Rg8eDHBL2tj8M4SvHaaxQ6Zg" ], "script": "base64:AAIFAAAAAAAAACUIAhIICgYBAQEBAQESBQoDAQEBEgASAwoBARIAEgMKAQgSABIAAAAAPgAAAAALb3JhX2tfcHJpY2UCAAAABXByaWNlAAAAAA5rX3Bvc2l0aW9uU2l6ZQIAAAAOa19wb3NpdGlvblNpemUAAAAAEGtfcG9zaXRpb25NYXJnaW4CAAAADmtfcG9zaXRpb25TaXplAAAAABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAgAAAA5rX3Bvc2l0aW9uU2l6ZQAAAAAua19wb3NpdGlvbkxhc3RVcGRhdGVkQ3VtdWxhdGl2ZVByZW1pdW1GcmFjdGlvbgIAAAASa19wb3NpdGlvbkZyYWN0aW9uAAAAAA1rX2luaXRpYWxpemVkAgAAAA1rX2luaXRpYWxpemVkAAAAAA9rX2Z1bmRpbmdQZXJpb2QCAAAAD2tfZnVuZGluZ1BlcmlvZAAAAAARa19pbml0TWFyZ2luUmF0aW8CAAAAEWtfaW5pdE1hcmdpblJhdGlvAAAAABhrX21haW50ZW5hbmNlTWFyZ2luUmF0aW8CAAAAGGtfbWFpbnRlbmFu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MzY5MjU0MzkAAAACXzIEAAAADSR0MDI1NDQyMjU2NDMJAQAAACJjYWxjUmVtYWluTWFyZ2luV2l0aEZ1bmRpbmdQYXltZW50AAAABAUAAAAMcG9zaXRpb25TaXplBQAAAA5wb3NpdGlvbk1hcmdpbgUAAAAscG9zaXRpb25MYXN0VXBkYXRlZEN1bXVsYXRpdmVQcmVtaXVtRnJhY3Rpb24FAAAADXVucmVhbGl6ZWRQbmwEAAAADHJlbWFpbk1hcmdpbggFAAAADSR0MDI1NDQyMjU2NDMAAAACXzEEAAAAB2JhZERlYnQIBQAAAA0kdDAyNTQ0MjI1NjQzAAAAAl8yBAAAAA5mdW5kaW5nUGF5bWVudAgFAAAADSR0MDI1NDQyMjU2NDMAAAACXzMJAAACAAAAAQkAASwAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAADnVucmVhbGl6ZWRQbmw9CQABpAAAAAEFAAAADXVucmVhbGl6ZWRQbmwCAAAACSBiYWREZWJ0PQkAAaQAAAABBQAAAAdiYWREZWJ0AgAAABAgZnVuZGluZ1BheW1lbnQ9CQABpAAAAAEFAAAADmZ1bmRpbmdQYXltZW50AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAamWBNb", "height": 2028069, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let ora_k_price = "price" | |
5 | + | ||
6 | + | let k_positionSize = "k_positionSize" | |
7 | + | ||
8 | + | let k_positionMargin = "k_positionSize" | |
9 | + | ||
10 | + | let k_positionOpenNotional = "k_positionSize" | |
11 | + | ||
12 | + | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
13 | + | ||
14 | + | let k_initialized = "k_initialized" | |
15 | + | ||
16 | + | let k_fundingPeriod = "k_fundingPeriod" | |
17 | + | ||
18 | + | let k_initMarginRatio = "k_initMarginRatio" | |
19 | + | ||
20 | + | let k_maintenanceMarginRatio = "k_maintenanceMarginRatio" | |
21 | + | ||
22 | + | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
23 | + | ||
24 | + | let k_latestCumulativePremiumFraction = "k_latestPremiumFraction" | |
25 | + | ||
26 | + | let k_nextFundingBlock = "k_nextFundingBlock" | |
27 | + | ||
28 | + | let k_fundingRate = "k_fundingRate" | |
29 | + | ||
30 | + | let k_quouteAssetReserve = "k_quouteAssetReserve" | |
31 | + | ||
32 | + | let k_baseAssetReserve = "k_baseAssetReserve" | |
33 | + | ||
34 | + | let k_baseAssetDeltaThisFundingPeriod = "k_baseAssetDelta" | |
35 | + | ||
36 | + | let k_totalPositionSize = "k_totalPositionSize" | |
37 | + | ||
38 | + | let k_cumulativeNotional = "k_cumulativeNotional" | |
39 | + | ||
40 | + | let k_openInteresetNotional = "k_openInteresetNotional" | |
41 | + | ||
42 | + | let ADMIN_ADDRESS = Address(base58'3N2tbRSrvvc5BuRU84MqVVNZRaNWxbhRRKj') | |
43 | + | ||
44 | + | let USDN = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
45 | + | ||
46 | + | let ORACLE = Address(base58'3N4NS7d4Jo9a6F14LiFUKKYVdUkkf2eP4Zx') | |
47 | + | ||
48 | + | let DIR_LONG = 1 | |
49 | + | ||
50 | + | let DIR_SHORT = 2 | |
51 | + | ||
52 | + | let FUNDING_BLOCK_INTERVAL = 60 | |
53 | + | ||
54 | + | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
55 | + | ||
56 | + | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
57 | + | ||
58 | + | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y) | |
59 | + | ||
60 | + | ||
61 | + | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT) | |
62 | + | ||
63 | + | ||
64 | + | func abs (_x) = if ((_x > 0)) | |
65 | + | then _x | |
66 | + | else -(_x) | |
67 | + | ||
68 | + | ||
69 | + | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
70 | + | ||
71 | + | ||
72 | + | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
73 | + | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
74 | + | if (if (_largerThanOrEqualTo) | |
75 | + | then (0 > remainingMarginRatio) | |
76 | + | else false) | |
77 | + | then throw("Invalid margin") | |
78 | + | else if (if (!(_largerThanOrEqualTo)) | |
79 | + | then (remainingMarginRatio >= 0) | |
80 | + | else false) | |
81 | + | then throw("Invalid margin") | |
82 | + | else true | |
83 | + | } | |
84 | + | ||
85 | + | ||
86 | + | func initMarginRatio () = valueOrErrorMessage(getInteger(this, k_initMarginRatio), "no value for initMarginRatio") | |
87 | + | ||
88 | + | ||
89 | + | func quouteAssetReserve () = valueOrErrorMessage(getInteger(this, k_quouteAssetReserve), "no value for quouteAssetReserve") | |
90 | + | ||
91 | + | ||
92 | + | func baseAssetReserve () = valueOrErrorMessage(getInteger(this, k_baseAssetReserve), "no value for baseAssetReserve") | |
93 | + | ||
94 | + | ||
95 | + | func baseAssetDeltaThisFundingPeriod () = valueOrErrorMessage(getInteger(this, k_baseAssetDeltaThisFundingPeriod), "no value for baseAssetDeltaThisFundingPeriod") | |
96 | + | ||
97 | + | ||
98 | + | func totalPositionSize () = valueOrErrorMessage(getInteger(this, k_totalPositionSize), "no value for totalPositionSize") | |
99 | + | ||
100 | + | ||
101 | + | func cumulativeNotional () = valueOrErrorMessage(getInteger(this, k_cumulativeNotional), "no value for cumulativeNotional") | |
102 | + | ||
103 | + | ||
104 | + | func latestCumulativePremiumFraction () = valueOrErrorMessage(getInteger(this, k_latestCumulativePremiumFraction), "no value for latestCumulativePremiumFraction") | |
105 | + | ||
106 | + | ||
107 | + | func openInteresetNotional () = valueOrErrorMessage(getInteger(this, k_openInteresetNotional), "no value for openInteresetNotional") | |
108 | + | ||
109 | + | ||
110 | + | func nextFundingBlock () = valueOrErrorMessage(getInteger(this, k_nextFundingBlock), "no value for nextFundingBlock") | |
111 | + | ||
112 | + | ||
113 | + | func fundingPeriod () = valueOrErrorMessage(getInteger(this, k_fundingPeriod), "no value for fundingPeriod") | |
114 | + | ||
115 | + | ||
116 | + | func maintenanceMarginRatio () = valueOrErrorMessage(getInteger(this, k_maintenanceMarginRatio), "no value for maintenanceMarginRatio") | |
117 | + | ||
118 | + | ||
119 | + | func liquidationFeeRatio () = valueOrErrorMessage(getInteger(this, k_liquidationFeeRatio), "no value for liquidationFeeRatio") | |
120 | + | ||
121 | + | ||
122 | + | func getPosition (invesor) = { | |
123 | + | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, invesor)) | |
124 | + | match positionSizeOpt { | |
125 | + | case positionSize: Int => | |
126 | + | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, invesor)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, invesor)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, invesor))) | |
127 | + | case _ => | |
128 | + | $Tuple4(0, 0, 0, 0) | |
129 | + | } | |
130 | + | } | |
131 | + | ||
132 | + | ||
133 | + | func requireOpenPosition (_trader) = { | |
134 | + | let $t044154570 = getPosition(_trader) | |
135 | + | let positionSize = $t044154570._1 | |
136 | + | let positionMargin = $t044154570._2 | |
137 | + | let positionOpenNotional = $t044154570._3 | |
138 | + | let positionLastUpdatedCumulativePremiumFraction = $t044154570._4 | |
139 | + | if ((positionSize == 0)) | |
140 | + | then throw("No open position") | |
141 | + | else false | |
142 | + | } | |
143 | + | ||
144 | + | ||
145 | + | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
146 | + | ||
147 | + | ||
148 | + | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
149 | + | then $Tuple5((quouteAssetReserve() + _quoteAssetAmount), (baseAssetReserve() - _baseAssetAmount), (baseAssetDeltaThisFundingPeriod() - _baseAssetAmount), (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount)) | |
150 | + | else $Tuple5((quouteAssetReserve() - _quoteAssetAmount), (baseAssetReserve() + _baseAssetAmount), (baseAssetDeltaThisFundingPeriod() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount)) | |
151 | + | ||
152 | + | ||
153 | + | func swapInput (_isAdd,_quoteAssetAmoun) = { | |
154 | + | let _quouteAssetReserve = quouteAssetReserve() | |
155 | + | let _baseAssetReserve = baseAssetReserve() | |
156 | + | let k = muld(_quouteAssetReserve, _baseAssetReserve) | |
157 | + | let quouteAssetReserveAfter = if (_isAdd) | |
158 | + | then (_quouteAssetReserve + _quoteAssetAmoun) | |
159 | + | else (_quouteAssetReserve - _quoteAssetAmoun) | |
160 | + | let baseAssetReserveAfter = divd(k, quouteAssetReserveAfter) | |
161 | + | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _baseAssetReserve)) | |
162 | + | let amountBaseAssetBought = if (_isAdd) | |
163 | + | then amountBaseAssetBoughtAbs | |
164 | + | else -(amountBaseAssetBoughtAbs) | |
165 | + | let $t060476283 = updateReserve(_isAdd, _quoteAssetAmoun, amountBaseAssetBoughtAbs) | |
166 | + | let quouteAssetReserveAfter1 = $t060476283._1 | |
167 | + | let baseAssetReserveAfter1 = $t060476283._2 | |
168 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t060476283._3 | |
169 | + | let totalPositionSizeAfter1 = $t060476283._4 | |
170 | + | let cumulativeNotionalAfter1 = $t060476283._5 | |
171 | + | $Tuple6(amountBaseAssetBought, quouteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
172 | + | } | |
173 | + | ||
174 | + | ||
175 | + | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionLastUpdatedCumulativePremiumFraction,_marginDelta) = { | |
176 | + | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction() | |
177 | + | let fundingPayment = if ((_oldPositionSize != 0)) | |
178 | + | then muld((_latestCumulativePremiumFraction - _oldPositionLastUpdatedCumulativePremiumFraction), _oldPositionSize) | |
179 | + | else 0 | |
180 | + | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
181 | + | let $t070157142 = if ((0 > signedMargin)) | |
182 | + | then $Tuple2(0, abs(signedMargin)) | |
183 | + | else $Tuple2(abs(signedMargin), 0) | |
184 | + | let remainMargin = $t070157142._1 | |
185 | + | let badDebt = $t070157142._2 | |
186 | + | $Tuple4(remainMargin, badDebt, fundingPayment, _latestCumulativePremiumFraction) | |
187 | + | } | |
188 | + | ||
189 | + | ||
190 | + | func getOutputPriceWithReserves (_add,_baseAssetAmount,_quoteAssetPoolAmount,_baseAssetPoolAmount) = if ((_baseAssetAmount == 0)) | |
191 | + | then throw("Invalid base asset amount") | |
192 | + | else { | |
193 | + | let k = muld(_quoteAssetPoolAmount, _baseAssetPoolAmount) | |
194 | + | let baseAssetPoolAmountAfter = if (_add) | |
195 | + | then (_baseAssetPoolAmount + _baseAssetAmount) | |
196 | + | else (_baseAssetPoolAmount - _baseAssetAmount) | |
197 | + | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
198 | + | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetPoolAmount)) | |
199 | + | let $t078138050 = updateReserve(!(_add), quoteAssetSold, _baseAssetAmount) | |
200 | + | let quouteAssetReserveAfter1 = $t078138050._1 | |
201 | + | let baseAssetReserveAfter1 = $t078138050._2 | |
202 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t078138050._3 | |
203 | + | let totalPositionSizeAfter1 = $t078138050._4 | |
204 | + | let cumulativeNotionalAfter1 = $t078138050._5 | |
205 | + | $Tuple6(quoteAssetSold, quouteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
206 | + | } | |
207 | + | ||
208 | + | ||
209 | + | func getPositionNotionalAndUnrealizedPnl (_trader) = { | |
210 | + | let $t083268481 = getPosition(_trader) | |
211 | + | let positionSize = $t083268481._1 | |
212 | + | let positionMargin = $t083268481._2 | |
213 | + | let positionOpenNotional = $t083268481._3 | |
214 | + | let positionLastUpdatedCumulativePremiumFraction = $t083268481._4 | |
215 | + | let positionSizeAbs = abs(positionSize) | |
216 | + | if ((positionSizeAbs == 0)) | |
217 | + | then throw("Invalid position size") | |
218 | + | else { | |
219 | + | let isShort = (0 > positionSize) | |
220 | + | let $t086588830 = getOutputPriceWithReserves(!(isShort), positionSizeAbs, quouteAssetReserve(), baseAssetReserve()) | |
221 | + | let positionNotional = $t086588830._1 | |
222 | + | let x1 = $t086588830._2 | |
223 | + | let x2 = $t086588830._3 | |
224 | + | let x3 = $t086588830._4 | |
225 | + | let unrealizedPnl = if (isShort) | |
226 | + | then (positionOpenNotional - positionNotional) | |
227 | + | else (positionNotional - positionOpenNotional) | |
228 | + | $Tuple2(positionNotional, unrealizedPnl) | |
229 | + | } | |
230 | + | } | |
231 | + | ||
232 | + | ||
233 | + | func getOracleTwapPrice () = getIntegerValue(ORACLE, ora_k_price) | |
234 | + | ||
235 | + | ||
236 | + | func getTwapSpotPrice () = divd(quouteAssetReserve(), baseAssetReserve()) | |
237 | + | ||
238 | + | ||
239 | + | func getMarginRatio (_trader) = { | |
240 | + | let $t092669421 = getPosition(_trader) | |
241 | + | let positionSize = $t092669421._1 | |
242 | + | let positionMargin = $t092669421._2 | |
243 | + | let positionOpenNotional = $t092669421._3 | |
244 | + | let positionLastUpdatedCumulativePremiumFraction = $t092669421._4 | |
245 | + | let $t094279511 = getPositionNotionalAndUnrealizedPnl(_trader) | |
246 | + | let positionNotional = $t094279511._1 | |
247 | + | let unrealizedPnl = $t094279511._2 | |
248 | + | let $t095169709 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLastUpdatedCumulativePremiumFraction, unrealizedPnl) | |
249 | + | let remainMargin = $t095169709._1 | |
250 | + | let badDebt = $t095169709._2 | |
251 | + | divd((remainMargin - badDebt), positionNotional) | |
252 | + | } | |
253 | + | ||
254 | + | ||
255 | + | func internalClosePosition (_trader) = { | |
256 | + | let $t098169971 = getPosition(_trader) | |
257 | + | let positionSize = $t098169971._1 | |
258 | + | let positionMargin = $t098169971._2 | |
259 | + | let positionOpenNotional = $t098169971._3 | |
260 | + | let positionLastUpdatedCumulativePremiumFraction = $t098169971._4 | |
261 | + | let $t0997710047 = getPositionNotionalAndUnrealizedPnl(_trader) | |
262 | + | let x1 = $t0997710047._1 | |
263 | + | let unrealizedPnl = $t0997710047._2 | |
264 | + | let $t01005210251 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLastUpdatedCumulativePremiumFraction, unrealizedPnl) | |
265 | + | let remainMargin = $t01005210251._1 | |
266 | + | let badDebt = $t01005210251._2 | |
267 | + | let x2 = $t01005210251._3 | |
268 | + | let exchangedPositionSize = -(positionSize) | |
269 | + | let realizedPnl = unrealizedPnl | |
270 | + | let marginToVault = -(remainMargin) | |
271 | + | let $t01037810733 = getOutputPriceWithReserves((positionSize > 0), abs(positionSize), quouteAssetReserve(), baseAssetReserve()) | |
272 | + | let exchangedQuoteAssetAmount = $t01037810733._1 | |
273 | + | let quoteAssetReserveAfter = $t01037810733._2 | |
274 | + | let baseAssetReserveAfter = $t01037810733._3 | |
275 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01037810733._4 | |
276 | + | let totalPositionSizeAfter = $t01037810733._5 | |
277 | + | let cumulativeNotionalAfter = $t01037810733._6 | |
278 | + | let openInteresetNotionalAfter = (openInteresetNotional() - positionOpenNotional) | |
279 | + | $Tuple11(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter, exchangedQuoteAssetAmount) | |
280 | + | } | |
281 | + | ||
282 | + | ||
283 | + | func updateSettings (_initMarginRatio,_maintenanceMarginRatio,_liquidationFeeRatio) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _maintenanceMarginRatio), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio)] | |
284 | + | ||
285 | + | ||
286 | + | func updateFunding (_baseAssetDeltaThisFundingPeriod,_nextFundingBlock,_latestCumulativePremiumFraction,_fundingRate) = [IntegerEntry(k_baseAssetDeltaThisFundingPeriod, _baseAssetDeltaThisFundingPeriod), IntegerEntry(k_nextFundingBlock, _nextFundingBlock), IntegerEntry(k_latestCumulativePremiumFraction, _latestCumulativePremiumFraction), IntegerEntry(k_fundingRate, _fundingRate)] | |
287 | + | ||
288 | + | ||
289 | + | func updatePosition (_address,_size,_margin,_openNotinal,_lastUpdatedCumulativePremiumFraction) = [IntegerEntry(toCompositeKey(k_positionSize, _address), _size), IntegerEntry(toCompositeKey(k_positionMargin, _address), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, _address), _openNotinal), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address), _lastUpdatedCumulativePremiumFraction)] | |
290 | + | ||
291 | + | ||
292 | + | func updateAmm (_quouteAssetReserve,_baseAssetReserve,_baseAssetDeltaThisFundingPeriodAfter,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInteresetNotional) = [IntegerEntry(k_quouteAssetReserve, _quouteAssetReserve), IntegerEntry(k_baseAssetReserve, _baseAssetReserve), IntegerEntry(k_baseAssetDeltaThisFundingPeriod, _baseAssetDeltaThisFundingPeriodAfter), IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInteresetNotional, _openInteresetNotional)] | |
293 | + | ||
294 | + | ||
295 | + | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))] | |
296 | + | ||
297 | + | ||
298 | + | func withdraw (_address,_amount) = { | |
299 | + | let balance = assetBalance(this, USDN) | |
300 | + | if ((_amount > balance)) | |
301 | + | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
302 | + | else [ScriptTransfer(_address, _amount, USDN)] | |
303 | + | } | |
304 | + | ||
305 | + | ||
306 | + | @Callable(i) | |
307 | + | func initialize (_quouteAssetReserve,_baseAssetReserve,_fundingPeriod,_initMarginRatio,_maintenanceMarginRatio,_liquidationFeeRatio) = if (if (if (if (if (if (if (if ((0 >= _quouteAssetReserve)) | |
308 | + | then true | |
309 | + | else (0 >= _baseAssetReserve)) | |
310 | + | then true | |
311 | + | else (0 >= _fundingPeriod)) | |
312 | + | then true | |
313 | + | else (0 >= _initMarginRatio)) | |
314 | + | then true | |
315 | + | else (0 >= _maintenanceMarginRatio)) | |
316 | + | then true | |
317 | + | else (0 >= _liquidationFeeRatio)) | |
318 | + | then true | |
319 | + | else (i.caller != ADMIN_ADDRESS)) | |
320 | + | then true | |
321 | + | else initialized()) | |
322 | + | then throw("Invalid initialize parameters") | |
323 | + | else (((updateAmm(_quouteAssetReserve, _baseAssetReserve, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _maintenanceMarginRatio, _liquidationFeeRatio)) ++ updateFunding(0, (lastBlock.height + FUNDING_BLOCK_INTERVAL), 0, 0)) ++ [BooleanEntry(k_initialized, true)]) | |
324 | + | ||
325 | + | ||
326 | + | ||
327 | + | @Callable(i) | |
328 | + | func openPosition (_direction,_leverage,_minBaseAssetAmount) = { | |
329 | + | let _amount = i.payments[0].amount | |
330 | + | if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
331 | + | then (_direction != DIR_SHORT) | |
332 | + | else false) | |
333 | + | then true | |
334 | + | else (0 >= _amount)) | |
335 | + | then true | |
336 | + | else if (((1 * DECIMAL_UNIT) > _leverage)) | |
337 | + | then true | |
338 | + | else (_leverage > (3 * DECIMAL_UNIT))) | |
339 | + | then true | |
340 | + | else !(initialized())) | |
341 | + | then true | |
342 | + | else (i.payments[0].assetId != USDN)) | |
343 | + | then true | |
344 | + | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
345 | + | then throw("Invalid openPosition parameters") | |
346 | + | else { | |
347 | + | let $t01533915518 = getPosition(toString(i.caller)) | |
348 | + | let oldPositionSize = $t01533915518._1 | |
349 | + | let oldPositionMargin = $t01533915518._2 | |
350 | + | let oldPositionOpenNotional = $t01533915518._3 | |
351 | + | let oldPositionLastUpdatedCumulativePremiumFraction = $t01533915518._4 | |
352 | + | let isNewPosition = (oldPositionSize == 0) | |
353 | + | let isSameDirection = if ((oldPositionSize > 0)) | |
354 | + | then (_direction == DIR_LONG) | |
355 | + | else (_direction == DIR_SHORT) | |
356 | + | let expandExisting = if (!(isNewPosition)) | |
357 | + | then isSameDirection | |
358 | + | else false | |
359 | + | let isAdd = (_direction == DIR_LONG) | |
360 | + | let $t01580720256 = if (if (isNewPosition) | |
361 | + | then true | |
362 | + | else expandExisting) | |
363 | + | then { | |
364 | + | let openNotional = muld(_amount, _leverage) | |
365 | + | let $t01625316506 = swapInput(isAdd, openNotional) | |
366 | + | let amountBaseAssetBought = $t01625316506._1 | |
367 | + | let quouteAssetReserveAfter = $t01625316506._2 | |
368 | + | let baseAssetReserveAfter = $t01625316506._3 | |
369 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01625316506._4 | |
370 | + | let totalPositionSizeAfter = $t01625316506._5 | |
371 | + | let cumulativeNotionalAfter = $t01625316506._6 | |
372 | + | if (if ((_minBaseAssetAmount != 0)) | |
373 | + | then (_minBaseAssetAmount > amountBaseAssetBought) | |
374 | + | else false) | |
375 | + | then throw(((("Limit error: " + toString(amountBaseAssetBought)) + " < ") + toString(_minBaseAssetAmount))) | |
376 | + | else { | |
377 | + | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
378 | + | let increaseMarginRequirement = divd(openNotional, _leverage) | |
379 | + | let $t01687717179 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLastUpdatedCumulativePremiumFraction, increaseMarginRequirement) | |
380 | + | let remainMargin = $t01687717179._1 | |
381 | + | let x1 = $t01687717179._2 | |
382 | + | let x2 = $t01687717179._3 | |
383 | + | let oldLatestCumulativePremiumFraction = $t01687717179._4 | |
384 | + | $Tuple10(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), oldLatestCumulativePremiumFraction, baseAssetReserveAfter, quouteAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInteresetNotional() + openNotional)) | |
385 | + | } | |
386 | + | } | |
387 | + | else { | |
388 | + | let openNotional = muld(_amount, _leverage) | |
389 | + | let $t01791518014 = getPositionNotionalAndUnrealizedPnl(toString(i.caller)) | |
390 | + | let oldPositionNotional = $t01791518014._1 | |
391 | + | let unrealizedPnl = $t01791518014._2 | |
392 | + | if ((oldPositionNotional > openNotional)) | |
393 | + | then { | |
394 | + | let $t01807618357 = swapInput(isAdd, openNotional) | |
395 | + | let exchangedPositionSize = $t01807618357._1 | |
396 | + | let quouteAssetReserveAfter = $t01807618357._2 | |
397 | + | let baseAssetReserveAfter = $t01807618357._3 | |
398 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01807618357._4 | |
399 | + | let totalPositionSizeAfter = $t01807618357._5 | |
400 | + | let cumulativeNotionalAfter = $t01807618357._6 | |
401 | + | if (if ((_minBaseAssetAmount != 0)) | |
402 | + | then (_minBaseAssetAmount > abs(exchangedPositionSize)) | |
403 | + | else false) | |
404 | + | then throw("Too little basse asset exchanged") | |
405 | + | else { | |
406 | + | let realizedPnl = if ((oldPositionSize != 0)) | |
407 | + | then divd(muld(unrealizedPnl, abs(exchangedPositionSize)), oldPositionSize) | |
408 | + | else 0 | |
409 | + | let $t01874319063 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLastUpdatedCumulativePremiumFraction, realizedPnl) | |
410 | + | let remainMargin = $t01874319063._1 | |
411 | + | let badDebt = $t01874319063._2 | |
412 | + | let fundingPayment = $t01874319063._3 | |
413 | + | let oldLatestCumulativePremiumFraction = $t01874319063._4 | |
414 | + | let exchangedQuoteAssetAmount = openNotional | |
415 | + | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
416 | + | let remainOpenNotional = if ((oldPositionSize > 0)) | |
417 | + | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
418 | + | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
419 | + | $Tuple10((oldPositionSize + exchangedPositionSize), remainMargin, abs(remainOpenNotional), oldLatestCumulativePremiumFraction, baseAssetReserveAfter, quouteAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInteresetNotional() - openNotional)) | |
420 | + | } | |
421 | + | } | |
422 | + | else throw("Close position first") | |
423 | + | } | |
424 | + | let newPositionSize = $t01580720256._1 | |
425 | + | let newPositionRemainMargin = $t01580720256._2 | |
426 | + | let newPosiionOpenNotional = $t01580720256._3 | |
427 | + | let newPositionLatestCumulativePremiumFraction = $t01580720256._4 | |
428 | + | let baseAssetReserveAfter = $t01580720256._5 | |
429 | + | let quouteAssetReserveAfter = $t01580720256._6 | |
430 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01580720256._7 | |
431 | + | let totalPositionSizeAfter = $t01580720256._8 | |
432 | + | let cumulativeNotionalAfter = $t01580720256._9 | |
433 | + | let openInteresetNotionalAfter = $t01580720256._10 | |
434 | + | (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPosiionOpenNotional, newPositionLatestCumulativePremiumFraction) ++ updateAmm(quouteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) | |
435 | + | } | |
436 | + | } | |
437 | + | ||
438 | + | ||
439 | + | ||
440 | + | @Callable(i) | |
441 | + | func addMargin () = if (if ((i.payments[0].assetId != USDN)) | |
442 | + | then true | |
443 | + | else !(requireOpenPosition(toString(i.caller)))) | |
444 | + | then throw("Invalid addMargin parameters") | |
445 | + | else { | |
446 | + | let $t02087021049 = getPosition(toString(i.caller)) | |
447 | + | let oldPositionSize = $t02087021049._1 | |
448 | + | let oldPositionMargin = $t02087021049._2 | |
449 | + | let oldPositionOpenNotional = $t02087021049._3 | |
450 | + | let oldPositionLastUpdatedCumulativePremiumFraction = $t02087021049._4 | |
451 | + | updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + i.payments[0].amount), oldPositionOpenNotional, oldPositionLastUpdatedCumulativePremiumFraction) | |
452 | + | } | |
453 | + | ||
454 | + | ||
455 | + | ||
456 | + | @Callable(i) | |
457 | + | func removeMargin (_amount) = if (if ((0 >= _amount)) | |
458 | + | then true | |
459 | + | else !(requireOpenPosition(toString(i.caller)))) | |
460 | + | then throw("Invalid removeMargin parameters") | |
461 | + | else { | |
462 | + | let $t02146421643 = getPosition(toString(i.caller)) | |
463 | + | let oldPositionSize = $t02146421643._1 | |
464 | + | let oldPositionMargin = $t02146421643._2 | |
465 | + | let oldPositionOpenNotional = $t02146421643._3 | |
466 | + | let oldPositionLastUpdatedCumulativePremiumFraction = $t02146421643._4 | |
467 | + | let marginDelta = -(_amount) | |
468 | + | let $t02168021924 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLastUpdatedCumulativePremiumFraction, marginDelta) | |
469 | + | let remainMargin = $t02168021924._1 | |
470 | + | let badDebt = $t02168021924._2 | |
471 | + | let x1 = $t02168021924._3 | |
472 | + | let latestCumulativePremiumFraction1 = $t02168021924._4 | |
473 | + | if ((badDebt != 0)) | |
474 | + | then throw("Invalid added margin amount") | |
475 | + | else (updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction1) ++ withdraw(i.caller, _amount)) | |
476 | + | } | |
477 | + | ||
478 | + | ||
479 | + | ||
480 | + | @Callable(i) | |
481 | + | func closePosition () = { | |
482 | + | let $t02228722623 = internalClosePosition(toString(i.caller)) | |
483 | + | let x1 = $t02228722623._1 | |
484 | + | let badDebt = $t02228722623._2 | |
485 | + | let realizedPnl = $t02228722623._3 | |
486 | + | let marginToVault = $t02228722623._4 | |
487 | + | let quoteAssetReserveAfter = $t02228722623._5 | |
488 | + | let baseAssetReserveAfter = $t02228722623._6 | |
489 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02228722623._7 | |
490 | + | let totalPositionSizeAfter = $t02228722623._8 | |
491 | + | let cumulativeNotionalAfter = $t02228722623._9 | |
492 | + | let openInteresetNotionalAfter = $t02228722623._10 | |
493 | + | if ((badDebt > 0)) | |
494 | + | then throw("Unable to close position with bad debt") | |
495 | + | else ((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) ++ withdraw(i.caller, abs(marginToVault))) | |
496 | + | } | |
497 | + | ||
498 | + | ||
499 | + | ||
500 | + | @Callable(i) | |
501 | + | func liquidate (_trader) = if (if (!(requireMoreMarginRatio(getMarginRatio(_trader), maintenanceMarginRatio(), false))) | |
502 | + | then true | |
503 | + | else !(initialized())) | |
504 | + | then throw("Unable to liquidate") | |
505 | + | else { | |
506 | + | let $t02326123591 = internalClosePosition(_trader) | |
507 | + | let x1 = $t02326123591._1 | |
508 | + | let badDebt = $t02326123591._2 | |
509 | + | let x2 = $t02326123591._3 | |
510 | + | let marginToVault = $t02326123591._4 | |
511 | + | let quoteAssetReserveAfter = $t02326123591._5 | |
512 | + | let baseAssetReserveAfter = $t02326123591._6 | |
513 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02326123591._7 | |
514 | + | let totalPositionSizeAfter = $t02326123591._8 | |
515 | + | let cumulativeNotionalAfter = $t02326123591._9 | |
516 | + | let openInteresetNotionalAfter = $t02326123591._10 | |
517 | + | let exchangedQuoteAssetAmount = $t02326123591._11 | |
518 | + | let feeToLiquidator = (muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) / 2) | |
519 | + | let $t02368124085 = if ((feeToLiquidator > marginToVault)) | |
520 | + | then $Tuple3((feeToLiquidator - marginToVault), marginToVault, ((badDebt + feeToLiquidator) - marginToVault)) | |
521 | + | else $Tuple3(0, (marginToVault - feeToLiquidator), badDebt) | |
522 | + | let liquidationBadDebt = $t02368124085._1 | |
523 | + | let remainMargin = $t02368124085._2 | |
524 | + | let totalBadDebt = $t02368124085._3 | |
525 | + | ((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) ++ withdraw(i.caller, feeToLiquidator)) | |
526 | + | } | |
527 | + | ||
528 | + | ||
529 | + | ||
530 | + | @Callable(i) | |
531 | + | func payFunding () = { | |
532 | + | let fundingBlock = nextFundingBlock() | |
533 | + | if (if ((fundingBlock > lastBlock.height)) | |
534 | + | then true | |
535 | + | else !(initialized())) | |
536 | + | then throw("Invalid funding block") | |
537 | + | else { | |
538 | + | let underlyingPrice = getOracleTwapPrice() | |
539 | + | let spotTwapPrice = getTwapSpotPrice() | |
540 | + | let premium = (spotTwapPrice - underlyingPrice) | |
541 | + | let premiumFraction = divd(muld(premium, fundingPeriod()), ONE_DAY) | |
542 | + | let totalTraderPositionSize = totalPositionSize() | |
543 | + | let ammFundingPaymentProfit = muld(premiumFraction, totalTraderPositionSize) | |
544 | + | updateFunding(0, (fundingBlock + FUNDING_BLOCK_INTERVAL), (latestCumulativePremiumFraction() + premiumFraction), divd(premiumFraction, underlyingPrice)) | |
545 | + | } | |
546 | + | } | |
547 | + | ||
548 | + | ||
549 | + | ||
550 | + | @Callable(i) | |
551 | + | func debug_calcRemainMarginWithFundingPayment () = { | |
552 | + | let _trader = toString(i.caller) | |
553 | + | let $t02526325366 = getPosition(_trader) | |
554 | + | let positionSize = $t02526325366._1 | |
555 | + | let positionMargin = $t02526325366._2 | |
556 | + | let positionLastUpdatedCumulativePremiumFraction = $t02526325366._3 | |
557 | + | let $t02536925439 = getPositionNotionalAndUnrealizedPnl(_trader) | |
558 | + | let x1 = $t02536925439._1 | |
559 | + | let unrealizedPnl = $t02536925439._2 | |
560 | + | let $t02544225643 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLastUpdatedCumulativePremiumFraction, unrealizedPnl) | |
561 | + | let remainMargin = $t02544225643._1 | |
562 | + | let badDebt = $t02544225643._2 | |
563 | + | let fundingPayment = $t02544225643._3 | |
564 | + | throw(((((("unrealizedPnl=" + toString(unrealizedPnl)) + " badDebt=") + toString(badDebt)) + " fundingPayment=") + toString(fundingPayment))) | |
565 | + | } | |
566 | + | ||
567 | + | ||
568 | + | @Verifier(tx) | |
569 | + | func verify () = true | |
570 | + |
github/deemru/w8io/169f3d6 41.24 ms ◑