tx · B9zz9NAZtd4ALqXUbiGvVxQPXma7cwfxYepnERZbrGb8 3Mud6ktLyZpnYFf1knDQ2dHi6mmLTjg9KGu: -0.01000000 Waves 2020.02.10 17:37 [893302] smart account 3Mud6ktLyZpnYFf1knDQ2dHi6mmLTjg9KGu > SELF 0.00000000 Waves
{ "type": 13, "id": "B9zz9NAZtd4ALqXUbiGvVxQPXma7cwfxYepnERZbrGb8", "fee": 1000000, "feeAssetId": null, "timestamp": 1581345491757, "version": 1, "sender": "3Mud6ktLyZpnYFf1knDQ2dHi6mmLTjg9KGu", "senderPublicKey": "D91aMFbJeDK9XdmaZ5Y2Jthg5bGJUawMutxnvQDUj7G7", "proofs": [ "YbF8rGy8cznpCAS9chk2Fv2wuxK87waH79Z32dS4d2tiWEdz6HGy9mtsXYpZGgbSH97RmKHdFcRDeX3ZeVt1ZYC" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgIBCBIDCgEIEgAAAAA3AQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAABAAAAGGdldFN0cmluZ0J5QWRkcmVzc0FuZEtleQAAAAIAAAAHYWRkcmVzcwAAAANrZXkEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAHYWRkcmVzcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWECAAAAAAEAAAAYZ2V0T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AUAAAAbdG90YWxPcmRlcldhdmVsZXRlc1JlcXVpcmVkBQAAAAR1bml0BQAAAANuaWwAAAAA7TYjig==", "chainId": 84, "height": 893302, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func getNumberByKey (key) = match getInteger(this, key) { | |
5 | + | case a: Int => | |
6 | + | a | |
7 | + | case _ => | |
8 | + | 0 | |
9 | + | } | |
10 | + | ||
11 | + | ||
12 | + | func getStringByKey (key) = match getString(this, key) { | |
13 | + | case a: String => | |
14 | + | a | |
15 | + | case _ => | |
16 | + | "" | |
17 | + | } | |
18 | + | ||
19 | + | ||
20 | + | func getStringByAddressAndKey (address,key) = match getString(address, key) { | |
21 | + | case a: String => | |
22 | + | a | |
23 | + | case _ => | |
24 | + | "" | |
25 | + | } | |
26 | + | ||
27 | + | ||
28 | + | func getNumberByAddressAndKey (address,key) = match getInteger(address, key) { | |
29 | + | case a: Int => | |
30 | + | a | |
31 | + | case _ => | |
32 | + | 0 | |
33 | + | } | |
34 | + | ||
35 | + | ||
36 | + | let WAVELET = 100000000 | |
37 | + | ||
38 | + | let PAULI = 1000000 | |
39 | + | ||
40 | + | let PERCENTACCURACY = 1000 | |
41 | + | ||
42 | + | let MINORDERTOTAL = (10 * WAVELET) | |
43 | + | ||
44 | + | let MAXROI = 100 | |
45 | + | ||
46 | + | let CANCELED = "canceled" | |
47 | + | ||
48 | + | let NEW = "new" | |
49 | + | ||
50 | + | let FILLED = "filled" | |
51 | + | ||
52 | + | let NeutrinoContractKey = "neutrino_contract" | |
53 | + | ||
54 | + | let PriceKey = "price" | |
55 | + | ||
56 | + | let BondAssetIdKey = "bond_asset_id" | |
57 | + | ||
58 | + | let NeutrinoAssetIdKey = "neutrino_asset_id" | |
59 | + | ||
60 | + | let ControlContractKey = "control_contract" | |
61 | + | ||
62 | + | let BalanceLockedkKey = "balance_lock_" | |
63 | + | ||
64 | + | let WavesLockedBalanceKey = (BalanceLockedkKey + "waves") | |
65 | + | ||
66 | + | let NeutrinoLockedBalanceKey = (BalanceLockedkKey + "neutrino") | |
67 | + | ||
68 | + | let LiquidationContractKey = "liquidation_contract" | |
69 | + | ||
70 | + | let FirstOrderKey = "order_first" | |
71 | + | ||
72 | + | func getOrderPriceKey (orderId) = ("order_price_" + orderId) | |
73 | + | ||
74 | + | ||
75 | + | func getOrderTotalKey (orderId) = ("order_total_" + orderId) | |
76 | + | ||
77 | + | ||
78 | + | func getOrderOwnerKey (orderId) = ("order_owner_" + orderId) | |
79 | + | ||
80 | + | ||
81 | + | func getOrderHeightKey (orderId) = ("order_height_" + orderId) | |
82 | + | ||
83 | + | ||
84 | + | func getOrderStatusKey (orderId) = ("order_status_" + orderId) | |
85 | + | ||
86 | + | ||
87 | + | func getOrderFilledTotalKey (orderId) = ("order_filled_total_" + orderId) | |
88 | + | ||
89 | + | ||
90 | + | func getLastOrderOwnerKey (owner) = ("last_order_owner_" + owner) | |
91 | + | ||
92 | + | ||
93 | + | func getPrevOrderKey (orderId) = ("order_prev_" + orderId) | |
94 | + | ||
95 | + | ||
96 | + | func getNextOrderKey (orderId) = ("order_next_" + orderId) | |
97 | + | ||
98 | + | ||
99 | + | func convertNeutrinoToWaves (amount,price) = fraction(fraction(amount, 100, price), WAVELET, PAULI) | |
100 | + | ||
101 | + | ||
102 | + | func convertWavesToNeutrino (amount,price) = fraction(fraction(amount, price, 100), PAULI, WAVELET) | |
103 | + | ||
104 | + | ||
105 | + | func convertNeutrinoToBond (amount) = (amount / PAULI) | |
106 | + | ||
107 | + | ||
108 | + | func convertBondToNeutrino (amount) = (amount * PAULI) | |
109 | + | ||
110 | + | ||
111 | + | func convertWavesToBond (amount,price) = convertNeutrinoToBond(convertWavesToNeutrino(amount, price)) | |
112 | + | ||
113 | + | ||
114 | + | func convertBondToWaves (amount,price) = convertNeutrinoToWaves(convertBondToNeutrino(amount), price) | |
115 | + | ||
116 | + | ||
117 | + | let neutrinoContract = addressFromStringValue(getStringByKey(NeutrinoContractKey)) | |
118 | + | ||
119 | + | let controlContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, ControlContractKey)) | |
120 | + | ||
121 | + | let liquidationContract = addressFromStringValue(getStringByAddressAndKey(neutrinoContract, LiquidationContractKey)) | |
122 | + | ||
123 | + | let neutrinoAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, NeutrinoAssetIdKey)) | |
124 | + | ||
125 | + | let bondAssetId = fromBase58String(getStringByAddressAndKey(neutrinoContract, BondAssetIdKey)) | |
126 | + | ||
127 | + | let currentPrice = getNumberByAddressAndKey(controlContract, PriceKey) | |
128 | + | ||
129 | + | let neutrinoLockedBalance = getNumberByAddressAndKey(neutrinoContract, NeutrinoLockedBalanceKey) | |
130 | + | ||
131 | + | let reserve = (wavesBalance(neutrinoContract) - getNumberByAddressAndKey(neutrinoContract, WavesLockedBalanceKey)) | |
132 | + | ||
133 | + | let neutrinoSupply = (((neutrinoLockedBalance + extract(assetInfo(neutrinoAssetId)).quantity) - assetBalance(neutrinoContract, neutrinoAssetId)) - assetBalance(liquidationContract, neutrinoAssetId)) | |
134 | + | ||
135 | + | let deficit = (neutrinoSupply - convertWavesToNeutrino(reserve, currentPrice)) | |
136 | + | ||
137 | + | let firstOrder = getStringByKey(FirstOrderKey) | |
138 | + | ||
139 | + | func getOrderPrice (id) = getNumberByKey(getOrderPriceKey(id)) | |
140 | + | ||
141 | + | ||
142 | + | func getOrderTotal (id) = getNumberByKey(getOrderTotalKey(id)) | |
143 | + | ||
144 | + | ||
145 | + | func getOrderOwner (id) = getStringByKey(getOrderOwnerKey(id)) | |
146 | + | ||
147 | + | ||
148 | + | func getOrderStatus (id) = getStringByKey(getOrderStatusKey(id)) | |
149 | + | ||
150 | + | ||
151 | + | func getOrderFilledTotal (id) = getNumberByKey(getOrderFilledTotalKey(id)) | |
152 | + | ||
153 | + | ||
154 | + | func getPrevOrder (id) = getStringByKey(getPrevOrderKey(id)) | |
155 | + | ||
156 | + | ||
157 | + | func getNextOrder (id) = getStringByKey(getNextOrderKey(id)) | |
158 | + | ||
159 | + | ||
160 | + | @Callable(i) | |
161 | + | func addBuyBondOrder (price,prevOrder) = { | |
162 | + | let pmt = extract(i.payment) | |
163 | + | let orderId = toBase58String(keccak256(((((toBytes(price) + toBytes(pmt.amount)) + i.caller.bytes) + toBytes(height)) + i.transactionId))) | |
164 | + | let priceWavesByBondCents = fraction(100, 100, price) | |
165 | + | let roi = fraction((priceWavesByBondCents - currentPrice), 100, currentPrice) | |
166 | + | if ((MINORDERTOTAL > pmt.amount)) | |
167 | + | then throw(("min order total equals " + toString(MINORDERTOTAL))) | |
168 | + | else if ((roi > MAXROI)) | |
169 | + | then throw("max setOrder ROI is 100%") | |
170 | + | else if (isDefined(pmt.assetId)) | |
171 | + | then throw("can use waves only") | |
172 | + | else if ((0 >= price)) | |
173 | + | then throw("price less zero") | |
174 | + | else if ((getOrderOwner(orderId) != "")) | |
175 | + | then throw("order exists") | |
176 | + | else if (if ((prevOrder != "")) | |
177 | + | then (getOrderStatus(prevOrder) != NEW) | |
178 | + | else false) | |
179 | + | then throw("prev order status is not new") | |
180 | + | else { | |
181 | + | let owner = toString(i.caller) | |
182 | + | let nextOrder = if ((prevOrder == "")) | |
183 | + | then firstOrder | |
184 | + | else getNextOrder(prevOrder) | |
185 | + | let nextOrderPrice = getOrderPrice(nextOrder) | |
186 | + | let isNextOrderError = if (if ((nextOrder != "")) | |
187 | + | then (nextOrderPrice >= price) | |
188 | + | else false) | |
189 | + | then true | |
190 | + | else false | |
191 | + | let prevOrderPrice = getOrderPrice(prevOrder) | |
192 | + | let isPrevOrderError = if (if ((prevOrder != "")) | |
193 | + | then (price > prevOrderPrice) | |
194 | + | else false) | |
195 | + | then true | |
196 | + | else false | |
197 | + | if (if (isNextOrderError) | |
198 | + | then true | |
199 | + | else isPrevOrderError) | |
200 | + | then throw(((("invalid order isPrevOrderError:" + toString(isPrevOrderError)) + " isNextOrderError:") + toString(isNextOrderError))) | |
201 | + | else WriteSet([DataEntry(getLastOrderOwnerKey(owner), orderId), DataEntry(getPrevOrderKey(orderId), prevOrder), DataEntry(getNextOrderKey(orderId), nextOrder), DataEntry(getNextOrderKey(prevOrder), if ((prevOrder == "")) | |
202 | + | then "" | |
203 | + | else orderId), DataEntry(getPrevOrderKey(nextOrder), if ((nextOrder == "")) | |
204 | + | then "" | |
205 | + | else orderId), DataEntry(FirstOrderKey, if (if ((firstOrder == "")) | |
206 | + | then true | |
207 | + | else (firstOrder == nextOrder)) | |
208 | + | then orderId | |
209 | + | else firstOrder), DataEntry(getOrderPriceKey(orderId), price), DataEntry(getOrderTotalKey(orderId), pmt.amount), DataEntry(getOrderOwnerKey(orderId), owner), DataEntry(getOrderHeightKey(orderId), height), DataEntry(getOrderStatusKey(orderId), NEW), DataEntry(("debug_order_currentPrice_" + orderId), currentPrice), DataEntry(("debug_order_roi_" + orderId), roi)]) | |
210 | + | } | |
211 | + | } | |
212 | + | ||
213 | + | ||
214 | + | ||
215 | + | @Callable(i) | |
216 | + | func cancelOrder (orderId) = { | |
217 | + | let owner = getOrderOwner(orderId) | |
218 | + | let amount = (getOrderTotal(orderId) - getOrderFilledTotal(orderId)) | |
219 | + | let nextOrder = getNextOrder(orderId) | |
220 | + | let prevOrder = getPrevOrder(orderId) | |
221 | + | if ((owner != toString(i.caller))) | |
222 | + | then throw("permission denied") | |
223 | + | else if ((getOrderStatus(orderId) != NEW)) | |
224 | + | then throw("invalid order status") | |
225 | + | else ScriptResult(WriteSet([DataEntry(FirstOrderKey, if ((firstOrder == orderId)) | |
226 | + | then nextOrder | |
227 | + | else firstOrder), DataEntry(getNextOrderKey(prevOrder), nextOrder), DataEntry(getPrevOrderKey(nextOrder), prevOrder), DataEntry(getOrderStatusKey(orderId), CANCELED)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
228 | + | } | |
229 | + | ||
230 | + | ||
231 | + | ||
232 | + | @Callable(i) | |
233 | + | func sellBond () = { | |
234 | + | let bondBalance = assetBalance(this, bondAssetId) | |
235 | + | let deficitPositive = if ((0 >= deficit)) | |
236 | + | then 0 | |
237 | + | else (deficit / PAULI) | |
238 | + | let bondAmount = if ((deficitPositive >= bondBalance)) | |
239 | + | then bondBalance | |
240 | + | else deficitPositive | |
241 | + | let returnAmount = if ((deficitPositive >= bondBalance)) | |
242 | + | then 0 | |
243 | + | else (bondBalance - deficitPositive) | |
244 | + | if (if ((deficitPositive == 0)) | |
245 | + | then (bondBalance == 0) | |
246 | + | else false) | |
247 | + | then throw("without deficit") | |
248 | + | else if ((bondBalance == 0)) | |
249 | + | then throw("without bonds to sell") | |
250 | + | else if ((returnAmount > 0)) | |
251 | + | then TransferSet([ScriptTransfer(neutrinoContract, returnAmount, bondAssetId)]) | |
252 | + | else if ((firstOrder == "")) | |
253 | + | then throw("empty orderbook") | |
254 | + | else { | |
255 | + | let nextOrder = getNextOrder(firstOrder) | |
256 | + | let filledTotal = getOrderFilledTotal(firstOrder) | |
257 | + | let orderPrice = getOrderPrice(firstOrder) | |
258 | + | let priceWavesByBondCents = fraction(100, 100, orderPrice) | |
259 | + | let remainedTotal = (getOrderTotal(firstOrder) - filledTotal) | |
260 | + | let amountToExecuteOrder = convertWavesToBond(remainedTotal, priceWavesByBondCents) | |
261 | + | let fillOrderCondition = (bondAmount >= amountToExecuteOrder) | |
262 | + | let fillableOrderAmount = if (fillOrderCondition) | |
263 | + | then amountToExecuteOrder | |
264 | + | else bondAmount | |
265 | + | let totalOrderWaveletesRequired = convertBondToWaves(fillableOrderAmount, priceWavesByBondCents) | |
266 | + | if ((amountToExecuteOrder == 0)) | |
267 | + | then ScriptResult(WriteSet([DataEntry(FirstOrderKey, nextOrder), DataEntry(getPrevOrderKey(nextOrder), ""), DataEntry(FirstOrderKey, nextOrder), DataEntry(getOrderStatusKey(firstOrder), FILLED)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(firstOrder)), remainedTotal, unit)])) | |
268 | + | else if ((totalOrderWaveletesRequired == 0)) | |
269 | + | then throw("cannot fill order at the moment") | |
270 | + | else { | |
271 | + | let newStatus = if (if (fillOrderCondition) | |
272 | + | then (remainedTotal == 0) | |
273 | + | else false) | |
274 | + | then FILLED | |
275 | + | else NEW | |
276 | + | ScriptResult(WriteSet([DataEntry(getPrevOrderKey(nextOrder), if ((newStatus == FILLED)) | |
277 | + | then "" | |
278 | + | else firstOrder), DataEntry(FirstOrderKey, if ((newStatus == FILLED)) | |
279 | + | then nextOrder | |
280 | + | else firstOrder), DataEntry(getOrderFilledTotalKey(firstOrder), (filledTotal + totalOrderWaveletesRequired)), DataEntry(getOrderStatusKey(firstOrder), newStatus)]), TransferSet([ScriptTransfer(addressFromStringValue(getOrderOwner(firstOrder)), fillableOrderAmount, bondAssetId), ScriptTransfer(neutrinoContract, totalOrderWaveletesRequired, unit)])) | |
281 | + | } | |
282 | + | } | |
283 | + | } | |
284 | + | ||
285 | + |
github/deemru/w8io/169f3d6 19.66 ms ◑