tx · DXj6csFNKmpdJqa7tq74Av6XU1rjhv83vKH4USbxesXU

3MrMbQwr3cpCvWMWCFjqUZzqRgxg8En6Jd5:  -0.03700000 Waves

2022.12.15 13:01 [2361278] smart account 3MrMbQwr3cpCvWMWCFjqUZzqRgxg8En6Jd5 > SELF 0.00000000 Waves

{ "type": 13, "id": "DXj6csFNKmpdJqa7tq74Av6XU1rjhv83vKH4USbxesXU", "fee": 3700000, "feeAssetId": null, "timestamp": 1671098518287, "version": 2, "chainId": 84, "sender": "3MrMbQwr3cpCvWMWCFjqUZzqRgxg8En6Jd5", "senderPublicKey": "8WTLBzi1s9cZm76TPZ9czV6poaHGWvpZ7sCBeTBaa7uh", "proofs": [ "3qV57ZmSXMy1ezeLG9zN9dTcRHWiTtQsXXhkeGT5GZap6D6Ler8ATZgPbCKvKRFtwfbysqierupFn6gSgLvkeZvp" ], "script": "base64:BgJhCAISBAoCCAgSAwoBCBIAEgUKAwgIARIFCgMICAESBgoECAgIARIFCgMICAgSBQoDCAgBEgQKAggIEgMKAQgSBAoCCAESBQoDCAgBEgQKAggBEgQKAggBEgMKAQgSAwoBCGUAE2tfdG90YWxGZWVzSW5QZXJpb2QCE2tfdG90YWxGZWVzSW5QZXJpb2QAGGtfdG90YWxBc3NldEZlZXNJblBlcmlvZAIYa190b3RhbEFzc2V0RmVlc0luUGVyaW9kABRrX3RyYWRlckZlZXNJblBlcmlvZAIUa190cmFkZXJGZWVzSW5QZXJpb2QADmtfdHJhZGVyVm9sdW1lAg5rX3RyYWRlclZvbHVtZQAYa190cmFkZXJDdW11bGF0aXZlVm9sdW1lAhhrX3RyYWRlckN1bXVsYXRpdmVWb2x1bWUACmtfZmVlVGllcnMCCmtfZmVlVGllcnMADmtfbGFzdE5vdGlvbmFsAg5rX2xhc3ROb3Rpb25hbAAUa190b3RhbFNjb3JlSW5QZXJpb2QCFGtfdG90YWxTY29yZUluUGVyaW9kABVrX3RyYWRlclNjb3JlSW5QZXJpb2QCFWtfdHJhZGVyU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VudAEFB190cmFkZXIJAJQKAgUDbmlsBQZyZXN1bHQBaQEXdmlld19jb21wdXRlRmVlRGlzY291bnQBB190cmFkZXIEBnJlc3VsdAkBDmdldEZlZURpc2NvdW50AQUHX3RyYWRlcgkAAgEJAKQDAQUGcmVzdWx0AQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AHWSGw0=", "height": 2361278, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EWbphkhY6NbbuezqiPaYC3aVbUXB9C94t2kLetQdLB8R Next: C6sgCSTRqPbRwHr6t3oxVThLQD52fPNCzcp9QdYK5uqr Diff:
OldNewDifferences
2424 let k_ammRewardRate = "k_ammRewardRate"
2525
2626 let k_assetMaxAmountPerPeriod = "k_assetMaxAmountPerPeriod"
27+
28+let k_assetLastUpdated = "k_assetLastUpdated"
2729
2830 let k_rewardAssetIds = "k_rewardAssetIds"
2931
6264 let MS_IN_DAY = (1000 * 86400)
6365
6466 let NO_DISCOUNT = (DECIMAL_UNIT / 100)
67+
68+let WEEK_COUNT = [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
6569
6670 func listToStr (_list) = {
6771 func _join (accumulator,val) = ((accumulator + val) + ",")
174178
175179
176180 func getAssetMaxAmountPerPeriodKey (_assetId) = ((k_assetMaxAmountPerPeriod + "_") + _assetId)
181+
182+
183+func getAssetMaxAmountPerDefinedPeriodKey (_assetId,_period) = ((((k_assetMaxAmountPerPeriod + "_") + _assetId) + "_") + toString(_period))
184+
185+
186+func getAssetLastUpdatedKey (_assetId) = ((k_assetLastUpdated + "_") + _assetId)
177187
178188
179189 func getClaimedTraderAssetPeriodKey (_trader,_assetId,_period) = ((((((k_claimedAssetAndPeriod + "_") + _trader) + "_") + _assetId) + "_") + toString(_period))
295305 }
296306
297307
308+func getAssetMaxAmountPerDefinedPeriod (_assetId,_period) = {
309+ let key = getAssetMaxAmountPerDefinedPeriodKey(_assetId, _period)
310+ valueOrElse(getInteger(this, key), getAssetMaxAmountPerPeriod(_assetId))
311+ }
312+
313+
298314 func getTotalClaimedForTraderAndAsset (_trader,_assetId) = {
299315 let key = getTotalClaimedForTraderAndAssetKey(_trader, _assetId)
300316 int0(key)
318334 int0(key)
319335 }
320336 else {
321- let maxAmountOfAsset = getAssetMaxAmountPerPeriod(_assetId)
337+ let maxAmountOfAsset = getAssetMaxAmountPerDefinedPeriod(_assetId, _weekId)
322338 let maxAmountOfAssetToDistribute = muld(divd(totalFeesInPeriod, totalAssetFeesInPeriod), maxAmountOfAsset)
323339 maxAmountOfAssetToDistribute
324340 }
538554 let tiers = getFeeTiers()
539555 let cumulativeVolume = getTraderCumulativeVolume(_trader)
540556 func findFee (_acc,_tier) = {
541- let $t01644516488 = _tier
542- let minCumulativeVolume = $t01644516488._1
543- let discount = $t01644516488._2
557+ let $t01723817281 = _tier
558+ let minCumulativeVolume = $t01723817281._1
559+ let discount = $t01723817281._2
544560 if ((cumulativeVolume >= minCumulativeVolume))
545561 then [discount]
546562 else _acc
627643 if (contains(_periods, toString(getWeekId(TIME))))
628644 then throw("Can not claim rewards for current week")
629645 else {
630- let $t01890718990 = claimAllRewardForPeriodForTrader(trader, _assetId, _periods)
631- let amount = $t01890718990._1
632- let result = $t01890718990._2
646+ let $t01970019783 = claimAllRewardForPeriodForTrader(trader, _assetId, _periods)
647+ let amount = $t01970019783._1
648+ let result = $t01970019783._2
633649 if ((amount == 0))
634650 then throw("Nothing to claim")
635651 else result
655671 else {
656672 let amms = getAmms()
657673 let rewardAssetIds = getRewardAssetIds()
674+ let weekId = getWeekId(TIME)
658675 let newRewardAssetIds = if (containsElement(rewardAssetIds, _assetId))
659676 then rewardAssetIds
660677 else (rewardAssetIds :+ _assetId)
661-[IntegerEntry(getAssetMaxAmountPerPeriodKey(_assetId), _maxAmountPerPeriod), StringEntry(k_rewardAssetIds, listToStr(newRewardAssetIds))]
678+ let previousMaxAmountPerPeriod = getAssetMaxAmountPerPeriod(_assetId)
679+ let fix = if ((previousMaxAmountPerPeriod > 0))
680+ then {
681+ let key = getAssetLastUpdatedKey(_assetId)
682+ let prevUpdatedPeriod = valueOrElse(getInteger(this, key), 2736)
683+ func doFixAssetAmountAtPeriod (_acc,_increment) = {
684+ let fixWeekId = (prevUpdatedPeriod + _increment)
685+ if ((weekId > fixWeekId))
686+ then (_acc :+ IntegerEntry(getAssetMaxAmountPerDefinedPeriodKey(_assetId, fixWeekId), previousMaxAmountPerPeriod))
687+ else _acc
688+ }
689+
690+ let $l = WEEK_COUNT
691+ let $s = size($l)
692+ let $acc0 = nil
693+ func $f0_1 ($a,$i) = if (($i >= $s))
694+ then $a
695+ else doFixAssetAmountAtPeriod($a, $l[$i])
696+
697+ func $f0_2 ($a,$i) = if (($i >= $s))
698+ then $a
699+ else throw("List size exceeds 52")
700+
701+ $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($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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52)
702+ }
703+ else nil
704+ (fix ++ [IntegerEntry(getAssetMaxAmountPerPeriodKey(_assetId), _maxAmountPerPeriod), IntegerEntry(getAssetLastUpdatedKey(_assetId), weekId), StringEntry(k_rewardAssetIds, listToStr(newRewardAssetIds))])
662705 }
663706
664707
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let k_totalFeesInPeriod = "k_totalFeesInPeriod"
55
66 let k_totalAssetFeesInPeriod = "k_totalAssetFeesInPeriod"
77
88 let k_traderFeesInPeriod = "k_traderFeesInPeriod"
99
1010 let k_traderVolume = "k_traderVolume"
1111
1212 let k_traderCumulativeVolume = "k_traderCumulativeVolume"
1313
1414 let k_feeTiers = "k_feeTiers"
1515
1616 let k_lastNotional = "k_lastNotional"
1717
1818 let k_totalScoreInPeriod = "k_totalScoreInPeriod"
1919
2020 let k_traderScoreInPeriod = "k_traderScoreInPeriod"
2121
2222 let k_traderAverageNotionalInPeriod = "k_traderAverageNotionalInPeriod"
2323
2424 let k_ammRewardRate = "k_ammRewardRate"
2525
2626 let k_assetMaxAmountPerPeriod = "k_assetMaxAmountPerPeriod"
27+
28+let k_assetLastUpdated = "k_assetLastUpdated"
2729
2830 let k_rewardAssetIds = "k_rewardAssetIds"
2931
3032 let k_amms = "k_amms"
3133
3234 let k_claimedAssetAndPeriod = "k_claimedAssetAndPeriod"
3335
3436 let k_oracleAddress = "k_oracleAddress"
3537
3638 let k_oraclePrice = "price"
3739
3840 let k_totalClaimedForTraderAndAsset = "k_totalClaimedForTraderAndAsset"
3941
4042 let k_ammMaxAmountPerPeriod = "k_ammMaxAmountPerPeriod"
4143
4244 let k_initialized = "k_initialized"
4345
4446 let k_coordinatorAddress = "k_coordinatorAddress"
4547
4648 let k_governance_asset = "k_gov_asset"
4749
4850 let k_quote_asset = "k_quote_asset"
4951
5052 let k_admin_public_key = "k_admin_public_key"
5153
5254 let k_admin_address = "k_admin_address"
5355
5456 let k_amm = "k_amm"
5557
5658 let DECIMAL_UNIT = (1 * (((((((10 * 10) * 10) * 10) * 10) * 10) * 10) * 10))
5759
5860 let A = 70000000
5961
6062 let MS_IN_WEEK = (1000 * 604800)
6163
6264 let MS_IN_DAY = (1000 * 86400)
6365
6466 let NO_DISCOUNT = (DECIMAL_UNIT / 100)
67+
68+let WEEK_COUNT = [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, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
6569
6670 func listToStr (_list) = {
6771 func _join (accumulator,val) = ((accumulator + val) + ",")
6872
6973 let newListStr = {
7074 let $l = _list
7175 let $s = size($l)
7276 let $acc0 = ""
7377 func $f0_1 ($a,$i) = if (($i >= $s))
7478 then $a
7579 else _join($a, $l[$i])
7680
7781 func $f0_2 ($a,$i) = if (($i >= $s))
7882 then $a
7983 else throw("List size exceeds 100")
8084
8185 $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($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($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($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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52), 53), 54), 55), 56), 57), 58), 59), 60), 61), 62), 63), 64), 65), 66), 67), 68), 69), 70), 71), 72), 73), 74), 75), 76), 77), 78), 79), 80), 81), 82), 83), 84), 85), 86), 87), 88), 89), 90), 91), 92), 93), 94), 95), 96), 97), 98), 99), 100)
8286 }
8387 let newListStrU = dropRight(newListStr, 1)
8488 let newListStrR = if ((take(newListStrU, 1) == ","))
8589 then drop(newListStrU, 1)
8690 else newListStrU
8791 newListStrR
8892 }
8993
9094
9195 func strToList (_str) = if ((_str == ""))
9296 then nil
9397 else split(_str, ",")
9498
9599
96100 func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN)
97101
98102
99103 func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN)
100104
101105
102106 func powd (_x,_y) = pow(_x, 8, _y, 8, 8, HALFEVEN)
103107
104108
105109 func abs (_x) = if ((_x > 0))
106110 then _x
107111 else -(_x)
108112
109113
110114 func minv (_x,_y) = if ((_x > _y))
111115 then _y
112116 else _x
113117
114118
115119 func toCompositeKey (_key,_address) = ((_key + "_") + _address)
116120
117121
118122 let that = this
119123
120124 func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(that, k_coordinatorAddress)), "Coordinator not set")
121125
122126
123127 func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key))
124128
125129
126130 func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address))
127131
128132
129133 func isWhitelist (_address) = valueOrElse(getBoolean(coordinator(), toCompositeKey(k_amm, _address)), false)
130134
131135
132136 func int (k) = valueOrErrorMessage(getInteger(that, k), ("no value for " + k))
133137
134138
135139 func int0 (k) = valueOrElse(getInteger(that, k), 0)
136140
137141
138142 func initialized () = valueOrElse(getBoolean(that, k_initialized), false)
139143
140144
141145 func getRewardAssetIds () = strToList(valueOrElse(getString(that, k_rewardAssetIds), ""))
142146
143147
144148 let TIME = lastBlock.timestamp
145149
146150 func getTraderVolumeKey (_trader,_dayId) = ((((k_traderVolume + "_") + _trader) + "_") + toString(_dayId))
147151
148152
149153 func getTraderCumulativeVolumeKey (_trader) = ((k_traderCumulativeVolume + "_") + _trader)
150154
151155
152156 func getTraderFeesInPeriodKey (_amm,_trader,_weekId) = ((((((k_traderFeesInPeriod + "_") + _amm) + "_") + _trader) + "_") + toString(_weekId))
153157
154158
155159 func getTotalAmmFeesInPeriodKey (_amm,_weekId) = ((((k_totalFeesInPeriod + "_") + _amm) + "_") + toString(_weekId))
156160
157161
158162 func getTotalAssetFeesInPeriodKey (_assetId,_weekId) = ((((k_totalAssetFeesInPeriod + "_") + _assetId) + "_") + toString(_weekId))
159163
160164
161165 func getLastNotionalKey (_amm,_trader) = ((((k_lastNotional + "_") + _amm) + "_") + _trader)
162166
163167
164168 func getTraderScoreInPeriodKey (_amm,_trader,_weekId) = ((((((k_traderScoreInPeriod + "_") + _amm) + "_") + _trader) + "_") + toString(_weekId))
165169
166170
167171 func getTotalScoreInPeriodKey (_amm,_weekId) = ((((k_totalScoreInPeriod + "_") + _amm) + "_") + toString(_weekId))
168172
169173
170174 func getTraderAverageNotionalInPeriodKey (_amm,_trader,_weekId) = ((((((k_traderAverageNotionalInPeriod + "_") + _amm) + "_") + _trader) + "_") + toString(_weekId))
171175
172176
173177 func getAmmRewardRateKey (_amm,_assetId) = ((((k_ammRewardRate + "_") + _amm) + "_") + _assetId)
174178
175179
176180 func getAssetMaxAmountPerPeriodKey (_assetId) = ((k_assetMaxAmountPerPeriod + "_") + _assetId)
181+
182+
183+func getAssetMaxAmountPerDefinedPeriodKey (_assetId,_period) = ((((k_assetMaxAmountPerPeriod + "_") + _assetId) + "_") + toString(_period))
184+
185+
186+func getAssetLastUpdatedKey (_assetId) = ((k_assetLastUpdated + "_") + _assetId)
177187
178188
179189 func getClaimedTraderAssetPeriodKey (_trader,_assetId,_period) = ((((((k_claimedAssetAndPeriod + "_") + _trader) + "_") + _assetId) + "_") + toString(_period))
180190
181191
182192 func getOraclePriceKey (_assetId,_period) = ((((k_oraclePrice + "_") + toString(_period)) + "_") + _assetId)
183193
184194
185195 func getTotalClaimedForTraderAndAssetKey (_trader,_assetId) = ((((k_totalClaimedForTraderAndAsset + "_") + _trader) + "_") + _assetId)
186196
187197
188198 func getAmmMaxAmountPerPeriodKey (_amm,_assetId) = ((((k_ammMaxAmountPerPeriod + "_") + _amm) + "_") + _assetId)
189199
190200
191201 func usdnToDecimals (_amount) = (_amount * 100)
192202
193203
194204 func getWeekStart (_weekId) = (_weekId * MS_IN_WEEK)
195205
196206
197207 func getWeekEnd (_weekId) = ((_weekId + 1) * MS_IN_WEEK)
198208
199209
200210 func getWeekId (_ts) = (_ts / MS_IN_WEEK)
201211
202212
203213 func getDayId (_ts) = (_ts / MS_IN_DAY)
204214
205215
206216 func getFeeTiers () = {
207217 let storedTiers = valueOrElse(getString(this, k_feeTiers), "")
208218 if ((storedTiers == ""))
209219 then nil
210220 else {
211221 let tiers = split(valueOrElse(getString(this, k_feeTiers), ""), ",")
212222 func toFeeTier (_acc,_tier) = {
213223 let tierSplit = split(_tier, ":")
214224 let minCumulativeVolume = parseIntValue(tierSplit[0])
215225 let discount = parseIntValue(tierSplit[1])
216226 (_acc :+ $Tuple2(minCumulativeVolume, discount))
217227 }
218228
219229 let $l = tiers
220230 let $s = size($l)
221231 let $acc0 = nil
222232 func $f0_1 ($a,$i) = if (($i >= $s))
223233 then $a
224234 else toFeeTier($a, $l[$i])
225235
226236 func $f0_2 ($a,$i) = if (($i >= $s))
227237 then $a
228238 else throw("List size exceeds 10")
229239
230240 $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)
231241 }
232242 }
233243
234244
235245 func getTraderVolume (_trader,_dayId) = {
236246 let key = getTraderVolumeKey(_trader, _dayId)
237247 valueOrElse(getInteger(this, key), 0)
238248 }
239249
240250
241251 func getTraderCumulativeVolume (_trader) = {
242252 let key = getTraderCumulativeVolumeKey(_trader)
243253 valueOrElse(getInteger(this, key), 0)
244254 }
245255
246256
247257 func getFeesInPeriod (_amm,_trader,_weekId) = {
248258 let key = getTraderFeesInPeriodKey(_amm, _trader, _weekId)
249259 int0(key)
250260 }
251261
252262
253263 func getTotalFeesInPeriod (_amm,_weekId) = {
254264 let key = getTotalAmmFeesInPeriodKey(_amm, _weekId)
255265 int0(key)
256266 }
257267
258268
259269 func getTotalAssetFeesInPeriod (_assetId,_weekId) = {
260270 let key = getTotalAssetFeesInPeriodKey(_assetId, _weekId)
261271 int0(key)
262272 }
263273
264274
265275 func getLastNotional (_amm,_trader) = {
266276 let key = getLastNotionalKey(_amm, _trader)
267277 int0(key)
268278 }
269279
270280
271281 func getTraderScoreInPeriod (_amm,_trader,_weekId) = {
272282 let key = getTraderScoreInPeriodKey(_amm, _trader, _weekId)
273283 int0(key)
274284 }
275285
276286
277287 func getTotalScoreInPeriod (_amm,_weekId) = {
278288 let key = getTotalScoreInPeriodKey(_amm, _weekId)
279289 int0(key)
280290 }
281291
282292
283293 func getAmms () = strToList(valueOrElse(getString(that, k_amms), ""))
284294
285295
286296 func getAmmRewardRate (_amm,_assetId) = {
287297 let key = getAmmRewardRateKey(_amm, _assetId)
288298 int0(key)
289299 }
290300
291301
292302 func getAssetMaxAmountPerPeriod (_assetId) = {
293303 let key = getAssetMaxAmountPerPeriodKey(_assetId)
294304 int0(key)
295305 }
296306
297307
308+func getAssetMaxAmountPerDefinedPeriod (_assetId,_period) = {
309+ let key = getAssetMaxAmountPerDefinedPeriodKey(_assetId, _period)
310+ valueOrElse(getInteger(this, key), getAssetMaxAmountPerPeriod(_assetId))
311+ }
312+
313+
298314 func getTotalClaimedForTraderAndAsset (_trader,_assetId) = {
299315 let key = getTotalClaimedForTraderAndAssetKey(_trader, _assetId)
300316 int0(key)
301317 }
302318
303319
304320 func getRewardAssetPrice (_assetId,_weekId) = {
305321 let oracleAddressStr = valueOrErrorMessage(getString(that, k_oracleAddress), "Oracle not set")
306322 let oracleAddress = valueOrErrorMessage(addressFromString(oracleAddressStr), "Invalid oracle address")
307323 let priceKey = getOraclePriceKey(_assetId, _weekId)
308324 usdnToDecimals(valueOrErrorMessage(getInteger(oracleAddress, priceKey), ((("No oracle price for asset " + _assetId) + " period ") + toString(_weekId))))
309325 }
310326
311327
312328 func getMaxAmountOfAssetToDistribute (_amm,_assetId,_weekId) = {
313329 let totalFeesInPeriod = getTotalFeesInPeriod(_amm, _weekId)
314330 let totalAssetFeesInPeriod = getTotalAssetFeesInPeriod(_assetId, _weekId)
315331 if ((totalAssetFeesInPeriod == 0))
316332 then {
317333 let key = getAmmMaxAmountPerPeriodKey(_amm, _assetId)
318334 int0(key)
319335 }
320336 else {
321- let maxAmountOfAsset = getAssetMaxAmountPerPeriod(_assetId)
337+ let maxAmountOfAsset = getAssetMaxAmountPerDefinedPeriod(_assetId, _weekId)
322338 let maxAmountOfAssetToDistribute = muld(divd(totalFeesInPeriod, totalAssetFeesInPeriod), maxAmountOfAsset)
323339 maxAmountOfAssetToDistribute
324340 }
325341 }
326342
327343
328344 func rewardForTraderInAssetInPeriod (_amm,_trader,_assetId,_weekId) = {
329345 let rewardAssetRate = getAmmRewardRate(_amm, _assetId)
330346 if ((rewardAssetRate == 0))
331347 then 0
332348 else {
333349 let totalFeesInPeriod = getTotalFeesInPeriod(_amm, _weekId)
334350 let rewardAssetPrice = getRewardAssetPrice(_assetId, _weekId)
335351 let maxAmountOfAssetToDistribute = getMaxAmountOfAssetToDistribute(_amm, _assetId, _weekId)
336352 let traderScore = getTraderScoreInPeriod(_amm, _trader, _weekId)
337353 let totalTraderScore = getTotalScoreInPeriod(_amm, _weekId)
338354 if ((totalTraderScore == 0))
339355 then 0
340356 else {
341357 let totalAssetToDistribute = divd(muld(totalFeesInPeriod, rewardAssetRate), rewardAssetPrice)
342358 let actualTotalAssetToDistribute = minv(totalAssetToDistribute, maxAmountOfAssetToDistribute)
343359 let traderShareInRewards = divd(muld(actualTotalAssetToDistribute, traderScore), totalTraderScore)
344360 traderShareInRewards
345361 }
346362 }
347363 }
348364
349365
350366 func rewardForAmmInAssetInPeriod (_amm,_assetId,_weekId) = {
351367 let rewardAssetRate = getAmmRewardRate(_amm, _assetId)
352368 if ((rewardAssetRate == 0))
353369 then 0
354370 else {
355371 let totalFeesInPeriod = getTotalFeesInPeriod(_amm, _weekId)
356372 let rewardAssetPrice = getRewardAssetPrice(_assetId, _weekId)
357373 let maxAmountOfAssetToDistribute = getMaxAmountOfAssetToDistribute(_amm, _assetId, _weekId)
358374 let totalAssetToDistribute = divd(muld(totalFeesInPeriod, rewardAssetRate), rewardAssetPrice)
359375 let actualTotalAssetToDistribute = minv(totalAssetToDistribute, maxAmountOfAssetToDistribute)
360376 actualTotalAssetToDistribute
361377 }
362378 }
363379
364380
365381 func totalRewardForTraderInAssetInPeriod (_trader,_assetId,_weekId) = {
366382 let amms = getAmms()
367383 func compute (_acc,_amm) = (_acc + rewardForTraderInAssetInPeriod(_amm, _trader, _assetId, _weekId))
368384
369385 let $l = amms
370386 let $s = size($l)
371387 let $acc0 = 0
372388 func $f0_1 ($a,$i) = if (($i >= $s))
373389 then $a
374390 else compute($a, $l[$i])
375391
376392 func $f0_2 ($a,$i) = if (($i >= $s))
377393 then $a
378394 else throw("List size exceeds 20")
379395
380396 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
381397 }
382398
383399
384400 func totalRewardForTraderInAsset (_trader,_assetId,_periods) = {
385401 func compute (_acc,_weekId) = (_acc + totalRewardForTraderInAssetInPeriod(_trader, _assetId, _weekId))
386402
387403 let $l = _periods
388404 let $s = size($l)
389405 let $acc0 = 0
390406 func $f0_1 ($a,$i) = if (($i >= $s))
391407 then $a
392408 else compute($a, $l[$i])
393409
394410 func $f0_2 ($a,$i) = if (($i >= $s))
395411 then $a
396412 else throw("List size exceeds 12")
397413
398414 $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12)
399415 }
400416
401417
402418 func getTraderAverageNotionalInPeriod (_amm,_trader,_weekId,_defaultValue) = {
403419 let key = getTraderAverageNotionalInPeriodKey(_amm, _trader, _weekId)
404420 valueOrElse(getInteger(that, key), _defaultValue)
405421 }
406422
407423
408424 func isClaimed (_trader,_assetId,_period) = {
409425 let key = getClaimedTraderAssetPeriodKey(_trader, _assetId, _period)
410426 valueOrElse(getBoolean(that, key), false)
411427 }
412428
413429
414430 func adjust (_amount,_assetId) = {
415431 let asset = valueOrErrorMessage(assetInfo(fromBase58String(_assetId)), "Invalid asset id")
416432 let decimals = asset.decimals
417433 if ((decimals == 6))
418434 then (_amount / 100)
419435 else _amount
420436 }
421437
422438
423439 func claimAllRewardForPeriodForTrader (_trader,_assetId,_periods) = {
424440 let periods = strToList(_periods)
425441 func checkAndFilterFn (_acc,_next) = {
426442 let period = valueOrErrorMessage(parseInt(_next), ("Invalid period: " + _next))
427443 if (if (containsElement(_acc, period))
428444 then true
429445 else isClaimed(_trader, _assetId, period))
430446 then _acc
431447 else (_acc :+ period)
432448 }
433449
434450 let validPeriods = {
435451 let $l = periods
436452 let $s = size($l)
437453 let $acc0 = nil
438454 func $f0_1 ($a,$i) = if (($i >= $s))
439455 then $a
440456 else checkAndFilterFn($a, $l[$i])
441457
442458 func $f0_2 ($a,$i) = if (($i >= $s))
443459 then $a
444460 else throw("List size exceeds 12")
445461
446462 $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($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12)
447463 }
448464 func markPeriodAsDoneFn (_acc,_period) = (_acc :+ BooleanEntry(getClaimedTraderAssetPeriodKey(_trader, _assetId, _period), true))
449465
450466 let markPeriodsAsClaimed = {
451467 let $l = validPeriods
452468 let $s = size($l)
453469 let $acc0 = nil
454470 func $f1_1 ($a,$i) = if (($i >= $s))
455471 then $a
456472 else markPeriodAsDoneFn($a, $l[$i])
457473
458474 func $f1_2 ($a,$i) = if (($i >= $s))
459475 then $a
460476 else throw("List size exceeds 16")
461477
462478 $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)
463479 }
464480 let amount = totalRewardForTraderInAsset(_trader, _assetId, validPeriods)
465481 $Tuple2(amount, ([ScriptTransfer(addressFromStringValue(_trader), adjust(amount, _assetId), fromBase58String(_assetId)), IntegerEntry(getTotalClaimedForTraderAndAssetKey(_trader, _assetId), (getTotalClaimedForTraderAndAsset(_trader, _assetId) + amount))] ++ markPeriodsAsClaimed))
466482 }
467483
468484
469485 func updateTraderVolume (_trader,_dayId,_generatedVolume) = {
470486 let actualDayVolume = (getTraderVolume(_trader, _dayId) + _generatedVolume)
471487 let daysBefore = [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]
472488 func updateCumulativeVolume (_acc,_minusDay) = (_acc + getTraderVolume(_trader, (_dayId - _minusDay)))
473489
474490 let cumulativeVolume = {
475491 let $l = daysBefore
476492 let $s = size($l)
477493 let $acc0 = 0
478494 func $f0_1 ($a,$i) = if (($i >= $s))
479495 then $a
480496 else updateCumulativeVolume($a, $l[$i])
481497
482498 func $f0_2 ($a,$i) = if (($i >= $s))
483499 then $a
484500 else throw("List size exceeds 30")
485501
486502 $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)
487503 }
488504 [IntegerEntry(getTraderVolumeKey(_trader, _dayId), actualDayVolume), IntegerEntry(getTraderCumulativeVolumeKey(_trader), (cumulativeVolume + actualDayVolume))]
489505 }
490506
491507
492508 func updateAmmFees (_amm,_trader,_weekId,_actualFee) = {
493509 let traderFeesKey = getTraderFeesInPeriodKey(_amm, _trader, _weekId)
494510 let totalFeesKey = getTotalAmmFeesInPeriodKey(_amm, _weekId)
495511 let rewardAssets = getRewardAssetIds()
496512 let feesInPeriod = getFeesInPeriod(_amm, _trader, _weekId)
497513 let totalFeesInPeriod = getTotalFeesInPeriod(_amm, _weekId)
498514 let newFeesInPeriod = (feesInPeriod + _actualFee)
499515 let newTotalFeesInPeriod = (totalFeesInPeriod + _actualFee)
500516 func doHandleRewardAssetId (_acc,_assetId) = {
501517 let key = getAmmRewardRateKey(_amm, _assetId)
502518 if ((int0(key) > 0))
503519 then {
504520 let totalAssetFeesKey = getTotalAssetFeesInPeriodKey(_assetId, _weekId)
505521 (_acc :+ IntegerEntry(totalAssetFeesKey, (getTotalAssetFeesInPeriod(_assetId, _weekId) + _actualFee)))
506522 }
507523 else _acc
508524 }
509525
510526 let updateAssetFees = {
511527 let $l = rewardAssets
512528 let $s = size($l)
513529 let $acc0 = nil
514530 func $f0_1 ($a,$i) = if (($i >= $s))
515531 then $a
516532 else doHandleRewardAssetId($a, $l[$i])
517533
518534 func $f0_2 ($a,$i) = if (($i >= $s))
519535 then $a
520536 else throw("List size exceeds 10")
521537
522538 $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)
523539 }
524540 ([IntegerEntry(traderFeesKey, newFeesInPeriod), IntegerEntry(totalFeesKey, newTotalFeesInPeriod)] ++ updateAssetFees)
525541 }
526542
527543
528544 func updateAmmData (_amm,_trader,_weekId,_traderAverage,_traderLastNotional,_traderScore,_totalScore) = {
529545 let totalScoreInPeriodKey = getTotalScoreInPeriodKey(_amm, _weekId)
530546 let traderScoreInPeriodKey = getTraderScoreInPeriodKey(_amm, _trader, _weekId)
531547 let lastNotionalKey = getLastNotionalKey(_amm, _trader)
532548 let traderAverageNotionalInPeriodKey = getTraderAverageNotionalInPeriodKey(_amm, _trader, _weekId)
533549 [IntegerEntry(totalScoreInPeriodKey, _totalScore), IntegerEntry(traderScoreInPeriodKey, _traderScore), IntegerEntry(lastNotionalKey, _traderLastNotional), IntegerEntry(traderAverageNotionalInPeriodKey, _traderAverage)]
534550 }
535551
536552
537553 func getFeeDiscount (_trader) = {
538554 let tiers = getFeeTiers()
539555 let cumulativeVolume = getTraderCumulativeVolume(_trader)
540556 func findFee (_acc,_tier) = {
541- let $t01644516488 = _tier
542- let minCumulativeVolume = $t01644516488._1
543- let discount = $t01644516488._2
557+ let $t01723817281 = _tier
558+ let minCumulativeVolume = $t01723817281._1
559+ let discount = $t01723817281._2
544560 if ((cumulativeVolume >= minCumulativeVolume))
545561 then [discount]
546562 else _acc
547563 }
548564
549565 let resultList = {
550566 let $l = tiers
551567 let $s = size($l)
552568 let $acc0 = [NO_DISCOUNT]
553569 func $f0_1 ($a,$i) = if (($i >= $s))
554570 then $a
555571 else findFee($a, $l[$i])
556572
557573 func $f0_2 ($a,$i) = if (($i >= $s))
558574 then $a
559575 else throw("List size exceeds 5")
560576
561577 $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5)
562578 }
563579 resultList[0]
564580 }
565581
566582
567583 @Callable(i)
568584 func initialize (_coordinator,_oracle) = if (initialized())
569585 then throw("Already initialized")
570586 else [StringEntry(k_coordinatorAddress, _coordinator), StringEntry(k_oracleAddress, _oracle), BooleanEntry(k_initialized, true)]
571587
572588
573589
574590 @Callable(i)
575591 func setOracleAddress (_oracle) = if (if (!(initialized()))
576592 then true
577593 else (i.caller != adminAddress()))
578594 then throw("Invalid setOracleAddress parameters")
579595 else [StringEntry(k_oracleAddress, _oracle)]
580596
581597
582598
583599 @Callable(i)
584600 func view_getPeriod () = {
585601 let weekId = getWeekId(TIME)
586602 let weekStart = getWeekStart(weekId)
587603 let weekEnd = getWeekEnd(weekId)
588604 throw(((((toString(weekStart) + ",") + toString(weekEnd)) + ",") + toString(TIME)))
589605 }
590606
591607
592608
593609 @Callable(i)
594610 func view_getMaxAmountOfAssetToDistribute (_amm,_assetId,_weekId) = throw(toString(getMaxAmountOfAssetToDistribute(_amm, _assetId, _weekId)))
595611
596612
597613
598614 @Callable(i)
599615 func view_claimRewards (_trader,_assetId,_period) = throw(toString(totalRewardForTraderInAsset(_trader, _assetId, [_period])))
600616
601617
602618
603619 @Callable(i)
604620 func view_calcReward (_trader,_amm,_assetId,_period) = throw(toString(rewardForTraderInAssetInPeriod(_amm, _assetId, _trader, _period)))
605621
606622
607623
608624 @Callable(i)
609625 func view_claimAllRewards (_trader,_assetId,_periods) = {
610626 let result = claimAllRewardForPeriodForTrader(_trader, _assetId, _periods)
611627 throw(((toString(result._1) + ",") + toString(getTotalClaimedForTraderAndAsset(_trader, _assetId))))
612628 }
613629
614630
615631
616632 @Callable(i)
617633 func view_earnedRewards (_amm,_assetId,_period) = {
618634 let result = rewardForAmmInAssetInPeriod(_amm, _assetId, _period)
619635 throw(toString(result))
620636 }
621637
622638
623639
624640 @Callable(i)
625641 func claimAllRewards (_assetId,_periods) = {
626642 let trader = toString(i.caller)
627643 if (contains(_periods, toString(getWeekId(TIME))))
628644 then throw("Can not claim rewards for current week")
629645 else {
630- let $t01890718990 = claimAllRewardForPeriodForTrader(trader, _assetId, _periods)
631- let amount = $t01890718990._1
632- let result = $t01890718990._2
646+ let $t01970019783 = claimAllRewardForPeriodForTrader(trader, _assetId, _periods)
647+ let amount = $t01970019783._1
648+ let result = $t01970019783._2
633649 if ((amount == 0))
634650 then throw("Nothing to claim")
635651 else result
636652 }
637653 }
638654
639655
640656
641657 @Callable(i)
642658 func setFeeDiscountTiers (_discounts) = if (if (!(initialized()))
643659 then true
644660 else (i.caller != adminAddress()))
645661 then throw("Invalid setFeeDiscountTiers params")
646662 else [StringEntry(k_feeTiers, _discounts)]
647663
648664
649665
650666 @Callable(i)
651667 func attachRewardAsset (_assetId,_maxAmountPerPeriod) = if (if (!(initialized()))
652668 then true
653669 else (i.caller != adminAddress()))
654670 then throw("Invalid attachRewardAsset params")
655671 else {
656672 let amms = getAmms()
657673 let rewardAssetIds = getRewardAssetIds()
674+ let weekId = getWeekId(TIME)
658675 let newRewardAssetIds = if (containsElement(rewardAssetIds, _assetId))
659676 then rewardAssetIds
660677 else (rewardAssetIds :+ _assetId)
661-[IntegerEntry(getAssetMaxAmountPerPeriodKey(_assetId), _maxAmountPerPeriod), StringEntry(k_rewardAssetIds, listToStr(newRewardAssetIds))]
678+ let previousMaxAmountPerPeriod = getAssetMaxAmountPerPeriod(_assetId)
679+ let fix = if ((previousMaxAmountPerPeriod > 0))
680+ then {
681+ let key = getAssetLastUpdatedKey(_assetId)
682+ let prevUpdatedPeriod = valueOrElse(getInteger(this, key), 2736)
683+ func doFixAssetAmountAtPeriod (_acc,_increment) = {
684+ let fixWeekId = (prevUpdatedPeriod + _increment)
685+ if ((weekId > fixWeekId))
686+ then (_acc :+ IntegerEntry(getAssetMaxAmountPerDefinedPeriodKey(_assetId, fixWeekId), previousMaxAmountPerPeriod))
687+ else _acc
688+ }
689+
690+ let $l = WEEK_COUNT
691+ let $s = size($l)
692+ let $acc0 = nil
693+ func $f0_1 ($a,$i) = if (($i >= $s))
694+ then $a
695+ else doFixAssetAmountAtPeriod($a, $l[$i])
696+
697+ func $f0_2 ($a,$i) = if (($i >= $s))
698+ then $a
699+ else throw("List size exceeds 52")
700+
701+ $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($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), 31), 32), 33), 34), 35), 36), 37), 38), 39), 40), 41), 42), 43), 44), 45), 46), 47), 48), 49), 50), 51), 52)
702+ }
703+ else nil
704+ (fix ++ [IntegerEntry(getAssetMaxAmountPerPeriodKey(_assetId), _maxAmountPerPeriod), IntegerEntry(getAssetLastUpdatedKey(_assetId), weekId), StringEntry(k_rewardAssetIds, listToStr(newRewardAssetIds))])
662705 }
663706
664707
665708
666709 @Callable(i)
667710 func attachRewards (_amm,_assetId,_rewardRate) = if (if (if (!(initialized()))
668711 then true
669712 else (i.caller != adminAddress()))
670713 then true
671714 else !(isWhitelist(_amm)))
672715 then throw("Invalid attachRewards params")
673716 else {
674717 let amms = getAmms()
675718 let rewardAssetIds = getRewardAssetIds()
676719 let newAmms = if (containsElement(amms, _amm))
677720 then amms
678721 else (amms :+ _amm)
679722 let newRewardAssetIds = if (containsElement(rewardAssetIds, _assetId))
680723 then rewardAssetIds
681724 else (rewardAssetIds :+ _assetId)
682725 [IntegerEntry(getAmmRewardRateKey(_amm, _assetId), _rewardRate), StringEntry(k_amms, listToStr(newAmms)), StringEntry(k_rewardAssetIds, listToStr(newRewardAssetIds))]
683726 }
684727
685728
686729
687730 @Callable(i)
688731 func notifyFees (_trader,_fee) = {
689732 let amm = toString(i.caller)
690733 if (if (!(isWhitelist(amm)))
691734 then true
692735 else !(initialized()))
693736 then throw("Invalid notifyFees params")
694737 else {
695738 let actualFee = usdnToDecimals(_fee)
696739 let weekId = getWeekId(TIME)
697740 updateAmmFees(amm, _trader, weekId, actualFee)
698741 }
699742 }
700743
701744
702745
703746 @Callable(i)
704747 func notifyNotional (_trader,_notional) = {
705748 let amm = toString(i.caller)
706749 if (if (!(isWhitelist(amm)))
707750 then true
708751 else !(initialized()))
709752 then throw("Invalid notifyNotional params")
710753 else {
711754 let actualNotional = usdnToDecimals(_notional)
712755 let lastNotional = getLastNotional(amm, _trader)
713756 let weekId = getWeekId(TIME)
714757 let dayId = getDayId(TIME)
715758 let weekStart = getWeekStart(weekId)
716759 let weekEnd = getWeekEnd(weekId)
717760 let t = (weekEnd - weekStart)
718761 let oldRunningAverage = getTraderAverageNotionalInPeriod(amm, _trader, weekId, lastNotional)
719762 let w = divd((weekEnd - TIME), t)
720763 let oldTraderAmmScore = getTraderScoreInPeriod(amm, _trader, weekId)
721764 let oldTotalAmmScore = getTotalScoreInPeriod(amm, weekId)
722765 let fees = getFeesInPeriod(amm, _trader, weekId)
723766 let newRunningAverage = ((oldRunningAverage + muld(actualNotional, w)) - muld(lastNotional, w))
724767 let newTraderAmmScore = muld(powd(fees, A), powd(newRunningAverage, (DECIMAL_UNIT - A)))
725768 let newTotalAmmScoreInPeriod = ((oldTotalAmmScore - oldTraderAmmScore) + newTraderAmmScore)
726769 (updateAmmData(amm, _trader, weekId, newRunningAverage, actualNotional, newTraderAmmScore, newTotalAmmScoreInPeriod) ++ updateTraderVolume(_trader, dayId, abs((lastNotional - actualNotional))))
727770 }
728771 }
729772
730773
731774
732775 @Callable(i)
733776 func computeFeeDiscount (_trader) = {
734777 let result = getFeeDiscount(_trader)
735778 $Tuple2(nil, result)
736779 }
737780
738781
739782
740783 @Callable(i)
741784 func view_computeFeeDiscount (_trader) = {
742785 let result = getFeeDiscount(_trader)
743786 throw(toString(result))
744787 }
745788
746789
747790 @Verifier(tx)
748791 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey())
749792

github/deemru/w8io/169f3d6 
97.14 ms