tx · 2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU: -0.04000000 Waves 2021.09.02 00:08 [1684488] smart account 3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU > SELF 0.00000000 Waves
{ "type": 13, "id": "2EybzTBaxU1BEA75NcGobNMj8umFXjPX6A8FmZVDxbRz", "fee": 4000000, "feeAssetId": null, "timestamp": 1630530546854, "version": 2, "chainId": 84, "sender": "3MyfKzBNordUSxbv54zj1hxm98ojcDvaiXU", "senderPublicKey": "EhGswdVQkp8SXCWyKvRCUKYDidTrRjnzTPa8CZk6GYgN", "proofs": [ "5HAMVp8SpEEyd3x23fFYc5xHDWdhfF6Cahrm5PiBoEWYGneP6787U9wBKa2XjfdRcGmtdZXRUQruLBTVsdeg27TN" ], "script": "base64:AAIFAAAAAAAAABoIAhIECgIIBBIDCgEIEgYKBAgICAgSAwoBCAAAACgAAAAACmJhc2VGYWN0b3IAAAAAAAAAA+gAAAAACWJhc2VJbmRleAAAI4byb8EAAAAAAAANYmxvY2tzUGVyWWVhcgAAAAAAAAgFIAAAAAAGY29uZmlnCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAABHRoaXMCAAAADWNvbmZpZ0FkZHJlc3MCAAAAAAAAAAAFYWRtaW4JAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQdAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQUAAAAGY29uZmlnAgAAAAVhZG1pbgIAAAAAAAAAAAt3YXZldHJvbGxlcgkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABB0AAAACCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAAZjb25maWcCAAAAC3dhdmV0cm9sbGVyAgAAAAAAAAAACmFzc2V0SWRTdWIJAQAAABN2YWx1ZU9yRXJyb3JNZXNzYWdlAAAAAgkABB0AAAACBQAAAAR0aGlzAgAAAAdhc3NldElk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0eAAAAA9zZW5kZXJQdWJsaWNLZXnA/nqd", "height": 1684488, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: G8rXyivHFiyBJ7BgnrrUQ23P1hjdkn1HDxoBQ7LxM2Ww Next: 44vcH6UD2Su3C9yWRWt5W6JbbHT1Yfmk3j7RoMkVw1Fg Diff:
Old | New | Differences | |
---|---|---|---|
91 | 91 | ||
92 | 92 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
93 | 93 | ||
94 | - | let | |
94 | + | let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
95 | 95 | ||
96 | 96 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
97 | 97 | ||
98 | - | let | |
98 | + | let exchangeRate = if ((dTokenSupply > 0)) | |
99 | 99 | then { | |
100 | 100 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
101 | 101 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
102 | - | fraction( | |
102 | + | fraction(currentTotalSupply, mantissa, dTokenSupply) | |
103 | 103 | } | |
104 | 104 | else 20000000000000000 | |
105 | 105 | ||
106 | - | func | |
106 | + | func calcDTokenAmount (assetAmount) = { | |
107 | 107 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
108 | 108 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
109 | - | fraction(assetAmount, mantissa, dTokenExchangeRate) | |
109 | + | fraction(assetAmount, mantissa, exchangeRate) | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | func calcAssetAmount (dTokenAmount) = { | |
114 | + | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
115 | + | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
116 | + | fraction(dTokenAmount, exchangeRate, mantissa) | |
110 | 117 | } | |
111 | 118 | ||
112 | 119 | ||
113 | 120 | @Callable(i) | |
114 | 121 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
115 | 122 | then { | |
116 | - | let userTokenAmount = | |
123 | + | let userTokenAmount = calcDTokenAmount(i.payments[0].amount) | |
117 | 124 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
118 | 125 | if (isCollateral) | |
119 | 126 | then { | |
120 | 127 | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
121 | - | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", ( | |
128 | + | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true)], (toString(i.payments[0].amount) + "were successfully locked")) | |
122 | 129 | } | |
123 | - | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
130 | + | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
131 | + | } | |
132 | + | else throw("Address does not match with wavetroller address!") | |
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | @Callable(i) | |
137 | + | func withdraw (user) = if (isWavetroller(i.caller)) | |
138 | + | then { | |
139 | + | let availableLiquidity = (currentTotalSupply - currentTotalBorrow) | |
140 | + | if ((i.payments[0].amount > 0)) | |
141 | + | then { | |
142 | + | let requestedAssetAmount = calcAssetAmount(i.payments[0].amount) | |
143 | + | if ((availableLiquidity >= requestedAssetAmount)) | |
144 | + | then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount) | |
145 | + | else throw("Pool liquidity is not sufficient!") | |
146 | + | } | |
147 | + | else throw("Token amount must be greater than 0!") | |
124 | 148 | } | |
125 | 149 | else throw("Address does not match with wavetroller address!") | |
126 | 150 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let baseFactor = 1000 | |
5 | 5 | ||
6 | 6 | let baseIndex = 10000000000000000 | |
7 | 7 | ||
8 | 8 | let blocksPerYear = 525600 | |
9 | 9 | ||
10 | 10 | let config = valueOrElse(getString(this, "configAddress"), "") | |
11 | 11 | ||
12 | 12 | let admin = valueOrElse(getString(addressFromStringValue(config), "admin"), "") | |
13 | 13 | ||
14 | 14 | let wavetroller = valueOrElse(getString(addressFromStringValue(config), "wavetroller"), "") | |
15 | 15 | ||
16 | 16 | let assetIdSub = valueOrErrorMessage(getString(this, "assetId"), "No assetId could be found in data storage!") | |
17 | 17 | ||
18 | 18 | let assetDecimals = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Decimals")), (("No key " + (assetIdSub + "_Decimals")) + " was found")) | |
19 | 19 | ||
20 | 20 | let multiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Multiplier")), (("No key " + (assetIdSub + "_Multiplier")) + " was found")) | |
21 | 21 | ||
22 | 22 | let kink = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_Kink")), (("No key " + (assetIdSub + "_Kink")) + " was found")) | |
23 | 23 | ||
24 | 24 | let jumpMultiplier = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_JumpMultiplier")), (("No key " + (assetIdSub + "_JumpMultiplier")) + " was found")) | |
25 | 25 | ||
26 | 26 | let baseRate = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_BaseRate")), (("No key " + (assetIdSub + "_BaseRate")) + " was found")) | |
27 | 27 | ||
28 | 28 | let reserveFactor = valueOrErrorMessage(getInteger(addressFromStringValue(config), (assetIdSub + "_ReserveFactor")), (("No key " + (assetIdSub + "_ReserveFactor")) + " was found")) | |
29 | 29 | ||
30 | 30 | let totalBorrow = valueOrElse(getInteger(this, "totalBorrow"), 0) | |
31 | 31 | ||
32 | 32 | let totalSupply = valueOrElse(getInteger(this, "totalSupply"), 0) | |
33 | 33 | ||
34 | 34 | let totalReserve = valueOrElse(getInteger(this, "totalReserve"), 0) | |
35 | 35 | ||
36 | 36 | let dTokenSupply = valueOrErrorMessage(getInteger(this, "dTokenSupply"), "No key dTokenSupply was found") | |
37 | 37 | ||
38 | 38 | let dTokenDecimals = valueOrErrorMessage(getInteger(this, "dTokenDecimals"), "No key dTokenDecimals was found") | |
39 | 39 | ||
40 | 40 | let dTokenId = valueOrErrorMessage(getString(this, "dTokenId"), "No key dTokenId was found") | |
41 | 41 | ||
42 | 42 | let storedHeight = valueOrElse(getInteger(this, "storedHeight"), height) | |
43 | 43 | ||
44 | 44 | let storedIndex = valueOrElse(getInteger(this, "storedIndex"), 10000000000000000) | |
45 | 45 | ||
46 | 46 | func isAdminAddress (address) = if ((addressFromStringValue(admin) == address)) | |
47 | 47 | then true | |
48 | 48 | else false | |
49 | 49 | ||
50 | 50 | ||
51 | 51 | func isWavetroller (address) = if ((addressFromStringValue(wavetroller) == address)) | |
52 | 52 | then true | |
53 | 53 | else false | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | func isAcceptableAssetId (assetId) = if ((assetId == assetIdSub)) | |
57 | 57 | then true | |
58 | 58 | else false | |
59 | 59 | ||
60 | 60 | ||
61 | 61 | func writeString (key,stringValue) = StringEntry(key, stringValue) | |
62 | 62 | ||
63 | 63 | ||
64 | 64 | func writeInteger (key,integerValue) = IntegerEntry(key, integerValue) | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | func userlockedBalance (userAddress) = valueOrElse(getInteger(this, (userAddress + "_locked")), 0) | |
68 | 68 | ||
69 | 69 | ||
70 | 70 | let utilization = if ((totalSupply > 0)) | |
71 | 71 | then fraction(totalBorrow, baseFactor, totalSupply) | |
72 | 72 | else 0 | |
73 | 73 | ||
74 | 74 | let apr = { | |
75 | 75 | let minValue = [utilization, kink] | |
76 | 76 | let minValueItem = min(minValue) | |
77 | 77 | let maxValue = [0, (utilization - kink)] | |
78 | 78 | let maxValueItem = max(maxValue) | |
79 | 79 | ((fraction(multiplier, minValueItem, baseFactor) + fraction(jumpMultiplier, maxValueItem, baseFactor)) + baseRate) | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 | let apy = fraction(fraction(apr, utilization, baseFactor), (baseFactor - reserveFactor), baseFactor) | |
83 | 83 | ||
84 | 84 | let borrowRatePerBlock = fraction(apr, baseIndex, (blocksPerYear * baseFactor)) | |
85 | 85 | ||
86 | 86 | let deltaBlocks = (height - storedHeight) | |
87 | 87 | ||
88 | 88 | let currentIndex = fraction(storedIndex, (baseIndex + (borrowRatePerBlock * deltaBlocks)), baseIndex, CEILING) | |
89 | 89 | ||
90 | 90 | let currentTotalBorrow = fraction(totalBorrow, currentIndex, storedIndex) | |
91 | 91 | ||
92 | 92 | let collectedInterest = fraction(totalBorrow, (borrowRatePerBlock * deltaBlocks), baseIndex) | |
93 | 93 | ||
94 | - | let | |
94 | + | let currentTotalSupply = (totalSupply + fraction((baseFactor - reserveFactor), collectedInterest, baseFactor)) | |
95 | 95 | ||
96 | 96 | let currentReserve = (totalReserve + fraction(reserveFactor, collectedInterest, baseFactor)) | |
97 | 97 | ||
98 | - | let | |
98 | + | let exchangeRate = if ((dTokenSupply > 0)) | |
99 | 99 | then { | |
100 | 100 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
101 | 101 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
102 | - | fraction( | |
102 | + | fraction(currentTotalSupply, mantissa, dTokenSupply) | |
103 | 103 | } | |
104 | 104 | else 20000000000000000 | |
105 | 105 | ||
106 | - | func | |
106 | + | func calcDTokenAmount (assetAmount) = { | |
107 | 107 | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
108 | 108 | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
109 | - | fraction(assetAmount, mantissa, dTokenExchangeRate) | |
109 | + | fraction(assetAmount, mantissa, exchangeRate) | |
110 | + | } | |
111 | + | ||
112 | + | ||
113 | + | func calcAssetAmount (dTokenAmount) = { | |
114 | + | let exponent = ((18 - dTokenDecimals) + assetDecimals) | |
115 | + | let mantissa = pow(10, 0, exponent, 0, 0, CEILING) | |
116 | + | fraction(dTokenAmount, exchangeRate, mantissa) | |
110 | 117 | } | |
111 | 118 | ||
112 | 119 | ||
113 | 120 | @Callable(i) | |
114 | 121 | func deposit (user,isCollateral) = if (isWavetroller(i.caller)) | |
115 | 122 | then { | |
116 | - | let userTokenAmount = | |
123 | + | let userTokenAmount = calcDTokenAmount(i.payments[0].amount) | |
117 | 124 | let currentDTokenSupply = (dTokenSupply + userTokenAmount) | |
118 | 125 | if (isCollateral) | |
119 | 126 | then { | |
120 | 127 | let lockedUserBalance = (userlockedBalance(user) + userTokenAmount) | |
121 | - | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", ( | |
128 | + | $Tuple2([writeInteger((user + "_locked"), lockedUserBalance), writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true)], (toString(i.payments[0].amount) + "were successfully locked")) | |
122 | 129 | } | |
123 | - | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
130 | + | else $Tuple2([writeInteger("dTokenSupply", currentDTokenSupply), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply + i.payments[0].amount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Reissue(fromBase58String(dTokenId), userTokenAmount, true), ScriptTransfer(i.caller, userTokenAmount, fromBase58String(dTokenId))], userTokenAmount) | |
131 | + | } | |
132 | + | else throw("Address does not match with wavetroller address!") | |
133 | + | ||
134 | + | ||
135 | + | ||
136 | + | @Callable(i) | |
137 | + | func withdraw (user) = if (isWavetroller(i.caller)) | |
138 | + | then { | |
139 | + | let availableLiquidity = (currentTotalSupply - currentTotalBorrow) | |
140 | + | if ((i.payments[0].amount > 0)) | |
141 | + | then { | |
142 | + | let requestedAssetAmount = calcAssetAmount(i.payments[0].amount) | |
143 | + | if ((availableLiquidity >= requestedAssetAmount)) | |
144 | + | then $Tuple2([writeInteger("dTokenSupply", (dTokenSupply - i.payments[0].amount)), writeInteger("totalBorrow", currentTotalBorrow), writeInteger("totalSupply", (currentTotalSupply - requestedAssetAmount)), writeInteger("totalReserve", currentReserve), writeInteger("storedIndex", currentIndex), writeInteger("storedHeight", height), Burn(fromBase58String(dTokenId), i.payments[0].amount), ScriptTransfer(i.caller, requestedAssetAmount, fromBase58String(assetIdSub))], requestedAssetAmount) | |
145 | + | else throw("Pool liquidity is not sufficient!") | |
146 | + | } | |
147 | + | else throw("Token amount must be greater than 0!") | |
124 | 148 | } | |
125 | 149 | else throw("Address does not match with wavetroller address!") | |
126 | 150 | ||
127 | 151 | ||
128 | 152 | ||
129 | 153 | @Callable(i) | |
130 | 154 | func setup (aId,configAdd,tokenName,tokenDescription) = if (!(isDefined(getString(this, "configAddress")))) | |
131 | 155 | then { | |
132 | 156 | let asset = Issue(tokenName, tokenDescription, 0, 8, true) | |
133 | 157 | let tokenId = calculateAssetId(asset) | |
134 | 158 | [asset, writeString("assetId", aId), writeString("configAddress", configAdd), IntegerEntry("totalBorrow", 0), IntegerEntry("totalSupply", 0), IntegerEntry("totalReserve", 0), IntegerEntry("storedIndex", baseIndex), IntegerEntry("storedHeight", height), writeString("dTokenName", tokenName), writeString("dTokenId", toBase58String(tokenId)), IntegerEntry("dTokenDecimals", 8), IntegerEntry("dTokenSupply", 0)] | |
135 | 159 | } | |
136 | 160 | else throw("Pool already setup!") | |
137 | 161 | ||
138 | 162 | ||
139 | 163 | ||
140 | 164 | @Callable(i) | |
141 | 165 | func deletEntry (key) = if (isAdminAddress(i.caller)) | |
142 | 166 | then [DeleteEntry(key)] | |
143 | 167 | else throw("Caller is not an admin!") | |
144 | 168 | ||
145 | 169 | ||
146 | 170 | @Verifier(tx) | |
147 | 171 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
148 | 172 |
github/deemru/w8io/026f985 44.78 ms ◑