tx · G7FXZm7SAJJt3w4FYMYKa97zdrFBQqRBG961NkLTHbhM

3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y:  -0.03700000 Waves

2022.12.26 22:41 [2377687] smart account 3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y > SELF 0.00000000 Waves

{ "type": 13, "id": "G7FXZm7SAJJt3w4FYMYKa97zdrFBQqRBG961NkLTHbhM", "fee": 3700000, "feeAssetId": null, "timestamp": 1672083711726, "version": 2, "chainId": 84, "sender": "3N9kbR6BQEQV7pwBfDFzprJtNofgi6fSJ6Y", "senderPublicKey": "EajGg1J8duApPELWPw9gVkPwAKFC9hujhvCcne4FunUa", "proofs": [ "21kJCcLCXnTkdFUvArfDVVWk3dUoryr3i3Yw3c9DFQf9vuniYX1r5UXi1NorTVWueRMT5EXFV1kaPNt1u6WvKMhZ" ], "script": "base64:BgJLCAISBAoCCAgSAwoBCBIAEgMKAQgSCgoICAEBAQEBAQgSCwoJCAEBAQgBAQEBEg0KCwgIAQEBAQEBCAgBEgMKAQESAwoBARIDCgEBOwAUa19jb29yZGluYXRvckFkZHJlc3MCFGtfY29vcmRpbmF0b3JBZGRyZXNzABJrX2FkbWluX3B1YmxpY19rZXkCEmtfYWRtaW5fcHVibGljX2tleQANa19xdW90ZV9hc3NldAINa19xdW90ZV9hc3NldAAFa19hbW0CBWtfYW1tABFrX21hbmFnZXJfYWRkcmVzcwIRa19tYW5hZ2VyX2FkZHJlc3MAEmtfcG9zaXRpb25TZXF1ZW5jZQISa19wb3NpdGlvblNlcXVlbmNlAA5rX3Bvc2l0aW9uU2l6ZQIOa19wb3NpdGlvblNpemUABWtfZmVlAgVrX2ZlZQAQa19leGVjdXRlZE9yZGVycwIQa19leGVjdXRlZE9yZGVycwAQa19jYW5jZWxlZE9yZGVycwIQa19jYW5jZWxlZE9yZGVycwAHa19vcmRlcgIHa19vcmRlcgANa19sYXN0T3JkZXJJZAINa19sYXN0T3JkZXJJZAAQa190cmFkZXJP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BQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5ABy9SNs=", "height": 2377687, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: Fj8LyeAxMh3HyxXSCJcfdzuxbkP34QExpoCxpuGYvYrU Next: Etj6dUa2n6myFoCEbpYbRn5tSEgTQfA1DFDKs8ejWgs Diff:
OldNewDifferences
230230 @Callable(i)
231231 func cleanUpStaleOrders (_amm,_trader) = {
232232 let orders = traderAmmOrdersIds(_amm, _trader)
233+ let orderCount = getTraderOrderCount(_amm, _trader)
233234 func cleanUpOne (_acc,_orderId) = {
234235 let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id")
235- let $t083208515 = getOrder(orderIdInt)
236- let _x1 = $t083208515._1
237- let _x2 = $t083208515._2
238- let _x3 = $t083208515._3
239- let _x4 = $t083208515._4
240- let _type = $t083208515._5
241- let _x5 = $t083208515._6
242- let _x6 = $t083208515._7
243- let _x7 = $t083208515._8
244- let _x8 = $t083208515._9
245- let _positionId = $t083208515._10
246- let _x9 = $t083208515._11
236+ let $t083838578 = getOrder(orderIdInt)
237+ let _x1 = $t083838578._1
238+ let _x2 = $t083838578._2
239+ let _x3 = $t083838578._3
240+ let _x4 = $t083838578._4
241+ let _type = $t083838578._5
242+ let _x5 = $t083838578._6
243+ let _x6 = $t083838578._7
244+ let _x7 = $t083838578._8
245+ let _x8 = $t083838578._9
246+ let _positionId = $t083838578._10
247+ let _x9 = $t083838578._11
247248 let positionSize = getPositionSize(_amm, _trader)
248249 let currentPositionId = if ((positionSize != 0))
249250 then getPositionId(_amm, _trader)
255256 else false)
256257 then {
257258 let change = (markCancelOrder(orderIdInt) ++ addRemoveOrderId(orderIdInt, _amm, _trader, false))
258- (_acc ++ change)
259+ $Tuple2((_acc._1 + 1), (_acc._2 ++ change))
259260 }
260261 else _acc
261262 }
262263
263- let $l = orders
264- let $s = size($l)
265- let $acc0 = nil
266- func $f0_1 ($a,$i) = if (($i >= $s))
267- then $a
268- else cleanUpOne($a, $l[$i])
264+ let result = {
265+ let $l = orders
266+ let $s = size($l)
267+ let $acc0 = $Tuple2(0, nil)
268+ func $f0_1 ($a,$i) = if (($i >= $s))
269+ then $a
270+ else cleanUpOne($a, $l[$i])
269271
270- func $f0_2 ($a,$i) = if (($i >= $s))
271- then $a
272- else throw("List size exceeds 5")
272+ func $f0_2 ($a,$i) = if (($i >= $s))
273+ then $a
274+ else throw("List size exceeds 5")
273275
274- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
276+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
277+ }
278+ (result._2 ++ updateTraderOrderCount(_amm, _trader, (orderCount - result._1)))
275279 }
276280
277281
305309 then if ((size(i.payments) > 1))
306310 then throw("Invalid createOrder parameters: invalid payment count")
307311 else {
308- let $t01010010352 = if ((size(i.payments) == 1))
312+ let $t01028710539 = if ((size(i.payments) == 1))
309313 then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount)
310314 else $Tuple2("", 0)
311- let paymentAssetId = $t01010010352._1
312- let paymentAmount = $t01010010352._2
315+ let paymentAssetId = $t01028710539._1
316+ let paymentAmount = $t01028710539._2
313317 let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil)
314318 if ((doCall == doCall))
315319 then nil
464468
465469 @Callable(i)
466470 func cancelOrder (_orderId) = {
467- let $t01572115940 = getOrder(_orderId)
468- let _amm = $t01572115940._1
469- let _trader = $t01572115940._2
470- let _amountIn = $t01572115940._3
471- let _leverage = $t01572115940._4
472- let _type = $t01572115940._5
473- let _triggerPrice = $t01572115940._6
474- let _amountUsdn = $t01572115940._7
475- let _side = $t01572115940._8
476- let _refLink = $t01572115940._9
477- let _positionId = $t01572115940._10
478- let _limitPrice = $t01572115940._11
471+ let $t01590816127 = getOrder(_orderId)
472+ let _amm = $t01590816127._1
473+ let _trader = $t01590816127._2
474+ let _amountIn = $t01590816127._3
475+ let _leverage = $t01590816127._4
476+ let _type = $t01590816127._5
477+ let _triggerPrice = $t01590816127._6
478+ let _amountUsdn = $t01590816127._7
479+ let _side = $t01590816127._8
480+ let _refLink = $t01590816127._9
481+ let _positionId = $t01590816127._10
482+ let _limitPrice = $t01590816127._11
479483 if (if (if (!(initialized()))
480484 then true
481485 else !(isValid(_orderId)))
509513
510514 @Callable(i)
511515 func executeOrder (_orderId) = {
512- let $t01691117130 = getOrder(_orderId)
513- let _amm = $t01691117130._1
514- let _trader = $t01691117130._2
515- let _amountIn = $t01691117130._3
516- let _leverage = $t01691117130._4
517- let _type = $t01691117130._5
518- let _triggerPrice = $t01691117130._6
519- let _amountUsdn = $t01691117130._7
520- let _side = $t01691117130._8
521- let _refLink = $t01691117130._9
522- let _positionId = $t01691117130._10
523- let _limitPrice = $t01691117130._11
516+ let $t01709817317 = getOrder(_orderId)
517+ let _amm = $t01709817317._1
518+ let _trader = $t01709817317._2
519+ let _amountIn = $t01709817317._3
520+ let _leverage = $t01709817317._4
521+ let _type = $t01709817317._5
522+ let _triggerPrice = $t01709817317._6
523+ let _amountUsdn = $t01709817317._7
524+ let _side = $t01709817317._8
525+ let _refLink = $t01709817317._9
526+ let _positionId = $t01709817317._10
527+ let _limitPrice = $t01709817317._11
524528 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
525529 if ((cleanUp == cleanUp))
526530 then if (if (!(initialized()))
532536 let currentPositionId = if ((positionSize != 0))
533537 then getPositionId(_amm, _trader)
534538 else 0
535- let $t01753821359 = if ((_type == STOP))
539+ let $t01772121542 = if ((_type == STOP))
536540 then {
537541 let _positionDirection = if ((positionSize > 0))
538542 then LONG
603607 else throw("Can not execute LIMIT order: triggerPrice mismatch")
604608 }
605609 else throw(("Invalid order type: " + toString(_type)))
606- let method = $t01753821359._1
607- let args = $t01753821359._2
608- let payments = $t01753821359._3
610+ let method = $t01772121542._1
611+ let args = $t01772121542._2
612+ let payments = $t01772121542._3
609613 let withdraw = if ((size(payments) == 1))
610614 then {
611615 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_coordinatorAddress = "k_coordinatorAddress"
55
66 let k_admin_public_key = "k_admin_public_key"
77
88 let k_quote_asset = "k_quote_asset"
99
1010 let k_amm = "k_amm"
1111
1212 let k_manager_address = "k_manager_address"
1313
1414 let k_positionSequence = "k_positionSequence"
1515
1616 let k_positionSize = "k_positionSize"
1717
1818 let k_fee = "k_fee"
1919
2020 let k_executedOrders = "k_executedOrders"
2121
2222 let k_canceledOrders = "k_canceledOrders"
2323
2424 let k_order = "k_order"
2525
2626 let k_lastOrderId = "k_lastOrderId"
2727
2828 let k_traderOrderCnt = "k_traderOrderCnt"
2929
3030 let k_traderOrderIds = "k_traderOrderIds"
3131
3232 let k_sender = "k_sender"
3333
3434 let k_initialized = "k_initialized"
3535
3636 let STOP = 1
3737
3838 let TAKE = 2
3939
4040 let LIMIT = 3
4141
4242 let LONG = 1
4343
4444 let SHORT = 2
4545
4646 let INCREASE = 1
4747
4848 let DECREASE = 2
4949
5050 let MAX_TRADER_ORDERS_PER_AMM = 5
5151
5252 let TIME = lastBlock.timestamp
5353
5454 let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10))
5555
5656 let SPREAD_LIMIT = (DECIMAL_UNIT / 200)
5757
5858 func abs (_x) = if ((_x > 0))
5959 then _x
6060 else -(_x)
6161
6262
6363 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
6464
6565
6666 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
6767
6868
6969 func minv (_x,_y) = if ((_x > _y))
7070 then _y
7171 else _x
7272
7373
7474 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
7575
7676
7777 func executedOrderKey (_orderId) = ((k_executedOrders + "_") + toString(_orderId))
7878
7979
8080 func canceledOrderKey (_orderId) = ((k_canceledOrders + "_") + toString(_orderId))
8181
8282
8383 func orderKey (_orderId) = toCompositeKey(k_order, toString(_orderId))
8484
8585
8686 func traderOrderCountKey (_amm,_trader) = ((((k_traderOrderCnt + "_") + _amm) + "_") + _trader)
8787
8888
8989 func traderOrderIdsKey (_amm,_trader) = ((((k_traderOrderIds + "_") + _amm) + "_") + _trader)
9090
9191
9292 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set")
9393
9494
9595 func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset))
9696
9797
9898 func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set")
9999
100100
101101 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
102102
103103
104104 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
105105
106106
107107 func initialized () = valueOrElse(getBoolean(this, k_initialized), false)
108108
109109
110110 func isValid (_orderId) = if (valueOrElse(getBoolean(this, executedOrderKey(_orderId)), false))
111111 then throw(("Order already executed: " + toString(_orderId)))
112112 else if (valueOrElse(getBoolean(this, canceledOrderKey(_orderId)), false))
113113 then throw(("Order already cancelled: " + toString(_orderId)))
114114 else true
115115
116116
117117 func currentOrderId () = valueOrElse(getInteger(this, k_lastOrderId), 0)
118118
119119
120120 func getTraderOrderCount (_amm,_trader) = {
121121 let key = traderOrderCountKey(_amm, _trader)
122122 valueOrElse(getInteger(this, key), 0)
123123 }
124124
125125
126126 func traderAmmOrdersIds (_amm,_trader) = {
127127 let key = traderOrderIdsKey(_amm, _trader)
128128 let val = valueOrElse(getString(this, key), "")
129129 if ((val == ""))
130130 then nil
131131 else split(val, ",")
132132 }
133133
134134
135135 func getOrder (_orderId) = {
136136 let orderStr = valueOrErrorMessage(getString(this, orderKey(_orderId)), ("Invalid order id: " + toString(_orderId)))
137137 let orderPartList = split(orderStr, ",")
138138 let amm = orderPartList[0]
139139 let trader = orderPartList[1]
140140 let amountIn = valueOrErrorMessage(parseInt(orderPartList[2]), "Invalid amountIn")
141141 let leverage = valueOrErrorMessage(parseInt(orderPartList[3]), "Invalid leverage")
142142 let type = valueOrErrorMessage(parseInt(orderPartList[4]), "Invalid type")
143143 let triggerPrice = valueOrErrorMessage(parseInt(orderPartList[5]), "Invalid triggerPrice")
144144 let paymentUsdn = valueOrErrorMessage(parseInt(orderPartList[6]), "Invalid paymentUsdn")
145145 let side = valueOrErrorMessage(parseInt(orderPartList[7]), "Invalid side")
146146 let refLink = orderPartList[8]
147147 let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId")
148148 let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice")
149149 $Tuple11(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice)
150150 }
151151
152152
153153 func getMarketPrice (_amm) = {
154154 let s = invoke(addressFromStringValue(_amm), "computeSpotPrice", nil, nil)
155155 if ((s == s))
156156 then {
157157 let res = match s {
158158 case t: Int =>
159159 t
160160 case _ =>
161161 throw("Invalid computeSpotPrice result")
162162 }
163163 value(res)
164164 }
165165 else throw("Strict value is not equal to itself.")
166166 }
167167
168168
169169 func getFee (_amm,_trader) = {
170170 let s = invoke(addressFromStringValue(_amm), "computeFeeForTraderWithArtifact", [_trader, ""], nil)
171171 if ((s == s))
172172 then {
173173 let res = match s {
174174 case t: (Int, Boolean) =>
175175 t._1
176176 case _ =>
177177 throw("Invalid computeFeeForTraderWithArtifact result")
178178 }
179179 value(res)
180180 }
181181 else throw("Strict value is not equal to itself.")
182182 }
183183
184184
185185 func getPositionSize (_amm,_trader) = {
186186 let amm = addressFromStringValue(_amm)
187187 let sizeKey = toCompositeKey(k_positionSize, _trader)
188188 valueOrElse(getInteger(amm, sizeKey), 0)
189189 }
190190
191191
192192 func getPositionId (_amm,_trader) = {
193193 let amm = addressFromStringValue(_amm)
194194 let seqKey = toCompositeKey(k_positionSequence, _trader)
195195 valueOrElse(getInteger(amm, seqKey), 0)
196196 }
197197
198198
199199 func getSpread (_price) = muld(_price, SPREAD_LIMIT)
200200
201201
202202 func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice) = {
203203 let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice)], ",")
204204 [StringEntry(orderKey(_orderId), orderStr)]
205205 }
206206
207207
208208 func addRemoveOrderId (_orderId,_amm,_trader,_add) = {
209209 let orderIds = traderAmmOrdersIds(_amm, _trader)
210210 let orderIdsNew = if (_add)
211211 then (orderIds :+ toString(_orderId))
212212 else removeByIndex(orderIds, valueOrErrorMessage(indexOf(orderIds, toString(_orderId)), ("No order with id: " + toString(_orderId))))
213213 let orderIdsNewStr = makeString(orderIdsNew, ",")
214214 [StringEntry(traderOrderIdsKey(_amm, _trader), orderIdsNewStr)]
215215 }
216216
217217
218218 func updateTraderOrderCount (_amm,_trader,_count) = [IntegerEntry(traderOrderCountKey(_amm, _trader), _count)]
219219
220220
221221 func updateLastOrderId (_lastOrderId) = [IntegerEntry(k_lastOrderId, _lastOrderId)]
222222
223223
224224 func markExecuteOrder (_orderId) = [BooleanEntry(toCompositeKey(k_executedOrders, toString(_orderId)), true)]
225225
226226
227227 func markCancelOrder (_orderId) = [BooleanEntry(toCompositeKey(k_canceledOrders, toString(_orderId)), true)]
228228
229229
230230 @Callable(i)
231231 func cleanUpStaleOrders (_amm,_trader) = {
232232 let orders = traderAmmOrdersIds(_amm, _trader)
233+ let orderCount = getTraderOrderCount(_amm, _trader)
233234 func cleanUpOne (_acc,_orderId) = {
234235 let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id")
235- let $t083208515 = getOrder(orderIdInt)
236- let _x1 = $t083208515._1
237- let _x2 = $t083208515._2
238- let _x3 = $t083208515._3
239- let _x4 = $t083208515._4
240- let _type = $t083208515._5
241- let _x5 = $t083208515._6
242- let _x6 = $t083208515._7
243- let _x7 = $t083208515._8
244- let _x8 = $t083208515._9
245- let _positionId = $t083208515._10
246- let _x9 = $t083208515._11
236+ let $t083838578 = getOrder(orderIdInt)
237+ let _x1 = $t083838578._1
238+ let _x2 = $t083838578._2
239+ let _x3 = $t083838578._3
240+ let _x4 = $t083838578._4
241+ let _type = $t083838578._5
242+ let _x5 = $t083838578._6
243+ let _x6 = $t083838578._7
244+ let _x7 = $t083838578._8
245+ let _x8 = $t083838578._9
246+ let _positionId = $t083838578._10
247+ let _x9 = $t083838578._11
247248 let positionSize = getPositionSize(_amm, _trader)
248249 let currentPositionId = if ((positionSize != 0))
249250 then getPositionId(_amm, _trader)
250251 else 0
251252 if (if (if ((_type == STOP))
252253 then true
253254 else (_type == TAKE))
254255 then (currentPositionId != _positionId)
255256 else false)
256257 then {
257258 let change = (markCancelOrder(orderIdInt) ++ addRemoveOrderId(orderIdInt, _amm, _trader, false))
258- (_acc ++ change)
259+ $Tuple2((_acc._1 + 1), (_acc._2 ++ change))
259260 }
260261 else _acc
261262 }
262263
263- let $l = orders
264- let $s = size($l)
265- let $acc0 = nil
266- func $f0_1 ($a,$i) = if (($i >= $s))
267- then $a
268- else cleanUpOne($a, $l[$i])
264+ let result = {
265+ let $l = orders
266+ let $s = size($l)
267+ let $acc0 = $Tuple2(0, nil)
268+ func $f0_1 ($a,$i) = if (($i >= $s))
269+ then $a
270+ else cleanUpOne($a, $l[$i])
269271
270- func $f0_2 ($a,$i) = if (($i >= $s))
271- then $a
272- else throw("List size exceeds 5")
272+ func $f0_2 ($a,$i) = if (($i >= $s))
273+ then $a
274+ else throw("List size exceeds 5")
273275
274- $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
276+ $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
277+ }
278+ (result._2 ++ updateTraderOrderCount(_amm, _trader, (orderCount - result._1)))
275279 }
276280
277281
278282
279283 @Callable(i)
280284 func setContext (_sender) = if ((i.caller != this))
281285 then throw("Only self-call")
282286 else [StringEntry(k_sender, _sender)]
283287
284288
285289
286290 @Callable(i)
287291 func resetContext () = if ((i.caller != this))
288292 then throw("Only self-call")
289293 else [DeleteEntry(k_sender)]
290294
291295
292296
293297 @Callable(i)
294298 func initialize (_coordinator) = if (initialized())
295299 then throw("Already initialized")
296300 else [StringEntry(k_coordinatorAddress, _coordinator), BooleanEntry(k_initialized, true)]
297301
298302
299303
300304 @Callable(i)
301305 func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink) = {
302306 let _trader = toString(i.caller)
303307 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
304308 if ((cleanUp == cleanUp))
305309 then if ((size(i.payments) > 1))
306310 then throw("Invalid createOrder parameters: invalid payment count")
307311 else {
308- let $t01010010352 = if ((size(i.payments) == 1))
312+ let $t01028710539 = if ((size(i.payments) == 1))
309313 then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount)
310314 else $Tuple2("", 0)
311- let paymentAssetId = $t01010010352._1
312- let paymentAmount = $t01010010352._2
315+ let paymentAssetId = $t01028710539._1
316+ let paymentAmount = $t01028710539._2
313317 let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount], nil)
314318 if ((doCall == doCall))
315319 then nil
316320 else throw("Strict value is not equal to itself.")
317321 }
318322 else throw("Strict value is not equal to itself.")
319323 }
320324
321325
322326
323327 @Callable(i)
324328 func increasePositionWithStopLoss (_amm,_direction,_leverage,_minBaseAssetAmount,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice) = {
325329 let _trader = toString(i.caller)
326330 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
327331 if ((cleanUp == cleanUp))
328332 then if (if (!(initialized()))
329333 then true
330334 else !(isWhitelist(_amm)))
331335 then throw("Invalid increasePositionWithStopLoss parameters")
332336 else {
333337 let positionSize = getPositionSize(_amm, _trader)
334338 if ((positionSize != 0))
335339 then throw("Invalid increasePositionWithStopLoss parameters: only new position")
336340 else {
337341 let doSetContext = invoke(this, "setContext", [_trader], nil)
338342 if ((doSetContext == doSetContext))
339343 then {
340344 let doClosePosition = invoke(addressFromStringValue(_amm), "increasePosition", [_direction, _leverage, _minBaseAssetAmount, _refLink], i.payments)
341345 if ((doClosePosition == doClosePosition))
342346 then {
343347 let doResetContext = invoke(this, "resetContext", nil, nil)
344348 if ((doResetContext == doResetContext))
345349 then {
346350 let openedPositionSize = getPositionSize(_amm, _trader)
347351 if ((openedPositionSize == openedPositionSize))
348352 then {
349353 let amountIn = abs(openedPositionSize)
350354 let stopLossSide = if ((0 > openedPositionSize))
351355 then LONG
352356 else SHORT
353357 let doCreateStopOrder = if ((_stopTriggerPrice > 0))
354358 then {
355359 let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
356360 if ((doCreateStopOrder == doCreateStopOrder))
357361 then nil
358362 else throw("Strict value is not equal to itself.")
359363 }
360364 else nil
361365 if ((doCreateStopOrder == doCreateStopOrder))
362366 then {
363367 let doCreateTakeOrder = if ((_takeTriggerPrice > 0))
364368 then {
365369 let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0], nil)
366370 if ((doCreateTakeOrder == doCreateTakeOrder))
367371 then nil
368372 else throw("Strict value is not equal to itself.")
369373 }
370374 else nil
371375 if ((doCreateTakeOrder == doCreateTakeOrder))
372376 then nil
373377 else throw("Strict value is not equal to itself.")
374378 }
375379 else throw("Strict value is not equal to itself.")
376380 }
377381 else throw("Strict value is not equal to itself.")
378382 }
379383 else throw("Strict value is not equal to itself.")
380384 }
381385 else throw("Strict value is not equal to itself.")
382386 }
383387 else throw("Strict value is not equal to itself.")
384388 }
385389 }
386390 else throw("Strict value is not equal to itself.")
387391 }
388392
389393
390394
391395 @Callable(i)
392396 func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount) = if (if (if (if (if (if (if (if (if (!(initialized()))
393397 then true
394398 else !(isWhitelist(_amm)))
395399 then true
396400 else (0 >= _triggerPrice))
397401 then true
398402 else (0 > _limitPrice))
399403 then true
400404 else (0 >= _amountIn))
401405 then true
402406 else (0 > _leverage))
403407 then true
404408 else !(if ((_side == LONG))
405409 then true
406410 else (_side == SHORT)))
407411 then true
408412 else !(if (if ((_type == STOP))
409413 then true
410414 else (_type == TAKE))
411415 then true
412416 else (_type == LIMIT)))
413417 then true
414418 else !((i.caller == this)))
415419 then throw("Invalid createOrder parameters")
416420 else {
417421 let orderId = (currentOrderId() + 1)
418422 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1)
419423 let positionSize = getPositionSize(_amm, _trader)
420424 let _direction = if (if (if ((positionSize == 0))
421425 then true
422426 else if ((positionSize > 0))
423427 then (_side == LONG)
424428 else false)
425429 then true
426430 else if ((0 > positionSize))
427431 then (_side == SHORT)
428432 else false)
429433 then INCREASE
430434 else DECREASE
431435 if (if ((positionSize == 0))
432436 then if ((_type == STOP))
433437 then true
434438 else (_type == TAKE)
435439 else false)
436440 then throw("Can not create STOP/TAKE order: no position")
437441 else {
438442 let usdnPayment = if ((_direction == INCREASE))
439443 then if (if ((_paymentAssetId != toBase58String(quoteAsset())))
440444 then true
441445 else (_paymentAmount != _amountIn))
442446 then throw("Invalid createLimitOrder parameters: invalid payment")
443447 else {
444448 let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)])
445449 if ((stake == stake))
446450 then _paymentAmount
447451 else throw("Strict value is not equal to itself.")
448452 }
449453 else 0
450454 if ((usdnPayment == usdnPayment))
451455 then {
452456 let positionId = if ((positionSize != 0))
453457 then getPositionId(_amm, _trader)
454458 else 0
455459 if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM))
456460 then throw("Invalid createLimitOrder parameters: order count")
457461 else (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId))
458462 }
459463 else throw("Strict value is not equal to itself.")
460464 }
461465 }
462466
463467
464468
465469 @Callable(i)
466470 func cancelOrder (_orderId) = {
467- let $t01572115940 = getOrder(_orderId)
468- let _amm = $t01572115940._1
469- let _trader = $t01572115940._2
470- let _amountIn = $t01572115940._3
471- let _leverage = $t01572115940._4
472- let _type = $t01572115940._5
473- let _triggerPrice = $t01572115940._6
474- let _amountUsdn = $t01572115940._7
475- let _side = $t01572115940._8
476- let _refLink = $t01572115940._9
477- let _positionId = $t01572115940._10
478- let _limitPrice = $t01572115940._11
471+ let $t01590816127 = getOrder(_orderId)
472+ let _amm = $t01590816127._1
473+ let _trader = $t01590816127._2
474+ let _amountIn = $t01590816127._3
475+ let _leverage = $t01590816127._4
476+ let _type = $t01590816127._5
477+ let _triggerPrice = $t01590816127._6
478+ let _amountUsdn = $t01590816127._7
479+ let _side = $t01590816127._8
480+ let _refLink = $t01590816127._9
481+ let _positionId = $t01590816127._10
482+ let _limitPrice = $t01590816127._11
479483 if (if (if (!(initialized()))
480484 then true
481485 else !(isValid(_orderId)))
482486 then true
483487 else !((toString(i.caller) == _trader)))
484488 then throw("Invalid cancelOrder parameters")
485489 else {
486490 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
487491 if ((cleanUp == cleanUp))
488492 then {
489493 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
490494 let withdraw = if ((_amountUsdn > 0))
491495 then {
492496 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amountUsdn], nil)
493497 if ((unstake == unstake))
494498 then nil
495499 else throw("Strict value is not equal to itself.")
496500 }
497501 else nil
498502 if ((withdraw == withdraw))
499503 then (((markCancelOrder(_orderId) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ (if ((_amountUsdn > 0))
500504 then [ScriptTransfer(i.caller, _amountUsdn, quoteAsset())]
501505 else nil))
502506 else throw("Strict value is not equal to itself.")
503507 }
504508 else throw("Strict value is not equal to itself.")
505509 }
506510 }
507511
508512
509513
510514 @Callable(i)
511515 func executeOrder (_orderId) = {
512- let $t01691117130 = getOrder(_orderId)
513- let _amm = $t01691117130._1
514- let _trader = $t01691117130._2
515- let _amountIn = $t01691117130._3
516- let _leverage = $t01691117130._4
517- let _type = $t01691117130._5
518- let _triggerPrice = $t01691117130._6
519- let _amountUsdn = $t01691117130._7
520- let _side = $t01691117130._8
521- let _refLink = $t01691117130._9
522- let _positionId = $t01691117130._10
523- let _limitPrice = $t01691117130._11
516+ let $t01709817317 = getOrder(_orderId)
517+ let _amm = $t01709817317._1
518+ let _trader = $t01709817317._2
519+ let _amountIn = $t01709817317._3
520+ let _leverage = $t01709817317._4
521+ let _type = $t01709817317._5
522+ let _triggerPrice = $t01709817317._6
523+ let _amountUsdn = $t01709817317._7
524+ let _side = $t01709817317._8
525+ let _refLink = $t01709817317._9
526+ let _positionId = $t01709817317._10
527+ let _limitPrice = $t01709817317._11
524528 let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil)
525529 if ((cleanUp == cleanUp))
526530 then if (if (!(initialized()))
527531 then true
528532 else !(isValid(_orderId)))
529533 then throw("Invalid executeOrder parameters")
530534 else {
531535 let positionSize = getPositionSize(_amm, _trader)
532536 let currentPositionId = if ((positionSize != 0))
533537 then getPositionId(_amm, _trader)
534538 else 0
535- let $t01753821359 = if ((_type == STOP))
539+ let $t01772121542 = if ((_type == STOP))
536540 then {
537541 let _positionDirection = if ((positionSize > 0))
538542 then LONG
539543 else if ((0 > positionSize))
540544 then SHORT
541545 else throw("Can not execute STOP order: no open position")
542546 let marketPrice = getMarketPrice(_amm)
543547 let isExecutable = if ((_side == _positionDirection))
544548 then throw("Can not execute STOP order: reduce only")
545549 else if ((currentPositionId != _positionId))
546550 then throw("Can not execute STOP order: position closed")
547551 else if ((_positionDirection == LONG))
548552 then (_triggerPrice >= marketPrice)
549553 else (marketPrice >= _triggerPrice)
550554 if (isExecutable)
551555 then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
552556 else throw("Can not execute STOP order: triggerPrice mismatch")
553557 }
554558 else if ((_type == TAKE))
555559 then {
556560 let _positionDirection = if ((positionSize > 0))
557561 then LONG
558562 else if ((0 > positionSize))
559563 then SHORT
560564 else throw("Can not execute STOP order: no open position")
561565 let marketPrice = getMarketPrice(_amm)
562566 let isExecutable = if ((_side == _positionDirection))
563567 then throw("Can not execute TAKE order: reduce only")
564568 else if ((currentPositionId != _positionId))
565569 then throw(((("Can not execute TAKE order: position closed " + toString(currentPositionId)) + "!=") + toString(_positionId)))
566570 else if ((_positionDirection == LONG))
567571 then (marketPrice >= _triggerPrice)
568572 else (_triggerPrice >= marketPrice)
569573 if (isExecutable)
570574 then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), muld(_limitPrice, abs(positionSize))], nil)
571575 else throw("Can not execute TAKE order: triggerPrice mismatch")
572576 }
573577 else if ((_type == LIMIT))
574578 then {
575579 let marketPrice = getMarketPrice(_amm)
576580 let spread = if ((_limitPrice == 0))
577581 then getSpread(_triggerPrice)
578582 else abs((_triggerPrice - _limitPrice))
579583 let isExecutable = if ((marketPrice >= (_triggerPrice - spread)))
580584 then ((_triggerPrice + spread) >= marketPrice)
581585 else false
582586 if (isExecutable)
583587 then {
584588 let _positionDirection = if ((positionSize > 0))
585589 then LONG
586590 else if ((0 > positionSize))
587591 then SHORT
588592 else -1
589593 let direction = if ((positionSize == 0))
590594 then INCREASE
591595 else if ((_positionDirection == _side))
592596 then INCREASE
593597 else DECREASE
594598 if ((direction == INCREASE))
595599 then {
596600 let amountInWithFee = (_amountUsdn - muld(_amountUsdn, getFee(_amm, _trader)))
597601 $Tuple3("increasePosition", [_side, _leverage, if ((_limitPrice == 0))
598602 then 0
599603 else divd(amountInWithFee, _limitPrice), _refLink], [AttachedPayment(quoteAsset(), _amountUsdn)])
600604 }
601605 else $Tuple3("closePosition", [_amountIn, muld(_amountIn, _limitPrice)], nil)
602606 }
603607 else throw("Can not execute LIMIT order: triggerPrice mismatch")
604608 }
605609 else throw(("Invalid order type: " + toString(_type)))
606- let method = $t01753821359._1
607- let args = $t01753821359._2
608- let payments = $t01753821359._3
610+ let method = $t01772121542._1
611+ let args = $t01772121542._2
612+ let payments = $t01772121542._3
609613 let withdraw = if ((size(payments) == 1))
610614 then {
611615 let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil)
612616 if ((unstake == unstake))
613617 then nil
614618 else throw("Strict value is not equal to itself.")
615619 }
616620 else nil
617621 if ((withdraw == withdraw))
618622 then {
619623 let doSetContext = invoke(this, "setContext", [_trader], nil)
620624 if ((doSetContext == doSetContext))
621625 then {
622626 let doClosePosition = invoke(addressFromStringValue(_amm), method, args, payments)
623627 if ((doClosePosition == doClosePosition))
624628 then {
625629 let doResetContext = invoke(this, "resetContext", nil, nil)
626630 if ((doResetContext == doResetContext))
627631 then {
628632 let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1)
629633 ((updateTraderOrderCount(_amm, _trader, newTraderOrderCount) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ markExecuteOrder(_orderId))
630634 }
631635 else throw("Strict value is not equal to itself.")
632636 }
633637 else throw("Strict value is not equal to itself.")
634638 }
635639 else throw("Strict value is not equal to itself.")
636640 }
637641 else throw("Strict value is not equal to itself.")
638642 }
639643 else throw("Strict value is not equal to itself.")
640644 }
641645
642646
643647
644648 @Callable(i)
645649 func view_canExecuteOrder (_orderId) = {
646650 let s = invoke(this, "executeOrder", [_orderId], nil)
647651 if ((s == s))
648652 then throw("Success")
649653 else throw("Strict value is not equal to itself.")
650654 }
651655
652656
653657 @Verifier(tx)
654658 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
655659

github/deemru/w8io/026f985 
84.94 ms