tx · BNtv4PQa8EXSrzAnfNNzzXJDLDks5AM4xixcmKwHwKwe

3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ:  -0.01400000 Waves

2021.03.07 17:21 [1427382] smart account 3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ > SELF 0.00000000 Waves

{ "type": 13, "id": "BNtv4PQa8EXSrzAnfNNzzXJDLDks5AM4xixcmKwHwKwe", "fee": 1400000, "feeAssetId": null, "timestamp": 1615126915730, "version": 1, "sender": "3N18bq33YEjzWkoTDhZvc7zd7eRAyv6x4aZ", "senderPublicKey": "71DfVUys2KXcuEivd6kRxABvVQKB5k5c48qobMB1DzKN", "proofs": [ "3mVXMbBENoLVivYqa8sBPwy1CpG758211eq3TYABC4ojMJN5NebTGZCLJerykB2o1r6UL9VjugSDHFLCnFsSSSrm" ], "script": "base64:AAIEAAAAAAAAABoIAhIAEgMKAQESBAoCAQESBAoCAQESAwoBAQAAAEoAAAAAB3ZlcnNpb24CAAAABTIuMC4wAAAAAAprZXlWZXJzaW9uAgAAAAd2ZXJzaW9uAAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAALa2V5QXNzZXRJZEECAAAACkFfYXNzZXRfaWQAAAAAC2tleUFzc2V0SWRCAgAAAApCX2Fzc2V0X2lkAAAAAAtrZXlCYWxhbmNlQQIAAAAPQV9hc3NldF9iYWxhbmNlAAAAAAtrZXlCYWxhbmNlQgIAAAAPQl9hc3NldF9iYWxhbmNlAAAAAA9rZXlTaGFyZUFzc2V0SWQCAAAADnNoYXJlX2Fzc2V0X2lkAAAAABNrZXlTaGFyZUFzc2V0U3VwcGx5AgAAABJzaGFyZV9hc3NldF9zdXBwbHkAAAAADWtleUNvbW1pc3Npb24CAAAACmNvbW1pc3Npb24AAAAAG2tleUNvbW1pc3Npb25TY2FsZURlbGltaXRlcgIAAAAaY29tbWlzc2lvbl9zY2FsZV9kZWxpbWl0ZXIAAAAAF2tleUNvbW1pc3Npb25Hb3Zlcm5h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AAABQAAAB11bmNvdW50YWJsZUFtb3VudEVucm9sbEFzc2V0QgkBAAAAB3N1c3BlbmQAAAABAgAAABZFbnJvbGwgYW1vdW50IG5lZ2F0aXZlAwMJAABmAAAAAgAAAAAAAAAAAAUAAAANYW1vdW50RW5yb2xsQQYJAABmAAAAAgAAAAAAAAAAAAUAAAANYW1vdW50RW5yb2xsQgkAAAIAAAABAgAAABVUb28gbGFyZ2UgYW1vdW50TGVhdmUJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIFAAAAC2tleUJhbGFuY2VBCQAAZAAAAAIFAAAACGJhbGFuY2VBBQAAAA1hbW91bnRFbnJvbGxBCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAtrZXlCYWxhbmNlQgkAAGQAAAACBQAAAAhiYWxhbmNlQgUAAAANYW1vdW50RW5yb2xsQgUAAAADbmlsAAAAAAYAAV4=", "chainId": 84, "height": 1427382, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8y9JJ95njDLc2aTHC9yCRvSWVVY6tgM9DsckQxJsp3RB Next: AdtBnkNhURz1y9Pg77ehS6YwMaipYwox23doVrPoX9eR Diff:
OldNewDifferences
357357 let $t04229442369 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
358358 let pmtAmount = $t04229442369._1
359359 let pmtAssetId = $t04229442369._2
360- let pmtMinThreshold = 5000000
361- let thresholdValueForMinTolerance = 50000000
362- let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
363- then 100000
364- else 1
365- let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000))
366- let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000))
367- let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
368- let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000))
369- if (!(isActive))
370- then throwIsInactive()
371- else if ((pmtMinThreshold > pmtAmount))
372- then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
373- else if ((size(i.payments) != 1))
374- then throw("One attached payment expected")
375- else if (!(hasEnoughBalance))
376- then suspendSuspicious()
377- else if ((pmtAssetId == assetIdA))
378- then {
379- let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay)
380- let amountVirtualReplenishTokenB = virtualSwapTokenGet
381- let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay)
382- let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet)
383- let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
384- let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
385- if (if ((invariantEstimatedRatio >= slippageValueMinForSwap))
386- then ((invariantNew - invariant) >= 0)
387- else false)
360+ if (true)
361+ then throw(toString(value(value(assetInfo(USDN)).minSponsoredFee)))
362+ else {
363+ let pmtMinThreshold = 5000000
364+ let thresholdValueForMinTolerance = 50000000
365+ let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
366+ then 100000
367+ else 1
368+ let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000))
369+ let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000))
370+ let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
371+ let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000))
372+ if (!(isActive))
373+ then throwIsInactive()
374+ else if ((pmtMinThreshold > pmtAmount))
375+ then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
376+ else if ((size(i.payments) != 1))
377+ then throw("One attached payment expected")
378+ else if (!(hasEnoughBalance))
379+ then suspendSuspicious()
380+ else if ((pmtAssetId == assetIdA))
388381 then {
389- let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
390- if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
391- then true
392- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
393- then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
394- else {
395- let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000))
396- let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA)
397- let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
398- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
399- let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
400- let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB)
401- let newAmountTokenA = (balanceA + pmtAmount)
402- let newAmountTokenB = balanceB
403- let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount))
404- let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount))
405- let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
406- if (if ((dAppThresholdAmount > newAmountTokenA))
382+ let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay)
383+ let amountVirtualReplenishTokenB = virtualSwapTokenGet
384+ let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay)
385+ let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet)
386+ let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
387+ let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
388+ if (if ((invariantEstimatedRatio >= slippageValueMinForSwap))
389+ then ((invariantNew - invariant) >= 0)
390+ else false)
391+ then {
392+ let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
393+ if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
407394 then true
408- else (dAppThresholdAmount > newAmountTokenB))
409- then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
410- else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)]
395+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
396+ then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
397+ else {
398+ let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000))
399+ let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA)
400+ let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
401+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
402+ let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
403+ let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB)
404+ let newAmountTokenA = (balanceA + pmtAmount)
405+ let newAmountTokenB = balanceB
406+ let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount))
407+ let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount))
408+ let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
409+ if (if ((dAppThresholdAmount > newAmountTokenA))
410+ then true
411+ else (dAppThresholdAmount > newAmountTokenB))
412+ then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
413+ else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)]
414+ }
411415 }
416+ else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
412417 }
413- else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
414- }
415- else if ((pmtAssetId == assetIdB))
416- then {
417- let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay)
418- let amountVirtualReplenishTokenA = virtualSwapTokenGet
419- let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet)
420- let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay)
421- let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
422- let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
423- if (if ((invariantEstimatedRatio > slippageValueMinForSwap))
424- then ((invariantNew - invariant) >= 0)
425- else false)
418+ else if ((pmtAssetId == assetIdB))
426419 then {
427- let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
428- if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
429- then true
430- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
431- then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
432- else {
433- let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA)
434- let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
435- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
436- let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount))
437- let newAmountTokenA = balanceA
438- let newAmountTokenB = (balanceB + pmtAmount)
439- let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
440- if (if ((dAppThresholdAmount > newAmountTokenA))
420+ let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay)
421+ let amountVirtualReplenishTokenA = virtualSwapTokenGet
422+ let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet)
423+ let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay)
424+ let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
425+ let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
426+ if (if ((invariantEstimatedRatio > slippageValueMinForSwap))
427+ then ((invariantNew - invariant) >= 0)
428+ else false)
429+ then {
430+ let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
431+ if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
441432 then true
442- else (dAppThresholdAmount > newAmountTokenB))
443- then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
444- else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)]
433+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
434+ then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
435+ else {
436+ let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA)
437+ let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
438+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
439+ let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount))
440+ let newAmountTokenA = balanceA
441+ let newAmountTokenB = (balanceB + pmtAmount)
442+ let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
443+ if (if ((dAppThresholdAmount > newAmountTokenA))
444+ then true
445+ else (dAppThresholdAmount > newAmountTokenB))
446+ then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
447+ else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)]
448+ }
445449 }
450+ else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
446451 }
447- else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
448- }
449- else throwAssets()
452+ else throwAssets()
453+ }
450454 }
451455
452456
453457
454458 @Callable(i)
455459 func exchange (estimatedAmountToReceive,minAmountToReceive) = {
456- let $t04992249997 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
457- let pmtAmount = $t04992249997._1
458- let pmtAssetId = $t04992249997._2
460+ let $t05001550090 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
461+ let pmtAmount = $t05001550090._1
462+ let pmtAssetId = $t05001550090._2
459463 if (!(isActive))
460464 then throwIsInactive()
461465 else if ((0 >= estimatedAmountToReceive))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let version = "2.0.0"
55
66 let keyVersion = "version"
77
88 let keyActive = "active"
99
1010 let keyAssetIdA = "A_asset_id"
1111
1212 let keyAssetIdB = "B_asset_id"
1313
1414 let keyBalanceA = "A_asset_balance"
1515
1616 let keyBalanceB = "B_asset_balance"
1717
1818 let keyShareAssetId = "share_asset_id"
1919
2020 let keyShareAssetSupply = "share_asset_supply"
2121
2222 let keyCommission = "commission"
2323
2424 let keyCommissionScaleDelimiter = "commission_scale_delimiter"
2525
2626 let keyCommissionGovernance = "commission_governance"
2727
2828 let keyInvariant = "invariant"
2929
3030 let keyCause = "shutdown_cause"
3131
3232 let adminPubKey1 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4'
3333
3434 let adminPubKey2 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4'
3535
3636 let adminPubKey3 = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4'
3737
3838 let adminPubKeyStartStop = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4'
3939
4040 let adminPubKeyStaking = base58'7FhFLst7Htn4uYxGH7xYMTAmbydLVoiZef3eFghi7CG4'
4141
4242 let governanceAddress = Address(base58'3MqhxbxHEMtp2Rwy1gUb6cPSJHQepdap1Yp')
4343
4444 let stakingAddress = Address(base58'3MqhxbxHEMtp2Rwy1gUb6cPSJHQepdap1Yp')
4545
4646 let USDN = base58'3FUNGbzfNsQ1AZfvumCUqARXvpjjLQrvCzorYuDryQAq'
4747
4848 let stakingFeeInUSDN = (9 * value(value(assetInfo(USDN)).minSponsoredFee))
4949
5050 let isActive = getBooleanValue(this, keyActive)
5151
5252 let strAssetIdA = getStringValue(this, keyAssetIdA)
5353
5454 let strAssetIdB = getStringValue(this, keyAssetIdB)
5555
5656 let assetIdA = if ((strAssetIdA == "WAVES"))
5757 then unit
5858 else fromBase58String(strAssetIdA)
5959
6060 let assetIdB = if ((strAssetIdB == "WAVES"))
6161 then unit
6262 else fromBase58String(strAssetIdB)
6363
6464 let assetNameA = match assetIdA {
6565 case id: ByteVector =>
6666 value(assetInfo(id)).name
6767 case waves: Unit =>
6868 "WAVES"
6969 case _ =>
7070 throw("Match error")
7171 }
7272
7373 let assetNameB = match assetIdB {
7474 case id: ByteVector =>
7575 value(assetInfo(id)).name
7676 case waves: Unit =>
7777 "WAVES"
7878 case _ =>
7979 throw("Match error")
8080 }
8181
8282 let balanceA = getIntegerValue(this, keyBalanceA)
8383
8484 let balanceB = getIntegerValue(this, keyBalanceB)
8585
8686 let shareAssetId = fromBase58String(getStringValue(this, keyShareAssetId))
8787
8888 let shareAssetSupply = getIntegerValue(this, keyShareAssetSupply)
8989
9090 let invariant = getIntegerValue(this, keyInvariant)
9191
9292 let commission = 500
9393
9494 let commissionGovernance = 200
9595
9696 let commissionScaleDelimiter = 1000000
9797
9898 let scaleValue3 = 1000
9999
100100 let scaleValue8 = 100000000
101101
102102 let scaleValue12 = 1000000000000
103103
104104 let slippageToleranceDelimiter = 1000
105105
106106 let scaleValue8Digits = 8
107107
108108 let scaleValue12Digits = 12
109109
110110 let dAppThreshold = 50
111111
112112 let dAppThresholdDelimiter = 100
113113
114114 let ratioThresholdMax = 100000000
115115
116116 let ratioThresholdMin = 99999000
117117
118118 let alpha = 50
119119
120120 let alphaDigits = 2
121121
122122 let beta = 46000000
123123
124124 let betaDigits = 8
125125
126126 func accountBalance (assetId) = match assetId {
127127 case id: ByteVector =>
128128 assetBalance(this, id)
129129 case waves: Unit =>
130130 wavesBalance(this).available
131131 case _ =>
132132 throw("Match error")
133133 }
134134
135135
136136 let stakedAmountUSDN = match getInteger(stakingAddress, ((("rpd_balance_" + toBase58String(USDN)) + "_") + toString(this))) {
137137 case staked: Int =>
138138 staked
139139 case nothing: Unit =>
140140 0
141141 case _ =>
142142 throw("Match error")
143143 }
144144
145145 let availableBalanceA = (balanceA - (if ((assetIdA == USDN))
146146 then stakedAmountUSDN
147147 else 0))
148148
149149 let availableBalanceB = (balanceB - (if ((assetIdB == USDN))
150150 then stakedAmountUSDN
151151 else 0))
152152
153153 let accountBalanceWithStakedA = (accountBalance(assetIdA) + (if ((assetIdA == USDN))
154154 then stakedAmountUSDN
155155 else 0))
156156
157157 let accountBalanceWithStakedB = (accountBalance(assetIdB) + (if ((assetIdB == USDN))
158158 then stakedAmountUSDN
159159 else 0))
160160
161161 let hasEnoughBalance = if ((accountBalanceWithStakedA >= balanceA))
162162 then (accountBalanceWithStakedB >= balanceB)
163163 else false
164164
165165 func skewness (x,y) = (((fraction(scaleValue12, x, y) + fraction(scaleValue12, y, x)) / 2) / 10000)
166166
167167
168168 func invariantCalc (x,y) = {
169169 let sk = skewness(x, y)
170170 (fraction((x + y), scaleValue8, pow(sk, scaleValue8Digits, alpha, alphaDigits, scaleValue8Digits, UP)) + (2 * fraction(pow(fraction(x, y, scaleValue8), 0, 5, 1, (scaleValue8Digits / 2), DOWN), pow((sk - beta), scaleValue8Digits, alpha, alphaDigits, scaleValue8Digits, DOWN), scaleValue8)))
171171 }
172172
173173
174174 func calculateHowManySendTokenA (amountToSendEstimated,minTokenReceiveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = {
175175 let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
176176 let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount)
177177 let amountToSendStep1 = (amountToSendEstimated - ((1 * deltaBetweenMaxAndMinSendValue) / 5))
178178 let amountToSendStep2 = (amountToSendEstimated - ((2 * deltaBetweenMaxAndMinSendValue) / 5))
179179 let amountToSendStep3 = (amountToSendEstimated - ((3 * deltaBetweenMaxAndMinSendValue) / 5))
180180 let amountToSendStep4 = (amountToSendEstimated - ((4 * deltaBetweenMaxAndMinSendValue) / 5))
181181 let amountToSendStep5 = (amountToSendEstimated - ((5 * deltaBetweenMaxAndMinSendValue) / 5))
182182 let y = (amountTokenB + tokenReceiveAmount)
183183 let invariantNew = invariantCalc((amountTokenA - amountToSendEstimated), y)
184184 let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
185185 if ((0 >= (invariantCalc((amountTokenA - amountToSendStep5), y) - invariant)))
186186 then throw("minTokenReceiveAmount too large.err1")
187187 else if (if ((invariantEstimatedRatio > slippageValue))
188188 then ((invariantNew - invariant) > 0)
189189 else false)
190190 then amountToSendEstimated
191191 else if (((invariantCalc((amountTokenA - amountToSendStep1), y) - invariant) > 0))
192192 then ((amountToSendStep1 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
193193 else if (((invariantCalc((amountTokenA - amountToSendStep2), y) - invariant) > 0))
194194 then ((amountToSendStep2 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
195195 else if (((invariantCalc((amountTokenA - amountToSendStep3), y) - invariant) > 0))
196196 then ((amountToSendStep3 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
197197 else if (((invariantCalc((amountTokenA - amountToSendStep4), y) - invariant) > 0))
198198 then ((amountToSendStep4 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
199199 else if (((invariantCalc((amountTokenA - amountToSendStep5), y) - invariant) > 0))
200200 then ((amountToSendStep5 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
201201 else throw("something went wrong while working with amountToSendStep. err2")
202202 }
203203
204204
205205 func calculateHowManySendTokenB (amountToSendEstimated,minTokenReceiveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = {
206206 let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
207207 let deltaBetweenMaxAndMinSendValue = (amountToSendEstimated - minTokenReceiveAmount)
208208 let amountToSendStep1 = (amountToSendEstimated - ((1 * deltaBetweenMaxAndMinSendValue) / 5))
209209 let amountToSendStep2 = (amountToSendEstimated - ((2 * deltaBetweenMaxAndMinSendValue) / 5))
210210 let amountToSendStep3 = (amountToSendEstimated - ((3 * deltaBetweenMaxAndMinSendValue) / 5))
211211 let amountToSendStep4 = (amountToSendEstimated - ((4 * deltaBetweenMaxAndMinSendValue) / 5))
212212 let amountToSendStep5 = (amountToSendEstimated - ((5 * deltaBetweenMaxAndMinSendValue) / 5))
213213 let x = (amountTokenA + tokenReceiveAmount)
214214 let invariantNew = invariantCalc(x, (amountTokenB - amountToSendEstimated))
215215 let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
216216 if ((0 >= (invariantCalc(x, (amountTokenB - amountToSendStep5)) - invariant)))
217217 then throw("minTokenReceiveAmount too large.err1")
218218 else if (if ((invariantEstimatedRatio > slippageValue))
219219 then ((invariantNew - invariant) > 0)
220220 else false)
221221 then amountToSendEstimated
222222 else if (((invariantCalc(x, (amountTokenB - amountToSendStep1)) - invariant) > 0))
223223 then ((amountToSendStep1 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
224224 else if (((invariantCalc(x, (amountTokenB - amountToSendStep2)) - invariant) > 0))
225225 then ((amountToSendStep2 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
226226 else if (((invariantCalc(x, (amountTokenB - amountToSendStep3)) - invariant) > 0))
227227 then ((amountToSendStep3 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
228228 else if (((invariantCalc(x, (amountTokenB - amountToSendStep4)) - invariant) > 0))
229229 then ((amountToSendStep4 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
230230 else if (((invariantCalc(x, (amountTokenB - amountToSendStep5)) - invariant) > 0))
231231 then ((amountToSendStep5 * (commissionScaleDelimiter - commission)) / commissionScaleDelimiter)
232232 else throw("something went wrong while working with amountToSendStep. err2")
233233 }
234234
235235
236236 func getAssetInfo (assetId) = match assetId {
237237 case id: ByteVector =>
238238 let stringId = toBase58String(id)
239239 let info = valueOrErrorMessage(assetInfo(id), (("Asset " + stringId) + " doesn't exist"))
240240 $Tuple3(stringId, info.name, info.decimals)
241241 case waves: Unit =>
242242 $Tuple3("WAVES", "WAVES", 8)
243243 case _ =>
244244 throw("Match error")
245245 }
246246
247247
248248 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
249249
250250
251251 func deductStakingFee (amount,assetId) = if ((assetId == USDN))
252252 then {
253253 let result = (amount - stakingFeeInUSDN)
254254 if ((0 >= result))
255255 then throw((((("Insufficient amount " + toString(amount)) + " to deduct staking fee ") + toString(stakingFeeInUSDN)) + " USD-N"))
256256 else result
257257 }
258258 else amount
259259
260260
261261 func throwIsActive () = throw("DApp is already active")
262262
263263
264264 func throwIsInactive () = throw("DApp is inactive at this moment")
265265
266266
267267 func throwOnlyAdmin () = throw("Only admin can call this function")
268268
269269
270270 func throwAssets () = throw(((("Incorrect assets attached. Expected: " + strAssetIdA) + " and ") + strAssetIdB))
271271
272272
273273 func throwThreshold (threshold,amountA,amountB) = throw(((((((((("New balance in assets of the DApp is less than threshold " + toString(threshold)) + ": ") + toString(amountA)) + " ") + assetNameA) + ", ") + toString(amountB)) + " ") + assetNameB))
274274
275275
276276 func throwInsufficientAvailableBalance (amount,available,assetName) = throw((((((((("Insufficient DApp balance to pay " + toString(amount)) + " ") + assetName) + " due to staking. Available: ") + toString(available)) + " ") + assetName) + ". Please contact support in Telegram: https://t.me/swopfisupport"))
277277
278278
279279 func throwInsufficientAvailableBalances (amountA,amountB) = throw((((((((((((((((("Insufficient DApp balance to pay " + toString(amountA)) + " ") + assetNameA) + " and ") + toString(amountB)) + " ") + assetNameB) + " due to staking. Available: ") + toString(availableBalanceA)) + " ") + assetNameA) + " and ") + toString(availableBalanceB)) + " ") + assetNameB) + ". Please contact support in Telegram: https://t.me/swopfisupport"))
280280
281281
282282 func suspendSuspicious () = suspend(((((((((((((((("Suspicious state. Actual balances: " + toString(balanceA)) + " ") + assetNameA) + ", ") + toString(balanceB)) + " ") + assetNameB) + ". State: ") + toString(accountBalance(assetIdA))) + " ") + assetNameA) + ", ") + toString(accountBalance(assetIdB))) + " ") + assetNameB))
283283
284284
285285 @Callable(i)
286286 func init () = {
287287 let $t03744437521 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
288288 let pmtAmountA = $t03744437521._1
289289 let pmtAssetIdA = $t03744437521._2
290290 let $t03752637603 = $Tuple2(i.payments[1].amount, i.payments[1].assetId)
291291 let pmtAmountB = $t03752637603._1
292292 let pmtAssetIdB = $t03752637603._2
293293 let $t03760837685 = getAssetInfo(pmtAssetIdA)
294294 let pmtStrAssetIdA = $t03760837685._1
295295 let pmtAssetNameA = $t03760837685._2
296296 let pmtDecimalsA = $t03760837685._3
297297 let $t03769037767 = getAssetInfo(pmtAssetIdB)
298298 let pmtStrAssetIdB = $t03769037767._1
299299 let pmtAssetNameB = $t03769037767._2
300300 let pmtDecimalsB = $t03769037767._3
301301 if (isDefined(getBoolean(this, keyActive)))
302302 then throwIsActive()
303303 else if ((pmtAssetIdA == pmtAssetIdB))
304304 then throw("Assets must be different")
305305 else {
306306 let shareName = ((("s" + take(pmtAssetNameA, 7)) + "_") + take(pmtAssetNameB, 7))
307307 let shareDescription = ((((("ShareToken of SwopFi protocol for " + pmtAssetNameA) + " and ") + pmtAssetNameB) + " at address ") + toString(this))
308308 let shareDecimals = ((pmtDecimalsA + pmtDecimalsB) / 2)
309309 let shareInitialSupply = fraction(pow(pmtAmountA, pmtDecimalsA, 5, 1, pmtDecimalsA, HALFDOWN), pow(pmtAmountB, pmtDecimalsB, 5, 1, pmtDecimalsB, HALFDOWN), pow(10, 0, shareDecimals, 0, 0, HALFDOWN))
310310 let shareIssue = Issue(shareName, shareDescription, shareInitialSupply, shareDecimals, true)
311311 let shareIssueId = calculateAssetId(shareIssue)
312312 let invariantCalculated = invariantCalc(pmtAmountA, pmtAmountB)
313313 [StringEntry(keyVersion, version), BooleanEntry(keyActive, true), StringEntry(keyAssetIdA, pmtStrAssetIdA), StringEntry(keyAssetIdB, pmtStrAssetIdB), IntegerEntry(keyBalanceA, pmtAmountA), IntegerEntry(keyBalanceB, pmtAmountB), IntegerEntry(keyInvariant, invariantCalculated), IntegerEntry(keyCommission, commission), IntegerEntry(keyCommissionScaleDelimiter, commissionScaleDelimiter), shareIssue, StringEntry(keyShareAssetId, toBase58String(shareIssueId)), IntegerEntry(keyShareAssetSupply, shareInitialSupply), ScriptTransfer(i.caller, shareInitialSupply, shareIssueId)]
314314 }
315315 }
316316
317317
318318
319319 @Callable(i)
320320 func replenishWithTwoTokens (slippageTolerance) = {
321321 let pmtAssetIdA = i.payments[0].assetId
322322 let pmtAssetIdB = i.payments[1].assetId
323323 let pmtAmountA = deductStakingFee(i.payments[0].amount, pmtAssetIdA)
324324 let pmtAmountB = deductStakingFee(i.payments[1].amount, pmtAssetIdB)
325325 let tokenRatio = fraction(fraction(balanceA, scaleValue8, pmtAmountA), scaleValue3, fraction(balanceB, scaleValue8, pmtAmountB))
326326 let ratioShareTokensInA = fraction(pmtAmountA, scaleValue8, balanceA)
327327 let ratioShareTokensInB = fraction(pmtAmountB, scaleValue8, balanceB)
328328 let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
329329 let invariantCalculated = invariantCalc((balanceA + pmtAmountA), (balanceB + pmtAmountB))
330330 if (!(isActive))
331331 then throwIsInactive()
332332 else if (if ((0 > slippageTolerance))
333333 then true
334334 else (slippageTolerance > slippageToleranceDelimiter))
335335 then throw(((("Slippage tolerance must be between 0 and " + toString(slippageToleranceDelimiter)) + " inclusively. Actual: ") + toString(slippageTolerance)))
336336 else if ((size(i.payments) != 2))
337337 then throw("Two attached assets expected")
338338 else if (if ((pmtAssetIdA != assetIdA))
339339 then true
340340 else (pmtAssetIdB != assetIdB))
341341 then throwAssets()
342342 else if (if ((((scaleValue3 * (slippageToleranceDelimiter - slippageTolerance)) / slippageToleranceDelimiter) > tokenRatio))
343343 then true
344344 else (tokenRatio > ((scaleValue3 * (slippageToleranceDelimiter + slippageTolerance)) / slippageToleranceDelimiter)))
345345 then throw("Incorrect assets amount: amounts must have the contract ratio")
346346 else if ((shareTokenToPayAmount == 0))
347347 then throw("Too small amount to replenish")
348348 else if (!(hasEnoughBalance))
349349 then suspendSuspicious()
350350 else [IntegerEntry(keyBalanceA, (balanceA + pmtAmountA)), IntegerEntry(keyBalanceB, (balanceB + pmtAmountB)), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyInvariant, invariantCalculated), Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId)]
351351 }
352352
353353
354354
355355 @Callable(i)
356356 func replenishWithOneToken (virtualSwapTokenPay,virtualSwapTokenGet) = {
357357 let $t04229442369 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
358358 let pmtAmount = $t04229442369._1
359359 let pmtAssetId = $t04229442369._2
360- let pmtMinThreshold = 5000000
361- let thresholdValueForMinTolerance = 50000000
362- let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
363- then 100000
364- else 1
365- let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000))
366- let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000))
367- let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
368- let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000))
369- if (!(isActive))
370- then throwIsInactive()
371- else if ((pmtMinThreshold > pmtAmount))
372- then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
373- else if ((size(i.payments) != 1))
374- then throw("One attached payment expected")
375- else if (!(hasEnoughBalance))
376- then suspendSuspicious()
377- else if ((pmtAssetId == assetIdA))
378- then {
379- let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay)
380- let amountVirtualReplenishTokenB = virtualSwapTokenGet
381- let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay)
382- let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet)
383- let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
384- let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
385- if (if ((invariantEstimatedRatio >= slippageValueMinForSwap))
386- then ((invariantNew - invariant) >= 0)
387- else false)
360+ if (true)
361+ then throw(toString(value(value(assetInfo(USDN)).minSponsoredFee)))
362+ else {
363+ let pmtMinThreshold = 5000000
364+ let thresholdValueForMinTolerance = 50000000
365+ let tolerance = if ((thresholdValueForMinTolerance > pmtAmount))
366+ then 100000
367+ else 1
368+ let slippageValueMinForReplenish = (scaleValue8 - ((scaleValue8 * tolerance) / 10000000))
369+ let slippageValueMaxForReplenish = (scaleValue8 + ((scaleValue8 * tolerance) / 10000000))
370+ let slippageValueMinForSwap = (scaleValue8 - ((scaleValue8 * 1) / 10000000))
371+ let slippageValueMaxForSwap = (scaleValue8 + ((scaleValue8 * 1) / 10000000))
372+ if (!(isActive))
373+ then throwIsInactive()
374+ else if ((pmtMinThreshold > pmtAmount))
375+ then throw((((("Payment amount " + toString(pmtAmount)) + " does not exceed the minimum amount of ") + toString(pmtMinThreshold)) + " tokens"))
376+ else if ((size(i.payments) != 1))
377+ then throw("One attached payment expected")
378+ else if (!(hasEnoughBalance))
379+ then suspendSuspicious()
380+ else if ((pmtAssetId == assetIdA))
388381 then {
389- let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
390- if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
391- then true
392- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
393- then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
394- else {
395- let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000))
396- let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA)
397- let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
398- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
399- let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
400- let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB)
401- let newAmountTokenA = (balanceA + pmtAmount)
402- let newAmountTokenB = balanceB
403- let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount))
404- let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount))
405- let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
406- if (if ((dAppThresholdAmount > newAmountTokenA))
382+ let amountVirtualReplenishTokenA = (pmtAmount - virtualSwapTokenPay)
383+ let amountVirtualReplenishTokenB = virtualSwapTokenGet
384+ let balanceAfterVirtualSwapA = (balanceA + virtualSwapTokenPay)
385+ let balanceAfterVirtualSwapB = (balanceB - virtualSwapTokenGet)
386+ let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
387+ let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
388+ if (if ((invariantEstimatedRatio >= slippageValueMinForSwap))
389+ then ((invariantNew - invariant) >= 0)
390+ else false)
391+ then {
392+ let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
393+ if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
407394 then true
408- else (dAppThresholdAmount > newAmountTokenB))
409- then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
410- else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)]
395+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
396+ then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
397+ else {
398+ let ratioShareTokensInA = fraction((amountVirtualReplenishTokenA - 270000), scaleValue8, (balanceAfterVirtualSwapA - 270000))
399+ let ratioShareTokensInAWithoutCommission = fraction(amountVirtualReplenishTokenA, scaleValue8, balanceAfterVirtualSwapA)
400+ let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
401+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
402+ let shareTokenToPayAmountToDelete = fraction(max([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
403+ let invariantCalculated = invariantCalc((balanceA + pmtAmount), balanceB)
404+ let newAmountTokenA = (balanceA + pmtAmount)
405+ let newAmountTokenB = balanceB
406+ let xGet = fraction(shareTokenToPayAmount, newAmountTokenA, (shareAssetSupply + shareTokenToPayAmount))
407+ let yGet = fraction(shareTokenToPayAmount, newAmountTokenB, (shareAssetSupply + shareTokenToPayAmount))
408+ let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
409+ if (if ((dAppThresholdAmount > newAmountTokenA))
410+ then true
411+ else (dAppThresholdAmount > newAmountTokenB))
412+ then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
413+ else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyInvariant, invariantCalculated)]
414+ }
411415 }
416+ else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
412417 }
413- else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
414- }
415- else if ((pmtAssetId == assetIdB))
416- then {
417- let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay)
418- let amountVirtualReplenishTokenA = virtualSwapTokenGet
419- let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet)
420- let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay)
421- let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
422- let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
423- if (if ((invariantEstimatedRatio > slippageValueMinForSwap))
424- then ((invariantNew - invariant) >= 0)
425- else false)
418+ else if ((pmtAssetId == assetIdB))
426419 then {
427- let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
428- if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
429- then true
430- else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
431- then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
432- else {
433- let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA)
434- let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
435- let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
436- let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount))
437- let newAmountTokenA = balanceA
438- let newAmountTokenB = (balanceB + pmtAmount)
439- let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
440- if (if ((dAppThresholdAmount > newAmountTokenA))
420+ let amountVirtualReplenishTokenB = (pmtAmount - virtualSwapTokenPay)
421+ let amountVirtualReplenishTokenA = virtualSwapTokenGet
422+ let balanceAfterVirtualSwapA = (balanceA - virtualSwapTokenGet)
423+ let balanceAfterVirtualSwapB = (balanceB + virtualSwapTokenPay)
424+ let invariantNew = invariantCalc(balanceAfterVirtualSwapA, balanceAfterVirtualSwapB)
425+ let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantNew)
426+ if (if ((invariantEstimatedRatio > slippageValueMinForSwap))
427+ then ((invariantNew - invariant) >= 0)
428+ else false)
429+ then {
430+ let ratioVirtualBalanceToVirtualReplenish = (fraction(balanceAfterVirtualSwapA, (scaleValue8 * scaleValue8), balanceAfterVirtualSwapB) / fraction(amountVirtualReplenishTokenA, scaleValue8, amountVirtualReplenishTokenB))
431+ if (if ((slippageValueMinForReplenish > ratioVirtualBalanceToVirtualReplenish))
441432 then true
442- else (dAppThresholdAmount > newAmountTokenB))
443- then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
444- else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)]
433+ else (ratioVirtualBalanceToVirtualReplenish > slippageValueMaxForReplenish))
434+ then throw("swop with virtualSwapTokenPay and virtualSwapTokenGet possible, but ratio after virtual swap incorrect")
435+ else {
436+ let ratioShareTokensInA = fraction(deductStakingFee(amountVirtualReplenishTokenA, assetIdA), scaleValue8, balanceAfterVirtualSwapA)
437+ let ratioShareTokensInB = fraction(deductStakingFee(amountVirtualReplenishTokenB, assetIdB), scaleValue8, balanceAfterVirtualSwapB)
438+ let shareTokenToPayAmount = fraction(min([ratioShareTokensInA, ratioShareTokensInB]), shareAssetSupply, scaleValue8)
439+ let invariantCalculated = invariantCalc(balanceA, (balanceB + pmtAmount))
440+ let newAmountTokenA = balanceA
441+ let newAmountTokenB = (balanceB + pmtAmount)
442+ let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
443+ if (if ((dAppThresholdAmount > newAmountTokenA))
444+ then true
445+ else (dAppThresholdAmount > newAmountTokenB))
446+ then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
447+ else [Reissue(shareAssetId, shareTokenToPayAmount, true), ScriptTransfer(i.caller, shareTokenToPayAmount, shareAssetId), IntegerEntry(keyShareAssetSupply, (shareAssetSupply + shareTokenToPayAmount)), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalculated)]
448+ }
445449 }
450+ else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
446451 }
447- else throw("incorrect virtualSwapTokenPay or virtualSwapTokenGet value")
448- }
449- else throwAssets()
452+ else throwAssets()
453+ }
450454 }
451455
452456
453457
454458 @Callable(i)
455459 func exchange (estimatedAmountToReceive,minAmountToReceive) = {
456- let $t04992249997 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
457- let pmtAmount = $t04992249997._1
458- let pmtAssetId = $t04992249997._2
460+ let $t05001550090 = $Tuple2(i.payments[0].amount, i.payments[0].assetId)
461+ let pmtAmount = $t05001550090._1
462+ let pmtAssetId = $t05001550090._2
459463 if (!(isActive))
460464 then throwIsInactive()
461465 else if ((0 >= estimatedAmountToReceive))
462466 then throw(("Estimated amount must be positive. Actual: " + toString(estimatedAmountToReceive)))
463467 else if ((minAmountToReceive > estimatedAmountToReceive))
464468 then throw(((("Minimal amount can't be greater than estimated. Estimated: " + toString(estimatedAmountToReceive)) + ". Minimal: ") + toString(minAmountToReceive)))
465469 else if ((size(i.payments) != 1))
466470 then throw("One attached payment expected")
467471 else if (!(hasEnoughBalance))
468472 then suspendSuspicious()
469473 else if ((pmtAssetId == assetIdA))
470474 then {
471475 let assetIdSend = assetIdB
472476 let amountWithoutFee = calculateHowManySendTokenB(estimatedAmountToReceive, minAmountToReceive, balanceA, balanceB, pmtAmount)
473477 let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
474478 let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter)
475479 let newAmountTokenA = (balanceA + pmtAmount)
476480 let newAmountTokenB = ((balanceB - amountWithFee) - governanceReward)
477481 let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
478482 if (if ((dAppThresholdAmount > newAmountTokenA))
479483 then true
480484 else (dAppThresholdAmount > newAmountTokenB))
481485 then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
482486 else if (if (if ((assetIdA == USDN))
483487 then (stakedAmountUSDN >= newAmountTokenA)
484488 else false)
485489 then true
486490 else if ((assetIdB == USDN))
487491 then (stakedAmountUSDN >= newAmountTokenB)
488492 else false)
489493 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceB, assetNameB)
490494 else [IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalc((balanceA + pmtAmount), ((balanceB - amountWithFee) - governanceReward))), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(governanceAddress, governanceReward, assetIdSend)]
491495 }
492496 else if ((pmtAssetId == assetIdB))
493497 then {
494498 let assetIdSend = assetIdA
495499 let amountWithoutFee = calculateHowManySendTokenA(estimatedAmountToReceive, minAmountToReceive, balanceA, balanceB, pmtAmount)
496500 let amountWithFee = fraction(amountWithoutFee, (commissionScaleDelimiter - commission), commissionScaleDelimiter)
497501 let governanceReward = fraction(amountWithoutFee, commissionGovernance, commissionScaleDelimiter)
498502 let newAmountTokenA = ((balanceA - amountWithFee) - governanceReward)
499503 let newAmountTokenB = (balanceB + pmtAmount)
500504 let dAppThresholdAmount = fraction((newAmountTokenA + newAmountTokenB), dAppThreshold, (2 * dAppThresholdDelimiter))
501505 if (if ((dAppThresholdAmount > newAmountTokenA))
502506 then true
503507 else (dAppThresholdAmount > newAmountTokenB))
504508 then throwThreshold(dAppThresholdAmount, newAmountTokenA, newAmountTokenB)
505509 else if (if (if ((assetIdA == USDN))
506510 then (stakedAmountUSDN >= newAmountTokenA)
507511 else false)
508512 then true
509513 else if ((assetIdB == USDN))
510514 then (stakedAmountUSDN >= newAmountTokenB)
511515 else false)
512516 then throwInsufficientAvailableBalance(amountWithFee, availableBalanceA, assetNameA)
513517 else [IntegerEntry(keyBalanceA, newAmountTokenA), IntegerEntry(keyBalanceB, newAmountTokenB), IntegerEntry(keyInvariant, invariantCalc(((balanceA - amountWithFee) - governanceReward), (balanceB + pmtAmount))), ScriptTransfer(i.caller, amountWithFee, assetIdSend), ScriptTransfer(governanceAddress, governanceReward, assetIdSend)]
514518 }
515519 else throwAssets()
516520 }
517521
518522
519523
520524 @Callable(i)
521525 func takeIntoAccountExtraFunds (amountLeave) = {
522526 let uncountableAmountEnrollAssetA = (accountBalanceWithStakedA - balanceA)
523527 let uncountableAmountEnrollAssetB = (accountBalanceWithStakedB - balanceB)
524528 let amountEnrollA = (uncountableAmountEnrollAssetA - (if ((assetIdA == USDN))
525529 then amountLeave
526530 else 0))
527531 let amountEnrollB = (uncountableAmountEnrollAssetB - (if ((assetIdB == USDN))
528532 then amountLeave
529533 else 0))
530534 if (!(isActive))
531535 then throwIsInactive()
532536 else if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3, adminPubKeyStaking], i.callerPublicKey)))
533537 then throwOnlyAdmin()
534538 else if ((0 > amountLeave))
535539 then throw(("Argument 'amountLeave' cannot be negative. Actual: " + toString(amountLeave)))
536540 else if (if ((0 > uncountableAmountEnrollAssetA))
537541 then true
538542 else (0 > uncountableAmountEnrollAssetB))
539543 then suspend("Enroll amount negative")
540544 else if (if ((0 > amountEnrollA))
541545 then true
542546 else (0 > amountEnrollB))
543547 then throw("Too large amountLeave")
544548 else [IntegerEntry(keyBalanceA, (balanceA + amountEnrollA)), IntegerEntry(keyBalanceB, (balanceB + amountEnrollB))]
545549 }
546550
547551

github/deemru/w8io/169f3d6 
64.89 ms