tx · CJfPP9nTcmQhWTV9H5z8nbRrrhfbbzXGenHpoukSBZWk 3MxqS3CD3DRbyvyMLCLq3JoiSSi5qTuRMFd: -0.04600000 Waves 2022.06.28 13:03 [2116141] smart account 3MxqS3CD3DRbyvyMLCLq3JoiSSi5qTuRMFd > SELF 0.00000000 Waves
{ "type": 13, "id": "CJfPP9nTcmQhWTV9H5z8nbRrrhfbbzXGenHpoukSBZWk", "fee": 4600000, "feeAssetId": null, "timestamp": 1656410676560, "version": 2, "chainId": 84, "sender": "3MxqS3CD3DRbyvyMLCLq3JoiSSi5qTuRMFd", "senderPublicKey": "3JKx86V3GnbRtGTLNKaRKFkhb7v1aMTLpKMz28o43DE6", "proofs": [ "H7pJPv1LPvWdNzfmAbMBFBxRWDuG9GCbyD4KJqfnGmRuk7BGrjrMbyppTxxu1KcFNnp25YAaPEGdEJgmtnQR6tt" ], "script": "base64:AAIFAAAAAAAAAEUIAhIAEgASCQoHAQEBAQEBARIOCgwBAQEBAQEBCAgIAQESBgoEAQEBARIFCgMBAQESABIDCgEBEgASAwoBCBIAEgMKAQgAAABpAAAAAAlrX29yYV9rZXkCAAAACWtfb3JhX2tleQAAAAAFa19vcmECAAAABWtfb3JhAAAAAAlrX2JhbGFuY2UCAAAACWtfYmFsYW5jZQAAAAAOa19wb3NpdGlvblNpemUCAAAADmtfcG9zaXRpb25TaXplAAAAABBrX3Bvc2l0aW9uTWFyZ2luAgAAABBrX3Bvc2l0aW9uTWFyZ2luAAAAABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAgAAABZrX3Bvc2l0aW9uT3Blbk5vdGlvbmFsAAAAAC5rX3Bvc2l0aW9uTGFzdFVwZGF0ZWRDdW11bGF0aXZlUHJlbWl1bUZyYWN0aW9uAgAAABJrX3Bvc2l0aW9uRnJhY3Rpb24AAAAADWtfaW5pdGlhbGl6ZWQCAAAADWtfaW5pdGlhbGl6ZWQAAAAACGtfcGF1c2VkAgAAAAhrX3BhdXNlZAAAAAAFa19mZW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AAABcwAAAAEFAAAAAng0CQEAAAABcwAAAAEJAQAAAA5nZXRNYXJnaW5SYXRpbwAAAAEFAAAAB190cmFkZXIAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAkBAAAADmFkbWluUHVibGljS2V5AAAAAI/h53Q=", "height": 2116141, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6k3u1m9eQ9qmhJqpkwfX6KXEsDnZLfBztF2Rvw238Ht8 Next: 8wPJuhUvPX4ievTjioZtpy9cWoNCoquJADKrfpRjydjp Diff:
Old | New | Differences | |
---|---|---|---|
43 | 43 | ||
44 | 44 | let k_twap = "k_twap" | |
45 | 45 | ||
46 | + | let k_baseAsstFndDelt = "k_baseAssetDelta" | |
47 | + | ||
46 | 48 | let k_latestCumulativePremiumFraction = "k_latestPremiumFraction" | |
47 | 49 | ||
48 | 50 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
53 | 55 | ||
54 | 56 | let k_baseAssetReserve = "k_bsAstR" | |
55 | 57 | ||
56 | - | let k_ | |
58 | + | let k_baseAsstFndDe1lt = "k_baseAssetDelta" | |
57 | 59 | ||
58 | 60 | let k_totalPositionSize = "k_totalPositionSize" | |
59 | 61 | ||
260 | 262 | if ((priceImpact > maxPriceImpactValue)) | |
261 | 263 | then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue))) | |
262 | 264 | else { | |
263 | - | let $ | |
264 | - | let quoteAssetReserveAfter1 = $ | |
265 | - | let baseAssetReserveAfter1 = $ | |
266 | - | let baseAssetDeltaThisFundingPeriodAfter1 = $ | |
267 | - | let totalPositionSizeAfter1 = $ | |
268 | - | let cumulativeNotionalAfter1 = $ | |
265 | + | let $t0986710115 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
266 | + | let quoteAssetReserveAfter1 = $t0986710115._1 | |
267 | + | let baseAssetReserveAfter1 = $t0986710115._2 | |
268 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t0986710115._3 | |
269 | + | let totalPositionSizeAfter1 = $t0986710115._4 | |
270 | + | let cumulativeNotionalAfter1 = $t0986710115._5 | |
269 | 271 | $Tuple6(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
270 | 272 | } | |
271 | 273 | } | |
277 | 279 | then muld((_latestCPF - _oldPositionLstUpdCPF), _oldPositionSize) | |
278 | 280 | else 0 | |
279 | 281 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
280 | - | let $ | |
282 | + | let $t01073310860 = if ((0 > signedMargin)) | |
281 | 283 | then $Tuple2(0, abs(signedMargin)) | |
282 | 284 | else $Tuple2(abs(signedMargin), 0) | |
283 | - | let remainMargin = $ | |
284 | - | let badDebt = $ | |
285 | + | let remainMargin = $t01073310860._1 | |
286 | + | let badDebt = $t01073310860._2 | |
285 | 287 | $Tuple4(remainMargin, badDebt, fundingPayment, _latestCPF) | |
286 | 288 | } | |
287 | 289 | ||
295 | 297 | else (_baseAssetPoolAmount - _baseAssetAmount) | |
296 | 298 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
297 | 299 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetPoolAmount)) | |
298 | - | let $ | |
299 | - | let quoteAssetReserveAfter1 = $ | |
300 | - | let baseAssetReserveAfter1 = $ | |
301 | - | let baseAssetDeltaThisFundingPeriodAfter1 = $ | |
302 | - | let totalPositionSizeAfter1 = $ | |
303 | - | let cumulativeNotionalAfter1 = $ | |
300 | + | let $t01150911745 = updateReserve(!(_add), quoteAssetSold, _baseAssetAmount) | |
301 | + | let quoteAssetReserveAfter1 = $t01150911745._1 | |
302 | + | let baseAssetReserveAfter1 = $t01150911745._2 | |
303 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t01150911745._3 | |
304 | + | let totalPositionSizeAfter1 = $t01150911745._4 | |
305 | + | let cumulativeNotionalAfter1 = $t01150911745._5 | |
304 | 306 | $Tuple6(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
305 | 307 | } | |
306 | 308 | ||
327 | 329 | ||
328 | 330 | ||
329 | 331 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
330 | - | let $ | |
331 | - | let positionSize = $ | |
332 | - | let positionMargin = $ | |
333 | - | let | |
334 | - | let positionLstUpdCPF = $ | |
332 | + | let $t01252012648 = getPosition(_trader) | |
333 | + | let positionSize = $t01252012648._1 | |
334 | + | let positionMargin = $t01252012648._2 | |
335 | + | let positionOpenNotional = $t01252012648._3 | |
336 | + | let positionLstUpdCPF = $t01252012648._4 | |
335 | 337 | let positionSizeAbs = abs(positionSize) | |
336 | 338 | if ((positionSizeAbs == 0)) | |
337 | 339 | then throw("Invalid position size") | |
339 | 341 | let isShort = (0 > positionSize) | |
340 | 342 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
341 | 343 | then { | |
342 | - | let $ | |
343 | - | let outPositionNotional = $ | |
344 | - | let x1 = $ | |
345 | - | let x2 = $ | |
346 | - | let x3 = $ | |
344 | + | let $t01289513058 = getOutputPriceWithReserves(!(isShort), positionSizeAbs, qtAstR(), bsAstR()) | |
345 | + | let outPositionNotional = $t01289513058._1 | |
346 | + | let x1 = $t01289513058._2 | |
347 | + | let x2 = $t01289513058._3 | |
348 | + | let x3 = $t01289513058._4 | |
347 | 349 | outPositionNotional | |
348 | 350 | } | |
349 | 351 | else (positionSizeAbs * getOracleTwapPrice()) | |
350 | 352 | let unrealizedPnl = if (isShort) | |
351 | - | then ( | |
352 | - | else (positionNotional - | |
353 | + | then (positionOpenNotional - positionNotional) | |
354 | + | else (positionNotional - positionOpenNotional) | |
353 | 355 | $Tuple2(positionNotional, unrealizedPnl) | |
354 | 356 | } | |
355 | 357 | } | |
358 | 360 | func getMarginRatioByOption (_trader,_option) = { | |
359 | 361 | func x () = 0 | |
360 | 362 | ||
361 | - | let $ | |
362 | - | let positionSize = $ | |
363 | - | let positionMargin = $ | |
364 | - | let pon = $ | |
365 | - | let positionLstUpdCPF = $ | |
366 | - | let $ | |
367 | - | let positionNotional = $ | |
368 | - | let unrealizedPnl = $ | |
369 | - | let $ | |
370 | - | let remainMargin = $ | |
371 | - | let badDebt = $ | |
363 | + | let $t01348213593 = getPosition(_trader) | |
364 | + | let positionSize = $t01348213593._1 | |
365 | + | let positionMargin = $t01348213593._2 | |
366 | + | let pon = $t01348213593._3 | |
367 | + | let positionLstUpdCPF = $t01348213593._4 | |
368 | + | let $t01359913692 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
369 | + | let positionNotional = $t01359913692._1 | |
370 | + | let unrealizedPnl = $t01359913692._2 | |
371 | + | let $t01369713863 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
372 | + | let remainMargin = $t01369713863._1 | |
373 | + | let badDebt = $t01369713863._2 | |
372 | 374 | divd((remainMargin - badDebt), positionNotional) | |
373 | 375 | } | |
374 | 376 | ||
377 | 379 | ||
378 | 380 | ||
379 | 381 | func internalClosePosition (_trader) = { | |
380 | - | let $ | |
381 | - | let positionSize = $ | |
382 | - | let positionMargin = $ | |
383 | - | let pon = $ | |
384 | - | let positionLstUpdCPF = $ | |
385 | - | let $ | |
386 | - | let x1 = $ | |
387 | - | let unrealizedPnl = $ | |
388 | - | let $ | |
389 | - | let remainMargin = $ | |
390 | - | let badDebt = $ | |
391 | - | let x2 = $ | |
382 | + | let $t01405914170 = getPosition(_trader) | |
383 | + | let positionSize = $t01405914170._1 | |
384 | + | let positionMargin = $t01405914170._2 | |
385 | + | let pon = $t01405914170._3 | |
386 | + | let positionLstUpdCPF = $t01405914170._4 | |
387 | + | let $t01417614263 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
388 | + | let x1 = $t01417614263._1 | |
389 | + | let unrealizedPnl = $t01417614263._2 | |
390 | + | let $t01426814440 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
391 | + | let remainMargin = $t01426814440._1 | |
392 | + | let badDebt = $t01426814440._2 | |
393 | + | let x2 = $t01426814440._3 | |
392 | 394 | let exchangedPositionSize = -(positionSize) | |
393 | 395 | let realizedPnl = unrealizedPnl | |
394 | 396 | let marginToVault = -(remainMargin) | |
395 | - | let $ | |
396 | - | let exchangedQuoteAssetAmount = $ | |
397 | - | let quoteAssetReserveAfter = $ | |
398 | - | let baseAssetReserveAfter = $ | |
399 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
400 | - | let totalPositionSizeAfter = $ | |
401 | - | let cumulativeNotionalAfter = $ | |
397 | + | let $t01456714900 = getOutputPriceWithReserves((positionSize > 0), abs(positionSize), qtAstR(), bsAstR()) | |
398 | + | let exchangedQuoteAssetAmount = $t01456714900._1 | |
399 | + | let quoteAssetReserveAfter = $t01456714900._2 | |
400 | + | let baseAssetReserveAfter = $t01456714900._3 | |
401 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01456714900._4 | |
402 | + | let totalPositionSizeAfter = $t01456714900._5 | |
403 | + | let cumulativeNotionalAfter = $t01456714900._6 | |
402 | 404 | let openInteresetNotionalAfter = (openInteresetNotional() - pon) | |
403 | 405 | $Tuple11(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter, exchangedQuoteAssetAmount) | |
404 | 406 | } | |
423 | 425 | ||
424 | 426 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
425 | 427 | then $a | |
426 | - | else throw("List size exceeds | |
428 | + | else throw("List size exceeds 20") | |
427 | 429 | ||
428 | - | $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($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
430 | + | $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($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), 13), 14), 15), 16), 17), 18), 19), 20) | |
429 | 431 | } | |
430 | 432 | let maxIndex = max(listF) | |
431 | 433 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
477 | 479 | ||
478 | 480 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
479 | 481 | then $a | |
480 | - | else throw("List size exceeds | |
482 | + | else throw("List size exceeds 20") | |
481 | 483 | ||
482 | - | $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($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
484 | + | $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($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), 13), 14), 15), 16), 17), 18), 19), 20) | |
483 | 485 | } | |
484 | 486 | let newListStrU = dropRight(newListStr, 1) | |
485 | 487 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
576 | 578 | else paused()) | |
577 | 579 | then throw("Invalid decreasePosition parameters") | |
578 | 580 | else { | |
579 | - | let $ | |
580 | - | let oldPositionSize = $ | |
581 | - | let oldPositionMargin = $ | |
582 | - | let oldPositionOpenNotional = $ | |
583 | - | let oldPositionLstUpdCPF = $ | |
581 | + | let $t02345923611 = getPosition(toString(i.caller)) | |
582 | + | let oldPositionSize = $t02345923611._1 | |
583 | + | let oldPositionMargin = $t02345923611._2 | |
584 | + | let oldPositionOpenNotional = $t02345923611._3 | |
585 | + | let oldPositionLstUpdCPF = $t02345923611._4 | |
584 | 586 | let isNewPosition = (oldPositionSize == 0) | |
585 | 587 | let isSameDirection = if ((oldPositionSize > 0)) | |
586 | 588 | then (_direction == DIR_LONG) | |
589 | 591 | then isSameDirection | |
590 | 592 | else false | |
591 | 593 | let isAdd = (_direction == DIR_LONG) | |
592 | - | let $ | |
594 | + | let $t02390026798 = if (if (isNewPosition) | |
593 | 595 | then true | |
594 | 596 | else expandExisting) | |
595 | 597 | then throw("Use increasePosition to open new or increase position") | |
596 | 598 | else { | |
597 | 599 | let openNotional = muld(_amount, _leverage) | |
598 | - | let $ | |
599 | - | let oldPositionNotional = $ | |
600 | - | let unrealizedPnl = $ | |
600 | + | let $t02440524521 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
601 | + | let oldPositionNotional = $t02440524521._1 | |
602 | + | let unrealizedPnl = $t02440524521._2 | |
601 | 603 | if ((oldPositionNotional > openNotional)) | |
602 | 604 | then { | |
603 | - | let $ | |
604 | - | let exchangedPositionSize = $ | |
605 | - | let quoteAssetReserveAfter = $ | |
606 | - | let baseAssetReserveAfter = $ | |
607 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
608 | - | let totalPositionSizeAfter = $ | |
609 | - | let cumulativeNotionalAfter = $ | |
605 | + | let $t02458324863 = swapInput(isAdd, openNotional) | |
606 | + | let exchangedPositionSize = $t02458324863._1 | |
607 | + | let quoteAssetReserveAfter = $t02458324863._2 | |
608 | + | let baseAssetReserveAfter = $t02458324863._3 | |
609 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02458324863._4 | |
610 | + | let totalPositionSizeAfter = $t02458324863._5 | |
611 | + | let cumulativeNotionalAfter = $t02458324863._6 | |
610 | 612 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
611 | 613 | if (if ((_minBaseAssetAmount != 0)) | |
612 | 614 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
616 | 618 | let realizedPnl = if ((oldPositionSize != 0)) | |
617 | 619 | then divd(muld(unrealizedPnl, exchangedPositionSizeAbs), oldPositionSize) | |
618 | 620 | else 0 | |
619 | - | let $ | |
620 | - | let remainMargin = $ | |
621 | - | let badDebt = $ | |
622 | - | let fundingPayment = $ | |
623 | - | let oldLatestCPF = $ | |
621 | + | let $t02540425675 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
622 | + | let remainMargin = $t02540425675._1 | |
623 | + | let badDebt = $t02540425675._2 | |
624 | + | let fundingPayment = $t02540425675._3 | |
625 | + | let oldLatestCPF = $t02540425675._4 | |
624 | 626 | let exchangedQuoteAssetAmount = openNotional | |
625 | 627 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
626 | 628 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
631 | 633 | } | |
632 | 634 | else throw("Close position first") | |
633 | 635 | } | |
634 | - | let newPositionSize = $ | |
635 | - | let newPositionRemainMargin = $ | |
636 | - | let newPosiionOpenNotional = $ | |
637 | - | let newPositionLatestCPF = $ | |
638 | - | let baseAssetReserveAfter = $ | |
639 | - | let quoteAssetReserveAfter = $ | |
640 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
641 | - | let totalPositionSizeAfter = $ | |
642 | - | let cumulativeNotionalAfter = $ | |
643 | - | let openInteresetNotionalAfter = $ | |
636 | + | let newPositionSize = $t02390026798._1 | |
637 | + | let newPositionRemainMargin = $t02390026798._2 | |
638 | + | let newPosiionOpenNotional = $t02390026798._3 | |
639 | + | let newPositionLatestCPF = $t02390026798._4 | |
640 | + | let baseAssetReserveAfter = $t02390026798._5 | |
641 | + | let quoteAssetReserveAfter = $t02390026798._6 | |
642 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02390026798._7 | |
643 | + | let totalPositionSizeAfter = $t02390026798._8 | |
644 | + | let cumulativeNotionalAfter = $t02390026798._9 | |
645 | + | let openInteresetNotionalAfter = $t02390026798._10 | |
644 | 646 | (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPosiionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) | |
645 | 647 | } | |
646 | 648 | ||
670 | 672 | else { | |
671 | 673 | let feeAmount = muld(_rawAmount, fee()) | |
672 | 674 | let _amount = (_rawAmount - feeAmount) | |
673 | - | let $ | |
674 | - | let oldPositionSize = $ | |
675 | - | let oldPositionMargin = $ | |
676 | - | let oldPositionOpenNotional = $ | |
677 | - | let oldPositionLstUpdCPF = $ | |
675 | + | let $t02783327985 = getPosition(toString(i.caller)) | |
676 | + | let oldPositionSize = $t02783327985._1 | |
677 | + | let oldPositionMargin = $t02783327985._2 | |
678 | + | let oldPositionOpenNotional = $t02783327985._3 | |
679 | + | let oldPositionLstUpdCPF = $t02783327985._4 | |
678 | 680 | let isNewPosition = (oldPositionSize == 0) | |
679 | 681 | let isSameDirection = if ((oldPositionSize > 0)) | |
680 | 682 | then (_direction == DIR_LONG) | |
683 | 685 | then isSameDirection | |
684 | 686 | else false | |
685 | 687 | let isAdd = (_direction == DIR_LONG) | |
686 | - | let $ | |
688 | + | let $t02827430563 = if (if (isNewPosition) | |
687 | 689 | then true | |
688 | 690 | else expandExisting) | |
689 | 691 | then { | |
690 | 692 | let openNotional = muld(_amount, _leverage) | |
691 | - | let $ | |
692 | - | let amountBaseAssetBought = $ | |
693 | - | let quoteAssetReserveAfter = $ | |
694 | - | let baseAssetReserveAfter = $ | |
695 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
696 | - | let totalPositionSizeAfter = $ | |
697 | - | let cumulativeNotionalAfter = $ | |
693 | + | let $t02869728949 = swapInput(isAdd, openNotional) | |
694 | + | let amountBaseAssetBought = $t02869728949._1 | |
695 | + | let quoteAssetReserveAfter = $t02869728949._2 | |
696 | + | let baseAssetReserveAfter = $t02869728949._3 | |
697 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02869728949._4 | |
698 | + | let totalPositionSizeAfter = $t02869728949._5 | |
699 | + | let cumulativeNotionalAfter = $t02869728949._6 | |
698 | 700 | if (if ((_minBaseAssetAmount != 0)) | |
699 | 701 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
700 | 702 | else false) | |
702 | 704 | else { | |
703 | 705 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
704 | 706 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
705 | - | let $ | |
706 | - | let remainMargin = $ | |
707 | - | let x1 = $ | |
708 | - | let x2 = $ | |
709 | - | let oldLatestCPF = $ | |
707 | + | let $t02933029583 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
708 | + | let remainMargin = $t02933029583._1 | |
709 | + | let x1 = $t02933029583._2 | |
710 | + | let x2 = $t02933029583._3 | |
711 | + | let oldLatestCPF = $t02933029583._4 | |
710 | 712 | $Tuple10(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), oldLatestCPF, baseAssetReserveAfter, quoteAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInteresetNotional() + openNotional)) | |
711 | 713 | } | |
712 | 714 | } | |
713 | 715 | else { | |
714 | 716 | let openNotional = muld(_amount, _leverage) | |
715 | - | let $ | |
716 | - | let oldPositionNotional = $ | |
717 | - | let unrealizedPnl = $ | |
717 | + | let $t03025630372 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
718 | + | let oldPositionNotional = $t03025630372._1 | |
719 | + | let unrealizedPnl = $t03025630372._2 | |
718 | 720 | if ((oldPositionNotional > openNotional)) | |
719 | 721 | then throw("Use decreasePosition to decrease position size") | |
720 | 722 | else throw("Close position first") | |
721 | 723 | } | |
722 | - | let newPositionSize = $ | |
723 | - | let newPositionRemainMargin = $ | |
724 | - | let newPosiionOpenNotional = $ | |
725 | - | let newPositionLatestCPF = $ | |
726 | - | let baseAssetReserveAfter = $ | |
727 | - | let quoteAssetReserveAfter = $ | |
728 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
729 | - | let totalPositionSizeAfter = $ | |
730 | - | let cumulativeNotionalAfter = $ | |
731 | - | let openInteresetNotionalAfter = $ | |
724 | + | let newPositionSize = $t02827430563._1 | |
725 | + | let newPositionRemainMargin = $t02827430563._2 | |
726 | + | let newPosiionOpenNotional = $t02827430563._3 | |
727 | + | let newPositionLatestCPF = $t02827430563._4 | |
728 | + | let baseAssetReserveAfter = $t02827430563._5 | |
729 | + | let quoteAssetReserveAfter = $t02827430563._6 | |
730 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02827430563._7 | |
731 | + | let totalPositionSizeAfter = $t02827430563._8 | |
732 | + | let cumulativeNotionalAfter = $t02827430563._9 | |
733 | + | let openInteresetNotionalAfter = $t02827430563._10 | |
732 | 734 | let feeToStakers = (feeAmount / 2) | |
733 | 735 | let feeToInsurance = (feeAmount - feeToStakers) | |
734 | 736 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
759 | 761 | else { | |
760 | 762 | let feeAmount = muld(_rawAmount, fee()) | |
761 | 763 | let _amount = (_rawAmount - feeAmount) | |
762 | - | let $ | |
763 | - | let oldPositionSize = $ | |
764 | - | let oldPositionMargin = $ | |
765 | - | let oldPositionOpenNotional = $ | |
766 | - | let oldPositionLstUpdCPF = $ | |
764 | + | let $t03183831990 = getPosition(toString(i.caller)) | |
765 | + | let oldPositionSize = $t03183831990._1 | |
766 | + | let oldPositionMargin = $t03183831990._2 | |
767 | + | let oldPositionOpenNotional = $t03183831990._3 | |
768 | + | let oldPositionLstUpdCPF = $t03183831990._4 | |
767 | 769 | let feeToStakers = (feeAmount / 2) | |
768 | 770 | let feeToInsurance = (feeAmount - feeToStakers) | |
769 | 771 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
790 | 792 | else paused()) | |
791 | 793 | then throw("Invalid removeMargin parameters") | |
792 | 794 | else { | |
793 | - | let $ | |
794 | - | let oldPositionSize = $ | |
795 | - | let oldPositionMargin = $ | |
796 | - | let oldPositionOpenNotional = $ | |
797 | - | let oldPositionLstUpdCPF = $ | |
795 | + | let $t03292333075 = getPosition(toString(i.caller)) | |
796 | + | let oldPositionSize = $t03292333075._1 | |
797 | + | let oldPositionMargin = $t03292333075._2 | |
798 | + | let oldPositionOpenNotional = $t03292333075._3 | |
799 | + | let oldPositionLstUpdCPF = $t03292333075._4 | |
798 | 800 | let marginDelta = -(_amount) | |
799 | - | let $ | |
800 | - | let remainMargin = $ | |
801 | - | let badDebt = $ | |
802 | - | let x1 = $ | |
803 | - | let latestCPF1 = $ | |
801 | + | let $t03311233307 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
802 | + | let remainMargin = $t03311233307._1 | |
803 | + | let badDebt = $t03311233307._2 | |
804 | + | let x1 = $t03311233307._3 | |
805 | + | let latestCPF1 = $t03311233307._4 | |
804 | 806 | if ((badDebt != 0)) | |
805 | 807 | then throw("Invalid added margin amount") | |
806 | 808 | else { | |
821 | 823 | else paused()) | |
822 | 824 | then throw("Invalid closePosition parameters") | |
823 | 825 | else { | |
824 | - | let $ | |
825 | - | let x1 = $ | |
826 | - | let badDebt = $ | |
827 | - | let realizedPnl = $ | |
828 | - | let marginToVault = $ | |
829 | - | let quoteAssetReserveAfter = $ | |
830 | - | let baseAssetReserveAfter = $ | |
831 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
832 | - | let totalPositionSizeAfter = $ | |
833 | - | let cumulativeNotionalAfter = $ | |
834 | - | let openInteresetNotionalAfter = $ | |
826 | + | let $t03402934387 = internalClosePosition(toString(i.caller)) | |
827 | + | let x1 = $t03402934387._1 | |
828 | + | let badDebt = $t03402934387._2 | |
829 | + | let realizedPnl = $t03402934387._3 | |
830 | + | let marginToVault = $t03402934387._4 | |
831 | + | let quoteAssetReserveAfter = $t03402934387._5 | |
832 | + | let baseAssetReserveAfter = $t03402934387._6 | |
833 | + | let baseAssetDeltaThisFundingPeriodAfter = $t03402934387._7 | |
834 | + | let totalPositionSizeAfter = $t03402934387._8 | |
835 | + | let cumulativeNotionalAfter = $t03402934387._9 | |
836 | + | let openInteresetNotionalAfter = $t03402934387._10 | |
835 | 837 | if ((badDebt > 0)) | |
836 | 838 | then throw("Unable to close position with bad debt") | |
837 | 839 | else { | |
838 | 840 | let withdrawAmount = abs(marginToVault) | |
839 | 841 | let bd = (cbalance() - withdrawAmount) | |
840 | - | let $ | |
842 | + | let $t03458034676 = if ((0 > bd)) | |
841 | 843 | then $Tuple2(0, abs(bd)) | |
842 | 844 | else $Tuple2(bd, 0) | |
843 | - | let nb = $ | |
844 | - | let fromi = $ | |
845 | + | let nb = $t03458034676._1 | |
846 | + | let fromi = $t03458034676._2 | |
845 | 847 | let x = if ((fromi > 0)) | |
846 | 848 | then { | |
847 | 849 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [fromi], nil) | |
875 | 877 | else paused()) | |
876 | 878 | then throw("Unable to liquidate") | |
877 | 879 | else { | |
878 | - | let $ | |
879 | - | let x1 = $ | |
880 | - | let badDebt = $ | |
881 | - | let x2 = $ | |
882 | - | let marginToVault = $ | |
883 | - | let quoteAssetReserveAfter = $ | |
884 | - | let baseAssetReserveAfter = $ | |
885 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
886 | - | let totalPositionSizeAfter = $ | |
887 | - | let cumulativeNotionalAfter = $ | |
888 | - | let openInteresetNotionalAfter = $ | |
889 | - | let exchangedQuoteAssetAmount = $ | |
880 | + | let $t03584836178 = internalClosePosition(_trader) | |
881 | + | let x1 = $t03584836178._1 | |
882 | + | let badDebt = $t03584836178._2 | |
883 | + | let x2 = $t03584836178._3 | |
884 | + | let marginToVault = $t03584836178._4 | |
885 | + | let quoteAssetReserveAfter = $t03584836178._5 | |
886 | + | let baseAssetReserveAfter = $t03584836178._6 | |
887 | + | let baseAssetDeltaThisFundingPeriodAfter = $t03584836178._7 | |
888 | + | let totalPositionSizeAfter = $t03584836178._8 | |
889 | + | let cumulativeNotionalAfter = $t03584836178._9 | |
890 | + | let openInteresetNotionalAfter = $t03584836178._10 | |
891 | + | let exchangedQuoteAssetAmount = $t03584836178._11 | |
890 | 892 | let feeToLiquidator = (muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) / 2) | |
891 | - | let $ | |
893 | + | let $t03626836672 = if ((feeToLiquidator > marginToVault)) | |
892 | 894 | then $Tuple3((feeToLiquidator - marginToVault), marginToVault, ((badDebt + feeToLiquidator) - marginToVault)) | |
893 | 895 | else $Tuple3(0, (marginToVault - feeToLiquidator), badDebt) | |
894 | - | let liquidationBadDebt = $ | |
895 | - | let remainMargin = $ | |
896 | - | let totalBadDebt = $ | |
896 | + | let liquidationBadDebt = $t03626836672._1 | |
897 | + | let remainMargin = $t03626836672._2 | |
898 | + | let totalBadDebt = $t03626836672._3 | |
897 | 899 | let bd = (cbalance() - feeToLiquidator) | |
898 | - | let $ | |
900 | + | let $t03672036808 = if ((0 > bd)) | |
899 | 901 | then $Tuple2(0, abs(bd)) | |
900 | 902 | else $Tuple2(bd, 0) | |
901 | - | let nb = $ | |
902 | - | let fromi = $ | |
903 | + | let nb = $t03672036808._1 | |
904 | + | let fromi = $t03672036808._2 | |
903 | 905 | let x = if ((fromi > 0)) | |
904 | 906 | then { | |
905 | 907 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [fromi], nil) | |
943 | 945 | ||
944 | 946 | @Callable(i) | |
945 | 947 | func v_get (_trader) = { | |
946 | - | let $ | |
947 | - | let x1 = $ | |
948 | - | let x2 = $ | |
949 | - | let x3 = $ | |
950 | - | let x4 = $ | |
948 | + | let $t03828238335 = internalClosePosition(_trader) | |
949 | + | let x1 = $t03828238335._1 | |
950 | + | let x2 = $t03828238335._2 | |
951 | + | let x3 = $t03828238335._3 | |
952 | + | let x4 = $t03828238335._4 | |
951 | 953 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
952 | 954 | } | |
953 | 955 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let k_ora_key = "k_ora_key" | |
5 | 5 | ||
6 | 6 | let k_ora = "k_ora" | |
7 | 7 | ||
8 | 8 | let k_balance = "k_balance" | |
9 | 9 | ||
10 | 10 | let k_positionSize = "k_positionSize" | |
11 | 11 | ||
12 | 12 | let k_positionMargin = "k_positionMargin" | |
13 | 13 | ||
14 | 14 | let k_positionOpenNotional = "k_positionOpenNotional" | |
15 | 15 | ||
16 | 16 | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
17 | 17 | ||
18 | 18 | let k_initialized = "k_initialized" | |
19 | 19 | ||
20 | 20 | let k_paused = "k_paused" | |
21 | 21 | ||
22 | 22 | let k_fee = "k_fee" | |
23 | 23 | ||
24 | 24 | let k_fundingPeriod = "k_fundingPeriod" | |
25 | 25 | ||
26 | 26 | let k_initMarginRatio = "k_initMarginRatio" | |
27 | 27 | ||
28 | 28 | let k_maintenanceMarginRatio = "k_mmr" | |
29 | 29 | ||
30 | 30 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
31 | 31 | ||
32 | 32 | let k_spreadLimit = "k_spreadLimit" | |
33 | 33 | ||
34 | 34 | let k_maxPriceImpact = "k_maxPriceImpact" | |
35 | 35 | ||
36 | 36 | let k_lastDataStr = "k_lastDataStr" | |
37 | 37 | ||
38 | 38 | let k_lastMinuteId = "k_lastMinuteId" | |
39 | 39 | ||
40 | 40 | let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice" | |
41 | 41 | ||
42 | 42 | let k_twapDataLastPrice = "k_twapDataLastPrice" | |
43 | 43 | ||
44 | 44 | let k_twap = "k_twap" | |
45 | 45 | ||
46 | + | let k_baseAsstFndDelt = "k_baseAssetDelta" | |
47 | + | ||
46 | 48 | let k_latestCumulativePremiumFraction = "k_latestPremiumFraction" | |
47 | 49 | ||
48 | 50 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
49 | 51 | ||
50 | 52 | let k_fundingRate = "k_fundingRate" | |
51 | 53 | ||
52 | 54 | let k_quoteAssetReserve = "k_qtAstR" | |
53 | 55 | ||
54 | 56 | let k_baseAssetReserve = "k_bsAstR" | |
55 | 57 | ||
56 | - | let k_ | |
58 | + | let k_baseAsstFndDe1lt = "k_baseAssetDelta" | |
57 | 59 | ||
58 | 60 | let k_totalPositionSize = "k_totalPositionSize" | |
59 | 61 | ||
60 | 62 | let k_cumulativeNotional = "k_cumulativeNotional" | |
61 | 63 | ||
62 | 64 | let k_openInteresetNotional = "k_openInteresetNotional" | |
63 | 65 | ||
64 | 66 | let k_coordinatorAddress = "k_coordinatorAddress" | |
65 | 67 | ||
66 | 68 | let k_insurance_address = "k_insurance_address" | |
67 | 69 | ||
68 | 70 | let k_admin_address = "k_admin_address" | |
69 | 71 | ||
70 | 72 | let k_admin_public_key = "k_admin_public_key" | |
71 | 73 | ||
72 | 74 | let k_quote_asset = "k_quote_asset" | |
73 | 75 | ||
74 | 76 | let k_quote_staking = "k_quote_staking" | |
75 | 77 | ||
76 | 78 | let k_staking_address = "k_staking_address" | |
77 | 79 | ||
78 | 80 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
79 | 81 | ||
80 | 82 | ||
81 | 83 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
82 | 84 | ||
83 | 85 | ||
84 | 86 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
85 | 87 | ||
86 | 88 | ||
87 | 89 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
88 | 90 | ||
89 | 91 | ||
90 | 92 | func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote assete staking not set") | |
91 | 93 | ||
92 | 94 | ||
93 | 95 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Insurance not set") | |
94 | 96 | ||
95 | 97 | ||
96 | 98 | func insuranceAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_insurance_address)), "Insurance not set") | |
97 | 99 | ||
98 | 100 | ||
99 | 101 | let DIR_LONG = 1 | |
100 | 102 | ||
101 | 103 | let DIR_SHORT = 2 | |
102 | 104 | ||
103 | 105 | let FUNDING_BLOCK_INTERVAL = 60 | |
104 | 106 | ||
105 | 107 | let TWAP_INTERVAL = 15 | |
106 | 108 | ||
107 | 109 | let SECONDS = 1000 | |
108 | 110 | ||
109 | 111 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
110 | 112 | ||
111 | 113 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
112 | 114 | ||
113 | 115 | let ALL_FEES = 100 | |
114 | 116 | ||
115 | 117 | let PNL_OPTION_SPOT = 1 | |
116 | 118 | ||
117 | 119 | let PNL_OPTION_ORACLE = 2 | |
118 | 120 | ||
119 | 121 | func s (_x) = (toString(_x) + ",") | |
120 | 122 | ||
121 | 123 | ||
122 | 124 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
123 | 125 | ||
124 | 126 | ||
125 | 127 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
126 | 128 | ||
127 | 129 | ||
128 | 130 | func abs (_x) = if ((_x > 0)) | |
129 | 131 | then _x | |
130 | 132 | else -(_x) | |
131 | 133 | ||
132 | 134 | ||
133 | 135 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
134 | 136 | ||
135 | 137 | ||
136 | 138 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
137 | 139 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
138 | 140 | if (if (_largerThanOrEqualTo) | |
139 | 141 | then (0 > remainingMarginRatio) | |
140 | 142 | else false) | |
141 | 143 | then throw("Invalid margin") | |
142 | 144 | else if (if (!(_largerThanOrEqualTo)) | |
143 | 145 | then (remainingMarginRatio >= 0) | |
144 | 146 | else false) | |
145 | 147 | then throw("Invalid margin") | |
146 | 148 | else true | |
147 | 149 | } | |
148 | 150 | ||
149 | 151 | ||
150 | 152 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
151 | 153 | ||
152 | 154 | ||
153 | 155 | func cbalance () = int(k_balance) | |
154 | 156 | ||
155 | 157 | ||
156 | 158 | func fee () = int(k_fee) | |
157 | 159 | ||
158 | 160 | ||
159 | 161 | func initMarginRatio () = int(k_initMarginRatio) | |
160 | 162 | ||
161 | 163 | ||
162 | 164 | func qtAstR () = int(k_quoteAssetReserve) | |
163 | 165 | ||
164 | 166 | ||
165 | 167 | func bsAstR () = int(k_baseAssetReserve) | |
166 | 168 | ||
167 | 169 | ||
168 | 170 | func baseAsstFndDelt () = int(k_baseAsstFndDelt) | |
169 | 171 | ||
170 | 172 | ||
171 | 173 | func totalPositionSize () = int(k_totalPositionSize) | |
172 | 174 | ||
173 | 175 | ||
174 | 176 | func cumulativeNotional () = int(k_cumulativeNotional) | |
175 | 177 | ||
176 | 178 | ||
177 | 179 | func latestCPF () = int(k_latestCumulativePremiumFraction) | |
178 | 180 | ||
179 | 181 | ||
180 | 182 | func openInteresetNotional () = int(k_openInteresetNotional) | |
181 | 183 | ||
182 | 184 | ||
183 | 185 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
184 | 186 | ||
185 | 187 | ||
186 | 188 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
187 | 189 | ||
188 | 190 | ||
189 | 191 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
190 | 192 | ||
191 | 193 | ||
192 | 194 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
193 | 195 | ||
194 | 196 | ||
195 | 197 | func mmr () = int(k_maintenanceMarginRatio) | |
196 | 198 | ||
197 | 199 | ||
198 | 200 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
199 | 201 | ||
200 | 202 | ||
201 | 203 | func spreadLimit () = int(k_spreadLimit) | |
202 | 204 | ||
203 | 205 | ||
204 | 206 | func maxPriceImpact () = int(k_maxPriceImpact) | |
205 | 207 | ||
206 | 208 | ||
207 | 209 | func getPosition (invesor) = { | |
208 | 210 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, invesor)) | |
209 | 211 | match positionSizeOpt { | |
210 | 212 | case positionSize: Int => | |
211 | 213 | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, invesor)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, invesor)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, invesor))) | |
212 | 214 | case _ => | |
213 | 215 | $Tuple4(0, 0, 0, 0) | |
214 | 216 | } | |
215 | 217 | } | |
216 | 218 | ||
217 | 219 | ||
218 | 220 | func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0)) | |
219 | 221 | then throw("No open position") | |
220 | 222 | else true | |
221 | 223 | ||
222 | 224 | ||
223 | 225 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
224 | 226 | ||
225 | 227 | ||
226 | 228 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
227 | 229 | ||
228 | 230 | ||
229 | 231 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
230 | 232 | then { | |
231 | 233 | let newBase = (bsAstR() - _baseAssetAmount) | |
232 | 234 | if ((0 >= newBase)) | |
233 | 235 | then throw("Tx lead to base asset reserve <= 0, revert") | |
234 | 236 | else $Tuple5((qtAstR() + _quoteAssetAmount), newBase, (baseAsstFndDelt() - _baseAssetAmount), (totalPositionSize() + _baseAssetAmount), (cumulativeNotional() + _quoteAssetAmount)) | |
235 | 237 | } | |
236 | 238 | else { | |
237 | 239 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
238 | 240 | if ((0 >= newQuote)) | |
239 | 241 | then throw("Tx lead to base quote reserve <= 0, revert") | |
240 | 242 | else $Tuple5(newQuote, (bsAstR() + _baseAssetAmount), (baseAsstFndDelt() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount), (cumulativeNotional() - _quoteAssetAmount)) | |
241 | 243 | } | |
242 | 244 | ||
243 | 245 | ||
244 | 246 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
245 | 247 | let _qtAstR = qtAstR() | |
246 | 248 | let _bsAstR = bsAstR() | |
247 | 249 | let priceBefore = divd(_qtAstR, _bsAstR) | |
248 | 250 | let amountBaseAssetBoughtWithoutPriceImpact = muld(_quoteAssetAmount, priceBefore) | |
249 | 251 | let k = muld(_qtAstR, _bsAstR) | |
250 | 252 | let quoteAssetReserveAfter = if (_isAdd) | |
251 | 253 | then (_qtAstR + _quoteAssetAmount) | |
252 | 254 | else (_qtAstR - _quoteAssetAmount) | |
253 | 255 | let baseAssetReserveAfter = divd(k, quoteAssetReserveAfter) | |
254 | 256 | let amountBaseAssetBoughtAbs = abs((baseAssetReserveAfter - _bsAstR)) | |
255 | 257 | let amountBaseAssetBought = if (_isAdd) | |
256 | 258 | then amountBaseAssetBoughtAbs | |
257 | 259 | else -(amountBaseAssetBoughtAbs) | |
258 | 260 | let priceImpact = ((amountBaseAssetBoughtWithoutPriceImpact - amountBaseAssetBoughtAbs) / amountBaseAssetBoughtWithoutPriceImpact) | |
259 | 261 | let maxPriceImpactValue = maxPriceImpact() | |
260 | 262 | if ((priceImpact > maxPriceImpactValue)) | |
261 | 263 | then throw(((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue))) | |
262 | 264 | else { | |
263 | - | let $ | |
264 | - | let quoteAssetReserveAfter1 = $ | |
265 | - | let baseAssetReserveAfter1 = $ | |
266 | - | let baseAssetDeltaThisFundingPeriodAfter1 = $ | |
267 | - | let totalPositionSizeAfter1 = $ | |
268 | - | let cumulativeNotionalAfter1 = $ | |
265 | + | let $t0986710115 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
266 | + | let quoteAssetReserveAfter1 = $t0986710115._1 | |
267 | + | let baseAssetReserveAfter1 = $t0986710115._2 | |
268 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t0986710115._3 | |
269 | + | let totalPositionSizeAfter1 = $t0986710115._4 | |
270 | + | let cumulativeNotionalAfter1 = $t0986710115._5 | |
269 | 271 | $Tuple6(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
270 | 272 | } | |
271 | 273 | } | |
272 | 274 | ||
273 | 275 | ||
274 | 276 | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionLstUpdCPF,_marginDelta) = { | |
275 | 277 | let _latestCPF = latestCPF() | |
276 | 278 | let fundingPayment = if ((_oldPositionSize != 0)) | |
277 | 279 | then muld((_latestCPF - _oldPositionLstUpdCPF), _oldPositionSize) | |
278 | 280 | else 0 | |
279 | 281 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
280 | - | let $ | |
282 | + | let $t01073310860 = if ((0 > signedMargin)) | |
281 | 283 | then $Tuple2(0, abs(signedMargin)) | |
282 | 284 | else $Tuple2(abs(signedMargin), 0) | |
283 | - | let remainMargin = $ | |
284 | - | let badDebt = $ | |
285 | + | let remainMargin = $t01073310860._1 | |
286 | + | let badDebt = $t01073310860._2 | |
285 | 287 | $Tuple4(remainMargin, badDebt, fundingPayment, _latestCPF) | |
286 | 288 | } | |
287 | 289 | ||
288 | 290 | ||
289 | 291 | func getOutputPriceWithReserves (_add,_baseAssetAmount,_quoteAssetPoolAmount,_baseAssetPoolAmount) = if ((_baseAssetAmount == 0)) | |
290 | 292 | then throw("Invalid base asset amount") | |
291 | 293 | else { | |
292 | 294 | let k = muld(_quoteAssetPoolAmount, _baseAssetPoolAmount) | |
293 | 295 | let baseAssetPoolAmountAfter = if (_add) | |
294 | 296 | then (_baseAssetPoolAmount + _baseAssetAmount) | |
295 | 297 | else (_baseAssetPoolAmount - _baseAssetAmount) | |
296 | 298 | let quoteAssetAfter = divd(k, baseAssetPoolAmountAfter) | |
297 | 299 | let quoteAssetSold = abs((quoteAssetAfter - _quoteAssetPoolAmount)) | |
298 | - | let $ | |
299 | - | let quoteAssetReserveAfter1 = $ | |
300 | - | let baseAssetReserveAfter1 = $ | |
301 | - | let baseAssetDeltaThisFundingPeriodAfter1 = $ | |
302 | - | let totalPositionSizeAfter1 = $ | |
303 | - | let cumulativeNotionalAfter1 = $ | |
300 | + | let $t01150911745 = updateReserve(!(_add), quoteAssetSold, _baseAssetAmount) | |
301 | + | let quoteAssetReserveAfter1 = $t01150911745._1 | |
302 | + | let baseAssetReserveAfter1 = $t01150911745._2 | |
303 | + | let baseAssetDeltaThisFundingPeriodAfter1 = $t01150911745._3 | |
304 | + | let totalPositionSizeAfter1 = $t01150911745._4 | |
305 | + | let cumulativeNotionalAfter1 = $t01150911745._5 | |
304 | 306 | $Tuple6(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, baseAssetDeltaThisFundingPeriodAfter1, totalPositionSizeAfter1, cumulativeNotionalAfter1) | |
305 | 307 | } | |
306 | 308 | ||
307 | 309 | ||
308 | 310 | func getOracleTwapPrice () = { | |
309 | 311 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
310 | 312 | let priceKey = getStringValue(this, k_ora_key) | |
311 | 313 | getIntegerValue(oracle, priceKey) | |
312 | 314 | } | |
313 | 315 | ||
314 | 316 | ||
315 | 317 | func getSpotPrice () = { | |
316 | 318 | let _qtAstR = qtAstR() | |
317 | 319 | let _bsAstR = bsAstR() | |
318 | 320 | divd(_qtAstR, _bsAstR) | |
319 | 321 | } | |
320 | 322 | ||
321 | 323 | ||
322 | 324 | func isOverFluctuationLimit () = { | |
323 | 325 | let oraclePrice = getOracleTwapPrice() | |
324 | 326 | let currentPrice = getSpotPrice() | |
325 | 327 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
326 | 328 | } | |
327 | 329 | ||
328 | 330 | ||
329 | 331 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
330 | - | let $ | |
331 | - | let positionSize = $ | |
332 | - | let positionMargin = $ | |
333 | - | let | |
334 | - | let positionLstUpdCPF = $ | |
332 | + | let $t01252012648 = getPosition(_trader) | |
333 | + | let positionSize = $t01252012648._1 | |
334 | + | let positionMargin = $t01252012648._2 | |
335 | + | let positionOpenNotional = $t01252012648._3 | |
336 | + | let positionLstUpdCPF = $t01252012648._4 | |
335 | 337 | let positionSizeAbs = abs(positionSize) | |
336 | 338 | if ((positionSizeAbs == 0)) | |
337 | 339 | then throw("Invalid position size") | |
338 | 340 | else { | |
339 | 341 | let isShort = (0 > positionSize) | |
340 | 342 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
341 | 343 | then { | |
342 | - | let $ | |
343 | - | let outPositionNotional = $ | |
344 | - | let x1 = $ | |
345 | - | let x2 = $ | |
346 | - | let x3 = $ | |
344 | + | let $t01289513058 = getOutputPriceWithReserves(!(isShort), positionSizeAbs, qtAstR(), bsAstR()) | |
345 | + | let outPositionNotional = $t01289513058._1 | |
346 | + | let x1 = $t01289513058._2 | |
347 | + | let x2 = $t01289513058._3 | |
348 | + | let x3 = $t01289513058._4 | |
347 | 349 | outPositionNotional | |
348 | 350 | } | |
349 | 351 | else (positionSizeAbs * getOracleTwapPrice()) | |
350 | 352 | let unrealizedPnl = if (isShort) | |
351 | - | then ( | |
352 | - | else (positionNotional - | |
353 | + | then (positionOpenNotional - positionNotional) | |
354 | + | else (positionNotional - positionOpenNotional) | |
353 | 355 | $Tuple2(positionNotional, unrealizedPnl) | |
354 | 356 | } | |
355 | 357 | } | |
356 | 358 | ||
357 | 359 | ||
358 | 360 | func getMarginRatioByOption (_trader,_option) = { | |
359 | 361 | func x () = 0 | |
360 | 362 | ||
361 | - | let $ | |
362 | - | let positionSize = $ | |
363 | - | let positionMargin = $ | |
364 | - | let pon = $ | |
365 | - | let positionLstUpdCPF = $ | |
366 | - | let $ | |
367 | - | let positionNotional = $ | |
368 | - | let unrealizedPnl = $ | |
369 | - | let $ | |
370 | - | let remainMargin = $ | |
371 | - | let badDebt = $ | |
363 | + | let $t01348213593 = getPosition(_trader) | |
364 | + | let positionSize = $t01348213593._1 | |
365 | + | let positionMargin = $t01348213593._2 | |
366 | + | let pon = $t01348213593._3 | |
367 | + | let positionLstUpdCPF = $t01348213593._4 | |
368 | + | let $t01359913692 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
369 | + | let positionNotional = $t01359913692._1 | |
370 | + | let unrealizedPnl = $t01359913692._2 | |
371 | + | let $t01369713863 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
372 | + | let remainMargin = $t01369713863._1 | |
373 | + | let badDebt = $t01369713863._2 | |
372 | 374 | divd((remainMargin - badDebt), positionNotional) | |
373 | 375 | } | |
374 | 376 | ||
375 | 377 | ||
376 | 378 | func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
377 | 379 | ||
378 | 380 | ||
379 | 381 | func internalClosePosition (_trader) = { | |
380 | - | let $ | |
381 | - | let positionSize = $ | |
382 | - | let positionMargin = $ | |
383 | - | let pon = $ | |
384 | - | let positionLstUpdCPF = $ | |
385 | - | let $ | |
386 | - | let x1 = $ | |
387 | - | let unrealizedPnl = $ | |
388 | - | let $ | |
389 | - | let remainMargin = $ | |
390 | - | let badDebt = $ | |
391 | - | let x2 = $ | |
382 | + | let $t01405914170 = getPosition(_trader) | |
383 | + | let positionSize = $t01405914170._1 | |
384 | + | let positionMargin = $t01405914170._2 | |
385 | + | let pon = $t01405914170._3 | |
386 | + | let positionLstUpdCPF = $t01405914170._4 | |
387 | + | let $t01417614263 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
388 | + | let x1 = $t01417614263._1 | |
389 | + | let unrealizedPnl = $t01417614263._2 | |
390 | + | let $t01426814440 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
391 | + | let remainMargin = $t01426814440._1 | |
392 | + | let badDebt = $t01426814440._2 | |
393 | + | let x2 = $t01426814440._3 | |
392 | 394 | let exchangedPositionSize = -(positionSize) | |
393 | 395 | let realizedPnl = unrealizedPnl | |
394 | 396 | let marginToVault = -(remainMargin) | |
395 | - | let $ | |
396 | - | let exchangedQuoteAssetAmount = $ | |
397 | - | let quoteAssetReserveAfter = $ | |
398 | - | let baseAssetReserveAfter = $ | |
399 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
400 | - | let totalPositionSizeAfter = $ | |
401 | - | let cumulativeNotionalAfter = $ | |
397 | + | let $t01456714900 = getOutputPriceWithReserves((positionSize > 0), abs(positionSize), qtAstR(), bsAstR()) | |
398 | + | let exchangedQuoteAssetAmount = $t01456714900._1 | |
399 | + | let quoteAssetReserveAfter = $t01456714900._2 | |
400 | + | let baseAssetReserveAfter = $t01456714900._3 | |
401 | + | let baseAssetDeltaThisFundingPeriodAfter = $t01456714900._4 | |
402 | + | let totalPositionSizeAfter = $t01456714900._5 | |
403 | + | let cumulativeNotionalAfter = $t01456714900._6 | |
402 | 404 | let openInteresetNotionalAfter = (openInteresetNotional() - pon) | |
403 | 405 | $Tuple11(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter, exchangedQuoteAssetAmount) | |
404 | 406 | } | |
405 | 407 | ||
406 | 408 | ||
407 | 409 | func getTwapSpotPrice () = { | |
408 | 410 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
409 | 411 | let startMinuteId = (minuteId - TWAP_INTERVAL) | |
410 | 412 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
411 | 413 | let list = split(listStr, ",") | |
412 | 414 | func filterFn (accum,next) = if ((startMinuteId >= parseIntValue(next))) | |
413 | 415 | then (accum :+ parseIntValue(next)) | |
414 | 416 | else accum | |
415 | 417 | ||
416 | 418 | let listF = { | |
417 | 419 | let $l = list | |
418 | 420 | let $s = size($l) | |
419 | 421 | let $acc0 = nil | |
420 | 422 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
421 | 423 | then $a | |
422 | 424 | else filterFn($a, $l[$i]) | |
423 | 425 | ||
424 | 426 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
425 | 427 | then $a | |
426 | - | else throw("List size exceeds | |
428 | + | else throw("List size exceeds 20") | |
427 | 429 | ||
428 | - | $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($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
430 | + | $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($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), 13), 14), 15), 16), 17), 18), 19), 20) | |
429 | 431 | } | |
430 | 432 | let maxIndex = max(listF) | |
431 | 433 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
432 | 434 | let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0) | |
433 | 435 | let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0) | |
434 | 436 | let nowCummulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice)) | |
435 | 437 | let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0) | |
436 | 438 | let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0) | |
437 | 439 | let startCummulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice)) | |
438 | 440 | ((nowCummulativePrice - startCummulativePrice) / TWAP_INTERVAL) | |
439 | 441 | } | |
440 | 442 | ||
441 | 443 | ||
442 | 444 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = [IntegerEntry(k_initMarginRatio, _initMarginRatio), IntegerEntry(k_maintenanceMarginRatio, _mmr), IntegerEntry(k_liquidationFeeRatio, _liquidationFeeRatio), IntegerEntry(k_fundingPeriod, _fundingPeriod), IntegerEntry(k_fee, _fee), IntegerEntry(k_spreadLimit, _spreadLimit), IntegerEntry(k_maxPriceImpact, _maxPriceImpact)] | |
443 | 445 | ||
444 | 446 | ||
445 | 447 | func updateFunding (_baseADTFP,_nextFundingBlock,_latestCPF,_fundingRate) = [IntegerEntry(k_baseAsstFndDelt, _baseADTFP), IntegerEntry(k_nextFundingBlock, _nextFundingBlock), IntegerEntry(k_latestCumulativePremiumFraction, _latestCPF), IntegerEntry(k_fundingRate, _fundingRate)] | |
446 | 448 | ||
447 | 449 | ||
448 | 450 | func updatePosition (_address,_size,_margin,_openNotinal,_LstUpdCPF) = [IntegerEntry(toCompositeKey(k_positionSize, _address), _size), IntegerEntry(toCompositeKey(k_positionMargin, _address), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, _address), _openNotinal), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address), _LstUpdCPF)] | |
449 | 451 | ||
450 | 452 | ||
451 | 453 | func appendTwap (price) = { | |
452 | 454 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
453 | 455 | let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
454 | 456 | if ((previousMinuteId > minuteId)) | |
455 | 457 | then throw("TWAP out-of-order") | |
456 | 458 | else { | |
457 | 459 | let lastMinuteId = if ((previousMinuteId == 0)) | |
458 | 460 | then minuteId | |
459 | 461 | else previousMinuteId | |
460 | 462 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
461 | 463 | let oldList = split(listStr, ",") | |
462 | 464 | let list = if ((size(oldList) > TWAP_INTERVAL)) | |
463 | 465 | then (removeByIndex(oldList, 0) :+ toString(minuteId)) | |
464 | 466 | else (oldList :+ toString(minuteId)) | |
465 | 467 | let prevCummulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0) | |
466 | 468 | let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), price) | |
467 | 469 | let lastCummulativePrice = (prevCummulativePrice + ((minuteId - lastMinuteId) * prevPrice)) | |
468 | 470 | func join (accum,val) = ((accum + val) + ",") | |
469 | 471 | ||
470 | 472 | let newListStr = { | |
471 | 473 | let $l = list | |
472 | 474 | let $s = size($l) | |
473 | 475 | let $acc0 = "" | |
474 | 476 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
475 | 477 | then $a | |
476 | 478 | else join($a, $l[$i]) | |
477 | 479 | ||
478 | 480 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
479 | 481 | then $a | |
480 | - | else throw("List size exceeds | |
482 | + | else throw("List size exceeds 20") | |
481 | 483 | ||
482 | - | $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($f0_1($f0_1($f0_1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15) | |
484 | + | $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($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), 13), 14), 15), 16), 17), 18), 19), 20) | |
483 | 485 | } | |
484 | 486 | let newListStrU = dropRight(newListStr, 1) | |
485 | 487 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
486 | 488 | then drop(newListStrU, 1) | |
487 | 489 | else newListStrU | |
488 | 490 | [IntegerEntry(((k_twapDataLastCumulativePrice + "_") + toString(minuteId)), lastCummulativePrice), IntegerEntry(((k_twapDataLastPrice + "_") + toString(minuteId)), price), IntegerEntry(k_lastMinuteId, minuteId), StringEntry(k_lastDataStr, newListStrR)] | |
489 | 491 | } | |
490 | 492 | } | |
491 | 493 | ||
492 | 494 | ||
493 | 495 | func updateAmm (_qtAstR,_bsAstR,_baseAssetDeltaThisFundingPeriodAfter,_totalPositionSizeAfter,_cumulativeNotionalAfter,_openInteresetNotional) = ([IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR), IntegerEntry(k_baseAsstFndDelt, _baseAssetDeltaThisFundingPeriodAfter), IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_cumulativeNotional, _cumulativeNotionalAfter), IntegerEntry(k_openInteresetNotional, _openInteresetNotional)] ++ appendTwap(divd(_qtAstR, _bsAstR))) | |
494 | 496 | ||
495 | 497 | ||
496 | 498 | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address))] | |
497 | 499 | ||
498 | 500 | ||
499 | 501 | func withdraw (_address,_amount) = { | |
500 | 502 | let balance = assetBalance(this, quoteAsset()) | |
501 | 503 | if ((_amount > balance)) | |
502 | 504 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
503 | 505 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
504 | 506 | } | |
505 | 507 | ||
506 | 508 | ||
507 | 509 | func updateBalance (i) = if ((0 > i)) | |
508 | 510 | then throw("Balance") | |
509 | 511 | else [IntegerEntry(k_balance, i)] | |
510 | 512 | ||
511 | 513 | ||
512 | 514 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
513 | 515 | ||
514 | 516 | ||
515 | 517 | @Callable(i) | |
516 | 518 | func pause () = if ((i.caller != adminAddress())) | |
517 | 519 | then throw("Invalid togglePause params") | |
518 | 520 | else [BooleanEntry(k_paused, true)] | |
519 | 521 | ||
520 | 522 | ||
521 | 523 | ||
522 | 524 | @Callable(i) | |
523 | 525 | func unpause () = if ((i.caller != adminAddress())) | |
524 | 526 | then throw("Invalid togglePause params") | |
525 | 527 | else [BooleanEntry(k_paused, false)] | |
526 | 528 | ||
527 | 529 | ||
528 | 530 | ||
529 | 531 | @Callable(i) | |
530 | 532 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact) = if ((i.caller != adminAddress())) | |
531 | 533 | then throw("Invalid changeSettings params") | |
532 | 534 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact) | |
533 | 535 | ||
534 | 536 | ||
535 | 537 | ||
536 | 538 | @Callable(i) | |
537 | 539 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_coordinator,_spreadLimit,_maxPriceImpact) = if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
538 | 540 | then true | |
539 | 541 | else (0 >= _bsAstR)) | |
540 | 542 | then true | |
541 | 543 | else (0 >= _fundingPeriod)) | |
542 | 544 | then true | |
543 | 545 | else (0 >= _initMarginRatio)) | |
544 | 546 | then true | |
545 | 547 | else (0 >= _mmr)) | |
546 | 548 | then true | |
547 | 549 | else (0 >= _liquidationFeeRatio)) | |
548 | 550 | then true | |
549 | 551 | else (0 >= _fee)) | |
550 | 552 | then true | |
551 | 553 | else (0 >= _spreadLimit)) | |
552 | 554 | then true | |
553 | 555 | else (0 >= _maxPriceImpact)) | |
554 | 556 | then true | |
555 | 557 | else initialized()) | |
556 | 558 | then throw("Invalid initialize parameters") | |
557 | 559 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact)) ++ updateFunding(0, (lastBlock.timestamp + _fundingPeriod), 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_coordinatorAddress, _coordinator)]) | |
558 | 560 | ||
559 | 561 | ||
560 | 562 | ||
561 | 563 | @Callable(i) | |
562 | 564 | func decreasePosition (_direction,_amount,_leverage,_minBaseAssetAmount) = if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
563 | 565 | then (_direction != DIR_SHORT) | |
564 | 566 | else false) | |
565 | 567 | then true | |
566 | 568 | else (0 >= _amount)) | |
567 | 569 | then true | |
568 | 570 | else if (((1 * DECIMAL_UNIT) > _leverage)) | |
569 | 571 | then true | |
570 | 572 | else (_leverage > (3 * DECIMAL_UNIT))) | |
571 | 573 | then true | |
572 | 574 | else !(initialized())) | |
573 | 575 | then true | |
574 | 576 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
575 | 577 | then true | |
576 | 578 | else paused()) | |
577 | 579 | then throw("Invalid decreasePosition parameters") | |
578 | 580 | else { | |
579 | - | let $ | |
580 | - | let oldPositionSize = $ | |
581 | - | let oldPositionMargin = $ | |
582 | - | let oldPositionOpenNotional = $ | |
583 | - | let oldPositionLstUpdCPF = $ | |
581 | + | let $t02345923611 = getPosition(toString(i.caller)) | |
582 | + | let oldPositionSize = $t02345923611._1 | |
583 | + | let oldPositionMargin = $t02345923611._2 | |
584 | + | let oldPositionOpenNotional = $t02345923611._3 | |
585 | + | let oldPositionLstUpdCPF = $t02345923611._4 | |
584 | 586 | let isNewPosition = (oldPositionSize == 0) | |
585 | 587 | let isSameDirection = if ((oldPositionSize > 0)) | |
586 | 588 | then (_direction == DIR_LONG) | |
587 | 589 | else (_direction == DIR_SHORT) | |
588 | 590 | let expandExisting = if (!(isNewPosition)) | |
589 | 591 | then isSameDirection | |
590 | 592 | else false | |
591 | 593 | let isAdd = (_direction == DIR_LONG) | |
592 | - | let $ | |
594 | + | let $t02390026798 = if (if (isNewPosition) | |
593 | 595 | then true | |
594 | 596 | else expandExisting) | |
595 | 597 | then throw("Use increasePosition to open new or increase position") | |
596 | 598 | else { | |
597 | 599 | let openNotional = muld(_amount, _leverage) | |
598 | - | let $ | |
599 | - | let oldPositionNotional = $ | |
600 | - | let unrealizedPnl = $ | |
600 | + | let $t02440524521 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
601 | + | let oldPositionNotional = $t02440524521._1 | |
602 | + | let unrealizedPnl = $t02440524521._2 | |
601 | 603 | if ((oldPositionNotional > openNotional)) | |
602 | 604 | then { | |
603 | - | let $ | |
604 | - | let exchangedPositionSize = $ | |
605 | - | let quoteAssetReserveAfter = $ | |
606 | - | let baseAssetReserveAfter = $ | |
607 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
608 | - | let totalPositionSizeAfter = $ | |
609 | - | let cumulativeNotionalAfter = $ | |
605 | + | let $t02458324863 = swapInput(isAdd, openNotional) | |
606 | + | let exchangedPositionSize = $t02458324863._1 | |
607 | + | let quoteAssetReserveAfter = $t02458324863._2 | |
608 | + | let baseAssetReserveAfter = $t02458324863._3 | |
609 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02458324863._4 | |
610 | + | let totalPositionSizeAfter = $t02458324863._5 | |
611 | + | let cumulativeNotionalAfter = $t02458324863._6 | |
610 | 612 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
611 | 613 | if (if ((_minBaseAssetAmount != 0)) | |
612 | 614 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
613 | 615 | else false) | |
614 | 616 | then throw(((("Too little basse asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
615 | 617 | else { | |
616 | 618 | let realizedPnl = if ((oldPositionSize != 0)) | |
617 | 619 | then divd(muld(unrealizedPnl, exchangedPositionSizeAbs), oldPositionSize) | |
618 | 620 | else 0 | |
619 | - | let $ | |
620 | - | let remainMargin = $ | |
621 | - | let badDebt = $ | |
622 | - | let fundingPayment = $ | |
623 | - | let oldLatestCPF = $ | |
621 | + | let $t02540425675 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
622 | + | let remainMargin = $t02540425675._1 | |
623 | + | let badDebt = $t02540425675._2 | |
624 | + | let fundingPayment = $t02540425675._3 | |
625 | + | let oldLatestCPF = $t02540425675._4 | |
624 | 626 | let exchangedQuoteAssetAmount = openNotional | |
625 | 627 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
626 | 628 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
627 | 629 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
628 | 630 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
629 | 631 | $Tuple10((oldPositionSize + exchangedPositionSize), remainMargin, abs(remainOpenNotional), oldLatestCPF, baseAssetReserveAfter, quoteAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInteresetNotional() - openNotional)) | |
630 | 632 | } | |
631 | 633 | } | |
632 | 634 | else throw("Close position first") | |
633 | 635 | } | |
634 | - | let newPositionSize = $ | |
635 | - | let newPositionRemainMargin = $ | |
636 | - | let newPosiionOpenNotional = $ | |
637 | - | let newPositionLatestCPF = $ | |
638 | - | let baseAssetReserveAfter = $ | |
639 | - | let quoteAssetReserveAfter = $ | |
640 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
641 | - | let totalPositionSizeAfter = $ | |
642 | - | let cumulativeNotionalAfter = $ | |
643 | - | let openInteresetNotionalAfter = $ | |
636 | + | let newPositionSize = $t02390026798._1 | |
637 | + | let newPositionRemainMargin = $t02390026798._2 | |
638 | + | let newPosiionOpenNotional = $t02390026798._3 | |
639 | + | let newPositionLatestCPF = $t02390026798._4 | |
640 | + | let baseAssetReserveAfter = $t02390026798._5 | |
641 | + | let quoteAssetReserveAfter = $t02390026798._6 | |
642 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02390026798._7 | |
643 | + | let totalPositionSizeAfter = $t02390026798._8 | |
644 | + | let cumulativeNotionalAfter = $t02390026798._9 | |
645 | + | let openInteresetNotionalAfter = $t02390026798._10 | |
644 | 646 | (updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPosiionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) | |
645 | 647 | } | |
646 | 648 | ||
647 | 649 | ||
648 | 650 | ||
649 | 651 | @Callable(i) | |
650 | 652 | func increasePosition (_direction,_leverage,_minBaseAssetAmount) = { | |
651 | 653 | let _rawAmount = i.payments[0].amount | |
652 | 654 | if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
653 | 655 | then (_direction != DIR_SHORT) | |
654 | 656 | else false) | |
655 | 657 | then true | |
656 | 658 | else (0 >= _rawAmount)) | |
657 | 659 | then true | |
658 | 660 | else if (((1 * DECIMAL_UNIT) > _leverage)) | |
659 | 661 | then true | |
660 | 662 | else (_leverage > (3 * DECIMAL_UNIT))) | |
661 | 663 | then true | |
662 | 664 | else !(initialized())) | |
663 | 665 | then true | |
664 | 666 | else (i.payments[0].assetId != quoteAsset())) | |
665 | 667 | then true | |
666 | 668 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
667 | 669 | then true | |
668 | 670 | else paused()) | |
669 | 671 | then throw("Invalid increasePosition parameters") | |
670 | 672 | else { | |
671 | 673 | let feeAmount = muld(_rawAmount, fee()) | |
672 | 674 | let _amount = (_rawAmount - feeAmount) | |
673 | - | let $ | |
674 | - | let oldPositionSize = $ | |
675 | - | let oldPositionMargin = $ | |
676 | - | let oldPositionOpenNotional = $ | |
677 | - | let oldPositionLstUpdCPF = $ | |
675 | + | let $t02783327985 = getPosition(toString(i.caller)) | |
676 | + | let oldPositionSize = $t02783327985._1 | |
677 | + | let oldPositionMargin = $t02783327985._2 | |
678 | + | let oldPositionOpenNotional = $t02783327985._3 | |
679 | + | let oldPositionLstUpdCPF = $t02783327985._4 | |
678 | 680 | let isNewPosition = (oldPositionSize == 0) | |
679 | 681 | let isSameDirection = if ((oldPositionSize > 0)) | |
680 | 682 | then (_direction == DIR_LONG) | |
681 | 683 | else (_direction == DIR_SHORT) | |
682 | 684 | let expandExisting = if (!(isNewPosition)) | |
683 | 685 | then isSameDirection | |
684 | 686 | else false | |
685 | 687 | let isAdd = (_direction == DIR_LONG) | |
686 | - | let $ | |
688 | + | let $t02827430563 = if (if (isNewPosition) | |
687 | 689 | then true | |
688 | 690 | else expandExisting) | |
689 | 691 | then { | |
690 | 692 | let openNotional = muld(_amount, _leverage) | |
691 | - | let $ | |
692 | - | let amountBaseAssetBought = $ | |
693 | - | let quoteAssetReserveAfter = $ | |
694 | - | let baseAssetReserveAfter = $ | |
695 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
696 | - | let totalPositionSizeAfter = $ | |
697 | - | let cumulativeNotionalAfter = $ | |
693 | + | let $t02869728949 = swapInput(isAdd, openNotional) | |
694 | + | let amountBaseAssetBought = $t02869728949._1 | |
695 | + | let quoteAssetReserveAfter = $t02869728949._2 | |
696 | + | let baseAssetReserveAfter = $t02869728949._3 | |
697 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02869728949._4 | |
698 | + | let totalPositionSizeAfter = $t02869728949._5 | |
699 | + | let cumulativeNotionalAfter = $t02869728949._6 | |
698 | 700 | if (if ((_minBaseAssetAmount != 0)) | |
699 | 701 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
700 | 702 | else false) | |
701 | 703 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
702 | 704 | else { | |
703 | 705 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
704 | 706 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
705 | - | let $ | |
706 | - | let remainMargin = $ | |
707 | - | let x1 = $ | |
708 | - | let x2 = $ | |
709 | - | let oldLatestCPF = $ | |
707 | + | let $t02933029583 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
708 | + | let remainMargin = $t02933029583._1 | |
709 | + | let x1 = $t02933029583._2 | |
710 | + | let x2 = $t02933029583._3 | |
711 | + | let oldLatestCPF = $t02933029583._4 | |
710 | 712 | $Tuple10(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), oldLatestCPF, baseAssetReserveAfter, quoteAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, (openInteresetNotional() + openNotional)) | |
711 | 713 | } | |
712 | 714 | } | |
713 | 715 | else { | |
714 | 716 | let openNotional = muld(_amount, _leverage) | |
715 | - | let $ | |
716 | - | let oldPositionNotional = $ | |
717 | - | let unrealizedPnl = $ | |
717 | + | let $t03025630372 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
718 | + | let oldPositionNotional = $t03025630372._1 | |
719 | + | let unrealizedPnl = $t03025630372._2 | |
718 | 720 | if ((oldPositionNotional > openNotional)) | |
719 | 721 | then throw("Use decreasePosition to decrease position size") | |
720 | 722 | else throw("Close position first") | |
721 | 723 | } | |
722 | - | let newPositionSize = $ | |
723 | - | let newPositionRemainMargin = $ | |
724 | - | let newPosiionOpenNotional = $ | |
725 | - | let newPositionLatestCPF = $ | |
726 | - | let baseAssetReserveAfter = $ | |
727 | - | let quoteAssetReserveAfter = $ | |
728 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
729 | - | let totalPositionSizeAfter = $ | |
730 | - | let cumulativeNotionalAfter = $ | |
731 | - | let openInteresetNotionalAfter = $ | |
724 | + | let newPositionSize = $t02827430563._1 | |
725 | + | let newPositionRemainMargin = $t02827430563._2 | |
726 | + | let newPosiionOpenNotional = $t02827430563._3 | |
727 | + | let newPositionLatestCPF = $t02827430563._4 | |
728 | + | let baseAssetReserveAfter = $t02827430563._5 | |
729 | + | let quoteAssetReserveAfter = $t02827430563._6 | |
730 | + | let baseAssetDeltaThisFundingPeriodAfter = $t02827430563._7 | |
731 | + | let totalPositionSizeAfter = $t02827430563._8 | |
732 | + | let cumulativeNotionalAfter = $t02827430563._9 | |
733 | + | let openInteresetNotionalAfter = $t02827430563._10 | |
732 | 734 | let feeToStakers = (feeAmount / 2) | |
733 | 735 | let feeToInsurance = (feeAmount - feeToStakers) | |
734 | 736 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
735 | 737 | if ((stake == stake)) | |
736 | 738 | then { | |
737 | 739 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
738 | 740 | if ((depositInsurance == depositInsurance)) | |
739 | 741 | then (((updatePosition(toString(i.caller), newPositionSize, newPositionRemainMargin, newPosiionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
740 | 742 | else throw("Strict value is not equal to itself.") | |
741 | 743 | } | |
742 | 744 | else throw("Strict value is not equal to itself.") | |
743 | 745 | } | |
744 | 746 | } | |
745 | 747 | ||
746 | 748 | ||
747 | 749 | ||
748 | 750 | @Callable(i) | |
749 | 751 | func addMargin () = { | |
750 | 752 | let _rawAmount = i.payments[0].amount | |
751 | 753 | if (if (if (if ((i.payments[0].assetId != quoteAsset())) | |
752 | 754 | then true | |
753 | 755 | else !(requireOpenPosition(toString(i.caller)))) | |
754 | 756 | then true | |
755 | 757 | else !(initialized())) | |
756 | 758 | then true | |
757 | 759 | else paused()) | |
758 | 760 | then throw("Invalid addMargin parameters") | |
759 | 761 | else { | |
760 | 762 | let feeAmount = muld(_rawAmount, fee()) | |
761 | 763 | let _amount = (_rawAmount - feeAmount) | |
762 | - | let $ | |
763 | - | let oldPositionSize = $ | |
764 | - | let oldPositionMargin = $ | |
765 | - | let oldPositionOpenNotional = $ | |
766 | - | let oldPositionLstUpdCPF = $ | |
764 | + | let $t03183831990 = getPosition(toString(i.caller)) | |
765 | + | let oldPositionSize = $t03183831990._1 | |
766 | + | let oldPositionMargin = $t03183831990._2 | |
767 | + | let oldPositionOpenNotional = $t03183831990._3 | |
768 | + | let oldPositionLstUpdCPF = $t03183831990._4 | |
767 | 769 | let feeToStakers = (feeAmount / 2) | |
768 | 770 | let feeToInsurance = (feeAmount - feeToStakers) | |
769 | 771 | let stake = invoke(quoteAssetStaking(), "lockNeutrinoSP", [toString(stakingAddress()), ALL_FEES], [AttachedPayment(quoteAsset(), _amount)]) | |
770 | 772 | if ((stake == stake)) | |
771 | 773 | then { | |
772 | 774 | let depositInsurance = invoke(insuranceAddress(), "deposit", nil, [AttachedPayment(quoteAsset(), feeToInsurance)]) | |
773 | 775 | if ((depositInsurance == depositInsurance)) | |
774 | 776 | then ((updatePosition(toString(i.caller), oldPositionSize, (oldPositionMargin + i.payments[0].amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) | |
775 | 777 | else throw("Strict value is not equal to itself.") | |
776 | 778 | } | |
777 | 779 | else throw("Strict value is not equal to itself.") | |
778 | 780 | } | |
779 | 781 | } | |
780 | 782 | ||
781 | 783 | ||
782 | 784 | ||
783 | 785 | @Callable(i) | |
784 | 786 | func removeMargin (_amount) = if (if (if (if ((0 >= _amount)) | |
785 | 787 | then true | |
786 | 788 | else !(requireOpenPosition(toString(i.caller)))) | |
787 | 789 | then true | |
788 | 790 | else !(initialized())) | |
789 | 791 | then true | |
790 | 792 | else paused()) | |
791 | 793 | then throw("Invalid removeMargin parameters") | |
792 | 794 | else { | |
793 | - | let $ | |
794 | - | let oldPositionSize = $ | |
795 | - | let oldPositionMargin = $ | |
796 | - | let oldPositionOpenNotional = $ | |
797 | - | let oldPositionLstUpdCPF = $ | |
795 | + | let $t03292333075 = getPosition(toString(i.caller)) | |
796 | + | let oldPositionSize = $t03292333075._1 | |
797 | + | let oldPositionMargin = $t03292333075._2 | |
798 | + | let oldPositionOpenNotional = $t03292333075._3 | |
799 | + | let oldPositionLstUpdCPF = $t03292333075._4 | |
798 | 800 | let marginDelta = -(_amount) | |
799 | - | let $ | |
800 | - | let remainMargin = $ | |
801 | - | let badDebt = $ | |
802 | - | let x1 = $ | |
803 | - | let latestCPF1 = $ | |
801 | + | let $t03311233307 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
802 | + | let remainMargin = $t03311233307._1 | |
803 | + | let badDebt = $t03311233307._2 | |
804 | + | let x1 = $t03311233307._3 | |
805 | + | let latestCPF1 = $t03311233307._4 | |
804 | 806 | if ((badDebt != 0)) | |
805 | 807 | then throw("Invalid added margin amount") | |
806 | 808 | else { | |
807 | 809 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [_amount, toBase58String(quoteAsset())], nil) | |
808 | 810 | if ((unstake == unstake)) | |
809 | 811 | then ((updatePosition(toString(i.caller), oldPositionSize, remainMargin, oldPositionOpenNotional, latestCPF1) ++ withdraw(i.caller, _amount)) ++ updateBalance((cbalance() - _amount))) | |
810 | 812 | else throw("Strict value is not equal to itself.") | |
811 | 813 | } | |
812 | 814 | } | |
813 | 815 | ||
814 | 816 | ||
815 | 817 | ||
816 | 818 | @Callable(i) | |
817 | 819 | func closePosition () = if (if (if (!(requireOpenPosition(toString(i.caller)))) | |
818 | 820 | then true | |
819 | 821 | else !(initialized())) | |
820 | 822 | then true | |
821 | 823 | else paused()) | |
822 | 824 | then throw("Invalid closePosition parameters") | |
823 | 825 | else { | |
824 | - | let $ | |
825 | - | let x1 = $ | |
826 | - | let badDebt = $ | |
827 | - | let realizedPnl = $ | |
828 | - | let marginToVault = $ | |
829 | - | let quoteAssetReserveAfter = $ | |
830 | - | let baseAssetReserveAfter = $ | |
831 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
832 | - | let totalPositionSizeAfter = $ | |
833 | - | let cumulativeNotionalAfter = $ | |
834 | - | let openInteresetNotionalAfter = $ | |
826 | + | let $t03402934387 = internalClosePosition(toString(i.caller)) | |
827 | + | let x1 = $t03402934387._1 | |
828 | + | let badDebt = $t03402934387._2 | |
829 | + | let realizedPnl = $t03402934387._3 | |
830 | + | let marginToVault = $t03402934387._4 | |
831 | + | let quoteAssetReserveAfter = $t03402934387._5 | |
832 | + | let baseAssetReserveAfter = $t03402934387._6 | |
833 | + | let baseAssetDeltaThisFundingPeriodAfter = $t03402934387._7 | |
834 | + | let totalPositionSizeAfter = $t03402934387._8 | |
835 | + | let cumulativeNotionalAfter = $t03402934387._9 | |
836 | + | let openInteresetNotionalAfter = $t03402934387._10 | |
835 | 837 | if ((badDebt > 0)) | |
836 | 838 | then throw("Unable to close position with bad debt") | |
837 | 839 | else { | |
838 | 840 | let withdrawAmount = abs(marginToVault) | |
839 | 841 | let bd = (cbalance() - withdrawAmount) | |
840 | - | let $ | |
842 | + | let $t03458034676 = if ((0 > bd)) | |
841 | 843 | then $Tuple2(0, abs(bd)) | |
842 | 844 | else $Tuple2(bd, 0) | |
843 | - | let nb = $ | |
844 | - | let fromi = $ | |
845 | + | let nb = $t03458034676._1 | |
846 | + | let fromi = $t03458034676._2 | |
845 | 847 | let x = if ((fromi > 0)) | |
846 | 848 | then { | |
847 | 849 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [fromi], nil) | |
848 | 850 | if ((withdrawInsurance == withdrawInsurance)) | |
849 | 851 | then nil | |
850 | 852 | else throw("Strict value is not equal to itself.") | |
851 | 853 | } | |
852 | 854 | else nil | |
853 | 855 | if ((x == x)) | |
854 | 856 | then { | |
855 | 857 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(withdrawAmount - fromi), toBase58String(quoteAsset())], nil) | |
856 | 858 | if ((unstake == unstake)) | |
857 | 859 | then (((deletePosition(toString(i.caller)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) ++ withdraw(i.caller, withdrawAmount)) ++ updateBalance(nb)) | |
858 | 860 | else throw("Strict value is not equal to itself.") | |
859 | 861 | } | |
860 | 862 | else throw("Strict value is not equal to itself.") | |
861 | 863 | } | |
862 | 864 | } | |
863 | 865 | ||
864 | 866 | ||
865 | 867 | ||
866 | 868 | @Callable(i) | |
867 | 869 | func liquidate (_trader) = { | |
868 | 870 | let marginRatio = if (isOverFluctuationLimit()) | |
869 | 871 | then getMarginRatioByOption(_trader, PNL_OPTION_ORACLE) | |
870 | 872 | else getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
871 | 873 | if (if (if (!(requireMoreMarginRatio(marginRatio, mmr(), false))) | |
872 | 874 | then true | |
873 | 875 | else !(initialized())) | |
874 | 876 | then true | |
875 | 877 | else paused()) | |
876 | 878 | then throw("Unable to liquidate") | |
877 | 879 | else { | |
878 | - | let $ | |
879 | - | let x1 = $ | |
880 | - | let badDebt = $ | |
881 | - | let x2 = $ | |
882 | - | let marginToVault = $ | |
883 | - | let quoteAssetReserveAfter = $ | |
884 | - | let baseAssetReserveAfter = $ | |
885 | - | let baseAssetDeltaThisFundingPeriodAfter = $ | |
886 | - | let totalPositionSizeAfter = $ | |
887 | - | let cumulativeNotionalAfter = $ | |
888 | - | let openInteresetNotionalAfter = $ | |
889 | - | let exchangedQuoteAssetAmount = $ | |
880 | + | let $t03584836178 = internalClosePosition(_trader) | |
881 | + | let x1 = $t03584836178._1 | |
882 | + | let badDebt = $t03584836178._2 | |
883 | + | let x2 = $t03584836178._3 | |
884 | + | let marginToVault = $t03584836178._4 | |
885 | + | let quoteAssetReserveAfter = $t03584836178._5 | |
886 | + | let baseAssetReserveAfter = $t03584836178._6 | |
887 | + | let baseAssetDeltaThisFundingPeriodAfter = $t03584836178._7 | |
888 | + | let totalPositionSizeAfter = $t03584836178._8 | |
889 | + | let cumulativeNotionalAfter = $t03584836178._9 | |
890 | + | let openInteresetNotionalAfter = $t03584836178._10 | |
891 | + | let exchangedQuoteAssetAmount = $t03584836178._11 | |
890 | 892 | let feeToLiquidator = (muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) / 2) | |
891 | - | let $ | |
893 | + | let $t03626836672 = if ((feeToLiquidator > marginToVault)) | |
892 | 894 | then $Tuple3((feeToLiquidator - marginToVault), marginToVault, ((badDebt + feeToLiquidator) - marginToVault)) | |
893 | 895 | else $Tuple3(0, (marginToVault - feeToLiquidator), badDebt) | |
894 | - | let liquidationBadDebt = $ | |
895 | - | let remainMargin = $ | |
896 | - | let totalBadDebt = $ | |
896 | + | let liquidationBadDebt = $t03626836672._1 | |
897 | + | let remainMargin = $t03626836672._2 | |
898 | + | let totalBadDebt = $t03626836672._3 | |
897 | 899 | let bd = (cbalance() - feeToLiquidator) | |
898 | - | let $ | |
900 | + | let $t03672036808 = if ((0 > bd)) | |
899 | 901 | then $Tuple2(0, abs(bd)) | |
900 | 902 | else $Tuple2(bd, 0) | |
901 | - | let nb = $ | |
902 | - | let fromi = $ | |
903 | + | let nb = $t03672036808._1 | |
904 | + | let fromi = $t03672036808._2 | |
903 | 905 | let x = if ((fromi > 0)) | |
904 | 906 | then { | |
905 | 907 | let withdrawInsurance = invoke(insuranceAddress(), "withdraw", [fromi], nil) | |
906 | 908 | if ((withdrawInsurance == withdrawInsurance)) | |
907 | 909 | then nil | |
908 | 910 | else throw("Strict value is not equal to itself.") | |
909 | 911 | } | |
910 | 912 | else nil | |
911 | 913 | if ((x == x)) | |
912 | 914 | then { | |
913 | 915 | let unstake = invoke(quoteAssetStaking(), "unlockNeutrino", [(feeToLiquidator - fromi), toBase58String(quoteAsset())], nil) | |
914 | 916 | if ((unstake == unstake)) | |
915 | 917 | then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, baseAssetDeltaThisFundingPeriodAfter, totalPositionSizeAfter, cumulativeNotionalAfter, openInteresetNotionalAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(nb)) | |
916 | 918 | else throw("Strict value is not equal to itself.") | |
917 | 919 | } | |
918 | 920 | else throw("Strict value is not equal to itself.") | |
919 | 921 | } | |
920 | 922 | } | |
921 | 923 | ||
922 | 924 | ||
923 | 925 | ||
924 | 926 | @Callable(i) | |
925 | 927 | func payFunding () = { | |
926 | 928 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
927 | 929 | if (if (if ((fundingBlockTimestamp > lastBlock.timestamp)) | |
928 | 930 | then true | |
929 | 931 | else !(initialized())) | |
930 | 932 | then true | |
931 | 933 | else paused()) | |
932 | 934 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
933 | 935 | else { | |
934 | 936 | let underlyingPrice = getOracleTwapPrice() | |
935 | 937 | let spotTwapPrice = getTwapSpotPrice() | |
936 | 938 | let premium = (spotTwapPrice - underlyingPrice) | |
937 | 939 | let premiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
938 | 940 | updateFunding(0, (fundingBlockTimestamp + fundingPeriodSeconds()), (latestCPF() + premiumFraction), divd(premiumFraction, underlyingPrice)) | |
939 | 941 | } | |
940 | 942 | } | |
941 | 943 | ||
942 | 944 | ||
943 | 945 | ||
944 | 946 | @Callable(i) | |
945 | 947 | func v_get (_trader) = { | |
946 | - | let $ | |
947 | - | let x1 = $ | |
948 | - | let x2 = $ | |
949 | - | let x3 = $ | |
950 | - | let x4 = $ | |
948 | + | let $t03828238335 = internalClosePosition(_trader) | |
949 | + | let x1 = $t03828238335._1 | |
950 | + | let x2 = $t03828238335._2 | |
951 | + | let x3 = $t03828238335._3 | |
952 | + | let x4 = $t03828238335._4 | |
951 | 953 | throw((((s(x2) + s(x3)) + s(x4)) + s(getMarginRatio(_trader)))) | |
952 | 954 | } | |
953 | 955 | ||
954 | 956 | ||
955 | 957 | @Verifier(tx) | |
956 | 958 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
957 | 959 |
github/deemru/w8io/169f3d6 194.03 ms ◑