tx · 9rESm3oA7kVdNgEyyp3e8Q25pNfnzL1Le9RHd9Bowmrf 3N6VKmg8fcTLVZtzTGJTd2gfjmK3VYobQf1: -0.03700000 Waves 2023.05.27 12:10 [2596165] smart account 3N6VKmg8fcTLVZtzTGJTd2gfjmK3VYobQf1 > SELF 0.00000000 Waves
{ "type": 13, "id": "9rESm3oA7kVdNgEyyp3e8Q25pNfnzL1Le9RHd9Bowmrf", "fee": 3700000, "feeAssetId": null, "timestamp": 1685178635807, "version": 2, "chainId": 84, "sender": "3N6VKmg8fcTLVZtzTGJTd2gfjmK3VYobQf1", "senderPublicKey": "A2kf7bN5S7rrpJUdubvPFNzkrSEL8uTN8Hc2Sya5cZth", "proofs": [ "4KDPQPL6wcE9R338HezKgUk2iS5Xp1sfYAJUBAt7wagE7QJ5gwkVx2hPV2g6NvJEnGqhvWUVKG6zg32g7uJqWxje" ], "script": "base64:BgJrCAISBAoCCAgSAwoBCBIAEgQKAggBEgMKAQESDwoNCAEBAQEBAQgBAQEBARIMCgoIAQEBCAEBAQEIEgUKAwgIARIICgYICAEBAQESDgoMCAgBAQEBAQEICAEBEgMKAQESBAoCAQgSBAoCAQhEABRrX2Nvb3JkaW5hdG9yQWRkcmVzcwIUa19jb29yZGluYXRvckFkZHJlc3MAD2tfYWRtaW5fYWRkcmVzcwIPa19hZG1pbl9hZGRyZXNzAA1rX3F1b3RlX2Fzc2V0Ag1rX3F1b3RlX2Fzc2V0AAVrX2FtbQIFa19hbW0AEWtfbWFuYWdlcl9hZGRyZXNzAhFrX21hbmFnZXJfYWRkcmVzcwASa19wb3NpdGlvblNlcXVlbmNlAhJrX3Bvc2l0aW9uU2VxdWVuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19leGVjdXRlZE9yZGVycwIQa19leGVjdXRlZE9yZGVycwAQa19jYW5jZWxlZE9yZGVycwIQa19jYW5jZWxlZE9yZGVycwAHa19vcmRlcgIHa19vcmRlcgAOa19vcmRlclJlc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hbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAQJ0eAEGdmVyaWZ5AAQOY29vcmRpbmF0b3JTdHIJAJ0IAgUEdGhpcwUUa19jb29yZGluYXRvckFkZHJlc3MDCQEJaXNEZWZpbmVkAQUOY29vcmRpbmF0b3JTdHIEBWFkbWluCQCdCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEJAQV2YWx1ZQEFDmNvb3JkaW5hdG9yU3RyBQ9rX2FkbWluX2FkZHJlc3MDCQEJaXNEZWZpbmVkAQUFYWRtaW4JAQt2YWx1ZU9yRWxzZQIJAJsIAgkBEUBleHRyTmF0aXZlKDEwNjIpAQkBBXZhbHVlAQUFYWRtaW4JAKwCAgkArAICCQCsAgICB3N0YXR1c18JAKUIAQUEdGhpcwIBXwkA2AQBCAUCdHgCaWQHCQACAQIudW5hYmxlIHRvIHZlcmlmeTogYWRtaW4gbm90IHNldCBpbiBjb29yZGluYXRvcgkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleTToC6Q=", "height": 2596165, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GUBhAY7DrcVuujSkBWs7KN4BhCRz8aMreZHDDTrmQccm Next: CmTd4xkFkwUEx2xyoP5bRkRwXKFPhQWYj8FLfooHwMkJ Diff:
Old | New | Differences | |
---|---|---|---|
720 | 720 | let currentPositionId = if ((positionSize != 0)) | |
721 | 721 | then getPositionId(_amm, _trader, positionDirection) | |
722 | 722 | else 0 | |
723 | - | let $ | |
723 | + | let $t02760331564 = if ((_type == STOP)) | |
724 | 724 | then { | |
725 | 725 | let _positionDirection = if ((positionSize > 0)) | |
726 | 726 | then LONG | |
783 | 783 | else throw("Can not execute LIMIT order: triggerPrice mismatch") | |
784 | 784 | } | |
785 | 785 | else throw(("Invalid order type: " + toString(_type))) | |
786 | - | let method = $ | |
787 | - | let args = $ | |
788 | - | let payments = $ | |
786 | + | let method = $t02760331564._1 | |
787 | + | let args = $t02760331564._2 | |
788 | + | let payments = $t02760331564._3 | |
789 | 789 | let withdraw = if ((size(payments) == 1)) | |
790 | 790 | then { | |
791 | 791 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil) | |
819 | 819 | else LONG | |
820 | 820 | let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE)) | |
821 | 821 | then { | |
822 | - | let $ | |
823 | - | let newOrderId = $ | |
824 | - | let newAmm = $ | |
825 | - | let newTrader = $ | |
826 | - | let newType = $ | |
827 | - | let newTriggerPrice = $ | |
828 | - | let newLimitPrice = $ | |
822 | + | let $t03252632725 = getOrderRequest(_orderId, TAKE) | |
823 | + | let newOrderId = $t03252632725._1 | |
824 | + | let newAmm = $t03252632725._2 | |
825 | + | let newTrader = $t03252632725._3 | |
826 | + | let newType = $t03252632725._4 | |
827 | + | let newTriggerPrice = $t03252632725._5 | |
828 | + | let newLimitPrice = $t03252632725._6 | |
829 | 829 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil) | |
830 | 830 | if ((doCall == doCall)) | |
831 | 831 | then nil | |
836 | 836 | then { | |
837 | 837 | let makeStopOrder = if (haveOrderRequest(_orderId, STOP)) | |
838 | 838 | then { | |
839 | - | let $ | |
840 | - | let newOrderId = $ | |
841 | - | let newAmm = $ | |
842 | - | let newTrader = $ | |
843 | - | let newType = $ | |
844 | - | let newTriggerPrice = $ | |
845 | - | let newLimitPrice = $ | |
839 | + | let $t03329833497 = getOrderRequest(_orderId, STOP) | |
840 | + | let newOrderId = $t03329833497._1 | |
841 | + | let newAmm = $t03329833497._2 | |
842 | + | let newTrader = $t03329833497._3 | |
843 | + | let newType = $t03329833497._4 | |
844 | + | let newTriggerPrice = $t03329833497._5 | |
845 | + | let newLimitPrice = $t03329833497._6 | |
846 | 846 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil) | |
847 | 847 | if ((doCall == doCall)) | |
848 | 848 | then nil |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_coordinatorAddress = "k_coordinatorAddress" | |
5 | 5 | ||
6 | 6 | let k_admin_address = "k_admin_address" | |
7 | 7 | ||
8 | 8 | let k_quote_asset = "k_quote_asset" | |
9 | 9 | ||
10 | 10 | let k_amm = "k_amm" | |
11 | 11 | ||
12 | 12 | let k_manager_address = "k_manager_address" | |
13 | 13 | ||
14 | 14 | let k_positionSequence = "k_positionSequence" | |
15 | 15 | ||
16 | 16 | let k_positionSize = "k_positionSize" | |
17 | 17 | ||
18 | 18 | let k_executedOrders = "k_executedOrders" | |
19 | 19 | ||
20 | 20 | let k_canceledOrders = "k_canceledOrders" | |
21 | 21 | ||
22 | 22 | let k_order = "k_order" | |
23 | 23 | ||
24 | 24 | let k_orderRequest = "k_orderReq" | |
25 | 25 | ||
26 | 26 | let k_lastOrderId = "k_lastOrderId" | |
27 | 27 | ||
28 | 28 | let k_traderOrderCnt = "k_traderOrderCnt" | |
29 | 29 | ||
30 | 30 | let k_traderOrderIds = "k_traderOrderIds" | |
31 | 31 | ||
32 | 32 | let k_spreadLimit = "k_spreadLimit" | |
33 | 33 | ||
34 | 34 | let k_sender = "k_sender" | |
35 | 35 | ||
36 | 36 | let k_initialized = "k_initialized" | |
37 | 37 | ||
38 | 38 | let STOP = 1 | |
39 | 39 | ||
40 | 40 | let TAKE = 2 | |
41 | 41 | ||
42 | 42 | let LIMIT = 3 | |
43 | 43 | ||
44 | 44 | let LONG = 1 | |
45 | 45 | ||
46 | 46 | let SHORT = 2 | |
47 | 47 | ||
48 | 48 | let INCREASE = 1 | |
49 | 49 | ||
50 | 50 | let DECREASE = 2 | |
51 | 51 | ||
52 | 52 | let MAX_TRADER_ORDERS_PER_AMM = 10 | |
53 | 53 | ||
54 | 54 | let TIME = lastBlock.timestamp | |
55 | 55 | ||
56 | 56 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
57 | 57 | ||
58 | 58 | func abs (_x) = if ((_x > 0)) | |
59 | 59 | then _x | |
60 | 60 | else -(_x) | |
61 | 61 | ||
62 | 62 | ||
63 | 63 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
64 | 64 | ||
65 | 65 | ||
66 | 66 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
67 | 67 | ||
68 | 68 | ||
69 | 69 | func minv (_x,_y) = if ((_x > _y)) | |
70 | 70 | then _y | |
71 | 71 | else _x | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | func executedOrderKey (_orderId) = ((k_executedOrders + "_") + toString(_orderId)) | |
78 | 78 | ||
79 | 79 | ||
80 | 80 | func canceledOrderKey (_orderId) = ((k_canceledOrders + "_") + toString(_orderId)) | |
81 | 81 | ||
82 | 82 | ||
83 | 83 | func orderKey (_orderId) = toCompositeKey(k_order, toString(_orderId)) | |
84 | 84 | ||
85 | 85 | ||
86 | 86 | func orderRequestKey (_orderId,_type) = ((((k_orderRequest + "_") + toString(_orderId)) + "_") + toString(_type)) | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | func traderOrderCountKey (_amm,_trader) = ((((k_traderOrderCnt + "_") + _amm) + "_") + _trader) | |
90 | 90 | ||
91 | 91 | ||
92 | 92 | func traderOrderIdsKey (_amm,_trader) = ((((k_traderOrderIds + "_") + _amm) + "_") + _trader) | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
99 | 99 | ||
100 | 100 | ||
101 | 101 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
102 | 102 | ||
103 | 103 | ||
104 | 104 | func managerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_manager_address)), "Manager not set") | |
105 | 105 | ||
106 | 106 | ||
107 | 107 | func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false) | |
108 | 108 | ||
109 | 109 | ||
110 | 110 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
111 | 111 | ||
112 | 112 | ||
113 | 113 | func isValid (_orderId) = if (valueOrElse(getBoolean(this, executedOrderKey(_orderId)), false)) | |
114 | 114 | then throw(("Order already executed: " + toString(_orderId))) | |
115 | 115 | else if (valueOrElse(getBoolean(this, canceledOrderKey(_orderId)), false)) | |
116 | 116 | then throw(("Order already cancelled: " + toString(_orderId))) | |
117 | 117 | else true | |
118 | 118 | ||
119 | 119 | ||
120 | 120 | func getSpreadLimit () = valueOrErrorMessage(getInteger(this, k_spreadLimit), "Spread limit not set") | |
121 | 121 | ||
122 | 122 | ||
123 | 123 | func currentOrderId () = valueOrElse(getInteger(this, k_lastOrderId), 0) | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getTraderOrderCount (_amm,_trader) = { | |
127 | 127 | let key = traderOrderCountKey(_amm, _trader) | |
128 | 128 | valueOrElse(getInteger(this, key), 0) | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func traderAmmOrdersIds (_amm,_trader) = { | |
133 | 133 | let key = traderOrderIdsKey(_amm, _trader) | |
134 | 134 | let val = valueOrElse(getString(this, key), "") | |
135 | 135 | if ((val == "")) | |
136 | 136 | then nil | |
137 | 137 | else split(val, ",") | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func haveOrderRequest (_orderId,_type) = { | |
142 | 142 | let key = orderRequestKey(_orderId, _type) | |
143 | 143 | isDefined(getString(this, key)) | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func getOrderRequest (_orderId,_type) = { | |
148 | 148 | let key = orderRequestKey(_orderId, _type) | |
149 | 149 | let orderRequestStr = valueOrErrorMessage(getString(this, key), ("Not order request for key: " + key)) | |
150 | 150 | let orderRequestPartList = split(orderRequestStr, ",") | |
151 | 151 | let orderId = valueOrErrorMessage(parseInt(orderRequestPartList[0]), "Invalid orderId") | |
152 | 152 | let amm = orderRequestPartList[1] | |
153 | 153 | let trader = orderRequestPartList[2] | |
154 | 154 | let type = valueOrErrorMessage(parseInt(orderRequestPartList[3]), "Invalid type") | |
155 | 155 | let triggerPrice = valueOrErrorMessage(parseInt(orderRequestPartList[4]), "Invalid triggerPrice") | |
156 | 156 | let limitPrice = valueOrErrorMessage(parseInt(orderRequestPartList[5]), "Invalid limitPrice") | |
157 | 157 | $Tuple6(orderId, amm, trader, type, triggerPrice, limitPrice) | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func getOrder (_orderId) = { | |
162 | 162 | let orderStr = valueOrErrorMessage(getString(this, orderKey(_orderId)), ("Invalid order id: " + toString(_orderId))) | |
163 | 163 | let orderPartList = split(orderStr, ",") | |
164 | 164 | let amm = orderPartList[0] | |
165 | 165 | let trader = orderPartList[1] | |
166 | 166 | let amountIn = valueOrErrorMessage(parseInt(orderPartList[2]), "Invalid amountIn") | |
167 | 167 | let leverage = valueOrErrorMessage(parseInt(orderPartList[3]), "Invalid leverage") | |
168 | 168 | let type = valueOrErrorMessage(parseInt(orderPartList[4]), "Invalid type") | |
169 | 169 | let triggerPrice = valueOrErrorMessage(parseInt(orderPartList[5]), "Invalid triggerPrice") | |
170 | 170 | let paymentUsdn = valueOrErrorMessage(parseInt(orderPartList[6]), "Invalid paymentUsdn") | |
171 | 171 | let side = valueOrErrorMessage(parseInt(orderPartList[7]), "Invalid side") | |
172 | 172 | let refLink = orderPartList[8] | |
173 | 173 | let positionId = valueOrErrorMessage(parseInt(orderPartList[9]), "Invalid positionId") | |
174 | 174 | let limitPrice = valueOrErrorMessage(parseInt(orderPartList[10]), "Invalid limitPrice") | |
175 | 175 | let expiration = if ((size(orderPartList) > 11)) | |
176 | 176 | then valueOrErrorMessage(parseInt(orderPartList[11]), "Invalid expiration") | |
177 | 177 | else 0 | |
178 | 178 | let marketPrice = if ((size(orderPartList) > 12)) | |
179 | 179 | then valueOrErrorMessage(parseInt(orderPartList[12]), "Invalid orderMarketPrice") | |
180 | 180 | else 0 | |
181 | 181 | $Tuple13(amm, trader, amountIn, leverage, type, triggerPrice, paymentUsdn, side, refLink, positionId, limitPrice, expiration, marketPrice) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func getMarketPrice (_amm) = { | |
186 | 186 | let s = invoke(addressFromStringValue(_amm), "computeSpotPrice", nil, nil) | |
187 | 187 | if ((s == s)) | |
188 | 188 | then { | |
189 | 189 | let res = match s { | |
190 | 190 | case t: Int => | |
191 | 191 | t | |
192 | 192 | case _ => | |
193 | 193 | throw("Invalid computeSpotPrice result") | |
194 | 194 | } | |
195 | 195 | value(res) | |
196 | 196 | } | |
197 | 197 | else throw("Strict value is not equal to itself.") | |
198 | 198 | } | |
199 | 199 | ||
200 | 200 | ||
201 | 201 | func getFee (_amm,_trader) = { | |
202 | 202 | let s = invoke(addressFromStringValue(_amm), "computeFeeForTraderWithArtifact", [_trader, ""], nil) | |
203 | 203 | if ((s == s)) | |
204 | 204 | then { | |
205 | 205 | let res = match s { | |
206 | 206 | case t: (Int, Boolean) => | |
207 | 207 | t._1 | |
208 | 208 | case _ => | |
209 | 209 | throw("Invalid computeFeeForTraderWithArtifact result") | |
210 | 210 | } | |
211 | 211 | value(res) | |
212 | 212 | } | |
213 | 213 | else throw("Strict value is not equal to itself.") | |
214 | 214 | } | |
215 | 215 | ||
216 | 216 | ||
217 | 217 | func getPositionDirection (_orderSide,_orderType) = if (if ((_orderType == TAKE)) | |
218 | 218 | then true | |
219 | 219 | else (_orderType == STOP)) | |
220 | 220 | then if ((_orderSide == LONG)) | |
221 | 221 | then SHORT | |
222 | 222 | else LONG | |
223 | 223 | else _orderSide | |
224 | 224 | ||
225 | 225 | ||
226 | 226 | func getPositionSize (_amm,_trader,_direction) = { | |
227 | 227 | let amm = addressFromStringValue(_amm) | |
228 | 228 | let positionKey = ((_trader + "_") + toString(_direction)) | |
229 | 229 | let sizeKey = toCompositeKey(k_positionSize, positionKey) | |
230 | 230 | valueOrElse(getInteger(amm, sizeKey), 0) | |
231 | 231 | } | |
232 | 232 | ||
233 | 233 | ||
234 | 234 | func getPositionId (_amm,_trader,_direction) = { | |
235 | 235 | let amm = addressFromStringValue(_amm) | |
236 | 236 | let positionKey = ((_trader + "_") + toString(_direction)) | |
237 | 237 | let seqKey = toCompositeKey(k_positionSequence, positionKey) | |
238 | 238 | valueOrElse(getInteger(amm, seqKey), 0) | |
239 | 239 | } | |
240 | 240 | ||
241 | 241 | ||
242 | 242 | func getSpread (_price) = muld(_price, getSpreadLimit()) | |
243 | 243 | ||
244 | 244 | ||
245 | 245 | func saveOrder (_orderId,_amm,_trader,_amountIn,_leverage,_type,_triggerPrice,_paymentUsdn,_side,_refLink,_positionId,_limitPrice,_expiration,_orderMarketPrice) = { | |
246 | 246 | let orderStr = makeString([_amm, _trader, toString(_amountIn), toString(_leverage), toString(_type), toString(_triggerPrice), toString(_paymentUsdn), toString(_side), _refLink, toString(_positionId), toString(_limitPrice), toString(_expiration), toString(_orderMarketPrice)], ",") | |
247 | 247 | [StringEntry(orderKey(_orderId), orderStr)] | |
248 | 248 | } | |
249 | 249 | ||
250 | 250 | ||
251 | 251 | func saveOrderRequest (_orderId,_amm,_trader,_type,_triggerPrice,_limitPrice) = { | |
252 | 252 | let orderReqStr = makeString([toString(_orderId), _amm, _trader, toString(_type), toString(_triggerPrice), toString(_limitPrice)], ",") | |
253 | 253 | [StringEntry(orderRequestKey(_orderId, _type), orderReqStr)] | |
254 | 254 | } | |
255 | 255 | ||
256 | 256 | ||
257 | 257 | func updateOrderIdStr (_orderIdsNewStr,_amm,_trader) = [StringEntry(traderOrderIdsKey(_amm, _trader), _orderIdsNewStr)] | |
258 | 258 | ||
259 | 259 | ||
260 | 260 | func addRemoveOrderIdList (_orderIds,_orderId,_amm,_trader,_add) = { | |
261 | 261 | let orderIdsNew = if (_add) | |
262 | 262 | then (_orderIds :+ toString(_orderId)) | |
263 | 263 | else removeByIndex(_orderIds, valueOrErrorMessage(indexOf(_orderIds, toString(_orderId)), ("No order with id: " + toString(_orderId)))) | |
264 | 264 | orderIdsNew | |
265 | 265 | } | |
266 | 266 | ||
267 | 267 | ||
268 | 268 | func addRemoveOrderId (_orderId,_amm,_trader,_add) = { | |
269 | 269 | let orderIds = traderAmmOrdersIds(_amm, _trader) | |
270 | 270 | let orderIdsNew = addRemoveOrderIdList(orderIds, _orderId, _amm, _trader, _add) | |
271 | 271 | let orderIdsNewStr = makeString(orderIdsNew, ",") | |
272 | 272 | updateOrderIdStr(orderIdsNewStr, _amm, _trader) | |
273 | 273 | } | |
274 | 274 | ||
275 | 275 | ||
276 | 276 | func updateTraderOrderCount (_amm,_trader,_count) = if ((0 > _count)) | |
277 | 277 | then throw(("Invalid order count: " + toString(_count))) | |
278 | 278 | else [IntegerEntry(traderOrderCountKey(_amm, _trader), _count)] | |
279 | 279 | ||
280 | 280 | ||
281 | 281 | func updateLastOrderId (_lastOrderId) = [IntegerEntry(k_lastOrderId, _lastOrderId)] | |
282 | 282 | ||
283 | 283 | ||
284 | 284 | func markExecuteOrder (_orderId) = [BooleanEntry(toCompositeKey(k_executedOrders, toString(_orderId)), true)] | |
285 | 285 | ||
286 | 286 | ||
287 | 287 | func markCancelOrder (_orderId) = [BooleanEntry(toCompositeKey(k_canceledOrders, toString(_orderId)), true)] | |
288 | 288 | ||
289 | 289 | ||
290 | 290 | func getPositionIds (_amm,_trader) = { | |
291 | 291 | let longPositionSize = getPositionSize(_amm, _trader, LONG) | |
292 | 292 | let currentLongPositionId = if ((longPositionSize != 0)) | |
293 | 293 | then getPositionId(_amm, _trader, LONG) | |
294 | 294 | else 0 | |
295 | 295 | let shortPositionSize = getPositionSize(_amm, _trader, SHORT) | |
296 | 296 | let currentShortPositionId = if ((shortPositionSize != 0)) | |
297 | 297 | then getPositionId(_amm, _trader, SHORT) | |
298 | 298 | else 0 | |
299 | 299 | [currentLongPositionId, currentShortPositionId] | |
300 | 300 | } | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | @Callable(i) | |
304 | 304 | func cleanUpStaleOrders (_amm,_trader) = { | |
305 | 305 | let orders = traderAmmOrdersIds(_amm, _trader) | |
306 | 306 | let positionIds = getPositionIds(_amm, _trader) | |
307 | 307 | func cleanUpOne (_acc,_orderId) = { | |
308 | 308 | let orderIdInt = valueOrErrorMessage(parseInt(_orderId), "Invalid order id") | |
309 | 309 | let $t01176611982 = getOrder(orderIdInt) | |
310 | 310 | let _x1 = $t01176611982._1 | |
311 | 311 | let _x2 = $t01176611982._2 | |
312 | 312 | let _x3 = $t01176611982._3 | |
313 | 313 | let _x4 = $t01176611982._4 | |
314 | 314 | let _type = $t01176611982._5 | |
315 | 315 | let _x5 = $t01176611982._6 | |
316 | 316 | let _x6 = $t01176611982._7 | |
317 | 317 | let _x7 = $t01176611982._8 | |
318 | 318 | let _x8 = $t01176611982._9 | |
319 | 319 | let _positionId = $t01176611982._10 | |
320 | 320 | let _x9 = $t01176611982._11 | |
321 | 321 | let _expiration = $t01176611982._12 | |
322 | 322 | let cancelTakeStopOfNoPosition = if (if (if ((_type == STOP)) | |
323 | 323 | then true | |
324 | 324 | else (_type == TAKE)) | |
325 | 325 | then (positionIds[0] != _positionId) | |
326 | 326 | else false) | |
327 | 327 | then (positionIds[1] != _positionId) | |
328 | 328 | else false | |
329 | 329 | let cancelLimitIfExpired = if ((_type == LIMIT)) | |
330 | 330 | then (lastBlock.timestamp >= _expiration) | |
331 | 331 | else false | |
332 | 332 | if (if (cancelTakeStopOfNoPosition) | |
333 | 333 | then true | |
334 | 334 | else cancelLimitIfExpired) | |
335 | 335 | then { | |
336 | 336 | let change = markCancelOrder(orderIdInt) | |
337 | 337 | let newOrderList = addRemoveOrderIdList(_acc._1, orderIdInt, _amm, _trader, false) | |
338 | 338 | $Tuple2(newOrderList, (_acc._2 ++ change)) | |
339 | 339 | } | |
340 | 340 | else _acc | |
341 | 341 | } | |
342 | 342 | ||
343 | 343 | let $t01251412589 = { | |
344 | 344 | let $l = orders | |
345 | 345 | let $s = size($l) | |
346 | 346 | let $acc0 = $Tuple2(orders, nil) | |
347 | 347 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
348 | 348 | then $a | |
349 | 349 | else cleanUpOne($a, $l[$i]) | |
350 | 350 | ||
351 | 351 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
352 | 352 | then $a | |
353 | 353 | else throw("List size exceeds 10") | |
354 | 354 | ||
355 | 355 | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10) | |
356 | 356 | } | |
357 | 357 | let newOrders = $t01251412589._1 | |
358 | 358 | let cancelActions = $t01251412589._2 | |
359 | 359 | ((cancelActions ++ updateTraderOrderCount(_amm, _trader, size(newOrders))) ++ updateOrderIdStr(makeString(newOrders, ","), _amm, _trader)) | |
360 | 360 | } | |
361 | 361 | ||
362 | 362 | ||
363 | 363 | ||
364 | 364 | @Callable(i) | |
365 | 365 | func setContext (_sender) = if ((i.caller != this)) | |
366 | 366 | then throw("Only self-call") | |
367 | 367 | else [StringEntry(k_sender, _sender)] | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | ||
371 | 371 | @Callable(i) | |
372 | 372 | func resetContext () = if ((i.caller != this)) | |
373 | 373 | then throw("Only self-call") | |
374 | 374 | else [DeleteEntry(k_sender)] | |
375 | 375 | ||
376 | 376 | ||
377 | 377 | ||
378 | 378 | @Callable(i) | |
379 | 379 | func initialize (_coordinator,_spreadLimit) = if (if (if (initialized()) | |
380 | 380 | then true | |
381 | 381 | else if ((0 > _spreadLimit)) | |
382 | 382 | then true | |
383 | 383 | else (_spreadLimit > (DECIMAL_UNIT / 10))) | |
384 | 384 | then true | |
385 | 385 | else (i.caller != this)) | |
386 | 386 | then throw("Unable to initialize") | |
387 | 387 | else [StringEntry(k_coordinatorAddress, toString(addressFromStringValue(_coordinator))), IntegerEntry(k_spreadLimit, _spreadLimit), BooleanEntry(k_initialized, true)] | |
388 | 388 | ||
389 | 389 | ||
390 | 390 | ||
391 | 391 | @Callable(i) | |
392 | 392 | func changeSettings (_spreadLimit) = if (if ((i.caller != adminAddress())) | |
393 | 393 | then true | |
394 | 394 | else if ((0 > _spreadLimit)) | |
395 | 395 | then true | |
396 | 396 | else (_spreadLimit > (DECIMAL_UNIT / 10))) | |
397 | 397 | then throw("Invalid changeSettings params") | |
398 | 398 | else [IntegerEntry(k_spreadLimit, _spreadLimit)] | |
399 | 399 | ||
400 | 400 | ||
401 | 401 | ||
402 | 402 | @Callable(i) | |
403 | 403 | func createOrder (_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice,_expiration) = { | |
404 | 404 | let _trader = toString(i.caller) | |
405 | 405 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
406 | 406 | if ((cleanUp == cleanUp)) | |
407 | 407 | then if ((size(i.payments) > 1)) | |
408 | 408 | then throw("Invalid createOrder parameters: invalid payment count") | |
409 | 409 | else { | |
410 | 410 | let $t01557815830 = if ((size(i.payments) == 1)) | |
411 | 411 | then $Tuple2(toBase58String(valueOrErrorMessage(i.payments[0].assetId, "Invalid asset id")), i.payments[0].amount) | |
412 | 412 | else $Tuple2("", 0) | |
413 | 413 | let paymentAssetId = $t01557815830._1 | |
414 | 414 | let paymentAmount = $t01557815830._2 | |
415 | 415 | let doCall = invoke(this, "internalCreateOrder", [_trader, _amm, _type, _triggerPrice, _limitPrice, _amountIn, _leverage, _side, _refLink, paymentAssetId, paymentAmount, _expiration], nil) | |
416 | 416 | if ((doCall == doCall)) | |
417 | 417 | then { | |
418 | 418 | let orderId = match doCall { | |
419 | 419 | case t: Int => | |
420 | 420 | t | |
421 | 421 | case _ => | |
422 | 422 | throw("Invalid ID of created order") | |
423 | 423 | } | |
424 | 424 | if ((_type == LIMIT)) | |
425 | 425 | then { | |
426 | 426 | let makeStop = if ((_stopTriggerPrice > 0)) | |
427 | 427 | then { | |
428 | 428 | let doMakeStop = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, STOP, _stopTriggerPrice, _stopLimitPrice], nil) | |
429 | 429 | if ((doMakeStop == doMakeStop)) | |
430 | 430 | then nil | |
431 | 431 | else throw("Strict value is not equal to itself.") | |
432 | 432 | } | |
433 | 433 | else nil | |
434 | 434 | let makeTake = if ((_takeTriggerPrice > 0)) | |
435 | 435 | then { | |
436 | 436 | let doMakeTake = invoke(this, "internalCreateOrderRequest", [_trader, _amm, orderId, TAKE, _takeTriggerPrice, _takeLimitPrice], nil) | |
437 | 437 | if ((doMakeTake == doMakeTake)) | |
438 | 438 | then nil | |
439 | 439 | else throw("Strict value is not equal to itself.") | |
440 | 440 | } | |
441 | 441 | else nil | |
442 | 442 | (makeStop ++ makeTake) | |
443 | 443 | } | |
444 | 444 | else nil | |
445 | 445 | } | |
446 | 446 | else throw("Strict value is not equal to itself.") | |
447 | 447 | } | |
448 | 448 | else throw("Strict value is not equal to itself.") | |
449 | 449 | } | |
450 | 450 | ||
451 | 451 | ||
452 | 452 | ||
453 | 453 | @Callable(i) | |
454 | 454 | func increasePositionWithStopLoss (_amm,_direction,_leverage,_minBaseAssetAmount,_refLink,_stopTriggerPrice,_stopLimitPrice,_takeTriggerPrice,_takeLimitPrice,_priceData) = { | |
455 | 455 | let _trader = toString(i.caller) | |
456 | 456 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
457 | 457 | if ((cleanUp == cleanUp)) | |
458 | 458 | then if (if (!(initialized())) | |
459 | 459 | then true | |
460 | 460 | else !(isWhitelist(_amm))) | |
461 | 461 | then throw("Invalid increasePositionWithStopLoss parameters") | |
462 | 462 | else { | |
463 | 463 | let positionSize = getPositionSize(_amm, _trader, _direction) | |
464 | 464 | if ((positionSize != 0)) | |
465 | 465 | then throw("Invalid increasePositionWithStopLoss parameters: only new position") | |
466 | 466 | else { | |
467 | 467 | let doSetContext = invoke(this, "setContext", [_trader], nil) | |
468 | 468 | if ((doSetContext == doSetContext)) | |
469 | 469 | then { | |
470 | 470 | let doOpenPosition = invoke(addressFromStringValue(_amm), "increasePosition", [_direction, _leverage, _minBaseAssetAmount, _refLink, _priceData], i.payments) | |
471 | 471 | if ((doOpenPosition == doOpenPosition)) | |
472 | 472 | then { | |
473 | 473 | let doResetContext = invoke(this, "resetContext", nil, nil) | |
474 | 474 | if ((doResetContext == doResetContext)) | |
475 | 475 | then { | |
476 | 476 | let openedPositionSize = getPositionSize(_amm, _trader, _direction) | |
477 | 477 | if ((openedPositionSize == openedPositionSize)) | |
478 | 478 | then { | |
479 | 479 | let amountIn = abs(openedPositionSize) | |
480 | 480 | if ((amountIn == amountIn)) | |
481 | 481 | then { | |
482 | 482 | let stopLossSide = if ((0 > openedPositionSize)) | |
483 | 483 | then LONG | |
484 | 484 | else SHORT | |
485 | 485 | let checkAmountIn = if ((0 >= amountIn)) | |
486 | 486 | then { | |
487 | 487 | let data = makeString([_amm, _trader, toString(_direction), toString(_leverage), toString(_minBaseAssetAmount), _refLink, _priceData], ",") | |
488 | 488 | throw(((("Invalid amountIn=" + toString(amountIn)) + " after success increasePosition: ") + data)) | |
489 | 489 | } | |
490 | 490 | else 0 | |
491 | 491 | if ((checkAmountIn == checkAmountIn)) | |
492 | 492 | then { | |
493 | 493 | let doCreateStopOrder = if ((_stopTriggerPrice > 0)) | |
494 | 494 | then { | |
495 | 495 | let doCreateStopOrder = invoke(this, "internalCreateOrder", [_trader, _amm, STOP, _stopTriggerPrice, _stopLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil) | |
496 | 496 | if ((doCreateStopOrder == doCreateStopOrder)) | |
497 | 497 | then nil | |
498 | 498 | else throw("Strict value is not equal to itself.") | |
499 | 499 | } | |
500 | 500 | else nil | |
501 | 501 | if ((doCreateStopOrder == doCreateStopOrder)) | |
502 | 502 | then { | |
503 | 503 | let doCreateTakeOrder = if ((_takeTriggerPrice > 0)) | |
504 | 504 | then { | |
505 | 505 | let doCreateTakeOrder = invoke(this, "internalCreateOrder", [_trader, _amm, TAKE, _takeTriggerPrice, _takeLimitPrice, amountIn, 0, stopLossSide, _refLink, "", 0, 0], nil) | |
506 | 506 | if ((doCreateTakeOrder == doCreateTakeOrder)) | |
507 | 507 | then nil | |
508 | 508 | else throw("Strict value is not equal to itself.") | |
509 | 509 | } | |
510 | 510 | else nil | |
511 | 511 | if ((doCreateTakeOrder == doCreateTakeOrder)) | |
512 | 512 | then nil | |
513 | 513 | else throw("Strict value is not equal to itself.") | |
514 | 514 | } | |
515 | 515 | else throw("Strict value is not equal to itself.") | |
516 | 516 | } | |
517 | 517 | else throw("Strict value is not equal to itself.") | |
518 | 518 | } | |
519 | 519 | else throw("Strict value is not equal to itself.") | |
520 | 520 | } | |
521 | 521 | else throw("Strict value is not equal to itself.") | |
522 | 522 | } | |
523 | 523 | else throw("Strict value is not equal to itself.") | |
524 | 524 | } | |
525 | 525 | else throw("Strict value is not equal to itself.") | |
526 | 526 | } | |
527 | 527 | else throw("Strict value is not equal to itself.") | |
528 | 528 | } | |
529 | 529 | } | |
530 | 530 | else throw("Strict value is not equal to itself.") | |
531 | 531 | } | |
532 | 532 | ||
533 | 533 | ||
534 | 534 | ||
535 | 535 | @Callable(i) | |
536 | 536 | func internalMarkOrderExecuted (_amm,_trader,_orderId) = if (if (if (!(initialized())) | |
537 | 537 | then true | |
538 | 538 | else !(isWhitelist(_amm))) | |
539 | 539 | then true | |
540 | 540 | else !((i.caller == this))) | |
541 | 541 | then throw("Invalid internalMarkOrderExecuted parameters") | |
542 | 542 | else { | |
543 | 543 | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1) | |
544 | 544 | ((updateTraderOrderCount(_amm, _trader, newTraderOrderCount) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ markExecuteOrder(_orderId)) | |
545 | 545 | } | |
546 | 546 | ||
547 | 547 | ||
548 | 548 | ||
549 | 549 | @Callable(i) | |
550 | 550 | func internalCreateOrderRequest (_trader,_amm,_orderId,_type,_triggerPrice,_limitPrice) = if (if (if (if (if (!(initialized())) | |
551 | 551 | then true | |
552 | 552 | else !(isWhitelist(_amm))) | |
553 | 553 | then true | |
554 | 554 | else (0 >= _triggerPrice)) | |
555 | 555 | then true | |
556 | 556 | else (0 > _limitPrice)) | |
557 | 557 | then true | |
558 | 558 | else !((i.caller == this))) | |
559 | 559 | then throw("Invalid internalCreateOrderRequest parameters") | |
560 | 560 | else saveOrderRequest(_orderId, _amm, _trader, _type, _triggerPrice, _limitPrice) | |
561 | 561 | ||
562 | 562 | ||
563 | 563 | ||
564 | 564 | @Callable(i) | |
565 | 565 | func internalCreateOrder (_trader,_amm,_type,_triggerPrice,_limitPrice,_amountIn,_leverage,_side,_refLink,_paymentAssetId,_paymentAmount,_expiration) = if (if (if (if (if (if (if (if (if (if (!(initialized())) | |
566 | 566 | then true | |
567 | 567 | else !(isWhitelist(_amm))) | |
568 | 568 | then true | |
569 | 569 | else (0 >= _triggerPrice)) | |
570 | 570 | then true | |
571 | 571 | else (0 > _limitPrice)) | |
572 | 572 | then true | |
573 | 573 | else (0 >= _amountIn)) | |
574 | 574 | then true | |
575 | 575 | else (0 > _leverage)) | |
576 | 576 | then true | |
577 | 577 | else !(if ((_side == LONG)) | |
578 | 578 | then true | |
579 | 579 | else (_side == SHORT))) | |
580 | 580 | then true | |
581 | 581 | else !(if (if ((_type == STOP)) | |
582 | 582 | then true | |
583 | 583 | else (_type == TAKE)) | |
584 | 584 | then true | |
585 | 585 | else (_type == LIMIT))) | |
586 | 586 | then true | |
587 | 587 | else !((i.caller == this))) | |
588 | 588 | then true | |
589 | 589 | else (0 > _expiration)) | |
590 | 590 | then throw("Invalid internalCreateOrder parameters") | |
591 | 591 | else { | |
592 | 592 | let orderId = (currentOrderId() + 1) | |
593 | 593 | let positionDirection = getPositionDirection(_side, _type) | |
594 | 594 | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) + 1) | |
595 | 595 | let positionSize = getPositionSize(_amm, _trader, positionDirection) | |
596 | 596 | let orderMarketPrice = getMarketPrice(_amm) | |
597 | 597 | let _direction = if (if (if ((positionSize == 0)) | |
598 | 598 | then true | |
599 | 599 | else if ((positionSize > 0)) | |
600 | 600 | then (_side == LONG) | |
601 | 601 | else false) | |
602 | 602 | then true | |
603 | 603 | else if ((0 > positionSize)) | |
604 | 604 | then (_side == SHORT) | |
605 | 605 | else false) | |
606 | 606 | then INCREASE | |
607 | 607 | else DECREASE | |
608 | 608 | if (if ((positionSize == 0)) | |
609 | 609 | then if ((_type == STOP)) | |
610 | 610 | then true | |
611 | 611 | else (_type == TAKE) | |
612 | 612 | else false) | |
613 | 613 | then throw("Can not create STOP/TAKE order: no position") | |
614 | 614 | else { | |
615 | 615 | let usdnPayment = if ((_direction == INCREASE)) | |
616 | 616 | then if (if ((_paymentAssetId != toBase58String(quoteAsset()))) | |
617 | 617 | then true | |
618 | 618 | else (_paymentAmount != _amountIn)) | |
619 | 619 | then throw("Invalid createLimitOrder parameters: invalid payment") | |
620 | 620 | else { | |
621 | 621 | let stake = invoke(managerAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), _paymentAmount)]) | |
622 | 622 | if ((stake == stake)) | |
623 | 623 | then _paymentAmount | |
624 | 624 | else throw("Strict value is not equal to itself.") | |
625 | 625 | } | |
626 | 626 | else 0 | |
627 | 627 | if ((usdnPayment == usdnPayment)) | |
628 | 628 | then { | |
629 | 629 | let positionId = if ((positionSize != 0)) | |
630 | 630 | then getPositionId(_amm, _trader, positionDirection) | |
631 | 631 | else 0 | |
632 | 632 | if (if (if ((_type == STOP)) | |
633 | 633 | then true | |
634 | 634 | else (_type == TAKE)) | |
635 | 635 | then (positionId == 0) | |
636 | 636 | else false) | |
637 | 637 | then throw("STOP and TAKE order should be assigned to position with id != 0") | |
638 | 638 | else if ((newTraderOrderCount > MAX_TRADER_ORDERS_PER_AMM)) | |
639 | 639 | then throw("Invalid createLimitOrder parameters: order count") | |
640 | 640 | else { | |
641 | 641 | let changeSet = (((saveOrder(orderId, _amm, _trader, _amountIn, _leverage, _type, _triggerPrice, usdnPayment, _side, _refLink, positionId, _limitPrice, _expiration, orderMarketPrice) ++ addRemoveOrderId(orderId, _amm, _trader, true)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ updateLastOrderId(orderId)) | |
642 | 642 | $Tuple2(changeSet, orderId) | |
643 | 643 | } | |
644 | 644 | } | |
645 | 645 | else throw("Strict value is not equal to itself.") | |
646 | 646 | } | |
647 | 647 | } | |
648 | 648 | ||
649 | 649 | ||
650 | 650 | ||
651 | 651 | @Callable(i) | |
652 | 652 | func cancelOrder (_orderId) = { | |
653 | 653 | let $t02546625616 = getOrder(_orderId) | |
654 | 654 | let _amm = $t02546625616._1 | |
655 | 655 | let _trader = $t02546625616._2 | |
656 | 656 | let _amountIn = $t02546625616._3 | |
657 | 657 | let _leverage = $t02546625616._4 | |
658 | 658 | let _type = $t02546625616._5 | |
659 | 659 | let _triggerPrice = $t02546625616._6 | |
660 | 660 | let _amountUsdn = $t02546625616._7 | |
661 | 661 | if (if (if (!(initialized())) | |
662 | 662 | then true | |
663 | 663 | else !(isValid(_orderId))) | |
664 | 664 | then true | |
665 | 665 | else !((toString(i.caller) == _trader))) | |
666 | 666 | then throw("Invalid cancelOrder parameters") | |
667 | 667 | else { | |
668 | 668 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
669 | 669 | if ((cleanUp == cleanUp)) | |
670 | 670 | then { | |
671 | 671 | let newTraderOrderCount = (getTraderOrderCount(_amm, _trader) - 1) | |
672 | 672 | let withdraw = if ((_amountUsdn > 0)) | |
673 | 673 | then { | |
674 | 674 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), _amountUsdn], nil) | |
675 | 675 | if ((unstake == unstake)) | |
676 | 676 | then nil | |
677 | 677 | else throw("Strict value is not equal to itself.") | |
678 | 678 | } | |
679 | 679 | else nil | |
680 | 680 | if ((withdraw == withdraw)) | |
681 | 681 | then (((markCancelOrder(_orderId) ++ addRemoveOrderId(_orderId, _amm, _trader, false)) ++ updateTraderOrderCount(_amm, _trader, newTraderOrderCount)) ++ (if ((_amountUsdn > 0)) | |
682 | 682 | then [ScriptTransfer(i.caller, _amountUsdn, quoteAsset())] | |
683 | 683 | else nil)) | |
684 | 684 | else throw("Strict value is not equal to itself.") | |
685 | 685 | } | |
686 | 686 | else throw("Strict value is not equal to itself.") | |
687 | 687 | } | |
688 | 688 | } | |
689 | 689 | ||
690 | 690 | ||
691 | 691 | ||
692 | 692 | @Callable(i) | |
693 | 693 | func executeOrder (_orderId,_priceData) = { | |
694 | 694 | let $t02683427096 = getOrder(_orderId) | |
695 | 695 | let _amm = $t02683427096._1 | |
696 | 696 | let _trader = $t02683427096._2 | |
697 | 697 | let _amountIn = $t02683427096._3 | |
698 | 698 | let _leverage = $t02683427096._4 | |
699 | 699 | let _type = $t02683427096._5 | |
700 | 700 | let _triggerPrice = $t02683427096._6 | |
701 | 701 | let _amountUsdn = $t02683427096._7 | |
702 | 702 | let _side = $t02683427096._8 | |
703 | 703 | let _refLink = $t02683427096._9 | |
704 | 704 | let _positionId = $t02683427096._10 | |
705 | 705 | let _limitPrice = $t02683427096._11 | |
706 | 706 | let _timestamp = $t02683427096._12 | |
707 | 707 | let _orderMarketPrice = $t02683427096._13 | |
708 | 708 | let cleanUp = invoke(this, "cleanUpStaleOrders", [_amm, _trader], nil) | |
709 | 709 | if ((cleanUp == cleanUp)) | |
710 | 710 | then { | |
711 | 711 | let positionDirection = getPositionDirection(_side, _type) | |
712 | 712 | if (if (!(initialized())) | |
713 | 713 | then true | |
714 | 714 | else !(isValid(_orderId))) | |
715 | 715 | then throw("Invalid executeOrder parameters") | |
716 | 716 | else { | |
717 | 717 | let positionSize = getPositionSize(_amm, _trader, positionDirection) | |
718 | 718 | if ((positionSize == positionSize)) | |
719 | 719 | then { | |
720 | 720 | let currentPositionId = if ((positionSize != 0)) | |
721 | 721 | then getPositionId(_amm, _trader, positionDirection) | |
722 | 722 | else 0 | |
723 | - | let $ | |
723 | + | let $t02760331564 = if ((_type == STOP)) | |
724 | 724 | then { | |
725 | 725 | let _positionDirection = if ((positionSize > 0)) | |
726 | 726 | then LONG | |
727 | 727 | else if ((0 > positionSize)) | |
728 | 728 | then SHORT | |
729 | 729 | else throw("Can not execute STOP order: no open position") | |
730 | 730 | let marketPrice = getMarketPrice(_amm) | |
731 | 731 | let isExecutable = if ((_side == _positionDirection)) | |
732 | 732 | then throw("Can not execute STOP order: reduce only") | |
733 | 733 | else if ((currentPositionId != _positionId)) | |
734 | 734 | then throw("Can not execute STOP order: position closed") | |
735 | 735 | else if ((_positionDirection == LONG)) | |
736 | 736 | then (_triggerPrice >= marketPrice) | |
737 | 737 | else (marketPrice >= _triggerPrice) | |
738 | 738 | if (isExecutable) | |
739 | 739 | then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false, _priceData], nil) | |
740 | 740 | else throw("Can not execute STOP order: triggerPrice mismatch") | |
741 | 741 | } | |
742 | 742 | else if ((_type == TAKE)) | |
743 | 743 | then { | |
744 | 744 | let _positionDirection = if ((positionSize > 0)) | |
745 | 745 | then LONG | |
746 | 746 | else if ((0 > positionSize)) | |
747 | 747 | then SHORT | |
748 | 748 | else throw("Can not execute STOP order: no open position") | |
749 | 749 | let marketPrice = getMarketPrice(_amm) | |
750 | 750 | let isExecutable = if ((_side == _positionDirection)) | |
751 | 751 | then throw("Can not execute TAKE order: reduce only") | |
752 | 752 | else if ((currentPositionId != _positionId)) | |
753 | 753 | then throw(((("Can not execute TAKE order: position closed " + toString(currentPositionId)) + "!=") + toString(_positionId))) | |
754 | 754 | else if ((_positionDirection == LONG)) | |
755 | 755 | then (marketPrice >= _triggerPrice) | |
756 | 756 | else (_triggerPrice >= marketPrice) | |
757 | 757 | if (isExecutable) | |
758 | 758 | then $Tuple3("closePosition", [minv(_amountIn, abs(positionSize)), positionDirection, muld(_limitPrice, abs(positionSize)), false, _priceData], nil) | |
759 | 759 | else throw("Can not execute TAKE order: triggerPrice mismatch") | |
760 | 760 | } | |
761 | 761 | else if ((_type == LIMIT)) | |
762 | 762 | then { | |
763 | 763 | let marketPrice = getMarketPrice(_amm) | |
764 | 764 | let isExecutableByStop = if ((_limitPrice == 0)) | |
765 | 765 | then true | |
766 | 766 | else if ((_limitPrice > _orderMarketPrice)) | |
767 | 767 | then (marketPrice >= _limitPrice) | |
768 | 768 | else (_limitPrice >= marketPrice) | |
769 | 769 | let isExecutableForTriggerPrice = if ((_side == LONG)) | |
770 | 770 | then (_triggerPrice >= marketPrice) | |
771 | 771 | else (marketPrice >= _triggerPrice) | |
772 | 772 | let isExecutable = if (isExecutableByStop) | |
773 | 773 | then isExecutableForTriggerPrice | |
774 | 774 | else false | |
775 | 775 | if (isExecutable) | |
776 | 776 | then { | |
777 | 777 | let marginAmount = divd(_amountUsdn, (muld(getFee(_amm, _trader), _leverage) + DECIMAL_UNIT)) | |
778 | 778 | let openNotional = muld(marginAmount, _leverage) | |
779 | 779 | let idealMinBaseAssetAmount = divd(openNotional, _triggerPrice) | |
780 | 780 | let minBaseAssetAmount = (idealMinBaseAssetAmount - muld(idealMinBaseAssetAmount, getSpreadLimit())) | |
781 | 781 | $Tuple3("increasePosition", [_side, _leverage, minBaseAssetAmount, _refLink, _priceData], [AttachedPayment(quoteAsset(), _amountUsdn)]) | |
782 | 782 | } | |
783 | 783 | else throw("Can not execute LIMIT order: triggerPrice mismatch") | |
784 | 784 | } | |
785 | 785 | else throw(("Invalid order type: " + toString(_type))) | |
786 | - | let method = $ | |
787 | - | let args = $ | |
788 | - | let payments = $ | |
786 | + | let method = $t02760331564._1 | |
787 | + | let args = $t02760331564._2 | |
788 | + | let payments = $t02760331564._3 | |
789 | 789 | let withdraw = if ((size(payments) == 1)) | |
790 | 790 | then { | |
791 | 791 | let unstake = invoke(managerAddress(), "withdraw", [toBase58String(quoteAsset()), payments[0].amount], nil) | |
792 | 792 | if ((unstake == unstake)) | |
793 | 793 | then nil | |
794 | 794 | else throw("Strict value is not equal to itself.") | |
795 | 795 | } | |
796 | 796 | else nil | |
797 | 797 | if ((withdraw == withdraw)) | |
798 | 798 | then { | |
799 | 799 | let doSetContext = invoke(this, "setContext", [_trader], nil) | |
800 | 800 | if ((doSetContext == doSetContext)) | |
801 | 801 | then { | |
802 | 802 | let doClosePosition = invoke(addressFromStringValue(_amm), method, args, payments) | |
803 | 803 | if ((doClosePosition == doClosePosition)) | |
804 | 804 | then { | |
805 | 805 | let doResetContext = invoke(this, "resetContext", nil, nil) | |
806 | 806 | if ((doResetContext == doResetContext)) | |
807 | 807 | then { | |
808 | 808 | let executeOrderRequest = if ((_type == LIMIT)) | |
809 | 809 | then { | |
810 | 810 | let newPositionSize = getPositionSize(_amm, _trader, positionDirection) | |
811 | 811 | if ((newPositionSize == newPositionSize)) | |
812 | 812 | then { | |
813 | 813 | let newPositionId = getPositionId(_amm, _trader, positionDirection) | |
814 | 814 | if ((newPositionId == newPositionId)) | |
815 | 815 | then { | |
816 | 816 | let positionSizeDelta = (newPositionSize - positionSize) | |
817 | 817 | let closeOrderSide = if ((newPositionSize > 0)) | |
818 | 818 | then SHORT | |
819 | 819 | else LONG | |
820 | 820 | let makeTakeOrder = if (haveOrderRequest(_orderId, TAKE)) | |
821 | 821 | then { | |
822 | - | let $ | |
823 | - | let newOrderId = $ | |
824 | - | let newAmm = $ | |
825 | - | let newTrader = $ | |
826 | - | let newType = $ | |
827 | - | let newTriggerPrice = $ | |
828 | - | let newLimitPrice = $ | |
822 | + | let $t03252632725 = getOrderRequest(_orderId, TAKE) | |
823 | + | let newOrderId = $t03252632725._1 | |
824 | + | let newAmm = $t03252632725._2 | |
825 | + | let newTrader = $t03252632725._3 | |
826 | + | let newType = $t03252632725._4 | |
827 | + | let newTriggerPrice = $t03252632725._5 | |
828 | + | let newLimitPrice = $t03252632725._6 | |
829 | 829 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil) | |
830 | 830 | if ((doCall == doCall)) | |
831 | 831 | then nil | |
832 | 832 | else throw("Strict value is not equal to itself.") | |
833 | 833 | } | |
834 | 834 | else nil | |
835 | 835 | if ((makeTakeOrder == makeTakeOrder)) | |
836 | 836 | then { | |
837 | 837 | let makeStopOrder = if (haveOrderRequest(_orderId, STOP)) | |
838 | 838 | then { | |
839 | - | let $ | |
840 | - | let newOrderId = $ | |
841 | - | let newAmm = $ | |
842 | - | let newTrader = $ | |
843 | - | let newType = $ | |
844 | - | let newTriggerPrice = $ | |
845 | - | let newLimitPrice = $ | |
839 | + | let $t03329833497 = getOrderRequest(_orderId, STOP) | |
840 | + | let newOrderId = $t03329833497._1 | |
841 | + | let newAmm = $t03329833497._2 | |
842 | + | let newTrader = $t03329833497._3 | |
843 | + | let newType = $t03329833497._4 | |
844 | + | let newTriggerPrice = $t03329833497._5 | |
845 | + | let newLimitPrice = $t03329833497._6 | |
846 | 846 | let doCall = invoke(this, "internalCreateOrder", [newTrader, newAmm, newType, newTriggerPrice, newLimitPrice, positionSizeDelta, 0, closeOrderSide, "", "", 0, 0], nil) | |
847 | 847 | if ((doCall == doCall)) | |
848 | 848 | then nil | |
849 | 849 | else throw("Strict value is not equal to itself.") | |
850 | 850 | } | |
851 | 851 | else nil | |
852 | 852 | if ((makeStopOrder == makeStopOrder)) | |
853 | 853 | then (makeTakeOrder ++ makeStopOrder) | |
854 | 854 | else throw("Strict value is not equal to itself.") | |
855 | 855 | } | |
856 | 856 | else throw("Strict value is not equal to itself.") | |
857 | 857 | } | |
858 | 858 | else throw("Strict value is not equal to itself.") | |
859 | 859 | } | |
860 | 860 | else throw("Strict value is not equal to itself.") | |
861 | 861 | } | |
862 | 862 | else nil | |
863 | 863 | if ((executeOrderRequest == executeOrderRequest)) | |
864 | 864 | then { | |
865 | 865 | let doMarkOrderExecuted = invoke(this, "internalMarkOrderExecuted", [_amm, _trader, _orderId], nil) | |
866 | 866 | if ((doMarkOrderExecuted == doMarkOrderExecuted)) | |
867 | 867 | then nil | |
868 | 868 | else throw("Strict value is not equal to itself.") | |
869 | 869 | } | |
870 | 870 | else throw("Strict value is not equal to itself.") | |
871 | 871 | } | |
872 | 872 | else throw("Strict value is not equal to itself.") | |
873 | 873 | } | |
874 | 874 | else throw("Strict value is not equal to itself.") | |
875 | 875 | } | |
876 | 876 | else throw("Strict value is not equal to itself.") | |
877 | 877 | } | |
878 | 878 | else throw("Strict value is not equal to itself.") | |
879 | 879 | } | |
880 | 880 | else throw("Strict value is not equal to itself.") | |
881 | 881 | } | |
882 | 882 | } | |
883 | 883 | else throw("Strict value is not equal to itself.") | |
884 | 884 | } | |
885 | 885 | ||
886 | 886 | ||
887 | 887 | ||
888 | 888 | @Callable(i) | |
889 | 889 | func view_canExecuteOrder (_orderId,_priceData) = { | |
890 | 890 | let s = invoke(this, "executeOrder", [_orderId, _priceData], nil) | |
891 | 891 | if ((s == s)) | |
892 | 892 | then throw("Success") | |
893 | 893 | else throw("Strict value is not equal to itself.") | |
894 | 894 | } | |
895 | 895 | ||
896 | 896 | ||
897 | 897 | @Verifier(tx) | |
898 | 898 | func verify () = { | |
899 | 899 | let coordinatorStr = getString(this, k_coordinatorAddress) | |
900 | 900 | if (isDefined(coordinatorStr)) | |
901 | 901 | then { | |
902 | 902 | let admin = getString(addressFromStringValue(value(coordinatorStr)), k_admin_address) | |
903 | 903 | if (isDefined(admin)) | |
904 | 904 | then valueOrElse(getBoolean(addressFromStringValue(value(admin)), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
905 | 905 | else throw("unable to verify: admin not set in coordinator") | |
906 | 906 | } | |
907 | 907 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
908 | 908 | } | |
909 | 909 |
github/deemru/w8io/169f3d6 118.97 ms ◑