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