tx · 3Xc4dpzB1PoqdGksWfiNLTbeF2uMdapEY1egoTeZQgDD 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS: -0.22000000 Waves 2023.04.07 12:49 [2523982] smart account 3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS > SELF 0.00000000 Waves
{ "type": 13, "id": "3Xc4dpzB1PoqdGksWfiNLTbeF2uMdapEY1egoTeZQgDD", "fee": 22000000, "feeAssetId": null, "timestamp": 1680860986293, "version": 2, "chainId": 84, "sender": "3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS", "senderPublicKey": "HP8sssVq1866F7CaPQJwgFrt6fsqhQjKwM84cL1wjD2a", "proofs": [ "3Y1dbDWzsf9BNxJXCptt49H1Sn7k6zxWircfDZTZSoeKvcM6vq41cudpXx3HkJEXysojvRX1QXjQo3Vhht1Erb18" ], "script": "base64:BgJOCAISBQoDCAEIEgMKAQgSBAoCCAESAwoBCBIOCgwICAgBBBEYGBEBARgSCgoICAgIAQQIARgSDgoMCAgIAQQYGBgYGAEYEgcKBQgIAQEBPAALU0ZfUE9TX1RZUEUCAlNGAAtXWF9QT1NfVFlQRQICV1gAB0NBUF9GRUUCA2NhcAAITE9BTl9GRUUCBGxvYW4AC05PX0xPQU5fRkVFAgZub0xvYW4ABlNDQUxFOACAwtcvAAdTQ0FMRTEwAIDIr6AlAApGRUVfU0NBTEU2AMCEPQAUa1NGUG9vbEFBc3NldEJhbGFuY2UCD0FfYXNzZXRfYmFsYW5jZQAUa1NGUG9vbEJBc3NldEJhbGFuY2UCD0JfYXNzZXRfYmFsYW5jZQAPa1NGUG9vbEFBc3NldElkAgpBX2Fzc2V0X2lkAA9rU0ZQb29sQkFzc2V0SWQCCkJfYXNzZXRfaWQADmtTRlBvb2xTaGFyZUlkAg5zaGFyZV9hc3NldF9pZAANa1VzZXJQb3NpdGlvbgIOX3VzZXJfcG9zaXRpb24AEWtVc2VyQm9ycm93QW1vdW50AhxfdXNlcl9wb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ULU0ZfUE9TX1RZUEUJAQIhPQIFBHR5cGUFC1dYX1BPU19UWVBFBwkAAgECCldyb25nIHR5cGUJAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFFWtBeGx5SW5GZWVXaXRob3V0TG9hbgULaW5GZWVOb0xvYW4JAMwIAgkBDEludGVnZXJFbnRyeQIJAKwCAgUIcG9vbEFkZHIFEmtBeGx5SW5GZWVXaXRoTG9hbgUJaW5GZWVMb2FuCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQtrQXhseUNhcEZlZQUGY2FwRmVlCQDMCAIJAQxJbnRlZ2VyRW50cnkCCQCsAgIFCHBvb2xBZGRyBQ1rUG9vbEludGVyZXN0AAAJAMwIAgkBC1N0cmluZ0VudHJ5AgkArAICBQVrUG9vbAUIcG9vbEFkZHIFBHR5cGUFA25pbAECdHgBBnZlcmlmeQAJAPQDAwgFAnR4CWJvZHlCeXRlcwkAkQMCCAUCdHgGcHJvb2ZzAAAIBQJ0eA9zZW5kZXJQdWJsaWNLZXlAwbU2", "height": 2523982, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FDeLsTVqHMnTQAr4BuWDVaKAMUY2sEiZybRkVLWg7vUN Next: 5fMoDcGRvW5ye6jxqQPZaos9LDCFnhAh1E9JjEaWN3aG Diff:
Old | New | Differences | |
---|---|---|---|
690 | 690 | then (type != WX_POS_TYPE) | |
691 | 691 | else false) | |
692 | 692 | then throw("Wrong type") | |
693 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), StringEntry((kPool + poolAddr), type)] | |
693 | + | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
694 | 694 | ||
695 | 695 | ||
696 | 696 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SF_POS_TYPE = "SF" | |
5 | 5 | ||
6 | 6 | let WX_POS_TYPE = "WX" | |
7 | 7 | ||
8 | 8 | let CAP_FEE = "cap" | |
9 | 9 | ||
10 | 10 | let LOAN_FEE = "loan" | |
11 | 11 | ||
12 | 12 | let NO_LOAN_FEE = "noLoan" | |
13 | 13 | ||
14 | 14 | let SCALE8 = 100000000 | |
15 | 15 | ||
16 | 16 | let SCALE10 = 10000000000 | |
17 | 17 | ||
18 | 18 | let FEE_SCALE6 = 1000000 | |
19 | 19 | ||
20 | 20 | let kSFPoolAAssetBalance = "A_asset_balance" | |
21 | 21 | ||
22 | 22 | let kSFPoolBAssetBalance = "B_asset_balance" | |
23 | 23 | ||
24 | 24 | let kSFPoolAAssetId = "A_asset_id" | |
25 | 25 | ||
26 | 26 | let kSFPoolBAssetId = "B_asset_id" | |
27 | 27 | ||
28 | 28 | let kSFPoolShareId = "share_asset_id" | |
29 | 29 | ||
30 | 30 | let kUserPosition = "_user_position" | |
31 | 31 | ||
32 | 32 | let kUserBorrowAmount = "_user_position_borrow_amount" | |
33 | 33 | ||
34 | 34 | let kUserBorrowAssetId = "_user_position_borrow_asset_id" | |
35 | 35 | ||
36 | 36 | let kUserPositionType = "_user_position_type" | |
37 | 37 | ||
38 | 38 | let kUserPositionNum = "_user_position_number" | |
39 | 39 | ||
40 | 40 | let kUserPositionInterest = "_user_position_interest" | |
41 | 41 | ||
42 | 42 | let kPoolTotal = "_pool_total" | |
43 | 43 | ||
44 | 44 | let kPoolInterest = "_pool_interest" | |
45 | 45 | ||
46 | 46 | let kAxlyInFeeWithoutLoan = "_axly_fee_without_loan" | |
47 | 47 | ||
48 | 48 | let kAxlyInFeeWithLoan = "_axly_fee_with_loan" | |
49 | 49 | ||
50 | 50 | let kAxlyCapFee = "_axly_fee_cap" | |
51 | 51 | ||
52 | 52 | let kRequestId = "_request_id" | |
53 | 53 | ||
54 | 54 | let kRequestIter = "requests_iter" | |
55 | 55 | ||
56 | 56 | let kPool = "pool_" | |
57 | 57 | ||
58 | 58 | let kPoolCapChange = "_pool_cap_change" | |
59 | 59 | ||
60 | 60 | let kMoneyBox = "axly_money_box" | |
61 | 61 | ||
62 | 62 | let kSFFarmingAddr = "swopfi_farming_addr" | |
63 | 63 | ||
64 | 64 | let kLendService = "lend_service_addr" | |
65 | 65 | ||
66 | 66 | let kPriceOracle = "price_oracle" | |
67 | 67 | ||
68 | 68 | let kExContract = "exchangeContract" | |
69 | 69 | ||
70 | 70 | let moneyBox = Address(fromBase58String(valueOrErrorMessage(getString(this, kMoneyBox), "No axly moneyBox address"))) | |
71 | 71 | ||
72 | 72 | let exContract = Address(fromBase58String(valueOrErrorMessage(getString(this, kExContract), "No exchange contract address"))) | |
73 | 73 | ||
74 | 74 | let priceOracleAddr = Address(fromBase58String(valueOrErrorMessage(getString(this, kPriceOracle), "No price oracle address"))) | |
75 | 75 | ||
76 | 76 | let SWOPID = base58'4W19ndijcc2CsQa9HGW2dfXKTVXhnneWWttxXrtjPmEp' | |
77 | 77 | ||
78 | 78 | let WXID = base58'EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc' | |
79 | 79 | ||
80 | 80 | func isSelfCall (i) = if ((i.caller == this)) | |
81 | 81 | then unit | |
82 | 82 | else throw("Only contract itself can call this function") | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | func accountBalance (assetId) = match assetId { | |
86 | 86 | case id: ByteVector => | |
87 | 87 | assetBalance(this, id) | |
88 | 88 | case waves: Unit => | |
89 | 89 | wavesBalance(this).available | |
90 | 90 | case _ => | |
91 | 91 | throw("Match error") | |
92 | 92 | } | |
93 | 93 | ||
94 | 94 | ||
95 | 95 | func getSFPoolData (poolAddr) = $Tuple5(valueOrErrorMessage(getString(poolAddr, kSFPoolAAssetId), "Can't get pool A asset id"), valueOrErrorMessage(getString(poolAddr, kSFPoolBAssetId), "Can't get pool B asset id"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolAAssetBalance), "Can't get pool A asset balance"), valueOrErrorMessage(getInteger(poolAddr, kSFPoolBAssetBalance), "Can't get pool B asset balance"), valueOrErrorMessage(getString(poolAddr, kSFPoolShareId), "Can't get share asset id")) | |
96 | 96 | ||
97 | 97 | ||
98 | 98 | func getWXPoolData (poolAddr) = { | |
99 | 99 | let cfg = { | |
100 | 100 | let @ = invoke(poolAddr, "getPoolConfigWrapperREADONLY", nil, nil) | |
101 | 101 | if ($isInstanceOf(@, "List[Any]")) | |
102 | 102 | then @ | |
103 | 103 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
104 | 104 | } | |
105 | 105 | if ((cfg == cfg)) | |
106 | 106 | then $Tuple5(valueOrErrorMessage({ | |
107 | 107 | let @ = cfg[4] | |
108 | 108 | if ($isInstanceOf(@, "String")) | |
109 | 109 | then @ | |
110 | 110 | else unit | |
111 | 111 | }, "Can't get pool A asset id"), valueOrErrorMessage({ | |
112 | 112 | let @ = cfg[5] | |
113 | 113 | if ($isInstanceOf(@, "String")) | |
114 | 114 | then @ | |
115 | 115 | else unit | |
116 | 116 | }, "Can't get pool B asset id"), 0, 0, valueOrErrorMessage({ | |
117 | 117 | let @ = cfg[3] | |
118 | 118 | if ($isInstanceOf(@, "String")) | |
119 | 119 | then @ | |
120 | 120 | else unit | |
121 | 121 | }, "Can't get pool LP asset id")) | |
122 | 122 | else throw("Strict value is not equal to itself.") | |
123 | 123 | } | |
124 | 124 | ||
125 | 125 | ||
126 | 126 | func getPoolData (poolAddr,type) = if ((type == SF_POS_TYPE)) | |
127 | 127 | then getSFPoolData(poolAddr) | |
128 | 128 | else if ((type == WX_POS_TYPE)) | |
129 | 129 | then getWXPoolData(poolAddr) | |
130 | 130 | else throw("Wrong pool type") | |
131 | 131 | ||
132 | 132 | ||
133 | 133 | func getPoolTotalShare (pool) = valueOrElse(getInteger(this, (pool + kPoolTotal)), 0) | |
134 | 134 | ||
135 | 135 | ||
136 | 136 | func getNewUserPositionNumber (pool,user) = (valueOrElse(getInteger(this, (((pool + "_") + user) + kUserPositionNum)), 0) + 1) | |
137 | 137 | ||
138 | 138 | ||
139 | 139 | func getAxlyFee (pool,feeType) = if ((feeType == "cap")) | |
140 | 140 | then getIntegerValue(this, (pool + kAxlyCapFee)) | |
141 | 141 | else if ((feeType == "loan")) | |
142 | 142 | then getIntegerValue(this, (pool + kAxlyInFeeWithLoan)) | |
143 | 143 | else if ((feeType == "noLoan")) | |
144 | 144 | then getIntegerValue(this, (pool + kAxlyInFeeWithoutLoan)) | |
145 | 145 | else throw("Wrong fee type") | |
146 | 146 | ||
147 | 147 | ||
148 | 148 | func getSFFarmingAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kSFFarmingAddr), "Can't get swopfi farming addr"))) | |
149 | 149 | ||
150 | 150 | ||
151 | 151 | func getWXFarmingAddr (poolAddr) = { | |
152 | 152 | let fContract = Address(fromBase58String(valueOrElse(getString(poolAddr, "%s__factoryContract"), "Can't get WX factory contract addr"))) | |
153 | 153 | let factroyCfg = split(valueOrElse(getString(fContract, "%s__factoryConfig"), "Can't get WX factory cfg"), "__") | |
154 | 154 | Address(fromBase58String(factroyCfg[1])) | |
155 | 155 | } | |
156 | 156 | ||
157 | 157 | ||
158 | 158 | func getLendSrvAddr () = Address(fromBase58String(valueOrErrorMessage(getString(this, kLendService), "Can't get lend service addr"))) | |
159 | 159 | ||
160 | 160 | ||
161 | 161 | func assetIdToStr (assetId) = match assetId { | |
162 | 162 | case id: ByteVector => | |
163 | 163 | toBase58String(id) | |
164 | 164 | case waves: Unit => | |
165 | 165 | "WAVES" | |
166 | 166 | case _ => | |
167 | 167 | throw("Match error") | |
168 | 168 | } | |
169 | 169 | ||
170 | 170 | ||
171 | 171 | func assetIdFromStr (assetId) = if ((assetId == "WAVES")) | |
172 | 172 | then unit | |
173 | 173 | else fromBase58String(assetId) | |
174 | 174 | ||
175 | 175 | ||
176 | 176 | func getAssetDecimals (assetId) = if ((assetId == "WAVES")) | |
177 | 177 | then 8 | |
178 | 178 | else match assetInfo(fromBase58String(assetId)) { | |
179 | 179 | case asset: Asset => | |
180 | 180 | asset.decimals | |
181 | 181 | case _ => | |
182 | 182 | throw("Can't find asset") | |
183 | 183 | } | |
184 | 184 | ||
185 | 185 | ||
186 | 186 | func replanishSwopFi (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,balA,balB,shareId) = { | |
187 | 187 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
188 | 188 | if ((shareBalanceBefore == shareBalanceBefore)) | |
189 | 189 | then { | |
190 | 190 | let poolAddr = Address(fromBase58String(pool)) | |
191 | 191 | let ratioA = fraction(SCALE8, pmtA, balA) | |
192 | 192 | let ratioB = fraction(SCALE8, pmtB, balB) | |
193 | 193 | let $t063496641 = if ((ratioB > ratioA)) | |
194 | 194 | then { | |
195 | 195 | let pmt = fraction(balB, ratioA, SCALE8, CEILING) | |
196 | 196 | $Tuple4(pmtA, pmt, (pmtB - pmt), pmtAssetB) | |
197 | 197 | } | |
198 | 198 | else { | |
199 | 199 | let pmt = fraction(balA, ratioB, SCALE8, CEILING) | |
200 | 200 | $Tuple4(pmt, pmtB, (pmtA - pmt), pmtAssetA) | |
201 | 201 | } | |
202 | 202 | let pmtAmountA = $t063496641._1 | |
203 | 203 | let pmtAmountB = $t063496641._2 | |
204 | 204 | let change = $t063496641._3 | |
205 | 205 | let changeAssetId = $t063496641._4 | |
206 | 206 | let inv1 = if (if ((pmtAmountA > 0)) | |
207 | 207 | then (pmtAmountB > 0) | |
208 | 208 | else false) | |
209 | 209 | then { | |
210 | 210 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
211 | 211 | invoke(poolAddr, "callFunction", ["replenishWithTwoTokens", ["false", "0"]], payments) | |
212 | 212 | } | |
213 | 213 | else 0 | |
214 | 214 | if ((inv1 == inv1)) | |
215 | 215 | then { | |
216 | 216 | let inv2 = if ((change > 0)) | |
217 | 217 | then { | |
218 | 218 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
219 | 219 | let vars = ["0", "false", "0"] | |
220 | 220 | invoke(poolAddr, "callFunction", ["replenishWithOneToken", vars], payments) | |
221 | 221 | } | |
222 | 222 | else 0 | |
223 | 223 | if ((inv2 == inv2)) | |
224 | 224 | then { | |
225 | 225 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
226 | 226 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
227 | 227 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
228 | 228 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
229 | 229 | if ((0 >= userShareForStake)) | |
230 | 230 | then throw("amount of staked sharetokens must be > 0") | |
231 | 231 | else { | |
232 | 232 | let inv3 = invoke(getSFFarmingAddr(), "lockShareTokens", [pool, 0], [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
233 | 233 | if ((inv3 == inv3)) | |
234 | 234 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
235 | 235 | else throw("Strict value is not equal to itself.") | |
236 | 236 | } | |
237 | 237 | } | |
238 | 238 | else throw("Strict value is not equal to itself.") | |
239 | 239 | } | |
240 | 240 | else throw("Strict value is not equal to itself.") | |
241 | 241 | } | |
242 | 242 | else throw("Strict value is not equal to itself.") | |
243 | 243 | } | |
244 | 244 | ||
245 | 245 | ||
246 | 246 | func replanishWX (pool,feeType,pmtA,pmtAssetA,pmtB,pmtAssetB,shareId) = { | |
247 | 247 | let poolAddr = Address(fromBase58String(pool)) | |
248 | 248 | let $t080928911 = if (if ((pmtA > 0)) | |
249 | 249 | then (pmtB > 0) | |
250 | 250 | else false) | |
251 | 251 | then { | |
252 | 252 | let evalPutInA = { | |
253 | 253 | let @ = invoke(poolAddr, "evaluatePutByAmountAssetREADONLY", [pmtA], nil) | |
254 | 254 | if ($isInstanceOf(@, "List[Any]")) | |
255 | 255 | then @ | |
256 | 256 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
257 | 257 | } | |
258 | 258 | if ((evalPutInA == evalPutInA)) | |
259 | 259 | then { | |
260 | 260 | let evalPutInB = { | |
261 | 261 | let @ = invoke(poolAddr, "evaluatePutByPriceAssetREADONLY", [pmtB], nil) | |
262 | 262 | if ($isInstanceOf(@, "List[Any]")) | |
263 | 263 | then @ | |
264 | 264 | else throw(($getType(@) + " couldn't be cast to List[Any]")) | |
265 | 265 | } | |
266 | 266 | if ((evalPutInB == evalPutInB)) | |
267 | 267 | then { | |
268 | 268 | let lpInA = { | |
269 | 269 | let @ = evalPutInA[0] | |
270 | 270 | if ($isInstanceOf(@, "Int")) | |
271 | 271 | then @ | |
272 | 272 | else throw(($getType(@) + " couldn't be cast to Int")) | |
273 | 273 | } | |
274 | 274 | let lpInB = { | |
275 | 275 | let @ = evalPutInB[0] | |
276 | 276 | if ($isInstanceOf(@, "Int")) | |
277 | 277 | then @ | |
278 | 278 | else throw(($getType(@) + " couldn't be cast to Int")) | |
279 | 279 | } | |
280 | 280 | if ((lpInA > lpInB)) | |
281 | 281 | then { | |
282 | 282 | let pmtInB = { | |
283 | 283 | let @ = evalPutInB[7] | |
284 | 284 | if ($isInstanceOf(@, "Int")) | |
285 | 285 | then @ | |
286 | 286 | else throw(($getType(@) + " couldn't be cast to Int")) | |
287 | 287 | } | |
288 | 288 | $Tuple4(pmtA, pmtInB, (pmtB - pmtInB), pmtAssetB) | |
289 | 289 | } | |
290 | 290 | else { | |
291 | 291 | let pmtInA = { | |
292 | 292 | let @ = evalPutInB[6] | |
293 | 293 | if ($isInstanceOf(@, "Int")) | |
294 | 294 | then @ | |
295 | 295 | else throw(($getType(@) + " couldn't be cast to Int")) | |
296 | 296 | } | |
297 | 297 | $Tuple4(pmtInA, pmtB, (pmtA - pmtInA), pmtAssetA) | |
298 | 298 | } | |
299 | 299 | } | |
300 | 300 | else throw("Strict value is not equal to itself.") | |
301 | 301 | } | |
302 | 302 | else throw("Strict value is not equal to itself.") | |
303 | 303 | } | |
304 | 304 | else if ((pmtA > 0)) | |
305 | 305 | then $Tuple4(pmtA, pmtB, pmtA, pmtAssetA) | |
306 | 306 | else if ((pmtB > 0)) | |
307 | 307 | then $Tuple4(pmtA, pmtB, pmtB, pmtAssetB) | |
308 | 308 | else throw("pmts must be > 0") | |
309 | 309 | let pmtAmountA = $t080928911._1 | |
310 | 310 | let pmtAmountB = $t080928911._2 | |
311 | 311 | let change = $t080928911._3 | |
312 | 312 | let changeAssetId = $t080928911._4 | |
313 | 313 | let shareBalanceBefore = accountBalance(fromBase58String(shareId)) | |
314 | 314 | if ((shareBalanceBefore == shareBalanceBefore)) | |
315 | 315 | then { | |
316 | 316 | let inv1 = if (if ((pmtAmountA > 0)) | |
317 | 317 | then (pmtAmountB > 0) | |
318 | 318 | else false) | |
319 | 319 | then { | |
320 | 320 | let payments = [AttachedPayment(assetIdFromStr(pmtAssetA), pmtAmountA), AttachedPayment(assetIdFromStr(pmtAssetB), pmtAmountB)] | |
321 | 321 | invoke(poolAddr, "put", [1, false], payments) | |
322 | 322 | } | |
323 | 323 | else 0 | |
324 | 324 | if ((inv1 == inv1)) | |
325 | 325 | then { | |
326 | 326 | let inv2 = if ((change > 0)) | |
327 | 327 | then { | |
328 | 328 | let payments = [AttachedPayment(assetIdFromStr(changeAssetId), change)] | |
329 | 329 | invoke(poolAddr, "putOneTkn", [0, false], payments) | |
330 | 330 | } | |
331 | 331 | else 0 | |
332 | 332 | if ((inv2 == inv2)) | |
333 | 333 | then { | |
334 | 334 | let shareBalanceAfter = accountBalance(fromBase58String(shareId)) | |
335 | 335 | let totalStaked = (shareBalanceAfter - shareBalanceBefore) | |
336 | 336 | let axlyFeeAmount = fraction(totalStaked, getAxlyFee(pool, feeType), FEE_SCALE6) | |
337 | 337 | let userShareForStake = (totalStaked - axlyFeeAmount) | |
338 | 338 | if ((0 >= userShareForStake)) | |
339 | 339 | then throw("amount of staked sharetokens must be > 0") | |
340 | 340 | else { | |
341 | 341 | let inv3 = invoke(getWXFarmingAddr(poolAddr), "stake", nil, [AttachedPayment(fromBase58String(shareId), userShareForStake)]) | |
342 | 342 | if ((inv3 == inv3)) | |
343 | 343 | then $Tuple2(userShareForStake, axlyFeeAmount) | |
344 | 344 | else throw("Strict value is not equal to itself.") | |
345 | 345 | } | |
346 | 346 | } | |
347 | 347 | else throw("Strict value is not equal to itself.") | |
348 | 348 | } | |
349 | 349 | else throw("Strict value is not equal to itself.") | |
350 | 350 | } | |
351 | 351 | else throw("Strict value is not equal to itself.") | |
352 | 352 | } | |
353 | 353 | ||
354 | 354 | ||
355 | 355 | func replanishEntries (pool,user,stakedAmount,axlyFeeAmount,posNum,shareId) = { | |
356 | 356 | let totalAmount = getPoolTotalShare(pool) | |
357 | 357 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
358 | 358 | [IntegerEntry((pool + kPoolTotal), (totalAmount + stakedAmount)), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPosition), stakedAmount), StringEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionType), SF_POS_TYPE), IntegerEntry((((((pool + "_") + user) + "_") + toString(posNum)) + kUserPositionInterest), curPoolInterest), IntegerEntry((((pool + "_") + user) + kUserPositionNum), posNum), ScriptTransfer(moneyBox, axlyFeeAmount, fromBase58String(shareId))] | |
359 | 359 | } | |
360 | 360 | ||
361 | 361 | ||
362 | 362 | func claimFarmed (type,pool) = if ((type == SF_POS_TYPE)) | |
363 | 363 | then { | |
364 | 364 | let balBefore = accountBalance(SWOPID) | |
365 | 365 | if ((balBefore == balBefore)) | |
366 | 366 | then { | |
367 | 367 | let inv = invoke(getSFFarmingAddr(), "claim", [pool], nil) | |
368 | 368 | if ((inv == inv)) | |
369 | 369 | then { | |
370 | 370 | let balAfter = accountBalance(SWOPID) | |
371 | 371 | $Tuple2((balAfter - balBefore), SWOPID) | |
372 | 372 | } | |
373 | 373 | else throw("Strict value is not equal to itself.") | |
374 | 374 | } | |
375 | 375 | else throw("Strict value is not equal to itself.") | |
376 | 376 | } | |
377 | 377 | else if ((type == WX_POS_TYPE)) | |
378 | 378 | then { | |
379 | 379 | let balBefore = accountBalance(WXID) | |
380 | 380 | if ((balBefore == balBefore)) | |
381 | 381 | then { | |
382 | 382 | let inv = invoke(getWXFarmingAddr(Address(fromBase58String(pool))), "claimWX", [pool], nil) | |
383 | 383 | if ((inv == inv)) | |
384 | 384 | then { | |
385 | 385 | let balAfter = accountBalance(WXID) | |
386 | 386 | $Tuple2((balAfter - balBefore), WXID) | |
387 | 387 | } | |
388 | 388 | else throw("Strict value is not equal to itself.") | |
389 | 389 | } | |
390 | 390 | else throw("Strict value is not equal to itself.") | |
391 | 391 | } | |
392 | 392 | else throw("Wrong pool type") | |
393 | 393 | ||
394 | 394 | ||
395 | 395 | func exchangeKeeper (toToken,pmtAmount,pmtAsset,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
396 | 396 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
397 | 397 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
398 | 398 | then { | |
399 | 399 | let inv = invoke(exContract, "swap", [amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
400 | 400 | if ((inv == inv)) | |
401 | 401 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
402 | 402 | else throw("Strict value is not equal to itself.") | |
403 | 403 | } | |
404 | 404 | else throw("Strict value is not equal to itself.") | |
405 | 405 | } | |
406 | 406 | ||
407 | 407 | ||
408 | 408 | func exchangePazzle (toToken,pmtAmount,pmtAsset,routesStr,minToReceive,options) = { | |
409 | 409 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
410 | 410 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
411 | 411 | then { | |
412 | 412 | let inv = invoke(exContract, "puzzleSwap", [routesStr, minToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
413 | 413 | if ((inv == inv)) | |
414 | 414 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
415 | 415 | else throw("Strict value is not equal to itself.") | |
416 | 416 | } | |
417 | 417 | else throw("Strict value is not equal to itself.") | |
418 | 418 | } | |
419 | 419 | ||
420 | 420 | ||
421 | 421 | func exchangeSwopFi (toToken,pmtAmount,pmtAsset,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
422 | 422 | let tokenBalanceBefore = accountBalance(assetIdFromStr(toToken)) | |
423 | 423 | if ((tokenBalanceBefore == tokenBalanceBefore)) | |
424 | 424 | then { | |
425 | 425 | let inv = invoke(exContract, "swopfiSwap", [exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options], [AttachedPayment(pmtAsset, pmtAmount)]) | |
426 | 426 | if ((inv == inv)) | |
427 | 427 | then (accountBalance(assetIdFromStr(toToken)) - tokenBalanceBefore) | |
428 | 428 | else throw("Strict value is not equal to itself.") | |
429 | 429 | } | |
430 | 430 | else throw("Strict value is not equal to itself.") | |
431 | 431 | } | |
432 | 432 | ||
433 | 433 | ||
434 | 434 | func capitalize (pool,type,tokenId,tokenAmount) = { | |
435 | 435 | let poolAddr = Address(fromBase58String(pool)) | |
436 | 436 | let $t01320513283 = getPoolData(poolAddr, type) | |
437 | 437 | let AId = $t01320513283._1 | |
438 | 438 | let BId = $t01320513283._2 | |
439 | 439 | let balA = $t01320513283._3 | |
440 | 440 | let balB = $t01320513283._4 | |
441 | 441 | let shareId = $t01320513283._5 | |
442 | 442 | let $t01328613366 = if ((tokenId == AId)) | |
443 | 443 | then $Tuple2(tokenAmount, 0) | |
444 | 444 | else $Tuple2(0, tokenAmount) | |
445 | 445 | let pmtA = $t01328613366._1 | |
446 | 446 | let pmtB = $t01328613366._2 | |
447 | 447 | let $t01336913734 = if ((type == SF_POS_TYPE)) | |
448 | 448 | then replanishSwopFi(pool, CAP_FEE, pmtA, AId, pmtB, BId, balA, balB, shareId) | |
449 | 449 | else replanishWX(pool, CAP_FEE, pmtA, AId, pmtB, BId, shareId) | |
450 | 450 | let stakedAmount = $t01336913734._1 | |
451 | 451 | let axlyFee = $t01336913734._2 | |
452 | 452 | let curPoolInterest = valueOrElse(getInteger(this, (pool + kPoolInterest)), 0) | |
453 | 453 | let totalShareAmount = getPoolTotalShare(pool) | |
454 | 454 | let newInterest = (curPoolInterest + fraction(stakedAmount, SCALE10, totalShareAmount)) | |
455 | 455 | [IntegerEntry((pool + kPoolInterest), newInterest), ScriptTransfer(moneyBox, axlyFee, fromBase58String(shareId))] | |
456 | 456 | } | |
457 | 457 | ||
458 | 458 | ||
459 | 459 | @Callable(i) | |
460 | 460 | func replanish (pool,leverage,borrowAssetId) = if (if ((100 > leverage)) | |
461 | 461 | then true | |
462 | 462 | else (leverage > 300)) | |
463 | 463 | then throw("Leverage can't be <100 and >300") | |
464 | 464 | else { | |
465 | 465 | let type = valueOrErrorMessage(getString(this, (kPool + pool)), "Pool is not inited") | |
466 | 466 | let $t01433914428 = getPoolData(Address(fromBase58String(pool)), type) | |
467 | 467 | let AId = $t01433914428._1 | |
468 | 468 | let BId = $t01433914428._2 | |
469 | 469 | let balA = $t01433914428._3 | |
470 | 470 | let balB = $t01433914428._4 | |
471 | 471 | let shareId = $t01433914428._5 | |
472 | 472 | let $t01443115068 = if ((size(i.payments) == 2)) | |
473 | 473 | then if ((assetIdToStr(i.payments[0].assetId) != AId)) | |
474 | 474 | then throw("Wrong payment asset A") | |
475 | 475 | else if ((assetIdToStr(i.payments[1].assetId) != BId)) | |
476 | 476 | then throw("Wrong payment asset B") | |
477 | 477 | else $Tuple4(i.payments[0].amount, AId, i.payments[1].amount, BId) | |
478 | 478 | else if ((size(i.payments) == 1)) | |
479 | 479 | then if ((assetIdToStr(i.payments[0].assetId) == AId)) | |
480 | 480 | then $Tuple4(i.payments[0].amount, AId, 0, BId) | |
481 | 481 | else if ((assetIdToStr(i.payments[0].assetId) == BId)) | |
482 | 482 | then $Tuple4(0, AId, i.payments[0].amount, BId) | |
483 | 483 | else throw("Wrong payment") | |
484 | 484 | else throw("One or two payments expected") | |
485 | 485 | let pmtA = $t01443115068._1 | |
486 | 486 | let pmtAssetA = $t01443115068._2 | |
487 | 487 | let pmtB = $t01443115068._3 | |
488 | 488 | let pmtAssetB = $t01443115068._4 | |
489 | 489 | let newPosNum = getNewUserPositionNumber(pool, toString(i.caller)) | |
490 | 490 | if ((leverage > 100)) | |
491 | 491 | then { | |
492 | 492 | let dPriceA = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetA, false], nil) | |
493 | 493 | if ($isInstanceOf(@, "(Int, Int)")) | |
494 | 494 | then @ | |
495 | 495 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
496 | 496 | let dPriceB = ( let @ = invoke(priceOracleAddr, "getTWAP60", [pmtAssetB, false], nil) | |
497 | 497 | if ($isInstanceOf(@, "(Int, Int)")) | |
498 | 498 | then @ | |
499 | 499 | else throw(($getType(@) + " couldn't be cast to (Int, Int)")))._1 | |
500 | 500 | let paydInDollar = (fraction(dPriceA, pmtA, pow(10, 0, getAssetDecimals(pmtAssetA), 0, 0, DOWN)) + fraction(dPriceB, pmtB, pow(10, 0, getAssetDecimals(pmtAssetB), 0, 0, DOWN))) | |
501 | 501 | let borrowAmount = fraction(paydInDollar, (leverage - 100), 100) | |
502 | 502 | let request = makeString([type, toString(i.caller), pool, toString(pmtA), pmtAssetA, toString(pmtB), pmtAssetB, toString(balA), toString(balB), shareId, borrowAssetId, toString(borrowAmount), toString(newPosNum)], ",") | |
503 | 503 | let newRequestId = { | |
504 | 504 | let @ = invoke(this, "createNewRequest", [request], nil) | |
505 | 505 | if ($isInstanceOf(@, "Int")) | |
506 | 506 | then @ | |
507 | 507 | else unit | |
508 | 508 | } | |
509 | 509 | if ((newRequestId == newRequestId)) | |
510 | 510 | then { | |
511 | 511 | let args = [((toString(i.caller) + "_") + toString(newPosNum)), shareId, borrowAssetId, borrowAmount, toString(this), "replanishFromLand", toString(valueOrErrorMessage(newRequestId, "Can't create new request"))] | |
512 | 512 | let inv = reentrantInvoke(getLendSrvAddr(), "flashPosition", args, nil) | |
513 | 513 | if ((inv == inv)) | |
514 | 514 | then nil | |
515 | 515 | else throw("Strict value is not equal to itself.") | |
516 | 516 | } | |
517 | 517 | else throw("Strict value is not equal to itself.") | |
518 | 518 | } | |
519 | 519 | else { | |
520 | 520 | let $t01640416799 = if ((type == SF_POS_TYPE)) | |
521 | 521 | then replanishSwopFi(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, balA, balB, shareId) | |
522 | 522 | else replanishWX(pool, NO_LOAN_FEE, pmtA, pmtAssetA, pmtB, pmtAssetB, shareId) | |
523 | 523 | let userStaked = $t01640416799._1 | |
524 | 524 | let axlyFee = $t01640416799._2 | |
525 | 525 | replanishEntries(pool, toString(i.caller), userStaked, axlyFee, newPosNum, shareId) | |
526 | 526 | } | |
527 | 527 | } | |
528 | 528 | ||
529 | 529 | ||
530 | 530 | ||
531 | 531 | @Callable(i) | |
532 | 532 | func replanishFromLand (requestId) = { | |
533 | 533 | let request = split(valueOrErrorMessage(getString(this, (requestId + kRequestId)), ("No request with id " + requestId)), ",") | |
534 | 534 | if ((size(i.payments) != 1)) | |
535 | 535 | then throw("Wrong payment size") | |
536 | 536 | else if (if ((assetIdToStr(i.payments[0].assetId) != request[10])) | |
537 | 537 | then true | |
538 | 538 | else (i.payments[0].amount != parseIntValue(request[11]))) | |
539 | 539 | then throw("Wrong payment") | |
540 | 540 | else { | |
541 | 541 | let pmtA = if ((request[4] == assetIdToStr(i.payments[0].assetId))) | |
542 | 542 | then (parseIntValue(request[3]) + i.payments[0].amount) | |
543 | 543 | else parseIntValue(request[3]) | |
544 | 544 | let pmtB = if ((request[6] == assetIdToStr(i.payments[0].assetId))) | |
545 | 545 | then (parseIntValue(request[5]) + i.payments[0].amount) | |
546 | 546 | else parseIntValue(request[3]) | |
547 | 547 | let pool = request[2] | |
548 | 548 | let user = request[1] | |
549 | 549 | let shareId = request[9] | |
550 | 550 | let posNum = parseIntValue(request[12]) | |
551 | 551 | let $t01775118274 = if ((request[0] == SF_POS_TYPE)) | |
552 | 552 | then replanishSwopFi(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], parseIntValue(request[7]), parseIntValue(request[8]), shareId) | |
553 | 553 | else if ((request[0] == WX_POS_TYPE)) | |
554 | 554 | then replanishWX(pool, LOAN_FEE, pmtA, request[4], pmtB, request[6], shareId) | |
555 | 555 | else throw("Wrong request type") | |
556 | 556 | let userStaked = $t01775118274._1 | |
557 | 557 | let axlyFee = $t01775118274._2 | |
558 | 558 | let borrowEntries = [IntegerEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAmount), i.payments[0].amount), StringEntry((((((request[2] + "_") + request[1]) + "_") + request[12]) + kUserBorrowAssetId), request[10])] | |
559 | 559 | let entries = replanishEntries(pool, user, userStaked, axlyFee, posNum, shareId) | |
560 | 560 | $Tuple2(((entries ++ borrowEntries) :+ DeleteEntry((requestId + kRequestId))), userStaked) | |
561 | 561 | } | |
562 | 562 | } | |
563 | 563 | ||
564 | 564 | ||
565 | 565 | ||
566 | 566 | @Callable(i) | |
567 | 567 | func withdraw (pool,posId) = { | |
568 | 568 | let user = toString(i.caller) | |
569 | 569 | let pType = valueOrErrorMessage(getString(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), "Can't find position") | |
570 | 570 | let pAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)) | |
571 | 571 | let userInterest = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionInterest)) | |
572 | 572 | let poolInterst = getIntegerValue(this, (pool + kPoolInterest)) | |
573 | 573 | let poolTotalShare = getIntegerValue(this, (pool + kPoolTotal)) | |
574 | 574 | let userCanWithdraw = (pAmount + fraction(pAmount, (poolInterst - userInterest), SCALE10)) | |
575 | 575 | let poolAddr = Address(fromBase58String(pool)) | |
576 | 576 | let userAddr = Address(fromBase58String(user)) | |
577 | 577 | let borrowAmount = getIntegerValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAmount)) | |
578 | 578 | let borrowAsset = getStringValue(this, (((((pool + "_") + user) + "_") + toString(posId)) + kUserBorrowAssetId)) | |
579 | 579 | let $t01964619746 = getPoolData(Address(fromBase58String(pool)), pType) | |
580 | 580 | let assetIdA = $t01964619746._1 | |
581 | 581 | let assetIdB = $t01964619746._2 | |
582 | 582 | let balA = $t01964619746._3 | |
583 | 583 | let balB = $t01964619746._4 | |
584 | 584 | let shareId = $t01964619746._5 | |
585 | 585 | let cBalABefore = accountBalance(assetIdFromStr(assetIdA)) | |
586 | 586 | if ((cBalABefore == cBalABefore)) | |
587 | 587 | then { | |
588 | 588 | let cBalBBefore = accountBalance(assetIdFromStr(assetIdB)) | |
589 | 589 | if ((cBalBBefore == cBalBBefore)) | |
590 | 590 | then { | |
591 | 591 | let inv = if ((pType == SF_POS_TYPE)) | |
592 | 592 | then invoke(poolAddr, "callFunction", ["withdraw", [toString(userCanWithdraw)]], nil) | |
593 | 593 | else if ((pType == WX_POS_TYPE)) | |
594 | 594 | then invoke(poolAddr, "unstakeAndGet", [userCanWithdraw], nil) | |
595 | 595 | else throw("Wrong position type") | |
596 | 596 | if ((inv == inv)) | |
597 | 597 | then { | |
598 | 598 | let cBalAAfter = accountBalance(assetIdFromStr(assetIdA)) | |
599 | 599 | let cBalBAfter = accountBalance(assetIdFromStr(assetIdB)) | |
600 | 600 | let $t02026620355 = $Tuple2((cBalAAfter - cBalABefore), (cBalBAfter - cBalBBefore)) | |
601 | 601 | let tokensAmountA = $t02026620355._1 | |
602 | 602 | let tokensAmountB = $t02026620355._2 | |
603 | 603 | [DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPositionType)), DeleteEntry((((((pool + "_") + user) + "_") + toString(posId)) + kUserPosition)), IntegerEntry((pool + kPoolTotal), (poolTotalShare - userCanWithdraw)), ScriptTransfer(userAddr, tokensAmountA, assetIdFromStr(assetIdA)), ScriptTransfer(userAddr, tokensAmountB, assetIdFromStr(assetIdB))] | |
604 | 604 | } | |
605 | 605 | else throw("Strict value is not equal to itself.") | |
606 | 606 | } | |
607 | 607 | else throw("Strict value is not equal to itself.") | |
608 | 608 | } | |
609 | 609 | else throw("Strict value is not equal to itself.") | |
610 | 610 | } | |
611 | 611 | ||
612 | 612 | ||
613 | 613 | ||
614 | 614 | @Callable(i) | |
615 | 615 | func createNewRequest (params) = valueOrElse(isSelfCall(i), { | |
616 | 616 | let newRequestId = (valueOrElse(getInteger(this, kRequestIter), 0) + 1) | |
617 | 617 | $Tuple2([StringEntry((toString(newRequestId) + kRequestId), params), IntegerEntry(kRequestIter, newRequestId)], newRequestId) | |
618 | 618 | }) | |
619 | 619 | ||
620 | 620 | ||
621 | 621 | ||
622 | 622 | @Callable(i) | |
623 | 623 | func capitalizeExKeeper (pool,type,tokenToId,amountToExchange,claim,amountsIn,addresses,assetsToReceive,estReceived,slippageTolerance,minReceived,options) = { | |
624 | 624 | let $t02146121659 = if (claim) | |
625 | 625 | then claimFarmed(type, pool) | |
626 | 626 | else { | |
627 | 627 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
628 | 628 | then SWOPID | |
629 | 629 | else WXID | |
630 | 630 | $Tuple2(amountToExchange, claimedAsset) | |
631 | 631 | } | |
632 | 632 | let claimedAmount = $t02146121659._1 | |
633 | 633 | let claimedAsset = $t02146121659._2 | |
634 | 634 | let exchangedAmount = exchangeKeeper(tokenToId, amountToExchange, claimedAsset, amountsIn, addresses, assetsToReceive, estReceived, slippageTolerance, minReceived, options) | |
635 | 635 | let change = (claimedAmount - amountToExchange) | |
636 | 636 | let changeEntry = if ((change > 0)) | |
637 | 637 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
638 | 638 | else nil | |
639 | 639 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
640 | 640 | } | |
641 | 641 | ||
642 | 642 | ||
643 | 643 | ||
644 | 644 | @Callable(i) | |
645 | 645 | func capitalizeExPazzle (pool,type,tokenToId,amountToExchange,claim,routesStr,minToReceive,options) = { | |
646 | 646 | let $t02231522513 = if (claim) | |
647 | 647 | then claimFarmed(type, pool) | |
648 | 648 | else { | |
649 | 649 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
650 | 650 | then SWOPID | |
651 | 651 | else WXID | |
652 | 652 | $Tuple2(amountToExchange, claimedAsset) | |
653 | 653 | } | |
654 | 654 | let claimedAmount = $t02231522513._1 | |
655 | 655 | let claimedAsset = $t02231522513._2 | |
656 | 656 | let exchangedAmount = exchangePazzle(tokenToId, amountToExchange, claimedAsset, routesStr, minToReceive, options) | |
657 | 657 | let change = (claimedAmount - amountToExchange) | |
658 | 658 | let changeEntry = if ((change > 0)) | |
659 | 659 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
660 | 660 | else nil | |
661 | 661 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
662 | 662 | } | |
663 | 663 | ||
664 | 664 | ||
665 | 665 | ||
666 | 666 | @Callable(i) | |
667 | 667 | func capitalizeExSwopFi (pool,type,tokenToId,amountToExchange,claim,exchangers,exchangersType,args1,args2,routingAssetsKeys,minAmountToReceive,options) = { | |
668 | 668 | let $t02323623434 = if (claim) | |
669 | 669 | then claimFarmed(type, pool) | |
670 | 670 | else { | |
671 | 671 | let claimedAsset = if ((type == SF_POS_TYPE)) | |
672 | 672 | then SWOPID | |
673 | 673 | else WXID | |
674 | 674 | $Tuple2(amountToExchange, claimedAsset) | |
675 | 675 | } | |
676 | 676 | let claimedAmount = $t02323623434._1 | |
677 | 677 | let claimedAsset = $t02323623434._2 | |
678 | 678 | let exchangedAmount = exchangeSwopFi(tokenToId, amountToExchange, claimedAsset, exchangers, exchangersType, args1, args2, routingAssetsKeys, minAmountToReceive, options) | |
679 | 679 | let change = (claimedAmount - amountToExchange) | |
680 | 680 | let changeEntry = if ((change > 0)) | |
681 | 681 | then [IntegerEntry((pool + kPoolCapChange), (change + valueOrElse(getInteger(this, (pool + kPoolCapChange)), 0)))] | |
682 | 682 | else nil | |
683 | 683 | (capitalize(pool, type, tokenToId, exchangedAmount) ++ changeEntry) | |
684 | 684 | } | |
685 | 685 | ||
686 | 686 | ||
687 | 687 | ||
688 | 688 | @Callable(i) | |
689 | 689 | func initNewPool (type,poolAddr,inFeeNoLoan,inFeeLoan,capFee) = if (if ((type != SF_POS_TYPE)) | |
690 | 690 | then (type != WX_POS_TYPE) | |
691 | 691 | else false) | |
692 | 692 | then throw("Wrong type") | |
693 | - | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), StringEntry((kPool + poolAddr), type)] | |
693 | + | else [IntegerEntry((poolAddr + kAxlyInFeeWithoutLoan), inFeeNoLoan), IntegerEntry((poolAddr + kAxlyInFeeWithLoan), inFeeLoan), IntegerEntry((poolAddr + kAxlyCapFee), capFee), IntegerEntry((poolAddr + kPoolInterest), 0), StringEntry((kPool + poolAddr), type)] | |
694 | 694 | ||
695 | 695 | ||
696 | 696 | @Verifier(tx) | |
697 | 697 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
698 | 698 |
github/deemru/w8io/169f3d6 125.31 ms ◑