tx · H863h5AyEQizZyQHUPdxYX7Nfe34UqqdMYZVvve5mxbB 3ND2Uc6nLqw6E8ZrXhAr6nxUdLj42dPUSZq: -0.01500000 Waves 2023.10.30 19:12 [2821595] smart account 3ND2Uc6nLqw6E8ZrXhAr6nxUdLj42dPUSZq > SELF 0.00000000 Waves
{ "type": 13, "id": "H863h5AyEQizZyQHUPdxYX7Nfe34UqqdMYZVvve5mxbB", "fee": 1500000, "feeAssetId": null, "timestamp": 1698682431741, "version": 2, "chainId": 84, "sender": "3ND2Uc6nLqw6E8ZrXhAr6nxUdLj42dPUSZq", "senderPublicKey": "12BQCrHZPntS89uGfjkawkVfX5XbHXybSRxx4njSkt8N", "proofs": [ "3MKbfdSQumNCWNopTxcKhTmgG7VyDRG8bnXZJjCE5cSHCKgwD8z6WzncdWVJ4yZ73rQy76W9AuAx8ENcSGwjzSsh" ], "script": "base64:BgIPCAISBQoDCAgIEgQKAggILgAFV2F2ZXMCBVdBVkVTAAZTY2FsZTYAwIQ9AAZTY2FsZTgAgMLXLwAJU2NhbGU4QmlnCQC2AgEAgMLXLwAHU2NhbGUxMACAyK+gJQAHU2NhbGUxNgCAgIT+pt7hEQAKU2NhbGUxNkJpZwkAtgIBAICAhP6m3uERAAlkYXlCbG9ja3MAoAsACnllYXJCbG9ja3MAoIogAA15ZWFyQmxvY2tzQmlnCQC2AgEAoIogAAtyZXNlcnZlRnVuZAAUAAVhcnIxMgkAzAgCAAAJAMwIAgABCQDMCAIAAgkAzAgCAAMJAMwIAgAECQDMCAIABQkAzAgCAAYJAMwIAgAHCQDMCAIACAkAzAgCAAkJAMwIAgAKCQDMCAIACwUDbmlsAAl1c2R0SWRTdHICLDl3YzNMWE5BNFRFQnNYeUt0b0xFOW1yYkREN1dNSFh2WHJDalp2YWJMQXNpAAl1c2RjSWRTdHICLEhHZ2FiVHFVUzhXdFZGVUp6Zm1yVERNZ0VjY0p1WkxCUGhGZ1FGeHZuc29XAA1vcmFjbGVBZGRyZXNzCQEHQWR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3RhbEJvcnJvdwUFYlJhdGUEAnVyCQELZ2V0QWN0dWFsVXICBQZzdXBwbHkFBmJvcnJvdwQJc3VwcGx5QXB5CQEMZ2V0U3VwcGx5QXB5AgUEcmF0ZQUCdXIJAJQKAgUDbmlsBQlzdXBwbHlBcHkBAnR4AQZ2ZXJpZnkACQD0AwMIBQJ0eAlib2R5Qnl0ZXMJAJEDAggFAnR4BnByb29mcwAACAUCdHgPc2VuZGVyUHVibGljS2V5mY3AbA==", "height": 2821595, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let Waves = "WAVES" | |
5 | + | ||
6 | + | let Scale6 = 1000000 | |
7 | + | ||
8 | + | let Scale8 = 100000000 | |
9 | + | ||
10 | + | let Scale8Big = toBigInt(100000000) | |
11 | + | ||
12 | + | let Scale10 = 10000000000 | |
13 | + | ||
14 | + | let Scale16 = 10000000000000000 | |
15 | + | ||
16 | + | let Scale16Big = toBigInt(10000000000000000) | |
17 | + | ||
18 | + | let dayBlocks = 1440 | |
19 | + | ||
20 | + | let yearBlocks = 525600 | |
21 | + | ||
22 | + | let yearBlocksBig = toBigInt(525600) | |
23 | + | ||
24 | + | let reserveFund = 20 | |
25 | + | ||
26 | + | let arr12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] | |
27 | + | ||
28 | + | let usdtIdStr = "9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" | |
29 | + | ||
30 | + | let usdcIdStr = "HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW" | |
31 | + | ||
32 | + | let oracleAddress = Address(base58'3P8d1E1BLKoD52y3bQJ1bDTd2TD1gpaLn9t') | |
33 | + | ||
34 | + | let axlyAddress = Address(base58'3PLsYkBw7taejV1J3qWPCN2yeyVRu31d5HW') | |
35 | + | ||
36 | + | let axlyLPs = ["7KZbJrVopwJhkdwbe1eFDBbex4dkY63MxjTNjqXtrzj1", "Btw3G1j4wQgdp49PTxaFkNvn75dQtqGDM7ejQppHnWC1", "BiSzFe8nSL78oZaebfoin5vBZ5Pze6d7kaeijLqr5xZe", "F2AKkA513k5yHEJkLsU6vWxCYYk811GpjLhwEv2WGwZ9", "4CQ5CPGLXLbWBUs2JBjKUaRqF49CmKHkwzvPgSvQpAQV", "6iMB6LKSrgv9waEvEnN6Ydyx7dfxPnGcTw8318WVm5bR"] | |
37 | + | ||
38 | + | func getRateCurve (assetIdStr,marketStr) = match marketStr { | |
39 | + | case _ => | |
40 | + | if (("3P4uA5etnZi4AmBabKinq2bMiWU8KcnHZdH" == $match0)) | |
41 | + | then match assetIdStr { | |
42 | + | case _ => | |
43 | + | if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
44 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
45 | + | else if (("HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW" == $match1)) | |
46 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
47 | + | else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match1)) | |
48 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
49 | + | else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match1)) | |
50 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
51 | + | else if (("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" == $match1)) | |
52 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
53 | + | else if (("Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" == $match1)) | |
54 | + | then $Tuple4(2000000, 40000000, 80000000, 150000000) | |
55 | + | else if (("HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS" == $match1)) | |
56 | + | then $Tuple4(0, 100000000, 80000000, 400000000) | |
57 | + | else if (("WAVES" == $match1)) | |
58 | + | then $Tuple4(2000000, 30000000, 80000000, 90000000) | |
59 | + | else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match1)) | |
60 | + | then $Tuple4(0, 20000000, 80000000, 40000000) | |
61 | + | else if (("DSbbhLsSTeDg5Lsiufk2Aneh3DjVqJuPr2M9uU1gwy5p" == $match1)) | |
62 | + | then $Tuple4(0, 20000000, 80000000, 100000000) | |
63 | + | else if (("8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" == $match1)) | |
64 | + | then $Tuple4(0, 30000000, 80000000, 40000000) | |
65 | + | else if (("At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" == $match1)) | |
66 | + | then $Tuple4(0, 25000000, 80000000, 40000000) | |
67 | + | else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == $match1)) | |
68 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
69 | + | else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == $match1)) | |
70 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
71 | + | else if (("5UYBPpq4WoU5n4MwpFkgJnW3Fq4B1u3ukpK33ik4QerR" == $match1)) | |
72 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
73 | + | else if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match1)) | |
74 | + | then $Tuple4(2000000, 40000000, 80000000, 100000000) | |
75 | + | else if (("YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7" == $match1)) | |
76 | + | then $Tuple4(2000000, 30000000, 80000000, 80000000) | |
77 | + | else if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
78 | + | then $Tuple4(0, 50000000, 80000000, 200000000) | |
79 | + | else if (("3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13" == $match1)) | |
80 | + | then $Tuple4(0, 100000000, 80000000, 400000000) | |
81 | + | else $Tuple4(0, 20000000, 80000000, 80000000) | |
82 | + | } | |
83 | + | else if (("3P4DK5VzDwL3vfc5ahUEhtoe5ByZNyacJ3X" == $match0)) | |
84 | + | then match assetIdStr { | |
85 | + | case _ => | |
86 | + | if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
87 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
88 | + | else if (("HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW" == $match1)) | |
89 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
90 | + | else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match1)) | |
91 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
92 | + | else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match1)) | |
93 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
94 | + | else if (("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" == $match1)) | |
95 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
96 | + | else if (("Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" == $match1)) | |
97 | + | then $Tuple4(2000000, 40000000, 80000000, 150000000) | |
98 | + | else if (("HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS" == $match1)) | |
99 | + | then $Tuple4(0, 50000000, 80000000, 400000000) | |
100 | + | else if (("WAVES" == $match1)) | |
101 | + | then $Tuple4(2000000, 30000000, 80000000, 80000000) | |
102 | + | else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match1)) | |
103 | + | then $Tuple4(0, 20000000, 80000000, 40000000) | |
104 | + | else if (("DSbbhLsSTeDg5Lsiufk2Aneh3DjVqJuPr2M9uU1gwy5p" == $match1)) | |
105 | + | then $Tuple4(0, 20000000, 80000000, 100000000) | |
106 | + | else if (("8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" == $match1)) | |
107 | + | then $Tuple4(0, 30000000, 80000000, 40000000) | |
108 | + | else if (("At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" == $match1)) | |
109 | + | then $Tuple4(0, 25000000, 80000000, 40000000) | |
110 | + | else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == $match1)) | |
111 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
112 | + | else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == $match1)) | |
113 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
114 | + | else if (("5UYBPpq4WoU5n4MwpFkgJnW3Fq4B1u3ukpK33ik4QerR" == $match1)) | |
115 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
116 | + | else if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match1)) | |
117 | + | then $Tuple4(2000000, 40000000, 80000000, 100000000) | |
118 | + | else if (("YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7" == $match1)) | |
119 | + | then $Tuple4(2000000, 30000000, 80000000, 80000000) | |
120 | + | else if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
121 | + | then $Tuple4(0, 50000000, 80000000, 200000000) | |
122 | + | else if (("3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13" == $match1)) | |
123 | + | then $Tuple4(0, 100000000, 80000000, 400000000) | |
124 | + | else $Tuple4(0, 20000000, 80000000, 80000000) | |
125 | + | } | |
126 | + | else if (("3PHpuQUPVUoR3AYzFeJzeWJfYLsLTmWssVH" == $match0)) | |
127 | + | then $Tuple4(20000000, 100000000, 60000000, 400000000) | |
128 | + | else if (("3P8Df2b7ywHtLBHBe8PBVQYd3A5MdEEJAou" == $match0)) | |
129 | + | then match assetIdStr { | |
130 | + | case _ => | |
131 | + | if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
132 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
133 | + | else if (("HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW" == $match1)) | |
134 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
135 | + | else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match1)) | |
136 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
137 | + | else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match1)) | |
138 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
139 | + | else if (("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" == $match1)) | |
140 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
141 | + | else if (("Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" == $match1)) | |
142 | + | then $Tuple4(2000000, 40000000, 80000000, 150000000) | |
143 | + | else if (("HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS" == $match1)) | |
144 | + | then $Tuple4(0, 100000000, 80000000, 400000000) | |
145 | + | else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match1)) | |
146 | + | then $Tuple4(0, 20000000, 80000000, 40000000) | |
147 | + | else if (("DSbbhLsSTeDg5Lsiufk2Aneh3DjVqJuPr2M9uU1gwy5p" == $match1)) | |
148 | + | then $Tuple4(0, 20000000, 80000000, 100000000) | |
149 | + | else if (("8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" == $match1)) | |
150 | + | then $Tuple4(0, 30000000, 80000000, 40000000) | |
151 | + | else if (("At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" == $match1)) | |
152 | + | then $Tuple4(0, 25000000, 80000000, 40000000) | |
153 | + | else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == $match1)) | |
154 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
155 | + | else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == $match1)) | |
156 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
157 | + | else if (("5UYBPpq4WoU5n4MwpFkgJnW3Fq4B1u3ukpK33ik4QerR" == $match1)) | |
158 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
159 | + | else if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
160 | + | then $Tuple4(0, 50000000, 80000000, 200000000) | |
161 | + | else if (("3VuV5WTmDz47Dmdn3QpcYjzbSdipjQE4JMdNe1xZpX13" == $match1)) | |
162 | + | then $Tuple4(0, 100000000, 80000000, 400000000) | |
163 | + | else if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match1)) | |
164 | + | then $Tuple4(2000000, 40000000, 80000000, 100000000) | |
165 | + | else if (("YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7" == $match1)) | |
166 | + | then $Tuple4(2000000, 30000000, 80000000, 80000000) | |
167 | + | else if (("WAVES" == $match1)) | |
168 | + | then $Tuple4(2000000, 50000000, 80000000, 100000000) | |
169 | + | else $Tuple4(20000000, 100000000, 60000000, 400000000) | |
170 | + | } | |
171 | + | else if (("3PAd9Aqg3cQSzu26MFYWQYcjSXPVCJtuf5V" == $match0)) | |
172 | + | then match assetIdStr { | |
173 | + | case _ => | |
174 | + | if (("9wc3LXNA4TEBsXyKtoLE9mrbDD7WMHXvXrCjZvabLAsi" == $match1)) | |
175 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
176 | + | else if (("HGgabTqUS8WtVFUJzfmrTDMgEccJuZLBPhFgQFxvnsoW" == $match1)) | |
177 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
178 | + | else if (("34N9YcEETLWn93qYQ64EsP1x89tSruJU44RrEMSXXEPJ" == $match1)) | |
179 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
180 | + | else if (("6XtHjpXbs9RRJP2Sr9GUyVqzACcby9TkThHXnjVC5CDJ" == $match1)) | |
181 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
182 | + | else if (("DG2xFkPdDwKUoBkzGAhQtLpSGzfXLiCYPEzeKH2Ad24p" == $match1)) | |
183 | + | then $Tuple4(2000000, 25000000, 80000000, 100000000) | |
184 | + | else if (("Ajso6nTTjptu2UHLx6hfSXVtHFtRBJCkKYd5SAyj7zf5" == $match1)) | |
185 | + | then $Tuple4(2000000, 40000000, 80000000, 150000000) | |
186 | + | else if (("HEB8Qaw9xrWpWs8tHsiATYGBWDBtP2S7kcPALrMu43AS" == $match1)) | |
187 | + | then $Tuple4(0, 20000000, 80000000, 40000000) | |
188 | + | else if (("WAVES" == $match1)) | |
189 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
190 | + | else if (("Atqv59EYzjFGuitKVnMRk6H8FukjoV3ktPorbEys25on" == $match1)) | |
191 | + | then $Tuple4(0, 20000000, 80000000, 40000000) | |
192 | + | else if (("DSbbhLsSTeDg5Lsiufk2Aneh3DjVqJuPr2M9uU1gwy5p" == $match1)) | |
193 | + | then $Tuple4(0, 20000000, 80000000, 100000000) | |
194 | + | else if (("8t4DPWTwPzpatHA9AkTxWAB47THnYzBsDnoY7fQqbG91" == $match1)) | |
195 | + | then $Tuple4(0, 30000000, 80000000, 40000000) | |
196 | + | else if (("At8D6NFFpheCbvKVnjVoeLL84Eo8NZn6ovManxfLaFWL" == $match1)) | |
197 | + | then $Tuple4(0, 25000000, 80000000, 40000000) | |
198 | + | else if (("8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS" == $match1)) | |
199 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
200 | + | else if (("474jTeYx2r2Va35794tCScAXWJG9hU2HcgxzMowaZUnu" == $match1)) | |
201 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
202 | + | else if (("5UYBPpq4WoU5n4MwpFkgJnW3Fq4B1u3ukpK33ik4QerR" == $match1)) | |
203 | + | then $Tuple4(2000000, 30000000, 80000000, 50000000) | |
204 | + | else if (("2thsACuHmzDMuNezPM32wg9a3BwUzBWDeSKakgz3cw21" == $match1)) | |
205 | + | then $Tuple4(2000000, 40000000, 80000000, 100000000) | |
206 | + | else if (("YiNbofFzC17jEHHCMwrRcpy9MrrjabMMLZxg8g5xmf7" == $match1)) | |
207 | + | then $Tuple4(2000000, 30000000, 80000000, 80000000) | |
208 | + | else $Tuple4(0, 20000000, 80000000, 80000000) | |
209 | + | } | |
210 | + | else throw("Unknown market") | |
211 | + | } | |
212 | + | ||
213 | + | ||
214 | + | func sum (size,data) = { | |
215 | + | func fold (accum,next) = if ((next >= size)) | |
216 | + | then accum | |
217 | + | else (accum + data[next]) | |
218 | + | ||
219 | + | let $l = arr12 | |
220 | + | let $s = size($l) | |
221 | + | let $acc0 = 0 | |
222 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
223 | + | then $a | |
224 | + | else fold($a, $l[$i]) | |
225 | + | ||
226 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
227 | + | then $a | |
228 | + | else throw("List size exceeds 12") | |
229 | + | ||
230 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12) | |
231 | + | } | |
232 | + | ||
233 | + | ||
234 | + | func getSetupTokens (marketAddress) = split(getStringValue(marketAddress, "setup_tokens"), ",") | |
235 | + | ||
236 | + | ||
237 | + | func getTokenPrice (assetIdStr) = if (if ((assetIdStr == usdtIdStr)) | |
238 | + | then true | |
239 | + | else (assetIdStr == usdcIdStr)) | |
240 | + | then 1000000 | |
241 | + | else if (containsElement(axlyLPs, assetIdStr)) | |
242 | + | then { | |
243 | + | let @ = invoke(axlyAddress, "getShareAssetPriceREADONLY", [assetIdStr], nil) | |
244 | + | if ($isInstanceOf(@, "Int")) | |
245 | + | then @ | |
246 | + | else throw(($getType(@) + " couldn't be cast to Int")) | |
247 | + | } | |
248 | + | else { | |
249 | + | let price = getIntegerValue(oracleAddress, (assetIdStr + "_twap5B")) | |
250 | + | price | |
251 | + | } | |
252 | + | ||
253 | + | ||
254 | + | func getAssetScale (assetIdStr) = { | |
255 | + | let decimals = if ((assetIdStr == "WAVES")) | |
256 | + | then 8 | |
257 | + | else value(assetInfo(fromBase58String(assetIdStr))).decimals | |
258 | + | pow(10, 0, decimals, 0, 0, DOWN) | |
259 | + | } | |
260 | + | ||
261 | + | ||
262 | + | func getLastRateHeight (marketAddress) = valueOrElse(getInteger(marketAddress, "lastRateHeight"), 0) | |
263 | + | ||
264 | + | ||
265 | + | func getOutdatedTotalSupply (marketAddress,assetIdStr) = valueOrElse(getInteger(marketAddress, ("total_supplied_" + assetIdStr)), 0) | |
266 | + | ||
267 | + | ||
268 | + | func getOutdatedTotalBorrow (marketAddress,assetIdStr) = valueOrElse(getInteger(marketAddress, ("total_borrowed_" + assetIdStr)), 0) | |
269 | + | ||
270 | + | ||
271 | + | func getOutdatedSRate (marketAddress,assetIdStr) = valueOrElse(getInteger(marketAddress, (assetIdStr + "_sRate")), 0) | |
272 | + | ||
273 | + | ||
274 | + | func getOutdatedBRate (marketAddress,assetIdStr) = valueOrElse(getInteger(marketAddress, (assetIdStr + "_bRate")), 0) | |
275 | + | ||
276 | + | ||
277 | + | func getOutdatedUr (outdatedTotalSupply,outdatedTotalBorrow,outdatedSRate,outdatedBRate) = { | |
278 | + | let down = fraction(outdatedTotalSupply, outdatedSRate, Scale16) | |
279 | + | if ((down == 0)) | |
280 | + | then 0 | |
281 | + | else fraction(Scale8, fraction(outdatedTotalBorrow, outdatedBRate, Scale16), down) | |
282 | + | } | |
283 | + | ||
284 | + | ||
285 | + | func getRate (outdatedUr,assetIdStr,marketStr) = { | |
286 | + | let curve = getRateCurve(assetIdStr, marketStr) | |
287 | + | (curve._1 + (if ((curve._3 >= outdatedUr)) | |
288 | + | then fraction(outdatedUr, curve._2, curve._3) | |
289 | + | else (curve._2 + fraction((outdatedUr - curve._3), curve._4, (100000000 - curve._3))))) | |
290 | + | } | |
291 | + | ||
292 | + | ||
293 | + | func getInterest (rate) = max([fraction(rate, Scale8, yearBlocks), 1]) | |
294 | + | ||
295 | + | ||
296 | + | func getAssetIndex (setupTokens,assetIdStr) = value(indexOf(setupTokens, assetIdStr)) | |
297 | + | ||
298 | + | ||
299 | + | func getAssetParamters (marketParameters,assetIndex) = $Tuple3(marketParameters._1[assetIndex], marketParameters._2[assetIndex], marketParameters._3[assetIndex]) | |
300 | + | ||
301 | + | ||
302 | + | func getMarketParameters (marketAddress,setupTokens) = { | |
303 | + | let setupCf = split(getStringValue(marketAddress, "setup_ltvs"), ",") | |
304 | + | let setupLt = split(getStringValue(marketAddress, "setup_lts"), ",") | |
305 | + | let setupPenalty = split(getStringValue(marketAddress, "setup_penalties"), ",") | |
306 | + | let tokensSize = size(setupTokens) | |
307 | + | func fold (accum,next) = if ((next >= tokensSize)) | |
308 | + | then accum | |
309 | + | else $Tuple3((accum._1 :+ parseIntValue(setupCf[next])), (accum._2 :+ parseIntValue(setupLt[next])), (accum._3 :+ parseIntValue(setupPenalty[next]))) | |
310 | + | ||
311 | + | let $l = arr12 | |
312 | + | let $s = size($l) | |
313 | + | let $acc0 = $Tuple3(nil, nil, nil) | |
314 | + | func $f0_1 ($a,$i) = if (($i >= $s)) | |
315 | + | then $a | |
316 | + | else fold($a, $l[$i]) | |
317 | + | ||
318 | + | func $f0_2 ($a,$i) = if (($i >= $s)) | |
319 | + | then $a | |
320 | + | else throw("List size exceeds 12") | |
321 | + | ||
322 | + | $f0_2($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12) | |
323 | + | } | |
324 | + | ||
325 | + | ||
326 | + | func getMaxSupply (marketAddress,assetIdStr) = parseIntValue(valueOrElse(getString(marketAddress, ("setup_maxSupply_" + assetIdStr)), "0")) | |
327 | + | ||
328 | + | ||
329 | + | func getActualSRate (lastRateHeight,interest,outdatedUr,outdatedSRate) = { | |
330 | + | let lastSRate = max([outdatedSRate, Scale16]) | |
331 | + | let newSRate = (lastSRate + ((((height - lastRateHeight) * fraction(interest, outdatedUr, Scale8)) * (100 - reserveFund)) / 100)) | |
332 | + | newSRate | |
333 | + | } | |
334 | + | ||
335 | + | ||
336 | + | func getActualBRate (lastRateHeight,interest,outdatedBRate) = { | |
337 | + | let lastBRate = max([outdatedBRate, Scale16]) | |
338 | + | let newBRate = (lastBRate + ((height - lastRateHeight) * interest)) | |
339 | + | newBRate | |
340 | + | } | |
341 | + | ||
342 | + | ||
343 | + | func getActualUr (actualSupply,actualBorrow) = fraction(actualBorrow, Scale8, actualSupply) | |
344 | + | ||
345 | + | ||
346 | + | func getActualAmount (outdatedAmount,actualRate) = fraction(outdatedAmount, actualRate, Scale16) | |
347 | + | ||
348 | + | ||
349 | + | func getInUsd (actualAmount,assetScale,price) = fraction(actualAmount, price, assetScale) | |
350 | + | ||
351 | + | ||
352 | + | func getSupplyApy (rate,actualUr) = { | |
353 | + | let supplyRate = fraction(fraction(rate, 80, 100), actualUr, Scale8) | |
354 | + | (toInt(pow((Scale16Big + fraction(toBigInt(supplyRate), Scale8Big, yearBlocksBig)), 16, yearBlocksBig, 0, 8, DOWN)) - Scale8) | |
355 | + | } | |
356 | + | ||
357 | + | ||
358 | + | func getBorrowApy (rate) = (toInt(pow((Scale16Big + fraction(toBigInt(rate), Scale8Big, yearBlocksBig)), 16, yearBlocksBig, 0, 8, DOWN)) - Scale8) | |
359 | + | ||
360 | + | ||
361 | + | func getWalletSupply (marketAddress,assetIdStr,wallet,actualSRate) = { | |
362 | + | let outdatedWalletSupply = valueOrElse(getInteger(marketAddress, ((wallet + "_supplied_") + assetIdStr)), 0) | |
363 | + | getActualAmount(outdatedWalletSupply, actualSRate) | |
364 | + | } | |
365 | + | ||
366 | + | ||
367 | + | func getWalletBorrow (marketAddress,assetIdStr,wallet,actualBRate) = { | |
368 | + | let outdatedWalletBorrow = valueOrElse(getInteger(marketAddress, ((wallet + "_borrowed_") + assetIdStr)), 0) | |
369 | + | getActualAmount(outdatedWalletBorrow, actualBRate) | |
370 | + | } | |
371 | + | ||
372 | + | ||
373 | + | func getDailyPercents (apy,quantity) = fraction(fraction((toInt(pow((Scale8Big + toBigInt(apy)), 8, (Scale16Big / yearBlocksBig), 16, 16, DOWN)) - Scale16), dayBlocks, Scale8), quantity, Scale8) | |
374 | + | ||
375 | + | ||
376 | + | func getAccountHealth (totalWalletBorrowLimitInUsd,totalWalletBorrowUsageInUsd) = if ((totalWalletBorrowLimitInUsd == 0)) | |
377 | + | then Scale8 | |
378 | + | else (Scale8 - fraction(totalWalletBorrowUsageInUsd, Scale8, totalWalletBorrowLimitInUsd)) | |
379 | + | ||
380 | + | ||
381 | + | func getNetApy (totalWalletSupplyInUsd,totalWalletBorrowInUsd,totalWalletMarginInUsd) = if ((totalWalletMarginInUsd == 0)) | |
382 | + | then 0 | |
383 | + | else if ((totalWalletMarginInUsd > 0)) | |
384 | + | then fraction(totalWalletMarginInUsd, Scale8, totalWalletSupplyInUsd) | |
385 | + | else fraction(totalWalletMarginInUsd, Scale8, totalWalletBorrowInUsd) | |
386 | + | ||
387 | + | ||
388 | + | @Callable(i) | |
389 | + | func assetSupplyByAddressREADONLY (marketStr,assetIdStr,wallet) = { | |
390 | + | let currentMarketAddress = addressFromStringValue(marketStr) | |
391 | + | let currentLastRateHeight = getLastRateHeight(currentMarketAddress) | |
392 | + | let outdatedTotalSupply = getOutdatedTotalSupply(currentMarketAddress, assetIdStr) | |
393 | + | let outdatedTotalBorrow = getOutdatedTotalBorrow(currentMarketAddress, assetIdStr) | |
394 | + | let outdatedSRate = getOutdatedSRate(currentMarketAddress, assetIdStr) | |
395 | + | let outdatedBRate = getOutdatedBRate(currentMarketAddress, assetIdStr) | |
396 | + | let outdatedUr = getOutdatedUr(outdatedTotalSupply, outdatedTotalBorrow, outdatedSRate, outdatedBRate) | |
397 | + | let rate = getRate(outdatedUr, assetIdStr, marketStr) | |
398 | + | let interest = getInterest(rate) | |
399 | + | let sRate = getActualSRate(currentLastRateHeight, interest, outdatedUr, outdatedSRate) | |
400 | + | let bRate = getActualBRate(currentLastRateHeight, interest, outdatedBRate) | |
401 | + | let supply = getActualAmount(outdatedTotalSupply, sRate) | |
402 | + | let borrow = getActualAmount(outdatedTotalBorrow, bRate) | |
403 | + | let ur = getActualUr(supply, borrow) | |
404 | + | let supplyApy = getSupplyApy(rate, ur) | |
405 | + | let borrowApy = getBorrowApy(rate) | |
406 | + | let walletSupply = getWalletSupply(currentMarketAddress, assetIdStr, wallet, sRate) | |
407 | + | $Tuple2(nil, walletSupply) | |
408 | + | } | |
409 | + | ||
410 | + | ||
411 | + | ||
412 | + | @Callable(i) | |
413 | + | func supplyApyREADONLY (marketStr,assetIdStr) = { | |
414 | + | let currentMarketAddress = addressFromStringValue(marketStr) | |
415 | + | let currentSetupTokens = getSetupTokens(currentMarketAddress) | |
416 | + | let currentLastRateHeight = getLastRateHeight(currentMarketAddress) | |
417 | + | let outdatedTotalSupply = getOutdatedTotalSupply(currentMarketAddress, assetIdStr) | |
418 | + | let outdatedTotalBorrow = getOutdatedTotalBorrow(currentMarketAddress, assetIdStr) | |
419 | + | let outdatedSRate = getOutdatedSRate(currentMarketAddress, assetIdStr) | |
420 | + | let outdatedBRate = getOutdatedBRate(currentMarketAddress, assetIdStr) | |
421 | + | let outdatedUr = getOutdatedUr(outdatedTotalSupply, outdatedTotalBorrow, outdatedSRate, outdatedBRate) | |
422 | + | let rate = getRate(outdatedUr, assetIdStr, marketStr) | |
423 | + | let interest = getInterest(rate) | |
424 | + | let sRate = getActualSRate(currentLastRateHeight, interest, outdatedUr, outdatedSRate) | |
425 | + | let bRate = getActualBRate(currentLastRateHeight, interest, outdatedBRate) | |
426 | + | let supply = getActualAmount(outdatedTotalSupply, sRate) | |
427 | + | let borrow = getActualAmount(outdatedTotalBorrow, bRate) | |
428 | + | let ur = getActualUr(supply, borrow) | |
429 | + | let supplyApy = getSupplyApy(rate, ur) | |
430 | + | $Tuple2(nil, supplyApy) | |
431 | + | } | |
432 | + | ||
433 | + | ||
434 | + | @Verifier(tx) | |
435 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
436 | + |
github/deemru/w8io/169f3d6 67.19 ms ◑