tx · 9tUhaUtJn6YF5TVg6bMYz6cEn1E4z8jNScYoDaaHYMTE

3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG:  -0.01400000 Waves

2020.08.03 15:51 [1116197] smart account 3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG > SELF 0.00000000 Waves

{ "type": 13, "id": "9tUhaUtJn6YF5TVg6bMYz6cEn1E4z8jNScYoDaaHYMTE", "fee": 1400000, "feeAssetId": null, "timestamp": 1596459185120, "version": 1, "sender": "3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG", "senderPublicKey": "2WHjsmTCwLeerJuc5YMaJNou8UGSHuy4TE3F6DneRaJt", "proofs": [ "56EciJuM5soyBGp4aeVdMebBc3T4BSQmXieKEAt2q7Pn2a8gSiK171njZFAKddC52drLGGfmMEF5wDdgeTWfBzLc" ], "script": "base64:AAIDAAAAAAAAACIIARIHCgUICAgICBIHCgUBAQEBBBIDCgEIEgASAwoBCBIAAAAAMgAAAAAHQlVMTEtleQIAAAAGQlVMTElkAAAAAAdCRUFSS2V5AgAAAAZCRUFSSWQAAAAADG1haW5Ub2tlbktleQIAAAALbWFpblRva2VuSWQAAAAAEmlzc3VlUGVyY2VudGlsZUtleQIAAAAPaXNzdWVQZXJjZW50aWxlAAAAABNyZWRlZW1QZXJjZW50aWxlS2V5AgAAABByZWRlZW1QZXJjZW50aWxlAAAAAAttaW5Jc3N1ZUtleQIAAAAIbWluSXNzdWUAAAAADG1pblJlZGVlbUtleQIAAAAJbWluUmVkZWVtAAAAABB3aGl0ZWxpc3RPbmx5S2V5AgAAAA13aGl0ZWxpc3RPbmx5AAAAAAtvcmFjbGVQS0tleQIAAAAGb3JhY2xlAAAAABFsYXN0UHJpY2VJbmRleEtleQIAAAALcHJpY2VfaW5kZXgAAAAAEHByaWNlSW5kZXhQcmVmaXgCAAAADHByaWNlX2luZGV4XwAAAAARcHJpY2VIZWlnaHRQcmVmaXgCAAAABnByaWNlXwAAAAAab3JhY2xlQ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dIG5lZWQgdG8gd2FpdAMJAAAAAAAAAgUAAAAKcHJpY2VJbmRleAUAAAAUcmViYWxhbmNlZFByaWNlSW5kZXgJAQAAAAdkZXF1ZXVlAAAAAAkAAAIAAAABAgAAADBjb3JydXB0IGRhdGEsIGZ1dHVyZSBwcmljZSBpZCBhbHJlYWR5IHJlYmFsYW5jZWQAAAAAdLu9Qw==", "chainId": 84, "height": 1116197, "spentComplexity": 0 } View: original | compacted Prev: 7WEFUJug9eGL7X9P5obhaTq9Kfc8UPSzTG8A9DiUJZDN Next: 6r9GJCVKHSTieZPQzysTH4SncsbqC2CzRCMZdy85Lqxz Diff:
OldNewDifferences
1919
2020 let oraclePKKey = "oracle"
2121
22-let oracleCurrentPriceIdKey = "lastPriceId"
22+let lastPriceIndexKey = "price_index"
2323
24-let lastRebalancePriceIdKey = "lastSettlementPriceId"
24+let priceIndexPrefix = "price_index_"
25+
26+let priceHeightPrefix = "price_"
27+
28+let oracleCurrentPriceIndexKey = "price_index"
29+
30+let lastRebalancePriceIndexKey = "lastSettlementPriceId"
2531
2632 let bullCollateralKey = "bullCollateral"
2733
6167
6268 let oracle = valueOrErrorMessage(addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, oraclePKKey), "no oraclePKKey"))), "bad oracle address")
6369
64-let rebalancedPriceId = valueOrErrorMessage(getInteger(this, lastRebalancePriceIdKey), "no last rebalance price")
70+let rebalancedPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "no last rebalance price")
6571
66-let oraclePriceId = valueOrErrorMessage(getInteger(oracle, oracleCurrentPriceIdKey), "bad oracle data")
72+let oraclePriceIndex = valueOrErrorMessage(getInteger(oracle, oracleCurrentPriceIndexKey), "bad oracle data")
6773
6874 let headPointerKey = "headPointer"
6975
105111
106112 let REDEEM = "REDEEM"
107113
108-func buildNewItem (action,amt,token,priceId,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceId)) + "|") + invoker) + "|")
114+func buildNewItem (action,amt,token,priceIndex,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceIndex)) + "|") + invoker) + "|")
109115
110116
111117 func validateEnqueue (inv) = if ((inv.caller == this))
137143 }
138144
139145
140-func enqueue (id,action,amt,token,priceId,invoker) = {
146+func enqueue (id,action,amt,token,priceIndex,invoker) = {
141147 let increaseQueueSize = DataEntry(queueSizeKey, (queueSize + 1))
142- let itm = buildNewItem(action, amt, token, priceId, invoker)
148+ let itm = buildNewItem(action, amt, token, priceIndex, invoker)
143149 if ((queueSize == 0))
144150 then WriteSet([DataEntry(headPointerKey, id), DataEntry(tailPointerKey, id), DataEntry(id, itm), increaseQueueSize])
145151 else {
163169 let action = data[0]
164170 let amt = parseIntValue(data[1])
165171 let token = data[2]
166- let priceId = parseIntValue(data[3])
172+ let priceIndex = parseIntValue(data[3])
167173 let invoker = addressFromStringValue(data[4])
168174 let next = data[5]
169- if ((rebalancedPriceId > priceId))
170- then throw(((("corrupt state, rebalancedPriceId=" + toString(rebalancedPriceId)) + ", request price id=") + toString(priceId)))
171- else if ((priceId > rebalancedPriceId))
175+ if ((rebalancedPriceIndex > priceIndex))
176+ then throw(((("corrupt state, rebalancedPriceIndex=" + toString(rebalancedPriceIndex)) + ", request price id=") + toString(priceIndex)))
177+ else if ((priceIndex > rebalancedPriceIndex))
172178 then throw("can't dequeue, too early, rebalance first")
173179 else if ((action == ISSUE))
174180 then {
239245 fraction(v, ((6 * a) + b), ((7 * a) + b))
240246 }
241247
242- let settledPriceId = valueOrErrorMessage(getInteger(this, lastRebalancePriceIdKey), "inconsistent data")
243- let unsettledPriceId = (settledPriceId + 1)
244- let settledPrice = valueOrErrorMessage(getInteger(oracle, toString(settledPriceId)), "bad oracle data for sellted price")
245- let nextPrice = valueOrErrorMessage(getInteger(oracle, toString(unsettledPriceId)), "no next price")
248+ let settledPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "inconsistent data")
249+ let unsettledPriceIndex = (settledPriceIndex + 1)
250+ let settledPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(settledPriceIndex))), "bad oracle data for settled price height")
251+ let settledPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(settledPriceHeight))), "bad oracle data for price")
252+ let nextPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(unsettledPriceIndex))), "no next price height")
253+ let nextPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(nextPriceHeight))), "no next price")
246254 let minVol = if ((bearCol > bullCol))
247255 then bullCol
248256 else bearCol
249257 let redist = LV(minVol, settledPrice, nextPrice)
250258 if ((nextPrice > settledPrice))
251- then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
259+ then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
252260 else if ((settledPrice > nextPrice))
253- then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
254- else WriteSet([DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
261+ then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
262+ else WriteSet([DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
255263 }
256264
257265
271279 else (bulls == 0))
272280 then throw("can't init balances")
273281 else {
274- let oracleCurrentPriceId = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), oracleCurrentPriceIdKey), "can't find oracle price id")
275- ScriptResult(WriteSet([DataEntry(BULLKey, bullId), DataEntry(BEARKey, bearId), DataEntry(mainTokenKey, mainTokenId), DataEntry(oraclePKKey, oraclePK), DataEntry(bullCollateralKey, bulls), DataEntry(bearCollateralKey, bears), DataEntry(bullCirculationKey, bulls), DataEntry(bearCirculationKey, bears), DataEntry(lastRebalancePriceIdKey, oracleCurrentPriceId), DataEntry(whitelistKey, whitelisted), DataEntry(issuePercentileKey, 0), DataEntry(redeemPercentileKey, 0), DataEntry(minIssueKey, 0), DataEntry(minRedeemKey, 0), DataEntry(whitelistOnlyKey, true)]), TransferSet([ScriptTransfer(inv.caller, bulls, fromBase58String(bullId)), ScriptTransfer(inv.caller, bears, fromBase58String(bearId))]))
282+ let oracleCurrentPriceIndex = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), oracleCurrentPriceIndexKey), "can't find oracle price id")
283+ ScriptResult(WriteSet([DataEntry(BULLKey, bullId), DataEntry(BEARKey, bearId), DataEntry(mainTokenKey, mainTokenId), DataEntry(oraclePKKey, oraclePK), DataEntry(bullCollateralKey, bulls), DataEntry(bearCollateralKey, bears), DataEntry(bullCirculationKey, bulls), DataEntry(bearCirculationKey, bears), DataEntry(lastRebalancePriceIndexKey, oracleCurrentPriceIndex), DataEntry(whitelistKey, whitelisted), DataEntry(issuePercentileKey, 0), DataEntry(redeemPercentileKey, 0), DataEntry(minIssueKey, 0), DataEntry(minRedeemKey, 0), DataEntry(whitelistOnlyKey, true)]), TransferSet([ScriptTransfer(inv.caller, bulls, fromBase58String(bullId)), ScriptTransfer(inv.caller, bears, fromBase58String(bearId))]))
276284 }
277285 }
278286
296304 func requestRedeem () = if ((validateEnqueue(inv) == unit))
297305 then {
298306 let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here"))
299- enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceId + 1), toString(inv.caller))
307+ enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceIndex + 1), toString(inv.caller))
300308 }
301309 else throw("doesn't happen")
302310
321329 then errorMessage
322330 else if ((minIssue > value(inv.payment).amount))
323331 then throw((("Attached payment too small. Min required: " + toString((minIssue / 1000000))) + " USDN"))
324- else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceId + 1), toString(inv.caller))
332+ else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceIndex + 1), toString(inv.caller))
325333 }
326334
327335
329337 @Callable(inv)
330338 func settle () = {
331339 let queueEmpty = (headPointer == "")
332- let canRebalance = (oraclePriceId > rebalancedPriceId)
340+ let canRebalance = (oraclePriceIndex > rebalancedPriceIndex)
333341 if (queueEmpty)
334342 then if (canRebalance)
335343 then rebalance()
336344 else throw("[OK] all done, carry on")
337345 else {
338346 let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|")
339- let priceId = parseIntValue(data[3])
340- if ((priceId > rebalancedPriceId))
347+ let priceIndex = parseIntValue(data[3])
348+ if ((priceIndex > rebalancedPriceIndex))
341349 then if (canRebalance)
342350 then rebalance()
343351 else throw("[OK] need to wait")
344- else if ((priceId == rebalancedPriceId))
352+ else if ((priceIndex == rebalancedPriceIndex))
345353 then dequeue()
346354 else throw("corrupt data, future price id already rebalanced")
347355 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BULLKey = "BULLId"
55
66 let BEARKey = "BEARId"
77
88 let mainTokenKey = "mainTokenId"
99
1010 let issuePercentileKey = "issuePercentile"
1111
1212 let redeemPercentileKey = "redeemPercentile"
1313
1414 let minIssueKey = "minIssue"
1515
1616 let minRedeemKey = "minRedeem"
1717
1818 let whitelistOnlyKey = "whitelistOnly"
1919
2020 let oraclePKKey = "oracle"
2121
22-let oracleCurrentPriceIdKey = "lastPriceId"
22+let lastPriceIndexKey = "price_index"
2323
24-let lastRebalancePriceIdKey = "lastSettlementPriceId"
24+let priceIndexPrefix = "price_index_"
25+
26+let priceHeightPrefix = "price_"
27+
28+let oracleCurrentPriceIndexKey = "price_index"
29+
30+let lastRebalancePriceIndexKey = "lastSettlementPriceId"
2531
2632 let bullCollateralKey = "bullCollateral"
2733
2834 let bearCollateralKey = "bearCollateral"
2935
3036 let bullCirculationKey = "bullCirculation"
3137
3238 let bearCirculationKey = "bearCirculation"
3339
3440 let whitelistKey = "issueWhiteList"
3541
3642 let whitelist = valueOrErrorMessage(getString(this, whitelistKey), "no bullCollateralKey")
3743
3844 let bullCol = valueOrErrorMessage(getInteger(this, bullCollateralKey), "no bullCollateralKey")
3945
4046 let bearCol = valueOrErrorMessage(getInteger(this, bearCollateralKey), "no bearCollateralKey")
4147
4248 let bullCirc = valueOrErrorMessage(getInteger(this, bullCirculationKey), "no bullCirculationKey")
4349
4450 let bearCirc = valueOrErrorMessage(getInteger(this, bearCirculationKey), "no bearCirculationKey")
4551
4652 let BULL = valueOrErrorMessage(getString(this, BULLKey), "no BULLKey")
4753
4854 let BEAR = valueOrErrorMessage(getString(this, BEARKey), "no BEARKey")
4955
5056 let mainToken = valueOrErrorMessage(getString(this, mainTokenKey), "no mainTokenKey")
5157
5258 let issuePercentile = valueOrErrorMessage(getInteger(this, issuePercentileKey), "no issuePercentileKey")
5359
5460 let redeemPercentile = valueOrErrorMessage(getInteger(this, redeemPercentileKey), "no redeemPercentileKey")
5561
5662 let minIssue = valueOrErrorMessage(getInteger(this, minIssueKey), "no minIssueKey")
5763
5864 let minRedeem = valueOrErrorMessage(getInteger(this, minRedeemKey), "no minRedeemKey")
5965
6066 let whitelistOnly = valueOrErrorMessage(getBoolean(this, whitelistOnlyKey), "no whitelistOnlyKey")
6167
6268 let oracle = valueOrErrorMessage(addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, oraclePKKey), "no oraclePKKey"))), "bad oracle address")
6369
64-let rebalancedPriceId = valueOrErrorMessage(getInteger(this, lastRebalancePriceIdKey), "no last rebalance price")
70+let rebalancedPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "no last rebalance price")
6571
66-let oraclePriceId = valueOrErrorMessage(getInteger(oracle, oracleCurrentPriceIdKey), "bad oracle data")
72+let oraclePriceIndex = valueOrErrorMessage(getInteger(oracle, oracleCurrentPriceIndexKey), "bad oracle data")
6773
6874 let headPointerKey = "headPointer"
6975
7076 let tailPointerKey = "tailPointer"
7177
7278 let queueSizeKey = "queueSize"
7379
7480 let queueSize = match getInteger(this, queueSizeKey) {
7581 case i: Int =>
7682 i
7783 case _ =>
7884 0
7985 }
8086
8187 let headPointer = match getString(this, headPointerKey) {
8288 case s: String =>
8389 s
8490 case _ =>
8591 ""
8692 }
8793
8894 let tailPointer = match getString(this, tailPointerKey) {
8995 case s: String =>
9096 s
9197 case _ =>
9298 ""
9399 }
94100
95101 let feesAccumulatedKey = "feesAccumulated"
96102
97103 let feesAccumulated = match getInteger(this, feesAccumulatedKey) {
98104 case i: Int =>
99105 i
100106 case _ =>
101107 0
102108 }
103109
104110 let ISSUE = "ISSUE"
105111
106112 let REDEEM = "REDEEM"
107113
108-func buildNewItem (action,amt,token,priceId,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceId)) + "|") + invoker) + "|")
114+func buildNewItem (action,amt,token,priceIndex,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceIndex)) + "|") + invoker) + "|")
109115
110116
111117 func validateEnqueue (inv) = if ((inv.caller == this))
112118 then throw("can't do")
113119 else {
114120 func errorMessage (got) = throw(((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are accepted, received: ") + got))
115121
116122 if (!(isDefined(inv.payment)))
117123 then errorMessage("no attached payment")
118124 else {
119125 let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here"))
120126 if (if ((assetId != BEAR))
121127 then (assetId != BULL)
122128 else false)
123129 then errorMessage(assetId)
124130 else {
125131 let col = if ((assetId == BEAR))
126132 then bearCol
127133 else bullCol
128134 let circ = if ((assetId == BEAR))
129135 then bearCirc
130136 else bearCirc
131137 let estimated = fraction(col, value(inv.payment).amount, circ)
132138 if ((minRedeem > estimated))
133139 then throw((("Attached payment too small. Min redeem amount is " + toString((minRedeem / 1000000))) + " USDN"))
134140 else unit
135141 }
136142 }
137143 }
138144
139145
140-func enqueue (id,action,amt,token,priceId,invoker) = {
146+func enqueue (id,action,amt,token,priceIndex,invoker) = {
141147 let increaseQueueSize = DataEntry(queueSizeKey, (queueSize + 1))
142- let itm = buildNewItem(action, amt, token, priceId, invoker)
148+ let itm = buildNewItem(action, amt, token, priceIndex, invoker)
143149 if ((queueSize == 0))
144150 then WriteSet([DataEntry(headPointerKey, id), DataEntry(tailPointerKey, id), DataEntry(id, itm), increaseQueueSize])
145151 else {
146152 let prevId = valueOrErrorMessage(getString(this, tailPointerKey), "can't get tail pointer")
147153 let prevItm = split(valueOrErrorMessage(getString(this, prevId), "can't resolve pointer"), "|")
148154 let updatedPrevItm = ((((((((((prevItm[0] + "|") + prevItm[1]) + "|") + prevItm[2]) + "|") + prevItm[3]) + "|") + prevItm[4]) + "|") + id)
149155 WriteSet([DataEntry(prevId, updatedPrevItm), DataEntry(id, itm), DataEntry(tailPointerKey, id), increaseQueueSize])
150156 }
151157 }
152158
153159
154160 func dequeue () = if ((queueSize == 0))
155161 then throw("nothing to settle")
156162 else {
157163 func collectFee (fees) = DataEntry(feesAccumulatedKey, (feesAccumulated + fees))
158164
159165 let decreaseQueueSize = DataEntry(queueSizeKey, (queueSize - 1))
160166 let isLastElement = (headPointer == tailPointer)
161167 let overwriteTail = DataEntry(tailPointerKey, "")
162168 let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|")
163169 let action = data[0]
164170 let amt = parseIntValue(data[1])
165171 let token = data[2]
166- let priceId = parseIntValue(data[3])
172+ let priceIndex = parseIntValue(data[3])
167173 let invoker = addressFromStringValue(data[4])
168174 let next = data[5]
169- if ((rebalancedPriceId > priceId))
170- then throw(((("corrupt state, rebalancedPriceId=" + toString(rebalancedPriceId)) + ", request price id=") + toString(priceId)))
171- else if ((priceId > rebalancedPriceId))
175+ if ((rebalancedPriceIndex > priceIndex))
176+ then throw(((("corrupt state, rebalancedPriceIndex=" + toString(rebalancedPriceIndex)) + ", request price id=") + toString(priceIndex)))
177+ else if ((priceIndex > rebalancedPriceIndex))
172178 then throw("can't dequeue, too early, rebalance first")
173179 else if ((action == ISSUE))
174180 then {
175181 let feeSize = fraction(amt, issuePercentile, 10000)
176182 let addedCollateral = (amt - feeSize)
177183 if ((token == BULL))
178184 then {
179185 let addedToCirculation = fraction(bullCirc, addedCollateral, bullCol)
180186 let items = [DataEntry(bullCollateralKey, (bullCol + addedCollateral)), DataEntry(bullCirculationKey, (bullCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
181187 ScriptResult(WriteSet(if (isLastElement)
182188 then overwriteTail :: items
183189 else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BULL))]))
184190 }
185191 else if ((token == BEAR))
186192 then {
187193 let addedToCirculation = fraction(bearCirc, addedCollateral, bearCol)
188194 let items = [DataEntry(bearCollateralKey, (bearCol + addedCollateral)), DataEntry(bearCirculationKey, (bearCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
189195 ScriptResult(WriteSet(if (isLastElement)
190196 then overwriteTail :: items
191197 else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BEAR))]))
192198 }
193199 else throw("bad token id")
194200 }
195201 else if ((action == REDEEM))
196202 then {
197203 let removedTokens = amt
198204 if ((token == BULL))
199205 then {
200206 let removedCollateral = fraction(bullCol, removedTokens, bullCirc)
201207 let feeSize = fraction(removedCollateral, redeemPercentile, 10000)
202208 let payout = if ((removedCollateral > feeSize))
203209 then (removedCollateral - feeSize)
204210 else 0
205211 let items = [DataEntry(bullCollateralKey, (bullCol - removedCollateral)), DataEntry(bullCirculationKey, (bullCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
206212 ScriptResult(WriteSet(if (isLastElement)
207213 then overwriteTail :: items
208214 else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))]))
209215 }
210216 else if ((token == BEAR))
211217 then {
212218 let removedCollateral = fraction(bearCol, removedTokens, bearCirc)
213219 let feeSize = fraction(removedCollateral, redeemPercentile, 10000)
214220 let payout = if ((removedCollateral > feeSize))
215221 then (removedCollateral - feeSize)
216222 else 0
217223 let items = [DataEntry(bearCollateralKey, (bearCol - removedCollateral)), DataEntry(bearCirculationKey, (bearCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize]
218224 ScriptResult(WriteSet(if (isLastElement)
219225 then overwriteTail :: items
220226 else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))]))
221227 }
222228 else throw("bad token id")
223229 }
224230 else throw(("bad action: " + action))
225231 }
226232
227233
228234 func rebalance () = {
229235 func LV (v,p0,p1) = {
230236 let denom = 100
231237 let pmax = ((if ((p1 > p0))
232238 then p1
233239 else p0) / denom)
234240 let pmin = ((if ((p0 > p1))
235241 then p1
236242 else p0) / denom)
237243 let a = (pmin * pmin)
238244 let b = (((9 * pmax) * pmax) - ((15 * pmax) * pmin))
239245 fraction(v, ((6 * a) + b), ((7 * a) + b))
240246 }
241247
242- let settledPriceId = valueOrErrorMessage(getInteger(this, lastRebalancePriceIdKey), "inconsistent data")
243- let unsettledPriceId = (settledPriceId + 1)
244- let settledPrice = valueOrErrorMessage(getInteger(oracle, toString(settledPriceId)), "bad oracle data for sellted price")
245- let nextPrice = valueOrErrorMessage(getInteger(oracle, toString(unsettledPriceId)), "no next price")
248+ let settledPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "inconsistent data")
249+ let unsettledPriceIndex = (settledPriceIndex + 1)
250+ let settledPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(settledPriceIndex))), "bad oracle data for settled price height")
251+ let settledPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(settledPriceHeight))), "bad oracle data for price")
252+ let nextPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(unsettledPriceIndex))), "no next price height")
253+ let nextPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(nextPriceHeight))), "no next price")
246254 let minVol = if ((bearCol > bullCol))
247255 then bullCol
248256 else bearCol
249257 let redist = LV(minVol, settledPrice, nextPrice)
250258 if ((nextPrice > settledPrice))
251- then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
259+ then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
252260 else if ((settledPrice > nextPrice))
253- then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
254- else WriteSet([DataEntry(lastRebalancePriceIdKey, unsettledPriceId)])
261+ then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
262+ else WriteSet([DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)])
255263 }
256264
257265
258266 @Callable(inv)
259267 func init (bullId,bearId,mainTokenId,oraclePK,whitelisted) = if (isDefined(getString(this, BULLKey)))
260268 then throw("already initialized")
261269 else if (!(isDefined(inv.payment)))
262270 then throw("neutrino payment required")
263271 else if ((toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "neutrino payment required")) != mainTokenId))
264272 then throw("payment not in neutrino")
265273 else {
266274 let totalOwnedMainToken = value(inv.payment).amount
267275 let bulls = (totalOwnedMainToken / 2)
268276 let bears = (totalOwnedMainToken - bulls)
269277 if (if ((bears == 0))
270278 then true
271279 else (bulls == 0))
272280 then throw("can't init balances")
273281 else {
274- let oracleCurrentPriceId = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), oracleCurrentPriceIdKey), "can't find oracle price id")
275- ScriptResult(WriteSet([DataEntry(BULLKey, bullId), DataEntry(BEARKey, bearId), DataEntry(mainTokenKey, mainTokenId), DataEntry(oraclePKKey, oraclePK), DataEntry(bullCollateralKey, bulls), DataEntry(bearCollateralKey, bears), DataEntry(bullCirculationKey, bulls), DataEntry(bearCirculationKey, bears), DataEntry(lastRebalancePriceIdKey, oracleCurrentPriceId), DataEntry(whitelistKey, whitelisted), DataEntry(issuePercentileKey, 0), DataEntry(redeemPercentileKey, 0), DataEntry(minIssueKey, 0), DataEntry(minRedeemKey, 0), DataEntry(whitelistOnlyKey, true)]), TransferSet([ScriptTransfer(inv.caller, bulls, fromBase58String(bullId)), ScriptTransfer(inv.caller, bears, fromBase58String(bearId))]))
282+ let oracleCurrentPriceIndex = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), oracleCurrentPriceIndexKey), "can't find oracle price id")
283+ ScriptResult(WriteSet([DataEntry(BULLKey, bullId), DataEntry(BEARKey, bearId), DataEntry(mainTokenKey, mainTokenId), DataEntry(oraclePKKey, oraclePK), DataEntry(bullCollateralKey, bulls), DataEntry(bearCollateralKey, bears), DataEntry(bullCirculationKey, bulls), DataEntry(bearCirculationKey, bears), DataEntry(lastRebalancePriceIndexKey, oracleCurrentPriceIndex), DataEntry(whitelistKey, whitelisted), DataEntry(issuePercentileKey, 0), DataEntry(redeemPercentileKey, 0), DataEntry(minIssueKey, 0), DataEntry(minRedeemKey, 0), DataEntry(whitelistOnlyKey, true)]), TransferSet([ScriptTransfer(inv.caller, bulls, fromBase58String(bullId)), ScriptTransfer(inv.caller, bears, fromBase58String(bearId))]))
276284 }
277285 }
278286
279287
280288
281289 @Callable(i)
282290 func setParams (iP,rP,mI,mR,wl) = if ((i.caller != this))
283291 then throw("only self can change whitelist")
284292 else WriteSet([DataEntry(issuePercentileKey, iP), DataEntry(redeemPercentileKey, rP), DataEntry(minIssueKey, mI), DataEntry(minRedeemKey, mR), DataEntry(whitelistOnlyKey, wl)])
285293
286294
287295
288296 @Callable(i)
289297 func setWhitelist (l) = if ((i.caller != this))
290298 then throw("only self can change whitelist")
291299 else WriteSet([DataEntry(whitelistKey, l)])
292300
293301
294302
295303 @Callable(inv)
296304 func requestRedeem () = if ((validateEnqueue(inv) == unit))
297305 then {
298306 let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here"))
299- enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceId + 1), toString(inv.caller))
307+ enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceIndex + 1), toString(inv.caller))
300308 }
301309 else throw("doesn't happen")
302310
303311
304312
305313 @Callable(inv)
306314 func requestIssue (tokenId) = if ((inv.caller == this))
307315 then throw("can't do")
308316 else if (if (whitelistOnly)
309317 then !(isDefined(indexOf(whitelist, toString(inv.caller))))
310318 else false)
311319 then throw("only whitelisted can do")
312320 else {
313321 let errorMessage = throw((((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are available in exchange for USDN(") + mainToken) + ")"))
314322 if (if ((tokenId != BULL))
315323 then (tokenId != BEAR)
316324 else false)
317325 then errorMessage
318326 else if (!(isDefined(inv.payment)))
319327 then errorMessage
320328 else if ((value(inv.payment).assetId != fromBase58String(mainToken)))
321329 then errorMessage
322330 else if ((minIssue > value(inv.payment).amount))
323331 then throw((("Attached payment too small. Min required: " + toString((minIssue / 1000000))) + " USDN"))
324- else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceId + 1), toString(inv.caller))
332+ else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceIndex + 1), toString(inv.caller))
325333 }
326334
327335
328336
329337 @Callable(inv)
330338 func settle () = {
331339 let queueEmpty = (headPointer == "")
332- let canRebalance = (oraclePriceId > rebalancedPriceId)
340+ let canRebalance = (oraclePriceIndex > rebalancedPriceIndex)
333341 if (queueEmpty)
334342 then if (canRebalance)
335343 then rebalance()
336344 else throw("[OK] all done, carry on")
337345 else {
338346 let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|")
339- let priceId = parseIntValue(data[3])
340- if ((priceId > rebalancedPriceId))
347+ let priceIndex = parseIntValue(data[3])
348+ if ((priceIndex > rebalancedPriceIndex))
341349 then if (canRebalance)
342350 then rebalance()
343351 else throw("[OK] need to wait")
344- else if ((priceId == rebalancedPriceId))
352+ else if ((priceIndex == rebalancedPriceIndex))
345353 then dequeue()
346354 else throw("corrupt data, future price id already rebalanced")
347355 }
348356 }
349357
350358

github/deemru/w8io/026f985 
61.90 ms