tx · 4WAtGQGcVKHkVnmvUufbKWDY8sogrvwDUu1GLPEwfoCr 3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG: -0.01400000 Waves 2020.08.03 17:28 [1116308] smart account 3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG > SELF 0.00000000 Waves
{ "type": 13, "id": "4WAtGQGcVKHkVnmvUufbKWDY8sogrvwDUu1GLPEwfoCr", "fee": 1400000, "feeAssetId": null, "timestamp": 1596464897170, "version": 1, "sender": "3Mtzn1SRUhygEXMVpHNMckc8HKCWjq2fTiG", "senderPublicKey": "2WHjsmTCwLeerJuc5YMaJNou8UGSHuy4TE3F6DneRaJt", "proofs": [ "42c6kUtpagEWu7saTWkRgAsZgNcFg6ThBwUWd9EyPvrxwgm1FbdMiLgphgTmboZpJroRbhM1wzCd8x7abxYh4xMr" ], "script": "base64:AAIDAAAAAAAAACIIARIHCgUICAgICBIHCgUBAQEBBBIDCgEIEgASAwoBCBIAAAAAMgAAAAAHQlVMTEtleQIAAAAGQlVMTElkAAAAAAdCRUFSS2V5AgAAAAZCRUFSSWQAAAAADG1haW5Ub2tlbktleQIAAAALbWFpblRva2VuSWQAAAAAEmlzc3VlUGVyY2VudGlsZUtleQIAAAAPaXNzdWVQZXJjZW50aWxlAAAAABNyZWRlZW1QZXJjZW50aWxlS2V5AgAAABByZWRlZW1QZXJjZW50aWxlAAAAAAttaW5Jc3N1ZUtleQIAAAAIbWluSXNzdWUAAAAADG1pblJlZGVlbUtleQIAAAAJbWluUmVkZWVtAAAAABB3aGl0ZWxpc3RPbmx5S2V5AgAAAA13aGl0ZWxpc3RPbmx5AAAAAAtvcmFjbGVQS0tleQIAAAAGb3JhY2xlAAAAABFsYXN0UHJpY2VJbmRleEtleQIAAAALcHJpY2VfaW5kZXgAAAAAEHByaWNlSW5kZXhQcmVmaXgCAAAADHByaWNlX2luZGV4XwAAAAARcHJpY2VIZWlnaHRQcmVmaXgCAAAABnByaWNlXwAAAAAab3JhY2xlQ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IGFsbCBkb25lLCBjYXJyeSBvbgQAAAAEZGF0YQkABLUAAAACCQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIJAAQdAAAAAgUAAAAEdGhpcwUAAAALaGVhZFBvaW50ZXICAAAAEGJhZCBoZWFkIHBvaW50ZXICAAAAAXwEAAAACnByaWNlSW5kZXgJAQAAAA1wYXJzZUludFZhbHVlAAAAAQkAAZEAAAACBQAAAARkYXRhAAAAAAAAAAADAwkAAGYAAAACBQAAAApwcmljZUluZGV4BQAAABRyZWJhbGFuY2VkUHJpY2VJbmRleAMFAAAADGNhblJlYmFsYW5jZQkBAAAACXJlYmFsYW5jZQAAAAAJAAACAAAAAQIAAAARW09LXSBuZWVkIHRvIHdhaXQDCQAAAAAAAAIFAAAACnByaWNlSW5kZXgFAAAAFHJlYmFsYW5jZWRQcmljZUluZGV4CQEAAAAHZGVxdWV1ZQAAAAAJAAACAAAAAQIAAAAwY29ycnVwdCBkYXRhLCBmdXR1cmUgcHJpY2UgaWQgYWxyZWFkeSByZWJhbGFuY2VkAAAAAHq5j2w=", "chainId": 84, "height": 1116308, "spentComplexity": 0 } View: original | compacted Prev: C1Q5XwVgGf6BBHdYevvLsPYnd6Y7LhDdKMGDfhhee56W Next: none Diff:
Old | New | Differences | |
---|---|---|---|
134 | 134 | else bullCol | |
135 | 135 | let circ = if ((assetId == BEAR)) | |
136 | 136 | then bearCirc | |
137 | - | else | |
137 | + | else bullCirc | |
138 | 138 | let estimated = fraction(col, attachedAmount, circ) | |
139 | 139 | if ((minRedeem > estimated)) | |
140 | 140 | then throw((((((((((("Attached payment too small. Min redeem amount is " + toString((minRedeem / 1000000))) + " USDN, ") + "attached amount: ") + toString(attachedAmount)) + ", col: ") + toString(col)) + ", circ: ") + toString(circ)) + ", estimated: ") + toString(estimated))) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let BULLKey = "BULLId" | |
5 | 5 | ||
6 | 6 | let BEARKey = "BEARId" | |
7 | 7 | ||
8 | 8 | let mainTokenKey = "mainTokenId" | |
9 | 9 | ||
10 | 10 | let issuePercentileKey = "issuePercentile" | |
11 | 11 | ||
12 | 12 | let redeemPercentileKey = "redeemPercentile" | |
13 | 13 | ||
14 | 14 | let minIssueKey = "minIssue" | |
15 | 15 | ||
16 | 16 | let minRedeemKey = "minRedeem" | |
17 | 17 | ||
18 | 18 | let whitelistOnlyKey = "whitelistOnly" | |
19 | 19 | ||
20 | 20 | let oraclePKKey = "oracle" | |
21 | 21 | ||
22 | 22 | let lastPriceIndexKey = "price_index" | |
23 | 23 | ||
24 | 24 | let priceIndexPrefix = "price_index_" | |
25 | 25 | ||
26 | 26 | let priceHeightPrefix = "price_" | |
27 | 27 | ||
28 | 28 | let oracleCurrentPriceIndexKey = "price_index" | |
29 | 29 | ||
30 | 30 | let lastRebalancePriceIndexKey = "lastSettlementPriceId" | |
31 | 31 | ||
32 | 32 | let bullCollateralKey = "bullCollateral" | |
33 | 33 | ||
34 | 34 | let bearCollateralKey = "bearCollateral" | |
35 | 35 | ||
36 | 36 | let bullCirculationKey = "bullCirculation" | |
37 | 37 | ||
38 | 38 | let bearCirculationKey = "bearCirculation" | |
39 | 39 | ||
40 | 40 | let whitelistKey = "issueWhiteList" | |
41 | 41 | ||
42 | 42 | let whitelist = valueOrErrorMessage(getString(this, whitelistKey), "no bullCollateralKey") | |
43 | 43 | ||
44 | 44 | let bullCol = valueOrErrorMessage(getInteger(this, bullCollateralKey), "no bullCollateralKey") | |
45 | 45 | ||
46 | 46 | let bearCol = valueOrErrorMessage(getInteger(this, bearCollateralKey), "no bearCollateralKey") | |
47 | 47 | ||
48 | 48 | let bullCirc = valueOrErrorMessage(getInteger(this, bullCirculationKey), "no bullCirculationKey") | |
49 | 49 | ||
50 | 50 | let bearCirc = valueOrErrorMessage(getInteger(this, bearCirculationKey), "no bearCirculationKey") | |
51 | 51 | ||
52 | 52 | let BULL = valueOrErrorMessage(getString(this, BULLKey), "no BULLKey") | |
53 | 53 | ||
54 | 54 | let BEAR = valueOrErrorMessage(getString(this, BEARKey), "no BEARKey") | |
55 | 55 | ||
56 | 56 | let mainToken = valueOrErrorMessage(getString(this, mainTokenKey), "no mainTokenKey") | |
57 | 57 | ||
58 | 58 | let issuePercentile = valueOrErrorMessage(getInteger(this, issuePercentileKey), "no issuePercentileKey") | |
59 | 59 | ||
60 | 60 | let redeemPercentile = valueOrErrorMessage(getInteger(this, redeemPercentileKey), "no redeemPercentileKey") | |
61 | 61 | ||
62 | 62 | let minIssue = valueOrErrorMessage(getInteger(this, minIssueKey), "no minIssueKey") | |
63 | 63 | ||
64 | 64 | let minRedeem = valueOrErrorMessage(getInteger(this, minRedeemKey), "no minRedeemKey") | |
65 | 65 | ||
66 | 66 | let whitelistOnly = valueOrErrorMessage(getBoolean(this, whitelistOnlyKey), "no whitelistOnlyKey") | |
67 | 67 | ||
68 | 68 | let oracle = valueOrErrorMessage(addressFromPublicKey(fromBase58String(valueOrErrorMessage(getString(this, oraclePKKey), "no oraclePKKey"))), "bad oracle address") | |
69 | 69 | ||
70 | 70 | let rebalancedPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "no last rebalance price") | |
71 | 71 | ||
72 | 72 | let oraclePriceIndex = valueOrErrorMessage(getInteger(oracle, lastPriceIndexKey), ((("bad oracle data at " + toString(oracle)) + ": no integer at ") + lastPriceIndexKey)) | |
73 | 73 | ||
74 | 74 | let headPointerKey = "headPointer" | |
75 | 75 | ||
76 | 76 | let tailPointerKey = "tailPointer" | |
77 | 77 | ||
78 | 78 | let queueSizeKey = "queueSize" | |
79 | 79 | ||
80 | 80 | let queueSize = match getInteger(this, queueSizeKey) { | |
81 | 81 | case i: Int => | |
82 | 82 | i | |
83 | 83 | case _ => | |
84 | 84 | 0 | |
85 | 85 | } | |
86 | 86 | ||
87 | 87 | let headPointer = match getString(this, headPointerKey) { | |
88 | 88 | case s: String => | |
89 | 89 | s | |
90 | 90 | case _ => | |
91 | 91 | "" | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | let tailPointer = match getString(this, tailPointerKey) { | |
95 | 95 | case s: String => | |
96 | 96 | s | |
97 | 97 | case _ => | |
98 | 98 | "" | |
99 | 99 | } | |
100 | 100 | ||
101 | 101 | let feesAccumulatedKey = "feesAccumulated" | |
102 | 102 | ||
103 | 103 | let feesAccumulated = match getInteger(this, feesAccumulatedKey) { | |
104 | 104 | case i: Int => | |
105 | 105 | i | |
106 | 106 | case _ => | |
107 | 107 | 0 | |
108 | 108 | } | |
109 | 109 | ||
110 | 110 | let ISSUE = "ISSUE" | |
111 | 111 | ||
112 | 112 | let REDEEM = "REDEEM" | |
113 | 113 | ||
114 | 114 | func buildNewItem (action,amt,token,priceIndex,invoker) = (((((((((action + "|") + toString(amt)) + "|") + token) + "|") + toString(priceIndex)) + "|") + invoker) + "|") | |
115 | 115 | ||
116 | 116 | ||
117 | 117 | func validateEnqueue (inv) = if ((inv.caller == this)) | |
118 | 118 | then throw("can't do") | |
119 | 119 | else { | |
120 | 120 | func errorMessage (got) = throw(((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are accepted, received: ") + got)) | |
121 | 121 | ||
122 | 122 | if (!(isDefined(inv.payment))) | |
123 | 123 | then errorMessage("no attached payment") | |
124 | 124 | else { | |
125 | 125 | let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here")) | |
126 | 126 | if (if ((assetId != BEAR)) | |
127 | 127 | then (assetId != BULL) | |
128 | 128 | else false) | |
129 | 129 | then errorMessage(assetId) | |
130 | 130 | else { | |
131 | 131 | let attachedAmount = value(inv.payment).amount | |
132 | 132 | let col = if ((assetId == BEAR)) | |
133 | 133 | then bearCol | |
134 | 134 | else bullCol | |
135 | 135 | let circ = if ((assetId == BEAR)) | |
136 | 136 | then bearCirc | |
137 | - | else | |
137 | + | else bullCirc | |
138 | 138 | let estimated = fraction(col, attachedAmount, circ) | |
139 | 139 | if ((minRedeem > estimated)) | |
140 | 140 | then throw((((((((((("Attached payment too small. Min redeem amount is " + toString((minRedeem / 1000000))) + " USDN, ") + "attached amount: ") + toString(attachedAmount)) + ", col: ") + toString(col)) + ", circ: ") + toString(circ)) + ", estimated: ") + toString(estimated))) | |
141 | 141 | else unit | |
142 | 142 | } | |
143 | 143 | } | |
144 | 144 | } | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func enqueue (id,action,amt,token,priceIndex,invoker) = { | |
148 | 148 | let increaseQueueSize = DataEntry(queueSizeKey, (queueSize + 1)) | |
149 | 149 | let itm = buildNewItem(action, amt, token, priceIndex, invoker) | |
150 | 150 | if ((queueSize == 0)) | |
151 | 151 | then WriteSet([DataEntry(headPointerKey, id), DataEntry(tailPointerKey, id), DataEntry(id, itm), increaseQueueSize]) | |
152 | 152 | else { | |
153 | 153 | let prevId = valueOrErrorMessage(getString(this, tailPointerKey), "can't get tail pointer") | |
154 | 154 | let prevItm = split(valueOrErrorMessage(getString(this, prevId), "can't resolve pointer"), "|") | |
155 | 155 | let updatedPrevItm = ((((((((((prevItm[0] + "|") + prevItm[1]) + "|") + prevItm[2]) + "|") + prevItm[3]) + "|") + prevItm[4]) + "|") + id) | |
156 | 156 | WriteSet([DataEntry(prevId, updatedPrevItm), DataEntry(id, itm), DataEntry(tailPointerKey, id), increaseQueueSize]) | |
157 | 157 | } | |
158 | 158 | } | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func dequeue () = if ((queueSize == 0)) | |
162 | 162 | then throw("nothing to settle") | |
163 | 163 | else { | |
164 | 164 | func collectFee (fees) = DataEntry(feesAccumulatedKey, (feesAccumulated + fees)) | |
165 | 165 | ||
166 | 166 | let decreaseQueueSize = DataEntry(queueSizeKey, (queueSize - 1)) | |
167 | 167 | let isLastElement = (headPointer == tailPointer) | |
168 | 168 | let overwriteTail = DataEntry(tailPointerKey, "") | |
169 | 169 | let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|") | |
170 | 170 | let action = data[0] | |
171 | 171 | let amt = parseIntValue(data[1]) | |
172 | 172 | let token = data[2] | |
173 | 173 | let priceIndex = parseIntValue(data[3]) | |
174 | 174 | let invoker = addressFromStringValue(data[4]) | |
175 | 175 | let next = data[5] | |
176 | 176 | if ((rebalancedPriceIndex > priceIndex)) | |
177 | 177 | then throw(((("corrupt state, rebalancedPriceIndex=" + toString(rebalancedPriceIndex)) + ", request price id=") + toString(priceIndex))) | |
178 | 178 | else if ((priceIndex > rebalancedPriceIndex)) | |
179 | 179 | then throw("can't dequeue, too early, rebalance first") | |
180 | 180 | else if ((action == ISSUE)) | |
181 | 181 | then { | |
182 | 182 | let feeSize = fraction(amt, issuePercentile, 10000) | |
183 | 183 | let addedCollateral = (amt - feeSize) | |
184 | 184 | if ((token == BULL)) | |
185 | 185 | then { | |
186 | 186 | let addedToCirculation = fraction(bullCirc, addedCollateral, bullCol) | |
187 | 187 | let items = [DataEntry(bullCollateralKey, (bullCol + addedCollateral)), DataEntry(bullCirculationKey, (bullCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize] | |
188 | 188 | ScriptResult(WriteSet(if (isLastElement) | |
189 | 189 | then overwriteTail :: items | |
190 | 190 | else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BULL))])) | |
191 | 191 | } | |
192 | 192 | else if ((token == BEAR)) | |
193 | 193 | then { | |
194 | 194 | let addedToCirculation = fraction(bearCirc, addedCollateral, bearCol) | |
195 | 195 | let items = [DataEntry(bearCollateralKey, (bearCol + addedCollateral)), DataEntry(bearCirculationKey, (bearCirc + addedToCirculation)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize] | |
196 | 196 | ScriptResult(WriteSet(if (isLastElement) | |
197 | 197 | then overwriteTail :: items | |
198 | 198 | else items), TransferSet([ScriptTransfer(invoker, addedToCirculation, fromBase58String(BEAR))])) | |
199 | 199 | } | |
200 | 200 | else throw("bad token id") | |
201 | 201 | } | |
202 | 202 | else if ((action == REDEEM)) | |
203 | 203 | then { | |
204 | 204 | let removedTokens = amt | |
205 | 205 | if ((token == BULL)) | |
206 | 206 | then { | |
207 | 207 | let removedCollateral = fraction(bullCol, removedTokens, bullCirc) | |
208 | 208 | let feeSize = fraction(removedCollateral, redeemPercentile, 10000) | |
209 | 209 | let payout = if ((removedCollateral > feeSize)) | |
210 | 210 | then (removedCollateral - feeSize) | |
211 | 211 | else 0 | |
212 | 212 | let items = [DataEntry(bullCollateralKey, (bullCol - removedCollateral)), DataEntry(bullCirculationKey, (bullCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize] | |
213 | 213 | ScriptResult(WriteSet(if (isLastElement) | |
214 | 214 | then overwriteTail :: items | |
215 | 215 | else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))])) | |
216 | 216 | } | |
217 | 217 | else if ((token == BEAR)) | |
218 | 218 | then { | |
219 | 219 | let removedCollateral = fraction(bearCol, removedTokens, bearCirc) | |
220 | 220 | let feeSize = fraction(removedCollateral, redeemPercentile, 10000) | |
221 | 221 | let payout = if ((removedCollateral > feeSize)) | |
222 | 222 | then (removedCollateral - feeSize) | |
223 | 223 | else 0 | |
224 | 224 | let items = [DataEntry(bearCollateralKey, (bearCol - removedCollateral)), DataEntry(bearCirculationKey, (bearCirc - removedTokens)), DataEntry(headPointerKey, next), collectFee(feeSize), decreaseQueueSize] | |
225 | 225 | ScriptResult(WriteSet(if (isLastElement) | |
226 | 226 | then overwriteTail :: items | |
227 | 227 | else items), TransferSet([ScriptTransfer(invoker, payout, fromBase58String(mainToken))])) | |
228 | 228 | } | |
229 | 229 | else throw("bad token id") | |
230 | 230 | } | |
231 | 231 | else throw(("bad action: " + action)) | |
232 | 232 | } | |
233 | 233 | ||
234 | 234 | ||
235 | 235 | func rebalance () = { | |
236 | 236 | func LV (v,p0,p1) = { | |
237 | 237 | let denom = 100 | |
238 | 238 | let pmax = ((if ((p1 > p0)) | |
239 | 239 | then p1 | |
240 | 240 | else p0) / denom) | |
241 | 241 | let pmin = ((if ((p0 > p1)) | |
242 | 242 | then p1 | |
243 | 243 | else p0) / denom) | |
244 | 244 | let a = (pmin * pmin) | |
245 | 245 | let b = (((9 * pmax) * pmax) - ((15 * pmax) * pmin)) | |
246 | 246 | fraction(v, ((6 * a) + b), ((7 * a) + b)) | |
247 | 247 | } | |
248 | 248 | ||
249 | 249 | let settledPriceIndex = valueOrErrorMessage(getInteger(this, lastRebalancePriceIndexKey), "inconsistent data") | |
250 | 250 | let unsettledPriceIndex = (settledPriceIndex + 1) | |
251 | 251 | let settledPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(settledPriceIndex))), "bad oracle data for settled price height") | |
252 | 252 | let settledPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(settledPriceHeight))), "bad oracle data for price") | |
253 | 253 | let nextPriceHeight = valueOrErrorMessage(getInteger(oracle, ("price_index_" + toString(unsettledPriceIndex))), "no next price height") | |
254 | 254 | let nextPrice = valueOrErrorMessage(getInteger(oracle, ("price_" + toString(nextPriceHeight))), "no next price") | |
255 | 255 | let minVol = if ((bearCol > bullCol)) | |
256 | 256 | then bullCol | |
257 | 257 | else bearCol | |
258 | 258 | let redist = LV(minVol, settledPrice, nextPrice) | |
259 | 259 | if ((nextPrice > settledPrice)) | |
260 | 260 | then WriteSet([DataEntry(bullCollateralKey, (bullCol + redist)), DataEntry(bearCollateralKey, (bearCol - redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)]) | |
261 | 261 | else if ((settledPrice > nextPrice)) | |
262 | 262 | then WriteSet([DataEntry(bullCollateralKey, (bullCol - redist)), DataEntry(bearCollateralKey, (bearCol + redist)), DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)]) | |
263 | 263 | else WriteSet([DataEntry(lastRebalancePriceIndexKey, unsettledPriceIndex)]) | |
264 | 264 | } | |
265 | 265 | ||
266 | 266 | ||
267 | 267 | @Callable(inv) | |
268 | 268 | func init (bullId,bearId,mainTokenId,oraclePK,whitelisted) = if (isDefined(getString(this, BULLKey))) | |
269 | 269 | then throw("already initialized") | |
270 | 270 | else if (!(isDefined(inv.payment))) | |
271 | 271 | then throw("neutrino payment required") | |
272 | 272 | else if ((toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "neutrino payment required")) != mainTokenId)) | |
273 | 273 | then throw("payment not in neutrino") | |
274 | 274 | else { | |
275 | 275 | let totalOwnedMainToken = value(inv.payment).amount | |
276 | 276 | let bulls = (totalOwnedMainToken / 2) | |
277 | 277 | let bears = (totalOwnedMainToken - bulls) | |
278 | 278 | if (if ((bears == 0)) | |
279 | 279 | then true | |
280 | 280 | else (bulls == 0)) | |
281 | 281 | then throw("can't init balances") | |
282 | 282 | else { | |
283 | 283 | let oracleCurrentPriceIndex = valueOrErrorMessage(getInteger(valueOrErrorMessage(addressFromPublicKey(fromBase58String(oraclePK)), "bad oracle address"), lastPriceIndexKey), "can't find last oracle price index") | |
284 | 284 | 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))])) | |
285 | 285 | } | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | ||
290 | 290 | @Callable(i) | |
291 | 291 | func setParams (iP,rP,mI,mR,wl) = if ((i.caller != this)) | |
292 | 292 | then throw("only self can change whitelist") | |
293 | 293 | else WriteSet([DataEntry(issuePercentileKey, iP), DataEntry(redeemPercentileKey, rP), DataEntry(minIssueKey, mI), DataEntry(minRedeemKey, mR), DataEntry(whitelistOnlyKey, wl)]) | |
294 | 294 | ||
295 | 295 | ||
296 | 296 | ||
297 | 297 | @Callable(i) | |
298 | 298 | func setWhitelist (l) = if ((i.caller != this)) | |
299 | 299 | then throw("only self can change whitelist") | |
300 | 300 | else WriteSet([DataEntry(whitelistKey, l)]) | |
301 | 301 | ||
302 | 302 | ||
303 | 303 | ||
304 | 304 | @Callable(inv) | |
305 | 305 | func requestRedeem () = if ((validateEnqueue(inv) == unit)) | |
306 | 306 | then { | |
307 | 307 | let assetId = toBase58String(valueOrErrorMessage(value(inv.payment).assetId, "waves are not accepted here")) | |
308 | 308 | enqueue(toBase58String(inv.transactionId), REDEEM, value(inv.payment).amount, assetId, (oraclePriceIndex + 1), toString(inv.caller)) | |
309 | 309 | } | |
310 | 310 | else throw("doesn't happen") | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | ||
314 | 314 | @Callable(inv) | |
315 | 315 | func requestIssue (tokenId) = if ((inv.caller == this)) | |
316 | 316 | then throw("can't do") | |
317 | 317 | else if (if (whitelistOnly) | |
318 | 318 | then !(isDefined(indexOf(whitelist, toString(inv.caller)))) | |
319 | 319 | else false) | |
320 | 320 | then throw("only whitelisted can do") | |
321 | 321 | else { | |
322 | 322 | let errorMessage = throw((((((("only BULL(" + BULL) + ") or BEAR(") + BEAR) + ") tokens are available in exchange for USDN(") + mainToken) + ")")) | |
323 | 323 | if (if ((tokenId != BULL)) | |
324 | 324 | then (tokenId != BEAR) | |
325 | 325 | else false) | |
326 | 326 | then errorMessage | |
327 | 327 | else if (!(isDefined(inv.payment))) | |
328 | 328 | then errorMessage | |
329 | 329 | else if ((value(inv.payment).assetId != fromBase58String(mainToken))) | |
330 | 330 | then errorMessage | |
331 | 331 | else if ((minIssue > value(inv.payment).amount)) | |
332 | 332 | then throw((("Attached payment too small. Min required: " + toString((minIssue / 1000000))) + " USDN")) | |
333 | 333 | else enqueue(toBase58String(inv.transactionId), ISSUE, value(inv.payment).amount, tokenId, (oraclePriceIndex + 1), toString(inv.caller)) | |
334 | 334 | } | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | ||
338 | 338 | @Callable(inv) | |
339 | 339 | func settle () = { | |
340 | 340 | let queueEmpty = (headPointer == "") | |
341 | 341 | let canRebalance = (oraclePriceIndex > rebalancedPriceIndex) | |
342 | 342 | if (queueEmpty) | |
343 | 343 | then if (canRebalance) | |
344 | 344 | then rebalance() | |
345 | 345 | else throw("[OK] all done, carry on") | |
346 | 346 | else { | |
347 | 347 | let data = split(valueOrErrorMessage(getString(this, headPointer), "bad head pointer"), "|") | |
348 | 348 | let priceIndex = parseIntValue(data[3]) | |
349 | 349 | if ((priceIndex > rebalancedPriceIndex)) | |
350 | 350 | then if (canRebalance) | |
351 | 351 | then rebalance() | |
352 | 352 | else throw("[OK] need to wait") | |
353 | 353 | else if ((priceIndex == rebalancedPriceIndex)) | |
354 | 354 | then dequeue() | |
355 | 355 | else throw("corrupt data, future price id already rebalanced") | |
356 | 356 | } | |
357 | 357 | } | |
358 | 358 | ||
359 | 359 |
github/deemru/w8io/026f985 63.20 ms ◑