tx · 3FUGuFpzbYabvBrmuP7MrXCJY6eQydXzPvJdb1BCu4YJ 3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4: -0.01400000 Waves 2020.10.22 21:51 [1232162] smart account 3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4 > SELF 0.00000000 Waves
{ "type": 13, "id": "3FUGuFpzbYabvBrmuP7MrXCJY6eQydXzPvJdb1BCu4YJ", "fee": 1400000, "feeAssetId": null, "timestamp": 1603392704263, "version": 1, "sender": "3NCD7sCFocnQuSL6gaDqWD9Noq9RCwjCup4", "senderPublicKey": "HuNwRHF9iwGdZDspJ7V7eY2akXjp5fWmTprKuM97CATY", "proofs": [ "coB48q3hptjsVkGr7JqEc9WH7cYBvy2CFNoW1MhijWNbZnQzfxbRz1phNmMnK1MgJ8Bj1ChSKf86tgDeD9qRxGe" ], "script": "base64:AAIEAAAAAAAAABQIAhIAEgASBAoCAQESABIECgIBAQAAABsAAAAACElkVG9rZW5BCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA1hc3NldElkVG9rZW5BAAAAAAhJZFRva2VuQgkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAANYXNzZXRJZFRva2VuQgAAAAAMSWRUb2tlblNoYXJlCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzAgAAAA5zaGFyZV90b2tlbl9pZAAAAAARZEFwcFRva2Vuc0Ftb3VudEEJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQQAAAAARZEFwcFRva2Vuc0Ftb3VudEIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAADGFtb3VudFRva2VuQgAAAAAQdG9rZW5TaGFyZVN1cHBseQkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAASc2hhcmVfd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xjdWxhdGVIb3dNYW55U2VuZFRva2VuQgAAAAUFAAAAFWFtb3VudFRvU2VuZEVzdGltYXRlZAUAAAAVbWluVG9rZW5SZWNpZXZlQW1vdW50BQAAAAxhbW91bnRUb2tlbkEFAAAADGFtb3VudFRva2VuQgUAAAASdG9rZW5SZWNlaXZlQW1vdW50BAAAAAthc3NldElkU2VudAUAAAANYXNzZXRJZFRva2VuQgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAMYW1vdW50VG9rZW5BCQAAZAAAAAIFAAAADGFtb3VudFRva2VuQQUAAAASdG9rZW5SZWNlaXZlQW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAxhbW91bnRUb2tlbkIJAABlAAAAAgUAAAAMYW1vdW50VG9rZW5CBQAAAA90b2tlblNlbmRBbW91bnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAADmV4Y2hhbmdlX2NvdW50CQAAZAAAAAIFAAAABWNvdW50AAAAAAAAAAABCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAlpbnZhcmlhbnQJAQAAAA1pbnZhcmlhbnRDYWxjAAAAAgkAAGQAAAACBQAAAAxhbW91bnRUb2tlbkEFAAAAEnRva2VuUmVjZWl2ZUFtb3VudAkAAGUAAAACBQAAAAxhbW91bnRUb2tlbkIFAAAAD3Rva2VuU2VuZEFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAAKY29udGV4dE9iagAAAAZjYWxsZXIFAAAAD3Rva2VuU2VuZEFtb3VudAUAAAALYXNzZXRJZFNlbnQFAAAAA25pbAkAAAIAAAABAgAAABRBc3NldCBpcyBub3QgYWxsb3dlZAAAAAA/1FvN", "chainId": 84, "height": 1232162, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: AkDPVGtjTXBVAg3XDDHEjcyzDUzwZNdyXE3EqCBVGAGB Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let IdTokenA = getStringValue(this, "assetIdTokenA") | |
5 | + | ||
6 | + | let IdTokenB = getStringValue(this, "assetIdTokenB") | |
7 | + | ||
8 | + | let IdTokenShare = getStringValue(this, "share_token_id") | |
9 | + | ||
10 | + | let dAppTokensAmountA = getIntegerValue(this, "amountTokenA") | |
11 | + | ||
12 | + | let dAppTokensAmountB = getIntegerValue(this, "amountTokenB") | |
13 | + | ||
14 | + | let tokenShareSupply = getIntegerValue(this, "share_token_supply") | |
15 | + | ||
16 | + | let comission = 0 | |
17 | + | ||
18 | + | let comissionScaleDelimiter = 10000 | |
19 | + | ||
20 | + | let version = "2.0.0" | |
21 | + | ||
22 | + | let invariant = getIntegerValue(this, "invariant") | |
23 | + | ||
24 | + | let scaleValue8 = 100000000 | |
25 | + | ||
26 | + | let scaleValue8Digits = 8 | |
27 | + | ||
28 | + | let scaleValue12 = 1000000000000 | |
29 | + | ||
30 | + | let ratioThresholdMax = 100000000 | |
31 | + | ||
32 | + | let ratioThresholdMin = 99999000 | |
33 | + | ||
34 | + | let alpha = 50 | |
35 | + | ||
36 | + | let alphaDigits = 2 | |
37 | + | ||
38 | + | let betta = 46 | |
39 | + | ||
40 | + | let bettaDigits = 2 | |
41 | + | ||
42 | + | func skeweness (x,y) = ((fraction(scaleValue8, x, y) + fraction(scaleValue8, y, x)) / 2) | |
43 | + | ||
44 | + | ||
45 | + | func invariantCalc (x,y) = { | |
46 | + | let sk = skeweness(x, y) | |
47 | + | (fraction((x + y), pow(sk, scaleValue8Digits, -(alpha), alphaDigits, 8, HALFDOWN), scaleValue8) + (2 * fraction(fraction(pow(x, 0, 5, 1, scaleValue8Digits, HALFDOWN), pow(y, 0, 5, 1, scaleValue8Digits, HALFDOWN), (scaleValue8 * scaleValue8)), pow((sk - ((betta * scaleValue8) / 100)), 0, alpha, alphaDigits, scaleValue8Digits, HALFDOWN), scaleValue12))) | |
48 | + | } | |
49 | + | ||
50 | + | ||
51 | + | func assetId (asset) = if ((asset == "WAVES")) | |
52 | + | then unit | |
53 | + | else fromBase58String(asset) | |
54 | + | ||
55 | + | ||
56 | + | func calculateHowManySendTokenA (amountToSendEstimated,minTokenRecieveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = { | |
57 | + | let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000)) | |
58 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantCalc((amountTokenA - amountToSendEstimated), (amountTokenB + tokenReceiveAmount))) | |
59 | + | if (if ((invariantEstimatedRatio > slippageValue)) | |
60 | + | then (scaleValue8 > invariantEstimatedRatio) | |
61 | + | else false) | |
62 | + | then ((amountToSendEstimated * (comissionScaleDelimiter - comission)) / comissionScaleDelimiter) | |
63 | + | else throw("price has changed dramatically. err2") | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | func calculateHowManySendTokenB (amountToSendEstimated,minTokenRecieveAmount,amountTokenA,amountTokenB,tokenReceiveAmount) = { | |
68 | + | let slippageValue = (scaleValue8 - ((scaleValue8 * 1) / 10000)) | |
69 | + | let invariantEstimatedRatio = fraction(invariant, scaleValue8, invariantCalc((amountTokenA + tokenReceiveAmount), (amountTokenB - amountToSendEstimated))) | |
70 | + | if (if ((invariantEstimatedRatio > slippageValue)) | |
71 | + | then (scaleValue8 > invariantEstimatedRatio) | |
72 | + | else false) | |
73 | + | then ((amountToSendEstimated * (comissionScaleDelimiter - comission)) / comissionScaleDelimiter) | |
74 | + | else throw("price has changed dramatically. err2") | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | let assetIdTokenA = assetId(IdTokenA) | |
79 | + | ||
80 | + | let assetIdTokenB = assetId(IdTokenB) | |
81 | + | ||
82 | + | let assetIdTokenShare = fromBase58String(IdTokenShare) | |
83 | + | ||
84 | + | @Callable(contextObj) | |
85 | + | func fund () = { | |
86 | + | let paymentA = value(contextObj.payments[0]) | |
87 | + | let paymentB = value(contextObj.payments[1]) | |
88 | + | let assetIdReceivedA = paymentA.assetId | |
89 | + | let tokenReceiveAmountA = paymentA.amount | |
90 | + | let assetIdReceivedB = paymentB.assetId | |
91 | + | let tokenReceiveAmountB = paymentB.amount | |
92 | + | let digitTokenA = match assetIdReceivedA { | |
93 | + | case p: Unit => | |
94 | + | 8 | |
95 | + | case p: ByteVector => | |
96 | + | value(assetInfo(p)).decimals | |
97 | + | case _ => | |
98 | + | throw("Match error") | |
99 | + | } | |
100 | + | let digitTokenB = match assetIdReceivedB { | |
101 | + | case p: Unit => | |
102 | + | 8 | |
103 | + | case p: ByteVector => | |
104 | + | value(assetInfo(p)).decimals | |
105 | + | case _ => | |
106 | + | throw("Match error") | |
107 | + | } | |
108 | + | if (isDefined(getBoolean(this, "status"))) | |
109 | + | then throw("already active") | |
110 | + | else { | |
111 | + | let shareTokenName = ("ShareT_" + takeRight(toString(this), 5)) | |
112 | + | let digitsInShareToken = ((digitTokenA + digitTokenB) / 2) | |
113 | + | let shareTokenInitialAmount = fraction(pow(tokenReceiveAmountA, digitTokenA, 5, 1, digitTokenA, HALFDOWN), pow(tokenReceiveAmountB, digitTokenB, 5, 1, digitTokenB, HALFDOWN), pow(10, 0, digitsInShareToken, 0, 0, HALFDOWN)) | |
114 | + | let shareTokenAssetId = calculateAssetId(Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true)) | |
115 | + | let assetIdTokenStringA = match assetIdReceivedA { | |
116 | + | case t: Unit => | |
117 | + | "WAVES" | |
118 | + | case t: ByteVector => | |
119 | + | toBase58String(value(assetIdReceivedA)) | |
120 | + | case _ => | |
121 | + | throw("Match error") | |
122 | + | } | |
123 | + | let assetIdTokenStringB = match assetIdReceivedB { | |
124 | + | case t: Unit => | |
125 | + | "WAVES" | |
126 | + | case t: ByteVector => | |
127 | + | toBase58String(value(assetIdReceivedB)) | |
128 | + | case _ => | |
129 | + | throw("Match error") | |
130 | + | } | |
131 | + | let invariantCalcualated = invariantCalc(tokenReceiveAmountA, tokenReceiveAmountB) | |
132 | + | [IntegerEntry("amountTokenA", tokenReceiveAmountA), IntegerEntry("amountTokenB", tokenReceiveAmountB), StringEntry("assetIdTokenA", assetIdTokenStringA), StringEntry("assetIdTokenB", assetIdTokenStringB), IntegerEntry("invariant", invariantCalcualated), IntegerEntry("exchange_count", 0), BooleanEntry("status", true), IntegerEntry("comission", comission), IntegerEntry("comissionScaleDelimiter", comissionScaleDelimiter), StringEntry("version", version), Issue(shareTokenName, shareTokenName, shareTokenInitialAmount, digitsInShareToken, true), ScriptTransfer(contextObj.caller, shareTokenInitialAmount, shareTokenAssetId), StringEntry("share_token_id", toBase58String(shareTokenAssetId)), IntegerEntry("share_token_supply", shareTokenInitialAmount)] | |
133 | + | } | |
134 | + | } | |
135 | + | ||
136 | + | ||
137 | + | ||
138 | + | @Callable(contextObj) | |
139 | + | func replenishmentWithTwoToken () = { | |
140 | + | let paymentA = value(contextObj.payments[0]) | |
141 | + | let paymentB = value(contextObj.payments[1]) | |
142 | + | let assetIdReceivedA = paymentA.assetId | |
143 | + | let tokenReceiveAmountA = paymentA.amount | |
144 | + | let assetIdReceivedB = paymentB.assetId | |
145 | + | let tokenReceiveAmountB = paymentB.amount | |
146 | + | let invariantCalcualated = invariantCalc((dAppTokensAmountA + tokenReceiveAmountA), (dAppTokensAmountB + tokenReceiveAmountB)) | |
147 | + | if (if ((assetIdReceivedA != assetIdTokenA)) | |
148 | + | then true | |
149 | + | else (assetIdReceivedB != assetIdTokenB)) | |
150 | + | then throw("incorrect assets") | |
151 | + | else { | |
152 | + | let tokenRatio = (fraction(tokenReceiveAmountA, (1000000000000 * 1000), dAppTokensAmountA) / fraction(dAppTokensAmountB, 1000000000000, tokenReceiveAmountB)) | |
153 | + | if (!(if ((tokenRatio > 990)) | |
154 | + | then (1010 > tokenRatio) | |
155 | + | else false)) | |
156 | + | then throw("incorrect assets amount") | |
157 | + | else { | |
158 | + | let shareTokenToPayAmount = fraction(tokenReceiveAmountA, tokenShareSupply, dAppTokensAmountA) | |
159 | + | if ((shareTokenToPayAmount == 0)) | |
160 | + | then throw("you try replansish with very small amount") | |
161 | + | else [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", (dAppTokensAmountA + tokenReceiveAmountA)), IntegerEntry("amountTokenB", (dAppTokensAmountB + tokenReceiveAmountB)), IntegerEntry("invariant", invariantCalcualated)] | |
162 | + | } | |
163 | + | } | |
164 | + | } | |
165 | + | ||
166 | + | ||
167 | + | ||
168 | + | @Callable(contextObj) | |
169 | + | func replanishmentWithOneToken (tokenAamountWithOldInvariantNewPrice,tokenBamountWithOldInvariantNewPrice) = { | |
170 | + | let payment = value(contextObj.payments[0]) | |
171 | + | let assetIdReceived = payment.assetId | |
172 | + | let tokenReceiveAmount = payment.amount | |
173 | + | if ((assetIdReceived == assetIdTokenA)) | |
174 | + | then { | |
175 | + | let newAmountTokenA = (dAppTokensAmountA + tokenReceiveAmount) | |
176 | + | let newInvariant = invariantCalc(newAmountTokenA, dAppTokensAmountB) | |
177 | + | let priceAtoBwith8digits = fraction(newAmountTokenA, scaleValue8, dAppTokensAmountB) | |
178 | + | let isCorrectPriceRation = fraction(tokenBamountWithOldInvariantNewPrice, priceAtoBwith8digits, tokenAamountWithOldInvariantNewPrice) | |
179 | + | if (if ((isCorrectPriceRation > ratioThresholdMax)) | |
180 | + | then true | |
181 | + | else (ratioThresholdMin > isCorrectPriceRation)) | |
182 | + | then throw("incorrect function args: price") | |
183 | + | else { | |
184 | + | let calculatedInvariantWithNewPrice = invariantCalc(tokenAamountWithOldInvariantNewPrice, tokenBamountWithOldInvariantNewPrice) | |
185 | + | let isCorrectInvariantRation = fraction(calculatedInvariantWithNewPrice, scaleValue8, invariant) | |
186 | + | if (if ((isCorrectInvariantRation > ratioThresholdMax)) | |
187 | + | then true | |
188 | + | else (ratioThresholdMin > isCorrectInvariantRation)) | |
189 | + | then throw("incorrect function args: invariant") | |
190 | + | else { | |
191 | + | let newTokenShareSupply = fraction(tokenBamountWithOldInvariantNewPrice, tokenShareSupply, dAppTokensAmountB) | |
192 | + | let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply) | |
193 | + | [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenA", newAmountTokenA), IntegerEntry("invariant", newInvariant)] | |
194 | + | } | |
195 | + | } | |
196 | + | } | |
197 | + | else if ((assetIdReceived == assetIdTokenB)) | |
198 | + | then { | |
199 | + | let newAmountTokenB = (dAppTokensAmountB + tokenReceiveAmount) | |
200 | + | let newInvariant = invariantCalc(dAppTokensAmountA, newAmountTokenB) | |
201 | + | let priceAtoBwith8digits = fraction(dAppTokensAmountA, scaleValue8, newAmountTokenB) | |
202 | + | let isCorrectPriceRation = fraction(tokenBamountWithOldInvariantNewPrice, priceAtoBwith8digits, tokenAamountWithOldInvariantNewPrice) | |
203 | + | if (if ((isCorrectPriceRation > ratioThresholdMax)) | |
204 | + | then true | |
205 | + | else (ratioThresholdMin > isCorrectPriceRation)) | |
206 | + | then throw("incorrect function args: price") | |
207 | + | else { | |
208 | + | let calculatedInvariantWithNewPrice = invariantCalc(tokenAamountWithOldInvariantNewPrice, tokenBamountWithOldInvariantNewPrice) | |
209 | + | let isCorrectInvariantRation = fraction(calculatedInvariantWithNewPrice, scaleValue8, invariant) | |
210 | + | if (if ((isCorrectInvariantRation > ratioThresholdMax)) | |
211 | + | then true | |
212 | + | else (ratioThresholdMin > isCorrectInvariantRation)) | |
213 | + | then throw("incorrect function args: invariant") | |
214 | + | else { | |
215 | + | let newTokenShareSupply = fraction(tokenBamountWithOldInvariantNewPrice, tokenShareSupply, dAppTokensAmountB) | |
216 | + | let shareTokenToPayAmount = (newTokenShareSupply - tokenShareSupply) | |
217 | + | [Reissue(assetIdTokenShare, shareTokenToPayAmount, true), ScriptTransfer(contextObj.caller, shareTokenToPayAmount, assetIdTokenShare), IntegerEntry("share_token_supply", (tokenShareSupply + shareTokenToPayAmount)), IntegerEntry("amountTokenB", newAmountTokenB), IntegerEntry("invariant", newInvariant)] | |
218 | + | } | |
219 | + | } | |
220 | + | } | |
221 | + | else throw("incorrect assets in payment") | |
222 | + | } | |
223 | + | ||
224 | + | ||
225 | + | ||
226 | + | @Callable(contextObj) | |
227 | + | func withdraw () = { | |
228 | + | let payment = value(contextObj.payments[0]) | |
229 | + | let assetIdReceived = payment.assetId | |
230 | + | let tokenReceiveAmount = payment.amount | |
231 | + | if ((assetIdTokenShare != assetIdReceived)) | |
232 | + | then throw(("you need to attach share token for this dApp " + toBase58String(assetIdTokenShare))) | |
233 | + | else { | |
234 | + | let tokensToPayA = fraction(tokenReceiveAmount, dAppTokensAmountA, tokenShareSupply) | |
235 | + | let tokensToPayB = fraction(tokenReceiveAmount, dAppTokensAmountB, tokenShareSupply) | |
236 | + | let invariantCalcualated = invariantCalc((dAppTokensAmountA - tokensToPayA), (dAppTokensAmountB - tokensToPayB)) | |
237 | + | [IntegerEntry("amountTokenA", (dAppTokensAmountA - tokensToPayA)), IntegerEntry("amountTokenB", (dAppTokensAmountB - tokensToPayB)), IntegerEntry("share_token_supply", (tokenShareSupply - tokenReceiveAmount)), ScriptTransfer(contextObj.caller, tokensToPayA, assetIdTokenA), ScriptTransfer(contextObj.caller, tokensToPayB, assetIdTokenB), Burn(assetIdTokenShare, tokenReceiveAmount), IntegerEntry("invariant", invariantCalcualated)] | |
238 | + | } | |
239 | + | } | |
240 | + | ||
241 | + | ||
242 | + | ||
243 | + | @Callable(contextObj) | |
244 | + | func exchanger (amountToSendEstimated,minTokenRecieveAmount) = { | |
245 | + | let amountTokenB = getIntegerValue(this, "amountTokenB") | |
246 | + | let amountTokenA = getIntegerValue(this, "amountTokenA") | |
247 | + | let payment = value(contextObj.payments[0]) | |
248 | + | let assetIdReceived = payment.assetId | |
249 | + | let tokenReceiveAmount = payment.amount | |
250 | + | let count = match getInteger(this, "exchange_count") { | |
251 | + | case i: Int => | |
252 | + | (value(getInteger(this, "exchange_count")) + i) | |
253 | + | case _ => | |
254 | + | 0 | |
255 | + | } | |
256 | + | if ((assetIdReceived == assetIdTokenB)) | |
257 | + | then { | |
258 | + | let tokenSendAmount = calculateHowManySendTokenA(amountToSendEstimated, minTokenRecieveAmount, amountTokenA, amountTokenB, tokenReceiveAmount) | |
259 | + | let assetIdSent = assetIdTokenA | |
260 | + | [IntegerEntry("amountTokenA", (amountTokenA - tokenSendAmount)), IntegerEntry("amountTokenB", (amountTokenB + tokenReceiveAmount)), IntegerEntry("exchange_count", (count + 1)), IntegerEntry("invariant", invariantCalc((amountTokenA - tokenSendAmount), (amountTokenB + tokenReceiveAmount))), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)] | |
261 | + | } | |
262 | + | else if ((assetIdReceived == assetIdTokenA)) | |
263 | + | then { | |
264 | + | let tokenSendAmount = calculateHowManySendTokenB(amountToSendEstimated, minTokenRecieveAmount, amountTokenA, amountTokenB, tokenReceiveAmount) | |
265 | + | let assetIdSent = assetIdTokenB | |
266 | + | [IntegerEntry("amountTokenA", (amountTokenA + tokenReceiveAmount)), IntegerEntry("amountTokenB", (amountTokenB - tokenSendAmount)), IntegerEntry("exchange_count", (count + 1)), IntegerEntry("invariant", invariantCalc((amountTokenA + tokenReceiveAmount), (amountTokenB - tokenSendAmount))), ScriptTransfer(contextObj.caller, tokenSendAmount, assetIdSent)] | |
267 | + | } | |
268 | + | else throw("Asset is not allowed") | |
269 | + | } | |
270 | + | ||
271 | + |
github/deemru/w8io/169f3d6 26.33 ms ◑