tx · wQqeHB3jR8k1L9HLbaQWGpm6CkrrV4fJb6SUmmx3Qco 3N8p4dscxCN8XkfWopQP55a2AyvFD9cJx8a: -0.02900000 Waves 2022.10.31 13:15 [2296459] smart account 3N8p4dscxCN8XkfWopQP55a2AyvFD9cJx8a > SELF 0.00000000 Waves
{ "type": 13, "id": "wQqeHB3jR8k1L9HLbaQWGpm6CkrrV4fJb6SUmmx3Qco", "fee": 2900000, "feeAssetId": null, "timestamp": 1667211145745, "version": 1, "sender": "3N8p4dscxCN8XkfWopQP55a2AyvFD9cJx8a", "senderPublicKey": "3JAonT9h65iAMaQegaHVE8pCbEPHPXoARiimB7edrrTb", "proofs": [ "2MDkp3fmSVvymSvi5RZkNffou8gUDkHQorjxYnKKi9NcXBc8GmVBZKZUtV21iQCtsgEkmCFJiRELm2vip5quj9K8" ], "script": "base64:BgJvCAISCAoGCAgIAQEBEgMKAQESBQoDAQEBEgQKAgEBEgMKAQgSBAoCAQESBAoCAQESABIAEgMKAQgSBAoCAQESABIECgIBARIAEgASAwoBCBIAEgASAwoBARIAEgASAwoBBBIAEgASAwoBCBIDCgEIRQAHTl9DT0lOUwkBEUBleHRyTmF0aXZlKDEwNTApAgUEdGhpcwIHTl9DT0lOUwALTl9DT0lOU19iaWcJALYCAQUHTl9DT0lOUwALTl9DT0lOU19NQVgACgAOVE9LRU5fREVDSU1BTFMABgAKVE9LRU5fUkFURQDAhD0AD0ZFRV9ERU5PTUlOQVRPUgCAyK+gJQAJUFJFQ0lTSU9OAMCEPQAIREVDSU1BTFMABgANTUFYX0FETUlOX0ZFRQCAyK+gJQAHTUFYX0ZFRQCA5JfQEgAFTUFYX0EAwIQ9AAxNQVhfQV9DSEFOR0UACgATQURNSU5fQUNUSU9OU19ERUxBWQkAaQIJAGgCAAMAgKMFADwADU1JTl9SQU1QX1RJTUUJAGkCAICjBQA8AA1WUF9MT0dfUEVSSU9EAIC4mSkADFZQX1BSRUNJU0lPTgCAoJSljR0ABWNvaW5zCQC1CQIJ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CAIAGQkAzAgCABoJAMwIAgAbCQDMCAIAHAkAzAgCAB0FA25pbAQHbGlzdDMwbQkAzAgCAP///////////wEJAMwIAgD+//////////8BCQDMCAIA/f//////////AQkAzAgCAPz//////////wEJAMwIAgD7//////////8BCQDMCAIA+v//////////AQkAzAgCAPn//////////wEJAMwIAgD4//////////8BCQDMCAIA9///////////AQkAzAgCAPb//////////wEJAMwIAgD1//////////8BCQDMCAIA9P//////////AQkAzAgCAPP//////////wEJAMwIAgDy//////////8BCQDMCAIA8f//////////AQkAzAgCAPD//////////wEJAMwIAgDv//////////8BCQDMCAIA7v//////////AQkAzAgCAO3//////////wEJAMwIAgDs//////////8BCQDMCAIA6///////////AQkAzAgCAOr//////////wEJAMwIAgDp//////////8BCQDMCAIA6P//////////AQkAzAgCAOf//////////wEJAMwIAgDm//////////8BCQDMCAIA5f//////////AQkAzAgCAOT//////////wEJAMwIAgDj//////////8BCQDMCAIA4v//////////AQUDbmlsBAh2YWx1ZTMwcAoAAiRsBQdsaXN0MzBwCgACJHMJAJADAQUCJGwKAAUkYWNjMAIACgEFJGYwXzECAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAQRmb2xkAgUCJGEJAJEDAgUCJGwFAiRpCgEFJGYwXzICAiRhAiRpAwkAZwIFAiRpBQIkcwUCJGEJAAIBAhRMaXN0IHNpemUgZXhjZWVkcyAzMAkBBSRmMF8yAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRmMF8xAgkBBSRm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aGlzAgh2ZXJpZmllcgMJAAECBQckbWF0Y2gwAgZTdHJpbmcECHZlcmlmaWVyBQckbWF0Y2gwCQELdmFsdWVPckVsc2UCCQCbCAIJARFAZXh0ck5hdGl2ZSgxMDYyKQEFCHZlcmlmaWVyCQCsAgIJAKwCAgkArAICAgdzdGF0dXNfCQClCAEFBHRoaXMCAV8JANgEAQgFAnR4AmlkBwkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleWNwgbA=", "chainId": 84, "height": 2296459, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AmkwiMwGk537QJXeqwLRYHMS59Y6nM6nsfnoYV8Zxcou Next: none Diff:
Old | New | Differences | |
---|---|---|---|
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | - | ||
206 | + | let amp = { | |
207 | 207 | let t1 = future_A_time | |
208 | 208 | let A1 = future_A | |
209 | 209 | if ((t1 > block_timestamp)) | |
216 | 216 | } | |
217 | 217 | else A1 | |
218 | 218 | } | |
219 | - | ||
220 | 219 | ||
221 | 220 | func list_sum (list) = { | |
222 | 221 | func fold (acc,val) = (acc + val) | |
299 | 298 | else $Tuple2(D, false) | |
300 | 299 | } | |
301 | 300 | ||
302 | - | let $ | |
301 | + | let $t060426104 = { | |
303 | 302 | let $l = list16 | |
304 | 303 | let $s = size($l) | |
305 | 304 | let $acc0 = $Tuple2(S, false) | |
313 | 312 | ||
314 | 313 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
315 | 314 | } | |
316 | - | let D = $ | |
317 | - | let finished = $ | |
315 | + | let D = $t060426104._1 | |
316 | + | let finished = $t060426104._2 | |
318 | 317 | if ((finished == false)) | |
319 | 318 | then throw(("D_proc() not finished with " + toString(D))) | |
320 | 319 | else toInt(D) | |
333 | 332 | else false)) | |
334 | 333 | then throw("above N_COINS") | |
335 | 334 | else { | |
336 | - | let amp = _A() | |
337 | 335 | let D = get_D(xp, amp) | |
338 | 336 | let D_big = toBigInt(D) | |
339 | 337 | let Ann_big = toBigInt((amp * N_COINS)) | |
340 | 338 | func S_c (acc,index) = { | |
341 | - | let $ | |
342 | - | let S_ = $ | |
343 | - | let c = $ | |
339 | + | let $t066976716 = acc | |
340 | + | let S_ = $t066976716._1 | |
341 | + | let c = $t066976716._2 | |
344 | 342 | let x_ = if ((index == i)) | |
345 | 343 | then toBigInt(fraction(x, TOKEN_RATE, rates[index])) | |
346 | 344 | else xp[index] | |
349 | 347 | else $Tuple2(S_, c) | |
350 | 348 | } | |
351 | 349 | ||
352 | - | let $ | |
350 | + | let $t069927056 = { | |
353 | 351 | let $l = index_N_COINS | |
354 | 352 | let $s = size($l) | |
355 | 353 | let $acc0 = $Tuple2(big0, D_big) | |
363 | 361 | ||
364 | 362 | $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) | |
365 | 363 | } | |
366 | - | let S_ = $ | |
367 | - | let c_ = $ | |
364 | + | let S_ = $t069927056._1 | |
365 | + | let c_ = $t069927056._2 | |
368 | 366 | let c = fraction(c_, D_big, fraction(Ann_big, N_COINS_big, big1)) | |
369 | 367 | let bD = ((S_ + fraction(D_big, big1, Ann_big)) - D_big) | |
370 | 368 | func y_proc (acc,unused) = if ((acc._2 == true)) | |
381 | 379 | else $Tuple2(y, false) | |
382 | 380 | } | |
383 | 381 | ||
384 | - | let $ | |
382 | + | let $t076367702 = { | |
385 | 383 | let $l = list16 | |
386 | 384 | let $s = size($l) | |
387 | 385 | let $acc0 = $Tuple2(D_big, false) | |
395 | 393 | ||
396 | 394 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
397 | 395 | } | |
398 | - | let y = $ | |
399 | - | let finished = $ | |
396 | + | let y = $t076367702._1 | |
397 | + | let finished = $t076367702._2 | |
400 | 398 | if ((finished == false)) | |
401 | 399 | then throw(("y_proc() not finished with " + toString(y))) | |
402 | 400 | else $Tuple2(fraction(toInt(y), rates[j], TOKEN_RATE), D) | |
411 | 409 | let D_big = toBigInt(D) | |
412 | 410 | let Ann_big = toBigInt((amp * N_COINS)) | |
413 | 411 | func S_c (acc,index) = { | |
414 | - | let $ | |
415 | - | let S_ = $ | |
416 | - | let c = $ | |
412 | + | let $t082078226 = acc | |
413 | + | let S_ = $t082078226._1 | |
414 | + | let c = $t082078226._2 | |
417 | 415 | let x_ = if ((index == i)) | |
418 | 416 | then big0 | |
419 | 417 | else xp[index] | |
422 | 420 | else $Tuple2(S_, c) | |
423 | 421 | } | |
424 | 422 | ||
425 | - | let $ | |
423 | + | let $t084568520 = { | |
426 | 424 | let $l = index_N_COINS | |
427 | 425 | let $s = size($l) | |
428 | 426 | let $acc0 = $Tuple2(big0, D_big) | |
436 | 434 | ||
437 | 435 | $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) | |
438 | 436 | } | |
439 | - | let S_ = $ | |
440 | - | let c_ = $ | |
437 | + | let S_ = $t084568520._1 | |
438 | + | let c_ = $t084568520._2 | |
441 | 439 | let c = fraction(c_, D_big, fraction(Ann_big, N_COINS_big, big1)) | |
442 | 440 | let bD = ((S_ + fraction(D_big, big1, Ann_big)) - D_big) | |
443 | 441 | func y_proc (acc,unused) = if ((acc._2 == true)) | |
454 | 452 | else $Tuple2(y, false) | |
455 | 453 | } | |
456 | 454 | ||
457 | - | let $ | |
455 | + | let $t091009166 = { | |
458 | 456 | let $l = list16 | |
459 | 457 | let $s = size($l) | |
460 | 458 | let $acc0 = $Tuple2(D_big, false) | |
468 | 466 | ||
469 | 467 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
470 | 468 | } | |
471 | - | let y = $ | |
472 | - | let finished = $ | |
469 | + | let y = $t091009166._1 | |
470 | + | let finished = $t091009166._2 | |
473 | 471 | if ((finished == false)) | |
474 | 472 | then throw(("y_proc() not finished with " + toString(y))) | |
475 | 473 | else fraction(toInt(y), rates[i], TOKEN_RATE) | |
477 | 475 | ||
478 | 476 | ||
479 | 477 | func _calc_withdraw_one_coin (_token_amount,i) = { | |
480 | - | let amp = _A() | |
481 | 478 | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
482 | 479 | let xp = big_list(balances) | |
483 | 480 | let D0 = get_D(xp, amp) | |
572 | 569 | ||
573 | 570 | ||
574 | 571 | func get_virtual_price_diff (_t0) = { | |
575 | - | let vp1 = virtual_price(get_D(big_list(balances), | |
572 | + | let vp1 = virtual_price(get_D(big_list(balances), amp)) | |
576 | 573 | let vp1_timestamp = lastBlock.timestamp | |
577 | 574 | let t0 = if ((0 >= _t0)) | |
578 | 575 | then (vp1_timestamp + _t0) | |
605 | 602 | let vol0 = parseBigIntValue(log_list[1]) | |
606 | 603 | let vol0_timestamp = parseIntValue(log_list[2]) | |
607 | 604 | $Tuple3(vol1, vol0, (vol1_timestamp - vol0_timestamp)) | |
605 | + | } | |
606 | + | } | |
607 | + | ||
608 | + | ||
609 | + | func _calc_token_amount (new_balances) = { | |
610 | + | let D0 = if ((token_quantity == 0)) | |
611 | + | then 0 | |
612 | + | else get_D(big_list(balances), amp) | |
613 | + | let D1 = get_D(big_list(new_balances), amp) | |
614 | + | if (assert((D1 > D0))) | |
615 | + | then throw("D1 > D0") | |
616 | + | else { | |
617 | + | let $t01289914902 = if ((token_quantity > 0)) | |
618 | + | then { | |
619 | + | func fee_balances (old,new) = { | |
620 | + | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
621 | + | let n = size(old) | |
622 | + | func fold (acc,index) = { | |
623 | + | let old_balance = old[index] | |
624 | + | let new_balance = new[index] | |
625 | + | let ideal_balance = fraction(D1, old_balance, D0) | |
626 | + | let difference = if ((ideal_balance > new_balance)) | |
627 | + | then (ideal_balance - new_balance) | |
628 | + | else (new_balance - ideal_balance) | |
629 | + | let amount_fee = fraction(_fee, difference, FEE_DENOMINATOR) | |
630 | + | let amount_admin_fee = fraction(amount_fee, admin_fee, FEE_DENOMINATOR) | |
631 | + | $Tuple4((acc._1 :+ (new_balance - amount_admin_fee)), (acc._2 :+ (new_balance - amount_fee)), if (if (is_auto_fees) | |
632 | + | then (amount_admin_fee > 0) | |
633 | + | else false) | |
634 | + | then (acc._3 :+ ScriptTransfer(owner, amount_admin_fee, fromBase58String(coins[index]))) | |
635 | + | else acc._3, (acc._4 + fraction(amount_fee, TOKEN_RATE, rates[index]))) | |
636 | + | } | |
637 | + | ||
638 | + | let $l = index_N_COINS | |
639 | + | let $s = size($l) | |
640 | + | let $acc0 = $Tuple4(nil, nil, nil, 0) | |
641 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
642 | + | then $a | |
643 | + | else fold($a, $l[$i]) | |
644 | + | ||
645 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
646 | + | then $a | |
647 | + | else throw("List size exceeds 10") | |
648 | + | ||
649 | + | $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) | |
650 | + | } | |
651 | + | ||
652 | + | let $t01447314555 = fee_balances(balances, new_balances) | |
653 | + | let finals = $t01447314555._1 | |
654 | + | let no_fees = $t01447314555._2 | |
655 | + | let actions = $t01447314555._3 | |
656 | + | let fee_sum = $t01447314555._4 | |
657 | + | $Tuple3(finals, get_D(big_list(no_fees), amp), (actions ++ log_data(D0, fraction(fee_sum, FEE_DENOMINATOR, fee)))) | |
658 | + | } | |
659 | + | else $Tuple3(new_balances, D1, nil) | |
660 | + | let final_balances = $t01289914902._1 | |
661 | + | let D2 = $t01289914902._2 | |
662 | + | let fees_actions = $t01289914902._3 | |
663 | + | let mint_amount = if ((token_quantity == 0)) | |
664 | + | then D1 | |
665 | + | else fraction(token_quantity, (D2 - D0), D0) | |
666 | + | $Tuple3(final_balances, mint_amount, fees_actions) | |
608 | 667 | } | |
609 | 668 | } | |
610 | 669 | ||
648 | 707 | ||
649 | 708 | func fold (acc,coin) = $Tuple3((acc._1 + 1), (acc._2 :+ 0), (acc._3 :+ pow(10, 0, decimals(coin), 0, 0, DOWN))) | |
650 | 709 | ||
651 | - | let $ | |
710 | + | let $t01615616251 = { | |
652 | 711 | let $l = coins_list | |
653 | 712 | let $s = size($l) | |
654 | 713 | let $acc0 = $Tuple3(0, nil, nil) | |
662 | 721 | ||
663 | 722 | $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) | |
664 | 723 | } | |
665 | - | let _N_COINS = $ | |
666 | - | let zeros = $ | |
667 | - | let _rates = $ | |
724 | + | let _N_COINS = $t01615616251._1 | |
725 | + | let zeros = $t01615616251._2 | |
726 | + | let _rates = $t01615616251._3 | |
668 | 727 | let issueToken = Issue(_pool_token, ("LP token for " + _coins), 0, TOKEN_DECIMALS, true) | |
669 | 728 | let tokenId = toBase58String(calculateAssetId(issueToken)) | |
670 | 729 | [StringEntry("coins", _coins), StringEntry("rates", makeString(list_itos(_rates), ",")), StringEntry("balances", makeString(list_itos(zeros), ",")), IntegerEntry("N_COINS", _N_COINS), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry("fee", _fee), IntegerEntry("admin_fee", _admin_fee), StringEntry("owner", checkAddress(_owner)), IntegerEntry("kill_deadline", (height + KILL_DEADLINE_DT)), StringEntry("token", tokenId), BooleanEntry("is_killed", false), BooleanEntry("is_auto_fees", true), issueToken] | |
678 | 737 | func add_liquidity (min_mint_amount) = if (assert(!(is_killed))) | |
679 | 738 | then throw("is killed") | |
680 | 739 | else { | |
681 | - | let amp = _A() | |
682 | - | let token_supply = token_quantity | |
683 | - | let D0 = if ((token_supply == 0)) | |
684 | - | then 0 | |
685 | - | else get_D(big_list(balances), amp) | |
686 | 740 | func update_1_balance (base,target,amount) = { | |
687 | 741 | func fold (acc,index) = (acc :+ (base[index] + (if ((index == target)) | |
688 | 742 | then amount | |
727 | 781 | } | |
728 | 782 | ||
729 | 783 | let new_balances = up_balances(balances, msg.payments) | |
730 | - | if (if ((token_ | |
784 | + | if (if ((token_quantity == 0)) | |
731 | 785 | then (min(new_balances) == 0) | |
732 | 786 | else false) | |
733 | 787 | then throw("initial deposit requires all coins") | |
734 | 788 | else { | |
735 | - | let D1 = get_D(big_list(new_balances), amp) | |
736 | - | if (assert((D1 > D0))) | |
737 | - | then throw("D1 > D0") | |
738 | - | else { | |
739 | - | let $t01600918010 = if ((token_supply > 0)) | |
740 | - | then { | |
741 | - | func fee_balances (old,new) = { | |
742 | - | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
743 | - | let n = size(old) | |
744 | - | func fold (acc,index) = { | |
745 | - | let old_balance = old[index] | |
746 | - | let new_balance = new[index] | |
747 | - | let ideal_balance = fraction(D1, old_balance, D0) | |
748 | - | let difference = if ((ideal_balance > new_balance)) | |
749 | - | then (ideal_balance - new_balance) | |
750 | - | else (new_balance - ideal_balance) | |
751 | - | let amount_fee = fraction(_fee, difference, FEE_DENOMINATOR) | |
752 | - | let amount_admin_fee = fraction(amount_fee, admin_fee, FEE_DENOMINATOR) | |
753 | - | $Tuple4((acc._1 :+ (new_balance - amount_admin_fee)), (acc._2 :+ (new_balance - amount_fee)), if (if (is_auto_fees) | |
754 | - | then (amount_admin_fee > 0) | |
755 | - | else false) | |
756 | - | then (acc._3 :+ ScriptTransfer(owner, amount_admin_fee, fromBase58String(coins[index]))) | |
757 | - | else acc._3, (acc._4 + fraction(amount_fee, TOKEN_RATE, rates[index]))) | |
758 | - | } | |
759 | - | ||
760 | - | let $l = index_N_COINS | |
761 | - | let $s = size($l) | |
762 | - | let $acc0 = $Tuple4(nil, nil, nil, 0) | |
763 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
764 | - | then $a | |
765 | - | else fold($a, $l[$i]) | |
766 | - | ||
767 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
768 | - | then $a | |
769 | - | else throw("List size exceeds 10") | |
770 | - | ||
771 | - | $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) | |
772 | - | } | |
773 | - | ||
774 | - | let $t01758117663 = fee_balances(balances, new_balances) | |
775 | - | let finals = $t01758117663._1 | |
776 | - | let no_fees = $t01758117663._2 | |
777 | - | let actions = $t01758117663._3 | |
778 | - | let fee_sum = $t01758117663._4 | |
779 | - | $Tuple3(finals, get_D(big_list(no_fees), amp), (actions ++ log_data(D0, fraction(fee_sum, FEE_DENOMINATOR, fee)))) | |
780 | - | } | |
781 | - | else $Tuple3(new_balances, D1, nil) | |
782 | - | let final_balances = $t01600918010._1 | |
783 | - | let D2 = $t01600918010._2 | |
784 | - | let fees_actions = $t01600918010._3 | |
785 | - | let mint_amount = if ((token_supply == 0)) | |
786 | - | then D1 | |
787 | - | else fraction(token_supply, (D2 - D0), D0) | |
788 | - | if (assert((mint_amount >= min_mint_amount))) | |
789 | - | then throw("slippage screwed you") | |
790 | - | else ([StringEntry("balances", makeString(list_itos(final_balances), ",")), Reissue(token, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, token)] ++ fees_actions) | |
791 | - | } | |
789 | + | let $t01813218218 = _calc_token_amount(new_balances) | |
790 | + | let final_balances = $t01813218218._1 | |
791 | + | let mint_amount = $t01813218218._2 | |
792 | + | let fees_actions = $t01813218218._3 | |
793 | + | if (assert((mint_amount >= min_mint_amount))) | |
794 | + | then throw("slippage screwed you") | |
795 | + | else ([StringEntry("balances", makeString(list_itos(final_balances), ",")), Reissue(token, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, token)] ++ fees_actions) | |
792 | 796 | } | |
793 | 797 | } | |
794 | 798 | ||
799 | 803 | let xp_i = balances[i] | |
800 | 804 | let xp_j = balances[j] | |
801 | 805 | let x = (xp_i + dx) | |
802 | - | let $ | |
803 | - | let y = $ | |
804 | - | let D = $ | |
806 | + | let $t01867818731 = get_y(i, j, x, big_list(balances)) | |
807 | + | let y = $t01867818731._1 | |
808 | + | let D = $t01867818731._2 | |
805 | 809 | let _dy = ((xp_j - y) - 1) | |
806 | 810 | let dy_fee = fraction(_dy, fee, FEE_DENOMINATOR) | |
807 | 811 | let dy = (_dy - dy_fee) | |
822 | 826 | let xp_i = balances[i] | |
823 | 827 | let xp_j = balances[j] | |
824 | 828 | let x = (xp_i + dx) | |
825 | - | let $ | |
826 | - | let y = $ | |
827 | - | let D = $ | |
829 | + | let $t01923719290 = get_y(i, j, x, big_list(balances)) | |
830 | + | let y = $t01923719290._1 | |
831 | + | let D = $t01923719290._2 | |
828 | 832 | let _dy = ((xp_j - y) - 1) | |
829 | 833 | let dy_fee = fraction(_dy, fee, FEE_DENOMINATOR) | |
830 | 834 | let dy = (_dy - dy_fee) | |
891 | 895 | else $Tuple2((acc._1 :+ ScriptTransfer(caller, amount_out, fromBase58String(coins[index]))), (acc._2 :+ (balance - amount_out))) | |
892 | 896 | } | |
893 | 897 | ||
894 | - | let $ | |
898 | + | let $t02140621485 = { | |
895 | 899 | let $l = index_N_COINS | |
896 | 900 | let $s = size($l) | |
897 | 901 | let $acc0 = $Tuple2(nil, nil) | |
905 | 909 | ||
906 | 910 | $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) | |
907 | 911 | } | |
908 | - | let transfers = $ | |
909 | - | let final_balances = $ | |
912 | + | let transfers = $t02140621485._1 | |
913 | + | let final_balances = $t02140621485._2 | |
910 | 914 | (transfers ++ [StringEntry("balances", makeString(list_itos(final_balances), ",")), Burn(token, amount)]) | |
911 | 915 | } | |
912 | 916 | } | |
930 | 934 | then throw("unknown token") | |
931 | 935 | else { | |
932 | 936 | let _token_amount = payment.amount | |
933 | - | let $ | |
934 | - | let dy = $ | |
935 | - | let dy_fee = $ | |
936 | - | let D = $ | |
937 | + | let $t02214622213 = _calc_withdraw_one_coin(_token_amount, i) | |
938 | + | let dy = $t02214622213._1 | |
939 | + | let dy_fee = $t02214622213._2 | |
940 | + | let D = $t02214622213._3 | |
937 | 941 | if (assert((dy >= min_amount))) | |
938 | 942 | then throw("not enough coins removed") | |
939 | 943 | else { | |
970 | 974 | ||
971 | 975 | ||
972 | 976 | @Callable(msg) | |
973 | - | func A () = $Tuple2(nil, | |
977 | + | func A () = $Tuple2(nil, amp) | |
974 | 978 | ||
975 | 979 | ||
976 | 980 | ||
977 | 981 | @Callable(msg) | |
978 | 982 | func get_virtual_price () = { | |
979 | - | let D = get_D(big_list(balances), | |
983 | + | let D = get_D(big_list(balances), amp) | |
980 | 984 | $Tuple2(nil, virtual_price(D)) | |
981 | 985 | } | |
982 | 986 | ||
983 | 987 | ||
984 | 988 | ||
985 | 989 | @Callable(msg) | |
986 | - | func calc_token_amount (_amounts | |
990 | + | func calc_token_amount (_amounts) = { | |
987 | 991 | let amounts = list_stoi(split(_amounts, ",")) | |
988 | 992 | if ((size(amounts) != N_COINS)) | |
989 | 993 | then throw("not enought amounts") | |
990 | 994 | else { | |
991 | - | let amp = _A() | |
992 | - | let D0 = get_D(big_list(amounts), amp) | |
993 | - | func fold (acc,index) = (acc :+ (balances[index] + (if (deposit) | |
994 | - | then amounts[index] | |
995 | - | else -(amounts[index])))) | |
995 | + | func fold (acc,index) = (acc :+ (balances[index] + amounts[index])) | |
996 | 996 | ||
997 | 997 | let new_balances = { | |
998 | 998 | let $l = index_N_COINS | |
1008 | 1008 | ||
1009 | 1009 | $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) | |
1010 | 1010 | } | |
1011 | - | let D1 = get_D(big_list(new_balances), amp) | |
1012 | - | let token_amount = token_quantity | |
1013 | - | let diff = if (deposit) | |
1014 | - | then (D1 - D0) | |
1015 | - | else (D0 - D1) | |
1016 | - | $Tuple2(nil, fraction(diff, token_amount, D0)) | |
1011 | + | let $t02366023746 = _calc_token_amount(new_balances) | |
1012 | + | let final_balances = $t02366023746._1 | |
1013 | + | let mint_amount = $t02366023746._2 | |
1014 | + | let fees_actions = $t02366023746._3 | |
1015 | + | $Tuple2(nil, mint_amount) | |
1017 | 1016 | } | |
1018 | 1017 | } | |
1019 | 1018 | ||
1027 | 1026 | else if (assert((_future_time >= (block_timestamp + MIN_RAMP_TIME)))) | |
1028 | 1027 | then throw("insufficient time") | |
1029 | 1028 | else { | |
1030 | - | let _initial_A = | |
1029 | + | let _initial_A = amp | |
1031 | 1030 | if (assert(if ((_future_A > 0)) | |
1032 | 1031 | then (MAX_A > _future_A) | |
1033 | 1032 | else false)) | |
1049 | 1048 | func stop_ramp_A () = if (assert((msg.caller == owner))) | |
1050 | 1049 | then throw("only owner") | |
1051 | 1050 | else { | |
1052 | - | let current_A = | |
1051 | + | let current_A = amp | |
1053 | 1052 | [IntegerEntry("initial_A", current_A), IntegerEntry("future_A", current_A), IntegerEntry("initial_A_time", block_timestamp), IntegerEntry("future_A_time", block_timestamp)] | |
1054 | 1053 | } | |
1055 | 1054 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let N_COINS = getIntegerValue(this, "N_COINS") | |
5 | 5 | ||
6 | 6 | let N_COINS_big = toBigInt(N_COINS) | |
7 | 7 | ||
8 | 8 | let N_COINS_MAX = 10 | |
9 | 9 | ||
10 | 10 | let TOKEN_DECIMALS = 6 | |
11 | 11 | ||
12 | 12 | let TOKEN_RATE = 1000000 | |
13 | 13 | ||
14 | 14 | let FEE_DENOMINATOR = 10000000000 | |
15 | 15 | ||
16 | 16 | let PRECISION = 1000000 | |
17 | 17 | ||
18 | 18 | let DECIMALS = 6 | |
19 | 19 | ||
20 | 20 | let MAX_ADMIN_FEE = 10000000000 | |
21 | 21 | ||
22 | 22 | let MAX_FEE = 5000000000 | |
23 | 23 | ||
24 | 24 | let MAX_A = 1000000 | |
25 | 25 | ||
26 | 26 | let MAX_A_CHANGE = 10 | |
27 | 27 | ||
28 | 28 | let ADMIN_ACTIONS_DELAY = ((3 * 86400) / 60) | |
29 | 29 | ||
30 | 30 | let MIN_RAMP_TIME = (86400 / 60) | |
31 | 31 | ||
32 | 32 | let VP_LOG_PERIOD = 86400000 | |
33 | 33 | ||
34 | 34 | let VP_PRECISION = 1000000000000 | |
35 | 35 | ||
36 | 36 | let coins = split(getStringValue(this, "coins"), ",") | |
37 | 37 | ||
38 | 38 | let fee = getIntegerValue(this, "fee") | |
39 | 39 | ||
40 | 40 | let admin_fee = getIntegerValue(this, "admin_fee") | |
41 | 41 | ||
42 | 42 | let is_auto_fees = getBooleanValue(this, "is_auto_fees") | |
43 | 43 | ||
44 | 44 | let owner = addressFromStringValue(getStringValue(this, "owner")) | |
45 | 45 | ||
46 | 46 | let token = fromBase58String(getStringValue(this, "token")) | |
47 | 47 | ||
48 | 48 | let token_quantity = value(assetInfo(token)).quantity | |
49 | 49 | ||
50 | 50 | let initial_A = getIntegerValue(this, "initial_A") | |
51 | 51 | ||
52 | 52 | let future_A = getIntegerValue(this, "future_A") | |
53 | 53 | ||
54 | 54 | let initial_A_time = valueOrElse(getInteger(this, "initial_A_time"), 0) | |
55 | 55 | ||
56 | 56 | let future_A_time = valueOrElse(getInteger(this, "future_A_time"), 0) | |
57 | 57 | ||
58 | 58 | let admin_actions_deadline = valueOrElse(getInteger(this, "admin_actions_deadline"), 0) | |
59 | 59 | ||
60 | 60 | let transfer_ownership_deadline = valueOrElse(getInteger(this, "transfer_ownership_deadline"), 0) | |
61 | 61 | ||
62 | 62 | let future_fee = getIntegerValue(this, "future_fee") | |
63 | 63 | ||
64 | 64 | let future_admin_fee = getIntegerValue(this, "future_admin_fee") | |
65 | 65 | ||
66 | 66 | let future_owner = getStringValue(this, "future_owner") | |
67 | 67 | ||
68 | 68 | let is_killed = getBooleanValue(this, "is_killed") | |
69 | 69 | ||
70 | 70 | let kill_deadline = getIntegerValue(this, "kill_deadline") | |
71 | 71 | ||
72 | 72 | let KILL_DEADLINE_DT = (((2 * 30) * 86400) / 60) | |
73 | 73 | ||
74 | 74 | let big0 = toBigInt(0) | |
75 | 75 | ||
76 | 76 | let big1 = toBigInt(1) | |
77 | 77 | ||
78 | 78 | let big2 = toBigInt(2) | |
79 | 79 | ||
80 | 80 | let heightAddress = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, "heightAddress"), "no settings defined")), "bad settings address") | |
81 | 81 | ||
82 | 82 | let HEIGHT = height | |
83 | 83 | ||
84 | 84 | let block_timestamp = HEIGHT | |
85 | 85 | ||
86 | 86 | func assert (a) = if (a) | |
87 | 87 | then false | |
88 | 88 | else true | |
89 | 89 | ||
90 | 90 | ||
91 | 91 | func list_itos (list) = if ((size(list) > N_COINS_MAX)) | |
92 | 92 | then throw("list_itos: list.size() > N_COINS_MAX") | |
93 | 93 | else { | |
94 | 94 | func fold (acc,val) = (acc :+ toString(val)) | |
95 | 95 | ||
96 | 96 | let $l = list | |
97 | 97 | let $s = size($l) | |
98 | 98 | let $acc0 = nil | |
99 | 99 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
100 | 100 | then $a | |
101 | 101 | else fold($a, $l[$i]) | |
102 | 102 | ||
103 | 103 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
104 | 104 | then $a | |
105 | 105 | else throw("List size exceeds 10") | |
106 | 106 | ||
107 | 107 | $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) | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | ||
111 | 111 | func list_stoi (list) = if ((size(list) > N_COINS_MAX)) | |
112 | 112 | then throw("list_stoi: list.size() > N_COINS_MAX") | |
113 | 113 | else { | |
114 | 114 | func fold (acc,val) = (acc :+ parseIntValue(val)) | |
115 | 115 | ||
116 | 116 | let $l = list | |
117 | 117 | let $s = size($l) | |
118 | 118 | let $acc0 = nil | |
119 | 119 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
120 | 120 | then $a | |
121 | 121 | else fold($a, $l[$i]) | |
122 | 122 | ||
123 | 123 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
124 | 124 | then $a | |
125 | 125 | else throw("List size exceeds 10") | |
126 | 126 | ||
127 | 127 | $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) | |
128 | 128 | } | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | let balances = list_stoi(split(getStringValue(this, "balances"), ",")) | |
132 | 132 | ||
133 | 133 | let rates = list_stoi(split(getStringValue(this, "rates"), ",")) | |
134 | 134 | ||
135 | 135 | let rates_size = size(rates) | |
136 | 136 | ||
137 | 137 | let index_N_COINS_MAX = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
138 | 138 | ||
139 | 139 | func index_n (n) = if ((n > N_COINS_MAX)) | |
140 | 140 | then throw("index_n: n > N_COINS_MAX") | |
141 | 141 | else { | |
142 | 142 | func fold (acc,index) = if ((n > index)) | |
143 | 143 | then (acc :+ index) | |
144 | 144 | else acc | |
145 | 145 | ||
146 | 146 | let $l = index_N_COINS_MAX | |
147 | 147 | let $s = size($l) | |
148 | 148 | let $acc0 = nil | |
149 | 149 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
150 | 150 | then $a | |
151 | 151 | else fold($a, $l[$i]) | |
152 | 152 | ||
153 | 153 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
154 | 154 | then $a | |
155 | 155 | else throw("List size exceeds 10") | |
156 | 156 | ||
157 | 157 | $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) | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | let index_N_COINS = index_n(N_COINS) | |
162 | 162 | ||
163 | 163 | let index_N_COINS_1 = (index_N_COINS :+ N_COINS) | |
164 | 164 | ||
165 | 165 | func big_list (list) = if ((size(list) != N_COINS)) | |
166 | 166 | then throw("big_list: list.size() != N_COINS") | |
167 | 167 | else { | |
168 | 168 | func fold (acc,index) = (acc :+ toBigInt(fraction(list[index], TOKEN_RATE, rates[index]))) | |
169 | 169 | ||
170 | 170 | let $l = index_N_COINS | |
171 | 171 | let $s = size($l) | |
172 | 172 | let $acc0 = nil | |
173 | 173 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
174 | 174 | then $a | |
175 | 175 | else fold($a, $l[$i]) | |
176 | 176 | ||
177 | 177 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
178 | 178 | then $a | |
179 | 179 | else throw("List size exceeds 10") | |
180 | 180 | ||
181 | 181 | $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) | |
182 | 182 | } | |
183 | 183 | ||
184 | 184 | ||
185 | 185 | func coin_index (payment) = match payment.assetId { | |
186 | 186 | case assetId: ByteVector => | |
187 | 187 | valueOrErrorMessage(indexOf(coins, toBase58String(assetId)), (toBase58String(assetId) + " out of pool")) | |
188 | 188 | case _ => | |
189 | 189 | throw("unsupported assetId") | |
190 | 190 | } | |
191 | 191 | ||
192 | 192 | ||
193 | 193 | func admin_balance (i) = if (if ((0 > i)) | |
194 | 194 | then true | |
195 | 195 | else (i > N_COINS)) | |
196 | 196 | then throw("i out of index") | |
197 | 197 | else (assetBalance(this, fromBase58String(coins[i])) - balances[i]) | |
198 | 198 | ||
199 | 199 | ||
200 | 200 | func checkAddress (a58) = { | |
201 | 201 | let a = addressFromStringValue(a58) | |
202 | 202 | toString(a) | |
203 | 203 | } | |
204 | 204 | ||
205 | 205 | ||
206 | - | ||
206 | + | let amp = { | |
207 | 207 | let t1 = future_A_time | |
208 | 208 | let A1 = future_A | |
209 | 209 | if ((t1 > block_timestamp)) | |
210 | 210 | then { | |
211 | 211 | let A0 = initial_A | |
212 | 212 | let t0 = initial_A_time | |
213 | 213 | if ((A1 > A0)) | |
214 | 214 | then (A0 + (((A1 - A0) * (block_timestamp - t0)) / (t1 - t0))) | |
215 | 215 | else (A0 - (((A0 - A1) * (block_timestamp - t0)) / (t1 - t0))) | |
216 | 216 | } | |
217 | 217 | else A1 | |
218 | 218 | } | |
219 | - | ||
220 | 219 | ||
221 | 220 | func list_sum (list) = { | |
222 | 221 | func fold (acc,val) = (acc + val) | |
223 | 222 | ||
224 | 223 | let $l = list | |
225 | 224 | let $s = size($l) | |
226 | 225 | let $acc0 = big0 | |
227 | 226 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
228 | 227 | then $a | |
229 | 228 | else fold($a, $l[$i]) | |
230 | 229 | ||
231 | 230 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
232 | 231 | then $a | |
233 | 232 | else throw("List size exceeds 10") | |
234 | 233 | ||
235 | 234 | $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) | |
236 | 235 | } | |
237 | 236 | ||
238 | 237 | ||
239 | 238 | func list_mult (list) = { | |
240 | 239 | func fold (acc,val) = fraction(fraction(acc, val, big1), N_COINS_big, big1) | |
241 | 240 | ||
242 | 241 | let $l = list | |
243 | 242 | let $s = size($l) | |
244 | 243 | let $acc0 = big1 | |
245 | 244 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
246 | 245 | then $a | |
247 | 246 | else fold($a, $l[$i]) | |
248 | 247 | ||
249 | 248 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
250 | 249 | then $a | |
251 | 250 | else throw("List size exceeds 10") | |
252 | 251 | ||
253 | 252 | $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) | |
254 | 253 | } | |
255 | 254 | ||
256 | 255 | ||
257 | 256 | let list16 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] | |
258 | 257 | ||
259 | 258 | func get_D (xp,amp) = { | |
260 | 259 | let S = list_sum(xp) | |
261 | 260 | if ((toInt(S) == 0)) | |
262 | 261 | then 0 | |
263 | 262 | else { | |
264 | 263 | let Ann = (amp * N_COINS) | |
265 | 264 | let AnnS = fraction(toBigInt(Ann), S, big1) | |
266 | 265 | let Ann1 = toBigInt((Ann - 1)) | |
267 | 266 | let xd = list_mult(xp) | |
268 | 267 | let N_COINS_1 = (N_COINS + 1) | |
269 | 268 | let N_COINS_1_big = toBigInt(N_COINS_1) | |
270 | 269 | func D_mult (val) = { | |
271 | 270 | func fold (acc,index) = fraction(acc, val, big1) | |
272 | 271 | ||
273 | 272 | let $l = index_N_COINS_1 | |
274 | 273 | let $s = size($l) | |
275 | 274 | let $acc0 = big1 | |
276 | 275 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
277 | 276 | then $a | |
278 | 277 | else fold($a, $l[$i]) | |
279 | 278 | ||
280 | 279 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
281 | 280 | then $a | |
282 | 281 | else throw("List size exceeds 10") | |
283 | 282 | ||
284 | 283 | $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) | |
285 | 284 | } | |
286 | 285 | ||
287 | 286 | func D_proc (acc,unused) = if ((acc._2 == true)) | |
288 | 287 | then acc | |
289 | 288 | else { | |
290 | 289 | let Dprev = acc._1 | |
291 | 290 | let D_P = fraction(D_mult(Dprev), big1, xd) | |
292 | 291 | let D = fraction((AnnS + fraction(N_COINS_big, D_P, big1)), Dprev, (fraction(Ann1, Dprev, big1) + fraction(N_COINS_1_big, D_P, big1))) | |
293 | 292 | if ((D > Dprev)) | |
294 | 293 | then if ((1 >= toInt((D - Dprev)))) | |
295 | 294 | then $Tuple2(D, true) | |
296 | 295 | else $Tuple2(D, false) | |
297 | 296 | else if ((1 >= toInt((Dprev - D)))) | |
298 | 297 | then $Tuple2(D, true) | |
299 | 298 | else $Tuple2(D, false) | |
300 | 299 | } | |
301 | 300 | ||
302 | - | let $ | |
301 | + | let $t060426104 = { | |
303 | 302 | let $l = list16 | |
304 | 303 | let $s = size($l) | |
305 | 304 | let $acc0 = $Tuple2(S, false) | |
306 | 305 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
307 | 306 | then $a | |
308 | 307 | else D_proc($a, $l[$i]) | |
309 | 308 | ||
310 | 309 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
311 | 310 | then $a | |
312 | 311 | else throw("List size exceeds 16") | |
313 | 312 | ||
314 | 313 | $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
315 | 314 | } | |
316 | - | let D = $ | |
317 | - | let finished = $ | |
315 | + | let D = $t060426104._1 | |
316 | + | let finished = $t060426104._2 | |
318 | 317 | if ((finished == false)) | |
319 | 318 | then throw(("D_proc() not finished with " + toString(D))) | |
320 | 319 | else toInt(D) | |
321 | 320 | } | |
322 | 321 | } | |
323 | 322 | ||
324 | 323 | ||
325 | 324 | func get_y (i,j,x,xp) = if (assert((i != j))) | |
326 | 325 | then throw("same coin") | |
327 | 326 | else if (assert(if ((j >= 0)) | |
328 | 327 | then (i >= 0) | |
329 | 328 | else false)) | |
330 | 329 | then throw("below zero") | |
331 | 330 | else if (assert(if ((N_COINS > j)) | |
332 | 331 | then (N_COINS > i) | |
333 | 332 | else false)) | |
334 | 333 | then throw("above N_COINS") | |
335 | 334 | else { | |
336 | - | let amp = _A() | |
337 | 335 | let D = get_D(xp, amp) | |
338 | 336 | let D_big = toBigInt(D) | |
339 | 337 | let Ann_big = toBigInt((amp * N_COINS)) | |
340 | 338 | func S_c (acc,index) = { | |
341 | - | let $ | |
342 | - | let S_ = $ | |
343 | - | let c = $ | |
339 | + | let $t066976716 = acc | |
340 | + | let S_ = $t066976716._1 | |
341 | + | let c = $t066976716._2 | |
344 | 342 | let x_ = if ((index == i)) | |
345 | 343 | then toBigInt(fraction(x, TOKEN_RATE, rates[index])) | |
346 | 344 | else xp[index] | |
347 | 345 | if ((index != j)) | |
348 | 346 | then $Tuple2((S_ + x_), fraction(c, D_big, fraction(x_, N_COINS_big, big1))) | |
349 | 347 | else $Tuple2(S_, c) | |
350 | 348 | } | |
351 | 349 | ||
352 | - | let $ | |
350 | + | let $t069927056 = { | |
353 | 351 | let $l = index_N_COINS | |
354 | 352 | let $s = size($l) | |
355 | 353 | let $acc0 = $Tuple2(big0, D_big) | |
356 | 354 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
357 | 355 | then $a | |
358 | 356 | else S_c($a, $l[$i]) | |
359 | 357 | ||
360 | 358 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
361 | 359 | then $a | |
362 | 360 | else throw("List size exceeds 10") | |
363 | 361 | ||
364 | 362 | $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) | |
365 | 363 | } | |
366 | - | let S_ = $ | |
367 | - | let c_ = $ | |
364 | + | let S_ = $t069927056._1 | |
365 | + | let c_ = $t069927056._2 | |
368 | 366 | let c = fraction(c_, D_big, fraction(Ann_big, N_COINS_big, big1)) | |
369 | 367 | let bD = ((S_ + fraction(D_big, big1, Ann_big)) - D_big) | |
370 | 368 | func y_proc (acc,unused) = if ((acc._2 == true)) | |
371 | 369 | then acc | |
372 | 370 | else { | |
373 | 371 | let y_prev = acc._1 | |
374 | 372 | let y = fraction((fraction(y_prev, y_prev, big1) + c), big1, (fraction(big2, y_prev, big1) + bD)) | |
375 | 373 | if ((y > y_prev)) | |
376 | 374 | then if ((1 >= toInt((y - y_prev)))) | |
377 | 375 | then $Tuple2(y, true) | |
378 | 376 | else $Tuple2(y, false) | |
379 | 377 | else if ((1 >= toInt((y_prev - y)))) | |
380 | 378 | then $Tuple2(y, true) | |
381 | 379 | else $Tuple2(y, false) | |
382 | 380 | } | |
383 | 381 | ||
384 | - | let $ | |
382 | + | let $t076367702 = { | |
385 | 383 | let $l = list16 | |
386 | 384 | let $s = size($l) | |
387 | 385 | let $acc0 = $Tuple2(D_big, false) | |
388 | 386 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
389 | 387 | then $a | |
390 | 388 | else y_proc($a, $l[$i]) | |
391 | 389 | ||
392 | 390 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
393 | 391 | then $a | |
394 | 392 | else throw("List size exceeds 16") | |
395 | 393 | ||
396 | 394 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
397 | 395 | } | |
398 | - | let y = $ | |
399 | - | let finished = $ | |
396 | + | let y = $t076367702._1 | |
397 | + | let finished = $t076367702._2 | |
400 | 398 | if ((finished == false)) | |
401 | 399 | then throw(("y_proc() not finished with " + toString(y))) | |
402 | 400 | else $Tuple2(fraction(toInt(y), rates[j], TOKEN_RATE), D) | |
403 | 401 | } | |
404 | 402 | ||
405 | 403 | ||
406 | 404 | func get_y_D (amp,i,xp,D) = if (assert((i >= 0))) | |
407 | 405 | then throw("i below zero") | |
408 | 406 | else if (assert((N_COINS > i))) | |
409 | 407 | then throw("i above N_COINS") | |
410 | 408 | else { | |
411 | 409 | let D_big = toBigInt(D) | |
412 | 410 | let Ann_big = toBigInt((amp * N_COINS)) | |
413 | 411 | func S_c (acc,index) = { | |
414 | - | let $ | |
415 | - | let S_ = $ | |
416 | - | let c = $ | |
412 | + | let $t082078226 = acc | |
413 | + | let S_ = $t082078226._1 | |
414 | + | let c = $t082078226._2 | |
417 | 415 | let x_ = if ((index == i)) | |
418 | 416 | then big0 | |
419 | 417 | else xp[index] | |
420 | 418 | if ((index != i)) | |
421 | 419 | then $Tuple2((S_ + x_), fraction(c, D_big, fraction(x_, N_COINS_big, big1))) | |
422 | 420 | else $Tuple2(S_, c) | |
423 | 421 | } | |
424 | 422 | ||
425 | - | let $ | |
423 | + | let $t084568520 = { | |
426 | 424 | let $l = index_N_COINS | |
427 | 425 | let $s = size($l) | |
428 | 426 | let $acc0 = $Tuple2(big0, D_big) | |
429 | 427 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
430 | 428 | then $a | |
431 | 429 | else S_c($a, $l[$i]) | |
432 | 430 | ||
433 | 431 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
434 | 432 | then $a | |
435 | 433 | else throw("List size exceeds 10") | |
436 | 434 | ||
437 | 435 | $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) | |
438 | 436 | } | |
439 | - | let S_ = $ | |
440 | - | let c_ = $ | |
437 | + | let S_ = $t084568520._1 | |
438 | + | let c_ = $t084568520._2 | |
441 | 439 | let c = fraction(c_, D_big, fraction(Ann_big, N_COINS_big, big1)) | |
442 | 440 | let bD = ((S_ + fraction(D_big, big1, Ann_big)) - D_big) | |
443 | 441 | func y_proc (acc,unused) = if ((acc._2 == true)) | |
444 | 442 | then acc | |
445 | 443 | else { | |
446 | 444 | let y_prev = acc._1 | |
447 | 445 | let y = fraction((fraction(y_prev, y_prev, big1) + c), big1, (fraction(big2, y_prev, big1) + bD)) | |
448 | 446 | if ((y > y_prev)) | |
449 | 447 | then if ((1 >= toInt((y - y_prev)))) | |
450 | 448 | then $Tuple2(y, true) | |
451 | 449 | else $Tuple2(y, false) | |
452 | 450 | else if ((1 >= toInt((y_prev - y)))) | |
453 | 451 | then $Tuple2(y, true) | |
454 | 452 | else $Tuple2(y, false) | |
455 | 453 | } | |
456 | 454 | ||
457 | - | let $ | |
455 | + | let $t091009166 = { | |
458 | 456 | let $l = list16 | |
459 | 457 | let $s = size($l) | |
460 | 458 | let $acc0 = $Tuple2(D_big, false) | |
461 | 459 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
462 | 460 | then $a | |
463 | 461 | else y_proc($a, $l[$i]) | |
464 | 462 | ||
465 | 463 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
466 | 464 | then $a | |
467 | 465 | else throw("List size exceeds 16") | |
468 | 466 | ||
469 | 467 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16) | |
470 | 468 | } | |
471 | - | let y = $ | |
472 | - | let finished = $ | |
469 | + | let y = $t091009166._1 | |
470 | + | let finished = $t091009166._2 | |
473 | 471 | if ((finished == false)) | |
474 | 472 | then throw(("y_proc() not finished with " + toString(y))) | |
475 | 473 | else fraction(toInt(y), rates[i], TOKEN_RATE) | |
476 | 474 | } | |
477 | 475 | ||
478 | 476 | ||
479 | 477 | func _calc_withdraw_one_coin (_token_amount,i) = { | |
480 | - | let amp = _A() | |
481 | 478 | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
482 | 479 | let xp = big_list(balances) | |
483 | 480 | let D0 = get_D(xp, amp) | |
484 | 481 | let D1 = (D0 - fraction(_token_amount, D0, token_quantity)) | |
485 | 482 | let new_y = get_y_D(amp, i, xp, D1) | |
486 | 483 | let dy_0 = (balances[i] - new_y) | |
487 | 484 | func fold (acc,index) = { | |
488 | 485 | let xp_j = balances[index] | |
489 | 486 | let dx_expected = if ((index == i)) | |
490 | 487 | then (fraction(xp_j, D1, D0) - new_y) | |
491 | 488 | else (xp_j - fraction(xp_j, D1, D0)) | |
492 | 489 | (acc :+ (xp_j - fraction(_fee, dx_expected, FEE_DENOMINATOR))) | |
493 | 490 | } | |
494 | 491 | ||
495 | 492 | let xp_reduced = { | |
496 | 493 | let $l = index_N_COINS | |
497 | 494 | let $s = size($l) | |
498 | 495 | let $acc0 = nil | |
499 | 496 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
500 | 497 | then $a | |
501 | 498 | else fold($a, $l[$i]) | |
502 | 499 | ||
503 | 500 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
504 | 501 | then $a | |
505 | 502 | else throw("List size exceeds 10") | |
506 | 503 | ||
507 | 504 | $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) | |
508 | 505 | } | |
509 | 506 | let xp_reduced_i = xp_reduced[i] | |
510 | 507 | let dy = ((xp_reduced_i - get_y_D(amp, i, big_list(xp_reduced), D1)) - 1) | |
511 | 508 | $Tuple3(dy, (dy_0 - dy), D0) | |
512 | 509 | } | |
513 | 510 | ||
514 | 511 | ||
515 | 512 | func virtual_price (D) = fraction(D, VP_PRECISION, token_quantity) | |
516 | 513 | ||
517 | 514 | ||
518 | 515 | func log_data (D,add) = { | |
519 | 516 | let total_vol = (parseBigIntValue(valueOrElse(getString("vol"), "0")) + toBigInt(add)) | |
520 | 517 | let total_vol_string = toString(total_vol) | |
521 | 518 | ([StringEntry("vol", total_vol_string)] ++ { | |
522 | 519 | let log_period = toString((lastBlock.timestamp / VP_LOG_PERIOD)) | |
523 | 520 | let log_key = ("log_" + log_period) | |
524 | 521 | if (isDefined(getString(log_key))) | |
525 | 522 | then nil | |
526 | 523 | else [StringEntry(log_key, ((((toString(virtual_price(D)) + "_") + total_vol_string) + "_") + toString(lastBlock.timestamp)))] | |
527 | 524 | }) | |
528 | 525 | } | |
529 | 526 | ||
530 | 527 | ||
531 | 528 | func get_nearest_log (period) = { | |
532 | 529 | func fold (log_value,step) = if ((log_value != "")) | |
533 | 530 | then log_value | |
534 | 531 | else { | |
535 | 532 | let log_key = ("log_" + toString((period - step))) | |
536 | 533 | valueOrElse(getString(log_key), "") | |
537 | 534 | } | |
538 | 535 | ||
539 | 536 | let list30p = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29] | |
540 | 537 | let list30m = [-1, -2, -3, -4, -5, -6, -7, -8, -9, -10, -11, -12, -13, -14, -15, -16, -17, -18, -19, -20, -21, -22, -23, -24, -25, -26, -27, -28, -29, -30] | |
541 | 538 | let value30p = { | |
542 | 539 | let $l = list30p | |
543 | 540 | let $s = size($l) | |
544 | 541 | let $acc0 = "" | |
545 | 542 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
546 | 543 | then $a | |
547 | 544 | else fold($a, $l[$i]) | |
548 | 545 | ||
549 | 546 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
550 | 547 | then $a | |
551 | 548 | else throw("List size exceeds 30") | |
552 | 549 | ||
553 | 550 | $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($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), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
554 | 551 | } | |
555 | 552 | if ((value30p != "")) | |
556 | 553 | then value30p | |
557 | 554 | else { | |
558 | 555 | let $l = list30m | |
559 | 556 | let $s = size($l) | |
560 | 557 | let $acc0 = "" | |
561 | 558 | func $f1_1 ($a,$i) = if (($i >= $s)) | |
562 | 559 | then $a | |
563 | 560 | else fold($a, $l[$i]) | |
564 | 561 | ||
565 | 562 | func $f1_2 ($a,$i) = if (($i >= $s)) | |
566 | 563 | then $a | |
567 | 564 | else throw("List size exceeds 30") | |
568 | 565 | ||
569 | 566 | $f1_2($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($f1_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20), 21), 22), 23), 24), 25), 26), 27), 28), 29), 30) | |
570 | 567 | } | |
571 | 568 | } | |
572 | 569 | ||
573 | 570 | ||
574 | 571 | func get_virtual_price_diff (_t0) = { | |
575 | - | let vp1 = virtual_price(get_D(big_list(balances), | |
572 | + | let vp1 = virtual_price(get_D(big_list(balances), amp)) | |
576 | 573 | let vp1_timestamp = lastBlock.timestamp | |
577 | 574 | let t0 = if ((0 >= _t0)) | |
578 | 575 | then (vp1_timestamp + _t0) | |
579 | 576 | else _t0 | |
580 | 577 | let t0_period = (t0 / VP_LOG_PERIOD) | |
581 | 578 | let log_value = get_nearest_log(t0_period) | |
582 | 579 | if ((log_value == "")) | |
583 | 580 | then $Tuple3(vp1, vp1, 0) | |
584 | 581 | else { | |
585 | 582 | let log_list = split(log_value, "_") | |
586 | 583 | let vp0 = parseIntValue(log_list[0]) | |
587 | 584 | let vp0_timestamp = parseIntValue(log_list[2]) | |
588 | 585 | $Tuple3(vp1, vp0, (vp1_timestamp - vp0_timestamp)) | |
589 | 586 | } | |
590 | 587 | } | |
591 | 588 | ||
592 | 589 | ||
593 | 590 | func get_volume_diff (_t0) = { | |
594 | 591 | let vol1 = parseBigIntValue(valueOrElse(getString("vol"), "0")) | |
595 | 592 | let vol1_timestamp = lastBlock.timestamp | |
596 | 593 | let t0 = if ((0 >= _t0)) | |
597 | 594 | then (vol1_timestamp + _t0) | |
598 | 595 | else _t0 | |
599 | 596 | let t0_period = (t0 / VP_LOG_PERIOD) | |
600 | 597 | let log_value = get_nearest_log(t0_period) | |
601 | 598 | if ((log_value == "")) | |
602 | 599 | then $Tuple3(vol1, vol1, 0) | |
603 | 600 | else { | |
604 | 601 | let log_list = split(log_value, "_") | |
605 | 602 | let vol0 = parseBigIntValue(log_list[1]) | |
606 | 603 | let vol0_timestamp = parseIntValue(log_list[2]) | |
607 | 604 | $Tuple3(vol1, vol0, (vol1_timestamp - vol0_timestamp)) | |
605 | + | } | |
606 | + | } | |
607 | + | ||
608 | + | ||
609 | + | func _calc_token_amount (new_balances) = { | |
610 | + | let D0 = if ((token_quantity == 0)) | |
611 | + | then 0 | |
612 | + | else get_D(big_list(balances), amp) | |
613 | + | let D1 = get_D(big_list(new_balances), amp) | |
614 | + | if (assert((D1 > D0))) | |
615 | + | then throw("D1 > D0") | |
616 | + | else { | |
617 | + | let $t01289914902 = if ((token_quantity > 0)) | |
618 | + | then { | |
619 | + | func fee_balances (old,new) = { | |
620 | + | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
621 | + | let n = size(old) | |
622 | + | func fold (acc,index) = { | |
623 | + | let old_balance = old[index] | |
624 | + | let new_balance = new[index] | |
625 | + | let ideal_balance = fraction(D1, old_balance, D0) | |
626 | + | let difference = if ((ideal_balance > new_balance)) | |
627 | + | then (ideal_balance - new_balance) | |
628 | + | else (new_balance - ideal_balance) | |
629 | + | let amount_fee = fraction(_fee, difference, FEE_DENOMINATOR) | |
630 | + | let amount_admin_fee = fraction(amount_fee, admin_fee, FEE_DENOMINATOR) | |
631 | + | $Tuple4((acc._1 :+ (new_balance - amount_admin_fee)), (acc._2 :+ (new_balance - amount_fee)), if (if (is_auto_fees) | |
632 | + | then (amount_admin_fee > 0) | |
633 | + | else false) | |
634 | + | then (acc._3 :+ ScriptTransfer(owner, amount_admin_fee, fromBase58String(coins[index]))) | |
635 | + | else acc._3, (acc._4 + fraction(amount_fee, TOKEN_RATE, rates[index]))) | |
636 | + | } | |
637 | + | ||
638 | + | let $l = index_N_COINS | |
639 | + | let $s = size($l) | |
640 | + | let $acc0 = $Tuple4(nil, nil, nil, 0) | |
641 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
642 | + | then $a | |
643 | + | else fold($a, $l[$i]) | |
644 | + | ||
645 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
646 | + | then $a | |
647 | + | else throw("List size exceeds 10") | |
648 | + | ||
649 | + | $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) | |
650 | + | } | |
651 | + | ||
652 | + | let $t01447314555 = fee_balances(balances, new_balances) | |
653 | + | let finals = $t01447314555._1 | |
654 | + | let no_fees = $t01447314555._2 | |
655 | + | let actions = $t01447314555._3 | |
656 | + | let fee_sum = $t01447314555._4 | |
657 | + | $Tuple3(finals, get_D(big_list(no_fees), amp), (actions ++ log_data(D0, fraction(fee_sum, FEE_DENOMINATOR, fee)))) | |
658 | + | } | |
659 | + | else $Tuple3(new_balances, D1, nil) | |
660 | + | let final_balances = $t01289914902._1 | |
661 | + | let D2 = $t01289914902._2 | |
662 | + | let fees_actions = $t01289914902._3 | |
663 | + | let mint_amount = if ((token_quantity == 0)) | |
664 | + | then D1 | |
665 | + | else fraction(token_quantity, (D2 - D0), D0) | |
666 | + | $Tuple3(final_balances, mint_amount, fees_actions) | |
608 | 667 | } | |
609 | 668 | } | |
610 | 669 | ||
611 | 670 | ||
612 | 671 | @Callable(msg) | |
613 | 672 | func init (_owner,_coins,_pool_token,_A,_fee,_admin_fee) = if (!(isDataStorageUntouched(this))) | |
614 | 673 | then throw("already initialized") | |
615 | 674 | else if ((msg.caller != this)) | |
616 | 675 | then throw("self initialization only") | |
617 | 676 | else { | |
618 | 677 | let coins_list = split(_coins, ",") | |
619 | 678 | let n = size(coins_list) | |
620 | 679 | if ((2 > n)) | |
621 | 680 | then throw("too small coins") | |
622 | 681 | else if ((n > N_COINS_MAX)) | |
623 | 682 | then throw("too many coins") | |
624 | 683 | else { | |
625 | 684 | func duplicates (acc,index) = if (if ((index >= n)) | |
626 | 685 | then true | |
627 | 686 | else (acc == false)) | |
628 | 687 | then acc | |
629 | 688 | else (indexOf(coins_list, coins_list[index]) == index) | |
630 | 689 | ||
631 | 690 | if ((false == { | |
632 | 691 | let $l = index_N_COINS_MAX | |
633 | 692 | let $s = size($l) | |
634 | 693 | let $acc0 = true | |
635 | 694 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
636 | 695 | then $a | |
637 | 696 | else duplicates($a, $l[$i]) | |
638 | 697 | ||
639 | 698 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
640 | 699 | then $a | |
641 | 700 | else throw("List size exceeds 10") | |
642 | 701 | ||
643 | 702 | $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) | |
644 | 703 | })) | |
645 | 704 | then throw("duplicate coin detected") | |
646 | 705 | else { | |
647 | 706 | func decimals (coin) = valueOrErrorMessage(assetInfo(valueOrErrorMessage(fromBase58String(coin), ("fromBase58String: " + coin))), ("assetInfo: " + coin)).decimals | |
648 | 707 | ||
649 | 708 | func fold (acc,coin) = $Tuple3((acc._1 + 1), (acc._2 :+ 0), (acc._3 :+ pow(10, 0, decimals(coin), 0, 0, DOWN))) | |
650 | 709 | ||
651 | - | let $ | |
710 | + | let $t01615616251 = { | |
652 | 711 | let $l = coins_list | |
653 | 712 | let $s = size($l) | |
654 | 713 | let $acc0 = $Tuple3(0, nil, nil) | |
655 | 714 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
656 | 715 | then $a | |
657 | 716 | else fold($a, $l[$i]) | |
658 | 717 | ||
659 | 718 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
660 | 719 | then $a | |
661 | 720 | else throw("List size exceeds 10") | |
662 | 721 | ||
663 | 722 | $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) | |
664 | 723 | } | |
665 | - | let _N_COINS = $ | |
666 | - | let zeros = $ | |
667 | - | let _rates = $ | |
724 | + | let _N_COINS = $t01615616251._1 | |
725 | + | let zeros = $t01615616251._2 | |
726 | + | let _rates = $t01615616251._3 | |
668 | 727 | let issueToken = Issue(_pool_token, ("LP token for " + _coins), 0, TOKEN_DECIMALS, true) | |
669 | 728 | let tokenId = toBase58String(calculateAssetId(issueToken)) | |
670 | 729 | [StringEntry("coins", _coins), StringEntry("rates", makeString(list_itos(_rates), ",")), StringEntry("balances", makeString(list_itos(zeros), ",")), IntegerEntry("N_COINS", _N_COINS), IntegerEntry("initial_A", _A), IntegerEntry("future_A", _A), IntegerEntry("fee", _fee), IntegerEntry("admin_fee", _admin_fee), StringEntry("owner", checkAddress(_owner)), IntegerEntry("kill_deadline", (height + KILL_DEADLINE_DT)), StringEntry("token", tokenId), BooleanEntry("is_killed", false), BooleanEntry("is_auto_fees", true), issueToken] | |
671 | 730 | } | |
672 | 731 | } | |
673 | 732 | } | |
674 | 733 | ||
675 | 734 | ||
676 | 735 | ||
677 | 736 | @Callable(msg) | |
678 | 737 | func add_liquidity (min_mint_amount) = if (assert(!(is_killed))) | |
679 | 738 | then throw("is killed") | |
680 | 739 | else { | |
681 | - | let amp = _A() | |
682 | - | let token_supply = token_quantity | |
683 | - | let D0 = if ((token_supply == 0)) | |
684 | - | then 0 | |
685 | - | else get_D(big_list(balances), amp) | |
686 | 740 | func update_1_balance (base,target,amount) = { | |
687 | 741 | func fold (acc,index) = (acc :+ (base[index] + (if ((index == target)) | |
688 | 742 | then amount | |
689 | 743 | else 0))) | |
690 | 744 | ||
691 | 745 | let $l = index_N_COINS | |
692 | 746 | let $s = size($l) | |
693 | 747 | let $acc0 = nil | |
694 | 748 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
695 | 749 | then $a | |
696 | 750 | else fold($a, $l[$i]) | |
697 | 751 | ||
698 | 752 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
699 | 753 | then $a | |
700 | 754 | else throw("List size exceeds 10") | |
701 | 755 | ||
702 | 756 | $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) | |
703 | 757 | } | |
704 | 758 | ||
705 | 759 | func up_balances (base,payments) = { | |
706 | 760 | let n = size(payments) | |
707 | 761 | if ((1 > n)) | |
708 | 762 | then throw("payments size < 1") | |
709 | 763 | else if ((n > N_COINS_MAX)) | |
710 | 764 | then throw("payments size > N_COINS_MAX") | |
711 | 765 | else { | |
712 | 766 | func fold (acc,payment) = update_1_balance(acc, coin_index(payment), payment.amount) | |
713 | 767 | ||
714 | 768 | let $l = payments | |
715 | 769 | let $s = size($l) | |
716 | 770 | let $acc0 = base | |
717 | 771 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
718 | 772 | then $a | |
719 | 773 | else fold($a, $l[$i]) | |
720 | 774 | ||
721 | 775 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
722 | 776 | then $a | |
723 | 777 | else throw("List size exceeds 10") | |
724 | 778 | ||
725 | 779 | $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) | |
726 | 780 | } | |
727 | 781 | } | |
728 | 782 | ||
729 | 783 | let new_balances = up_balances(balances, msg.payments) | |
730 | - | if (if ((token_ | |
784 | + | if (if ((token_quantity == 0)) | |
731 | 785 | then (min(new_balances) == 0) | |
732 | 786 | else false) | |
733 | 787 | then throw("initial deposit requires all coins") | |
734 | 788 | else { | |
735 | - | let D1 = get_D(big_list(new_balances), amp) | |
736 | - | if (assert((D1 > D0))) | |
737 | - | then throw("D1 > D0") | |
738 | - | else { | |
739 | - | let $t01600918010 = if ((token_supply > 0)) | |
740 | - | then { | |
741 | - | func fee_balances (old,new) = { | |
742 | - | let _fee = ((fee * N_COINS) / (4 * (N_COINS - 1))) | |
743 | - | let n = size(old) | |
744 | - | func fold (acc,index) = { | |
745 | - | let old_balance = old[index] | |
746 | - | let new_balance = new[index] | |
747 | - | let ideal_balance = fraction(D1, old_balance, D0) | |
748 | - | let difference = if ((ideal_balance > new_balance)) | |
749 | - | then (ideal_balance - new_balance) | |
750 | - | else (new_balance - ideal_balance) | |
751 | - | let amount_fee = fraction(_fee, difference, FEE_DENOMINATOR) | |
752 | - | let amount_admin_fee = fraction(amount_fee, admin_fee, FEE_DENOMINATOR) | |
753 | - | $Tuple4((acc._1 :+ (new_balance - amount_admin_fee)), (acc._2 :+ (new_balance - amount_fee)), if (if (is_auto_fees) | |
754 | - | then (amount_admin_fee > 0) | |
755 | - | else false) | |
756 | - | then (acc._3 :+ ScriptTransfer(owner, amount_admin_fee, fromBase58String(coins[index]))) | |
757 | - | else acc._3, (acc._4 + fraction(amount_fee, TOKEN_RATE, rates[index]))) | |
758 | - | } | |
759 | - | ||
760 | - | let $l = index_N_COINS | |
761 | - | let $s = size($l) | |
762 | - | let $acc0 = $Tuple4(nil, nil, nil, 0) | |
763 | - | func $f0_1 ($a,$i) = if (($i >= $s)) | |
764 | - | then $a | |
765 | - | else fold($a, $l[$i]) | |
766 | - | ||
767 | - | func $f0_2 ($a,$i) = if (($i >= $s)) | |
768 | - | then $a | |
769 | - | else throw("List size exceeds 10") | |
770 | - | ||
771 | - | $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) | |
772 | - | } | |
773 | - | ||
774 | - | let $t01758117663 = fee_balances(balances, new_balances) | |
775 | - | let finals = $t01758117663._1 | |
776 | - | let no_fees = $t01758117663._2 | |
777 | - | let actions = $t01758117663._3 | |
778 | - | let fee_sum = $t01758117663._4 | |
779 | - | $Tuple3(finals, get_D(big_list(no_fees), amp), (actions ++ log_data(D0, fraction(fee_sum, FEE_DENOMINATOR, fee)))) | |
780 | - | } | |
781 | - | else $Tuple3(new_balances, D1, nil) | |
782 | - | let final_balances = $t01600918010._1 | |
783 | - | let D2 = $t01600918010._2 | |
784 | - | let fees_actions = $t01600918010._3 | |
785 | - | let mint_amount = if ((token_supply == 0)) | |
786 | - | then D1 | |
787 | - | else fraction(token_supply, (D2 - D0), D0) | |
788 | - | if (assert((mint_amount >= min_mint_amount))) | |
789 | - | then throw("slippage screwed you") | |
790 | - | else ([StringEntry("balances", makeString(list_itos(final_balances), ",")), Reissue(token, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, token)] ++ fees_actions) | |
791 | - | } | |
789 | + | let $t01813218218 = _calc_token_amount(new_balances) | |
790 | + | let final_balances = $t01813218218._1 | |
791 | + | let mint_amount = $t01813218218._2 | |
792 | + | let fees_actions = $t01813218218._3 | |
793 | + | if (assert((mint_amount >= min_mint_amount))) | |
794 | + | then throw("slippage screwed you") | |
795 | + | else ([StringEntry("balances", makeString(list_itos(final_balances), ",")), Reissue(token, mint_amount, true), ScriptTransfer(msg.caller, mint_amount, token)] ++ fees_actions) | |
792 | 796 | } | |
793 | 797 | } | |
794 | 798 | ||
795 | 799 | ||
796 | 800 | ||
797 | 801 | @Callable(msg) | |
798 | 802 | func get_dy (i,j,dx) = { | |
799 | 803 | let xp_i = balances[i] | |
800 | 804 | let xp_j = balances[j] | |
801 | 805 | let x = (xp_i + dx) | |
802 | - | let $ | |
803 | - | let y = $ | |
804 | - | let D = $ | |
806 | + | let $t01867818731 = get_y(i, j, x, big_list(balances)) | |
807 | + | let y = $t01867818731._1 | |
808 | + | let D = $t01867818731._2 | |
805 | 809 | let _dy = ((xp_j - y) - 1) | |
806 | 810 | let dy_fee = fraction(_dy, fee, FEE_DENOMINATOR) | |
807 | 811 | let dy = (_dy - dy_fee) | |
808 | 812 | $Tuple2(nil, dy) | |
809 | 813 | } | |
810 | 814 | ||
811 | 815 | ||
812 | 816 | ||
813 | 817 | @Callable(msg) | |
814 | 818 | func exchange (j,min_dy) = if (assert(!(is_killed))) | |
815 | 819 | then throw("is killed") | |
816 | 820 | else if ((size(msg.payments) != 1)) | |
817 | 821 | then throw("size( payments ) != 1") | |
818 | 822 | else { | |
819 | 823 | let payment = msg.payments[0] | |
820 | 824 | let dx = payment.amount | |
821 | 825 | let i = coin_index(payment) | |
822 | 826 | let xp_i = balances[i] | |
823 | 827 | let xp_j = balances[j] | |
824 | 828 | let x = (xp_i + dx) | |
825 | - | let $ | |
826 | - | let y = $ | |
827 | - | let D = $ | |
829 | + | let $t01923719290 = get_y(i, j, x, big_list(balances)) | |
830 | + | let y = $t01923719290._1 | |
831 | + | let D = $t01923719290._2 | |
828 | 832 | let _dy = ((xp_j - y) - 1) | |
829 | 833 | let dy_fee = fraction(_dy, fee, FEE_DENOMINATOR) | |
830 | 834 | let dy = (_dy - dy_fee) | |
831 | 835 | if (assert((dy >= min_dy))) | |
832 | 836 | then throw("exchange resulted in fewer coins than expected") | |
833 | 837 | else { | |
834 | 838 | let dy_admin_fee = fraction(dy_fee, admin_fee, FEE_DENOMINATOR) | |
835 | 839 | func fold (acc,index) = (acc :+ (if ((index == i)) | |
836 | 840 | then (balances[index] + dx) | |
837 | 841 | else if ((index == j)) | |
838 | 842 | then ((balances[index] - dy) - dy_admin_fee) | |
839 | 843 | else balances[index])) | |
840 | 844 | ||
841 | 845 | let final_balances = { | |
842 | 846 | let $l = index_N_COINS | |
843 | 847 | let $s = size($l) | |
844 | 848 | let $acc0 = nil | |
845 | 849 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
846 | 850 | then $a | |
847 | 851 | else fold($a, $l[$i]) | |
848 | 852 | ||
849 | 853 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
850 | 854 | then $a | |
851 | 855 | else throw("List size exceeds 10") | |
852 | 856 | ||
853 | 857 | $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) | |
854 | 858 | } | |
855 | 859 | let tokenOut = fromBase58String(coins[j]) | |
856 | 860 | $Tuple2((([StringEntry("balances", makeString(list_itos(final_balances), ",")), ScriptTransfer(msg.caller, dy, tokenOut)] ++ (if (if (is_auto_fees) | |
857 | 861 | then (dy_admin_fee > 0) | |
858 | 862 | else false) | |
859 | 863 | then [ScriptTransfer(owner, dy_admin_fee, tokenOut)] | |
860 | 864 | else nil)) ++ log_data(D, fraction(dx, TOKEN_RATE, rates[i]))), dy) | |
861 | 865 | } | |
862 | 866 | } | |
863 | 867 | ||
864 | 868 | ||
865 | 869 | ||
866 | 870 | @Callable(msg) | |
867 | 871 | func remove_liquidity (_min_amounts) = if ((size(msg.payments) != 1)) | |
868 | 872 | then throw("size( payments ) != 1") | |
869 | 873 | else { | |
870 | 874 | let payment = msg.payments[0] | |
871 | 875 | if ((payment.assetId != token)) | |
872 | 876 | then throw("unknown token") | |
873 | 877 | else { | |
874 | 878 | let min_amounts = if ((_min_amounts == "0")) | |
875 | 879 | then nil | |
876 | 880 | else list_stoi(split(_min_amounts, ",")) | |
877 | 881 | if (if ((_min_amounts != "0")) | |
878 | 882 | then (size(min_amounts) != N_COINS) | |
879 | 883 | else false) | |
880 | 884 | then throw("min_amounts.size() != N_COINS") | |
881 | 885 | else { | |
882 | 886 | let amount = payment.amount | |
883 | 887 | let caller = msg.caller | |
884 | 888 | func fold (acc,index) = { | |
885 | 889 | let balance = balances[index] | |
886 | 890 | let amount_out = fraction(balance, amount, token_quantity) | |
887 | 891 | if (if ((_min_amounts != "0")) | |
888 | 892 | then (min_amounts[index] > amount_out) | |
889 | 893 | else false) | |
890 | 894 | then throw("withdrawal resulted in fewer coins than expected") | |
891 | 895 | else $Tuple2((acc._1 :+ ScriptTransfer(caller, amount_out, fromBase58String(coins[index]))), (acc._2 :+ (balance - amount_out))) | |
892 | 896 | } | |
893 | 897 | ||
894 | - | let $ | |
898 | + | let $t02140621485 = { | |
895 | 899 | let $l = index_N_COINS | |
896 | 900 | let $s = size($l) | |
897 | 901 | let $acc0 = $Tuple2(nil, nil) | |
898 | 902 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
899 | 903 | then $a | |
900 | 904 | else fold($a, $l[$i]) | |
901 | 905 | ||
902 | 906 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
903 | 907 | then $a | |
904 | 908 | else throw("List size exceeds 10") | |
905 | 909 | ||
906 | 910 | $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) | |
907 | 911 | } | |
908 | - | let transfers = $ | |
909 | - | let final_balances = $ | |
912 | + | let transfers = $t02140621485._1 | |
913 | + | let final_balances = $t02140621485._2 | |
910 | 914 | (transfers ++ [StringEntry("balances", makeString(list_itos(final_balances), ",")), Burn(token, amount)]) | |
911 | 915 | } | |
912 | 916 | } | |
913 | 917 | } | |
914 | 918 | ||
915 | 919 | ||
916 | 920 | ||
917 | 921 | @Callable(msg) | |
918 | 922 | func calc_withdraw_one_coin (_token_amount,i) = $Tuple2(nil, _calc_withdraw_one_coin(_token_amount, i)._1) | |
919 | 923 | ||
920 | 924 | ||
921 | 925 | ||
922 | 926 | @Callable(msg) | |
923 | 927 | func remove_liquidity_one_coin (i,min_amount) = if (assert(!(is_killed))) | |
924 | 928 | then throw("is killed") | |
925 | 929 | else if ((size(msg.payments) != 1)) | |
926 | 930 | then throw("size( payments ) != 1") | |
927 | 931 | else { | |
928 | 932 | let payment = msg.payments[0] | |
929 | 933 | if ((payment.assetId != token)) | |
930 | 934 | then throw("unknown token") | |
931 | 935 | else { | |
932 | 936 | let _token_amount = payment.amount | |
933 | - | let $ | |
934 | - | let dy = $ | |
935 | - | let dy_fee = $ | |
936 | - | let D = $ | |
937 | + | let $t02214622213 = _calc_withdraw_one_coin(_token_amount, i) | |
938 | + | let dy = $t02214622213._1 | |
939 | + | let dy_fee = $t02214622213._2 | |
940 | + | let D = $t02214622213._3 | |
937 | 941 | if (assert((dy >= min_amount))) | |
938 | 942 | then throw("not enough coins removed") | |
939 | 943 | else { | |
940 | 944 | let dy_admin_fee = fraction(dy_fee, admin_fee, FEE_DENOMINATOR) | |
941 | 945 | let dy_and_fee = (dy + dy_admin_fee) | |
942 | 946 | func fold (acc,index) = (acc :+ (balances[index] - (if ((index == i)) | |
943 | 947 | then dy_and_fee | |
944 | 948 | else 0))) | |
945 | 949 | ||
946 | 950 | let final_balances = { | |
947 | 951 | let $l = index_N_COINS | |
948 | 952 | let $s = size($l) | |
949 | 953 | let $acc0 = nil | |
950 | 954 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
951 | 955 | then $a | |
952 | 956 | else fold($a, $l[$i]) | |
953 | 957 | ||
954 | 958 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
955 | 959 | then $a | |
956 | 960 | else throw("List size exceeds 10") | |
957 | 961 | ||
958 | 962 | $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) | |
959 | 963 | } | |
960 | 964 | let tokenOut = fromBase58String(coins[i]) | |
961 | 965 | $Tuple2((([StringEntry("balances", makeString(list_itos(final_balances), ",")), ScriptTransfer(msg.caller, dy, tokenOut), Burn(token, _token_amount)] ++ (if (if (is_auto_fees) | |
962 | 966 | then (dy_admin_fee > 0) | |
963 | 967 | else false) | |
964 | 968 | then [ScriptTransfer(owner, dy_admin_fee, tokenOut)] | |
965 | 969 | else nil)) ++ log_data(D, fraction(fraction(dy_fee, TOKEN_RATE, rates[i]), FEE_DENOMINATOR, fee))), dy) | |
966 | 970 | } | |
967 | 971 | } | |
968 | 972 | } | |
969 | 973 | ||
970 | 974 | ||
971 | 975 | ||
972 | 976 | @Callable(msg) | |
973 | - | func A () = $Tuple2(nil, | |
977 | + | func A () = $Tuple2(nil, amp) | |
974 | 978 | ||
975 | 979 | ||
976 | 980 | ||
977 | 981 | @Callable(msg) | |
978 | 982 | func get_virtual_price () = { | |
979 | - | let D = get_D(big_list(balances), | |
983 | + | let D = get_D(big_list(balances), amp) | |
980 | 984 | $Tuple2(nil, virtual_price(D)) | |
981 | 985 | } | |
982 | 986 | ||
983 | 987 | ||
984 | 988 | ||
985 | 989 | @Callable(msg) | |
986 | - | func calc_token_amount (_amounts | |
990 | + | func calc_token_amount (_amounts) = { | |
987 | 991 | let amounts = list_stoi(split(_amounts, ",")) | |
988 | 992 | if ((size(amounts) != N_COINS)) | |
989 | 993 | then throw("not enought amounts") | |
990 | 994 | else { | |
991 | - | let amp = _A() | |
992 | - | let D0 = get_D(big_list(amounts), amp) | |
993 | - | func fold (acc,index) = (acc :+ (balances[index] + (if (deposit) | |
994 | - | then amounts[index] | |
995 | - | else -(amounts[index])))) | |
995 | + | func fold (acc,index) = (acc :+ (balances[index] + amounts[index])) | |
996 | 996 | ||
997 | 997 | let new_balances = { | |
998 | 998 | let $l = index_N_COINS | |
999 | 999 | let $s = size($l) | |
1000 | 1000 | let $acc0 = nil | |
1001 | 1001 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1002 | 1002 | then $a | |
1003 | 1003 | else fold($a, $l[$i]) | |
1004 | 1004 | ||
1005 | 1005 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1006 | 1006 | then $a | |
1007 | 1007 | else throw("List size exceeds 10") | |
1008 | 1008 | ||
1009 | 1009 | $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) | |
1010 | 1010 | } | |
1011 | - | let D1 = get_D(big_list(new_balances), amp) | |
1012 | - | let token_amount = token_quantity | |
1013 | - | let diff = if (deposit) | |
1014 | - | then (D1 - D0) | |
1015 | - | else (D0 - D1) | |
1016 | - | $Tuple2(nil, fraction(diff, token_amount, D0)) | |
1011 | + | let $t02366023746 = _calc_token_amount(new_balances) | |
1012 | + | let final_balances = $t02366023746._1 | |
1013 | + | let mint_amount = $t02366023746._2 | |
1014 | + | let fees_actions = $t02366023746._3 | |
1015 | + | $Tuple2(nil, mint_amount) | |
1017 | 1016 | } | |
1018 | 1017 | } | |
1019 | 1018 | ||
1020 | 1019 | ||
1021 | 1020 | ||
1022 | 1021 | @Callable(msg) | |
1023 | 1022 | func ramp_A (_future_A,_future_time) = if (assert((msg.caller == owner))) | |
1024 | 1023 | then throw("only owner") | |
1025 | 1024 | else if (assert((block_timestamp >= (initial_A_time + MIN_RAMP_TIME)))) | |
1026 | 1025 | then throw("too often") | |
1027 | 1026 | else if (assert((_future_time >= (block_timestamp + MIN_RAMP_TIME)))) | |
1028 | 1027 | then throw("insufficient time") | |
1029 | 1028 | else { | |
1030 | - | let _initial_A = | |
1029 | + | let _initial_A = amp | |
1031 | 1030 | if (assert(if ((_future_A > 0)) | |
1032 | 1031 | then (MAX_A > _future_A) | |
1033 | 1032 | else false)) | |
1034 | 1033 | then throw("out of base range") | |
1035 | 1034 | else if (assert(if (if ((_future_A >= _initial_A)) | |
1036 | 1035 | then ((_initial_A * MAX_A_CHANGE) >= _future_A) | |
1037 | 1036 | else false) | |
1038 | 1037 | then true | |
1039 | 1038 | else if ((_initial_A > _future_A)) | |
1040 | 1039 | then ((_future_A * MAX_A_CHANGE) >= _initial_A) | |
1041 | 1040 | else false)) | |
1042 | 1041 | then throw("out of range") | |
1043 | 1042 | else [IntegerEntry("initial_A", _initial_A), IntegerEntry("future_A", _future_A), IntegerEntry("initial_A_time", block_timestamp), IntegerEntry("future_A_time", _future_time)] | |
1044 | 1043 | } | |
1045 | 1044 | ||
1046 | 1045 | ||
1047 | 1046 | ||
1048 | 1047 | @Callable(msg) | |
1049 | 1048 | func stop_ramp_A () = if (assert((msg.caller == owner))) | |
1050 | 1049 | then throw("only owner") | |
1051 | 1050 | else { | |
1052 | - | let current_A = | |
1051 | + | let current_A = amp | |
1053 | 1052 | [IntegerEntry("initial_A", current_A), IntegerEntry("future_A", current_A), IntegerEntry("initial_A_time", block_timestamp), IntegerEntry("future_A_time", block_timestamp)] | |
1054 | 1053 | } | |
1055 | 1054 | ||
1056 | 1055 | ||
1057 | 1056 | ||
1058 | 1057 | @Callable(msg) | |
1059 | 1058 | func commit_new_fee (new_fee,new_admin_fee) = if (assert((msg.caller == owner))) | |
1060 | 1059 | then throw("only owner") | |
1061 | 1060 | else if (assert((admin_actions_deadline == 0))) | |
1062 | 1061 | then throw("active action") | |
1063 | 1062 | else if (assert((MAX_FEE >= new_fee))) | |
1064 | 1063 | then throw("fee exceeds maximum") | |
1065 | 1064 | else if (assert((MAX_ADMIN_FEE >= new_admin_fee))) | |
1066 | 1065 | then throw("admin fee exceeds maximum") | |
1067 | 1066 | else { | |
1068 | 1067 | let _deadline = (block_timestamp + ADMIN_ACTIONS_DELAY) | |
1069 | 1068 | [IntegerEntry("admin_actions_deadline", _deadline), IntegerEntry("future_fee", new_fee), IntegerEntry("future_admin_fee", new_admin_fee)] | |
1070 | 1069 | } | |
1071 | 1070 | ||
1072 | 1071 | ||
1073 | 1072 | ||
1074 | 1073 | @Callable(msg) | |
1075 | 1074 | func apply_new_fee () = if (assert((msg.caller == owner))) | |
1076 | 1075 | then throw("only owner") | |
1077 | 1076 | else if (assert((block_timestamp >= admin_actions_deadline))) | |
1078 | 1077 | then throw("insufficient time") | |
1079 | 1078 | else if (assert((admin_actions_deadline != 0))) | |
1080 | 1079 | then throw("no active action") | |
1081 | 1080 | else [IntegerEntry("admin_actions_deadline", 0), IntegerEntry("fee", future_fee), IntegerEntry("admin_fee", future_admin_fee)] | |
1082 | 1081 | ||
1083 | 1082 | ||
1084 | 1083 | ||
1085 | 1084 | @Callable(msg) | |
1086 | 1085 | func revert_new_parameters () = if (assert((msg.caller == owner))) | |
1087 | 1086 | then throw("only owner") | |
1088 | 1087 | else [IntegerEntry("admin_actions_deadline", 0)] | |
1089 | 1088 | ||
1090 | 1089 | ||
1091 | 1090 | ||
1092 | 1091 | @Callable(msg) | |
1093 | 1092 | func commit_transfer_ownership (_owner) = if (assert((msg.caller == owner))) | |
1094 | 1093 | then throw("only owner") | |
1095 | 1094 | else if (assert((transfer_ownership_deadline == 0))) | |
1096 | 1095 | then throw("active transfer") | |
1097 | 1096 | else { | |
1098 | 1097 | let _deadline = (block_timestamp + ADMIN_ACTIONS_DELAY) | |
1099 | 1098 | [IntegerEntry("transfer_ownership_deadline", _deadline), StringEntry("future_owner", checkAddress(_owner))] | |
1100 | 1099 | } | |
1101 | 1100 | ||
1102 | 1101 | ||
1103 | 1102 | ||
1104 | 1103 | @Callable(msg) | |
1105 | 1104 | func apply_transfer_ownership () = if (assert((msg.caller == owner))) | |
1106 | 1105 | then throw("only owner") | |
1107 | 1106 | else if (assert((block_timestamp >= transfer_ownership_deadline))) | |
1108 | 1107 | then throw("insufficient time") | |
1109 | 1108 | else if (assert((transfer_ownership_deadline != 0))) | |
1110 | 1109 | then throw("no active transfer") | |
1111 | 1110 | else [IntegerEntry("transfer_ownership_deadline", 0), StringEntry("owner", future_owner)] | |
1112 | 1111 | ||
1113 | 1112 | ||
1114 | 1113 | ||
1115 | 1114 | @Callable(msg) | |
1116 | 1115 | func revert_transfer_ownership () = if (assert((msg.caller == owner))) | |
1117 | 1116 | then throw("only owner") | |
1118 | 1117 | else [IntegerEntry("transfer_ownership_deadline", 0)] | |
1119 | 1118 | ||
1120 | 1119 | ||
1121 | 1120 | ||
1122 | 1121 | @Callable(msg) | |
1123 | 1122 | func admin_balances (i) = $Tuple2(nil, admin_balance(i)) | |
1124 | 1123 | ||
1125 | 1124 | ||
1126 | 1125 | ||
1127 | 1126 | @Callable(msg) | |
1128 | 1127 | func withdraw_admin_fees () = if (assert((msg.caller == owner))) | |
1129 | 1128 | then throw("only owner") | |
1130 | 1129 | else { | |
1131 | 1130 | func fold (acc,index) = (acc :+ ScriptTransfer(owner, admin_balance(index), fromBase58String(coins[index]))) | |
1132 | 1131 | ||
1133 | 1132 | let $l = index_N_COINS | |
1134 | 1133 | let $s = size($l) | |
1135 | 1134 | let $acc0 = nil | |
1136 | 1135 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1137 | 1136 | then $a | |
1138 | 1137 | else fold($a, $l[$i]) | |
1139 | 1138 | ||
1140 | 1139 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1141 | 1140 | then $a | |
1142 | 1141 | else throw("List size exceeds 10") | |
1143 | 1142 | ||
1144 | 1143 | $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) | |
1145 | 1144 | } | |
1146 | 1145 | ||
1147 | 1146 | ||
1148 | 1147 | ||
1149 | 1148 | @Callable(msg) | |
1150 | 1149 | func donate_admin_fees () = if (assert((msg.caller == owner))) | |
1151 | 1150 | then throw("only owner") | |
1152 | 1151 | else { | |
1153 | 1152 | func fold (acc,index) = (acc :+ (balances[index] + admin_balance(index))) | |
1154 | 1153 | ||
1155 | 1154 | let new_balances = { | |
1156 | 1155 | let $l = index_N_COINS | |
1157 | 1156 | let $s = size($l) | |
1158 | 1157 | let $acc0 = nil | |
1159 | 1158 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
1160 | 1159 | then $a | |
1161 | 1160 | else fold($a, $l[$i]) | |
1162 | 1161 | ||
1163 | 1162 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
1164 | 1163 | then $a | |
1165 | 1164 | else throw("List size exceeds 10") | |
1166 | 1165 | ||
1167 | 1166 | $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) | |
1168 | 1167 | } | |
1169 | 1168 | [StringEntry("balances", makeString(list_itos(new_balances), ","))] | |
1170 | 1169 | } | |
1171 | 1170 | ||
1172 | 1171 | ||
1173 | 1172 | ||
1174 | 1173 | @Callable(msg) | |
1175 | 1174 | func set_auto_fees (_is_auto_fees) = if (assert((msg.caller == owner))) | |
1176 | 1175 | then throw("only owner") | |
1177 | 1176 | else [BooleanEntry("is_auto_fees", _is_auto_fees)] | |
1178 | 1177 | ||
1179 | 1178 | ||
1180 | 1179 | ||
1181 | 1180 | @Callable(msg) | |
1182 | 1181 | func kill_me () = if (assert((msg.caller == owner))) | |
1183 | 1182 | then throw("only owner") | |
1184 | 1183 | else if (assert((kill_deadline > block_timestamp))) | |
1185 | 1184 | then throw("deadline has passed") | |
1186 | 1185 | else [BooleanEntry("is_killed", true)] | |
1187 | 1186 | ||
1188 | 1187 | ||
1189 | 1188 | ||
1190 | 1189 | @Callable(msg) | |
1191 | 1190 | func unkill_me () = if (assert((msg.caller == owner))) | |
1192 | 1191 | then throw("only owner") | |
1193 | 1192 | else [BooleanEntry("is_killed", false)] | |
1194 | 1193 | ||
1195 | 1194 | ||
1196 | 1195 | ||
1197 | 1196 | @Callable(msg) | |
1198 | 1197 | func set_height_address (_heightAddress) = if ((msg.caller != owner)) | |
1199 | 1198 | then throw("only owner") | |
1200 | 1199 | else [StringEntry("heightAddress", checkAddress(_heightAddress))] | |
1201 | 1200 | ||
1202 | 1201 | ||
1203 | 1202 | ||
1204 | 1203 | @Callable(i) | |
1205 | 1204 | func set_verifier (verifier) = if ((i.caller != this)) | |
1206 | 1205 | then throw("self call only") | |
1207 | 1206 | else { | |
1208 | 1207 | let addressOK = match addressFromString(verifier) { | |
1209 | 1208 | case a: Address => | |
1210 | 1209 | true | |
1211 | 1210 | case _ => | |
1212 | 1211 | false | |
1213 | 1212 | } | |
1214 | 1213 | if (!(addressOK)) | |
1215 | 1214 | then throw(("verifier wrong address " + verifier)) | |
1216 | 1215 | else if (isDefined(getString(this, "verifier"))) | |
1217 | 1216 | then throw("verifier already defined") | |
1218 | 1217 | else [StringEntry("verifier", verifier)] | |
1219 | 1218 | } | |
1220 | 1219 | ||
1221 | 1220 | ||
1222 | 1221 | @Verifier(tx) | |
1223 | 1222 | func verify () = match getString(this, "verifier") { | |
1224 | 1223 | case verifier: String => | |
1225 | 1224 | valueOrElse(getBoolean(addressFromStringValue(verifier), ((("status_" + toString(this)) + "_") + toBase58String(tx.id))), false) | |
1226 | 1225 | case _ => | |
1227 | 1226 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
1228 | 1227 | } | |
1229 | 1228 |
github/deemru/w8io/169f3d6 147.89 ms ◑