tx · 72BxAk9GAmPTFa5un3Phvhn9zwwRXafxUWF5vSgkm9h1 3MzHu4SpHqDEEdGuXHrinGsc1KDcWH5DvNY: -0.07500000 Waves 2022.12.12 16:48 [2357201] smart account 3MzHu4SpHqDEEdGuXHrinGsc1KDcWH5DvNY > SELF 0.00000000 Waves
{ "type": 13, "id": "72BxAk9GAmPTFa5un3Phvhn9zwwRXafxUWF5vSgkm9h1", "fee": 7500000, "feeAssetId": null, "timestamp": 1670852904762, "version": 2, "chainId": 84, "sender": "3MzHu4SpHqDEEdGuXHrinGsc1KDcWH5DvNY", "senderPublicKey": "7bR2UrhZFBmmHFg5wxSiyEXRBYjvQxNpku7Wnppww5GK", "proofs": [ "WevkcA8cMQDqJpjzn7xsebxNTUpV4X5PVTKQbj16axwGuTwb2xj3NBdFtw2Wvf6S1Mx7SjzCBEokFCQvRxgqZYp" ], "script": "base64:BgJ6CAISABIAEgASABIDCgEBEgMKAQESDgoMAQEBAQEBAQEBAQEBEhQKEgEBAQEBAQEICAgIAQEBAQEBARIFCgMBAQESBgoEAQEBCBIAEgMKAQESBAoCAQESAwoBCBIAEgASAwoBCBIDCgEBEgASABIDCgEIEgASBAoCCAjAAQAJa19vcmFfa2V5AglrX29yYV9rZXkAD2tfb3JhX2Jsb2NrX2tleQIPa19vcmFfYmxvY2tfa2V5AAVrX29yYQIFa19vcmEACWtfYmFsYW5jZQIJa19iYWxhbmNlAAprX3NlcXVlbmNlAgprX3NlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUAEGtfcG9zaXRpb25NYXJnaW4CEGtfcG9zaXRpb25NYXJnaW4AFmtfcG9zaXRpb25PcGVuTm90aW9uYWwCFmtfcG9zaXRpb25PcGVuTm90aW9uYWwALmtfcG9zaXRpb25MYXN0VXBkYXRlZEN1bXVsYXRpdmVQcmVtaXVtRnJhY3Rpb24CEmtfcG9zaXRpb25GcmFjdGlvbgASa19wb3NpdGlvblNlcXVlbmNlAhJrX3B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": 0 } View: original | compacted Prev: 4B8PaWkwByVR6Db1kJVwNfuHiwaGKVByHvyhm8VVX5BY Next: none Diff:
Old | New | Differences | |
---|---|---|---|
49 | 49 | ||
50 | 50 | let x = "k_maxOpenNotional" | |
51 | 51 | ||
52 | - | let y = "k_lastDataStr" | |
53 | - | ||
54 | - | let z = "k_lastMinuteId" | |
55 | - | ||
56 | - | let A = "k_twapDataLastCumulativePrice" | |
57 | - | ||
58 | - | let B = "k_twapDataLastPrice" | |
59 | - | ||
60 | - | let C = "k_twapDataPreviousMinuteId" | |
61 | - | ||
62 | - | let D = "k_latestLongPremiumFraction" | |
63 | - | ||
64 | - | let E = "k_latestShortPremiumFraction" | |
65 | - | ||
66 | - | let F = "k_nextFundingBlockMinTimestamp" | |
67 | - | ||
68 | - | let G = "k_longFundingRate" | |
69 | - | ||
70 | - | let H = "k_shortFundingRate" | |
71 | - | ||
72 | - | let I = "k_qtAstR" | |
73 | - | ||
74 | - | let J = "k_bsAstR" | |
75 | - | ||
76 | - | let K = "k_qtAstW" | |
77 | - | ||
78 | - | let L = "k_bsAstW" | |
79 | - | ||
80 | - | let M = "k_totalPositionSize" | |
81 | - | ||
82 | - | let N = "k_totalLongPositionSize" | |
83 | - | ||
84 | - | let O = "k_totalShortPositionSize" | |
85 | - | ||
86 | - | let P = "k_openInterestNotional" | |
87 | - | ||
88 | - | let Q = "k_openInterestShort" | |
89 | - | ||
90 | - | let R = "k_openInterestLong" | |
91 | - | ||
92 | - | let S = "k_coordinatorAddress" | |
93 | - | ||
94 | - | let T = "k_vault_address" | |
95 | - | ||
96 | - | let U = "k_admin_address" | |
97 | - | ||
98 | - | let V = "k_admin_public_key" | |
99 | - | ||
100 | - | let W = "k_quote_asset" | |
101 | - | ||
102 | - | let X = "k_quote_staking" | |
103 | - | ||
104 | - | let Y = "k_staking_address" | |
105 | - | ||
106 | - | let Z = "k_miner_address" | |
107 | - | ||
108 | - | let aa = "k_orders_address" | |
109 | - | ||
110 | - | let ab = "k_referral_address" | |
111 | - | ||
112 | - | let ac = "k_collateral_address" | |
113 | - | ||
114 | - | let ad = "k_exchange_address" | |
115 | - | ||
116 | - | let ae = "k_nft_manager_address" | |
117 | - | ||
118 | - | let af = "k_trader_market_asset_collateral" | |
119 | - | ||
120 | - | func ag (ah,ai) = ((ah + "_") + ai) | |
121 | - | ||
122 | - | ||
123 | - | func aj () = valueOrErrorMessage(addressFromString(getStringValue(this, S)), "Coordinator not set") | |
124 | - | ||
125 | - | ||
126 | - | func ak () = addressFromString(getStringValue(aj(), U)) | |
127 | - | ||
128 | - | ||
129 | - | func al () = fromBase58String(getStringValue(aj(), V)) | |
130 | - | ||
131 | - | ||
132 | - | func am () = fromBase58String(getStringValue(aj(), W)) | |
133 | - | ||
134 | - | ||
135 | - | func an () = valueOrErrorMessage(addressFromString(getStringValue(aj(), X)), "Quote asset staking not set") | |
136 | - | ||
137 | - | ||
138 | - | func ao () = valueOrErrorMessage(addressFromString(getStringValue(aj(), Y)), "Staking not set") | |
139 | - | ||
140 | - | ||
141 | - | func ap () = valueOrErrorMessage(addressFromString(getStringValue(aj(), T)), "Vault not set") | |
142 | - | ||
143 | - | ||
144 | - | func aq () = valueOrErrorMessage(addressFromString(getStringValue(aj(), Z)), "Miner not set") | |
145 | - | ||
146 | - | ||
147 | - | func ar () = valueOrErrorMessage(addressFromString(getStringValue(aj(), aa)), "Orders not set") | |
148 | - | ||
149 | - | ||
150 | - | func as () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ab)), "Referral not set") | |
151 | - | ||
152 | - | ||
153 | - | func at () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ae)), "NFT Manager not set") | |
154 | - | ||
155 | - | ||
156 | - | func au () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ac)), "Collateral Manager not set") | |
157 | - | ||
158 | - | ||
159 | - | func av () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(aj(), ad), "No swap address")), "Invalid swap address") | |
160 | - | ||
161 | - | ||
162 | - | let aw = "k_whitelist_asset" | |
163 | - | ||
164 | - | func ax (ay) = valueOrElse(getBoolean(au(), ag(aw, ay)), false) | |
165 | - | ||
166 | - | ||
167 | - | let az = "k_token_param" | |
168 | - | ||
169 | - | let aA = "k_token_type" | |
170 | - | ||
171 | - | let aB = "fee_reduction" | |
172 | - | ||
173 | - | let aC = 1 | |
174 | - | ||
175 | - | let aD = 2 | |
176 | - | ||
177 | - | let aE = 15 | |
178 | - | ||
179 | - | let aF = 15 | |
180 | - | ||
181 | - | let aG = 1000 | |
182 | - | ||
183 | - | let aH = 6 | |
184 | - | ||
185 | - | let aI = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
186 | - | ||
187 | - | let aJ = (86400 * aI) | |
188 | - | ||
189 | - | let aK = 100 | |
190 | - | ||
191 | - | let aL = 1 | |
192 | - | ||
193 | - | let aM = 2 | |
194 | - | ||
195 | - | func aN (aO) = (toString(aO) + ",") | |
196 | - | ||
197 | - | ||
198 | - | func aP (aO,aQ) = fraction(aO, aI, aQ, HALFEVEN) | |
199 | - | ||
200 | - | ||
201 | - | func aR (aO,aQ) = fraction(aO, aQ, aI, HALFEVEN) | |
202 | - | ||
203 | - | ||
204 | - | func aS (aO) = sqrt(aO, aH, aH, HALFEVEN) | |
205 | - | ||
206 | - | ||
207 | - | func aT (aO,aQ) = pow(aO, aH, aQ, aH, aH, HALFEVEN) | |
208 | - | ||
209 | - | ||
210 | - | func aU (aO,aQ) = fraction(aO, toBigInt(aI), aQ, HALFEVEN) | |
211 | - | ||
212 | - | ||
213 | - | func aV (aO,aQ) = fraction(aO, aQ, toBigInt(aI), HALFEVEN) | |
214 | - | ||
215 | - | ||
216 | - | func aW (aO) = sqrtBigInt(aO, aH, aH, HALFEVEN) | |
217 | - | ||
218 | - | ||
219 | - | func aX (aO,aQ) = pow(aO, aH, aQ, aH, aH, HALFEVEN) | |
220 | - | ||
221 | - | ||
222 | - | func aY (aO) = if ((aO > 0)) | |
223 | - | then aO | |
224 | - | else -(aO) | |
225 | - | ||
226 | - | ||
227 | - | func aZ (aO,aQ) = if ((aO >= aQ)) | |
228 | - | then aO | |
229 | - | else aQ | |
230 | - | ||
231 | - | ||
232 | - | func ba (bb) = { | |
233 | - | func bc (bd,be) = ((bd + be) + ",") | |
234 | - | ||
235 | - | let bf = { | |
236 | - | let bg = bb | |
237 | - | let bh = size(bg) | |
238 | - | let bi = "" | |
239 | - | func bj (bk,bl) = if ((bl >= bh)) | |
240 | - | then bk | |
241 | - | else bc(bk, bg[bl]) | |
242 | - | ||
243 | - | func bm (bk,bl) = if ((bl >= bh)) | |
244 | - | then bk | |
52 | + | let y = "k_feeToStakersPercent" | |
53 | + | ||
54 | + | let z = "k_maxOracleDelay" | |
55 | + | ||
56 | + | let A = "k_lastDataStr" | |
57 | + | ||
58 | + | let B = "k_lastMinuteId" | |
59 | + | ||
60 | + | let C = "k_twapDataLastCumulativePrice" | |
61 | + | ||
62 | + | let D = "k_twapDataLastPrice" | |
63 | + | ||
64 | + | let E = "k_twapDataPreviousMinuteId" | |
65 | + | ||
66 | + | let F = "k_latestLongPremiumFraction" | |
67 | + | ||
68 | + | let G = "k_latestShortPremiumFraction" | |
69 | + | ||
70 | + | let H = "k_nextFundingBlockMinTimestamp" | |
71 | + | ||
72 | + | let I = "k_longFundingRate" | |
73 | + | ||
74 | + | let J = "k_shortFundingRate" | |
75 | + | ||
76 | + | let K = "k_qtAstR" | |
77 | + | ||
78 | + | let L = "k_bsAstR" | |
79 | + | ||
80 | + | let M = "k_qtAstW" | |
81 | + | ||
82 | + | let N = "k_bsAstW" | |
83 | + | ||
84 | + | let O = "k_totalPositionSize" | |
85 | + | ||
86 | + | let P = "k_totalLongPositionSize" | |
87 | + | ||
88 | + | let Q = "k_totalShortPositionSize" | |
89 | + | ||
90 | + | let R = "k_openInterestNotional" | |
91 | + | ||
92 | + | let S = "k_openInterestShort" | |
93 | + | ||
94 | + | let T = "k_openInterestLong" | |
95 | + | ||
96 | + | let U = "k_coordinatorAddress" | |
97 | + | ||
98 | + | let V = "k_vault_address" | |
99 | + | ||
100 | + | let W = "k_admin_address" | |
101 | + | ||
102 | + | let X = "k_admin_public_key" | |
103 | + | ||
104 | + | let Y = "k_quote_asset" | |
105 | + | ||
106 | + | let Z = "k_quote_staking" | |
107 | + | ||
108 | + | let aa = "k_staking_address" | |
109 | + | ||
110 | + | let ab = "k_miner_address" | |
111 | + | ||
112 | + | let ac = "k_orders_address" | |
113 | + | ||
114 | + | let ad = "k_referral_address" | |
115 | + | ||
116 | + | let ae = "k_collateral_address" | |
117 | + | ||
118 | + | let af = "k_exchange_address" | |
119 | + | ||
120 | + | let ag = "k_nft_manager_address" | |
121 | + | ||
122 | + | let ah = "k_trader_market_asset_collateral" | |
123 | + | ||
124 | + | func ai (aj,ak) = ((aj + "_") + ak) | |
125 | + | ||
126 | + | ||
127 | + | func al () = valueOrErrorMessage(addressFromString(getStringValue(this, U)), "Coordinator not set") | |
128 | + | ||
129 | + | ||
130 | + | func am () = addressFromString(getStringValue(al(), W)) | |
131 | + | ||
132 | + | ||
133 | + | func an () = fromBase58String(getStringValue(al(), X)) | |
134 | + | ||
135 | + | ||
136 | + | func ao () = fromBase58String(getStringValue(al(), Y)) | |
137 | + | ||
138 | + | ||
139 | + | func ap () = valueOrErrorMessage(addressFromString(getStringValue(al(), Z)), "Quote asset staking not set") | |
140 | + | ||
141 | + | ||
142 | + | func aq () = valueOrErrorMessage(addressFromString(getStringValue(al(), aa)), "Staking not set") | |
143 | + | ||
144 | + | ||
145 | + | func ar () = valueOrErrorMessage(addressFromString(getStringValue(al(), V)), "Vault not set") | |
146 | + | ||
147 | + | ||
148 | + | func as () = valueOrErrorMessage(addressFromString(getStringValue(al(), ab)), "Miner not set") | |
149 | + | ||
150 | + | ||
151 | + | func at () = valueOrErrorMessage(addressFromString(getStringValue(al(), ac)), "Orders not set") | |
152 | + | ||
153 | + | ||
154 | + | func au () = valueOrErrorMessage(addressFromString(getStringValue(al(), ad)), "Referral not set") | |
155 | + | ||
156 | + | ||
157 | + | func av () = valueOrErrorMessage(addressFromString(getStringValue(al(), ag)), "NFT Manager not set") | |
158 | + | ||
159 | + | ||
160 | + | func aw () = valueOrErrorMessage(addressFromString(getStringValue(al(), ae)), "Collateral Manager not set") | |
161 | + | ||
162 | + | ||
163 | + | func ax () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(al(), af), "No swap address")), "Invalid swap address") | |
164 | + | ||
165 | + | ||
166 | + | let ay = "k_whitelist_asset" | |
167 | + | ||
168 | + | func az (aA) = valueOrElse(getBoolean(aw(), ai(ay, aA)), false) | |
169 | + | ||
170 | + | ||
171 | + | let aB = "k_token_param" | |
172 | + | ||
173 | + | let aC = "k_token_type" | |
174 | + | ||
175 | + | let aD = "fee_reduction" | |
176 | + | ||
177 | + | let aE = 1 | |
178 | + | ||
179 | + | let aF = 2 | |
180 | + | ||
181 | + | let aG = 15 | |
182 | + | ||
183 | + | let aH = 15 | |
184 | + | ||
185 | + | let aI = 1000 | |
186 | + | ||
187 | + | let aJ = 6 | |
188 | + | ||
189 | + | let aK = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
190 | + | ||
191 | + | let aL = (86400 * aK) | |
192 | + | ||
193 | + | let aM = 100 | |
194 | + | ||
195 | + | let aN = 1 | |
196 | + | ||
197 | + | let aO = 2 | |
198 | + | ||
199 | + | func aP (aQ) = (toString(aQ) + ",") | |
200 | + | ||
201 | + | ||
202 | + | func aR (aQ,aS) = fraction(aQ, aK, aS, HALFEVEN) | |
203 | + | ||
204 | + | ||
205 | + | func aT (aQ,aS) = fraction(aQ, aS, aK, HALFEVEN) | |
206 | + | ||
207 | + | ||
208 | + | func aU (aQ) = sqrt(aQ, aJ, aJ, HALFEVEN) | |
209 | + | ||
210 | + | ||
211 | + | func aV (aQ,aS) = pow(aQ, aJ, aS, aJ, aJ, HALFEVEN) | |
212 | + | ||
213 | + | ||
214 | + | func aW (aQ,aS) = fraction(aQ, toBigInt(aK), aS, HALFEVEN) | |
215 | + | ||
216 | + | ||
217 | + | func aX (aQ,aS) = fraction(aQ, aS, toBigInt(aK), HALFEVEN) | |
218 | + | ||
219 | + | ||
220 | + | func aY (aQ) = sqrtBigInt(aQ, aJ, aJ, HALFEVEN) | |
221 | + | ||
222 | + | ||
223 | + | func aZ (aQ,aS) = pow(aQ, aJ, aS, aJ, aJ, HALFEVEN) | |
224 | + | ||
225 | + | ||
226 | + | func ba (aQ) = if ((aQ > 0)) | |
227 | + | then aQ | |
228 | + | else -(aQ) | |
229 | + | ||
230 | + | ||
231 | + | func bb (aQ,aS) = if ((aQ >= aS)) | |
232 | + | then aQ | |
233 | + | else aS | |
234 | + | ||
235 | + | ||
236 | + | func bc (bd) = { | |
237 | + | func be (bf,bg) = ((bf + bg) + ",") | |
238 | + | ||
239 | + | let bh = { | |
240 | + | let bi = bd | |
241 | + | let bj = size(bi) | |
242 | + | let bk = "" | |
243 | + | func bl (bm,bn) = if ((bn >= bj)) | |
244 | + | then bm | |
245 | + | else be(bm, bi[bn]) | |
246 | + | ||
247 | + | func bo (bm,bn) = if ((bn >= bj)) | |
248 | + | then bm | |
245 | 249 | else throw("List size exceeds 20") | |
246 | 250 | ||
247 | - | | |
251 | + | bo(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bk, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
248 | 252 | } | |
249 | - | let bn = dropRight(bf, 1) | |
250 | - | let bo = if ((take(bn, 1) == ",")) | |
251 | - | then drop(bn, 1) | |
252 | - | else bn | |
253 | - | bo | |
254 | - | } | |
255 | - | ||
256 | - | ||
257 | - | func bp (bq) = split(bq, ",") | |
258 | - | ||
259 | - | ||
260 | - | func br (bb,bs,bt) = if ((size(bb) > bs)) | |
261 | - | then (removeByIndex(bb, 0) :+ bt) | |
262 | - | else (bb :+ bt) | |
263 | - | ||
264 | - | ||
265 | - | func bu (bv) = valueOrErrorMessage(getInteger(this, bv), ("no value for " + bv)) | |
266 | - | ||
267 | - | ||
268 | - | func bw (bv,bx) = valueOrElse(getInteger(this, bv), bx) | |
269 | - | ||
270 | - | ||
271 | - | func by (ai,ah) = { | |
272 | - | let be = valueOrErrorMessage(getString(ai, ah), ("No value for key " + ah)) | |
273 | - | be | |
274 | - | } | |
275 | - | ||
276 | - | ||
277 | - | func bz (ai,ah) = { | |
278 | - | let be = valueOrErrorMessage(getInteger(ai, ah), ("No value for key " + ah)) | |
279 | - | be | |
280 | - | } | |
281 | - | ||
282 | - | ||
283 | - | func bA () = bu(d) | |
284 | - | ||
285 | - | ||
286 | - | func bB () = bu(o) | |
287 | - | ||
288 | - | ||
289 | - | func bC () = bu(q) | |
290 | - | ||
291 | - | ||
292 | - | func bD () = bu(I) | |
293 | - | ||
294 | - | ||
295 | - | func bE () = bu(J) | |
296 | - | ||
297 | - | ||
298 | - | func bF () = bw(K, aI) | |
299 | - | ||
300 | - | ||
301 | - | func bG () = bw(L, aI) | |
302 | - | ||
303 | - | ||
304 | - | func bH () = bu(M) | |
305 | - | ||
306 | - | ||
307 | - | func bI () = bu(P) | |
308 | - | ||
309 | - | ||
310 | - | func bJ () = bu(Q) | |
311 | - | ||
312 | - | ||
313 | - | func bK () = bu(R) | |
314 | - | ||
315 | - | ||
316 | - | func bL () = bu(F) | |
317 | - | ||
318 | - | ||
319 | - | func bM () = bu(p) | |
320 | - | ||
321 | - | ||
322 | - | func bN () = (bM() * aI) | |
323 | - | ||
324 | - | ||
325 | - | func bO () = (bM() * aG) | |
326 | - | ||
327 | - | ||
328 | - | func bP () = bu(r) | |
329 | - | ||
330 | - | ||
331 | - | func bQ () = bu(s) | |
332 | - | ||
333 | - | ||
334 | - | func bR () = bu(t) | |
335 | - | ||
336 | - | ||
337 | - | func bS () = bu(u) | |
338 | - | ||
339 | - | ||
340 | - | func bT () = bu(v) | |
341 | - | ||
342 | - | ||
343 | - | func bU () = bu(w) | |
344 | - | ||
345 | - | ||
346 | - | func bV () = bu(x) | |
347 | - | ||
348 | - | ||
349 | - | func bW () = bu(D) | |
350 | - | ||
351 | - | ||
352 | - | func bX () = bu(E) | |
353 | - | ||
354 | - | ||
355 | - | func bY () = bu(O) | |
356 | - | ||
357 | - | ||
358 | - | func bZ () = bu(N) | |
359 | - | ||
360 | - | ||
361 | - | func ca () = bw(e, 0) | |
362 | - | ||
363 | - | ||
364 | - | func cb (cc) = valueOrElse(getString(ar(), "k_sender"), toString(cc.caller)) | |
365 | - | ||
366 | - | ||
367 | - | func cd (ce,cf,cg) = { | |
368 | - | let ch = (ce - cf) | |
369 | - | if (if (cg) | |
370 | - | then (0 > ch) | |
253 | + | let bp = dropRight(bh, 1) | |
254 | + | let bq = if ((take(bp, 1) == ",")) | |
255 | + | then drop(bp, 1) | |
256 | + | else bp | |
257 | + | bq | |
258 | + | } | |
259 | + | ||
260 | + | ||
261 | + | func br (bs) = split(bs, ",") | |
262 | + | ||
263 | + | ||
264 | + | func bt (bd,bu,bv) = if ((size(bd) > bu)) | |
265 | + | then (removeByIndex(bd, 0) :+ bv) | |
266 | + | else (bd :+ bv) | |
267 | + | ||
268 | + | ||
269 | + | func bw (bx) = valueOrErrorMessage(getInteger(this, bx), ("no value for " + bx)) | |
270 | + | ||
271 | + | ||
272 | + | func by (bx,bz) = valueOrElse(getInteger(this, bx), bz) | |
273 | + | ||
274 | + | ||
275 | + | func bA (ak,aj) = { | |
276 | + | let bg = valueOrErrorMessage(getString(ak, aj), ("No value for key " + aj)) | |
277 | + | bg | |
278 | + | } | |
279 | + | ||
280 | + | ||
281 | + | func bB (ak,aj) = { | |
282 | + | let bg = valueOrErrorMessage(getInteger(ak, aj), ("No value for key " + aj)) | |
283 | + | bg | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | func bC () = bw(d) | |
288 | + | ||
289 | + | ||
290 | + | func bD () = bw(o) | |
291 | + | ||
292 | + | ||
293 | + | func bE () = bw(q) | |
294 | + | ||
295 | + | ||
296 | + | func bF () = bw(K) | |
297 | + | ||
298 | + | ||
299 | + | func bG () = bw(L) | |
300 | + | ||
301 | + | ||
302 | + | func bH () = by(M, aK) | |
303 | + | ||
304 | + | ||
305 | + | func bI () = by(N, aK) | |
306 | + | ||
307 | + | ||
308 | + | func bJ () = bw(O) | |
309 | + | ||
310 | + | ||
311 | + | func bK () = bw(R) | |
312 | + | ||
313 | + | ||
314 | + | func bL () = bw(S) | |
315 | + | ||
316 | + | ||
317 | + | func bM () = bw(T) | |
318 | + | ||
319 | + | ||
320 | + | func bN () = bw(H) | |
321 | + | ||
322 | + | ||
323 | + | func bO () = bw(p) | |
324 | + | ||
325 | + | ||
326 | + | func bP () = (bO() * aK) | |
327 | + | ||
328 | + | ||
329 | + | func bQ () = (bO() * aI) | |
330 | + | ||
331 | + | ||
332 | + | func bR () = bw(r) | |
333 | + | ||
334 | + | ||
335 | + | func bS () = bw(s) | |
336 | + | ||
337 | + | ||
338 | + | func bT () = bw(t) | |
339 | + | ||
340 | + | ||
341 | + | func bU () = bw(u) | |
342 | + | ||
343 | + | ||
344 | + | func bV () = bw(v) | |
345 | + | ||
346 | + | ||
347 | + | func bW () = bw(w) | |
348 | + | ||
349 | + | ||
350 | + | func bX () = bw(x) | |
351 | + | ||
352 | + | ||
353 | + | func bY () = bw(F) | |
354 | + | ||
355 | + | ||
356 | + | func bZ () = bw(G) | |
357 | + | ||
358 | + | ||
359 | + | func ca () = bw(Q) | |
360 | + | ||
361 | + | ||
362 | + | func cb () = bw(P) | |
363 | + | ||
364 | + | ||
365 | + | func cc () = by(e, 0) | |
366 | + | ||
367 | + | ||
368 | + | func cd () = bw(y) | |
369 | + | ||
370 | + | ||
371 | + | func ce () = bw(z) | |
372 | + | ||
373 | + | ||
374 | + | func cf (cg) = valueOrElse(getString(at(), "k_sender"), toString(cg.caller)) | |
375 | + | ||
376 | + | ||
377 | + | func ch (ci,cj,ck) = { | |
378 | + | let cl = (ci - cj) | |
379 | + | if (if (ck) | |
380 | + | then (0 > cl) | |
371 | 381 | else false) | |
372 | 382 | then throw("Invalid margin") | |
373 | - | else if (if (!( | |
374 | - | then ( | |
383 | + | else if (if (!(ck)) | |
384 | + | then (cl >= 0) | |
375 | 385 | else false) | |
376 | 386 | then throw("Invalid margin") | |
377 | 387 | else true | |
378 | 388 | } | |
379 | 389 | ||
380 | 390 | ||
381 | - | func | |
391 | + | func cm (cn) = if ((cn == 0)) | |
382 | 392 | then throw("Should not be called with _positionSize == 0") | |
383 | - | else if (( | |
384 | - | then | |
385 | - | else | |
386 | - | ||
387 | - | ||
388 | - | func | |
389 | - | let | |
390 | - | let | |
391 | - | if ($isInstanceOf( | |
393 | + | else if ((cn > 0)) | |
394 | + | then bY() | |
395 | + | else bZ() | |
396 | + | ||
397 | + | ||
398 | + | func co (cp) = { | |
399 | + | let cq = getInteger(this, ai(f, cp)) | |
400 | + | let cr = cq | |
401 | + | if ($isInstanceOf(cr, "Int")) | |
392 | 402 | then { | |
393 | - | let | |
394 | - | $Tuple4( | |
403 | + | let cs = cr | |
404 | + | $Tuple4(cs, getIntegerValue(this, ai(g, cp)), getIntegerValue(this, ai(h, cp)), getIntegerValue(this, ai(i, cp))) | |
395 | 405 | } | |
396 | 406 | else $Tuple4(0, 0, 0, 0) | |
397 | 407 | } | |
398 | 408 | ||
399 | 409 | ||
400 | - | func | |
401 | - | let | |
402 | - | let | |
403 | - | if ($isInstanceOf( | |
410 | + | func ct (cp) = { | |
411 | + | let cu = getString(this, ai(k, cp)) | |
412 | + | let cr = cu | |
413 | + | if ($isInstanceOf(cr, "String")) | |
404 | 414 | then { | |
405 | - | let | |
406 | - | | |
407 | - | } | |
408 | - | else toBase58String( | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | func | |
415 | + | let cv = cr | |
416 | + | cv | |
417 | + | } | |
418 | + | else toBase58String(ao()) | |
419 | + | } | |
420 | + | ||
421 | + | ||
422 | + | func cw (cp) = if ((co(cp)._1 == 0)) | |
413 | 423 | then throw("No open position") | |
414 | 424 | else true | |
415 | 425 | ||
416 | 426 | ||
417 | - | func | |
418 | - | ||
419 | - | ||
420 | - | func | |
421 | - | ||
422 | - | ||
423 | - | func | |
424 | - | ||
425 | - | ||
426 | - | func | |
427 | + | func cx () = valueOrElse(getBoolean(this, l), false) | |
428 | + | ||
429 | + | ||
430 | + | func cy () = valueOrElse(getBoolean(this, m), false) | |
431 | + | ||
432 | + | ||
433 | + | func cz () = valueOrElse(getBoolean(this, n), false) | |
434 | + | ||
435 | + | ||
436 | + | func cA (cB,cC,cD) = if (cB) | |
427 | 437 | then { | |
428 | - | let | |
429 | - | if ((0 >= | |
438 | + | let cE = (bG() - cD) | |
439 | + | if ((0 >= cE)) | |
430 | 440 | then throw("Tx lead to base asset reserve <= 0, revert") | |
431 | - | else $Tuple3(( | |
441 | + | else $Tuple3((bF() + cC), cE, (bJ() + cD)) | |
432 | 442 | } | |
433 | 443 | else { | |
434 | - | let | |
435 | - | if ((0 >= | |
444 | + | let cF = (bF() - cC) | |
445 | + | if ((0 >= cF)) | |
436 | 446 | then throw("Tx lead to base quote reserve <= 0, revert") | |
437 | - | else $Tuple3( | |
447 | + | else $Tuple3(cF, (bG() + cD), (bJ() - cD)) | |
438 | 448 | } | |
439 | 449 | ||
440 | 450 | ||
441 | - | func | |
442 | - | let | |
443 | - | let | |
444 | - | let | |
445 | - | let | |
446 | - | | |
447 | - | } | |
448 | - | ||
449 | - | ||
450 | - | func | |
451 | - | let | |
452 | - | let | |
453 | - | let | |
454 | - | let | |
455 | - | let | |
456 | - | let | |
457 | - | then ( | |
458 | - | else ( | |
459 | - | let | |
460 | - | let | |
461 | - | let | |
462 | - | then | |
463 | - | else -( | |
464 | - | let | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | let | |
473 | - | if (( | |
474 | - | then throw(((((((((((((("Price impact " + toString( | |
475 | - | else $Tuple4( | |
476 | - | } | |
477 | - | ||
478 | - | ||
479 | - | func | |
480 | - | let | |
451 | + | func cG (cH,cI,cJ,cK) = { | |
452 | + | let cL = toBigInt(cH) | |
453 | + | let cM = toBigInt(cI) | |
454 | + | let cN = toBigInt(cJ) | |
455 | + | let cO = toBigInt(cK) | |
456 | + | aX(aX(cL, cM), aX(cN, cO)) | |
457 | + | } | |
458 | + | ||
459 | + | ||
460 | + | func cP (cB,cC) = { | |
461 | + | let cH = bF() | |
462 | + | let cJ = bG() | |
463 | + | let cI = bH() | |
464 | + | let cK = bI() | |
465 | + | let bx = cG(cH, cI, cJ, cK) | |
466 | + | let cQ = if (cB) | |
467 | + | then (cH + cC) | |
468 | + | else (cH - cC) | |
469 | + | let cR = toInt(aW(bx, toBigInt(aT(cQ, cI)))) | |
470 | + | let cS = aR(ba((cR - cJ)), cI) | |
471 | + | let cT = if (cB) | |
472 | + | then cS | |
473 | + | else -(cS) | |
474 | + | let cU = cA(cB, cC, cS) | |
475 | + | let cV = cU._1 | |
476 | + | let cW = cU._2 | |
477 | + | let cX = cU._3 | |
478 | + | let cY = aR(aT(cH, cI), aT(cJ, cK)) | |
479 | + | let cZ = aR(cC, cS) | |
480 | + | let da = ba((cY - cZ)) | |
481 | + | let db = (aK - aR(cY, (cY + da))) | |
482 | + | let dc = bV() | |
483 | + | if ((db > dc)) | |
484 | + | then throw(((((((((((((("Price impact " + toString(db)) + " > max price impact ") + toString(dc)) + " before quote asset: ") + toString(cH)) + " before base asset: ") + toString(cJ)) + " quote asset amount to exchange: ") + toString(cC)) + " price before: ") + toString(cY)) + " marketPrice: ") + toString(cZ))) | |
485 | + | else $Tuple4(cT, cV, cW, cX) | |
486 | + | } | |
487 | + | ||
488 | + | ||
489 | + | func dd (de,df,dg,dh) = { | |
490 | + | let di = if ((de != 0)) | |
481 | 491 | then { | |
482 | - | let | |
483 | - | | |
492 | + | let dj = cm(de) | |
493 | + | aT((dj - dg), de) | |
484 | 494 | } | |
485 | 495 | else 0 | |
486 | - | let | |
487 | - | let | |
488 | - | then $Tuple2(0, | |
489 | - | else $Tuple2( | |
490 | - | let | |
491 | - | let | |
492 | - | $Tuple3( | |
493 | - | } | |
494 | - | ||
495 | - | ||
496 | - | func | |
497 | - | let | |
498 | - | if (( | |
496 | + | let dk = ((dh - di) + df) | |
497 | + | let dl = if ((0 > dk)) | |
498 | + | then $Tuple2(0, ba(dk)) | |
499 | + | else $Tuple2(ba(dk), 0) | |
500 | + | let dm = dl._1 | |
501 | + | let dn = dl._2 | |
502 | + | $Tuple3(dm, dn, di) | |
503 | + | } | |
504 | + | ||
505 | + | ||
506 | + | func do (cB,cD,dp,dq,dr,ds,dt) = { | |
507 | + | let cY = aR(aT(dq, dr), aT(ds, dt)) | |
508 | + | if ((cD == 0)) | |
499 | 509 | then throw("Invalid base asset amount") | |
500 | 510 | else { | |
501 | - | let | |
502 | - | let | |
503 | - | then ( | |
504 | - | else ( | |
505 | - | let | |
506 | - | let | |
507 | - | let | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | let | |
513 | - | let | |
514 | - | let | |
515 | - | if (if (( | |
516 | - | then | |
511 | + | let bx = cG(dq, dr, ds, dt) | |
512 | + | let du = if (cB) | |
513 | + | then (ds + cD) | |
514 | + | else (ds - cD) | |
515 | + | let dv = toInt(aW(bx, toBigInt(aT(du, dt)))) | |
516 | + | let dw = ba((dv - aT(dq, dr))) | |
517 | + | let dc = bV() | |
518 | + | let dx = cA(!(cB), dw, cD) | |
519 | + | let cV = dx._1 | |
520 | + | let cW = dx._2 | |
521 | + | let cX = dx._3 | |
522 | + | let cZ = aR(dw, cD) | |
523 | + | let da = ba((cY - cZ)) | |
524 | + | let db = (aK - aR(cY, (cY + da))) | |
525 | + | if (if ((db > dc)) | |
526 | + | then dp | |
517 | 527 | else false) | |
518 | - | then throw(((((((((((((("Price impact " + toString(cX)) + " > max price impact ") + toString(cY)) + " before quote asset: ") + toString(dm)) + " before base asset: ") + toString(do)) + " base asset amount to exchange: ") + toString(cz)) + " price before: ") + toString(cU)) + " market price: ") + toString(cV))) | |
519 | - | else $Tuple7(ds, cR, cS, cT, (bZ() - (if (cx) | |
520 | - | then aY(cz) | |
521 | - | else 0)), (bY() - (if (!(cx)) | |
522 | - | then aY(cz) | |
523 | - | else 0)), cX) | |
524 | - | } | |
525 | - | } | |
526 | - | ||
527 | - | ||
528 | - | func du (cx,cz,dl) = dk(cx, cz, dl, bD(), bF(), bE(), bG()) | |
529 | - | ||
530 | - | ||
531 | - | func dv () = { | |
532 | - | let dw = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
533 | - | let dx = getStringValue(this, a) | |
534 | - | let dy = getStringValue(this, b) | |
535 | - | let dz = valueOrErrorMessage(getInteger(dw, dx), ((("Can not get oracle price. Oracle: " + toString(dw)) + " key: ") + dx)) | |
536 | - | dz | |
537 | - | } | |
538 | - | ||
539 | - | ||
540 | - | func dA (dm,do) = { | |
541 | - | let dB = dv() | |
542 | - | let dC = aP(dm, do) | |
543 | - | let dD = aP((dB + dC), (2 * aI)) | |
544 | - | let dE = aP(aY((dB - dC)), dD) | |
545 | - | if ((dE > bU())) | |
546 | - | then throw(((("Price spread " + toString(dE)) + " > max price spread ") + toString(bU()))) | |
528 | + | then throw(((((((((((((("Price impact " + toString(db)) + " > max price impact ") + toString(dc)) + " before quote asset: ") + toString(dq)) + " before base asset: ") + toString(ds)) + " base asset amount to exchange: ") + toString(cD)) + " price before: ") + toString(cY)) + " market price: ") + toString(cZ))) | |
529 | + | else $Tuple7(dw, cV, cW, cX, (cb() - (if (cB) | |
530 | + | then ba(cD) | |
531 | + | else 0)), (ca() - (if (!(cB)) | |
532 | + | then ba(cD) | |
533 | + | else 0)), db) | |
534 | + | } | |
535 | + | } | |
536 | + | ||
537 | + | ||
538 | + | func dy (cB,cD,dp) = do(cB, cD, dp, bF(), bH(), bG(), bI()) | |
539 | + | ||
540 | + | ||
541 | + | func dz () = { | |
542 | + | let dA = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
543 | + | let dB = getStringValue(this, a) | |
544 | + | let dC = valueOrErrorMessage(getInteger(dA, dB), ((("Can not get oracle price. Oracle: " + toString(dA)) + " key: ") + dB)) | |
545 | + | let dD = valueOrElse(getString(this, b), "") | |
546 | + | if ((dD != "")) | |
547 | + | then { | |
548 | + | let dE = lastBlock.height | |
549 | + | let dF = valueOrErrorMessage(getInteger(dA, b), ((("Can not get oracle block. Oracle: " + toString(dA)) + " key: ") + dD)) | |
550 | + | if (((dE - dF) > ce())) | |
551 | + | then throw(((("Oracle stale data. Last oracle block: " + toString(dF)) + " current block: ") + toString(dE))) | |
552 | + | else dC | |
553 | + | } | |
554 | + | else dC | |
555 | + | } | |
556 | + | ||
557 | + | ||
558 | + | func dG (dq,ds) = { | |
559 | + | let dH = dz() | |
560 | + | let cI = bH() | |
561 | + | let cK = bI() | |
562 | + | let dI = aR(aT(dq, cI), aT(ds, cK)) | |
563 | + | let dJ = aR((dH + dI), (2 * aK)) | |
564 | + | let dK = aR(ba((dH - dI)), dJ) | |
565 | + | if ((dK > bW())) | |
566 | + | then throw(((("Price spread " + toString(dK)) + " > max price spread ") + toString(bW()))) | |
547 | 567 | else true | |
548 | 568 | } | |
549 | 569 | ||
550 | 570 | ||
551 | - | func | |
552 | - | let | |
553 | - | if (( | |
554 | - | then throw(((("Long open notional " + toString( | |
555 | - | else if (( | |
556 | - | then throw(((("Short open notional " + toString( | |
571 | + | func dL (dM,dN) = { | |
572 | + | let dO = bX() | |
573 | + | if ((dM > dO)) | |
574 | + | then throw(((("Long open notional " + toString(dM)) + " > max open notional ") + toString(dO))) | |
575 | + | else if ((dN > dO)) | |
576 | + | then throw(((("Short open notional " + toString(dN)) + " > max open notional ") + toString(dO))) | |
557 | 577 | else true | |
558 | 578 | } | |
559 | 579 | ||
560 | 580 | ||
561 | - | func | |
562 | - | let | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | | |
567 | - | } | |
568 | - | ||
569 | - | ||
570 | - | func | |
571 | - | let | |
572 | - | let | |
573 | - | ( | |
574 | - | } | |
575 | - | ||
576 | - | ||
577 | - | func | |
578 | - | let | |
579 | - | let | |
580 | - | let | |
581 | + | func dP () = { | |
582 | + | let dq = bF() | |
583 | + | let ds = bG() | |
584 | + | let cI = bH() | |
585 | + | let cK = bI() | |
586 | + | aR(aT(dq, cI), aT(ds, cK)) | |
587 | + | } | |
588 | + | ||
589 | + | ||
590 | + | func dQ () = { | |
591 | + | let dH = dz() | |
592 | + | let dR = dP() | |
593 | + | (aR(ba((dH - dR)), dH) > bU()) | |
594 | + | } | |
595 | + | ||
596 | + | ||
597 | + | func dS (cn,dT,dq,dr,ds,dt) = { | |
598 | + | let dU = ba(cn) | |
599 | + | let dV = (0 > cn) | |
600 | + | let dW = if ((dT == aN)) | |
581 | 601 | then { | |
582 | - | let | |
583 | - | let | |
584 | - | let | |
585 | - | let | |
586 | - | let | |
587 | - | | |
588 | - | } | |
589 | - | else | |
590 | - | | |
591 | - | } | |
592 | - | ||
593 | - | ||
594 | - | func | |
602 | + | let dX = do(!(dV), dU, false, dq, dr, ds, dt) | |
603 | + | let dY = dX._1 | |
604 | + | let dZ = dX._2 | |
605 | + | let ea = dX._3 | |
606 | + | let eb = dX._4 | |
607 | + | dY | |
608 | + | } | |
609 | + | else aT(dU, dz()) | |
610 | + | dW | |
611 | + | } | |
612 | + | ||
613 | + | ||
614 | + | func ec (cn,ed,dq,dr,ds,dt,dT) = if ((cn == 0)) | |
595 | 615 | then throw("Invalid position size") | |
596 | 616 | else { | |
597 | - | let | |
598 | - | let | |
599 | - | let | |
600 | - | then ( | |
601 | - | else ( | |
602 | - | $Tuple2( | |
617 | + | let dV = (0 > cn) | |
618 | + | let dW = dS(cn, dT, dq, dr, ds, dt) | |
619 | + | let ee = if (dV) | |
620 | + | then (ed - dW) | |
621 | + | else (dW - ed) | |
622 | + | $Tuple2(dW, ee) | |
603 | 623 | } | |
604 | 624 | ||
605 | 625 | ||
606 | - | func | |
607 | - | let | |
608 | - | let | |
609 | - | let | |
610 | - | let | |
611 | - | let | |
612 | - | | |
613 | - | } | |
614 | - | ||
615 | - | ||
616 | - | func | |
617 | - | ||
618 | - | ||
619 | - | func | |
620 | - | let | |
621 | - | let | |
622 | - | let | |
623 | - | let | |
624 | - | let | |
625 | - | let | |
626 | - | let | |
627 | - | let | |
628 | - | let | |
629 | - | let | |
630 | - | let | |
631 | - | | |
632 | - | } | |
633 | - | ||
634 | - | ||
635 | - | func | |
636 | - | ||
637 | - | ||
638 | - | func | |
639 | - | let | |
640 | - | let | |
641 | - | let | |
642 | - | let | |
643 | - | let | |
644 | - | if (( | |
645 | - | then | |
626 | + | func ef (cp,dT) = { | |
627 | + | let eg = co(cp) | |
628 | + | let cs = eg._1 | |
629 | + | let eh = eg._2 | |
630 | + | let ei = eg._3 | |
631 | + | let ej = eg._4 | |
632 | + | ec(cs, ei, bF(), bH(), bG(), bI(), dT) | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | func ek (el,em,en) = aR((el - em), en) | |
637 | + | ||
638 | + | ||
639 | + | func eo (cp,dT) = { | |
640 | + | let ep = co(cp) | |
641 | + | let cs = ep._1 | |
642 | + | let eh = ep._2 | |
643 | + | let eq = ep._3 | |
644 | + | let ej = ep._4 | |
645 | + | let er = ef(cp, dT) | |
646 | + | let dW = er._1 | |
647 | + | let ee = er._2 | |
648 | + | let es = dd(cs, eh, ej, ee) | |
649 | + | let dm = es._1 | |
650 | + | let dn = es._2 | |
651 | + | ek(dm, dn, dW) | |
652 | + | } | |
653 | + | ||
654 | + | ||
655 | + | func et (cp) = eo(cp, aN) | |
656 | + | ||
657 | + | ||
658 | + | func eu (cp,cn) = { | |
659 | + | let ev = bb(bT(), (aK - aR(et(cp), bR()))) | |
660 | + | let ew = aT(ba(cn), ev) | |
661 | + | let ex = dy((cn > 0), ew, false) | |
662 | + | let ey = ex._1 | |
663 | + | let db = ex._7 | |
664 | + | if ((bV() > db)) | |
665 | + | then ey | |
646 | 666 | else { | |
647 | - | let | |
648 | - | let | |
649 | - | | |
650 | - | } | |
651 | - | } | |
652 | - | ||
653 | - | ||
654 | - | func | |
655 | - | let | |
656 | - | let | |
657 | - | let | |
658 | - | let | |
659 | - | let | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
664 | - | let | |
665 | - | let | |
666 | - | let | |
667 | - | let | |
668 | - | let | |
669 | - | let | |
670 | - | let | |
671 | - | let | |
672 | - | let | |
673 | - | let | |
674 | - | let | |
675 | - | $Tuple13( | |
676 | - | then | |
677 | - | else 0)), ( | |
678 | - | then | |
667 | + | let ez = aT(ba(cn), bT()) | |
668 | + | let eA = dy((cn > 0), ez, false)._1 | |
669 | + | eA | |
670 | + | } | |
671 | + | } | |
672 | + | ||
673 | + | ||
674 | + | func eB (cp,dp) = { | |
675 | + | let eC = co(cp) | |
676 | + | let cs = eC._1 | |
677 | + | let eh = eC._2 | |
678 | + | let ei = eC._3 | |
679 | + | let ej = eC._4 | |
680 | + | let ee = ef(cp, aN)._2 | |
681 | + | let eD = dd(cs, eh, ej, ee) | |
682 | + | let dm = eD._1 | |
683 | + | let dn = eD._2 | |
684 | + | let ez = -(cs) | |
685 | + | let eE = ee | |
686 | + | let eF = -(dm) | |
687 | + | let eG = dy((cs > 0), ba(cs), dp) | |
688 | + | let eA = eG._1 | |
689 | + | let cQ = eG._2 | |
690 | + | let cR = eG._3 | |
691 | + | let eH = eG._4 | |
692 | + | let eI = eG._5 | |
693 | + | let eJ = eG._6 | |
694 | + | let eK = (bK() - ei) | |
695 | + | $Tuple13(ez, dn, eE, eF, cQ, cR, eH, eK, eA, eI, eJ, (bM() - (if ((cs > 0)) | |
696 | + | then ei | |
697 | + | else 0)), (bL() - (if ((0 > cs)) | |
698 | + | then ei | |
679 | 699 | else 0))) | |
680 | 700 | } | |
681 | 701 | ||
682 | 702 | ||
683 | - | func | |
684 | - | let | |
685 | - | let | |
686 | - | let | |
687 | - | let | |
688 | - | func | |
689 | - | then ( | |
690 | - | else | |
691 | - | ||
692 | - | let | |
693 | - | let | |
694 | - | let | |
695 | - | let | |
696 | - | func | |
697 | - | then | |
698 | - | else | |
699 | - | ||
700 | - | func | |
701 | - | then | |
703 | + | func eL () = { | |
704 | + | let eM = ((lastBlock.timestamp / 1000) / 60) | |
705 | + | let eN = (eM - aG) | |
706 | + | let eO = valueOrElse(getString(this, A), "") | |
707 | + | let eP = split(eO, ",") | |
708 | + | func eQ (bf,eR) = if ((eN >= parseIntValue(eR))) | |
709 | + | then (bf :+ parseIntValue(eR)) | |
710 | + | else bf | |
711 | + | ||
712 | + | let eS = { | |
713 | + | let bi = eP | |
714 | + | let bj = size(bi) | |
715 | + | let bk = nil | |
716 | + | func bl (bm,bn) = if ((bn >= bj)) | |
717 | + | then bm | |
718 | + | else eQ(bm, bi[bn]) | |
719 | + | ||
720 | + | func bo (bm,bn) = if ((bn >= bj)) | |
721 | + | then bm | |
702 | 722 | else throw("List size exceeds 20") | |
703 | 723 | ||
704 | - | | |
724 | + | bo(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bk, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
705 | 725 | } | |
706 | - | let | |
707 | - | then max( | |
708 | - | else parseIntValue( | |
709 | - | let | |
710 | - | let | |
711 | - | let | |
712 | - | let | |
713 | - | let | |
714 | - | let | |
715 | - | let | |
716 | - | (( | |
717 | - | } | |
718 | - | ||
719 | - | ||
720 | - | func | |
721 | - | let | |
722 | - | if (( | |
723 | - | then $Tuple2( | |
726 | + | let eT = if ((size(eS) > 0)) | |
727 | + | then max(eS) | |
728 | + | else parseIntValue(eP[0]) | |
729 | + | let eU = valueOrElse(getInteger(this, B), 0) | |
730 | + | let eV = valueOrElse(getInteger(this, ((C + "_") + toString(eU))), 0) | |
731 | + | let eW = valueOrElse(getInteger(this, ((D + "_") + toString(eU))), 0) | |
732 | + | let eX = (eV + ((eM - eU) * eW)) | |
733 | + | let eY = valueOrElse(getInteger(this, ((C + "_") + toString(eT))), 0) | |
734 | + | let eZ = valueOrElse(getInteger(this, ((D + "_") + toString(eT))), 0) | |
735 | + | let fa = (eY + ((eN - eT) * eZ)) | |
736 | + | ((eX - fa) / aG) | |
737 | + | } | |
738 | + | ||
739 | + | ||
740 | + | func fb () = { | |
741 | + | let cn = bJ() | |
742 | + | if ((cn == 0)) | |
743 | + | then $Tuple2(bF(), bG()) | |
724 | 744 | else { | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | $Tuple2( | |
731 | - | } | |
732 | - | } | |
733 | - | ||
734 | - | ||
735 | - | func | |
736 | - | let | |
737 | - | let | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | let | |
744 | - | let | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | let | |
749 | - | toInt( | |
750 | - | } | |
751 | - | ||
752 | - | ||
753 | - | func | |
754 | - | let | |
755 | - | if (( | |
745 | + | let fc = (cn > 0) | |
746 | + | let fd = dy(fc, ba(cn), false) | |
747 | + | let fe = fd._1 | |
748 | + | let ff = fd._2 | |
749 | + | let fg = fd._3 | |
750 | + | $Tuple2(ff, fg) | |
751 | + | } | |
752 | + | } | |
753 | + | ||
754 | + | ||
755 | + | func fh (fi,bJ,fj,fk) = { | |
756 | + | let fl = toBigInt(fi) | |
757 | + | let fm = toBigInt(bJ) | |
758 | + | let fn = toBigInt(fj) | |
759 | + | let fo = toBigInt(fk) | |
760 | + | let fp = aZ((fl + fm), toBigInt((2 * aK))) | |
761 | + | let fq = aX(fn, fp) | |
762 | + | let fr = (toBigInt(4) * aX(fo, fm)) | |
763 | + | let fs = aY(aX(fq, (fn - fr))) | |
764 | + | let ft = aX(fl, fn) | |
765 | + | let fu = aX(fn, fm) | |
766 | + | let fv = ((-(fs) + ft) + fu) | |
767 | + | let fw = (toBigInt(2) * aX(fn, fm)) | |
768 | + | let fx = aW(fv, fw) | |
769 | + | toInt(fx) | |
770 | + | } | |
771 | + | ||
772 | + | ||
773 | + | func fy (fz) = { | |
774 | + | let cn = bJ() | |
775 | + | if ((cn == 0)) | |
756 | 776 | then { | |
757 | - | let | |
758 | - | let | |
759 | - | let | |
760 | - | $Tuple3( | |
777 | + | let cH = bF() | |
778 | + | let cJ = bG() | |
779 | + | let fA = aR(aT(fz, cJ), cH) | |
780 | + | $Tuple3(fA, aK, 0) | |
761 | 781 | } | |
762 | 782 | else { | |
763 | - | let | |
764 | - | let | |
765 | - | let | |
766 | - | let | |
767 | - | let | |
768 | - | let | |
769 | - | let | |
770 | - | $Tuple3( | |
771 | - | } | |
772 | - | } | |
773 | - | ||
774 | - | ||
775 | - | func | |
776 | - | let | |
777 | - | let | |
778 | - | let | |
779 | - | if (if (( | |
783 | + | let fc = (cn > 0) | |
784 | + | let fe = dy(fc, ba(cn), false)._1 | |
785 | + | let cH = bF() | |
786 | + | let cJ = bG() | |
787 | + | let fA = fh(cJ, cn, cH, fz) | |
788 | + | let fB = aK | |
789 | + | let eF = ec(cn, fe, cH, fA, cJ, fB, aN)._2 | |
790 | + | $Tuple3(fA, fB, eF) | |
791 | + | } | |
792 | + | } | |
793 | + | ||
794 | + | ||
795 | + | func fC () = { | |
796 | + | let fD = dz() | |
797 | + | let fE = eL() | |
798 | + | let fF = (fE - fD) | |
799 | + | if (if ((ca() == 0)) | |
780 | 800 | then true | |
781 | - | else ( | |
801 | + | else (cb() == 0)) | |
782 | 802 | then $Tuple2(0, 0) | |
783 | - | else if ((0 > | |
803 | + | else if ((0 > fF)) | |
784 | 804 | then { | |
785 | - | let | |
786 | - | let | |
787 | - | $Tuple2( | |
805 | + | let fG = aR(aT(fF, bP()), aL) | |
806 | + | let fH = aR(aT(fG, ca()), cb()) | |
807 | + | $Tuple2(fG, fH) | |
788 | 808 | } | |
789 | 809 | else { | |
790 | - | let | |
791 | - | let | |
792 | - | $Tuple2( | |
810 | + | let fH = aR(aT(fF, bP()), aL) | |
811 | + | let fG = aR(aT(fH, cb()), ca()) | |
812 | + | $Tuple2(fG, fH) | |
793 | 813 | } | |
794 | 814 | } | |
795 | 815 | ||
796 | 816 | ||
797 | - | func | |
798 | - | let | |
799 | - | let | |
800 | - | let | |
817 | + | func fI (fJ,fK) = { | |
818 | + | let fL = bD() | |
819 | + | let fM = aT(fL, fK) | |
820 | + | let fN = if ((fJ != "")) | |
801 | 821 | then { | |
802 | - | let | |
803 | - | if (( | |
822 | + | let fO = bA(av(), ai(aC, fJ)) | |
823 | + | if ((fO == aD)) | |
804 | 824 | then { | |
805 | - | let | |
806 | - | let | |
807 | - | $Tuple2( | |
825 | + | let fP = bB(av(), ai(aB, fJ)) | |
826 | + | let fQ = aT(fM, fP) | |
827 | + | $Tuple2(fQ, true) | |
808 | 828 | } | |
809 | 829 | else throw("Invalid attached artifact") | |
810 | 830 | } | |
811 | - | else $Tuple2(fG, false) | |
812 | - | let fK = fH._1 | |
813 | - | let fL = fH._2 | |
814 | - | $Tuple2(fK, fL) | |
815 | - | } | |
816 | - | ||
817 | - | ||
818 | - | func fM (fN,fO,fP,fQ,fR,fS,fT,fU,fV,dI) = [IntegerEntry(q, fN), IntegerEntry(r, fO), IntegerEntry(s, fP), IntegerEntry(p, fQ), IntegerEntry(o, fR), IntegerEntry(u, fS), IntegerEntry(v, fT), IntegerEntry(t, fU), IntegerEntry(w, fV), IntegerEntry(x, dI)] | |
819 | - | ||
820 | - | ||
821 | - | func fW (fX,fY,fZ,ga,gb) = [IntegerEntry(F, fX), IntegerEntry(D, fY), IntegerEntry(E, fZ), IntegerEntry(G, ga), IntegerEntry(H, gb)] | |
822 | - | ||
823 | - | ||
824 | - | func gc (ai,ay) = [StringEntry(ag(k, ai), ay)] | |
825 | - | ||
826 | - | ||
827 | - | func gd (ge,ai) = if (ge) | |
828 | - | then { | |
829 | - | let gf = ca() | |
830 | - | [IntegerEntry(ag(j, ai), (gf + 1)), IntegerEntry(e, (gf + 1))] | |
831 | - | } | |
832 | - | else nil | |
833 | - | ||
834 | - | ||
835 | - | func gg (ai,gh,gi,gj,df) = [IntegerEntry(ag(f, ai), gh), IntegerEntry(ag(g, ai), gi), IntegerEntry(ag(h, ai), gj), IntegerEntry(ag(i, ai), df)] | |
836 | - | ||
837 | - | ||
838 | - | func gk (gl) = { | |
839 | - | let eG = ((lastBlock.timestamp / 1000) / 60) | |
840 | - | let gm = valueOrElse(getInteger(this, z), 0) | |
841 | - | if ((gm > eG)) | |
842 | - | then throw("TWAP out-of-order") | |
831 | + | else $Tuple2(fM, false) | |
832 | + | let fQ = fN._1 | |
833 | + | let fR = fN._2 | |
834 | + | $Tuple2(fQ, fR) | |
835 | + | } | |
836 | + | ||
837 | + | ||
838 | + | func fS (cp,aA) = { | |
839 | + | let fT = co(cp)._1 | |
840 | + | if ((fT == 0)) | |
841 | + | then true | |
842 | + | else (ct(cp) == aA) | |
843 | + | } | |
844 | + | ||
845 | + | ||
846 | + | func fU (cp,aA) = (ct(cp) == aA) | |
847 | + | ||
848 | + | ||
849 | + | func fV (fW,aA,cp) = ((((((ah + "_") + fW) + "_") + aA) + "_") + cp) | |
850 | + | ||
851 | + | ||
852 | + | func fX (cp) = { | |
853 | + | let cv = ct(cp) | |
854 | + | if ((cv == toBase58String(ao()))) | |
855 | + | then $Tuple2(0, cv) | |
843 | 856 | else { | |
844 | - | let eO = if ((gm == 0)) | |
845 | - | then eG | |
846 | - | else gm | |
847 | - | if ((eG > gm)) | |
848 | - | then { | |
849 | - | let gn = valueOrElse(getInteger(this, ((A + "_") + toString(gm))), 0) | |
850 | - | let go = valueOrElse(getInteger(this, ((B + "_") + toString(gm))), gl) | |
851 | - | let gp = (gn + ((eG - eO) * go)) | |
852 | - | let eJ = br(bp(valueOrElse(getString(this, y), "")), aE, toString(eG)) | |
853 | - | [IntegerEntry(ag(A, toString(eG)), gp), IntegerEntry(ag(B, toString(eG)), gl), IntegerEntry(ag(C, toString(eG)), gm), IntegerEntry(z, eG), StringEntry(y, ba(eJ))] | |
854 | - | } | |
855 | - | else { | |
856 | - | let gq = valueOrElse(getInteger(this, ag(C, toString(eG))), 0) | |
857 | - | let gn = valueOrElse(getInteger(this, ag(A, toString(gq))), 0) | |
858 | - | let go = valueOrElse(getInteger(this, ag(B, toString(gq))), gl) | |
859 | - | let gp = (gn + ((eG - gq) * go)) | |
860 | - | [IntegerEntry(ag(A, toString(eG)), gp), IntegerEntry(ag(B, toString(eG)), gl)] | |
861 | - | } | |
862 | - | } | |
863 | - | } | |
864 | - | ||
865 | - | ||
866 | - | func gr (cD,cF) = [IntegerEntry(I, cD), IntegerEntry(J, cF)] | |
867 | - | ||
868 | - | ||
869 | - | func gs (cE,cG) = [IntegerEntry(K, cE), IntegerEntry(L, cG)] | |
870 | - | ||
871 | - | ||
872 | - | func gt (cD,cF,gu,gv,gw,gx,gy,gz) = { | |
873 | - | let cE = bF() | |
874 | - | let cG = bG() | |
875 | - | if (((gw - gx) != gu)) | |
876 | - | then throw(((((("Invalid AMM state data: " + toString(gw)) + " + ") + toString(gx)) + " != ") + toString(gu))) | |
877 | - | else ((gr(cD, cF) ++ [IntegerEntry(M, gu), IntegerEntry(P, gv), IntegerEntry(N, gw), IntegerEntry(O, gx), IntegerEntry(R, gy), IntegerEntry(Q, gz)]) ++ gk(aP(aR(cD, cE), aR(cF, cG)))) | |
878 | - | } | |
879 | - | ||
880 | - | ||
881 | - | func gA (ai) = [DeleteEntry(ag(f, ai)), DeleteEntry(ag(g, ai)), DeleteEntry(ag(h, ai)), DeleteEntry(ag(i, ai)), DeleteEntry(ag(k, ai))] | |
882 | - | ||
883 | - | ||
884 | - | func gB (ai,gC) = { | |
885 | - | let gD = assetBalance(this, am()) | |
886 | - | if ((gC > gD)) | |
887 | - | then throw(((("Unable to withdraw " + toString(gC)) + " from contract balance ") + toString(gD))) | |
888 | - | else [ScriptTransfer(ai, gC, am())] | |
889 | - | } | |
890 | - | ||
891 | - | ||
892 | - | func gE (cc) = if ((0 > cc)) | |
893 | - | then throw("Balance") | |
894 | - | else [IntegerEntry(d, cc)] | |
895 | - | ||
896 | - | ||
897 | - | func gF (cc) = [ScriptTransfer(ao(), cc, am())] | |
898 | - | ||
899 | - | ||
900 | - | func gG (gH,cc) = if (gH) | |
901 | - | then [Burn(valueOrErrorMessage(cc.payments[1].assetId, "Invalid artifact"), 1)] | |
902 | - | else nil | |
903 | - | ||
904 | - | ||
905 | - | func gI (cl,ay) = { | |
906 | - | let gJ = ck(cl)._1 | |
907 | - | if ((gJ == 0)) | |
908 | - | then true | |
909 | - | else (cp(cl) == ay) | |
910 | - | } | |
911 | - | ||
912 | - | ||
913 | - | func gK (cl,ay) = (cp(cl) == ay) | |
914 | - | ||
915 | - | ||
916 | - | func gL (gM,ay,cl) = ((((((af + "_") + gM) + "_") + ay) + "_") + cl) | |
917 | - | ||
918 | - | ||
919 | - | func gN (cl) = { | |
920 | - | let cr = cp(cl) | |
921 | - | if ((cr == toBase58String(am()))) | |
922 | - | then $Tuple2(0, cr) | |
923 | - | else { | |
924 | - | let gO = gL(toString(this), cr, cl) | |
925 | - | let gP = valueOrElse(getInteger(au(), gO), 0) | |
926 | - | $Tuple2(gP, cr) | |
927 | - | } | |
928 | - | } | |
929 | - | ||
930 | - | ||
931 | - | func gQ (cl,fD) = { | |
932 | - | let gR = invoke(aq(), "computeFeeDiscount", [cl], nil) | |
933 | - | if ((gR == gR)) | |
857 | + | let fY = fV(toString(this), cv, cp) | |
858 | + | let fZ = valueOrElse(getInteger(aw(), fY), 0) | |
859 | + | $Tuple2(fZ, cv) | |
860 | + | } | |
861 | + | } | |
862 | + | ||
863 | + | ||
864 | + | func ga (cp,fJ) = { | |
865 | + | let gb = invoke(as(), "computeFeeDiscount", [cp], nil) | |
866 | + | if ((gb == gb)) | |
934 | 867 | then { | |
935 | - | let | |
936 | - | let | |
937 | - | if ($isInstanceOf( | |
868 | + | let gc = { | |
869 | + | let cr = gb | |
870 | + | if ($isInstanceOf(cr, "Int")) | |
938 | 871 | then { | |
939 | - | let | |
940 | - | | |
872 | + | let gd = cr | |
873 | + | gd | |
941 | 874 | } | |
942 | 875 | else throw("Invalid computeFeeDiscount result") | |
943 | 876 | } | |
944 | - | let | |
945 | - | let | |
946 | - | let | |
947 | - | $Tuple2( | |
877 | + | let ge = fI(fJ, gc) | |
878 | + | let fQ = ge._1 | |
879 | + | let fR = ge._2 | |
880 | + | $Tuple2(fQ, fR) | |
948 | 881 | } | |
949 | 882 | else throw("Strict value is not equal to itself.") | |
950 | 883 | } | |
951 | 884 | ||
952 | 885 | ||
953 | - | func | |
954 | - | let | |
955 | - | then toBase58String(valueOrErrorMessage( | |
886 | + | func gf (cg) = { | |
887 | + | let gg = if ((size(cg.payments) > 1)) | |
888 | + | then toBase58String(valueOrErrorMessage(cg.payments[1].assetId, "Invalid artifactId")) | |
956 | 889 | else "" | |
957 | - | gW | |
958 | - | } | |
959 | - | ||
960 | - | ||
961 | - | @Callable(cc) | |
962 | - | func pause () = if ((cc.caller != ak())) | |
890 | + | gg | |
891 | + | } | |
892 | + | ||
893 | + | ||
894 | + | func gh (gi) = { | |
895 | + | let gj = aT(gi, cd()) | |
896 | + | let gk = (gi - gj) | |
897 | + | $Tuple2(gj, gk) | |
898 | + | } | |
899 | + | ||
900 | + | ||
901 | + | func gl (gm,gn,go,gp,gq,gr,gs,gt,gu,dO,gv,gw) = [IntegerEntry(q, gm), IntegerEntry(r, gn), IntegerEntry(s, go), IntegerEntry(p, gp), IntegerEntry(o, gq), IntegerEntry(u, gr), IntegerEntry(v, gs), IntegerEntry(t, gt), IntegerEntry(w, gu), IntegerEntry(x, dO), IntegerEntry(y, gv), IntegerEntry(z, gv)] | |
902 | + | ||
903 | + | ||
904 | + | func gx (gy,gz,gA,gB,gC) = [IntegerEntry(H, gy), IntegerEntry(F, gz), IntegerEntry(G, gA), IntegerEntry(I, gB), IntegerEntry(J, gC)] | |
905 | + | ||
906 | + | ||
907 | + | func gD (ak,aA) = [StringEntry(ai(k, ak), aA)] | |
908 | + | ||
909 | + | ||
910 | + | func gE (gF,ak) = if (gF) | |
911 | + | then { | |
912 | + | let gG = cc() | |
913 | + | [IntegerEntry(ai(j, ak), (gG + 1)), IntegerEntry(e, (gG + 1))] | |
914 | + | } | |
915 | + | else nil | |
916 | + | ||
917 | + | ||
918 | + | func gH (ak,gI,gJ,gK,dj) = [IntegerEntry(ai(f, ak), gI), IntegerEntry(ai(g, ak), gJ), IntegerEntry(ai(h, ak), gK), IntegerEntry(ai(i, ak), dj)] | |
919 | + | ||
920 | + | ||
921 | + | func gL (gM) = { | |
922 | + | let eM = ((lastBlock.timestamp / 1000) / 60) | |
923 | + | let gN = valueOrElse(getInteger(this, B), 0) | |
924 | + | if ((gN > eM)) | |
925 | + | then throw("TWAP out-of-order") | |
926 | + | else { | |
927 | + | let eU = if ((gN == 0)) | |
928 | + | then eM | |
929 | + | else gN | |
930 | + | if ((eM > gN)) | |
931 | + | then { | |
932 | + | let gO = valueOrElse(getInteger(this, ((C + "_") + toString(gN))), 0) | |
933 | + | let gP = valueOrElse(getInteger(this, ((D + "_") + toString(gN))), gM) | |
934 | + | let gQ = (gO + ((eM - eU) * gP)) | |
935 | + | let eP = bt(br(valueOrElse(getString(this, A), "")), aG, toString(eM)) | |
936 | + | [IntegerEntry(ai(C, toString(eM)), gQ), IntegerEntry(ai(D, toString(eM)), gM), IntegerEntry(ai(E, toString(eM)), gN), IntegerEntry(B, eM), StringEntry(A, bc(eP))] | |
937 | + | } | |
938 | + | else { | |
939 | + | let gR = valueOrElse(getInteger(this, ai(E, toString(eM))), 0) | |
940 | + | let gO = valueOrElse(getInteger(this, ai(C, toString(gR))), 0) | |
941 | + | let gP = valueOrElse(getInteger(this, ai(D, toString(gR))), gM) | |
942 | + | let gQ = (gO + ((eM - gR) * gP)) | |
943 | + | [IntegerEntry(ai(C, toString(eM)), gQ), IntegerEntry(ai(D, toString(eM)), gM)] | |
944 | + | } | |
945 | + | } | |
946 | + | } | |
947 | + | ||
948 | + | ||
949 | + | func gS (cH,cJ) = [IntegerEntry(K, cH), IntegerEntry(L, cJ)] | |
950 | + | ||
951 | + | ||
952 | + | func gT (cI,cK) = [IntegerEntry(M, cI), IntegerEntry(N, cK)] | |
953 | + | ||
954 | + | ||
955 | + | func gU (cH,cJ,gV,gW,gX,gY,gZ,ha) = { | |
956 | + | let cI = bH() | |
957 | + | let cK = bI() | |
958 | + | if (((gX - gY) != gV)) | |
959 | + | then throw(((((("Invalid AMM state data: " + toString(gX)) + " + ") + toString(gY)) + " != ") + toString(gV))) | |
960 | + | else ((gS(cH, cJ) ++ [IntegerEntry(O, gV), IntegerEntry(R, gW), IntegerEntry(P, gX), IntegerEntry(Q, gY), IntegerEntry(T, gZ), IntegerEntry(S, ha)]) ++ gL(aR(aT(cH, cI), aT(cJ, cK)))) | |
961 | + | } | |
962 | + | ||
963 | + | ||
964 | + | func hb (ak) = [DeleteEntry(ai(f, ak)), DeleteEntry(ai(g, ak)), DeleteEntry(ai(h, ak)), DeleteEntry(ai(i, ak)), DeleteEntry(ai(k, ak))] | |
965 | + | ||
966 | + | ||
967 | + | func hc (ak,hd) = { | |
968 | + | let he = assetBalance(this, ao()) | |
969 | + | if ((hd > he)) | |
970 | + | then throw(((("Unable to withdraw " + toString(hd)) + " from contract balance ") + toString(he))) | |
971 | + | else [ScriptTransfer(ak, hd, ao())] | |
972 | + | } | |
973 | + | ||
974 | + | ||
975 | + | func hf (cg) = if ((0 > cg)) | |
976 | + | then throw("Balance") | |
977 | + | else [IntegerEntry(d, cg)] | |
978 | + | ||
979 | + | ||
980 | + | func hg (cg) = [ScriptTransfer(aq(), cg, ao())] | |
981 | + | ||
982 | + | ||
983 | + | func hh (hi,cg) = if (hi) | |
984 | + | then [Burn(valueOrErrorMessage(cg.payments[1].assetId, "Invalid artifact"), 1)] | |
985 | + | else nil | |
986 | + | ||
987 | + | ||
988 | + | @Callable(cg) | |
989 | + | func pause () = if ((cg.caller != am())) | |
963 | 990 | then throw("Invalid pause params") | |
964 | 991 | else [BooleanEntry(m, true)] | |
965 | 992 | ||
966 | 993 | ||
967 | 994 | ||
968 | - | @Callable( | |
969 | - | func unpause () = if (( | |
995 | + | @Callable(cg) | |
996 | + | func unpause () = if ((cg.caller != am())) | |
970 | 997 | then throw("Invalid unpause params") | |
971 | 998 | else [BooleanEntry(m, false)] | |
972 | 999 | ||
973 | 1000 | ||
974 | 1001 | ||
975 | - | @Callable( | |
976 | - | func setCloseOnly () = if (( | |
1002 | + | @Callable(cg) | |
1003 | + | func setCloseOnly () = if ((cg.caller != am())) | |
977 | 1004 | then throw("Invalid setCloseOnly params") | |
978 | 1005 | else [BooleanEntry(n, true)] | |
979 | 1006 | ||
980 | 1007 | ||
981 | 1008 | ||
982 | - | @Callable( | |
983 | - | func unsetCloseOnly () = if (( | |
1009 | + | @Callable(cg) | |
1010 | + | func unsetCloseOnly () = if ((cg.caller != am())) | |
984 | 1011 | then throw("Invalid unsetCloseOnly params") | |
985 | 1012 | else [BooleanEntry(n, false)] | |
986 | 1013 | ||
987 | 1014 | ||
988 | 1015 | ||
989 | - | @Callable( | |
990 | - | func addLiquidity ( | |
1016 | + | @Callable(cg) | |
1017 | + | func addLiquidity (cC) = if (if ((cg.caller != am())) | |
991 | 1018 | then true | |
992 | - | else (0 >= | |
1019 | + | else (0 >= cC)) | |
993 | 1020 | then throw("Invalid addLiquidity params") | |
994 | 1021 | else { | |
995 | - | let | |
996 | - | let | |
997 | - | let | |
998 | - | let | |
999 | - | let | |
1000 | - | let | |
1001 | - | let | |
1002 | - | let | |
1003 | - | | |
1022 | + | let cH = bF() | |
1023 | + | let cJ = bG() | |
1024 | + | let cI = bH() | |
1025 | + | let cK = bI() | |
1026 | + | let hj = aR(aT(cH, cI), aT(cJ, cK)) | |
1027 | + | let hk = aR(cC, hj) | |
1028 | + | let hl = (cH + cC) | |
1029 | + | let hm = (cJ + hk) | |
1030 | + | gS(hl, hm) | |
1004 | 1031 | } | |
1005 | 1032 | ||
1006 | 1033 | ||
1007 | 1034 | ||
1008 | - | @Callable( | |
1009 | - | func removeLiquidity ( | |
1035 | + | @Callable(cg) | |
1036 | + | func removeLiquidity (cC) = if (if ((cg.caller != am())) | |
1010 | 1037 | then true | |
1011 | - | else (0 >= | |
1038 | + | else (0 >= cC)) | |
1012 | 1039 | then throw("Invalid removeLiquidity params") | |
1013 | 1040 | else { | |
1014 | - | let | |
1015 | - | let | |
1016 | - | let | |
1017 | - | let | |
1018 | - | let | |
1019 | - | let | |
1020 | - | let | |
1021 | - | let | |
1022 | - | | |
1041 | + | let cH = bF() | |
1042 | + | let cJ = bG() | |
1043 | + | let cI = bH() | |
1044 | + | let cK = bI() | |
1045 | + | let hj = aR(aT(cH, cI), aT(cJ, cK)) | |
1046 | + | let hn = aR(cC, hj) | |
1047 | + | let hl = (cH - cC) | |
1048 | + | let hm = (cJ - hn) | |
1049 | + | gS(hl, hm) | |
1023 | 1050 | } | |
1024 | 1051 | ||
1025 | 1052 | ||
1026 | 1053 | ||
1027 | - | @Callable( | |
1028 | - | func changeSettings ( | |
1054 | + | @Callable(cg) | |
1055 | + | func changeSettings (gm,gn,go,gp,gq,gr,gs,gt,gu,dO,gv,gw) = if ((cg.caller != am())) | |
1029 | 1056 | then throw("Invalid changeSettings params") | |
1030 | - | else | |
1031 | - | ||
1032 | - | ||
1033 | - | ||
1034 | - | @Callable( | |
1035 | - | func initialize ( | |
1057 | + | else gl(gm, gn, go, gp, gq, gr, gs, gt, gu, dO, gv, gw) | |
1058 | + | ||
1059 | + | ||
1060 | + | ||
1061 | + | @Callable(cg) | |
1062 | + | func initialize (cH,cJ,gp,gm,gn,go,gq,ho,hp,hq,hr,gr,gs,gt,gu,dO,gv,gw) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= cH)) | |
1036 | 1063 | then true | |
1037 | - | else (0 >= | |
1064 | + | else (0 >= cJ)) | |
1038 | 1065 | then true | |
1039 | - | else (0 >= | |
1066 | + | else (0 >= gp)) | |
1040 | 1067 | then true | |
1041 | - | else (0 >= | |
1068 | + | else (0 >= gm)) | |
1042 | 1069 | then true | |
1043 | - | else (0 >= | |
1070 | + | else (0 >= gn)) | |
1044 | 1071 | then true | |
1045 | - | else (0 >= | |
1072 | + | else (0 >= go)) | |
1046 | 1073 | then true | |
1047 | - | else (0 >= | |
1074 | + | else (0 >= gq)) | |
1048 | 1075 | then true | |
1049 | - | else (0 >= | |
1076 | + | else (0 >= gr)) | |
1050 | 1077 | then true | |
1051 | - | else (0 >= | |
1078 | + | else (0 >= gs)) | |
1052 | 1079 | then true | |
1053 | - | else (0 >= | |
1080 | + | else (0 >= gt)) | |
1054 | 1081 | then true | |
1055 | - | else (0 >= | |
1082 | + | else (0 >= gu)) | |
1056 | 1083 | then true | |
1057 | - | else (0 >= | |
1084 | + | else (0 >= dO)) | |
1058 | 1085 | then true | |
1059 | - | else ct()) | |
1086 | + | else (0 >= gv)) | |
1087 | + | then true | |
1088 | + | else (gv > aK)) | |
1089 | + | then true | |
1090 | + | else (0 >= gw)) | |
1091 | + | then true | |
1092 | + | else cx()) | |
1060 | 1093 | then throw("Invalid initialize parameters") | |
1061 | - | else (((( | |
1062 | - | ||
1063 | - | ||
1064 | - | ||
1065 | - | @Callable( | |
1066 | - | func decreasePosition ( | |
1067 | - | let | |
1068 | - | if (( | |
1094 | + | else ((((gU(cH, cJ, 0, 0, 0, 0, 0, 0) ++ gl(gm, gn, go, gp, gq, gr, gs, gt, gu, dO, gv, gw)) ++ gx((lastBlock.timestamp + gp), 0, 0, 0, 0)) ++ hf(0)) ++ [BooleanEntry(l, true), StringEntry(c, ho), StringEntry(a, hp), StringEntry(b, hq), StringEntry(U, hr)]) | |
1095 | + | ||
1096 | + | ||
1097 | + | ||
1098 | + | @Callable(cg) | |
1099 | + | func decreasePosition (hd,hs,ht) = { | |
1100 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1101 | + | if ((hu == hu)) | |
1069 | 1102 | then { | |
1070 | - | let | |
1071 | - | if (if (if (if (if ((0 >= | |
1072 | - | then true | |
1073 | - | else !( | |
1074 | - | then true | |
1075 | - | else !( | |
1076 | - | then true | |
1077 | - | else !( | |
1078 | - | then true | |
1079 | - | else | |
1103 | + | let cp = cf(cg) | |
1104 | + | if (if (if (if (if ((0 >= hd)) | |
1105 | + | then true | |
1106 | + | else !(cx())) | |
1107 | + | then true | |
1108 | + | else !(ch(aR(aK, hs), bE(), true))) | |
1109 | + | then true | |
1110 | + | else !(cw(cp))) | |
1111 | + | then true | |
1112 | + | else cy()) | |
1080 | 1113 | then throw("Invalid decreasePosition parameters") | |
1081 | 1114 | else { | |
1082 | - | let | |
1083 | - | let | |
1084 | - | let | |
1085 | - | let | |
1086 | - | let | |
1087 | - | let | |
1088 | - | then | |
1089 | - | else | |
1090 | - | let | |
1091 | - | let | |
1092 | - | let | |
1093 | - | let | |
1094 | - | let | |
1095 | - | let | |
1115 | + | let hv = co(cp) | |
1116 | + | let fT = hv._1 | |
1117 | + | let hw = hv._2 | |
1118 | + | let hx = hv._3 | |
1119 | + | let hy = hv._4 | |
1120 | + | let hz = if ((fT > 0)) | |
1121 | + | then aF | |
1122 | + | else aE | |
1123 | + | let hA = (hz == aE) | |
1124 | + | let hB = aT(hd, hs) | |
1125 | + | let hC = ef(cp, aN) | |
1126 | + | let hD = hC._1 | |
1127 | + | let ee = hC._2 | |
1128 | + | let hE = if ((hD > hB)) | |
1096 | 1129 | then { | |
1097 | - | let | |
1098 | - | let | |
1099 | - | let | |
1100 | - | let | |
1101 | - | let | |
1102 | - | let | |
1103 | - | if (if (( | |
1104 | - | then ( | |
1130 | + | let hF = cP(hA, hB) | |
1131 | + | let ez = hF._1 | |
1132 | + | let cQ = hF._2 | |
1133 | + | let cR = hF._3 | |
1134 | + | let eH = hF._4 | |
1135 | + | let hG = ba(ez) | |
1136 | + | if (if ((ht != 0)) | |
1137 | + | then (ht > hG) | |
1105 | 1138 | else false) | |
1106 | - | then throw(((("Too little base asset exchanged, got " + toString( | |
1139 | + | then throw(((("Too little base asset exchanged, got " + toString(hG)) + " expected ") + toString(ht))) | |
1107 | 1140 | else { | |
1108 | - | let | |
1109 | - | let | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | then (( | |
1117 | - | else (( | |
1118 | - | let | |
1119 | - | $Tuple12( | |
1120 | - | then | |
1121 | - | else 0)), ( | |
1122 | - | then | |
1123 | - | else 0)), ( | |
1124 | - | then | |
1125 | - | else 0)), ( | |
1126 | - | then | |
1141 | + | let eE = aR(aT(ee, hG), ba(fT)) | |
1142 | + | let hH = dd(fT, hw, hy, eE) | |
1143 | + | let dm = hH._1 | |
1144 | + | let dn = hH._2 | |
1145 | + | let di = hH._3 | |
1146 | + | let eA = hB | |
1147 | + | let hI = (ee - eE) | |
1148 | + | let hJ = if ((fT > 0)) | |
1149 | + | then ((hD - eA) - hI) | |
1150 | + | else ((hI + hD) - eA) | |
1151 | + | let hK = (fT + ez) | |
1152 | + | $Tuple12(hK, dm, ba(hJ), cm(hK), cR, cQ, eH, (bK() - hB), (cb() - (if ((hK > 0)) | |
1153 | + | then ba(ez) | |
1154 | + | else 0)), (ca() - (if ((0 > hK)) | |
1155 | + | then ba(ez) | |
1156 | + | else 0)), (bM() - (if ((hK > 0)) | |
1157 | + | then hB | |
1158 | + | else 0)), (bL() - (if ((0 > hK)) | |
1159 | + | then hB | |
1127 | 1160 | else 0))) | |
1128 | 1161 | } | |
1129 | 1162 | } | |
1130 | 1163 | else throw("Close position first") | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | let | |
1136 | - | let | |
1137 | - | let | |
1138 | - | let | |
1139 | - | let | |
1140 | - | let | |
1141 | - | let | |
1142 | - | let | |
1143 | - | let | |
1144 | - | if (( | |
1145 | - | then ( | |
1164 | + | let hK = hE._1 | |
1165 | + | let hL = hE._2 | |
1166 | + | let hM = hE._3 | |
1167 | + | let hN = hE._4 | |
1168 | + | let cR = hE._5 | |
1169 | + | let cQ = hE._6 | |
1170 | + | let eH = hE._7 | |
1171 | + | let eK = hE._8 | |
1172 | + | let eI = hE._9 | |
1173 | + | let eJ = hE._10 | |
1174 | + | let hO = hE._11 | |
1175 | + | let hP = hE._12 | |
1176 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1177 | + | if ((hQ == hQ)) | |
1178 | + | then (gH(cp, hK, hL, hM, hN) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) | |
1146 | 1179 | else throw("Strict value is not equal to itself.") | |
1147 | 1180 | } | |
1148 | 1181 | } | |
1151 | 1184 | ||
1152 | 1185 | ||
1153 | 1186 | ||
1154 | - | @Callable( | |
1155 | - | func increasePosition ( | |
1156 | - | let | |
1157 | - | if (( | |
1187 | + | @Callable(cg) | |
1188 | + | func increasePosition (hz,hs,ht,hR) = { | |
1189 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1190 | + | if ((hu == hu)) | |
1158 | 1191 | then { | |
1159 | - | let | |
1160 | - | let | |
1161 | - | let | |
1162 | - | let | |
1163 | - | let | |
1164 | - | let | |
1165 | - | if (if (if (if (if (if (if (if (if (( | |
1166 | - | then ( | |
1192 | + | let cp = cf(cg) | |
1193 | + | let hS = cg.payments[0].amount | |
1194 | + | let aA = cg.payments[0].assetId | |
1195 | + | let hT = toBase58String(value(aA)) | |
1196 | + | let hU = (aA == ao()) | |
1197 | + | let hV = az(hT) | |
1198 | + | if (if (if (if (if (if (if (if (if ((hz != aE)) | |
1199 | + | then (hz != aF) | |
1167 | 1200 | else false) | |
1168 | 1201 | then true | |
1169 | - | else (0 >= | |
1170 | - | then true | |
1171 | - | else !( | |
1172 | - | then true | |
1173 | - | else if (!( | |
1174 | - | then !( | |
1202 | + | else (0 >= hS)) | |
1203 | + | then true | |
1204 | + | else !(cx())) | |
1205 | + | then true | |
1206 | + | else if (!(hU)) | |
1207 | + | then !(hV) | |
1175 | 1208 | else false) | |
1176 | 1209 | then true | |
1177 | - | else !( | |
1178 | - | then true | |
1179 | - | else !( | |
1180 | - | then true | |
1181 | - | else | |
1182 | - | then true | |
1183 | - | else | |
1210 | + | else !(fS(cp, hT))) | |
1211 | + | then true | |
1212 | + | else !(ch(aR(aK, hs), bE(), true))) | |
1213 | + | then true | |
1214 | + | else cy()) | |
1215 | + | then true | |
1216 | + | else cz()) | |
1184 | 1217 | then throw("Invalid increasePosition parameters") | |
1185 | 1218 | else { | |
1186 | - | let | |
1187 | - | let | |
1188 | - | let | |
1189 | - | let | |
1190 | - | let | |
1191 | - | let | |
1219 | + | let hW = ga(cp, gf(cg)) | |
1220 | + | let fQ = hW._1 | |
1221 | + | let fR = hW._2 | |
1222 | + | let hX = aT(hS, fQ) | |
1223 | + | let hd = (hS - hX) | |
1224 | + | let hY = if (hV) | |
1192 | 1225 | then { | |
1193 | - | let | |
1194 | - | if (( | |
1226 | + | let hZ = invoke(aw(), "borrow", [cp], [AttachedPayment(aA, hd)]) | |
1227 | + | if ((hZ == hZ)) | |
1195 | 1228 | then { | |
1196 | - | let | |
1197 | - | if (( | |
1229 | + | let ia = assetBalance(this, ao()) | |
1230 | + | if ((ia == ia)) | |
1198 | 1231 | then { | |
1199 | - | let | |
1200 | - | if (( | |
1232 | + | let ib = invoke(ax(), "swap", [toBase58String(ao()), 0], [AttachedPayment(aA, hX)]) | |
1233 | + | if ((ib == ib)) | |
1201 | 1234 | then { | |
1202 | - | let | |
1203 | - | if (( | |
1235 | + | let ic = assetBalance(this, ao()) | |
1236 | + | if ((ic == ic)) | |
1204 | 1237 | then { | |
1205 | - | let | |
1206 | - | if (( | |
1207 | - | then | |
1238 | + | let id = (ic - ia) | |
1239 | + | if ((id == id)) | |
1240 | + | then id | |
1208 | 1241 | else throw("Strict value is not equal to itself.") | |
1209 | 1242 | } | |
1210 | 1243 | else throw("Strict value is not equal to itself.") | |
1215 | 1248 | } | |
1216 | 1249 | else throw("Strict value is not equal to itself.") | |
1217 | 1250 | } | |
1218 | - | else | |
1219 | - | if (( | |
1251 | + | else hX | |
1252 | + | if ((hY == hY)) | |
1220 | 1253 | then { | |
1221 | - | let | |
1222 | - | if (( | |
1254 | + | let ie = invoke(au(), "acceptPaymentWithLink", [cp, hR], [AttachedPayment(ao(), hY)]) | |
1255 | + | if ((ie == ie)) | |
1223 | 1256 | then { | |
1224 | - | let | |
1225 | - | let | |
1226 | - | if ($isInstanceOf( | |
1257 | + | let if = { | |
1258 | + | let cr = ie | |
1259 | + | if ($isInstanceOf(cr, "Int")) | |
1227 | 1260 | then { | |
1228 | - | let | |
1229 | - | | |
1261 | + | let gd = cr | |
1262 | + | gd | |
1230 | 1263 | } | |
1231 | 1264 | else throw("Invalid referrerFee") | |
1232 | 1265 | } | |
1233 | - | let | |
1234 | - | let | |
1235 | - | let | |
1236 | - | let | |
1237 | - | let | |
1238 | - | let | |
1239 | - | let | |
1240 | - | let | |
1241 | - | then ( | |
1242 | - | else ( | |
1243 | - | let | |
1244 | - | then | |
1266 | + | let ig = (hY - if) | |
1267 | + | let ih = co(cp) | |
1268 | + | let fT = ih._1 | |
1269 | + | let hw = ih._2 | |
1270 | + | let hx = ih._3 | |
1271 | + | let hy = ih._4 | |
1272 | + | let gF = (fT == 0) | |
1273 | + | let ii = if ((fT > 0)) | |
1274 | + | then (hz == aE) | |
1275 | + | else (hz == aF) | |
1276 | + | let ij = if (!(gF)) | |
1277 | + | then ii | |
1245 | 1278 | else false | |
1246 | - | let | |
1247 | - | let | |
1279 | + | let hA = (hz == aE) | |
1280 | + | let ik = if (if (gF) | |
1248 | 1281 | then true | |
1249 | - | else | |
1282 | + | else ij) | |
1250 | 1283 | then { | |
1251 | - | let | |
1252 | - | let | |
1253 | - | let | |
1254 | - | let | |
1255 | - | let | |
1256 | - | let | |
1257 | - | if (if (( | |
1258 | - | then ( | |
1284 | + | let hB = aT(hd, hs) | |
1285 | + | let il = cP(hA, hB) | |
1286 | + | let cT = il._1 | |
1287 | + | let cQ = il._2 | |
1288 | + | let cR = il._3 | |
1289 | + | let eH = il._4 | |
1290 | + | if (if ((ht != 0)) | |
1291 | + | then (ht > ba(cT)) | |
1259 | 1292 | else false) | |
1260 | - | then throw(((("Limit error: " + toString( | |
1293 | + | then throw(((("Limit error: " + toString(ba(cT))) + " < ") + toString(ht))) | |
1261 | 1294 | else { | |
1262 | - | let | |
1263 | - | let | |
1264 | - | then | |
1295 | + | let hK = (fT + cT) | |
1296 | + | let hO = (bM() + (if ((hK > 0)) | |
1297 | + | then hB | |
1265 | 1298 | else 0)) | |
1266 | - | let | |
1267 | - | then | |
1299 | + | let hP = (bL() + (if ((0 > hK)) | |
1300 | + | then hB | |
1268 | 1301 | else 0)) | |
1269 | - | let | |
1270 | - | let | |
1271 | - | let | |
1272 | - | let | |
1273 | - | let | |
1274 | - | if (!( | |
1302 | + | let im = aR(hB, hs) | |
1303 | + | let in = dd(fT, hw, hy, im) | |
1304 | + | let dm = in._1 | |
1305 | + | let dZ = in._2 | |
1306 | + | let ea = in._3 | |
1307 | + | if (!(dG(cQ, cR))) | |
1275 | 1308 | then throw("Over max spread limit") | |
1276 | - | else if (!( | |
1309 | + | else if (!(dL(hO, hP))) | |
1277 | 1310 | then throw("Over max open notional") | |
1278 | - | else $Tuple12( | |
1279 | - | then | |
1280 | - | else 0)), ( | |
1281 | - | then | |
1282 | - | else 0)), | |
1311 | + | else $Tuple12(hK, dm, (hx + hB), cm(hK), cR, cQ, eH, (bK() + hB), (cb() + (if ((hK > 0)) | |
1312 | + | then ba(cT) | |
1313 | + | else 0)), (ca() + (if ((0 > hK)) | |
1314 | + | then ba(cT) | |
1315 | + | else 0)), hO, hP) | |
1283 | 1316 | } | |
1284 | 1317 | } | |
1285 | 1318 | else { | |
1286 | - | let | |
1287 | - | let | |
1288 | - | let | |
1289 | - | let | |
1290 | - | if (( | |
1319 | + | let hB = aT(hd, hs) | |
1320 | + | let io = ef(toString(cg.caller), aN) | |
1321 | + | let hD = io._1 | |
1322 | + | let ee = io._2 | |
1323 | + | if ((hD > hB)) | |
1291 | 1324 | then throw("Use decreasePosition to decrease position size") | |
1292 | 1325 | else throw("Close position first") | |
1293 | 1326 | } | |
1294 | - | let | |
1295 | - | let | |
1296 | - | let | |
1297 | - | let | |
1298 | - | let | |
1299 | - | let | |
1300 | - | let | |
1301 | - | let | |
1302 | - | let | |
1303 | - | let | |
1304 | - | let | |
1305 | - | let | |
1306 | - | let | |
1307 | - | let | |
1308 | - | let | |
1309 | - | if ( | |
1327 | + | let hK = ik._1 | |
1328 | + | let hL = ik._2 | |
1329 | + | let hM = ik._3 | |
1330 | + | let hN = ik._4 | |
1331 | + | let cR = ik._5 | |
1332 | + | let cQ = ik._6 | |
1333 | + | let eH = ik._7 | |
1334 | + | let eK = ik._8 | |
1335 | + | let eI = ik._9 | |
1336 | + | let eJ = ik._10 | |
1337 | + | let hO = ik._11 | |
1338 | + | let hP = ik._12 | |
1339 | + | let ip = gh(ig) | |
1340 | + | let gj = ip._1 | |
1341 | + | let gk = ip._2 | |
1342 | + | let iq = if (hU) | |
1310 | 1343 | then { | |
1311 | - | let ie = invoke(ap(), "addFree", nil, [AttachedPayment(am(), ic)]) | |
1312 | - | if ((ie == ie)) | |
1344 | + | let iq = invoke(ar(), "addLocked", [false], [AttachedPayment(ao(), hd)]) | |
1345 | + | if ((iq == iq)) | |
1346 | + | then nil | |
1347 | + | else throw("Strict value is not equal to itself.") | |
1348 | + | } | |
1349 | + | else nil | |
1350 | + | if ((iq == iq)) | |
1351 | + | then { | |
1352 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1353 | + | if ((ir == ir)) | |
1313 | 1354 | then { | |
1314 | - | let | |
1315 | - | if (( | |
1355 | + | let is = invoke(as(), "notifyFees", [cp, ig], nil) | |
1356 | + | if ((is == is)) | |
1316 | 1357 | then { | |
1317 | - | let | |
1318 | - | if (( | |
1319 | - | then (((((( | |
1358 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1359 | + | if ((hQ == hQ)) | |
1360 | + | then ((((((gH(cp, hK, hL, hM, hN) ++ gE(gF, cp)) ++ gD(cp, hT)) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ hg(gj)) ++ hf((bC() + hd))) ++ hh(fR, cg)) | |
1320 | 1361 | else throw("Strict value is not equal to itself.") | |
1321 | 1362 | } | |
1322 | 1363 | else throw("Strict value is not equal to itself.") | |
1335 | 1376 | ||
1336 | 1377 | ||
1337 | 1378 | ||
1338 | - | @Callable( | |
1379 | + | @Callable(cg) | |
1339 | 1380 | func addMargin () = { | |
1340 | - | let | |
1341 | - | if (( | |
1381 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1382 | + | if ((hu == hu)) | |
1342 | 1383 | then { | |
1343 | - | let | |
1344 | - | let | |
1345 | - | let | |
1346 | - | let | |
1347 | - | let | |
1348 | - | let | |
1349 | - | if (if (if (if (if (if (if (!( | |
1350 | - | then !( | |
1384 | + | let cp = toString(cg.caller) | |
1385 | + | let hS = cg.payments[0].amount | |
1386 | + | let aA = cg.payments[0].assetId | |
1387 | + | let hT = toBase58String(value(aA)) | |
1388 | + | let hU = (aA == ao()) | |
1389 | + | let hV = az(hT) | |
1390 | + | if (if (if (if (if (if (if (!(hU)) | |
1391 | + | then !(hV) | |
1351 | 1392 | else false) | |
1352 | 1393 | then true | |
1353 | - | else !( | |
1354 | - | then true | |
1355 | - | else !( | |
1356 | - | then true | |
1357 | - | else !( | |
1358 | - | then true | |
1359 | - | else | |
1360 | - | then true | |
1361 | - | else | |
1394 | + | else !(cw(toString(cg.caller)))) | |
1395 | + | then true | |
1396 | + | else !(fU(cp, hT))) | |
1397 | + | then true | |
1398 | + | else !(cx())) | |
1399 | + | then true | |
1400 | + | else cy()) | |
1401 | + | then true | |
1402 | + | else cz()) | |
1362 | 1403 | then throw("Invalid addMargin parameters") | |
1363 | 1404 | else { | |
1364 | - | let | |
1365 | - | let | |
1366 | - | let | |
1367 | - | let | |
1368 | - | let | |
1369 | - | let | |
1405 | + | let it = ga(cp, gf(cg)) | |
1406 | + | let fQ = it._1 | |
1407 | + | let fR = it._2 | |
1408 | + | let hX = aT(hS, fQ) | |
1409 | + | let hd = (hS - hX) | |
1410 | + | let hY = if (hV) | |
1370 | 1411 | then { | |
1371 | - | let | |
1372 | - | if (( | |
1412 | + | let hZ = invoke(aw(), "borrow", [cp], [AttachedPayment(aA, hd)]) | |
1413 | + | if ((hZ == hZ)) | |
1373 | 1414 | then { | |
1374 | - | let | |
1375 | - | if (( | |
1415 | + | let ia = assetBalance(this, ao()) | |
1416 | + | if ((ia == ia)) | |
1376 | 1417 | then { | |
1377 | - | let | |
1378 | - | if (( | |
1418 | + | let ib = invoke(ax(), "swap", [toBase58String(ao()), 0], [AttachedPayment(aA, hX)]) | |
1419 | + | if ((ib == ib)) | |
1379 | 1420 | then { | |
1380 | - | let | |
1381 | - | if (( | |
1421 | + | let ic = assetBalance(this, ao()) | |
1422 | + | if ((ic == ic)) | |
1382 | 1423 | then { | |
1383 | - | let | |
1384 | - | if (( | |
1385 | - | then | |
1424 | + | let id = (ic - ia) | |
1425 | + | if ((id == id)) | |
1426 | + | then id | |
1386 | 1427 | else throw("Strict value is not equal to itself.") | |
1387 | 1428 | } | |
1388 | 1429 | else throw("Strict value is not equal to itself.") | |
1393 | 1434 | } | |
1394 | 1435 | else throw("Strict value is not equal to itself.") | |
1395 | 1436 | } | |
1396 | - | else | |
1397 | - | if (( | |
1437 | + | else hX | |
1438 | + | if ((hY == hY)) | |
1398 | 1439 | then { | |
1399 | - | let | |
1400 | - | if (( | |
1440 | + | let ie = invoke(au(), "acceptPayment", [cp], [AttachedPayment(ao(), hY)]) | |
1441 | + | if ((ie == ie)) | |
1401 | 1442 | then { | |
1402 | - | let | |
1403 | - | let | |
1404 | - | if ($isInstanceOf( | |
1443 | + | let if = { | |
1444 | + | let cr = ie | |
1445 | + | if ($isInstanceOf(cr, "Int")) | |
1405 | 1446 | then { | |
1406 | - | let | |
1407 | - | | |
1447 | + | let gd = cr | |
1448 | + | gd | |
1408 | 1449 | } | |
1409 | 1450 | else throw("Invalid referrerFee") | |
1410 | 1451 | } | |
1411 | - | let | |
1412 | - | let | |
1413 | - | let | |
1414 | - | let | |
1415 | - | let | |
1416 | - | let | |
1417 | - | let | |
1418 | - | let | |
1419 | - | let | |
1420 | - | if ( | |
1452 | + | let ig = (hY - if) | |
1453 | + | let iu = co(cp) | |
1454 | + | let fT = iu._1 | |
1455 | + | let hw = iu._2 | |
1456 | + | let hx = iu._3 | |
1457 | + | let hy = iu._4 | |
1458 | + | let iv = gh(ig) | |
1459 | + | let gj = iv._1 | |
1460 | + | let gk = iv._2 | |
1461 | + | let iq = if (hU) | |
1421 | 1462 | then { | |
1422 | - | let ie = invoke(ap(), "addFree", nil, [AttachedPayment(am(), ic)]) | |
1423 | - | if ((ie == ie)) | |
1463 | + | let iq = invoke(ar(), "addLocked", [false], [AttachedPayment(ao(), hd)]) | |
1464 | + | if ((iq == iq)) | |
1465 | + | then nil | |
1466 | + | else throw("Strict value is not equal to itself.") | |
1467 | + | } | |
1468 | + | else nil | |
1469 | + | if ((iq == iq)) | |
1470 | + | then { | |
1471 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1472 | + | if ((ir == ir)) | |
1424 | 1473 | then { | |
1425 | - | let | |
1426 | - | if (( | |
1427 | - | then ((( | |
1474 | + | let is = invoke(as(), "notifyFees", [cp, ig], nil) | |
1475 | + | if ((is == is)) | |
1476 | + | then (((gH(cp, fT, (hw + hd), hx, hy) ++ hg(gj)) ++ hf((bC() + hd))) ++ hh(fR, cg)) | |
1428 | 1477 | else throw("Strict value is not equal to itself.") | |
1429 | 1478 | } | |
1430 | 1479 | else throw("Strict value is not equal to itself.") | |
1441 | 1490 | ||
1442 | 1491 | ||
1443 | 1492 | ||
1444 | - | @Callable( | |
1445 | - | func removeMargin ( | |
1446 | - | let | |
1447 | - | if (( | |
1493 | + | @Callable(cg) | |
1494 | + | func removeMargin (hd) = { | |
1495 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1496 | + | if ((hu == hu)) | |
1448 | 1497 | then { | |
1449 | - | let | |
1450 | - | if (if (if (if ((0 >= | |
1451 | - | then true | |
1452 | - | else !( | |
1453 | - | then true | |
1454 | - | else !( | |
1455 | - | then true | |
1456 | - | else | |
1498 | + | let cp = toString(cg.caller) | |
1499 | + | if (if (if (if ((0 >= hd)) | |
1500 | + | then true | |
1501 | + | else !(cw(cp))) | |
1502 | + | then true | |
1503 | + | else !(cx())) | |
1504 | + | then true | |
1505 | + | else cy()) | |
1457 | 1506 | then throw("Invalid removeMargin parameters") | |
1458 | 1507 | else { | |
1459 | - | let | |
1460 | - | let | |
1461 | - | let | |
1462 | - | let | |
1463 | - | let | |
1464 | - | let | |
1465 | - | let | |
1466 | - | let | |
1467 | - | let | |
1468 | - | if (( | |
1508 | + | let iw = co(cp) | |
1509 | + | let fT = iw._1 | |
1510 | + | let hw = iw._2 | |
1511 | + | let hx = iw._3 | |
1512 | + | let hy = iw._4 | |
1513 | + | let ix = -(hd) | |
1514 | + | let iy = dd(fT, hw, hy, ix) | |
1515 | + | let dm = iy._1 | |
1516 | + | let dn = iy._2 | |
1517 | + | if ((dn != 0)) | |
1469 | 1518 | then throw("Invalid removed margin amount") | |
1470 | 1519 | else { | |
1471 | - | let | |
1472 | - | if (!( | |
1473 | - | then throw(((("Too much margin removed: " + toString( | |
1520 | + | let iz = ek(dm, dn, hx) | |
1521 | + | if (!(ch(iz, bE(), true))) | |
1522 | + | then throw(((("Too much margin removed: " + toString(iz)) + " < ") + toString(bE()))) | |
1474 | 1523 | else { | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1479 | - | let | |
1480 | - | then | |
1481 | - | else | |
1482 | - | let | |
1524 | + | let iA = toBase58String(ao()) | |
1525 | + | let iB = fX(cp) | |
1526 | + | let iC = iB._1 | |
1527 | + | let iD = iB._2 | |
1528 | + | let iE = if ((hd > iC)) | |
1529 | + | then iC | |
1530 | + | else hd | |
1531 | + | let iF = if ((iC > hd)) | |
1483 | 1532 | then 0 | |
1484 | - | else ( | |
1485 | - | let | |
1486 | - | let | |
1533 | + | else (hd - iC) | |
1534 | + | let iG = (iC - iE) | |
1535 | + | let iH = if ((iG > 0)) | |
1487 | 1536 | then nil | |
1488 | - | else | |
1489 | - | let | |
1490 | - | then throw(((((("toRepay=" + toString( | |
1537 | + | else gD(cp, iA) | |
1538 | + | let iI = if (((iE + iF) != hd)) | |
1539 | + | then throw(((((("toRepay=" + toString(iE)) + " + toWithdraw=") + toString(iF)) + " != ") + toString(hd))) | |
1491 | 1540 | else nil | |
1492 | - | if (( | |
1541 | + | if ((iI == iI)) | |
1493 | 1542 | then { | |
1494 | - | let iv = invoke(ap(), "withdrawLocked", [gC], nil) | |
1495 | - | if ((iv == iv)) | |
1543 | + | let iJ = if ((iF > 0)) | |
1496 | 1544 | then { | |
1497 | - | let iw = if ((iq > 0)) | |
1545 | + | let iJ = invoke(ar(), "withdrawLocked", [iF], nil) | |
1546 | + | if ((iJ == iJ)) | |
1547 | + | then nil | |
1548 | + | else throw("Strict value is not equal to itself.") | |
1549 | + | } | |
1550 | + | else nil | |
1551 | + | if ((iJ == iJ)) | |
1552 | + | then { | |
1553 | + | let iK = if ((iE > 0)) | |
1498 | 1554 | then { | |
1499 | - | let | |
1500 | - | if (( | |
1501 | - | then [ScriptTransfer( | |
1555 | + | let iL = invoke(aw(), "repay", [cp, iE, iD], nil) | |
1556 | + | if ((iL == iL)) | |
1557 | + | then [ScriptTransfer(cg.caller, iE, fromBase58String(iD))] | |
1502 | 1558 | else throw("Strict value is not equal to itself.") | |
1503 | 1559 | } | |
1504 | 1560 | else nil | |
1505 | - | if (( | |
1506 | - | then (((( | |
1507 | - | then | |
1508 | - | else nil)) ++ | |
1561 | + | if ((iK == iK)) | |
1562 | + | then ((((gH(cp, fT, dm, hx, cm(fT)) ++ (if ((iF > 0)) | |
1563 | + | then hc(cg.caller, iF) | |
1564 | + | else nil)) ++ hf((bC() - hd))) ++ iH) ++ iK) | |
1509 | 1565 | else throw("Strict value is not equal to itself.") | |
1510 | 1566 | } | |
1511 | 1567 | else throw("Strict value is not equal to itself.") | |
1520 | 1576 | ||
1521 | 1577 | ||
1522 | 1578 | ||
1523 | - | @Callable( | |
1524 | - | func closePosition ( | |
1525 | - | let | |
1526 | - | if (( | |
1579 | + | @Callable(cg) | |
1580 | + | func closePosition (gI,iM) = { | |
1581 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1582 | + | if ((hu == hu)) | |
1527 | 1583 | then { | |
1528 | - | let | |
1529 | - | let | |
1530 | - | if (if (if (if (if (!( | |
1531 | - | then true | |
1532 | - | else !( | |
1533 | - | then true | |
1534 | - | else | |
1535 | - | then true | |
1536 | - | else (0 >= | |
1537 | - | then true | |
1538 | - | else (0 > | |
1584 | + | let cp = cf(cg) | |
1585 | + | let iN = valueOrErrorMessage(addressFromString(cp), "Invalid caller") | |
1586 | + | if (if (if (if (if (!(cw(cp))) | |
1587 | + | then true | |
1588 | + | else !(cx())) | |
1589 | + | then true | |
1590 | + | else cy()) | |
1591 | + | then true | |
1592 | + | else (0 >= gI)) | |
1593 | + | then true | |
1594 | + | else (0 > iM)) | |
1539 | 1595 | then throw("Invalid closePosition parameters") | |
1540 | 1596 | else { | |
1541 | - | let | |
1542 | - | let | |
1543 | - | let | |
1544 | - | let | |
1545 | - | let | |
1546 | - | let | |
1597 | + | let iO = co(cp) | |
1598 | + | let fT = iO._1 | |
1599 | + | let hw = iO._2 | |
1600 | + | let hx = iO._3 | |
1601 | + | let hy = iO._4 | |
1602 | + | let iP = if ((ba(fT) > gI)) | |
1547 | 1603 | then { | |
1548 | - | let hl = if ((gJ > 0)) | |
1549 | - | then aD | |
1550 | - | else aC | |
1551 | - | let hm = (hl == aC) | |
1552 | - | let iC = du((gJ > 0), gh, true) | |
1553 | - | let eu = iC._1 | |
1554 | - | let cM = iC._2 | |
1555 | - | let cN = iC._3 | |
1556 | - | let eB = iC._4 | |
1557 | - | let et = if ((gJ > 0)) | |
1558 | - | then -(gh) | |
1559 | - | else gh | |
1560 | - | let iD = dZ(cl, aL) | |
1561 | - | let hp = iD._1 | |
1562 | - | let dY = iD._2 | |
1563 | - | let iE = aP(aY(et), aY(gJ)) | |
1564 | - | let ey = aR(dY, iE) | |
1565 | - | let iF = cZ(gJ, hi, hk, ey) | |
1566 | - | let di = iF._1 | |
1567 | - | let iG = iF._2 | |
1568 | - | let de = iF._3 | |
1569 | - | let hu = (dY - ey) | |
1570 | - | let hv = if ((gJ > 0)) | |
1571 | - | then ((hp - eu) - hu) | |
1572 | - | else ((hu + hp) - eu) | |
1573 | - | let iH = aR(di, iE) | |
1574 | - | let hw = (gJ + et) | |
1575 | - | let hy = aY(hv) | |
1576 | - | let iI = ci(hw) | |
1577 | - | let eE = (bI() - eu) | |
1578 | - | if (if ((iy != 0)) | |
1579 | - | then (iy > eu) | |
1604 | + | let hz = if ((fT > 0)) | |
1605 | + | then aF | |
1606 | + | else aE | |
1607 | + | let hA = (hz == aE) | |
1608 | + | let iQ = dy((fT > 0), gI, true) | |
1609 | + | let eA = iQ._1 | |
1610 | + | let cQ = iQ._2 | |
1611 | + | let cR = iQ._3 | |
1612 | + | let eH = iQ._4 | |
1613 | + | let ez = if ((fT > 0)) | |
1614 | + | then -(gI) | |
1615 | + | else gI | |
1616 | + | let iR = ef(cp, aN) | |
1617 | + | let hD = iR._1 | |
1618 | + | let ee = iR._2 | |
1619 | + | let iS = eo(cp, aN) | |
1620 | + | let iT = aR(ba(ez), ba(fT)) | |
1621 | + | let eE = aT(ee, iT) | |
1622 | + | let iU = dd(fT, hw, hy, eE) | |
1623 | + | let dm = iU._1 | |
1624 | + | let iV = iU._2 | |
1625 | + | let di = iU._3 | |
1626 | + | let hI = (ee - eE) | |
1627 | + | let hJ = if ((fT > 0)) | |
1628 | + | then ((hD - eA) - hI) | |
1629 | + | else ((hI + hD) - eA) | |
1630 | + | let hM = ba(hJ) | |
1631 | + | let iW = aT(hM, iS) | |
1632 | + | let hK = (fT + ez) | |
1633 | + | let iX = cm(hK) | |
1634 | + | let eK = (bK() - eA) | |
1635 | + | if (if ((iM != 0)) | |
1636 | + | then (iM > eA) | |
1580 | 1637 | else false) | |
1581 | - | then throw(((("Limit error: " + toString( | |
1582 | - | else $Tuple15( | |
1583 | - | then | |
1584 | - | else 0)), ( | |
1585 | - | then | |
1586 | - | else 0)), ( | |
1587 | - | then | |
1588 | - | else 0)), ( | |
1589 | - | then | |
1638 | + | then throw(((("Limit error: " + toString(eA)) + " < ") + toString(iM))) | |
1639 | + | else $Tuple15(hK, iW, hM, iX, iV, eE, (ba((dm - iW)) + eE), cQ, cR, eH, eK, (cb() - (if ((hK > 0)) | |
1640 | + | then ba(ez) | |
1641 | + | else 0)), (ca() - (if ((0 > hK)) | |
1642 | + | then ba(ez) | |
1643 | + | else 0)), (bM() - (if ((hK > 0)) | |
1644 | + | then eA | |
1645 | + | else 0)), (bL() - (if ((0 > hK)) | |
1646 | + | then eA | |
1590 | 1647 | else 0))) | |
1591 | 1648 | } | |
1592 | - | else if (( | |
1649 | + | else if ((gI > ba(fT))) | |
1593 | 1650 | then throw("Invalid closePosition parameters") | |
1594 | 1651 | else { | |
1595 | - | let | |
1596 | - | let | |
1597 | - | let | |
1598 | - | let | |
1599 | - | let | |
1600 | - | let | |
1601 | - | let | |
1602 | - | let | |
1603 | - | let | |
1604 | - | let | |
1605 | - | let | |
1606 | - | let | |
1607 | - | let | |
1608 | - | let | |
1609 | - | if (if (( | |
1610 | - | then ( | |
1652 | + | let iY = eB(cp, true) | |
1653 | + | let eA = iY._1 | |
1654 | + | let iV = iY._2 | |
1655 | + | let eE = iY._3 | |
1656 | + | let eF = iY._4 | |
1657 | + | let cQ = iY._5 | |
1658 | + | let cR = iY._6 | |
1659 | + | let eH = iY._7 | |
1660 | + | let eK = iY._8 | |
1661 | + | let ea = iY._9 | |
1662 | + | let eI = iY._10 | |
1663 | + | let eJ = iY._11 | |
1664 | + | let hO = iY._12 | |
1665 | + | let hP = iY._13 | |
1666 | + | if (if ((iM != 0)) | |
1667 | + | then (iM > eA) | |
1611 | 1668 | else false) | |
1612 | - | then throw(((("Limit error: " + toString( | |
1613 | - | else $Tuple15(0, 0, 0, 0, | |
1669 | + | then throw(((("Limit error: " + toString(eA)) + " < ") + toString(iM))) | |
1670 | + | else $Tuple15(0, 0, 0, 0, iV, eE, eF, cQ, cR, eH, eK, eI, eJ, hO, hP) | |
1614 | 1671 | } | |
1615 | - | let | |
1616 | - | let | |
1617 | - | let | |
1618 | - | let | |
1619 | - | let | |
1620 | - | let | |
1621 | - | let | |
1622 | - | let | |
1623 | - | let | |
1624 | - | let | |
1625 | - | let | |
1626 | - | let | |
1627 | - | let | |
1628 | - | let | |
1629 | - | let | |
1630 | - | if (( | |
1672 | + | let hK = iP._1 | |
1673 | + | let iW = iP._2 | |
1674 | + | let hM = iP._3 | |
1675 | + | let iX = iP._4 | |
1676 | + | let iV = iP._5 | |
1677 | + | let eE = iP._6 | |
1678 | + | let eF = iP._7 | |
1679 | + | let cQ = iP._8 | |
1680 | + | let cR = iP._9 | |
1681 | + | let eH = iP._10 | |
1682 | + | let eK = iP._11 | |
1683 | + | let eI = iP._12 | |
1684 | + | let eJ = iP._13 | |
1685 | + | let hO = iP._14 | |
1686 | + | let hP = iP._15 | |
1687 | + | if ((iV > 0)) | |
1631 | 1688 | then throw("Unable to close position with bad debt") | |
1632 | 1689 | else { | |
1633 | - | let iK = aY(ez) | |
1634 | - | let iL = (bA() - iK) | |
1635 | - | let iM = if ((0 > iL)) | |
1636 | - | then $Tuple2(0, aY(iL)) | |
1637 | - | else $Tuple2(iL, 0) | |
1638 | - | let iN = iM._1 | |
1639 | - | let iO = iM._2 | |
1640 | - | let iP = invoke(ap(), "withdrawLocked", [iK], nil) | |
1641 | - | if ((iP == iP)) | |
1690 | + | let iZ = ba(eF) | |
1691 | + | let ja = (bC() - iZ) | |
1692 | + | let jb = if ((0 > ja)) | |
1693 | + | then $Tuple2(0, ba(ja)) | |
1694 | + | else $Tuple2(ja, 0) | |
1695 | + | let jc = jb._1 | |
1696 | + | let jd = jb._2 | |
1697 | + | let je = fX(cp) | |
1698 | + | let iC = je._1 | |
1699 | + | let iD = je._2 | |
1700 | + | let jf = if ((iC > 0)) | |
1701 | + | then if ((iZ >= iC)) | |
1702 | + | then { | |
1703 | + | let iL = invoke(aw(), "repay", [cp, iC, iD], nil) | |
1704 | + | if ((iL == iL)) | |
1705 | + | then $Tuple2([ScriptTransfer(iN, iC, fromBase58String(iD))], (iZ - iC)) | |
1706 | + | else throw("Strict value is not equal to itself.") | |
1707 | + | } | |
1708 | + | else { | |
1709 | + | let jg = invoke(aw(), "realizePartiallyAndClose", [cp, iZ, iD], nil) | |
1710 | + | if ((jg == jg)) | |
1711 | + | then $Tuple2([ScriptTransfer(iN, iZ, fromBase58String(iD))], 0) | |
1712 | + | else throw("Strict value is not equal to itself.") | |
1713 | + | } | |
1714 | + | else $Tuple2(nil, iZ) | |
1715 | + | if ((jf == jf)) | |
1642 | 1716 | then { | |
1643 | - | let iQ = gN(cl) | |
1644 | - | let io = iQ._1 | |
1645 | - | let ip = iQ._2 | |
1646 | - | let iR = if ((io > 0)) | |
1647 | - | then if ((iK >= io)) | |
1648 | - | then { | |
1649 | - | let ix = invoke(au(), "repay", [cl, ip], [AttachedPayment(am(), io)]) | |
1650 | - | if ((ix == ix)) | |
1651 | - | then $Tuple2([ScriptTransfer(iz, io, fromBase58String(ip))], (iK - io)) | |
1652 | - | else throw("Strict value is not equal to itself.") | |
1653 | - | } | |
1654 | - | else { | |
1655 | - | let iS = invoke(au(), "realizePartiallyAndClose", [cl, ip], [AttachedPayment(am(), iK)]) | |
1656 | - | if ((iS == iS)) | |
1657 | - | then $Tuple2([ScriptTransfer(iz, iK, fromBase58String(ip))], 0) | |
1658 | - | else throw("Strict value is not equal to itself.") | |
1659 | - | } | |
1660 | - | else $Tuple2(nil, iK) | |
1661 | - | if ((iR == iR)) | |
1717 | + | let jh = jf._2 | |
1718 | + | let ji = jf._1 | |
1719 | + | let jj = if ((jh > 0)) | |
1662 | 1720 | then { | |
1663 | - | let iT = iR._2 | |
1664 | - | let iU = iR._1 | |
1665 | - | let hC = invoke(aq(), "notifyNotional", [cl, 0], nil) | |
1666 | - | if ((hC == hC)) | |
1667 | - | then (((((if ((hw == 0)) | |
1668 | - | then gA(cl) | |
1669 | - | else gg(cl, hw, iH, hy, iI)) ++ gt(cM, cN, eB, eE, eC, eD, hA, hB)) ++ (if ((iT > 0)) | |
1670 | - | then gB(iz, iT) | |
1671 | - | else nil)) ++ gE(iN)) ++ iU) | |
1721 | + | let jj = invoke(ar(), "withdrawLocked", [jh], nil) | |
1722 | + | if ((jj == jj)) | |
1723 | + | then nil | |
1724 | + | else throw("Strict value is not equal to itself.") | |
1725 | + | } | |
1726 | + | else nil | |
1727 | + | if ((jj == jj)) | |
1728 | + | then { | |
1729 | + | let hQ = invoke(as(), "notifyNotional", [cp, 0], nil) | |
1730 | + | if ((hQ == hQ)) | |
1731 | + | then (((((if ((hK == 0)) | |
1732 | + | then hb(cp) | |
1733 | + | else gH(cp, hK, iW, hM, iX)) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ (if ((jh > 0)) | |
1734 | + | then hc(iN, jh) | |
1735 | + | else nil)) ++ hf(jc)) ++ ji) | |
1672 | 1736 | else throw("Strict value is not equal to itself.") | |
1673 | 1737 | } | |
1674 | 1738 | else throw("Strict value is not equal to itself.") | |
1682 | 1746 | ||
1683 | 1747 | ||
1684 | 1748 | ||
1685 | - | @Callable( | |
1686 | - | func liquidate ( | |
1687 | - | let | |
1688 | - | if (( | |
1749 | + | @Callable(cg) | |
1750 | + | func liquidate (cp) = { | |
1751 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1752 | + | if ((hu == hu)) | |
1689 | 1753 | then { | |
1690 | - | let | |
1691 | - | let | |
1754 | + | let jk = eo(cp, aN) | |
1755 | + | let iz = if (dQ()) | |
1692 | 1756 | then { | |
1693 | - | let | |
1694 | - | | |
1757 | + | let jl = eo(cp, aO) | |
1758 | + | bb(jk, jl) | |
1695 | 1759 | } | |
1696 | - | else | |
1697 | - | if (if (if (if (!( | |
1698 | - | then true | |
1699 | - | else !( | |
1700 | - | then true | |
1701 | - | else !( | |
1702 | - | then true | |
1703 | - | else | |
1760 | + | else jk | |
1761 | + | if (if (if (if (!(ch(iz, bR(), false))) | |
1762 | + | then true | |
1763 | + | else !(cw(cp))) | |
1764 | + | then true | |
1765 | + | else !(cx())) | |
1766 | + | then true | |
1767 | + | else cy()) | |
1704 | 1768 | then throw("Unable to liquidate") | |
1705 | - | else if (if (if (( | |
1706 | - | then ( | |
1769 | + | else if (if (if ((jk > bS())) | |
1770 | + | then (bT() > 0) | |
1707 | 1771 | else false) | |
1708 | - | then ( | |
1772 | + | then (aK > bT()) | |
1709 | 1773 | else false) | |
1710 | 1774 | then { | |
1711 | - | let | |
1712 | - | let | |
1713 | - | let | |
1714 | - | let | |
1715 | - | let | |
1716 | - | let | |
1717 | - | then | |
1718 | - | else | |
1719 | - | let | |
1720 | - | let | |
1721 | - | let | |
1722 | - | let | |
1723 | - | let | |
1724 | - | let | |
1725 | - | let | |
1726 | - | let | |
1727 | - | let | |
1728 | - | let | |
1729 | - | let | |
1730 | - | let | |
1731 | - | let | |
1732 | - | let | |
1733 | - | let | |
1734 | - | let | |
1735 | - | let | |
1736 | - | let | |
1737 | - | then (( | |
1738 | - | else (( | |
1739 | - | let | |
1740 | - | let | |
1741 | - | let | |
1742 | - | let | |
1743 | - | let | |
1744 | - | let | |
1745 | - | let | |
1746 | - | let | |
1747 | - | let | |
1748 | - | let | |
1749 | - | then $Tuple2(0, | |
1750 | - | else $Tuple2( | |
1751 | - | let | |
1752 | - | let | |
1753 | - | let | |
1754 | - | let | |
1755 | - | let | |
1756 | - | let | |
1775 | + | let jm = co(cp) | |
1776 | + | let fT = jm._1 | |
1777 | + | let hw = jm._2 | |
1778 | + | let hx = jm._3 | |
1779 | + | let hy = jm._4 | |
1780 | + | let hz = if ((fT > 0)) | |
1781 | + | then aF | |
1782 | + | else aE | |
1783 | + | let hA = (hz == aE) | |
1784 | + | let eA = eu(cp, fT) | |
1785 | + | let jn = ef(cp, aN) | |
1786 | + | let hD = jn._1 | |
1787 | + | let ee = jn._2 | |
1788 | + | let jo = cP(hA, eA) | |
1789 | + | let ez = jo._1 | |
1790 | + | let cQ = jo._2 | |
1791 | + | let cR = jo._3 | |
1792 | + | let eH = jo._4 | |
1793 | + | let jp = aR(ba(ez), ba(fT)) | |
1794 | + | let eE = aT(ee, jp) | |
1795 | + | let jq = dd(fT, hw, hy, eE) | |
1796 | + | let dm = jq._1 | |
1797 | + | let dn = jq._2 | |
1798 | + | let di = jq._3 | |
1799 | + | let hI = (ee - eE) | |
1800 | + | let hJ = if ((fT > 0)) | |
1801 | + | then ((hD - eA) - hI) | |
1802 | + | else ((hI + hD) - eA) | |
1803 | + | let jr = aT(eA, bS()) | |
1804 | + | let js = (jr / 2) | |
1805 | + | let gk = (jr - js) | |
1806 | + | let iW = (dm - jr) | |
1807 | + | let hK = (fT + ez) | |
1808 | + | let hM = ba(hJ) | |
1809 | + | let iX = cm(hK) | |
1810 | + | let eK = (bK() - eA) | |
1811 | + | let ja = (bC() - jr) | |
1812 | + | let jt = if ((0 > ja)) | |
1813 | + | then $Tuple2(0, ba(ja)) | |
1814 | + | else $Tuple2(ja, 0) | |
1815 | + | let ju = jt._1 | |
1816 | + | let jd = jt._2 | |
1817 | + | let jv = fX(cp) | |
1818 | + | let iC = jv._1 | |
1819 | + | let iD = jv._2 | |
1820 | + | let jw = if ((iC > 0)) | |
1757 | 1821 | then { | |
1758 | - | let | |
1759 | - | let | |
1760 | - | if (( | |
1822 | + | let jx = aT(iC, jp) | |
1823 | + | let jg = invoke(aw(), "realizePartially", [cp, iD, jx], nil) | |
1824 | + | if ((jg == jg)) | |
1761 | 1825 | then nil | |
1762 | 1826 | else throw("Strict value is not equal to itself.") | |
1763 | 1827 | } | |
1764 | 1828 | else nil | |
1765 | - | if (( | |
1829 | + | if ((jw == jw)) | |
1766 | 1830 | then { | |
1767 | - | let | |
1768 | - | if (( | |
1831 | + | let jj = invoke(ar(), "withdrawLocked", [jr], nil) | |
1832 | + | if ((jj == jj)) | |
1769 | 1833 | then { | |
1770 | - | let | |
1771 | - | if (( | |
1834 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1835 | + | if ((ir == ir)) | |
1772 | 1836 | then { | |
1773 | - | let | |
1774 | - | if (( | |
1775 | - | then ((( | |
1776 | - | then | |
1777 | - | else 0)), ( | |
1778 | - | then | |
1779 | - | else 0)), ( | |
1780 | - | then | |
1781 | - | else 0)), ( | |
1782 | - | then | |
1783 | - | else 0)))) ++ | |
1837 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1838 | + | if ((hQ == hQ)) | |
1839 | + | then (((gH(cp, hK, iW, hM, iX) ++ gU(cQ, cR, eH, eK, (cb() - (if ((hK > 0)) | |
1840 | + | then ba(ez) | |
1841 | + | else 0)), (ca() - (if ((0 > hK)) | |
1842 | + | then ba(ez) | |
1843 | + | else 0)), (bM() - (if ((hK > 0)) | |
1844 | + | then eA | |
1845 | + | else 0)), (bL() - (if ((0 > hK)) | |
1846 | + | then eA | |
1847 | + | else 0)))) ++ hc(cg.caller, js)) ++ hf(ju)) | |
1784 | 1848 | else throw("Strict value is not equal to itself.") | |
1785 | 1849 | } | |
1786 | 1850 | else throw("Strict value is not equal to itself.") | |
1790 | 1854 | else throw("Strict value is not equal to itself.") | |
1791 | 1855 | } | |
1792 | 1856 | else { | |
1793 | - | let | |
1794 | - | let | |
1795 | - | let | |
1796 | - | let | |
1797 | - | let | |
1798 | - | let | |
1799 | - | let | |
1800 | - | let | |
1801 | - | let | |
1802 | - | let | |
1803 | - | let | |
1804 | - | let | |
1805 | - | let | |
1806 | - | let | |
1807 | - | let | |
1808 | - | let | |
1809 | - | let | |
1810 | - | let | |
1811 | - | let | |
1812 | - | then $Tuple2(0, | |
1813 | - | else $Tuple2( | |
1814 | - | let | |
1815 | - | let | |
1816 | - | let | |
1817 | - | let | |
1818 | - | let | |
1819 | - | let | |
1857 | + | let jy = eB(cp, false) | |
1858 | + | let dZ = jy._1 | |
1859 | + | let dn = jy._2 | |
1860 | + | let ea = jy._3 | |
1861 | + | let eb = jy._4 | |
1862 | + | let cQ = jy._5 | |
1863 | + | let cR = jy._6 | |
1864 | + | let eH = jy._7 | |
1865 | + | let eK = jy._8 | |
1866 | + | let eA = jy._9 | |
1867 | + | let eI = jy._10 | |
1868 | + | let eJ = jy._11 | |
1869 | + | let hO = jy._12 | |
1870 | + | let hP = jy._13 | |
1871 | + | let jr = aT(eA, bS()) | |
1872 | + | let js = (jr / 2) | |
1873 | + | let gk = (jr - js) | |
1874 | + | let ja = (bC() - jr) | |
1875 | + | let jz = if ((0 > ja)) | |
1876 | + | then $Tuple2(0, ba(ja)) | |
1877 | + | else $Tuple2(ja, 0) | |
1878 | + | let ju = jz._1 | |
1879 | + | let jd = jz._2 | |
1880 | + | let jA = fX(cp) | |
1881 | + | let iC = jA._1 | |
1882 | + | let iD = jA._2 | |
1883 | + | let jw = if ((iC > 0)) | |
1820 | 1884 | then { | |
1821 | - | let | |
1822 | - | if (( | |
1885 | + | let jg = invoke(aw(), "realizePartiallyAndClose", [cp, 0, iD], nil) | |
1886 | + | if ((jg == jg)) | |
1823 | 1887 | then nil | |
1824 | 1888 | else throw("Strict value is not equal to itself.") | |
1825 | 1889 | } | |
1826 | 1890 | else nil | |
1827 | - | if (( | |
1891 | + | if ((jw == jw)) | |
1828 | 1892 | then { | |
1829 | - | let | |
1893 | + | let gd = if ((dn > 0)) | |
1830 | 1894 | then { | |
1831 | - | let | |
1832 | - | if (( | |
1895 | + | let jB = invoke(ar(), "exchangeFreeAndLocked", [dn], nil) | |
1896 | + | if ((jB == jB)) | |
1833 | 1897 | then nil | |
1834 | 1898 | else throw("Strict value is not equal to itself.") | |
1835 | 1899 | } | |
1836 | 1900 | else nil | |
1837 | - | if (( | |
1901 | + | if ((gd == gd)) | |
1838 | 1902 | then { | |
1839 | - | let | |
1840 | - | if (( | |
1903 | + | let jj = invoke(ar(), "withdrawLocked", [jr], nil) | |
1904 | + | if ((jj == jj)) | |
1841 | 1905 | then { | |
1842 | - | let | |
1843 | - | if (( | |
1906 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1907 | + | if ((ir == ir)) | |
1844 | 1908 | then { | |
1845 | - | let | |
1846 | - | if (( | |
1847 | - | then ((( | |
1909 | + | let hQ = invoke(as(), "notifyNotional", [cp, 0], nil) | |
1910 | + | if ((hQ == hQ)) | |
1911 | + | then (((hb(cp) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ hc(cg.caller, js)) ++ hf(ju)) | |
1848 | 1912 | else throw("Strict value is not equal to itself.") | |
1849 | 1913 | } | |
1850 | 1914 | else throw("Strict value is not equal to itself.") | |
1861 | 1925 | ||
1862 | 1926 | ||
1863 | 1927 | ||
1864 | - | @Callable( | |
1928 | + | @Callable(cg) | |
1865 | 1929 | func payFunding () = { | |
1866 | - | let | |
1867 | - | if (if (if (( | |
1930 | + | let jC = bN() | |
1931 | + | if (if (if ((jC > lastBlock.timestamp)) | |
1868 | 1932 | then true | |
1869 | - | else !( | |
1933 | + | else !(cx())) | |
1870 | 1934 | then true | |
1871 | - | else | |
1872 | - | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString( | |
1935 | + | else cy()) | |
1936 | + | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(jC))) | |
1873 | 1937 | else { | |
1874 | - | let | |
1875 | - | let | |
1876 | - | let | |
1877 | - | let | |
1878 | - | | |
1879 | - | } | |
1880 | - | } | |
1881 | - | ||
1882 | - | ||
1883 | - | ||
1884 | - | @Callable( | |
1938 | + | let fD = dz() | |
1939 | + | let jD = fC() | |
1940 | + | let fG = jD._1 | |
1941 | + | let fH = jD._2 | |
1942 | + | gx((jC + bQ()), (bY() + fH), (bZ() + fG), aR(fH, fD), aR(fG, fD)) | |
1943 | + | } | |
1944 | + | } | |
1945 | + | ||
1946 | + | ||
1947 | + | ||
1948 | + | @Callable(cg) | |
1885 | 1949 | func syncTerminalPriceToOracle () = { | |
1886 | - | let jp = fs(dv()) | |
1887 | - | let jq = jp._1 | |
1888 | - | let jr = jp._2 | |
1889 | - | let ez = jp._3 | |
1890 | - | let jm = invoke(ap(), "exchangeFreeAndLocked", [ez], nil) | |
1891 | - | if ((jm == jm)) | |
1892 | - | then gs(jq, jr) | |
1950 | + | let jE = fy(dz()) | |
1951 | + | let jF = jE._1 | |
1952 | + | let jG = jE._2 | |
1953 | + | let eF = jE._3 | |
1954 | + | let jH = if ((eF != 0)) | |
1955 | + | then { | |
1956 | + | let jH = invoke(ar(), "exchangeFreeAndLocked", [eF], nil) | |
1957 | + | if ((jH == jH)) | |
1958 | + | then nil | |
1959 | + | else throw("Strict value is not equal to itself.") | |
1960 | + | } | |
1961 | + | else nil | |
1962 | + | if ((jH == jH)) | |
1963 | + | then gT(jF, jG) | |
1893 | 1964 | else throw("Strict value is not equal to itself.") | |
1894 | 1965 | } | |
1895 | 1966 | ||
1896 | 1967 | ||
1897 | 1968 | ||
1898 | - | @Callable( | |
1899 | - | func view_calcRemainMarginWithFundingPayment ( | |
1900 | - | let | |
1901 | - | if (( | |
1969 | + | @Callable(cg) | |
1970 | + | func view_calcRemainMarginWithFundingPayment (cp) = { | |
1971 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1972 | + | if ((hu == hu)) | |
1902 | 1973 | then { | |
1903 | - | let | |
1904 | - | let | |
1905 | - | let | |
1906 | - | let | |
1907 | - | let | |
1908 | - | let | |
1909 | - | let | |
1910 | - | let | |
1911 | - | let | |
1912 | - | let | |
1913 | - | let | |
1914 | - | let | |
1915 | - | throw(((((( | |
1974 | + | let jI = co(cp) | |
1975 | + | let cs = jI._1 | |
1976 | + | let eh = jI._2 | |
1977 | + | let eq = jI._3 | |
1978 | + | let ej = jI._4 | |
1979 | + | let jJ = ef(cp, aN) | |
1980 | + | let dW = jJ._1 | |
1981 | + | let ee = jJ._2 | |
1982 | + | let jK = dd(cs, eh, ej, ee) | |
1983 | + | let dm = jK._1 | |
1984 | + | let dn = jK._2 | |
1985 | + | let di = jK._3 | |
1986 | + | throw((((((aP(dm) + aP(di)) + aP(et(cp))) + aP(ee)) + aP(dn)) + aP(dW))) | |
1916 | 1987 | } | |
1917 | 1988 | else throw("Strict value is not equal to itself.") | |
1918 | 1989 | } | |
1919 | 1990 | ||
1920 | 1991 | ||
1921 | 1992 | ||
1922 | - | @Callable( | |
1923 | - | func view_getPegAdjustCost ( | |
1924 | - | let | |
1925 | - | throw(toString( | |
1926 | - | } | |
1927 | - | ||
1928 | - | ||
1929 | - | ||
1930 | - | @Callable( | |
1993 | + | @Callable(cg) | |
1994 | + | func view_getPegAdjustCost (gM) = { | |
1995 | + | let fx = fy(gM) | |
1996 | + | throw(toString(fx._3)) | |
1997 | + | } | |
1998 | + | ||
1999 | + | ||
2000 | + | ||
2001 | + | @Callable(cg) | |
1931 | 2002 | func view_getTerminalAmmPrice () = { | |
1932 | - | let | |
1933 | - | let | |
1934 | - | let | |
1935 | - | let | |
1936 | - | throw(toString( | |
1937 | - | } | |
1938 | - | ||
1939 | - | ||
1940 | - | ||
1941 | - | @Callable( | |
2003 | + | let jL = fb() | |
2004 | + | let ff = jL._1 | |
2005 | + | let fg = jL._2 | |
2006 | + | let hj = aR(aT(ff, bH()), aT(fg, bI())) | |
2007 | + | throw(toString(hj)) | |
2008 | + | } | |
2009 | + | ||
2010 | + | ||
2011 | + | ||
2012 | + | @Callable(cg) | |
1942 | 2013 | func view_getFunding () = { | |
1943 | - | let | |
1944 | - | let | |
1945 | - | let | |
1946 | - | let | |
1947 | - | let | |
1948 | - | let | |
1949 | - | throw(((( | |
1950 | - | } | |
1951 | - | ||
1952 | - | ||
1953 | - | ||
1954 | - | @Callable( | |
1955 | - | func view_getBorrowedByTrader ( | |
1956 | - | let | |
1957 | - | let | |
1958 | - | let | |
1959 | - | throw(( | |
1960 | - | } | |
1961 | - | ||
1962 | - | ||
1963 | - | ||
1964 | - | @Callable( | |
2014 | + | let fD = dz() | |
2015 | + | let jM = fC() | |
2016 | + | let fG = jM._1 | |
2017 | + | let fH = jM._2 | |
2018 | + | let jN = aR(fH, fD) | |
2019 | + | let jO = aR(fG, fD) | |
2020 | + | throw((((aP(jN) + aP(jO)) + aP(eL())) + aP(dz()))) | |
2021 | + | } | |
2022 | + | ||
2023 | + | ||
2024 | + | ||
2025 | + | @Callable(cg) | |
2026 | + | func view_getBorrowedByTrader (cp) = { | |
2027 | + | let jP = fX(cp) | |
2028 | + | let iC = jP._1 | |
2029 | + | let iD = jP._2 | |
2030 | + | throw((aP(iC) + iD)) | |
2031 | + | } | |
2032 | + | ||
2033 | + | ||
2034 | + | ||
2035 | + | @Callable(cg) | |
1965 | 2036 | func computeSpotPrice () = { | |
1966 | - | let | |
1967 | - | $Tuple2(nil, | |
1968 | - | } | |
1969 | - | ||
1970 | - | ||
1971 | - | ||
1972 | - | @Callable( | |
1973 | - | func computeFeeForTraderWithArtifact ( | |
1974 | - | let | |
1975 | - | $Tuple2(nil, | |
1976 | - | } | |
1977 | - | ||
1978 | - | ||
1979 | - | @Verifier( | |
1980 | - | func | |
2037 | + | let fx = dP() | |
2038 | + | $Tuple2(nil, fx) | |
2039 | + | } | |
2040 | + | ||
2041 | + | ||
2042 | + | ||
2043 | + | @Callable(cg) | |
2044 | + | func computeFeeForTraderWithArtifact (cp,fJ) = { | |
2045 | + | let fx = ga(cp, fJ) | |
2046 | + | $Tuple2(nil, fx) | |
2047 | + | } | |
2048 | + | ||
2049 | + | ||
2050 | + | @Verifier(jQ) | |
2051 | + | func jR () = sigVerify(jQ.bodyBytes, jQ.proofs[0], an()) | |
1981 | 2052 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = "k_ora_key" | |
5 | 5 | ||
6 | 6 | let b = "k_ora_block_key" | |
7 | 7 | ||
8 | 8 | let c = "k_ora" | |
9 | 9 | ||
10 | 10 | let d = "k_balance" | |
11 | 11 | ||
12 | 12 | let e = "k_sequence" | |
13 | 13 | ||
14 | 14 | let f = "k_positionSize" | |
15 | 15 | ||
16 | 16 | let g = "k_positionMargin" | |
17 | 17 | ||
18 | 18 | let h = "k_positionOpenNotional" | |
19 | 19 | ||
20 | 20 | let i = "k_positionFraction" | |
21 | 21 | ||
22 | 22 | let j = "k_positionSequence" | |
23 | 23 | ||
24 | 24 | let k = "k_positionAsset" | |
25 | 25 | ||
26 | 26 | let l = "k_initialized" | |
27 | 27 | ||
28 | 28 | let m = "k_paused" | |
29 | 29 | ||
30 | 30 | let n = "k_closeOnly" | |
31 | 31 | ||
32 | 32 | let o = "k_fee" | |
33 | 33 | ||
34 | 34 | let p = "k_fundingPeriod" | |
35 | 35 | ||
36 | 36 | let q = "k_initMarginRatio" | |
37 | 37 | ||
38 | 38 | let r = "k_mmr" | |
39 | 39 | ||
40 | 40 | let s = "k_liquidationFeeRatio" | |
41 | 41 | ||
42 | 42 | let t = "k_partLiquidationRatio" | |
43 | 43 | ||
44 | 44 | let u = "k_spreadLimit" | |
45 | 45 | ||
46 | 46 | let v = "k_maxPriceImpact" | |
47 | 47 | ||
48 | 48 | let w = "k_maxPriceSpread" | |
49 | 49 | ||
50 | 50 | let x = "k_maxOpenNotional" | |
51 | 51 | ||
52 | - | let y = "k_lastDataStr" | |
53 | - | ||
54 | - | let z = "k_lastMinuteId" | |
55 | - | ||
56 | - | let A = "k_twapDataLastCumulativePrice" | |
57 | - | ||
58 | - | let B = "k_twapDataLastPrice" | |
59 | - | ||
60 | - | let C = "k_twapDataPreviousMinuteId" | |
61 | - | ||
62 | - | let D = "k_latestLongPremiumFraction" | |
63 | - | ||
64 | - | let E = "k_latestShortPremiumFraction" | |
65 | - | ||
66 | - | let F = "k_nextFundingBlockMinTimestamp" | |
67 | - | ||
68 | - | let G = "k_longFundingRate" | |
69 | - | ||
70 | - | let H = "k_shortFundingRate" | |
71 | - | ||
72 | - | let I = "k_qtAstR" | |
73 | - | ||
74 | - | let J = "k_bsAstR" | |
75 | - | ||
76 | - | let K = "k_qtAstW" | |
77 | - | ||
78 | - | let L = "k_bsAstW" | |
79 | - | ||
80 | - | let M = "k_totalPositionSize" | |
81 | - | ||
82 | - | let N = "k_totalLongPositionSize" | |
83 | - | ||
84 | - | let O = "k_totalShortPositionSize" | |
85 | - | ||
86 | - | let P = "k_openInterestNotional" | |
87 | - | ||
88 | - | let Q = "k_openInterestShort" | |
89 | - | ||
90 | - | let R = "k_openInterestLong" | |
91 | - | ||
92 | - | let S = "k_coordinatorAddress" | |
93 | - | ||
94 | - | let T = "k_vault_address" | |
95 | - | ||
96 | - | let U = "k_admin_address" | |
97 | - | ||
98 | - | let V = "k_admin_public_key" | |
99 | - | ||
100 | - | let W = "k_quote_asset" | |
101 | - | ||
102 | - | let X = "k_quote_staking" | |
103 | - | ||
104 | - | let Y = "k_staking_address" | |
105 | - | ||
106 | - | let Z = "k_miner_address" | |
107 | - | ||
108 | - | let aa = "k_orders_address" | |
109 | - | ||
110 | - | let ab = "k_referral_address" | |
111 | - | ||
112 | - | let ac = "k_collateral_address" | |
113 | - | ||
114 | - | let ad = "k_exchange_address" | |
115 | - | ||
116 | - | let ae = "k_nft_manager_address" | |
117 | - | ||
118 | - | let af = "k_trader_market_asset_collateral" | |
119 | - | ||
120 | - | func ag (ah,ai) = ((ah + "_") + ai) | |
121 | - | ||
122 | - | ||
123 | - | func aj () = valueOrErrorMessage(addressFromString(getStringValue(this, S)), "Coordinator not set") | |
124 | - | ||
125 | - | ||
126 | - | func ak () = addressFromString(getStringValue(aj(), U)) | |
127 | - | ||
128 | - | ||
129 | - | func al () = fromBase58String(getStringValue(aj(), V)) | |
130 | - | ||
131 | - | ||
132 | - | func am () = fromBase58String(getStringValue(aj(), W)) | |
133 | - | ||
134 | - | ||
135 | - | func an () = valueOrErrorMessage(addressFromString(getStringValue(aj(), X)), "Quote asset staking not set") | |
136 | - | ||
137 | - | ||
138 | - | func ao () = valueOrErrorMessage(addressFromString(getStringValue(aj(), Y)), "Staking not set") | |
139 | - | ||
140 | - | ||
141 | - | func ap () = valueOrErrorMessage(addressFromString(getStringValue(aj(), T)), "Vault not set") | |
142 | - | ||
143 | - | ||
144 | - | func aq () = valueOrErrorMessage(addressFromString(getStringValue(aj(), Z)), "Miner not set") | |
145 | - | ||
146 | - | ||
147 | - | func ar () = valueOrErrorMessage(addressFromString(getStringValue(aj(), aa)), "Orders not set") | |
148 | - | ||
149 | - | ||
150 | - | func as () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ab)), "Referral not set") | |
151 | - | ||
152 | - | ||
153 | - | func at () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ae)), "NFT Manager not set") | |
154 | - | ||
155 | - | ||
156 | - | func au () = valueOrErrorMessage(addressFromString(getStringValue(aj(), ac)), "Collateral Manager not set") | |
157 | - | ||
158 | - | ||
159 | - | func av () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(aj(), ad), "No swap address")), "Invalid swap address") | |
160 | - | ||
161 | - | ||
162 | - | let aw = "k_whitelist_asset" | |
163 | - | ||
164 | - | func ax (ay) = valueOrElse(getBoolean(au(), ag(aw, ay)), false) | |
165 | - | ||
166 | - | ||
167 | - | let az = "k_token_param" | |
168 | - | ||
169 | - | let aA = "k_token_type" | |
170 | - | ||
171 | - | let aB = "fee_reduction" | |
172 | - | ||
173 | - | let aC = 1 | |
174 | - | ||
175 | - | let aD = 2 | |
176 | - | ||
177 | - | let aE = 15 | |
178 | - | ||
179 | - | let aF = 15 | |
180 | - | ||
181 | - | let aG = 1000 | |
182 | - | ||
183 | - | let aH = 6 | |
184 | - | ||
185 | - | let aI = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
186 | - | ||
187 | - | let aJ = (86400 * aI) | |
188 | - | ||
189 | - | let aK = 100 | |
190 | - | ||
191 | - | let aL = 1 | |
192 | - | ||
193 | - | let aM = 2 | |
194 | - | ||
195 | - | func aN (aO) = (toString(aO) + ",") | |
196 | - | ||
197 | - | ||
198 | - | func aP (aO,aQ) = fraction(aO, aI, aQ, HALFEVEN) | |
199 | - | ||
200 | - | ||
201 | - | func aR (aO,aQ) = fraction(aO, aQ, aI, HALFEVEN) | |
202 | - | ||
203 | - | ||
204 | - | func aS (aO) = sqrt(aO, aH, aH, HALFEVEN) | |
205 | - | ||
206 | - | ||
207 | - | func aT (aO,aQ) = pow(aO, aH, aQ, aH, aH, HALFEVEN) | |
208 | - | ||
209 | - | ||
210 | - | func aU (aO,aQ) = fraction(aO, toBigInt(aI), aQ, HALFEVEN) | |
211 | - | ||
212 | - | ||
213 | - | func aV (aO,aQ) = fraction(aO, aQ, toBigInt(aI), HALFEVEN) | |
214 | - | ||
215 | - | ||
216 | - | func aW (aO) = sqrtBigInt(aO, aH, aH, HALFEVEN) | |
217 | - | ||
218 | - | ||
219 | - | func aX (aO,aQ) = pow(aO, aH, aQ, aH, aH, HALFEVEN) | |
220 | - | ||
221 | - | ||
222 | - | func aY (aO) = if ((aO > 0)) | |
223 | - | then aO | |
224 | - | else -(aO) | |
225 | - | ||
226 | - | ||
227 | - | func aZ (aO,aQ) = if ((aO >= aQ)) | |
228 | - | then aO | |
229 | - | else aQ | |
230 | - | ||
231 | - | ||
232 | - | func ba (bb) = { | |
233 | - | func bc (bd,be) = ((bd + be) + ",") | |
234 | - | ||
235 | - | let bf = { | |
236 | - | let bg = bb | |
237 | - | let bh = size(bg) | |
238 | - | let bi = "" | |
239 | - | func bj (bk,bl) = if ((bl >= bh)) | |
240 | - | then bk | |
241 | - | else bc(bk, bg[bl]) | |
242 | - | ||
243 | - | func bm (bk,bl) = if ((bl >= bh)) | |
244 | - | then bk | |
52 | + | let y = "k_feeToStakersPercent" | |
53 | + | ||
54 | + | let z = "k_maxOracleDelay" | |
55 | + | ||
56 | + | let A = "k_lastDataStr" | |
57 | + | ||
58 | + | let B = "k_lastMinuteId" | |
59 | + | ||
60 | + | let C = "k_twapDataLastCumulativePrice" | |
61 | + | ||
62 | + | let D = "k_twapDataLastPrice" | |
63 | + | ||
64 | + | let E = "k_twapDataPreviousMinuteId" | |
65 | + | ||
66 | + | let F = "k_latestLongPremiumFraction" | |
67 | + | ||
68 | + | let G = "k_latestShortPremiumFraction" | |
69 | + | ||
70 | + | let H = "k_nextFundingBlockMinTimestamp" | |
71 | + | ||
72 | + | let I = "k_longFundingRate" | |
73 | + | ||
74 | + | let J = "k_shortFundingRate" | |
75 | + | ||
76 | + | let K = "k_qtAstR" | |
77 | + | ||
78 | + | let L = "k_bsAstR" | |
79 | + | ||
80 | + | let M = "k_qtAstW" | |
81 | + | ||
82 | + | let N = "k_bsAstW" | |
83 | + | ||
84 | + | let O = "k_totalPositionSize" | |
85 | + | ||
86 | + | let P = "k_totalLongPositionSize" | |
87 | + | ||
88 | + | let Q = "k_totalShortPositionSize" | |
89 | + | ||
90 | + | let R = "k_openInterestNotional" | |
91 | + | ||
92 | + | let S = "k_openInterestShort" | |
93 | + | ||
94 | + | let T = "k_openInterestLong" | |
95 | + | ||
96 | + | let U = "k_coordinatorAddress" | |
97 | + | ||
98 | + | let V = "k_vault_address" | |
99 | + | ||
100 | + | let W = "k_admin_address" | |
101 | + | ||
102 | + | let X = "k_admin_public_key" | |
103 | + | ||
104 | + | let Y = "k_quote_asset" | |
105 | + | ||
106 | + | let Z = "k_quote_staking" | |
107 | + | ||
108 | + | let aa = "k_staking_address" | |
109 | + | ||
110 | + | let ab = "k_miner_address" | |
111 | + | ||
112 | + | let ac = "k_orders_address" | |
113 | + | ||
114 | + | let ad = "k_referral_address" | |
115 | + | ||
116 | + | let ae = "k_collateral_address" | |
117 | + | ||
118 | + | let af = "k_exchange_address" | |
119 | + | ||
120 | + | let ag = "k_nft_manager_address" | |
121 | + | ||
122 | + | let ah = "k_trader_market_asset_collateral" | |
123 | + | ||
124 | + | func ai (aj,ak) = ((aj + "_") + ak) | |
125 | + | ||
126 | + | ||
127 | + | func al () = valueOrErrorMessage(addressFromString(getStringValue(this, U)), "Coordinator not set") | |
128 | + | ||
129 | + | ||
130 | + | func am () = addressFromString(getStringValue(al(), W)) | |
131 | + | ||
132 | + | ||
133 | + | func an () = fromBase58String(getStringValue(al(), X)) | |
134 | + | ||
135 | + | ||
136 | + | func ao () = fromBase58String(getStringValue(al(), Y)) | |
137 | + | ||
138 | + | ||
139 | + | func ap () = valueOrErrorMessage(addressFromString(getStringValue(al(), Z)), "Quote asset staking not set") | |
140 | + | ||
141 | + | ||
142 | + | func aq () = valueOrErrorMessage(addressFromString(getStringValue(al(), aa)), "Staking not set") | |
143 | + | ||
144 | + | ||
145 | + | func ar () = valueOrErrorMessage(addressFromString(getStringValue(al(), V)), "Vault not set") | |
146 | + | ||
147 | + | ||
148 | + | func as () = valueOrErrorMessage(addressFromString(getStringValue(al(), ab)), "Miner not set") | |
149 | + | ||
150 | + | ||
151 | + | func at () = valueOrErrorMessage(addressFromString(getStringValue(al(), ac)), "Orders not set") | |
152 | + | ||
153 | + | ||
154 | + | func au () = valueOrErrorMessage(addressFromString(getStringValue(al(), ad)), "Referral not set") | |
155 | + | ||
156 | + | ||
157 | + | func av () = valueOrErrorMessage(addressFromString(getStringValue(al(), ag)), "NFT Manager not set") | |
158 | + | ||
159 | + | ||
160 | + | func aw () = valueOrErrorMessage(addressFromString(getStringValue(al(), ae)), "Collateral Manager not set") | |
161 | + | ||
162 | + | ||
163 | + | func ax () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(al(), af), "No swap address")), "Invalid swap address") | |
164 | + | ||
165 | + | ||
166 | + | let ay = "k_whitelist_asset" | |
167 | + | ||
168 | + | func az (aA) = valueOrElse(getBoolean(aw(), ai(ay, aA)), false) | |
169 | + | ||
170 | + | ||
171 | + | let aB = "k_token_param" | |
172 | + | ||
173 | + | let aC = "k_token_type" | |
174 | + | ||
175 | + | let aD = "fee_reduction" | |
176 | + | ||
177 | + | let aE = 1 | |
178 | + | ||
179 | + | let aF = 2 | |
180 | + | ||
181 | + | let aG = 15 | |
182 | + | ||
183 | + | let aH = 15 | |
184 | + | ||
185 | + | let aI = 1000 | |
186 | + | ||
187 | + | let aJ = 6 | |
188 | + | ||
189 | + | let aK = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
190 | + | ||
191 | + | let aL = (86400 * aK) | |
192 | + | ||
193 | + | let aM = 100 | |
194 | + | ||
195 | + | let aN = 1 | |
196 | + | ||
197 | + | let aO = 2 | |
198 | + | ||
199 | + | func aP (aQ) = (toString(aQ) + ",") | |
200 | + | ||
201 | + | ||
202 | + | func aR (aQ,aS) = fraction(aQ, aK, aS, HALFEVEN) | |
203 | + | ||
204 | + | ||
205 | + | func aT (aQ,aS) = fraction(aQ, aS, aK, HALFEVEN) | |
206 | + | ||
207 | + | ||
208 | + | func aU (aQ) = sqrt(aQ, aJ, aJ, HALFEVEN) | |
209 | + | ||
210 | + | ||
211 | + | func aV (aQ,aS) = pow(aQ, aJ, aS, aJ, aJ, HALFEVEN) | |
212 | + | ||
213 | + | ||
214 | + | func aW (aQ,aS) = fraction(aQ, toBigInt(aK), aS, HALFEVEN) | |
215 | + | ||
216 | + | ||
217 | + | func aX (aQ,aS) = fraction(aQ, aS, toBigInt(aK), HALFEVEN) | |
218 | + | ||
219 | + | ||
220 | + | func aY (aQ) = sqrtBigInt(aQ, aJ, aJ, HALFEVEN) | |
221 | + | ||
222 | + | ||
223 | + | func aZ (aQ,aS) = pow(aQ, aJ, aS, aJ, aJ, HALFEVEN) | |
224 | + | ||
225 | + | ||
226 | + | func ba (aQ) = if ((aQ > 0)) | |
227 | + | then aQ | |
228 | + | else -(aQ) | |
229 | + | ||
230 | + | ||
231 | + | func bb (aQ,aS) = if ((aQ >= aS)) | |
232 | + | then aQ | |
233 | + | else aS | |
234 | + | ||
235 | + | ||
236 | + | func bc (bd) = { | |
237 | + | func be (bf,bg) = ((bf + bg) + ",") | |
238 | + | ||
239 | + | let bh = { | |
240 | + | let bi = bd | |
241 | + | let bj = size(bi) | |
242 | + | let bk = "" | |
243 | + | func bl (bm,bn) = if ((bn >= bj)) | |
244 | + | then bm | |
245 | + | else be(bm, bi[bn]) | |
246 | + | ||
247 | + | func bo (bm,bn) = if ((bn >= bj)) | |
248 | + | then bm | |
245 | 249 | else throw("List size exceeds 20") | |
246 | 250 | ||
247 | - | | |
251 | + | bo(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bk, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
248 | 252 | } | |
249 | - | let bn = dropRight(bf, 1) | |
250 | - | let bo = if ((take(bn, 1) == ",")) | |
251 | - | then drop(bn, 1) | |
252 | - | else bn | |
253 | - | bo | |
254 | - | } | |
255 | - | ||
256 | - | ||
257 | - | func bp (bq) = split(bq, ",") | |
258 | - | ||
259 | - | ||
260 | - | func br (bb,bs,bt) = if ((size(bb) > bs)) | |
261 | - | then (removeByIndex(bb, 0) :+ bt) | |
262 | - | else (bb :+ bt) | |
263 | - | ||
264 | - | ||
265 | - | func bu (bv) = valueOrErrorMessage(getInteger(this, bv), ("no value for " + bv)) | |
266 | - | ||
267 | - | ||
268 | - | func bw (bv,bx) = valueOrElse(getInteger(this, bv), bx) | |
269 | - | ||
270 | - | ||
271 | - | func by (ai,ah) = { | |
272 | - | let be = valueOrErrorMessage(getString(ai, ah), ("No value for key " + ah)) | |
273 | - | be | |
274 | - | } | |
275 | - | ||
276 | - | ||
277 | - | func bz (ai,ah) = { | |
278 | - | let be = valueOrErrorMessage(getInteger(ai, ah), ("No value for key " + ah)) | |
279 | - | be | |
280 | - | } | |
281 | - | ||
282 | - | ||
283 | - | func bA () = bu(d) | |
284 | - | ||
285 | - | ||
286 | - | func bB () = bu(o) | |
287 | - | ||
288 | - | ||
289 | - | func bC () = bu(q) | |
290 | - | ||
291 | - | ||
292 | - | func bD () = bu(I) | |
293 | - | ||
294 | - | ||
295 | - | func bE () = bu(J) | |
296 | - | ||
297 | - | ||
298 | - | func bF () = bw(K, aI) | |
299 | - | ||
300 | - | ||
301 | - | func bG () = bw(L, aI) | |
302 | - | ||
303 | - | ||
304 | - | func bH () = bu(M) | |
305 | - | ||
306 | - | ||
307 | - | func bI () = bu(P) | |
308 | - | ||
309 | - | ||
310 | - | func bJ () = bu(Q) | |
311 | - | ||
312 | - | ||
313 | - | func bK () = bu(R) | |
314 | - | ||
315 | - | ||
316 | - | func bL () = bu(F) | |
317 | - | ||
318 | - | ||
319 | - | func bM () = bu(p) | |
320 | - | ||
321 | - | ||
322 | - | func bN () = (bM() * aI) | |
323 | - | ||
324 | - | ||
325 | - | func bO () = (bM() * aG) | |
326 | - | ||
327 | - | ||
328 | - | func bP () = bu(r) | |
329 | - | ||
330 | - | ||
331 | - | func bQ () = bu(s) | |
332 | - | ||
333 | - | ||
334 | - | func bR () = bu(t) | |
335 | - | ||
336 | - | ||
337 | - | func bS () = bu(u) | |
338 | - | ||
339 | - | ||
340 | - | func bT () = bu(v) | |
341 | - | ||
342 | - | ||
343 | - | func bU () = bu(w) | |
344 | - | ||
345 | - | ||
346 | - | func bV () = bu(x) | |
347 | - | ||
348 | - | ||
349 | - | func bW () = bu(D) | |
350 | - | ||
351 | - | ||
352 | - | func bX () = bu(E) | |
353 | - | ||
354 | - | ||
355 | - | func bY () = bu(O) | |
356 | - | ||
357 | - | ||
358 | - | func bZ () = bu(N) | |
359 | - | ||
360 | - | ||
361 | - | func ca () = bw(e, 0) | |
362 | - | ||
363 | - | ||
364 | - | func cb (cc) = valueOrElse(getString(ar(), "k_sender"), toString(cc.caller)) | |
365 | - | ||
366 | - | ||
367 | - | func cd (ce,cf,cg) = { | |
368 | - | let ch = (ce - cf) | |
369 | - | if (if (cg) | |
370 | - | then (0 > ch) | |
253 | + | let bp = dropRight(bh, 1) | |
254 | + | let bq = if ((take(bp, 1) == ",")) | |
255 | + | then drop(bp, 1) | |
256 | + | else bp | |
257 | + | bq | |
258 | + | } | |
259 | + | ||
260 | + | ||
261 | + | func br (bs) = split(bs, ",") | |
262 | + | ||
263 | + | ||
264 | + | func bt (bd,bu,bv) = if ((size(bd) > bu)) | |
265 | + | then (removeByIndex(bd, 0) :+ bv) | |
266 | + | else (bd :+ bv) | |
267 | + | ||
268 | + | ||
269 | + | func bw (bx) = valueOrErrorMessage(getInteger(this, bx), ("no value for " + bx)) | |
270 | + | ||
271 | + | ||
272 | + | func by (bx,bz) = valueOrElse(getInteger(this, bx), bz) | |
273 | + | ||
274 | + | ||
275 | + | func bA (ak,aj) = { | |
276 | + | let bg = valueOrErrorMessage(getString(ak, aj), ("No value for key " + aj)) | |
277 | + | bg | |
278 | + | } | |
279 | + | ||
280 | + | ||
281 | + | func bB (ak,aj) = { | |
282 | + | let bg = valueOrErrorMessage(getInteger(ak, aj), ("No value for key " + aj)) | |
283 | + | bg | |
284 | + | } | |
285 | + | ||
286 | + | ||
287 | + | func bC () = bw(d) | |
288 | + | ||
289 | + | ||
290 | + | func bD () = bw(o) | |
291 | + | ||
292 | + | ||
293 | + | func bE () = bw(q) | |
294 | + | ||
295 | + | ||
296 | + | func bF () = bw(K) | |
297 | + | ||
298 | + | ||
299 | + | func bG () = bw(L) | |
300 | + | ||
301 | + | ||
302 | + | func bH () = by(M, aK) | |
303 | + | ||
304 | + | ||
305 | + | func bI () = by(N, aK) | |
306 | + | ||
307 | + | ||
308 | + | func bJ () = bw(O) | |
309 | + | ||
310 | + | ||
311 | + | func bK () = bw(R) | |
312 | + | ||
313 | + | ||
314 | + | func bL () = bw(S) | |
315 | + | ||
316 | + | ||
317 | + | func bM () = bw(T) | |
318 | + | ||
319 | + | ||
320 | + | func bN () = bw(H) | |
321 | + | ||
322 | + | ||
323 | + | func bO () = bw(p) | |
324 | + | ||
325 | + | ||
326 | + | func bP () = (bO() * aK) | |
327 | + | ||
328 | + | ||
329 | + | func bQ () = (bO() * aI) | |
330 | + | ||
331 | + | ||
332 | + | func bR () = bw(r) | |
333 | + | ||
334 | + | ||
335 | + | func bS () = bw(s) | |
336 | + | ||
337 | + | ||
338 | + | func bT () = bw(t) | |
339 | + | ||
340 | + | ||
341 | + | func bU () = bw(u) | |
342 | + | ||
343 | + | ||
344 | + | func bV () = bw(v) | |
345 | + | ||
346 | + | ||
347 | + | func bW () = bw(w) | |
348 | + | ||
349 | + | ||
350 | + | func bX () = bw(x) | |
351 | + | ||
352 | + | ||
353 | + | func bY () = bw(F) | |
354 | + | ||
355 | + | ||
356 | + | func bZ () = bw(G) | |
357 | + | ||
358 | + | ||
359 | + | func ca () = bw(Q) | |
360 | + | ||
361 | + | ||
362 | + | func cb () = bw(P) | |
363 | + | ||
364 | + | ||
365 | + | func cc () = by(e, 0) | |
366 | + | ||
367 | + | ||
368 | + | func cd () = bw(y) | |
369 | + | ||
370 | + | ||
371 | + | func ce () = bw(z) | |
372 | + | ||
373 | + | ||
374 | + | func cf (cg) = valueOrElse(getString(at(), "k_sender"), toString(cg.caller)) | |
375 | + | ||
376 | + | ||
377 | + | func ch (ci,cj,ck) = { | |
378 | + | let cl = (ci - cj) | |
379 | + | if (if (ck) | |
380 | + | then (0 > cl) | |
371 | 381 | else false) | |
372 | 382 | then throw("Invalid margin") | |
373 | - | else if (if (!( | |
374 | - | then ( | |
383 | + | else if (if (!(ck)) | |
384 | + | then (cl >= 0) | |
375 | 385 | else false) | |
376 | 386 | then throw("Invalid margin") | |
377 | 387 | else true | |
378 | 388 | } | |
379 | 389 | ||
380 | 390 | ||
381 | - | func | |
391 | + | func cm (cn) = if ((cn == 0)) | |
382 | 392 | then throw("Should not be called with _positionSize == 0") | |
383 | - | else if (( | |
384 | - | then | |
385 | - | else | |
386 | - | ||
387 | - | ||
388 | - | func | |
389 | - | let | |
390 | - | let | |
391 | - | if ($isInstanceOf( | |
393 | + | else if ((cn > 0)) | |
394 | + | then bY() | |
395 | + | else bZ() | |
396 | + | ||
397 | + | ||
398 | + | func co (cp) = { | |
399 | + | let cq = getInteger(this, ai(f, cp)) | |
400 | + | let cr = cq | |
401 | + | if ($isInstanceOf(cr, "Int")) | |
392 | 402 | then { | |
393 | - | let | |
394 | - | $Tuple4( | |
403 | + | let cs = cr | |
404 | + | $Tuple4(cs, getIntegerValue(this, ai(g, cp)), getIntegerValue(this, ai(h, cp)), getIntegerValue(this, ai(i, cp))) | |
395 | 405 | } | |
396 | 406 | else $Tuple4(0, 0, 0, 0) | |
397 | 407 | } | |
398 | 408 | ||
399 | 409 | ||
400 | - | func | |
401 | - | let | |
402 | - | let | |
403 | - | if ($isInstanceOf( | |
410 | + | func ct (cp) = { | |
411 | + | let cu = getString(this, ai(k, cp)) | |
412 | + | let cr = cu | |
413 | + | if ($isInstanceOf(cr, "String")) | |
404 | 414 | then { | |
405 | - | let | |
406 | - | | |
407 | - | } | |
408 | - | else toBase58String( | |
409 | - | } | |
410 | - | ||
411 | - | ||
412 | - | func | |
415 | + | let cv = cr | |
416 | + | cv | |
417 | + | } | |
418 | + | else toBase58String(ao()) | |
419 | + | } | |
420 | + | ||
421 | + | ||
422 | + | func cw (cp) = if ((co(cp)._1 == 0)) | |
413 | 423 | then throw("No open position") | |
414 | 424 | else true | |
415 | 425 | ||
416 | 426 | ||
417 | - | func | |
418 | - | ||
419 | - | ||
420 | - | func | |
421 | - | ||
422 | - | ||
423 | - | func | |
424 | - | ||
425 | - | ||
426 | - | func | |
427 | + | func cx () = valueOrElse(getBoolean(this, l), false) | |
428 | + | ||
429 | + | ||
430 | + | func cy () = valueOrElse(getBoolean(this, m), false) | |
431 | + | ||
432 | + | ||
433 | + | func cz () = valueOrElse(getBoolean(this, n), false) | |
434 | + | ||
435 | + | ||
436 | + | func cA (cB,cC,cD) = if (cB) | |
427 | 437 | then { | |
428 | - | let | |
429 | - | if ((0 >= | |
438 | + | let cE = (bG() - cD) | |
439 | + | if ((0 >= cE)) | |
430 | 440 | then throw("Tx lead to base asset reserve <= 0, revert") | |
431 | - | else $Tuple3(( | |
441 | + | else $Tuple3((bF() + cC), cE, (bJ() + cD)) | |
432 | 442 | } | |
433 | 443 | else { | |
434 | - | let | |
435 | - | if ((0 >= | |
444 | + | let cF = (bF() - cC) | |
445 | + | if ((0 >= cF)) | |
436 | 446 | then throw("Tx lead to base quote reserve <= 0, revert") | |
437 | - | else $Tuple3( | |
447 | + | else $Tuple3(cF, (bG() + cD), (bJ() - cD)) | |
438 | 448 | } | |
439 | 449 | ||
440 | 450 | ||
441 | - | func | |
442 | - | let | |
443 | - | let | |
444 | - | let | |
445 | - | let | |
446 | - | | |
447 | - | } | |
448 | - | ||
449 | - | ||
450 | - | func | |
451 | - | let | |
452 | - | let | |
453 | - | let | |
454 | - | let | |
455 | - | let | |
456 | - | let | |
457 | - | then ( | |
458 | - | else ( | |
459 | - | let | |
460 | - | let | |
461 | - | let | |
462 | - | then | |
463 | - | else -( | |
464 | - | let | |
465 | - | let | |
466 | - | let | |
467 | - | let | |
468 | - | let | |
469 | - | let | |
470 | - | let | |
471 | - | let | |
472 | - | let | |
473 | - | if (( | |
474 | - | then throw(((((((((((((("Price impact " + toString( | |
475 | - | else $Tuple4( | |
476 | - | } | |
477 | - | ||
478 | - | ||
479 | - | func | |
480 | - | let | |
451 | + | func cG (cH,cI,cJ,cK) = { | |
452 | + | let cL = toBigInt(cH) | |
453 | + | let cM = toBigInt(cI) | |
454 | + | let cN = toBigInt(cJ) | |
455 | + | let cO = toBigInt(cK) | |
456 | + | aX(aX(cL, cM), aX(cN, cO)) | |
457 | + | } | |
458 | + | ||
459 | + | ||
460 | + | func cP (cB,cC) = { | |
461 | + | let cH = bF() | |
462 | + | let cJ = bG() | |
463 | + | let cI = bH() | |
464 | + | let cK = bI() | |
465 | + | let bx = cG(cH, cI, cJ, cK) | |
466 | + | let cQ = if (cB) | |
467 | + | then (cH + cC) | |
468 | + | else (cH - cC) | |
469 | + | let cR = toInt(aW(bx, toBigInt(aT(cQ, cI)))) | |
470 | + | let cS = aR(ba((cR - cJ)), cI) | |
471 | + | let cT = if (cB) | |
472 | + | then cS | |
473 | + | else -(cS) | |
474 | + | let cU = cA(cB, cC, cS) | |
475 | + | let cV = cU._1 | |
476 | + | let cW = cU._2 | |
477 | + | let cX = cU._3 | |
478 | + | let cY = aR(aT(cH, cI), aT(cJ, cK)) | |
479 | + | let cZ = aR(cC, cS) | |
480 | + | let da = ba((cY - cZ)) | |
481 | + | let db = (aK - aR(cY, (cY + da))) | |
482 | + | let dc = bV() | |
483 | + | if ((db > dc)) | |
484 | + | then throw(((((((((((((("Price impact " + toString(db)) + " > max price impact ") + toString(dc)) + " before quote asset: ") + toString(cH)) + " before base asset: ") + toString(cJ)) + " quote asset amount to exchange: ") + toString(cC)) + " price before: ") + toString(cY)) + " marketPrice: ") + toString(cZ))) | |
485 | + | else $Tuple4(cT, cV, cW, cX) | |
486 | + | } | |
487 | + | ||
488 | + | ||
489 | + | func dd (de,df,dg,dh) = { | |
490 | + | let di = if ((de != 0)) | |
481 | 491 | then { | |
482 | - | let | |
483 | - | | |
492 | + | let dj = cm(de) | |
493 | + | aT((dj - dg), de) | |
484 | 494 | } | |
485 | 495 | else 0 | |
486 | - | let | |
487 | - | let | |
488 | - | then $Tuple2(0, | |
489 | - | else $Tuple2( | |
490 | - | let | |
491 | - | let | |
492 | - | $Tuple3( | |
493 | - | } | |
494 | - | ||
495 | - | ||
496 | - | func | |
497 | - | let | |
498 | - | if (( | |
496 | + | let dk = ((dh - di) + df) | |
497 | + | let dl = if ((0 > dk)) | |
498 | + | then $Tuple2(0, ba(dk)) | |
499 | + | else $Tuple2(ba(dk), 0) | |
500 | + | let dm = dl._1 | |
501 | + | let dn = dl._2 | |
502 | + | $Tuple3(dm, dn, di) | |
503 | + | } | |
504 | + | ||
505 | + | ||
506 | + | func do (cB,cD,dp,dq,dr,ds,dt) = { | |
507 | + | let cY = aR(aT(dq, dr), aT(ds, dt)) | |
508 | + | if ((cD == 0)) | |
499 | 509 | then throw("Invalid base asset amount") | |
500 | 510 | else { | |
501 | - | let | |
502 | - | let | |
503 | - | then ( | |
504 | - | else ( | |
505 | - | let | |
506 | - | let | |
507 | - | let | |
508 | - | let | |
509 | - | let | |
510 | - | let | |
511 | - | let | |
512 | - | let | |
513 | - | let | |
514 | - | let | |
515 | - | if (if (( | |
516 | - | then | |
511 | + | let bx = cG(dq, dr, ds, dt) | |
512 | + | let du = if (cB) | |
513 | + | then (ds + cD) | |
514 | + | else (ds - cD) | |
515 | + | let dv = toInt(aW(bx, toBigInt(aT(du, dt)))) | |
516 | + | let dw = ba((dv - aT(dq, dr))) | |
517 | + | let dc = bV() | |
518 | + | let dx = cA(!(cB), dw, cD) | |
519 | + | let cV = dx._1 | |
520 | + | let cW = dx._2 | |
521 | + | let cX = dx._3 | |
522 | + | let cZ = aR(dw, cD) | |
523 | + | let da = ba((cY - cZ)) | |
524 | + | let db = (aK - aR(cY, (cY + da))) | |
525 | + | if (if ((db > dc)) | |
526 | + | then dp | |
517 | 527 | else false) | |
518 | - | then throw(((((((((((((("Price impact " + toString(cX)) + " > max price impact ") + toString(cY)) + " before quote asset: ") + toString(dm)) + " before base asset: ") + toString(do)) + " base asset amount to exchange: ") + toString(cz)) + " price before: ") + toString(cU)) + " market price: ") + toString(cV))) | |
519 | - | else $Tuple7(ds, cR, cS, cT, (bZ() - (if (cx) | |
520 | - | then aY(cz) | |
521 | - | else 0)), (bY() - (if (!(cx)) | |
522 | - | then aY(cz) | |
523 | - | else 0)), cX) | |
524 | - | } | |
525 | - | } | |
526 | - | ||
527 | - | ||
528 | - | func du (cx,cz,dl) = dk(cx, cz, dl, bD(), bF(), bE(), bG()) | |
529 | - | ||
530 | - | ||
531 | - | func dv () = { | |
532 | - | let dw = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
533 | - | let dx = getStringValue(this, a) | |
534 | - | let dy = getStringValue(this, b) | |
535 | - | let dz = valueOrErrorMessage(getInteger(dw, dx), ((("Can not get oracle price. Oracle: " + toString(dw)) + " key: ") + dx)) | |
536 | - | dz | |
537 | - | } | |
538 | - | ||
539 | - | ||
540 | - | func dA (dm,do) = { | |
541 | - | let dB = dv() | |
542 | - | let dC = aP(dm, do) | |
543 | - | let dD = aP((dB + dC), (2 * aI)) | |
544 | - | let dE = aP(aY((dB - dC)), dD) | |
545 | - | if ((dE > bU())) | |
546 | - | then throw(((("Price spread " + toString(dE)) + " > max price spread ") + toString(bU()))) | |
528 | + | then throw(((((((((((((("Price impact " + toString(db)) + " > max price impact ") + toString(dc)) + " before quote asset: ") + toString(dq)) + " before base asset: ") + toString(ds)) + " base asset amount to exchange: ") + toString(cD)) + " price before: ") + toString(cY)) + " market price: ") + toString(cZ))) | |
529 | + | else $Tuple7(dw, cV, cW, cX, (cb() - (if (cB) | |
530 | + | then ba(cD) | |
531 | + | else 0)), (ca() - (if (!(cB)) | |
532 | + | then ba(cD) | |
533 | + | else 0)), db) | |
534 | + | } | |
535 | + | } | |
536 | + | ||
537 | + | ||
538 | + | func dy (cB,cD,dp) = do(cB, cD, dp, bF(), bH(), bG(), bI()) | |
539 | + | ||
540 | + | ||
541 | + | func dz () = { | |
542 | + | let dA = valueOrErrorMessage(addressFromString(getStringValue(this, c)), "") | |
543 | + | let dB = getStringValue(this, a) | |
544 | + | let dC = valueOrErrorMessage(getInteger(dA, dB), ((("Can not get oracle price. Oracle: " + toString(dA)) + " key: ") + dB)) | |
545 | + | let dD = valueOrElse(getString(this, b), "") | |
546 | + | if ((dD != "")) | |
547 | + | then { | |
548 | + | let dE = lastBlock.height | |
549 | + | let dF = valueOrErrorMessage(getInteger(dA, b), ((("Can not get oracle block. Oracle: " + toString(dA)) + " key: ") + dD)) | |
550 | + | if (((dE - dF) > ce())) | |
551 | + | then throw(((("Oracle stale data. Last oracle block: " + toString(dF)) + " current block: ") + toString(dE))) | |
552 | + | else dC | |
553 | + | } | |
554 | + | else dC | |
555 | + | } | |
556 | + | ||
557 | + | ||
558 | + | func dG (dq,ds) = { | |
559 | + | let dH = dz() | |
560 | + | let cI = bH() | |
561 | + | let cK = bI() | |
562 | + | let dI = aR(aT(dq, cI), aT(ds, cK)) | |
563 | + | let dJ = aR((dH + dI), (2 * aK)) | |
564 | + | let dK = aR(ba((dH - dI)), dJ) | |
565 | + | if ((dK > bW())) | |
566 | + | then throw(((("Price spread " + toString(dK)) + " > max price spread ") + toString(bW()))) | |
547 | 567 | else true | |
548 | 568 | } | |
549 | 569 | ||
550 | 570 | ||
551 | - | func | |
552 | - | let | |
553 | - | if (( | |
554 | - | then throw(((("Long open notional " + toString( | |
555 | - | else if (( | |
556 | - | then throw(((("Short open notional " + toString( | |
571 | + | func dL (dM,dN) = { | |
572 | + | let dO = bX() | |
573 | + | if ((dM > dO)) | |
574 | + | then throw(((("Long open notional " + toString(dM)) + " > max open notional ") + toString(dO))) | |
575 | + | else if ((dN > dO)) | |
576 | + | then throw(((("Short open notional " + toString(dN)) + " > max open notional ") + toString(dO))) | |
557 | 577 | else true | |
558 | 578 | } | |
559 | 579 | ||
560 | 580 | ||
561 | - | func | |
562 | - | let | |
563 | - | let | |
564 | - | let | |
565 | - | let | |
566 | - | | |
567 | - | } | |
568 | - | ||
569 | - | ||
570 | - | func | |
571 | - | let | |
572 | - | let | |
573 | - | ( | |
574 | - | } | |
575 | - | ||
576 | - | ||
577 | - | func | |
578 | - | let | |
579 | - | let | |
580 | - | let | |
581 | + | func dP () = { | |
582 | + | let dq = bF() | |
583 | + | let ds = bG() | |
584 | + | let cI = bH() | |
585 | + | let cK = bI() | |
586 | + | aR(aT(dq, cI), aT(ds, cK)) | |
587 | + | } | |
588 | + | ||
589 | + | ||
590 | + | func dQ () = { | |
591 | + | let dH = dz() | |
592 | + | let dR = dP() | |
593 | + | (aR(ba((dH - dR)), dH) > bU()) | |
594 | + | } | |
595 | + | ||
596 | + | ||
597 | + | func dS (cn,dT,dq,dr,ds,dt) = { | |
598 | + | let dU = ba(cn) | |
599 | + | let dV = (0 > cn) | |
600 | + | let dW = if ((dT == aN)) | |
581 | 601 | then { | |
582 | - | let | |
583 | - | let | |
584 | - | let | |
585 | - | let | |
586 | - | let | |
587 | - | | |
588 | - | } | |
589 | - | else | |
590 | - | | |
591 | - | } | |
592 | - | ||
593 | - | ||
594 | - | func | |
602 | + | let dX = do(!(dV), dU, false, dq, dr, ds, dt) | |
603 | + | let dY = dX._1 | |
604 | + | let dZ = dX._2 | |
605 | + | let ea = dX._3 | |
606 | + | let eb = dX._4 | |
607 | + | dY | |
608 | + | } | |
609 | + | else aT(dU, dz()) | |
610 | + | dW | |
611 | + | } | |
612 | + | ||
613 | + | ||
614 | + | func ec (cn,ed,dq,dr,ds,dt,dT) = if ((cn == 0)) | |
595 | 615 | then throw("Invalid position size") | |
596 | 616 | else { | |
597 | - | let | |
598 | - | let | |
599 | - | let | |
600 | - | then ( | |
601 | - | else ( | |
602 | - | $Tuple2( | |
617 | + | let dV = (0 > cn) | |
618 | + | let dW = dS(cn, dT, dq, dr, ds, dt) | |
619 | + | let ee = if (dV) | |
620 | + | then (ed - dW) | |
621 | + | else (dW - ed) | |
622 | + | $Tuple2(dW, ee) | |
603 | 623 | } | |
604 | 624 | ||
605 | 625 | ||
606 | - | func | |
607 | - | let | |
608 | - | let | |
609 | - | let | |
610 | - | let | |
611 | - | let | |
612 | - | | |
613 | - | } | |
614 | - | ||
615 | - | ||
616 | - | func | |
617 | - | ||
618 | - | ||
619 | - | func | |
620 | - | let | |
621 | - | let | |
622 | - | let | |
623 | - | let | |
624 | - | let | |
625 | - | let | |
626 | - | let | |
627 | - | let | |
628 | - | let | |
629 | - | let | |
630 | - | let | |
631 | - | | |
632 | - | } | |
633 | - | ||
634 | - | ||
635 | - | func | |
636 | - | ||
637 | - | ||
638 | - | func | |
639 | - | let | |
640 | - | let | |
641 | - | let | |
642 | - | let | |
643 | - | let | |
644 | - | if (( | |
645 | - | then | |
626 | + | func ef (cp,dT) = { | |
627 | + | let eg = co(cp) | |
628 | + | let cs = eg._1 | |
629 | + | let eh = eg._2 | |
630 | + | let ei = eg._3 | |
631 | + | let ej = eg._4 | |
632 | + | ec(cs, ei, bF(), bH(), bG(), bI(), dT) | |
633 | + | } | |
634 | + | ||
635 | + | ||
636 | + | func ek (el,em,en) = aR((el - em), en) | |
637 | + | ||
638 | + | ||
639 | + | func eo (cp,dT) = { | |
640 | + | let ep = co(cp) | |
641 | + | let cs = ep._1 | |
642 | + | let eh = ep._2 | |
643 | + | let eq = ep._3 | |
644 | + | let ej = ep._4 | |
645 | + | let er = ef(cp, dT) | |
646 | + | let dW = er._1 | |
647 | + | let ee = er._2 | |
648 | + | let es = dd(cs, eh, ej, ee) | |
649 | + | let dm = es._1 | |
650 | + | let dn = es._2 | |
651 | + | ek(dm, dn, dW) | |
652 | + | } | |
653 | + | ||
654 | + | ||
655 | + | func et (cp) = eo(cp, aN) | |
656 | + | ||
657 | + | ||
658 | + | func eu (cp,cn) = { | |
659 | + | let ev = bb(bT(), (aK - aR(et(cp), bR()))) | |
660 | + | let ew = aT(ba(cn), ev) | |
661 | + | let ex = dy((cn > 0), ew, false) | |
662 | + | let ey = ex._1 | |
663 | + | let db = ex._7 | |
664 | + | if ((bV() > db)) | |
665 | + | then ey | |
646 | 666 | else { | |
647 | - | let | |
648 | - | let | |
649 | - | | |
650 | - | } | |
651 | - | } | |
652 | - | ||
653 | - | ||
654 | - | func | |
655 | - | let | |
656 | - | let | |
657 | - | let | |
658 | - | let | |
659 | - | let | |
660 | - | let | |
661 | - | let | |
662 | - | let | |
663 | - | let | |
664 | - | let | |
665 | - | let | |
666 | - | let | |
667 | - | let | |
668 | - | let | |
669 | - | let | |
670 | - | let | |
671 | - | let | |
672 | - | let | |
673 | - | let | |
674 | - | let | |
675 | - | $Tuple13( | |
676 | - | then | |
677 | - | else 0)), ( | |
678 | - | then | |
667 | + | let ez = aT(ba(cn), bT()) | |
668 | + | let eA = dy((cn > 0), ez, false)._1 | |
669 | + | eA | |
670 | + | } | |
671 | + | } | |
672 | + | ||
673 | + | ||
674 | + | func eB (cp,dp) = { | |
675 | + | let eC = co(cp) | |
676 | + | let cs = eC._1 | |
677 | + | let eh = eC._2 | |
678 | + | let ei = eC._3 | |
679 | + | let ej = eC._4 | |
680 | + | let ee = ef(cp, aN)._2 | |
681 | + | let eD = dd(cs, eh, ej, ee) | |
682 | + | let dm = eD._1 | |
683 | + | let dn = eD._2 | |
684 | + | let ez = -(cs) | |
685 | + | let eE = ee | |
686 | + | let eF = -(dm) | |
687 | + | let eG = dy((cs > 0), ba(cs), dp) | |
688 | + | let eA = eG._1 | |
689 | + | let cQ = eG._2 | |
690 | + | let cR = eG._3 | |
691 | + | let eH = eG._4 | |
692 | + | let eI = eG._5 | |
693 | + | let eJ = eG._6 | |
694 | + | let eK = (bK() - ei) | |
695 | + | $Tuple13(ez, dn, eE, eF, cQ, cR, eH, eK, eA, eI, eJ, (bM() - (if ((cs > 0)) | |
696 | + | then ei | |
697 | + | else 0)), (bL() - (if ((0 > cs)) | |
698 | + | then ei | |
679 | 699 | else 0))) | |
680 | 700 | } | |
681 | 701 | ||
682 | 702 | ||
683 | - | func | |
684 | - | let | |
685 | - | let | |
686 | - | let | |
687 | - | let | |
688 | - | func | |
689 | - | then ( | |
690 | - | else | |
691 | - | ||
692 | - | let | |
693 | - | let | |
694 | - | let | |
695 | - | let | |
696 | - | func | |
697 | - | then | |
698 | - | else | |
699 | - | ||
700 | - | func | |
701 | - | then | |
703 | + | func eL () = { | |
704 | + | let eM = ((lastBlock.timestamp / 1000) / 60) | |
705 | + | let eN = (eM - aG) | |
706 | + | let eO = valueOrElse(getString(this, A), "") | |
707 | + | let eP = split(eO, ",") | |
708 | + | func eQ (bf,eR) = if ((eN >= parseIntValue(eR))) | |
709 | + | then (bf :+ parseIntValue(eR)) | |
710 | + | else bf | |
711 | + | ||
712 | + | let eS = { | |
713 | + | let bi = eP | |
714 | + | let bj = size(bi) | |
715 | + | let bk = nil | |
716 | + | func bl (bm,bn) = if ((bn >= bj)) | |
717 | + | then bm | |
718 | + | else eQ(bm, bi[bn]) | |
719 | + | ||
720 | + | func bo (bm,bn) = if ((bn >= bj)) | |
721 | + | then bm | |
702 | 722 | else throw("List size exceeds 20") | |
703 | 723 | ||
704 | - | | |
724 | + | bo(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bl(bk, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20) | |
705 | 725 | } | |
706 | - | let | |
707 | - | then max( | |
708 | - | else parseIntValue( | |
709 | - | let | |
710 | - | let | |
711 | - | let | |
712 | - | let | |
713 | - | let | |
714 | - | let | |
715 | - | let | |
716 | - | (( | |
717 | - | } | |
718 | - | ||
719 | - | ||
720 | - | func | |
721 | - | let | |
722 | - | if (( | |
723 | - | then $Tuple2( | |
726 | + | let eT = if ((size(eS) > 0)) | |
727 | + | then max(eS) | |
728 | + | else parseIntValue(eP[0]) | |
729 | + | let eU = valueOrElse(getInteger(this, B), 0) | |
730 | + | let eV = valueOrElse(getInteger(this, ((C + "_") + toString(eU))), 0) | |
731 | + | let eW = valueOrElse(getInteger(this, ((D + "_") + toString(eU))), 0) | |
732 | + | let eX = (eV + ((eM - eU) * eW)) | |
733 | + | let eY = valueOrElse(getInteger(this, ((C + "_") + toString(eT))), 0) | |
734 | + | let eZ = valueOrElse(getInteger(this, ((D + "_") + toString(eT))), 0) | |
735 | + | let fa = (eY + ((eN - eT) * eZ)) | |
736 | + | ((eX - fa) / aG) | |
737 | + | } | |
738 | + | ||
739 | + | ||
740 | + | func fb () = { | |
741 | + | let cn = bJ() | |
742 | + | if ((cn == 0)) | |
743 | + | then $Tuple2(bF(), bG()) | |
724 | 744 | else { | |
725 | - | let | |
726 | - | let | |
727 | - | let | |
728 | - | let | |
729 | - | let | |
730 | - | $Tuple2( | |
731 | - | } | |
732 | - | } | |
733 | - | ||
734 | - | ||
735 | - | func | |
736 | - | let | |
737 | - | let | |
738 | - | let | |
739 | - | let | |
740 | - | let | |
741 | - | let | |
742 | - | let | |
743 | - | let | |
744 | - | let | |
745 | - | let | |
746 | - | let | |
747 | - | let | |
748 | - | let | |
749 | - | toInt( | |
750 | - | } | |
751 | - | ||
752 | - | ||
753 | - | func | |
754 | - | let | |
755 | - | if (( | |
745 | + | let fc = (cn > 0) | |
746 | + | let fd = dy(fc, ba(cn), false) | |
747 | + | let fe = fd._1 | |
748 | + | let ff = fd._2 | |
749 | + | let fg = fd._3 | |
750 | + | $Tuple2(ff, fg) | |
751 | + | } | |
752 | + | } | |
753 | + | ||
754 | + | ||
755 | + | func fh (fi,bJ,fj,fk) = { | |
756 | + | let fl = toBigInt(fi) | |
757 | + | let fm = toBigInt(bJ) | |
758 | + | let fn = toBigInt(fj) | |
759 | + | let fo = toBigInt(fk) | |
760 | + | let fp = aZ((fl + fm), toBigInt((2 * aK))) | |
761 | + | let fq = aX(fn, fp) | |
762 | + | let fr = (toBigInt(4) * aX(fo, fm)) | |
763 | + | let fs = aY(aX(fq, (fn - fr))) | |
764 | + | let ft = aX(fl, fn) | |
765 | + | let fu = aX(fn, fm) | |
766 | + | let fv = ((-(fs) + ft) + fu) | |
767 | + | let fw = (toBigInt(2) * aX(fn, fm)) | |
768 | + | let fx = aW(fv, fw) | |
769 | + | toInt(fx) | |
770 | + | } | |
771 | + | ||
772 | + | ||
773 | + | func fy (fz) = { | |
774 | + | let cn = bJ() | |
775 | + | if ((cn == 0)) | |
756 | 776 | then { | |
757 | - | let | |
758 | - | let | |
759 | - | let | |
760 | - | $Tuple3( | |
777 | + | let cH = bF() | |
778 | + | let cJ = bG() | |
779 | + | let fA = aR(aT(fz, cJ), cH) | |
780 | + | $Tuple3(fA, aK, 0) | |
761 | 781 | } | |
762 | 782 | else { | |
763 | - | let | |
764 | - | let | |
765 | - | let | |
766 | - | let | |
767 | - | let | |
768 | - | let | |
769 | - | let | |
770 | - | $Tuple3( | |
771 | - | } | |
772 | - | } | |
773 | - | ||
774 | - | ||
775 | - | func | |
776 | - | let | |
777 | - | let | |
778 | - | let | |
779 | - | if (if (( | |
783 | + | let fc = (cn > 0) | |
784 | + | let fe = dy(fc, ba(cn), false)._1 | |
785 | + | let cH = bF() | |
786 | + | let cJ = bG() | |
787 | + | let fA = fh(cJ, cn, cH, fz) | |
788 | + | let fB = aK | |
789 | + | let eF = ec(cn, fe, cH, fA, cJ, fB, aN)._2 | |
790 | + | $Tuple3(fA, fB, eF) | |
791 | + | } | |
792 | + | } | |
793 | + | ||
794 | + | ||
795 | + | func fC () = { | |
796 | + | let fD = dz() | |
797 | + | let fE = eL() | |
798 | + | let fF = (fE - fD) | |
799 | + | if (if ((ca() == 0)) | |
780 | 800 | then true | |
781 | - | else ( | |
801 | + | else (cb() == 0)) | |
782 | 802 | then $Tuple2(0, 0) | |
783 | - | else if ((0 > | |
803 | + | else if ((0 > fF)) | |
784 | 804 | then { | |
785 | - | let | |
786 | - | let | |
787 | - | $Tuple2( | |
805 | + | let fG = aR(aT(fF, bP()), aL) | |
806 | + | let fH = aR(aT(fG, ca()), cb()) | |
807 | + | $Tuple2(fG, fH) | |
788 | 808 | } | |
789 | 809 | else { | |
790 | - | let | |
791 | - | let | |
792 | - | $Tuple2( | |
810 | + | let fH = aR(aT(fF, bP()), aL) | |
811 | + | let fG = aR(aT(fH, cb()), ca()) | |
812 | + | $Tuple2(fG, fH) | |
793 | 813 | } | |
794 | 814 | } | |
795 | 815 | ||
796 | 816 | ||
797 | - | func | |
798 | - | let | |
799 | - | let | |
800 | - | let | |
817 | + | func fI (fJ,fK) = { | |
818 | + | let fL = bD() | |
819 | + | let fM = aT(fL, fK) | |
820 | + | let fN = if ((fJ != "")) | |
801 | 821 | then { | |
802 | - | let | |
803 | - | if (( | |
822 | + | let fO = bA(av(), ai(aC, fJ)) | |
823 | + | if ((fO == aD)) | |
804 | 824 | then { | |
805 | - | let | |
806 | - | let | |
807 | - | $Tuple2( | |
825 | + | let fP = bB(av(), ai(aB, fJ)) | |
826 | + | let fQ = aT(fM, fP) | |
827 | + | $Tuple2(fQ, true) | |
808 | 828 | } | |
809 | 829 | else throw("Invalid attached artifact") | |
810 | 830 | } | |
811 | - | else $Tuple2(fG, false) | |
812 | - | let fK = fH._1 | |
813 | - | let fL = fH._2 | |
814 | - | $Tuple2(fK, fL) | |
815 | - | } | |
816 | - | ||
817 | - | ||
818 | - | func fM (fN,fO,fP,fQ,fR,fS,fT,fU,fV,dI) = [IntegerEntry(q, fN), IntegerEntry(r, fO), IntegerEntry(s, fP), IntegerEntry(p, fQ), IntegerEntry(o, fR), IntegerEntry(u, fS), IntegerEntry(v, fT), IntegerEntry(t, fU), IntegerEntry(w, fV), IntegerEntry(x, dI)] | |
819 | - | ||
820 | - | ||
821 | - | func fW (fX,fY,fZ,ga,gb) = [IntegerEntry(F, fX), IntegerEntry(D, fY), IntegerEntry(E, fZ), IntegerEntry(G, ga), IntegerEntry(H, gb)] | |
822 | - | ||
823 | - | ||
824 | - | func gc (ai,ay) = [StringEntry(ag(k, ai), ay)] | |
825 | - | ||
826 | - | ||
827 | - | func gd (ge,ai) = if (ge) | |
828 | - | then { | |
829 | - | let gf = ca() | |
830 | - | [IntegerEntry(ag(j, ai), (gf + 1)), IntegerEntry(e, (gf + 1))] | |
831 | - | } | |
832 | - | else nil | |
833 | - | ||
834 | - | ||
835 | - | func gg (ai,gh,gi,gj,df) = [IntegerEntry(ag(f, ai), gh), IntegerEntry(ag(g, ai), gi), IntegerEntry(ag(h, ai), gj), IntegerEntry(ag(i, ai), df)] | |
836 | - | ||
837 | - | ||
838 | - | func gk (gl) = { | |
839 | - | let eG = ((lastBlock.timestamp / 1000) / 60) | |
840 | - | let gm = valueOrElse(getInteger(this, z), 0) | |
841 | - | if ((gm > eG)) | |
842 | - | then throw("TWAP out-of-order") | |
831 | + | else $Tuple2(fM, false) | |
832 | + | let fQ = fN._1 | |
833 | + | let fR = fN._2 | |
834 | + | $Tuple2(fQ, fR) | |
835 | + | } | |
836 | + | ||
837 | + | ||
838 | + | func fS (cp,aA) = { | |
839 | + | let fT = co(cp)._1 | |
840 | + | if ((fT == 0)) | |
841 | + | then true | |
842 | + | else (ct(cp) == aA) | |
843 | + | } | |
844 | + | ||
845 | + | ||
846 | + | func fU (cp,aA) = (ct(cp) == aA) | |
847 | + | ||
848 | + | ||
849 | + | func fV (fW,aA,cp) = ((((((ah + "_") + fW) + "_") + aA) + "_") + cp) | |
850 | + | ||
851 | + | ||
852 | + | func fX (cp) = { | |
853 | + | let cv = ct(cp) | |
854 | + | if ((cv == toBase58String(ao()))) | |
855 | + | then $Tuple2(0, cv) | |
843 | 856 | else { | |
844 | - | let eO = if ((gm == 0)) | |
845 | - | then eG | |
846 | - | else gm | |
847 | - | if ((eG > gm)) | |
848 | - | then { | |
849 | - | let gn = valueOrElse(getInteger(this, ((A + "_") + toString(gm))), 0) | |
850 | - | let go = valueOrElse(getInteger(this, ((B + "_") + toString(gm))), gl) | |
851 | - | let gp = (gn + ((eG - eO) * go)) | |
852 | - | let eJ = br(bp(valueOrElse(getString(this, y), "")), aE, toString(eG)) | |
853 | - | [IntegerEntry(ag(A, toString(eG)), gp), IntegerEntry(ag(B, toString(eG)), gl), IntegerEntry(ag(C, toString(eG)), gm), IntegerEntry(z, eG), StringEntry(y, ba(eJ))] | |
854 | - | } | |
855 | - | else { | |
856 | - | let gq = valueOrElse(getInteger(this, ag(C, toString(eG))), 0) | |
857 | - | let gn = valueOrElse(getInteger(this, ag(A, toString(gq))), 0) | |
858 | - | let go = valueOrElse(getInteger(this, ag(B, toString(gq))), gl) | |
859 | - | let gp = (gn + ((eG - gq) * go)) | |
860 | - | [IntegerEntry(ag(A, toString(eG)), gp), IntegerEntry(ag(B, toString(eG)), gl)] | |
861 | - | } | |
862 | - | } | |
863 | - | } | |
864 | - | ||
865 | - | ||
866 | - | func gr (cD,cF) = [IntegerEntry(I, cD), IntegerEntry(J, cF)] | |
867 | - | ||
868 | - | ||
869 | - | func gs (cE,cG) = [IntegerEntry(K, cE), IntegerEntry(L, cG)] | |
870 | - | ||
871 | - | ||
872 | - | func gt (cD,cF,gu,gv,gw,gx,gy,gz) = { | |
873 | - | let cE = bF() | |
874 | - | let cG = bG() | |
875 | - | if (((gw - gx) != gu)) | |
876 | - | then throw(((((("Invalid AMM state data: " + toString(gw)) + " + ") + toString(gx)) + " != ") + toString(gu))) | |
877 | - | else ((gr(cD, cF) ++ [IntegerEntry(M, gu), IntegerEntry(P, gv), IntegerEntry(N, gw), IntegerEntry(O, gx), IntegerEntry(R, gy), IntegerEntry(Q, gz)]) ++ gk(aP(aR(cD, cE), aR(cF, cG)))) | |
878 | - | } | |
879 | - | ||
880 | - | ||
881 | - | func gA (ai) = [DeleteEntry(ag(f, ai)), DeleteEntry(ag(g, ai)), DeleteEntry(ag(h, ai)), DeleteEntry(ag(i, ai)), DeleteEntry(ag(k, ai))] | |
882 | - | ||
883 | - | ||
884 | - | func gB (ai,gC) = { | |
885 | - | let gD = assetBalance(this, am()) | |
886 | - | if ((gC > gD)) | |
887 | - | then throw(((("Unable to withdraw " + toString(gC)) + " from contract balance ") + toString(gD))) | |
888 | - | else [ScriptTransfer(ai, gC, am())] | |
889 | - | } | |
890 | - | ||
891 | - | ||
892 | - | func gE (cc) = if ((0 > cc)) | |
893 | - | then throw("Balance") | |
894 | - | else [IntegerEntry(d, cc)] | |
895 | - | ||
896 | - | ||
897 | - | func gF (cc) = [ScriptTransfer(ao(), cc, am())] | |
898 | - | ||
899 | - | ||
900 | - | func gG (gH,cc) = if (gH) | |
901 | - | then [Burn(valueOrErrorMessage(cc.payments[1].assetId, "Invalid artifact"), 1)] | |
902 | - | else nil | |
903 | - | ||
904 | - | ||
905 | - | func gI (cl,ay) = { | |
906 | - | let gJ = ck(cl)._1 | |
907 | - | if ((gJ == 0)) | |
908 | - | then true | |
909 | - | else (cp(cl) == ay) | |
910 | - | } | |
911 | - | ||
912 | - | ||
913 | - | func gK (cl,ay) = (cp(cl) == ay) | |
914 | - | ||
915 | - | ||
916 | - | func gL (gM,ay,cl) = ((((((af + "_") + gM) + "_") + ay) + "_") + cl) | |
917 | - | ||
918 | - | ||
919 | - | func gN (cl) = { | |
920 | - | let cr = cp(cl) | |
921 | - | if ((cr == toBase58String(am()))) | |
922 | - | then $Tuple2(0, cr) | |
923 | - | else { | |
924 | - | let gO = gL(toString(this), cr, cl) | |
925 | - | let gP = valueOrElse(getInteger(au(), gO), 0) | |
926 | - | $Tuple2(gP, cr) | |
927 | - | } | |
928 | - | } | |
929 | - | ||
930 | - | ||
931 | - | func gQ (cl,fD) = { | |
932 | - | let gR = invoke(aq(), "computeFeeDiscount", [cl], nil) | |
933 | - | if ((gR == gR)) | |
857 | + | let fY = fV(toString(this), cv, cp) | |
858 | + | let fZ = valueOrElse(getInteger(aw(), fY), 0) | |
859 | + | $Tuple2(fZ, cv) | |
860 | + | } | |
861 | + | } | |
862 | + | ||
863 | + | ||
864 | + | func ga (cp,fJ) = { | |
865 | + | let gb = invoke(as(), "computeFeeDiscount", [cp], nil) | |
866 | + | if ((gb == gb)) | |
934 | 867 | then { | |
935 | - | let | |
936 | - | let | |
937 | - | if ($isInstanceOf( | |
868 | + | let gc = { | |
869 | + | let cr = gb | |
870 | + | if ($isInstanceOf(cr, "Int")) | |
938 | 871 | then { | |
939 | - | let | |
940 | - | | |
872 | + | let gd = cr | |
873 | + | gd | |
941 | 874 | } | |
942 | 875 | else throw("Invalid computeFeeDiscount result") | |
943 | 876 | } | |
944 | - | let | |
945 | - | let | |
946 | - | let | |
947 | - | $Tuple2( | |
877 | + | let ge = fI(fJ, gc) | |
878 | + | let fQ = ge._1 | |
879 | + | let fR = ge._2 | |
880 | + | $Tuple2(fQ, fR) | |
948 | 881 | } | |
949 | 882 | else throw("Strict value is not equal to itself.") | |
950 | 883 | } | |
951 | 884 | ||
952 | 885 | ||
953 | - | func | |
954 | - | let | |
955 | - | then toBase58String(valueOrErrorMessage( | |
886 | + | func gf (cg) = { | |
887 | + | let gg = if ((size(cg.payments) > 1)) | |
888 | + | then toBase58String(valueOrErrorMessage(cg.payments[1].assetId, "Invalid artifactId")) | |
956 | 889 | else "" | |
957 | - | gW | |
958 | - | } | |
959 | - | ||
960 | - | ||
961 | - | @Callable(cc) | |
962 | - | func pause () = if ((cc.caller != ak())) | |
890 | + | gg | |
891 | + | } | |
892 | + | ||
893 | + | ||
894 | + | func gh (gi) = { | |
895 | + | let gj = aT(gi, cd()) | |
896 | + | let gk = (gi - gj) | |
897 | + | $Tuple2(gj, gk) | |
898 | + | } | |
899 | + | ||
900 | + | ||
901 | + | func gl (gm,gn,go,gp,gq,gr,gs,gt,gu,dO,gv,gw) = [IntegerEntry(q, gm), IntegerEntry(r, gn), IntegerEntry(s, go), IntegerEntry(p, gp), IntegerEntry(o, gq), IntegerEntry(u, gr), IntegerEntry(v, gs), IntegerEntry(t, gt), IntegerEntry(w, gu), IntegerEntry(x, dO), IntegerEntry(y, gv), IntegerEntry(z, gv)] | |
902 | + | ||
903 | + | ||
904 | + | func gx (gy,gz,gA,gB,gC) = [IntegerEntry(H, gy), IntegerEntry(F, gz), IntegerEntry(G, gA), IntegerEntry(I, gB), IntegerEntry(J, gC)] | |
905 | + | ||
906 | + | ||
907 | + | func gD (ak,aA) = [StringEntry(ai(k, ak), aA)] | |
908 | + | ||
909 | + | ||
910 | + | func gE (gF,ak) = if (gF) | |
911 | + | then { | |
912 | + | let gG = cc() | |
913 | + | [IntegerEntry(ai(j, ak), (gG + 1)), IntegerEntry(e, (gG + 1))] | |
914 | + | } | |
915 | + | else nil | |
916 | + | ||
917 | + | ||
918 | + | func gH (ak,gI,gJ,gK,dj) = [IntegerEntry(ai(f, ak), gI), IntegerEntry(ai(g, ak), gJ), IntegerEntry(ai(h, ak), gK), IntegerEntry(ai(i, ak), dj)] | |
919 | + | ||
920 | + | ||
921 | + | func gL (gM) = { | |
922 | + | let eM = ((lastBlock.timestamp / 1000) / 60) | |
923 | + | let gN = valueOrElse(getInteger(this, B), 0) | |
924 | + | if ((gN > eM)) | |
925 | + | then throw("TWAP out-of-order") | |
926 | + | else { | |
927 | + | let eU = if ((gN == 0)) | |
928 | + | then eM | |
929 | + | else gN | |
930 | + | if ((eM > gN)) | |
931 | + | then { | |
932 | + | let gO = valueOrElse(getInteger(this, ((C + "_") + toString(gN))), 0) | |
933 | + | let gP = valueOrElse(getInteger(this, ((D + "_") + toString(gN))), gM) | |
934 | + | let gQ = (gO + ((eM - eU) * gP)) | |
935 | + | let eP = bt(br(valueOrElse(getString(this, A), "")), aG, toString(eM)) | |
936 | + | [IntegerEntry(ai(C, toString(eM)), gQ), IntegerEntry(ai(D, toString(eM)), gM), IntegerEntry(ai(E, toString(eM)), gN), IntegerEntry(B, eM), StringEntry(A, bc(eP))] | |
937 | + | } | |
938 | + | else { | |
939 | + | let gR = valueOrElse(getInteger(this, ai(E, toString(eM))), 0) | |
940 | + | let gO = valueOrElse(getInteger(this, ai(C, toString(gR))), 0) | |
941 | + | let gP = valueOrElse(getInteger(this, ai(D, toString(gR))), gM) | |
942 | + | let gQ = (gO + ((eM - gR) * gP)) | |
943 | + | [IntegerEntry(ai(C, toString(eM)), gQ), IntegerEntry(ai(D, toString(eM)), gM)] | |
944 | + | } | |
945 | + | } | |
946 | + | } | |
947 | + | ||
948 | + | ||
949 | + | func gS (cH,cJ) = [IntegerEntry(K, cH), IntegerEntry(L, cJ)] | |
950 | + | ||
951 | + | ||
952 | + | func gT (cI,cK) = [IntegerEntry(M, cI), IntegerEntry(N, cK)] | |
953 | + | ||
954 | + | ||
955 | + | func gU (cH,cJ,gV,gW,gX,gY,gZ,ha) = { | |
956 | + | let cI = bH() | |
957 | + | let cK = bI() | |
958 | + | if (((gX - gY) != gV)) | |
959 | + | then throw(((((("Invalid AMM state data: " + toString(gX)) + " + ") + toString(gY)) + " != ") + toString(gV))) | |
960 | + | else ((gS(cH, cJ) ++ [IntegerEntry(O, gV), IntegerEntry(R, gW), IntegerEntry(P, gX), IntegerEntry(Q, gY), IntegerEntry(T, gZ), IntegerEntry(S, ha)]) ++ gL(aR(aT(cH, cI), aT(cJ, cK)))) | |
961 | + | } | |
962 | + | ||
963 | + | ||
964 | + | func hb (ak) = [DeleteEntry(ai(f, ak)), DeleteEntry(ai(g, ak)), DeleteEntry(ai(h, ak)), DeleteEntry(ai(i, ak)), DeleteEntry(ai(k, ak))] | |
965 | + | ||
966 | + | ||
967 | + | func hc (ak,hd) = { | |
968 | + | let he = assetBalance(this, ao()) | |
969 | + | if ((hd > he)) | |
970 | + | then throw(((("Unable to withdraw " + toString(hd)) + " from contract balance ") + toString(he))) | |
971 | + | else [ScriptTransfer(ak, hd, ao())] | |
972 | + | } | |
973 | + | ||
974 | + | ||
975 | + | func hf (cg) = if ((0 > cg)) | |
976 | + | then throw("Balance") | |
977 | + | else [IntegerEntry(d, cg)] | |
978 | + | ||
979 | + | ||
980 | + | func hg (cg) = [ScriptTransfer(aq(), cg, ao())] | |
981 | + | ||
982 | + | ||
983 | + | func hh (hi,cg) = if (hi) | |
984 | + | then [Burn(valueOrErrorMessage(cg.payments[1].assetId, "Invalid artifact"), 1)] | |
985 | + | else nil | |
986 | + | ||
987 | + | ||
988 | + | @Callable(cg) | |
989 | + | func pause () = if ((cg.caller != am())) | |
963 | 990 | then throw("Invalid pause params") | |
964 | 991 | else [BooleanEntry(m, true)] | |
965 | 992 | ||
966 | 993 | ||
967 | 994 | ||
968 | - | @Callable( | |
969 | - | func unpause () = if (( | |
995 | + | @Callable(cg) | |
996 | + | func unpause () = if ((cg.caller != am())) | |
970 | 997 | then throw("Invalid unpause params") | |
971 | 998 | else [BooleanEntry(m, false)] | |
972 | 999 | ||
973 | 1000 | ||
974 | 1001 | ||
975 | - | @Callable( | |
976 | - | func setCloseOnly () = if (( | |
1002 | + | @Callable(cg) | |
1003 | + | func setCloseOnly () = if ((cg.caller != am())) | |
977 | 1004 | then throw("Invalid setCloseOnly params") | |
978 | 1005 | else [BooleanEntry(n, true)] | |
979 | 1006 | ||
980 | 1007 | ||
981 | 1008 | ||
982 | - | @Callable( | |
983 | - | func unsetCloseOnly () = if (( | |
1009 | + | @Callable(cg) | |
1010 | + | func unsetCloseOnly () = if ((cg.caller != am())) | |
984 | 1011 | then throw("Invalid unsetCloseOnly params") | |
985 | 1012 | else [BooleanEntry(n, false)] | |
986 | 1013 | ||
987 | 1014 | ||
988 | 1015 | ||
989 | - | @Callable( | |
990 | - | func addLiquidity ( | |
1016 | + | @Callable(cg) | |
1017 | + | func addLiquidity (cC) = if (if ((cg.caller != am())) | |
991 | 1018 | then true | |
992 | - | else (0 >= | |
1019 | + | else (0 >= cC)) | |
993 | 1020 | then throw("Invalid addLiquidity params") | |
994 | 1021 | else { | |
995 | - | let | |
996 | - | let | |
997 | - | let | |
998 | - | let | |
999 | - | let | |
1000 | - | let | |
1001 | - | let | |
1002 | - | let | |
1003 | - | | |
1022 | + | let cH = bF() | |
1023 | + | let cJ = bG() | |
1024 | + | let cI = bH() | |
1025 | + | let cK = bI() | |
1026 | + | let hj = aR(aT(cH, cI), aT(cJ, cK)) | |
1027 | + | let hk = aR(cC, hj) | |
1028 | + | let hl = (cH + cC) | |
1029 | + | let hm = (cJ + hk) | |
1030 | + | gS(hl, hm) | |
1004 | 1031 | } | |
1005 | 1032 | ||
1006 | 1033 | ||
1007 | 1034 | ||
1008 | - | @Callable( | |
1009 | - | func removeLiquidity ( | |
1035 | + | @Callable(cg) | |
1036 | + | func removeLiquidity (cC) = if (if ((cg.caller != am())) | |
1010 | 1037 | then true | |
1011 | - | else (0 >= | |
1038 | + | else (0 >= cC)) | |
1012 | 1039 | then throw("Invalid removeLiquidity params") | |
1013 | 1040 | else { | |
1014 | - | let | |
1015 | - | let | |
1016 | - | let | |
1017 | - | let | |
1018 | - | let | |
1019 | - | let | |
1020 | - | let | |
1021 | - | let | |
1022 | - | | |
1041 | + | let cH = bF() | |
1042 | + | let cJ = bG() | |
1043 | + | let cI = bH() | |
1044 | + | let cK = bI() | |
1045 | + | let hj = aR(aT(cH, cI), aT(cJ, cK)) | |
1046 | + | let hn = aR(cC, hj) | |
1047 | + | let hl = (cH - cC) | |
1048 | + | let hm = (cJ - hn) | |
1049 | + | gS(hl, hm) | |
1023 | 1050 | } | |
1024 | 1051 | ||
1025 | 1052 | ||
1026 | 1053 | ||
1027 | - | @Callable( | |
1028 | - | func changeSettings ( | |
1054 | + | @Callable(cg) | |
1055 | + | func changeSettings (gm,gn,go,gp,gq,gr,gs,gt,gu,dO,gv,gw) = if ((cg.caller != am())) | |
1029 | 1056 | then throw("Invalid changeSettings params") | |
1030 | - | else | |
1031 | - | ||
1032 | - | ||
1033 | - | ||
1034 | - | @Callable( | |
1035 | - | func initialize ( | |
1057 | + | else gl(gm, gn, go, gp, gq, gr, gs, gt, gu, dO, gv, gw) | |
1058 | + | ||
1059 | + | ||
1060 | + | ||
1061 | + | @Callable(cg) | |
1062 | + | func initialize (cH,cJ,gp,gm,gn,go,gq,ho,hp,hq,hr,gr,gs,gt,gu,dO,gv,gw) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= cH)) | |
1036 | 1063 | then true | |
1037 | - | else (0 >= | |
1064 | + | else (0 >= cJ)) | |
1038 | 1065 | then true | |
1039 | - | else (0 >= | |
1066 | + | else (0 >= gp)) | |
1040 | 1067 | then true | |
1041 | - | else (0 >= | |
1068 | + | else (0 >= gm)) | |
1042 | 1069 | then true | |
1043 | - | else (0 >= | |
1070 | + | else (0 >= gn)) | |
1044 | 1071 | then true | |
1045 | - | else (0 >= | |
1072 | + | else (0 >= go)) | |
1046 | 1073 | then true | |
1047 | - | else (0 >= | |
1074 | + | else (0 >= gq)) | |
1048 | 1075 | then true | |
1049 | - | else (0 >= | |
1076 | + | else (0 >= gr)) | |
1050 | 1077 | then true | |
1051 | - | else (0 >= | |
1078 | + | else (0 >= gs)) | |
1052 | 1079 | then true | |
1053 | - | else (0 >= | |
1080 | + | else (0 >= gt)) | |
1054 | 1081 | then true | |
1055 | - | else (0 >= | |
1082 | + | else (0 >= gu)) | |
1056 | 1083 | then true | |
1057 | - | else (0 >= | |
1084 | + | else (0 >= dO)) | |
1058 | 1085 | then true | |
1059 | - | else ct()) | |
1086 | + | else (0 >= gv)) | |
1087 | + | then true | |
1088 | + | else (gv > aK)) | |
1089 | + | then true | |
1090 | + | else (0 >= gw)) | |
1091 | + | then true | |
1092 | + | else cx()) | |
1060 | 1093 | then throw("Invalid initialize parameters") | |
1061 | - | else (((( | |
1062 | - | ||
1063 | - | ||
1064 | - | ||
1065 | - | @Callable( | |
1066 | - | func decreasePosition ( | |
1067 | - | let | |
1068 | - | if (( | |
1094 | + | else ((((gU(cH, cJ, 0, 0, 0, 0, 0, 0) ++ gl(gm, gn, go, gp, gq, gr, gs, gt, gu, dO, gv, gw)) ++ gx((lastBlock.timestamp + gp), 0, 0, 0, 0)) ++ hf(0)) ++ [BooleanEntry(l, true), StringEntry(c, ho), StringEntry(a, hp), StringEntry(b, hq), StringEntry(U, hr)]) | |
1095 | + | ||
1096 | + | ||
1097 | + | ||
1098 | + | @Callable(cg) | |
1099 | + | func decreasePosition (hd,hs,ht) = { | |
1100 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1101 | + | if ((hu == hu)) | |
1069 | 1102 | then { | |
1070 | - | let | |
1071 | - | if (if (if (if (if ((0 >= | |
1072 | - | then true | |
1073 | - | else !( | |
1074 | - | then true | |
1075 | - | else !( | |
1076 | - | then true | |
1077 | - | else !( | |
1078 | - | then true | |
1079 | - | else | |
1103 | + | let cp = cf(cg) | |
1104 | + | if (if (if (if (if ((0 >= hd)) | |
1105 | + | then true | |
1106 | + | else !(cx())) | |
1107 | + | then true | |
1108 | + | else !(ch(aR(aK, hs), bE(), true))) | |
1109 | + | then true | |
1110 | + | else !(cw(cp))) | |
1111 | + | then true | |
1112 | + | else cy()) | |
1080 | 1113 | then throw("Invalid decreasePosition parameters") | |
1081 | 1114 | else { | |
1082 | - | let | |
1083 | - | let | |
1084 | - | let | |
1085 | - | let | |
1086 | - | let | |
1087 | - | let | |
1088 | - | then | |
1089 | - | else | |
1090 | - | let | |
1091 | - | let | |
1092 | - | let | |
1093 | - | let | |
1094 | - | let | |
1095 | - | let | |
1115 | + | let hv = co(cp) | |
1116 | + | let fT = hv._1 | |
1117 | + | let hw = hv._2 | |
1118 | + | let hx = hv._3 | |
1119 | + | let hy = hv._4 | |
1120 | + | let hz = if ((fT > 0)) | |
1121 | + | then aF | |
1122 | + | else aE | |
1123 | + | let hA = (hz == aE) | |
1124 | + | let hB = aT(hd, hs) | |
1125 | + | let hC = ef(cp, aN) | |
1126 | + | let hD = hC._1 | |
1127 | + | let ee = hC._2 | |
1128 | + | let hE = if ((hD > hB)) | |
1096 | 1129 | then { | |
1097 | - | let | |
1098 | - | let | |
1099 | - | let | |
1100 | - | let | |
1101 | - | let | |
1102 | - | let | |
1103 | - | if (if (( | |
1104 | - | then ( | |
1130 | + | let hF = cP(hA, hB) | |
1131 | + | let ez = hF._1 | |
1132 | + | let cQ = hF._2 | |
1133 | + | let cR = hF._3 | |
1134 | + | let eH = hF._4 | |
1135 | + | let hG = ba(ez) | |
1136 | + | if (if ((ht != 0)) | |
1137 | + | then (ht > hG) | |
1105 | 1138 | else false) | |
1106 | - | then throw(((("Too little base asset exchanged, got " + toString( | |
1139 | + | then throw(((("Too little base asset exchanged, got " + toString(hG)) + " expected ") + toString(ht))) | |
1107 | 1140 | else { | |
1108 | - | let | |
1109 | - | let | |
1110 | - | let | |
1111 | - | let | |
1112 | - | let | |
1113 | - | let | |
1114 | - | let | |
1115 | - | let | |
1116 | - | then (( | |
1117 | - | else (( | |
1118 | - | let | |
1119 | - | $Tuple12( | |
1120 | - | then | |
1121 | - | else 0)), ( | |
1122 | - | then | |
1123 | - | else 0)), ( | |
1124 | - | then | |
1125 | - | else 0)), ( | |
1126 | - | then | |
1141 | + | let eE = aR(aT(ee, hG), ba(fT)) | |
1142 | + | let hH = dd(fT, hw, hy, eE) | |
1143 | + | let dm = hH._1 | |
1144 | + | let dn = hH._2 | |
1145 | + | let di = hH._3 | |
1146 | + | let eA = hB | |
1147 | + | let hI = (ee - eE) | |
1148 | + | let hJ = if ((fT > 0)) | |
1149 | + | then ((hD - eA) - hI) | |
1150 | + | else ((hI + hD) - eA) | |
1151 | + | let hK = (fT + ez) | |
1152 | + | $Tuple12(hK, dm, ba(hJ), cm(hK), cR, cQ, eH, (bK() - hB), (cb() - (if ((hK > 0)) | |
1153 | + | then ba(ez) | |
1154 | + | else 0)), (ca() - (if ((0 > hK)) | |
1155 | + | then ba(ez) | |
1156 | + | else 0)), (bM() - (if ((hK > 0)) | |
1157 | + | then hB | |
1158 | + | else 0)), (bL() - (if ((0 > hK)) | |
1159 | + | then hB | |
1127 | 1160 | else 0))) | |
1128 | 1161 | } | |
1129 | 1162 | } | |
1130 | 1163 | else throw("Close position first") | |
1131 | - | let | |
1132 | - | let | |
1133 | - | let | |
1134 | - | let | |
1135 | - | let | |
1136 | - | let | |
1137 | - | let | |
1138 | - | let | |
1139 | - | let | |
1140 | - | let | |
1141 | - | let | |
1142 | - | let | |
1143 | - | let | |
1144 | - | if (( | |
1145 | - | then ( | |
1164 | + | let hK = hE._1 | |
1165 | + | let hL = hE._2 | |
1166 | + | let hM = hE._3 | |
1167 | + | let hN = hE._4 | |
1168 | + | let cR = hE._5 | |
1169 | + | let cQ = hE._6 | |
1170 | + | let eH = hE._7 | |
1171 | + | let eK = hE._8 | |
1172 | + | let eI = hE._9 | |
1173 | + | let eJ = hE._10 | |
1174 | + | let hO = hE._11 | |
1175 | + | let hP = hE._12 | |
1176 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1177 | + | if ((hQ == hQ)) | |
1178 | + | then (gH(cp, hK, hL, hM, hN) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) | |
1146 | 1179 | else throw("Strict value is not equal to itself.") | |
1147 | 1180 | } | |
1148 | 1181 | } | |
1149 | 1182 | else throw("Strict value is not equal to itself.") | |
1150 | 1183 | } | |
1151 | 1184 | ||
1152 | 1185 | ||
1153 | 1186 | ||
1154 | - | @Callable( | |
1155 | - | func increasePosition ( | |
1156 | - | let | |
1157 | - | if (( | |
1187 | + | @Callable(cg) | |
1188 | + | func increasePosition (hz,hs,ht,hR) = { | |
1189 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1190 | + | if ((hu == hu)) | |
1158 | 1191 | then { | |
1159 | - | let | |
1160 | - | let | |
1161 | - | let | |
1162 | - | let | |
1163 | - | let | |
1164 | - | let | |
1165 | - | if (if (if (if (if (if (if (if (if (( | |
1166 | - | then ( | |
1192 | + | let cp = cf(cg) | |
1193 | + | let hS = cg.payments[0].amount | |
1194 | + | let aA = cg.payments[0].assetId | |
1195 | + | let hT = toBase58String(value(aA)) | |
1196 | + | let hU = (aA == ao()) | |
1197 | + | let hV = az(hT) | |
1198 | + | if (if (if (if (if (if (if (if (if ((hz != aE)) | |
1199 | + | then (hz != aF) | |
1167 | 1200 | else false) | |
1168 | 1201 | then true | |
1169 | - | else (0 >= | |
1170 | - | then true | |
1171 | - | else !( | |
1172 | - | then true | |
1173 | - | else if (!( | |
1174 | - | then !( | |
1202 | + | else (0 >= hS)) | |
1203 | + | then true | |
1204 | + | else !(cx())) | |
1205 | + | then true | |
1206 | + | else if (!(hU)) | |
1207 | + | then !(hV) | |
1175 | 1208 | else false) | |
1176 | 1209 | then true | |
1177 | - | else !( | |
1178 | - | then true | |
1179 | - | else !( | |
1180 | - | then true | |
1181 | - | else | |
1182 | - | then true | |
1183 | - | else | |
1210 | + | else !(fS(cp, hT))) | |
1211 | + | then true | |
1212 | + | else !(ch(aR(aK, hs), bE(), true))) | |
1213 | + | then true | |
1214 | + | else cy()) | |
1215 | + | then true | |
1216 | + | else cz()) | |
1184 | 1217 | then throw("Invalid increasePosition parameters") | |
1185 | 1218 | else { | |
1186 | - | let | |
1187 | - | let | |
1188 | - | let | |
1189 | - | let | |
1190 | - | let | |
1191 | - | let | |
1219 | + | let hW = ga(cp, gf(cg)) | |
1220 | + | let fQ = hW._1 | |
1221 | + | let fR = hW._2 | |
1222 | + | let hX = aT(hS, fQ) | |
1223 | + | let hd = (hS - hX) | |
1224 | + | let hY = if (hV) | |
1192 | 1225 | then { | |
1193 | - | let | |
1194 | - | if (( | |
1226 | + | let hZ = invoke(aw(), "borrow", [cp], [AttachedPayment(aA, hd)]) | |
1227 | + | if ((hZ == hZ)) | |
1195 | 1228 | then { | |
1196 | - | let | |
1197 | - | if (( | |
1229 | + | let ia = assetBalance(this, ao()) | |
1230 | + | if ((ia == ia)) | |
1198 | 1231 | then { | |
1199 | - | let | |
1200 | - | if (( | |
1232 | + | let ib = invoke(ax(), "swap", [toBase58String(ao()), 0], [AttachedPayment(aA, hX)]) | |
1233 | + | if ((ib == ib)) | |
1201 | 1234 | then { | |
1202 | - | let | |
1203 | - | if (( | |
1235 | + | let ic = assetBalance(this, ao()) | |
1236 | + | if ((ic == ic)) | |
1204 | 1237 | then { | |
1205 | - | let | |
1206 | - | if (( | |
1207 | - | then | |
1238 | + | let id = (ic - ia) | |
1239 | + | if ((id == id)) | |
1240 | + | then id | |
1208 | 1241 | else throw("Strict value is not equal to itself.") | |
1209 | 1242 | } | |
1210 | 1243 | else throw("Strict value is not equal to itself.") | |
1211 | 1244 | } | |
1212 | 1245 | else throw("Strict value is not equal to itself.") | |
1213 | 1246 | } | |
1214 | 1247 | else throw("Strict value is not equal to itself.") | |
1215 | 1248 | } | |
1216 | 1249 | else throw("Strict value is not equal to itself.") | |
1217 | 1250 | } | |
1218 | - | else | |
1219 | - | if (( | |
1251 | + | else hX | |
1252 | + | if ((hY == hY)) | |
1220 | 1253 | then { | |
1221 | - | let | |
1222 | - | if (( | |
1254 | + | let ie = invoke(au(), "acceptPaymentWithLink", [cp, hR], [AttachedPayment(ao(), hY)]) | |
1255 | + | if ((ie == ie)) | |
1223 | 1256 | then { | |
1224 | - | let | |
1225 | - | let | |
1226 | - | if ($isInstanceOf( | |
1257 | + | let if = { | |
1258 | + | let cr = ie | |
1259 | + | if ($isInstanceOf(cr, "Int")) | |
1227 | 1260 | then { | |
1228 | - | let | |
1229 | - | | |
1261 | + | let gd = cr | |
1262 | + | gd | |
1230 | 1263 | } | |
1231 | 1264 | else throw("Invalid referrerFee") | |
1232 | 1265 | } | |
1233 | - | let | |
1234 | - | let | |
1235 | - | let | |
1236 | - | let | |
1237 | - | let | |
1238 | - | let | |
1239 | - | let | |
1240 | - | let | |
1241 | - | then ( | |
1242 | - | else ( | |
1243 | - | let | |
1244 | - | then | |
1266 | + | let ig = (hY - if) | |
1267 | + | let ih = co(cp) | |
1268 | + | let fT = ih._1 | |
1269 | + | let hw = ih._2 | |
1270 | + | let hx = ih._3 | |
1271 | + | let hy = ih._4 | |
1272 | + | let gF = (fT == 0) | |
1273 | + | let ii = if ((fT > 0)) | |
1274 | + | then (hz == aE) | |
1275 | + | else (hz == aF) | |
1276 | + | let ij = if (!(gF)) | |
1277 | + | then ii | |
1245 | 1278 | else false | |
1246 | - | let | |
1247 | - | let | |
1279 | + | let hA = (hz == aE) | |
1280 | + | let ik = if (if (gF) | |
1248 | 1281 | then true | |
1249 | - | else | |
1282 | + | else ij) | |
1250 | 1283 | then { | |
1251 | - | let | |
1252 | - | let | |
1253 | - | let | |
1254 | - | let | |
1255 | - | let | |
1256 | - | let | |
1257 | - | if (if (( | |
1258 | - | then ( | |
1284 | + | let hB = aT(hd, hs) | |
1285 | + | let il = cP(hA, hB) | |
1286 | + | let cT = il._1 | |
1287 | + | let cQ = il._2 | |
1288 | + | let cR = il._3 | |
1289 | + | let eH = il._4 | |
1290 | + | if (if ((ht != 0)) | |
1291 | + | then (ht > ba(cT)) | |
1259 | 1292 | else false) | |
1260 | - | then throw(((("Limit error: " + toString( | |
1293 | + | then throw(((("Limit error: " + toString(ba(cT))) + " < ") + toString(ht))) | |
1261 | 1294 | else { | |
1262 | - | let | |
1263 | - | let | |
1264 | - | then | |
1295 | + | let hK = (fT + cT) | |
1296 | + | let hO = (bM() + (if ((hK > 0)) | |
1297 | + | then hB | |
1265 | 1298 | else 0)) | |
1266 | - | let | |
1267 | - | then | |
1299 | + | let hP = (bL() + (if ((0 > hK)) | |
1300 | + | then hB | |
1268 | 1301 | else 0)) | |
1269 | - | let | |
1270 | - | let | |
1271 | - | let | |
1272 | - | let | |
1273 | - | let | |
1274 | - | if (!( | |
1302 | + | let im = aR(hB, hs) | |
1303 | + | let in = dd(fT, hw, hy, im) | |
1304 | + | let dm = in._1 | |
1305 | + | let dZ = in._2 | |
1306 | + | let ea = in._3 | |
1307 | + | if (!(dG(cQ, cR))) | |
1275 | 1308 | then throw("Over max spread limit") | |
1276 | - | else if (!( | |
1309 | + | else if (!(dL(hO, hP))) | |
1277 | 1310 | then throw("Over max open notional") | |
1278 | - | else $Tuple12( | |
1279 | - | then | |
1280 | - | else 0)), ( | |
1281 | - | then | |
1282 | - | else 0)), | |
1311 | + | else $Tuple12(hK, dm, (hx + hB), cm(hK), cR, cQ, eH, (bK() + hB), (cb() + (if ((hK > 0)) | |
1312 | + | then ba(cT) | |
1313 | + | else 0)), (ca() + (if ((0 > hK)) | |
1314 | + | then ba(cT) | |
1315 | + | else 0)), hO, hP) | |
1283 | 1316 | } | |
1284 | 1317 | } | |
1285 | 1318 | else { | |
1286 | - | let | |
1287 | - | let | |
1288 | - | let | |
1289 | - | let | |
1290 | - | if (( | |
1319 | + | let hB = aT(hd, hs) | |
1320 | + | let io = ef(toString(cg.caller), aN) | |
1321 | + | let hD = io._1 | |
1322 | + | let ee = io._2 | |
1323 | + | if ((hD > hB)) | |
1291 | 1324 | then throw("Use decreasePosition to decrease position size") | |
1292 | 1325 | else throw("Close position first") | |
1293 | 1326 | } | |
1294 | - | let | |
1295 | - | let | |
1296 | - | let | |
1297 | - | let | |
1298 | - | let | |
1299 | - | let | |
1300 | - | let | |
1301 | - | let | |
1302 | - | let | |
1303 | - | let | |
1304 | - | let | |
1305 | - | let | |
1306 | - | let | |
1307 | - | let | |
1308 | - | let | |
1309 | - | if ( | |
1327 | + | let hK = ik._1 | |
1328 | + | let hL = ik._2 | |
1329 | + | let hM = ik._3 | |
1330 | + | let hN = ik._4 | |
1331 | + | let cR = ik._5 | |
1332 | + | let cQ = ik._6 | |
1333 | + | let eH = ik._7 | |
1334 | + | let eK = ik._8 | |
1335 | + | let eI = ik._9 | |
1336 | + | let eJ = ik._10 | |
1337 | + | let hO = ik._11 | |
1338 | + | let hP = ik._12 | |
1339 | + | let ip = gh(ig) | |
1340 | + | let gj = ip._1 | |
1341 | + | let gk = ip._2 | |
1342 | + | let iq = if (hU) | |
1310 | 1343 | then { | |
1311 | - | let ie = invoke(ap(), "addFree", nil, [AttachedPayment(am(), ic)]) | |
1312 | - | if ((ie == ie)) | |
1344 | + | let iq = invoke(ar(), "addLocked", [false], [AttachedPayment(ao(), hd)]) | |
1345 | + | if ((iq == iq)) | |
1346 | + | then nil | |
1347 | + | else throw("Strict value is not equal to itself.") | |
1348 | + | } | |
1349 | + | else nil | |
1350 | + | if ((iq == iq)) | |
1351 | + | then { | |
1352 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1353 | + | if ((ir == ir)) | |
1313 | 1354 | then { | |
1314 | - | let | |
1315 | - | if (( | |
1355 | + | let is = invoke(as(), "notifyFees", [cp, ig], nil) | |
1356 | + | if ((is == is)) | |
1316 | 1357 | then { | |
1317 | - | let | |
1318 | - | if (( | |
1319 | - | then (((((( | |
1358 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1359 | + | if ((hQ == hQ)) | |
1360 | + | then ((((((gH(cp, hK, hL, hM, hN) ++ gE(gF, cp)) ++ gD(cp, hT)) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ hg(gj)) ++ hf((bC() + hd))) ++ hh(fR, cg)) | |
1320 | 1361 | else throw("Strict value is not equal to itself.") | |
1321 | 1362 | } | |
1322 | 1363 | else throw("Strict value is not equal to itself.") | |
1323 | 1364 | } | |
1324 | 1365 | else throw("Strict value is not equal to itself.") | |
1325 | 1366 | } | |
1326 | 1367 | else throw("Strict value is not equal to itself.") | |
1327 | 1368 | } | |
1328 | 1369 | else throw("Strict value is not equal to itself.") | |
1329 | 1370 | } | |
1330 | 1371 | else throw("Strict value is not equal to itself.") | |
1331 | 1372 | } | |
1332 | 1373 | } | |
1333 | 1374 | else throw("Strict value is not equal to itself.") | |
1334 | 1375 | } | |
1335 | 1376 | ||
1336 | 1377 | ||
1337 | 1378 | ||
1338 | - | @Callable( | |
1379 | + | @Callable(cg) | |
1339 | 1380 | func addMargin () = { | |
1340 | - | let | |
1341 | - | if (( | |
1381 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1382 | + | if ((hu == hu)) | |
1342 | 1383 | then { | |
1343 | - | let | |
1344 | - | let | |
1345 | - | let | |
1346 | - | let | |
1347 | - | let | |
1348 | - | let | |
1349 | - | if (if (if (if (if (if (if (!( | |
1350 | - | then !( | |
1384 | + | let cp = toString(cg.caller) | |
1385 | + | let hS = cg.payments[0].amount | |
1386 | + | let aA = cg.payments[0].assetId | |
1387 | + | let hT = toBase58String(value(aA)) | |
1388 | + | let hU = (aA == ao()) | |
1389 | + | let hV = az(hT) | |
1390 | + | if (if (if (if (if (if (if (!(hU)) | |
1391 | + | then !(hV) | |
1351 | 1392 | else false) | |
1352 | 1393 | then true | |
1353 | - | else !( | |
1354 | - | then true | |
1355 | - | else !( | |
1356 | - | then true | |
1357 | - | else !( | |
1358 | - | then true | |
1359 | - | else | |
1360 | - | then true | |
1361 | - | else | |
1394 | + | else !(cw(toString(cg.caller)))) | |
1395 | + | then true | |
1396 | + | else !(fU(cp, hT))) | |
1397 | + | then true | |
1398 | + | else !(cx())) | |
1399 | + | then true | |
1400 | + | else cy()) | |
1401 | + | then true | |
1402 | + | else cz()) | |
1362 | 1403 | then throw("Invalid addMargin parameters") | |
1363 | 1404 | else { | |
1364 | - | let | |
1365 | - | let | |
1366 | - | let | |
1367 | - | let | |
1368 | - | let | |
1369 | - | let | |
1405 | + | let it = ga(cp, gf(cg)) | |
1406 | + | let fQ = it._1 | |
1407 | + | let fR = it._2 | |
1408 | + | let hX = aT(hS, fQ) | |
1409 | + | let hd = (hS - hX) | |
1410 | + | let hY = if (hV) | |
1370 | 1411 | then { | |
1371 | - | let | |
1372 | - | if (( | |
1412 | + | let hZ = invoke(aw(), "borrow", [cp], [AttachedPayment(aA, hd)]) | |
1413 | + | if ((hZ == hZ)) | |
1373 | 1414 | then { | |
1374 | - | let | |
1375 | - | if (( | |
1415 | + | let ia = assetBalance(this, ao()) | |
1416 | + | if ((ia == ia)) | |
1376 | 1417 | then { | |
1377 | - | let | |
1378 | - | if (( | |
1418 | + | let ib = invoke(ax(), "swap", [toBase58String(ao()), 0], [AttachedPayment(aA, hX)]) | |
1419 | + | if ((ib == ib)) | |
1379 | 1420 | then { | |
1380 | - | let | |
1381 | - | if (( | |
1421 | + | let ic = assetBalance(this, ao()) | |
1422 | + | if ((ic == ic)) | |
1382 | 1423 | then { | |
1383 | - | let | |
1384 | - | if (( | |
1385 | - | then | |
1424 | + | let id = (ic - ia) | |
1425 | + | if ((id == id)) | |
1426 | + | then id | |
1386 | 1427 | else throw("Strict value is not equal to itself.") | |
1387 | 1428 | } | |
1388 | 1429 | else throw("Strict value is not equal to itself.") | |
1389 | 1430 | } | |
1390 | 1431 | else throw("Strict value is not equal to itself.") | |
1391 | 1432 | } | |
1392 | 1433 | else throw("Strict value is not equal to itself.") | |
1393 | 1434 | } | |
1394 | 1435 | else throw("Strict value is not equal to itself.") | |
1395 | 1436 | } | |
1396 | - | else | |
1397 | - | if (( | |
1437 | + | else hX | |
1438 | + | if ((hY == hY)) | |
1398 | 1439 | then { | |
1399 | - | let | |
1400 | - | if (( | |
1440 | + | let ie = invoke(au(), "acceptPayment", [cp], [AttachedPayment(ao(), hY)]) | |
1441 | + | if ((ie == ie)) | |
1401 | 1442 | then { | |
1402 | - | let | |
1403 | - | let | |
1404 | - | if ($isInstanceOf( | |
1443 | + | let if = { | |
1444 | + | let cr = ie | |
1445 | + | if ($isInstanceOf(cr, "Int")) | |
1405 | 1446 | then { | |
1406 | - | let | |
1407 | - | | |
1447 | + | let gd = cr | |
1448 | + | gd | |
1408 | 1449 | } | |
1409 | 1450 | else throw("Invalid referrerFee") | |
1410 | 1451 | } | |
1411 | - | let | |
1412 | - | let | |
1413 | - | let | |
1414 | - | let | |
1415 | - | let | |
1416 | - | let | |
1417 | - | let | |
1418 | - | let | |
1419 | - | let | |
1420 | - | if ( | |
1452 | + | let ig = (hY - if) | |
1453 | + | let iu = co(cp) | |
1454 | + | let fT = iu._1 | |
1455 | + | let hw = iu._2 | |
1456 | + | let hx = iu._3 | |
1457 | + | let hy = iu._4 | |
1458 | + | let iv = gh(ig) | |
1459 | + | let gj = iv._1 | |
1460 | + | let gk = iv._2 | |
1461 | + | let iq = if (hU) | |
1421 | 1462 | then { | |
1422 | - | let ie = invoke(ap(), "addFree", nil, [AttachedPayment(am(), ic)]) | |
1423 | - | if ((ie == ie)) | |
1463 | + | let iq = invoke(ar(), "addLocked", [false], [AttachedPayment(ao(), hd)]) | |
1464 | + | if ((iq == iq)) | |
1465 | + | then nil | |
1466 | + | else throw("Strict value is not equal to itself.") | |
1467 | + | } | |
1468 | + | else nil | |
1469 | + | if ((iq == iq)) | |
1470 | + | then { | |
1471 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1472 | + | if ((ir == ir)) | |
1424 | 1473 | then { | |
1425 | - | let | |
1426 | - | if (( | |
1427 | - | then ((( | |
1474 | + | let is = invoke(as(), "notifyFees", [cp, ig], nil) | |
1475 | + | if ((is == is)) | |
1476 | + | then (((gH(cp, fT, (hw + hd), hx, hy) ++ hg(gj)) ++ hf((bC() + hd))) ++ hh(fR, cg)) | |
1428 | 1477 | else throw("Strict value is not equal to itself.") | |
1429 | 1478 | } | |
1430 | 1479 | else throw("Strict value is not equal to itself.") | |
1431 | 1480 | } | |
1432 | 1481 | else throw("Strict value is not equal to itself.") | |
1433 | 1482 | } | |
1434 | 1483 | else throw("Strict value is not equal to itself.") | |
1435 | 1484 | } | |
1436 | 1485 | else throw("Strict value is not equal to itself.") | |
1437 | 1486 | } | |
1438 | 1487 | } | |
1439 | 1488 | else throw("Strict value is not equal to itself.") | |
1440 | 1489 | } | |
1441 | 1490 | ||
1442 | 1491 | ||
1443 | 1492 | ||
1444 | - | @Callable( | |
1445 | - | func removeMargin ( | |
1446 | - | let | |
1447 | - | if (( | |
1493 | + | @Callable(cg) | |
1494 | + | func removeMargin (hd) = { | |
1495 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1496 | + | if ((hu == hu)) | |
1448 | 1497 | then { | |
1449 | - | let | |
1450 | - | if (if (if (if ((0 >= | |
1451 | - | then true | |
1452 | - | else !( | |
1453 | - | then true | |
1454 | - | else !( | |
1455 | - | then true | |
1456 | - | else | |
1498 | + | let cp = toString(cg.caller) | |
1499 | + | if (if (if (if ((0 >= hd)) | |
1500 | + | then true | |
1501 | + | else !(cw(cp))) | |
1502 | + | then true | |
1503 | + | else !(cx())) | |
1504 | + | then true | |
1505 | + | else cy()) | |
1457 | 1506 | then throw("Invalid removeMargin parameters") | |
1458 | 1507 | else { | |
1459 | - | let | |
1460 | - | let | |
1461 | - | let | |
1462 | - | let | |
1463 | - | let | |
1464 | - | let | |
1465 | - | let | |
1466 | - | let | |
1467 | - | let | |
1468 | - | if (( | |
1508 | + | let iw = co(cp) | |
1509 | + | let fT = iw._1 | |
1510 | + | let hw = iw._2 | |
1511 | + | let hx = iw._3 | |
1512 | + | let hy = iw._4 | |
1513 | + | let ix = -(hd) | |
1514 | + | let iy = dd(fT, hw, hy, ix) | |
1515 | + | let dm = iy._1 | |
1516 | + | let dn = iy._2 | |
1517 | + | if ((dn != 0)) | |
1469 | 1518 | then throw("Invalid removed margin amount") | |
1470 | 1519 | else { | |
1471 | - | let | |
1472 | - | if (!( | |
1473 | - | then throw(((("Too much margin removed: " + toString( | |
1520 | + | let iz = ek(dm, dn, hx) | |
1521 | + | if (!(ch(iz, bE(), true))) | |
1522 | + | then throw(((("Too much margin removed: " + toString(iz)) + " < ") + toString(bE()))) | |
1474 | 1523 | else { | |
1475 | - | let | |
1476 | - | let | |
1477 | - | let | |
1478 | - | let | |
1479 | - | let | |
1480 | - | then | |
1481 | - | else | |
1482 | - | let | |
1524 | + | let iA = toBase58String(ao()) | |
1525 | + | let iB = fX(cp) | |
1526 | + | let iC = iB._1 | |
1527 | + | let iD = iB._2 | |
1528 | + | let iE = if ((hd > iC)) | |
1529 | + | then iC | |
1530 | + | else hd | |
1531 | + | let iF = if ((iC > hd)) | |
1483 | 1532 | then 0 | |
1484 | - | else ( | |
1485 | - | let | |
1486 | - | let | |
1533 | + | else (hd - iC) | |
1534 | + | let iG = (iC - iE) | |
1535 | + | let iH = if ((iG > 0)) | |
1487 | 1536 | then nil | |
1488 | - | else | |
1489 | - | let | |
1490 | - | then throw(((((("toRepay=" + toString( | |
1537 | + | else gD(cp, iA) | |
1538 | + | let iI = if (((iE + iF) != hd)) | |
1539 | + | then throw(((((("toRepay=" + toString(iE)) + " + toWithdraw=") + toString(iF)) + " != ") + toString(hd))) | |
1491 | 1540 | else nil | |
1492 | - | if (( | |
1541 | + | if ((iI == iI)) | |
1493 | 1542 | then { | |
1494 | - | let iv = invoke(ap(), "withdrawLocked", [gC], nil) | |
1495 | - | if ((iv == iv)) | |
1543 | + | let iJ = if ((iF > 0)) | |
1496 | 1544 | then { | |
1497 | - | let iw = if ((iq > 0)) | |
1545 | + | let iJ = invoke(ar(), "withdrawLocked", [iF], nil) | |
1546 | + | if ((iJ == iJ)) | |
1547 | + | then nil | |
1548 | + | else throw("Strict value is not equal to itself.") | |
1549 | + | } | |
1550 | + | else nil | |
1551 | + | if ((iJ == iJ)) | |
1552 | + | then { | |
1553 | + | let iK = if ((iE > 0)) | |
1498 | 1554 | then { | |
1499 | - | let | |
1500 | - | if (( | |
1501 | - | then [ScriptTransfer( | |
1555 | + | let iL = invoke(aw(), "repay", [cp, iE, iD], nil) | |
1556 | + | if ((iL == iL)) | |
1557 | + | then [ScriptTransfer(cg.caller, iE, fromBase58String(iD))] | |
1502 | 1558 | else throw("Strict value is not equal to itself.") | |
1503 | 1559 | } | |
1504 | 1560 | else nil | |
1505 | - | if (( | |
1506 | - | then (((( | |
1507 | - | then | |
1508 | - | else nil)) ++ | |
1561 | + | if ((iK == iK)) | |
1562 | + | then ((((gH(cp, fT, dm, hx, cm(fT)) ++ (if ((iF > 0)) | |
1563 | + | then hc(cg.caller, iF) | |
1564 | + | else nil)) ++ hf((bC() - hd))) ++ iH) ++ iK) | |
1509 | 1565 | else throw("Strict value is not equal to itself.") | |
1510 | 1566 | } | |
1511 | 1567 | else throw("Strict value is not equal to itself.") | |
1512 | 1568 | } | |
1513 | 1569 | else throw("Strict value is not equal to itself.") | |
1514 | 1570 | } | |
1515 | 1571 | } | |
1516 | 1572 | } | |
1517 | 1573 | } | |
1518 | 1574 | else throw("Strict value is not equal to itself.") | |
1519 | 1575 | } | |
1520 | 1576 | ||
1521 | 1577 | ||
1522 | 1578 | ||
1523 | - | @Callable( | |
1524 | - | func closePosition ( | |
1525 | - | let | |
1526 | - | if (( | |
1579 | + | @Callable(cg) | |
1580 | + | func closePosition (gI,iM) = { | |
1581 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1582 | + | if ((hu == hu)) | |
1527 | 1583 | then { | |
1528 | - | let | |
1529 | - | let | |
1530 | - | if (if (if (if (if (!( | |
1531 | - | then true | |
1532 | - | else !( | |
1533 | - | then true | |
1534 | - | else | |
1535 | - | then true | |
1536 | - | else (0 >= | |
1537 | - | then true | |
1538 | - | else (0 > | |
1584 | + | let cp = cf(cg) | |
1585 | + | let iN = valueOrErrorMessage(addressFromString(cp), "Invalid caller") | |
1586 | + | if (if (if (if (if (!(cw(cp))) | |
1587 | + | then true | |
1588 | + | else !(cx())) | |
1589 | + | then true | |
1590 | + | else cy()) | |
1591 | + | then true | |
1592 | + | else (0 >= gI)) | |
1593 | + | then true | |
1594 | + | else (0 > iM)) | |
1539 | 1595 | then throw("Invalid closePosition parameters") | |
1540 | 1596 | else { | |
1541 | - | let | |
1542 | - | let | |
1543 | - | let | |
1544 | - | let | |
1545 | - | let | |
1546 | - | let | |
1597 | + | let iO = co(cp) | |
1598 | + | let fT = iO._1 | |
1599 | + | let hw = iO._2 | |
1600 | + | let hx = iO._3 | |
1601 | + | let hy = iO._4 | |
1602 | + | let iP = if ((ba(fT) > gI)) | |
1547 | 1603 | then { | |
1548 | - | let hl = if ((gJ > 0)) | |
1549 | - | then aD | |
1550 | - | else aC | |
1551 | - | let hm = (hl == aC) | |
1552 | - | let iC = du((gJ > 0), gh, true) | |
1553 | - | let eu = iC._1 | |
1554 | - | let cM = iC._2 | |
1555 | - | let cN = iC._3 | |
1556 | - | let eB = iC._4 | |
1557 | - | let et = if ((gJ > 0)) | |
1558 | - | then -(gh) | |
1559 | - | else gh | |
1560 | - | let iD = dZ(cl, aL) | |
1561 | - | let hp = iD._1 | |
1562 | - | let dY = iD._2 | |
1563 | - | let iE = aP(aY(et), aY(gJ)) | |
1564 | - | let ey = aR(dY, iE) | |
1565 | - | let iF = cZ(gJ, hi, hk, ey) | |
1566 | - | let di = iF._1 | |
1567 | - | let iG = iF._2 | |
1568 | - | let de = iF._3 | |
1569 | - | let hu = (dY - ey) | |
1570 | - | let hv = if ((gJ > 0)) | |
1571 | - | then ((hp - eu) - hu) | |
1572 | - | else ((hu + hp) - eu) | |
1573 | - | let iH = aR(di, iE) | |
1574 | - | let hw = (gJ + et) | |
1575 | - | let hy = aY(hv) | |
1576 | - | let iI = ci(hw) | |
1577 | - | let eE = (bI() - eu) | |
1578 | - | if (if ((iy != 0)) | |
1579 | - | then (iy > eu) | |
1604 | + | let hz = if ((fT > 0)) | |
1605 | + | then aF | |
1606 | + | else aE | |
1607 | + | let hA = (hz == aE) | |
1608 | + | let iQ = dy((fT > 0), gI, true) | |
1609 | + | let eA = iQ._1 | |
1610 | + | let cQ = iQ._2 | |
1611 | + | let cR = iQ._3 | |
1612 | + | let eH = iQ._4 | |
1613 | + | let ez = if ((fT > 0)) | |
1614 | + | then -(gI) | |
1615 | + | else gI | |
1616 | + | let iR = ef(cp, aN) | |
1617 | + | let hD = iR._1 | |
1618 | + | let ee = iR._2 | |
1619 | + | let iS = eo(cp, aN) | |
1620 | + | let iT = aR(ba(ez), ba(fT)) | |
1621 | + | let eE = aT(ee, iT) | |
1622 | + | let iU = dd(fT, hw, hy, eE) | |
1623 | + | let dm = iU._1 | |
1624 | + | let iV = iU._2 | |
1625 | + | let di = iU._3 | |
1626 | + | let hI = (ee - eE) | |
1627 | + | let hJ = if ((fT > 0)) | |
1628 | + | then ((hD - eA) - hI) | |
1629 | + | else ((hI + hD) - eA) | |
1630 | + | let hM = ba(hJ) | |
1631 | + | let iW = aT(hM, iS) | |
1632 | + | let hK = (fT + ez) | |
1633 | + | let iX = cm(hK) | |
1634 | + | let eK = (bK() - eA) | |
1635 | + | if (if ((iM != 0)) | |
1636 | + | then (iM > eA) | |
1580 | 1637 | else false) | |
1581 | - | then throw(((("Limit error: " + toString( | |
1582 | - | else $Tuple15( | |
1583 | - | then | |
1584 | - | else 0)), ( | |
1585 | - | then | |
1586 | - | else 0)), ( | |
1587 | - | then | |
1588 | - | else 0)), ( | |
1589 | - | then | |
1638 | + | then throw(((("Limit error: " + toString(eA)) + " < ") + toString(iM))) | |
1639 | + | else $Tuple15(hK, iW, hM, iX, iV, eE, (ba((dm - iW)) + eE), cQ, cR, eH, eK, (cb() - (if ((hK > 0)) | |
1640 | + | then ba(ez) | |
1641 | + | else 0)), (ca() - (if ((0 > hK)) | |
1642 | + | then ba(ez) | |
1643 | + | else 0)), (bM() - (if ((hK > 0)) | |
1644 | + | then eA | |
1645 | + | else 0)), (bL() - (if ((0 > hK)) | |
1646 | + | then eA | |
1590 | 1647 | else 0))) | |
1591 | 1648 | } | |
1592 | - | else if (( | |
1649 | + | else if ((gI > ba(fT))) | |
1593 | 1650 | then throw("Invalid closePosition parameters") | |
1594 | 1651 | else { | |
1595 | - | let | |
1596 | - | let | |
1597 | - | let | |
1598 | - | let | |
1599 | - | let | |
1600 | - | let | |
1601 | - | let | |
1602 | - | let | |
1603 | - | let | |
1604 | - | let | |
1605 | - | let | |
1606 | - | let | |
1607 | - | let | |
1608 | - | let | |
1609 | - | if (if (( | |
1610 | - | then ( | |
1652 | + | let iY = eB(cp, true) | |
1653 | + | let eA = iY._1 | |
1654 | + | let iV = iY._2 | |
1655 | + | let eE = iY._3 | |
1656 | + | let eF = iY._4 | |
1657 | + | let cQ = iY._5 | |
1658 | + | let cR = iY._6 | |
1659 | + | let eH = iY._7 | |
1660 | + | let eK = iY._8 | |
1661 | + | let ea = iY._9 | |
1662 | + | let eI = iY._10 | |
1663 | + | let eJ = iY._11 | |
1664 | + | let hO = iY._12 | |
1665 | + | let hP = iY._13 | |
1666 | + | if (if ((iM != 0)) | |
1667 | + | then (iM > eA) | |
1611 | 1668 | else false) | |
1612 | - | then throw(((("Limit error: " + toString( | |
1613 | - | else $Tuple15(0, 0, 0, 0, | |
1669 | + | then throw(((("Limit error: " + toString(eA)) + " < ") + toString(iM))) | |
1670 | + | else $Tuple15(0, 0, 0, 0, iV, eE, eF, cQ, cR, eH, eK, eI, eJ, hO, hP) | |
1614 | 1671 | } | |
1615 | - | let | |
1616 | - | let | |
1617 | - | let | |
1618 | - | let | |
1619 | - | let | |
1620 | - | let | |
1621 | - | let | |
1622 | - | let | |
1623 | - | let | |
1624 | - | let | |
1625 | - | let | |
1626 | - | let | |
1627 | - | let | |
1628 | - | let | |
1629 | - | let | |
1630 | - | if (( | |
1672 | + | let hK = iP._1 | |
1673 | + | let iW = iP._2 | |
1674 | + | let hM = iP._3 | |
1675 | + | let iX = iP._4 | |
1676 | + | let iV = iP._5 | |
1677 | + | let eE = iP._6 | |
1678 | + | let eF = iP._7 | |
1679 | + | let cQ = iP._8 | |
1680 | + | let cR = iP._9 | |
1681 | + | let eH = iP._10 | |
1682 | + | let eK = iP._11 | |
1683 | + | let eI = iP._12 | |
1684 | + | let eJ = iP._13 | |
1685 | + | let hO = iP._14 | |
1686 | + | let hP = iP._15 | |
1687 | + | if ((iV > 0)) | |
1631 | 1688 | then throw("Unable to close position with bad debt") | |
1632 | 1689 | else { | |
1633 | - | let iK = aY(ez) | |
1634 | - | let iL = (bA() - iK) | |
1635 | - | let iM = if ((0 > iL)) | |
1636 | - | then $Tuple2(0, aY(iL)) | |
1637 | - | else $Tuple2(iL, 0) | |
1638 | - | let iN = iM._1 | |
1639 | - | let iO = iM._2 | |
1640 | - | let iP = invoke(ap(), "withdrawLocked", [iK], nil) | |
1641 | - | if ((iP == iP)) | |
1690 | + | let iZ = ba(eF) | |
1691 | + | let ja = (bC() - iZ) | |
1692 | + | let jb = if ((0 > ja)) | |
1693 | + | then $Tuple2(0, ba(ja)) | |
1694 | + | else $Tuple2(ja, 0) | |
1695 | + | let jc = jb._1 | |
1696 | + | let jd = jb._2 | |
1697 | + | let je = fX(cp) | |
1698 | + | let iC = je._1 | |
1699 | + | let iD = je._2 | |
1700 | + | let jf = if ((iC > 0)) | |
1701 | + | then if ((iZ >= iC)) | |
1702 | + | then { | |
1703 | + | let iL = invoke(aw(), "repay", [cp, iC, iD], nil) | |
1704 | + | if ((iL == iL)) | |
1705 | + | then $Tuple2([ScriptTransfer(iN, iC, fromBase58String(iD))], (iZ - iC)) | |
1706 | + | else throw("Strict value is not equal to itself.") | |
1707 | + | } | |
1708 | + | else { | |
1709 | + | let jg = invoke(aw(), "realizePartiallyAndClose", [cp, iZ, iD], nil) | |
1710 | + | if ((jg == jg)) | |
1711 | + | then $Tuple2([ScriptTransfer(iN, iZ, fromBase58String(iD))], 0) | |
1712 | + | else throw("Strict value is not equal to itself.") | |
1713 | + | } | |
1714 | + | else $Tuple2(nil, iZ) | |
1715 | + | if ((jf == jf)) | |
1642 | 1716 | then { | |
1643 | - | let iQ = gN(cl) | |
1644 | - | let io = iQ._1 | |
1645 | - | let ip = iQ._2 | |
1646 | - | let iR = if ((io > 0)) | |
1647 | - | then if ((iK >= io)) | |
1648 | - | then { | |
1649 | - | let ix = invoke(au(), "repay", [cl, ip], [AttachedPayment(am(), io)]) | |
1650 | - | if ((ix == ix)) | |
1651 | - | then $Tuple2([ScriptTransfer(iz, io, fromBase58String(ip))], (iK - io)) | |
1652 | - | else throw("Strict value is not equal to itself.") | |
1653 | - | } | |
1654 | - | else { | |
1655 | - | let iS = invoke(au(), "realizePartiallyAndClose", [cl, ip], [AttachedPayment(am(), iK)]) | |
1656 | - | if ((iS == iS)) | |
1657 | - | then $Tuple2([ScriptTransfer(iz, iK, fromBase58String(ip))], 0) | |
1658 | - | else throw("Strict value is not equal to itself.") | |
1659 | - | } | |
1660 | - | else $Tuple2(nil, iK) | |
1661 | - | if ((iR == iR)) | |
1717 | + | let jh = jf._2 | |
1718 | + | let ji = jf._1 | |
1719 | + | let jj = if ((jh > 0)) | |
1662 | 1720 | then { | |
1663 | - | let iT = iR._2 | |
1664 | - | let iU = iR._1 | |
1665 | - | let hC = invoke(aq(), "notifyNotional", [cl, 0], nil) | |
1666 | - | if ((hC == hC)) | |
1667 | - | then (((((if ((hw == 0)) | |
1668 | - | then gA(cl) | |
1669 | - | else gg(cl, hw, iH, hy, iI)) ++ gt(cM, cN, eB, eE, eC, eD, hA, hB)) ++ (if ((iT > 0)) | |
1670 | - | then gB(iz, iT) | |
1671 | - | else nil)) ++ gE(iN)) ++ iU) | |
1721 | + | let jj = invoke(ar(), "withdrawLocked", [jh], nil) | |
1722 | + | if ((jj == jj)) | |
1723 | + | then nil | |
1724 | + | else throw("Strict value is not equal to itself.") | |
1725 | + | } | |
1726 | + | else nil | |
1727 | + | if ((jj == jj)) | |
1728 | + | then { | |
1729 | + | let hQ = invoke(as(), "notifyNotional", [cp, 0], nil) | |
1730 | + | if ((hQ == hQ)) | |
1731 | + | then (((((if ((hK == 0)) | |
1732 | + | then hb(cp) | |
1733 | + | else gH(cp, hK, iW, hM, iX)) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ (if ((jh > 0)) | |
1734 | + | then hc(iN, jh) | |
1735 | + | else nil)) ++ hf(jc)) ++ ji) | |
1672 | 1736 | else throw("Strict value is not equal to itself.") | |
1673 | 1737 | } | |
1674 | 1738 | else throw("Strict value is not equal to itself.") | |
1675 | 1739 | } | |
1676 | 1740 | else throw("Strict value is not equal to itself.") | |
1677 | 1741 | } | |
1678 | 1742 | } | |
1679 | 1743 | } | |
1680 | 1744 | else throw("Strict value is not equal to itself.") | |
1681 | 1745 | } | |
1682 | 1746 | ||
1683 | 1747 | ||
1684 | 1748 | ||
1685 | - | @Callable( | |
1686 | - | func liquidate ( | |
1687 | - | let | |
1688 | - | if (( | |
1749 | + | @Callable(cg) | |
1750 | + | func liquidate (cp) = { | |
1751 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1752 | + | if ((hu == hu)) | |
1689 | 1753 | then { | |
1690 | - | let | |
1691 | - | let | |
1754 | + | let jk = eo(cp, aN) | |
1755 | + | let iz = if (dQ()) | |
1692 | 1756 | then { | |
1693 | - | let | |
1694 | - | | |
1757 | + | let jl = eo(cp, aO) | |
1758 | + | bb(jk, jl) | |
1695 | 1759 | } | |
1696 | - | else | |
1697 | - | if (if (if (if (!( | |
1698 | - | then true | |
1699 | - | else !( | |
1700 | - | then true | |
1701 | - | else !( | |
1702 | - | then true | |
1703 | - | else | |
1760 | + | else jk | |
1761 | + | if (if (if (if (!(ch(iz, bR(), false))) | |
1762 | + | then true | |
1763 | + | else !(cw(cp))) | |
1764 | + | then true | |
1765 | + | else !(cx())) | |
1766 | + | then true | |
1767 | + | else cy()) | |
1704 | 1768 | then throw("Unable to liquidate") | |
1705 | - | else if (if (if (( | |
1706 | - | then ( | |
1769 | + | else if (if (if ((jk > bS())) | |
1770 | + | then (bT() > 0) | |
1707 | 1771 | else false) | |
1708 | - | then ( | |
1772 | + | then (aK > bT()) | |
1709 | 1773 | else false) | |
1710 | 1774 | then { | |
1711 | - | let | |
1712 | - | let | |
1713 | - | let | |
1714 | - | let | |
1715 | - | let | |
1716 | - | let | |
1717 | - | then | |
1718 | - | else | |
1719 | - | let | |
1720 | - | let | |
1721 | - | let | |
1722 | - | let | |
1723 | - | let | |
1724 | - | let | |
1725 | - | let | |
1726 | - | let | |
1727 | - | let | |
1728 | - | let | |
1729 | - | let | |
1730 | - | let | |
1731 | - | let | |
1732 | - | let | |
1733 | - | let | |
1734 | - | let | |
1735 | - | let | |
1736 | - | let | |
1737 | - | then (( | |
1738 | - | else (( | |
1739 | - | let | |
1740 | - | let | |
1741 | - | let | |
1742 | - | let | |
1743 | - | let | |
1744 | - | let | |
1745 | - | let | |
1746 | - | let | |
1747 | - | let | |
1748 | - | let | |
1749 | - | then $Tuple2(0, | |
1750 | - | else $Tuple2( | |
1751 | - | let | |
1752 | - | let | |
1753 | - | let | |
1754 | - | let | |
1755 | - | let | |
1756 | - | let | |
1775 | + | let jm = co(cp) | |
1776 | + | let fT = jm._1 | |
1777 | + | let hw = jm._2 | |
1778 | + | let hx = jm._3 | |
1779 | + | let hy = jm._4 | |
1780 | + | let hz = if ((fT > 0)) | |
1781 | + | then aF | |
1782 | + | else aE | |
1783 | + | let hA = (hz == aE) | |
1784 | + | let eA = eu(cp, fT) | |
1785 | + | let jn = ef(cp, aN) | |
1786 | + | let hD = jn._1 | |
1787 | + | let ee = jn._2 | |
1788 | + | let jo = cP(hA, eA) | |
1789 | + | let ez = jo._1 | |
1790 | + | let cQ = jo._2 | |
1791 | + | let cR = jo._3 | |
1792 | + | let eH = jo._4 | |
1793 | + | let jp = aR(ba(ez), ba(fT)) | |
1794 | + | let eE = aT(ee, jp) | |
1795 | + | let jq = dd(fT, hw, hy, eE) | |
1796 | + | let dm = jq._1 | |
1797 | + | let dn = jq._2 | |
1798 | + | let di = jq._3 | |
1799 | + | let hI = (ee - eE) | |
1800 | + | let hJ = if ((fT > 0)) | |
1801 | + | then ((hD - eA) - hI) | |
1802 | + | else ((hI + hD) - eA) | |
1803 | + | let jr = aT(eA, bS()) | |
1804 | + | let js = (jr / 2) | |
1805 | + | let gk = (jr - js) | |
1806 | + | let iW = (dm - jr) | |
1807 | + | let hK = (fT + ez) | |
1808 | + | let hM = ba(hJ) | |
1809 | + | let iX = cm(hK) | |
1810 | + | let eK = (bK() - eA) | |
1811 | + | let ja = (bC() - jr) | |
1812 | + | let jt = if ((0 > ja)) | |
1813 | + | then $Tuple2(0, ba(ja)) | |
1814 | + | else $Tuple2(ja, 0) | |
1815 | + | let ju = jt._1 | |
1816 | + | let jd = jt._2 | |
1817 | + | let jv = fX(cp) | |
1818 | + | let iC = jv._1 | |
1819 | + | let iD = jv._2 | |
1820 | + | let jw = if ((iC > 0)) | |
1757 | 1821 | then { | |
1758 | - | let | |
1759 | - | let | |
1760 | - | if (( | |
1822 | + | let jx = aT(iC, jp) | |
1823 | + | let jg = invoke(aw(), "realizePartially", [cp, iD, jx], nil) | |
1824 | + | if ((jg == jg)) | |
1761 | 1825 | then nil | |
1762 | 1826 | else throw("Strict value is not equal to itself.") | |
1763 | 1827 | } | |
1764 | 1828 | else nil | |
1765 | - | if (( | |
1829 | + | if ((jw == jw)) | |
1766 | 1830 | then { | |
1767 | - | let | |
1768 | - | if (( | |
1831 | + | let jj = invoke(ar(), "withdrawLocked", [jr], nil) | |
1832 | + | if ((jj == jj)) | |
1769 | 1833 | then { | |
1770 | - | let | |
1771 | - | if (( | |
1834 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1835 | + | if ((ir == ir)) | |
1772 | 1836 | then { | |
1773 | - | let | |
1774 | - | if (( | |
1775 | - | then ((( | |
1776 | - | then | |
1777 | - | else 0)), ( | |
1778 | - | then | |
1779 | - | else 0)), ( | |
1780 | - | then | |
1781 | - | else 0)), ( | |
1782 | - | then | |
1783 | - | else 0)))) ++ | |
1837 | + | let hQ = invoke(as(), "notifyNotional", [cp, hM], nil) | |
1838 | + | if ((hQ == hQ)) | |
1839 | + | then (((gH(cp, hK, iW, hM, iX) ++ gU(cQ, cR, eH, eK, (cb() - (if ((hK > 0)) | |
1840 | + | then ba(ez) | |
1841 | + | else 0)), (ca() - (if ((0 > hK)) | |
1842 | + | then ba(ez) | |
1843 | + | else 0)), (bM() - (if ((hK > 0)) | |
1844 | + | then eA | |
1845 | + | else 0)), (bL() - (if ((0 > hK)) | |
1846 | + | then eA | |
1847 | + | else 0)))) ++ hc(cg.caller, js)) ++ hf(ju)) | |
1784 | 1848 | else throw("Strict value is not equal to itself.") | |
1785 | 1849 | } | |
1786 | 1850 | else throw("Strict value is not equal to itself.") | |
1787 | 1851 | } | |
1788 | 1852 | else throw("Strict value is not equal to itself.") | |
1789 | 1853 | } | |
1790 | 1854 | else throw("Strict value is not equal to itself.") | |
1791 | 1855 | } | |
1792 | 1856 | else { | |
1793 | - | let | |
1794 | - | let | |
1795 | - | let | |
1796 | - | let | |
1797 | - | let | |
1798 | - | let | |
1799 | - | let | |
1800 | - | let | |
1801 | - | let | |
1802 | - | let | |
1803 | - | let | |
1804 | - | let | |
1805 | - | let | |
1806 | - | let | |
1807 | - | let | |
1808 | - | let | |
1809 | - | let | |
1810 | - | let | |
1811 | - | let | |
1812 | - | then $Tuple2(0, | |
1813 | - | else $Tuple2( | |
1814 | - | let | |
1815 | - | let | |
1816 | - | let | |
1817 | - | let | |
1818 | - | let | |
1819 | - | let | |
1857 | + | let jy = eB(cp, false) | |
1858 | + | let dZ = jy._1 | |
1859 | + | let dn = jy._2 | |
1860 | + | let ea = jy._3 | |
1861 | + | let eb = jy._4 | |
1862 | + | let cQ = jy._5 | |
1863 | + | let cR = jy._6 | |
1864 | + | let eH = jy._7 | |
1865 | + | let eK = jy._8 | |
1866 | + | let eA = jy._9 | |
1867 | + | let eI = jy._10 | |
1868 | + | let eJ = jy._11 | |
1869 | + | let hO = jy._12 | |
1870 | + | let hP = jy._13 | |
1871 | + | let jr = aT(eA, bS()) | |
1872 | + | let js = (jr / 2) | |
1873 | + | let gk = (jr - js) | |
1874 | + | let ja = (bC() - jr) | |
1875 | + | let jz = if ((0 > ja)) | |
1876 | + | then $Tuple2(0, ba(ja)) | |
1877 | + | else $Tuple2(ja, 0) | |
1878 | + | let ju = jz._1 | |
1879 | + | let jd = jz._2 | |
1880 | + | let jA = fX(cp) | |
1881 | + | let iC = jA._1 | |
1882 | + | let iD = jA._2 | |
1883 | + | let jw = if ((iC > 0)) | |
1820 | 1884 | then { | |
1821 | - | let | |
1822 | - | if (( | |
1885 | + | let jg = invoke(aw(), "realizePartiallyAndClose", [cp, 0, iD], nil) | |
1886 | + | if ((jg == jg)) | |
1823 | 1887 | then nil | |
1824 | 1888 | else throw("Strict value is not equal to itself.") | |
1825 | 1889 | } | |
1826 | 1890 | else nil | |
1827 | - | if (( | |
1891 | + | if ((jw == jw)) | |
1828 | 1892 | then { | |
1829 | - | let | |
1893 | + | let gd = if ((dn > 0)) | |
1830 | 1894 | then { | |
1831 | - | let | |
1832 | - | if (( | |
1895 | + | let jB = invoke(ar(), "exchangeFreeAndLocked", [dn], nil) | |
1896 | + | if ((jB == jB)) | |
1833 | 1897 | then nil | |
1834 | 1898 | else throw("Strict value is not equal to itself.") | |
1835 | 1899 | } | |
1836 | 1900 | else nil | |
1837 | - | if (( | |
1901 | + | if ((gd == gd)) | |
1838 | 1902 | then { | |
1839 | - | let | |
1840 | - | if (( | |
1903 | + | let jj = invoke(ar(), "withdrawLocked", [jr], nil) | |
1904 | + | if ((jj == jj)) | |
1841 | 1905 | then { | |
1842 | - | let | |
1843 | - | if (( | |
1906 | + | let ir = invoke(ar(), "addFree", nil, [AttachedPayment(ao(), gk)]) | |
1907 | + | if ((ir == ir)) | |
1844 | 1908 | then { | |
1845 | - | let | |
1846 | - | if (( | |
1847 | - | then ((( | |
1909 | + | let hQ = invoke(as(), "notifyNotional", [cp, 0], nil) | |
1910 | + | if ((hQ == hQ)) | |
1911 | + | then (((hb(cp) ++ gU(cQ, cR, eH, eK, eI, eJ, hO, hP)) ++ hc(cg.caller, js)) ++ hf(ju)) | |
1848 | 1912 | else throw("Strict value is not equal to itself.") | |
1849 | 1913 | } | |
1850 | 1914 | else throw("Strict value is not equal to itself.") | |
1851 | 1915 | } | |
1852 | 1916 | else throw("Strict value is not equal to itself.") | |
1853 | 1917 | } | |
1854 | 1918 | else throw("Strict value is not equal to itself.") | |
1855 | 1919 | } | |
1856 | 1920 | else throw("Strict value is not equal to itself.") | |
1857 | 1921 | } | |
1858 | 1922 | } | |
1859 | 1923 | else throw("Strict value is not equal to itself.") | |
1860 | 1924 | } | |
1861 | 1925 | ||
1862 | 1926 | ||
1863 | 1927 | ||
1864 | - | @Callable( | |
1928 | + | @Callable(cg) | |
1865 | 1929 | func payFunding () = { | |
1866 | - | let | |
1867 | - | if (if (if (( | |
1930 | + | let jC = bN() | |
1931 | + | if (if (if ((jC > lastBlock.timestamp)) | |
1868 | 1932 | then true | |
1869 | - | else !( | |
1933 | + | else !(cx())) | |
1870 | 1934 | then true | |
1871 | - | else | |
1872 | - | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString( | |
1935 | + | else cy()) | |
1936 | + | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(jC))) | |
1873 | 1937 | else { | |
1874 | - | let | |
1875 | - | let | |
1876 | - | let | |
1877 | - | let | |
1878 | - | | |
1879 | - | } | |
1880 | - | } | |
1881 | - | ||
1882 | - | ||
1883 | - | ||
1884 | - | @Callable( | |
1938 | + | let fD = dz() | |
1939 | + | let jD = fC() | |
1940 | + | let fG = jD._1 | |
1941 | + | let fH = jD._2 | |
1942 | + | gx((jC + bQ()), (bY() + fH), (bZ() + fG), aR(fH, fD), aR(fG, fD)) | |
1943 | + | } | |
1944 | + | } | |
1945 | + | ||
1946 | + | ||
1947 | + | ||
1948 | + | @Callable(cg) | |
1885 | 1949 | func syncTerminalPriceToOracle () = { | |
1886 | - | let jp = fs(dv()) | |
1887 | - | let jq = jp._1 | |
1888 | - | let jr = jp._2 | |
1889 | - | let ez = jp._3 | |
1890 | - | let jm = invoke(ap(), "exchangeFreeAndLocked", [ez], nil) | |
1891 | - | if ((jm == jm)) | |
1892 | - | then gs(jq, jr) | |
1950 | + | let jE = fy(dz()) | |
1951 | + | let jF = jE._1 | |
1952 | + | let jG = jE._2 | |
1953 | + | let eF = jE._3 | |
1954 | + | let jH = if ((eF != 0)) | |
1955 | + | then { | |
1956 | + | let jH = invoke(ar(), "exchangeFreeAndLocked", [eF], nil) | |
1957 | + | if ((jH == jH)) | |
1958 | + | then nil | |
1959 | + | else throw("Strict value is not equal to itself.") | |
1960 | + | } | |
1961 | + | else nil | |
1962 | + | if ((jH == jH)) | |
1963 | + | then gT(jF, jG) | |
1893 | 1964 | else throw("Strict value is not equal to itself.") | |
1894 | 1965 | } | |
1895 | 1966 | ||
1896 | 1967 | ||
1897 | 1968 | ||
1898 | - | @Callable( | |
1899 | - | func view_calcRemainMarginWithFundingPayment ( | |
1900 | - | let | |
1901 | - | if (( | |
1969 | + | @Callable(cg) | |
1970 | + | func view_calcRemainMarginWithFundingPayment (cp) = { | |
1971 | + | let hu = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1972 | + | if ((hu == hu)) | |
1902 | 1973 | then { | |
1903 | - | let | |
1904 | - | let | |
1905 | - | let | |
1906 | - | let | |
1907 | - | let | |
1908 | - | let | |
1909 | - | let | |
1910 | - | let | |
1911 | - | let | |
1912 | - | let | |
1913 | - | let | |
1914 | - | let | |
1915 | - | throw(((((( | |
1974 | + | let jI = co(cp) | |
1975 | + | let cs = jI._1 | |
1976 | + | let eh = jI._2 | |
1977 | + | let eq = jI._3 | |
1978 | + | let ej = jI._4 | |
1979 | + | let jJ = ef(cp, aN) | |
1980 | + | let dW = jJ._1 | |
1981 | + | let ee = jJ._2 | |
1982 | + | let jK = dd(cs, eh, ej, ee) | |
1983 | + | let dm = jK._1 | |
1984 | + | let dn = jK._2 | |
1985 | + | let di = jK._3 | |
1986 | + | throw((((((aP(dm) + aP(di)) + aP(et(cp))) + aP(ee)) + aP(dn)) + aP(dW))) | |
1916 | 1987 | } | |
1917 | 1988 | else throw("Strict value is not equal to itself.") | |
1918 | 1989 | } | |
1919 | 1990 | ||
1920 | 1991 | ||
1921 | 1992 | ||
1922 | - | @Callable( | |
1923 | - | func view_getPegAdjustCost ( | |
1924 | - | let | |
1925 | - | throw(toString( | |
1926 | - | } | |
1927 | - | ||
1928 | - | ||
1929 | - | ||
1930 | - | @Callable( | |
1993 | + | @Callable(cg) | |
1994 | + | func view_getPegAdjustCost (gM) = { | |
1995 | + | let fx = fy(gM) | |
1996 | + | throw(toString(fx._3)) | |
1997 | + | } | |
1998 | + | ||
1999 | + | ||
2000 | + | ||
2001 | + | @Callable(cg) | |
1931 | 2002 | func view_getTerminalAmmPrice () = { | |
1932 | - | let | |
1933 | - | let | |
1934 | - | let | |
1935 | - | let | |
1936 | - | throw(toString( | |
1937 | - | } | |
1938 | - | ||
1939 | - | ||
1940 | - | ||
1941 | - | @Callable( | |
2003 | + | let jL = fb() | |
2004 | + | let ff = jL._1 | |
2005 | + | let fg = jL._2 | |
2006 | + | let hj = aR(aT(ff, bH()), aT(fg, bI())) | |
2007 | + | throw(toString(hj)) | |
2008 | + | } | |
2009 | + | ||
2010 | + | ||
2011 | + | ||
2012 | + | @Callable(cg) | |
1942 | 2013 | func view_getFunding () = { | |
1943 | - | let | |
1944 | - | let | |
1945 | - | let | |
1946 | - | let | |
1947 | - | let | |
1948 | - | let | |
1949 | - | throw(((( | |
1950 | - | } | |
1951 | - | ||
1952 | - | ||
1953 | - | ||
1954 | - | @Callable( | |
1955 | - | func view_getBorrowedByTrader ( | |
1956 | - | let | |
1957 | - | let | |
1958 | - | let | |
1959 | - | throw(( | |
1960 | - | } | |
1961 | - | ||
1962 | - | ||
1963 | - | ||
1964 | - | @Callable( | |
2014 | + | let fD = dz() | |
2015 | + | let jM = fC() | |
2016 | + | let fG = jM._1 | |
2017 | + | let fH = jM._2 | |
2018 | + | let jN = aR(fH, fD) | |
2019 | + | let jO = aR(fG, fD) | |
2020 | + | throw((((aP(jN) + aP(jO)) + aP(eL())) + aP(dz()))) | |
2021 | + | } | |
2022 | + | ||
2023 | + | ||
2024 | + | ||
2025 | + | @Callable(cg) | |
2026 | + | func view_getBorrowedByTrader (cp) = { | |
2027 | + | let jP = fX(cp) | |
2028 | + | let iC = jP._1 | |
2029 | + | let iD = jP._2 | |
2030 | + | throw((aP(iC) + iD)) | |
2031 | + | } | |
2032 | + | ||
2033 | + | ||
2034 | + | ||
2035 | + | @Callable(cg) | |
1965 | 2036 | func computeSpotPrice () = { | |
1966 | - | let | |
1967 | - | $Tuple2(nil, | |
1968 | - | } | |
1969 | - | ||
1970 | - | ||
1971 | - | ||
1972 | - | @Callable( | |
1973 | - | func computeFeeForTraderWithArtifact ( | |
1974 | - | let | |
1975 | - | $Tuple2(nil, | |
1976 | - | } | |
1977 | - | ||
1978 | - | ||
1979 | - | @Verifier( | |
1980 | - | func | |
2037 | + | let fx = dP() | |
2038 | + | $Tuple2(nil, fx) | |
2039 | + | } | |
2040 | + | ||
2041 | + | ||
2042 | + | ||
2043 | + | @Callable(cg) | |
2044 | + | func computeFeeForTraderWithArtifact (cp,fJ) = { | |
2045 | + | let fx = ga(cp, fJ) | |
2046 | + | $Tuple2(nil, fx) | |
2047 | + | } | |
2048 | + | ||
2049 | + | ||
2050 | + | @Verifier(jQ) | |
2051 | + | func jR () = sigVerify(jQ.bodyBytes, jQ.proofs[0], an()) | |
1981 | 2052 |
github/deemru/w8io/169f3d6 658.43 ms ◑