tx · 37W6Tg1wWRgT89QaG9SLweQtV7xzjpCX6BBB4HZo73JE 3N2PpSwSkK98YvLff2xQa6UcZ6LZ4suyFUF: -0.07500000 Waves 2022.12.29 12:39 [2381399] smart account 3N2PpSwSkK98YvLff2xQa6UcZ6LZ4suyFUF > SELF 0.00000000 Waves
{ "type": 13, "id": "37W6Tg1wWRgT89QaG9SLweQtV7xzjpCX6BBB4HZo73JE", "fee": 7500000, "feeAssetId": null, "timestamp": 1672306788687, "version": 2, "chainId": 84, "sender": "3N2PpSwSkK98YvLff2xQa6UcZ6LZ4suyFUF", "senderPublicKey": "F7t5bFSaRPct8VH5ZVsR6Z5ZrmBs8ScAsYtnsNFgwgS3", "proofs": [ "4WTh6Vr6qjdXUUVnrWJSGjHaRAR7oxALnAS3k87tXaa4bLpA8wpdGKJA8GUJjdSxEckba7SSFiDeAj2jktFbzNt2" ], "script": "base64:BgJ6CAISABIAEgASABIDCgEBEgMKAQESDgoMAQEBAQEBAQEBAQEBEhQKEgEBAQEBAQEICAgIAQEBAQEBARIFCgMBAQESBgoEAQEBCBIAEgMKAQESBAoCAQESAwoBCBIAEgASAwoBCBIDCgEBEgASABIDCgEIEgASBAoCCAjDAQAJa19vcmFfa2V5AglrX29yYV9rZXkAD2tfb3JhX2Jsb2NrX2tleQIPa19vcmFfYmxvY2tfa2V5AA5rX29yYV9vcGVuX2tleQIOa19vcmFfb3Blbl9rZXkABWtfb3JhAgVrX29yYQAJa19iYWxhbmNlAglrX2JhbGFuY2UACmtfc2VxdWVuY2UCCmtfc2VxdWVuY2UADmtfcG9zaXRpb25TaXplAg5rX3Bvc2l0aW9uU2l6ZQAQa19wb3NpdGlvbk1hcmdpbgIQa19wb3NpdGlvbk1hcmdpbgAWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAIWa19wb3NpdGlvbk9wZW5Ob3Rpb25hbAAua19wb3NpdGlvbkxhc3RVcGRhdGVkQ3VtdWxhdGl2ZVByZW1pdW1GcmFjdGlvbgISa19wb3N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VkQnlUcmFkZXIBBQdfdHJhZGVyBAhib3Jyb3dlZAgFDSR0MDg1ODIwODU4NzQCXzEEB2Fzc2V0SWQIBQ0kdDA4NTgyMDg1ODc0Al8yCQACAQkArAICCQEBcwEFCGJvcnJvd2VkBQdhc3NldElkAWkBEGNvbXB1dGVTcG90UHJpY2UABAZyZXN1bHQJAQxnZXRTcG90UHJpY2UACQCUCgIFA25pbAUGcmVzdWx0AWkBH2NvbXB1dGVGZWVGb3JUcmFkZXJXaXRoQXJ0aWZhY3QCB190cmFkZXILX2FydGlmYWN0SWQEBnJlc3VsdAkBGGdldEZvclRyYWRlcldpdGhBcnRpZmFjdAIFB190cmFkZXIFC19hcnRpZmFjdElkCQCUCgIFA25pbAUGcmVzdWx0AQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAkBDmFkbWluUHVibGljS2V5AHqiZSg=", "height": 2381399, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ckUG1Y86C6wyjXAavWeQTRvrQTmzN1aRhPFXJWWhyyB Next: CPkoPyMfPDr394FQ1mumC5872Qe1bgj5t3RHBrV673jf Diff:
Old | New | Differences | |
---|---|---|---|
1157 | 1157 | let $t05008050184 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1158 | 1158 | let oldPositionNotional = $t05008050184._1 | |
1159 | 1159 | let unrealizedPnl = $t05008050184._2 | |
1160 | - | let $ | |
1160 | + | let $t05019052832 = if ((oldPositionNotional > openNotional)) | |
1161 | 1161 | then { | |
1162 | 1162 | let $t05060550789 = swapInput(isAdd, openNotional) | |
1163 | 1163 | let exchangedPositionSize = $t05060550789._1 | |
1171 | 1171 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
1172 | 1172 | else { | |
1173 | 1173 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
1174 | - | let $t05122651471 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1175 | - | let remainMargin = $t05122651471._1 | |
1176 | - | let badDebt = $t05122651471._2 | |
1177 | - | let fundingPayment = $t05122651471._3 | |
1174 | + | let $t05122651455 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1175 | + | let remainMargin = $t05122651455._1 | |
1176 | + | let badDebt = $t05122651455._2 | |
1178 | 1177 | let exchangedQuoteAssetAmount = openNotional | |
1179 | 1178 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1180 | 1179 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1193 | 1192 | } | |
1194 | 1193 | } | |
1195 | 1194 | else throw("Close position first") | |
1196 | - | let newPositionSize = $ | |
1197 | - | let newPositionRemainMargin = $ | |
1198 | - | let newPositionOpenNotional = $ | |
1199 | - | let newPositionLatestCPF = $ | |
1200 | - | let baseAssetReserveAfter = $ | |
1201 | - | let quoteAssetReserveAfter = $ | |
1202 | - | let totalPositionSizeAfter = $ | |
1203 | - | let openInterestNotionalAfter = $ | |
1204 | - | let totalLongAfter = $ | |
1205 | - | let totalShortAfter = $ | |
1206 | - | let totalLongOpenInterestAfter = $ | |
1207 | - | let totalShortOpenInterestAfter = $ | |
1195 | + | let newPositionSize = $t05019052832._1 | |
1196 | + | let newPositionRemainMargin = $t05019052832._2 | |
1197 | + | let newPositionOpenNotional = $t05019052832._3 | |
1198 | + | let newPositionLatestCPF = $t05019052832._4 | |
1199 | + | let baseAssetReserveAfter = $t05019052832._5 | |
1200 | + | let quoteAssetReserveAfter = $t05019052832._6 | |
1201 | + | let totalPositionSizeAfter = $t05019052832._7 | |
1202 | + | let openInterestNotionalAfter = $t05019052832._8 | |
1203 | + | let totalLongAfter = $t05019052832._9 | |
1204 | + | let totalShortAfter = $t05019052832._10 | |
1205 | + | let totalLongOpenInterestAfter = $t05019052832._11 | |
1206 | + | let totalShortOpenInterestAfter = $t05019052832._12 | |
1208 | 1207 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1209 | 1208 | if ((notifyNotional == notifyNotional)) | |
1210 | 1209 | then (updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) | |
1250 | 1249 | else isMarketClosed()) | |
1251 | 1250 | then throw("Invalid increasePosition parameters") | |
1252 | 1251 | else { | |
1253 | - | let $ | |
1254 | - | let adjustedFee = $ | |
1255 | - | let burnArtifact = $ | |
1252 | + | let $t05429454379 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1253 | + | let adjustedFee = $t05429454379._1 | |
1254 | + | let burnArtifact = $t05429454379._2 | |
1256 | 1255 | let rawFeeAmount = muld(_rawAmount, adjustedFee) | |
1257 | 1256 | let _amount = (_rawAmount - rawFeeAmount) | |
1258 | 1257 | let distributeFeeAmount = if (isCollateralAsset) | |
1295 | 1294 | throw("Invalid referrerFee") | |
1296 | 1295 | } | |
1297 | 1296 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1298 | - | let $ | |
1299 | - | let oldPositionSize = $ | |
1300 | - | let oldPositionMargin = $ | |
1301 | - | let oldPositionOpenNotional = $ | |
1302 | - | let oldPositionLstUpdCPF = $ | |
1297 | + | let $t05569555835 = getPosition(_trader) | |
1298 | + | let oldPositionSize = $t05569555835._1 | |
1299 | + | let oldPositionMargin = $t05569555835._2 | |
1300 | + | let oldPositionOpenNotional = $t05569555835._3 | |
1301 | + | let oldPositionLstUpdCPF = $t05569555835._4 | |
1303 | 1302 | let isNewPosition = (oldPositionSize == 0) | |
1304 | 1303 | let isSameDirection = if ((oldPositionSize > 0)) | |
1305 | 1304 | then (_direction == DIR_LONG) | |
1308 | 1307 | then isSameDirection | |
1309 | 1308 | else false | |
1310 | 1309 | let isAdd = (_direction == DIR_LONG) | |
1311 | - | let $ | |
1310 | + | let $t05612459165 = if (if (isNewPosition) | |
1312 | 1311 | then true | |
1313 | 1312 | else expandExisting) | |
1314 | 1313 | then { | |
1315 | 1314 | let openNotional = muld(_amount, _leverage) | |
1316 | - | let $ | |
1317 | - | let amountBaseAssetBought = $ | |
1318 | - | let quoteAssetReserveAfter = $ | |
1319 | - | let baseAssetReserveAfter = $ | |
1320 | - | let totalPositionSizeAfter = $ | |
1315 | + | let $t05658656759 = swapInput(isAdd, openNotional) | |
1316 | + | let amountBaseAssetBought = $t05658656759._1 | |
1317 | + | let quoteAssetReserveAfter = $t05658656759._2 | |
1318 | + | let baseAssetReserveAfter = $t05658656759._3 | |
1319 | + | let totalPositionSizeAfter = $t05658656759._4 | |
1321 | 1320 | if (if ((_minBaseAssetAmount != 0)) | |
1322 | 1321 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
1323 | 1322 | else false) | |
1331 | 1330 | then openNotional | |
1332 | 1331 | else 0)) | |
1333 | 1332 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
1334 | - | let $ | |
1335 | - | let remainMargin = $ | |
1336 | - | let x1 = $ | |
1337 | - | let x2 = $ | |
1333 | + | let $t05736757606 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
1334 | + | let remainMargin = $t05736757606._1 | |
1335 | + | let x1 = $t05736757606._2 | |
1336 | + | let x2 = $t05736757606._3 | |
1338 | 1337 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
1339 | 1338 | then throw("Over max spread limit") | |
1340 | 1339 | else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter))) | |
1348 | 1347 | } | |
1349 | 1348 | else { | |
1350 | 1349 | let openNotional = muld(_amount, _leverage) | |
1351 | - | let $ | |
1352 | - | let oldPositionNotional = $ | |
1353 | - | let unrealizedPnl = $ | |
1350 | + | let $t05886558981 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
1351 | + | let oldPositionNotional = $t05886558981._1 | |
1352 | + | let unrealizedPnl = $t05886558981._2 | |
1354 | 1353 | if ((oldPositionNotional > openNotional)) | |
1355 | 1354 | then throw("Use decreasePosition to decrease position size") | |
1356 | 1355 | else throw("Close position first") | |
1357 | 1356 | } | |
1358 | - | let newPositionSize = $ | |
1359 | - | let newPositionRemainMargin = $ | |
1360 | - | let newPositionOpenNotional = $ | |
1361 | - | let newPositionLatestCPF = $ | |
1362 | - | let baseAssetReserveAfter = $ | |
1363 | - | let quoteAssetReserveAfter = $ | |
1364 | - | let totalPositionSizeAfter = $ | |
1365 | - | let openInterestNotionalAfter = $ | |
1366 | - | let totalLongAfter = $ | |
1367 | - | let totalShortAfter = $ | |
1368 | - | let totalLongOpenInterestAfter = $ | |
1369 | - | let totalShortOpenInterestAfter = $ | |
1370 | - | let $ | |
1371 | - | let feeToStakers = $ | |
1372 | - | let feeToVault = $ | |
1357 | + | let newPositionSize = $t05612459165._1 | |
1358 | + | let newPositionRemainMargin = $t05612459165._2 | |
1359 | + | let newPositionOpenNotional = $t05612459165._3 | |
1360 | + | let newPositionLatestCPF = $t05612459165._4 | |
1361 | + | let baseAssetReserveAfter = $t05612459165._5 | |
1362 | + | let quoteAssetReserveAfter = $t05612459165._6 | |
1363 | + | let totalPositionSizeAfter = $t05612459165._7 | |
1364 | + | let openInterestNotionalAfter = $t05612459165._8 | |
1365 | + | let totalLongAfter = $t05612459165._9 | |
1366 | + | let totalShortAfter = $t05612459165._10 | |
1367 | + | let totalLongOpenInterestAfter = $t05612459165._11 | |
1368 | + | let totalShortOpenInterestAfter = $t05612459165._12 | |
1369 | + | let $t05917159228 = distributeFee(feeAmount) | |
1370 | + | let feeToStakers = $t05917159228._1 | |
1371 | + | let feeToVault = $t05917159228._2 | |
1373 | 1372 | let stake = if (isQuoteAsset) | |
1374 | 1373 | then { | |
1375 | 1374 | let stake = invoke(vaultAddress(), "addLocked", [false], [AttachedPayment(quoteAsset(), _amount)]) | |
1435 | 1434 | else isMarketClosed()) | |
1436 | 1435 | then throw("Invalid addMargin parameters") | |
1437 | 1436 | else { | |
1438 | - | let $ | |
1439 | - | let adjustedFee = $ | |
1440 | - | let burnArtifact = $ | |
1437 | + | let $t06120061285 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1438 | + | let adjustedFee = $t06120061285._1 | |
1439 | + | let burnArtifact = $t06120061285._2 | |
1441 | 1440 | let rawFeeAmount = muld(_rawAmount, adjustedFee) | |
1442 | 1441 | let _amount = (_rawAmount - rawFeeAmount) | |
1443 | 1442 | let distributeFeeAmount = if (isCollateralAsset) | |
1480 | 1479 | throw("Invalid referrerFee") | |
1481 | 1480 | } | |
1482 | 1481 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1483 | - | let $ | |
1484 | - | let oldPositionSize = $ | |
1485 | - | let oldPositionMargin = $ | |
1486 | - | let oldPositionOpenNotional = $ | |
1487 | - | let oldPositionLstUpdCPF = $ | |
1488 | - | let $ | |
1489 | - | let feeToStakers = $ | |
1490 | - | let feeToVault = $ | |
1482 | + | let $t06258462724 = getPosition(_trader) | |
1483 | + | let oldPositionSize = $t06258462724._1 | |
1484 | + | let oldPositionMargin = $t06258462724._2 | |
1485 | + | let oldPositionOpenNotional = $t06258462724._3 | |
1486 | + | let oldPositionLstUpdCPF = $t06258462724._4 | |
1487 | + | let $t06273062787 = distributeFee(feeAmount) | |
1488 | + | let feeToStakers = $t06273062787._1 | |
1489 | + | let feeToVault = $t06273062787._2 | |
1491 | 1490 | let stake = if (isQuoteAsset) | |
1492 | 1491 | then { | |
1493 | 1492 | let stake = invoke(vaultAddress(), "addLocked", [false], [AttachedPayment(quoteAsset(), _amount)]) | |
1537 | 1536 | else isMarketClosed()) | |
1538 | 1537 | then throw("Invalid removeMargin parameters") | |
1539 | 1538 | else { | |
1540 | - | let $ | |
1541 | - | let oldPositionSize = $ | |
1542 | - | let oldPositionMargin = $ | |
1543 | - | let oldPositionOpenNotional = $ | |
1544 | - | let oldPositionLstUpdCPF = $ | |
1539 | + | let $t06392364063 = getPosition(_trader) | |
1540 | + | let oldPositionSize = $t06392364063._1 | |
1541 | + | let oldPositionMargin = $t06392364063._2 | |
1542 | + | let oldPositionOpenNotional = $t06392364063._3 | |
1543 | + | let oldPositionLstUpdCPF = $t06392364063._4 | |
1545 | 1544 | let marginDelta = -(_amount) | |
1546 | - | let $ | |
1547 | - | let remainMargin = $ | |
1548 | - | let badDebt = $ | |
1545 | + | let $t06410064279 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
1546 | + | let remainMargin = $t06410064279._1 | |
1547 | + | let badDebt = $t06410064279._2 | |
1549 | 1548 | if ((badDebt != 0)) | |
1550 | 1549 | then throw("Invalid removed margin amount") | |
1551 | 1550 | else { | |
1554 | 1553 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1555 | 1554 | else { | |
1556 | 1555 | let quoteAssetStr = toBase58String(quoteAsset()) | |
1557 | - | let $ | |
1558 | - | let borrowed = $ | |
1559 | - | let assetId = $ | |
1556 | + | let $t06472364777 = getBorrowedByTrader(_trader) | |
1557 | + | let borrowed = $t06472364777._1 | |
1558 | + | let assetId = $t06472364777._2 | |
1560 | 1559 | let toRepay = if ((_amount > borrowed)) | |
1561 | 1560 | then borrowed | |
1562 | 1561 | else _amount | |
1628 | 1627 | else isMarketClosed()) | |
1629 | 1628 | then throw("Invalid closePosition parameters") | |
1630 | 1629 | else { | |
1631 | - | let $ | |
1632 | - | let oldPositionSize = $ | |
1633 | - | let oldPositionMargin = $ | |
1634 | - | let oldPositionOpenNotional = $ | |
1635 | - | let oldPositionLstUpdCPF = $ | |
1636 | - | let $ | |
1630 | + | let $t06696167101 = getPosition(_trader) | |
1631 | + | let oldPositionSize = $t06696167101._1 | |
1632 | + | let oldPositionMargin = $t06696167101._2 | |
1633 | + | let oldPositionOpenNotional = $t06696167101._3 | |
1634 | + | let oldPositionLstUpdCPF = $t06696167101._4 | |
1635 | + | let $t06710772237 = if ((abs(oldPositionSize) > _size)) | |
1637 | 1636 | then { | |
1638 | 1637 | let _direction = if ((oldPositionSize > 0)) | |
1639 | 1638 | then DIR_SHORT | |
1640 | 1639 | else DIR_LONG | |
1641 | 1640 | let isAdd = (_direction == DIR_LONG) | |
1642 | - | let $ | |
1643 | - | let exchangedQuoteAssetAmount = $ | |
1644 | - | let quoteAssetReserveAfter = $ | |
1645 | - | let baseAssetReserveAfter = $ | |
1646 | - | let totalPositionSizeAfter = $ | |
1641 | + | let $t06769867920 = swapOutput((oldPositionSize > 0), _size, true) | |
1642 | + | let exchangedQuoteAssetAmount = $t06769867920._1 | |
1643 | + | let quoteAssetReserveAfter = $t06769867920._2 | |
1644 | + | let baseAssetReserveAfter = $t06769867920._3 | |
1645 | + | let totalPositionSizeAfter = $t06769867920._4 | |
1647 | 1646 | let exchangedPositionSize = if ((oldPositionSize > 0)) | |
1648 | 1647 | then -(_size) | |
1649 | 1648 | else _size | |
1650 | - | let $ | |
1651 | - | let oldPositionNotional = $ | |
1652 | - | let unrealizedPnl = $ | |
1649 | + | let $t06801168165 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1650 | + | let oldPositionNotional = $t06801168165._1 | |
1651 | + | let unrealizedPnl = $t06801168165._2 | |
1653 | 1652 | let mr = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
1654 | 1653 | let realizedRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize)) | |
1655 | 1654 | let realizedPnl = muld(unrealizedPnl, realizedRatio) | |
1656 | 1655 | let remainMarginBefore = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, unrealizedPnl)._1 | |
1657 | - | let $ | |
1658 | - | let | |
1659 | - | let positionBadDebt = $ | |
1660 | - | let fundingPayment = $ | |
1656 | + | let $t06866668894 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1657 | + | let x1 = $t06866668894._1 | |
1658 | + | let positionBadDebt = $t06866668894._2 | |
1659 | + | let fundingPayment = $t06866668894._3 | |
1661 | 1660 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1662 | 1661 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1663 | 1662 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1666 | 1665 | let newPositionMargin = if ((oldPositionSize > 0)) | |
1667 | 1666 | then (muld((newPositionOpenNotional + unrealizedPnlAfter), mr) - unrealizedPnlAfter) | |
1668 | 1667 | else (muld((newPositionOpenNotional - unrealizedPnlAfter), mr) - unrealizedPnlAfter) | |
1668 | + | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
1669 | 1669 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1670 | 1670 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1671 | - | let openInterestNotionalAfter = (openInterestNotional() - | |
1671 | + | let openInterestNotionalAfter = (openInterestNotional() - openNotionalDelta) | |
1672 | 1672 | if (if ((_minQuoteAssetAmount != 0)) | |
1673 | 1673 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
1674 | 1674 | else false) | |
1678 | 1678 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1679 | 1679 | then abs(exchangedPositionSize) | |
1680 | 1680 | else 0)), (openInterestLong() - (if ((newPositionSize > 0)) | |
1681 | - | then | |
1681 | + | then openNotionalDelta | |
1682 | 1682 | else 0)), (openInterestShort() - (if ((0 > newPositionSize)) | |
1683 | - | then | |
1683 | + | then openNotionalDelta | |
1684 | 1684 | else 0))) | |
1685 | 1685 | } | |
1686 | 1686 | else if ((_size > abs(oldPositionSize))) | |
1687 | 1687 | then throw("Invalid closePosition parameters") | |
1688 | 1688 | else { | |
1689 | - | let $ | |
1690 | - | let exchangedQuoteAssetAmount = $ | |
1691 | - | let positionBadDebt = $ | |
1692 | - | let realizedPnl = $ | |
1693 | - | let marginToVault = $ | |
1694 | - | let quoteAssetReserveAfter = $ | |
1695 | - | let baseAssetReserveAfter = $ | |
1696 | - | let totalPositionSizeAfter = $ | |
1697 | - | let openInterestNotionalAfter = $ | |
1698 | - | let x2 = $ | |
1699 | - | let totalLongAfter = $ | |
1700 | - | let totalShortAfter = $ | |
1701 | - | let totalLongOpenInterestAfter = $ | |
1702 | - | let totalShortOpenInterestAfter = $ | |
1689 | + | let $t07117871597 = internalClosePosition(_trader, true) | |
1690 | + | let exchangedQuoteAssetAmount = $t07117871597._1 | |
1691 | + | let positionBadDebt = $t07117871597._2 | |
1692 | + | let realizedPnl = $t07117871597._3 | |
1693 | + | let marginToVault = $t07117871597._4 | |
1694 | + | let quoteAssetReserveAfter = $t07117871597._5 | |
1695 | + | let baseAssetReserveAfter = $t07117871597._6 | |
1696 | + | let totalPositionSizeAfter = $t07117871597._7 | |
1697 | + | let openInterestNotionalAfter = $t07117871597._8 | |
1698 | + | let x2 = $t07117871597._9 | |
1699 | + | let totalLongAfter = $t07117871597._10 | |
1700 | + | let totalShortAfter = $t07117871597._11 | |
1701 | + | let totalLongOpenInterestAfter = $t07117871597._12 | |
1702 | + | let totalShortOpenInterestAfter = $t07117871597._13 | |
1703 | 1703 | if (if ((_minQuoteAssetAmount != 0)) | |
1704 | 1704 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
1705 | 1705 | else false) | |
1706 | 1706 | then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount))) | |
1707 | 1707 | else $Tuple15(0, 0, 0, 0, positionBadDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter) | |
1708 | 1708 | } | |
1709 | - | let newPositionSize = $ | |
1710 | - | let newPositionMargin = $ | |
1711 | - | let newPositionOpenNotional = $ | |
1712 | - | let newPositionLstUpdCPF = $ | |
1713 | - | let positionBadDebt = $ | |
1714 | - | let realizedPnl = $ | |
1715 | - | let marginToVault = $ | |
1716 | - | let quoteAssetReserveAfter = $ | |
1717 | - | let baseAssetReserveAfter = $ | |
1718 | - | let totalPositionSizeAfter = $ | |
1719 | - | let openInterestNotionalAfter = $ | |
1720 | - | let totalLongAfter = $ | |
1721 | - | let totalShortAfter = $ | |
1722 | - | let totalLongOpenInterestAfter = $ | |
1723 | - | let totalShortOpenInterestAfter = $ | |
1709 | + | let newPositionSize = $t06710772237._1 | |
1710 | + | let newPositionMargin = $t06710772237._2 | |
1711 | + | let newPositionOpenNotional = $t06710772237._3 | |
1712 | + | let newPositionLstUpdCPF = $t06710772237._4 | |
1713 | + | let positionBadDebt = $t06710772237._5 | |
1714 | + | let realizedPnl = $t06710772237._6 | |
1715 | + | let marginToVault = $t06710772237._7 | |
1716 | + | let quoteAssetReserveAfter = $t06710772237._8 | |
1717 | + | let baseAssetReserveAfter = $t06710772237._9 | |
1718 | + | let totalPositionSizeAfter = $t06710772237._10 | |
1719 | + | let openInterestNotionalAfter = $t06710772237._11 | |
1720 | + | let totalLongAfter = $t06710772237._12 | |
1721 | + | let totalShortAfter = $t06710772237._13 | |
1722 | + | let totalLongOpenInterestAfter = $t06710772237._14 | |
1723 | + | let totalShortOpenInterestAfter = $t06710772237._15 | |
1724 | 1724 | if ((positionBadDebt > 0)) | |
1725 | 1725 | then throw("Unable to close position with bad debt") | |
1726 | 1726 | else { | |
1727 | 1727 | let withdrawAmount = abs(marginToVault) | |
1728 | 1728 | let ammBalance = (cbalance() - withdrawAmount) | |
1729 | - | let $ | |
1729 | + | let $t07244672653 = if ((0 > ammBalance)) | |
1730 | 1730 | then $Tuple2(0, abs(ammBalance)) | |
1731 | 1731 | else $Tuple2(ammBalance, 0) | |
1732 | - | let ammNewBalance = $ | |
1733 | - | let x11 = $ | |
1734 | - | let $ | |
1735 | - | let borrowed = $ | |
1736 | - | let assetId = $ | |
1737 | - | let $ | |
1732 | + | let ammNewBalance = $t07244672653._1 | |
1733 | + | let x11 = $t07244672653._2 | |
1734 | + | let $t07266072714 = getBorrowedByTrader(_trader) | |
1735 | + | let borrowed = $t07266072714._1 | |
1736 | + | let assetId = $t07266072714._2 | |
1737 | + | let $t07272973588 = if ((borrowed > 0)) | |
1738 | 1738 | then if ((withdrawAmount >= borrowed)) | |
1739 | 1739 | then { | |
1740 | 1740 | let doRepay = invoke(collateralAddress(), "repay", [_trader, borrowed, assetId], nil) | |
1749 | 1749 | else throw("Strict value is not equal to itself.") | |
1750 | 1750 | } | |
1751 | 1751 | else $Tuple2(nil, withdrawAmount) | |
1752 | - | if (($ | |
1752 | + | if (($t07272973588 == $t07272973588)) | |
1753 | 1753 | then { | |
1754 | - | let quoteWithdrawAmount = $ | |
1755 | - | let sendCollateralAction = $ | |
1754 | + | let quoteWithdrawAmount = $t07272973588._2 | |
1755 | + | let sendCollateralAction = $t07272973588._1 | |
1756 | 1756 | let unstake = if ((quoteWithdrawAmount > 0)) | |
1757 | 1757 | then { | |
1758 | 1758 | let unstake = invoke(vaultAddress(), "withdrawLocked", [quoteWithdrawAmount], nil) | |
1811 | 1811 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1812 | 1812 | else false) | |
1813 | 1813 | then { | |
1814 | - | let $ | |
1815 | - | let oldPositionSize = $ | |
1816 | - | let oldPositionMargin = $ | |
1817 | - | let oldPositionOpenNotional = $ | |
1818 | - | let oldPositionLstUpdCPF = $ | |
1814 | + | let $t07590976059 = getPosition(_trader) | |
1815 | + | let oldPositionSize = $t07590976059._1 | |
1816 | + | let oldPositionMargin = $t07590976059._2 | |
1817 | + | let oldPositionOpenNotional = $t07590976059._3 | |
1818 | + | let oldPositionLstUpdCPF = $t07590976059._4 | |
1819 | 1819 | let _direction = if ((oldPositionSize > 0)) | |
1820 | 1820 | then DIR_SHORT | |
1821 | 1821 | else DIR_LONG | |
1822 | 1822 | let isAdd = (_direction == DIR_LONG) | |
1823 | 1823 | let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1824 | - | let $ | |
1825 | - | let oldPositionNotional = $ | |
1826 | - | let unrealizedPnl = $ | |
1827 | - | let $ | |
1828 | - | let exchangedPositionSize = $ | |
1829 | - | let quoteAssetReserveAfter = $ | |
1830 | - | let baseAssetReserveAfter = $ | |
1831 | - | let totalPositionSizeAfter = $ | |
1824 | + | let $t07628476388 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1825 | + | let oldPositionNotional = $t07628476388._1 | |
1826 | + | let unrealizedPnl = $t07628476388._2 | |
1827 | + | let $t07639676583 = swapInput(isAdd, exchangedQuoteAssetAmount) | |
1828 | + | let exchangedPositionSize = $t07639676583._1 | |
1829 | + | let quoteAssetReserveAfter = $t07639676583._2 | |
1830 | + | let baseAssetReserveAfter = $t07639676583._3 | |
1831 | + | let totalPositionSizeAfter = $t07639676583._4 | |
1832 | 1832 | let liquidationRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize)) | |
1833 | 1833 | let realizedPnl = muld(unrealizedPnl, liquidationRatio) | |
1834 | - | let $ | |
1835 | - | let remainMargin = $ | |
1836 | - | let badDebt = $ | |
1837 | - | let fundingPayment = $ | |
1834 | + | let $t07687277105 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1835 | + | let remainMargin = $t07687277105._1 | |
1836 | + | let badDebt = $t07687277105._2 | |
1837 | + | let fundingPayment = $t07687277105._3 | |
1838 | 1838 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1839 | 1839 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1840 | 1840 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1845 | 1845 | let newPositionMargin = (remainMargin - liquidationPenalty) | |
1846 | 1846 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1847 | 1847 | let newPositionOpenNotional = abs(remainOpenNotional) | |
1848 | + | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
1848 | 1849 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1849 | - | let openInterestNotionalAfter = (openInterestNotional() - | |
1850 | + | let openInterestNotionalAfter = (openInterestNotional() - openNotionalDelta) | |
1850 | 1851 | let ammBalance = (cbalance() - liquidationPenalty) | |
1851 | - | let $ | |
1852 | + | let $t07834678475 = if ((0 > ammBalance)) | |
1852 | 1853 | then $Tuple2(0, abs(ammBalance)) | |
1853 | 1854 | else $Tuple2(ammBalance, 0) | |
1854 | - | let newAmmBalance = $ | |
1855 | - | let x11 = $ | |
1856 | - | let $ | |
1857 | - | let borrowed = $ | |
1858 | - | let assetId = $ | |
1855 | + | let newAmmBalance = $t07834678475._1 | |
1856 | + | let x11 = $t07834678475._2 | |
1857 | + | let $t07848378537 = getBorrowedByTrader(_trader) | |
1858 | + | let borrowed = $t07848378537._1 | |
1859 | + | let assetId = $t07848378537._2 | |
1859 | 1860 | let doLiquidateCollateral = if ((borrowed > 0)) | |
1860 | 1861 | then { | |
1861 | 1862 | let collateralToSell = muld(borrowed, liquidationRatio) | |
1880 | 1881 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1881 | 1882 | then abs(exchangedPositionSize) | |
1882 | 1883 | else 0)), (openInterestLong() - (if ((newPositionSize > 0)) | |
1883 | - | then | |
1884 | + | then openNotionalDelta | |
1884 | 1885 | else 0)), (openInterestShort() - (if ((0 > newPositionSize)) | |
1885 | - | then | |
1886 | + | then openNotionalDelta | |
1886 | 1887 | else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1887 | 1888 | else throw("Strict value is not equal to itself.") | |
1888 | 1889 | } | |
1893 | 1894 | else throw("Strict value is not equal to itself.") | |
1894 | 1895 | } | |
1895 | 1896 | else { | |
1896 | - | let $ | |
1897 | - | let x1 = $ | |
1898 | - | let badDebt = $ | |
1899 | - | let x2 = $ | |
1900 | - | let x3 = $ | |
1901 | - | let quoteAssetReserveAfter = $ | |
1902 | - | let baseAssetReserveAfter = $ | |
1903 | - | let totalPositionSizeAfter = $ | |
1904 | - | let openInterestNotionalAfter = $ | |
1905 | - | let exchangedQuoteAssetAmount = $ | |
1906 | - | let totalLongAfter = $ | |
1907 | - | let totalShortAfter = $ | |
1908 | - | let totalLongOpenInterestAfter = $ | |
1909 | - | let totalShortOpenInterestAfter = $ | |
1897 | + | let $t08021680711 = internalClosePosition(_trader, false) | |
1898 | + | let x1 = $t08021680711._1 | |
1899 | + | let badDebt = $t08021680711._2 | |
1900 | + | let x2 = $t08021680711._3 | |
1901 | + | let x3 = $t08021680711._4 | |
1902 | + | let quoteAssetReserveAfter = $t08021680711._5 | |
1903 | + | let baseAssetReserveAfter = $t08021680711._6 | |
1904 | + | let totalPositionSizeAfter = $t08021680711._7 | |
1905 | + | let openInterestNotionalAfter = $t08021680711._8 | |
1906 | + | let exchangedQuoteAssetAmount = $t08021680711._9 | |
1907 | + | let totalLongAfter = $t08021680711._10 | |
1908 | + | let totalShortAfter = $t08021680711._11 | |
1909 | + | let totalLongOpenInterestAfter = $t08021680711._12 | |
1910 | + | let totalShortOpenInterestAfter = $t08021680711._13 | |
1910 | 1911 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1911 | 1912 | let feeToLiquidator = (liquidationPenalty / 2) | |
1912 | 1913 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1913 | 1914 | let ammBalance = (cbalance() - liquidationPenalty) | |
1914 | - | let $ | |
1915 | + | let $t08111981248 = if ((0 > ammBalance)) | |
1915 | 1916 | then $Tuple2(0, abs(ammBalance)) | |
1916 | 1917 | else $Tuple2(ammBalance, 0) | |
1917 | - | let newAmmBalance = $ | |
1918 | - | let x11 = $ | |
1919 | - | let $ | |
1920 | - | let borrowed = $ | |
1921 | - | let assetId = $ | |
1918 | + | let newAmmBalance = $t08111981248._1 | |
1919 | + | let x11 = $t08111981248._2 | |
1920 | + | let $t08125681310 = getBorrowedByTrader(_trader) | |
1921 | + | let borrowed = $t08125681310._1 | |
1922 | + | let assetId = $t08125681310._2 | |
1922 | 1923 | let doLiquidateCollateral = if ((borrowed > 0)) | |
1923 | 1924 | then { | |
1924 | 1925 | let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, 0, assetId], nil) | |
1978 | 1979 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
1979 | 1980 | else { | |
1980 | 1981 | let underlyingPrice = getOraclePrice() | |
1981 | - | let $ | |
1982 | - | let shortPremiumFraction = $ | |
1983 | - | let longPremiumFraction = $ | |
1982 | + | let $t08318283244 = getFunding() | |
1983 | + | let shortPremiumFraction = $t08318283244._1 | |
1984 | + | let longPremiumFraction = $t08318283244._2 | |
1984 | 1985 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1985 | 1986 | } | |
1986 | 1987 | } | |
1993 | 1994 | func syncTerminalPriceToOracle () = { | |
1994 | 1995 | let _qtAstR = qtAstR() | |
1995 | 1996 | let _bsAstR = bsAstR() | |
1996 | - | let $ | |
1997 | - | let newQuoteAssetWeight = $ | |
1998 | - | let newBaseAssetWeight = $ | |
1999 | - | let marginToVault = $ | |
1997 | + | let $t08367683811 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR) | |
1998 | + | let newQuoteAssetWeight = $t08367683811._1 | |
1999 | + | let newBaseAssetWeight = $t08367683811._2 | |
2000 | + | let marginToVault = $t08367683811._3 | |
2000 | 2001 | let doExchangePnL = if ((marginToVault != 0)) | |
2001 | 2002 | then { | |
2002 | 2003 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
2017 | 2018 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
2018 | 2019 | if ((sync == sync)) | |
2019 | 2020 | then { | |
2020 | - | let $ | |
2021 | - | let positionSize = $ | |
2022 | - | let positionMargin = $ | |
2023 | - | let pon = $ | |
2024 | - | let positionLstUpdCPF = $ | |
2025 | - | let $ | |
2026 | - | let positionNotional = $ | |
2027 | - | let unrealizedPnl = $ | |
2028 | - | let $ | |
2029 | - | let remainMargin = $ | |
2030 | - | let badDebt = $ | |
2031 | - | let fundingPayment = $ | |
2021 | + | let $t08438084481 = getPosition(_trader) | |
2022 | + | let positionSize = $t08438084481._1 | |
2023 | + | let positionMargin = $t08438084481._2 | |
2024 | + | let pon = $t08438084481._3 | |
2025 | + | let positionLstUpdCPF = $t08438084481._4 | |
2026 | + | let $t08448484585 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
2027 | + | let positionNotional = $t08448484585._1 | |
2028 | + | let unrealizedPnl = $t08448484585._2 | |
2029 | + | let $t08458884760 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
2030 | + | let remainMargin = $t08458884760._1 | |
2031 | + | let badDebt = $t08458884760._2 | |
2032 | + | let fundingPayment = $t08458884760._3 | |
2032 | 2033 | throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional))) | |
2033 | 2034 | } | |
2034 | 2035 | else throw("Strict value is not equal to itself.") | |
2048 | 2049 | ||
2049 | 2050 | @Callable(i) | |
2050 | 2051 | func view_getTerminalAmmPrice () = { | |
2051 | - | let $ | |
2052 | - | let terminalQuoteAssetReserve = $ | |
2053 | - | let terminalBaseAssetReserve = $ | |
2052 | + | let $t08517685257 = getTerminalAmmState() | |
2053 | + | let terminalQuoteAssetReserve = $t08517685257._1 | |
2054 | + | let terminalBaseAssetReserve = $t08517685257._2 | |
2054 | 2055 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
2055 | 2056 | throw(toString(price)) | |
2056 | 2057 | } | |
2060 | 2061 | @Callable(i) | |
2061 | 2062 | func view_getFunding () = { | |
2062 | 2063 | let underlyingPrice = getOraclePrice() | |
2063 | - | let $ | |
2064 | - | let shortPremiumFraction = $ | |
2065 | - | let longPremiumFraction = $ | |
2064 | + | let $t08547285534 = getFunding() | |
2065 | + | let shortPremiumFraction = $t08547285534._1 | |
2066 | + | let longPremiumFraction = $t08547285534._2 | |
2066 | 2067 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
2067 | 2068 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
2068 | 2069 | throw((((s(longFunding) + s(shortFunding)) + s(getTwapSpotPrice())) + s(getOraclePrice()))) | |
2072 | 2073 | ||
2073 | 2074 | @Callable(i) | |
2074 | 2075 | func view_getBorrowedByTrader (_trader) = { | |
2075 | - | let $ | |
2076 | - | let borrowed = $ | |
2077 | - | let assetId = $ | |
2076 | + | let $t08582085874 = getBorrowedByTrader(_trader) | |
2077 | + | let borrowed = $t08582085874._1 | |
2078 | + | let assetId = $t08582085874._2 | |
2078 | 2079 | throw((s(borrowed) + assetId)) | |
2079 | 2080 | } | |
2080 | 2081 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
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_block_key = "k_ora_block_key" | |
7 | 7 | ||
8 | 8 | let k_ora_open_key = "k_ora_open_key" | |
9 | 9 | ||
10 | 10 | let k_ora = "k_ora" | |
11 | 11 | ||
12 | 12 | let k_balance = "k_balance" | |
13 | 13 | ||
14 | 14 | let k_sequence = "k_sequence" | |
15 | 15 | ||
16 | 16 | let k_positionSize = "k_positionSize" | |
17 | 17 | ||
18 | 18 | let k_positionMargin = "k_positionMargin" | |
19 | 19 | ||
20 | 20 | let k_positionOpenNotional = "k_positionOpenNotional" | |
21 | 21 | ||
22 | 22 | let k_positionLastUpdatedCumulativePremiumFraction = "k_positionFraction" | |
23 | 23 | ||
24 | 24 | let k_positionSequence = "k_positionSequence" | |
25 | 25 | ||
26 | 26 | let k_positionAsset = "k_positionAsset" | |
27 | 27 | ||
28 | 28 | let k_initialized = "k_initialized" | |
29 | 29 | ||
30 | 30 | let k_paused = "k_paused" | |
31 | 31 | ||
32 | 32 | let k_closeOnly = "k_closeOnly" | |
33 | 33 | ||
34 | 34 | let k_fee = "k_fee" | |
35 | 35 | ||
36 | 36 | let k_fundingPeriod = "k_fundingPeriod" | |
37 | 37 | ||
38 | 38 | let k_initMarginRatio = "k_initMarginRatio" | |
39 | 39 | ||
40 | 40 | let k_maintenanceMarginRatio = "k_mmr" | |
41 | 41 | ||
42 | 42 | let k_liquidationFeeRatio = "k_liquidationFeeRatio" | |
43 | 43 | ||
44 | 44 | let k_partialLiquidationRatio = "k_partLiquidationRatio" | |
45 | 45 | ||
46 | 46 | let k_spreadLimit = "k_spreadLimit" | |
47 | 47 | ||
48 | 48 | let k_maxPriceImpact = "k_maxPriceImpact" | |
49 | 49 | ||
50 | 50 | let k_maxPriceSpread = "k_maxPriceSpread" | |
51 | 51 | ||
52 | 52 | let k_maxOpenNotional = "k_maxOpenNotional" | |
53 | 53 | ||
54 | 54 | let k_feeToStakersPercent = "k_feeToStakersPercent" | |
55 | 55 | ||
56 | 56 | let k_maxOracleDelay = "k_maxOracleDelay" | |
57 | 57 | ||
58 | 58 | let k_lastDataStr = "k_lastDataStr" | |
59 | 59 | ||
60 | 60 | let k_lastMinuteId = "k_lastMinuteId" | |
61 | 61 | ||
62 | 62 | let k_twapDataLastCumulativePrice = "k_twapDataLastCumulativePrice" | |
63 | 63 | ||
64 | 64 | let k_twapDataLastPrice = "k_twapDataLastPrice" | |
65 | 65 | ||
66 | 66 | let k_twapDataPreviousMinuteId = "k_twapDataPreviousMinuteId" | |
67 | 67 | ||
68 | 68 | let k_latestLongCumulativePremiumFraction = "k_latestLongPremiumFraction" | |
69 | 69 | ||
70 | 70 | let k_latestShortCumulativePremiumFraction = "k_latestShortPremiumFraction" | |
71 | 71 | ||
72 | 72 | let k_nextFundingBlock = "k_nextFundingBlockMinTimestamp" | |
73 | 73 | ||
74 | 74 | let k_longFundingRate = "k_longFundingRate" | |
75 | 75 | ||
76 | 76 | let k_shortFundingRate = "k_shortFundingRate" | |
77 | 77 | ||
78 | 78 | let k_quoteAssetReserve = "k_qtAstR" | |
79 | 79 | ||
80 | 80 | let k_baseAssetReserve = "k_bsAstR" | |
81 | 81 | ||
82 | 82 | let k_quoteAssetWeight = "k_qtAstW" | |
83 | 83 | ||
84 | 84 | let k_baseAssetWeight = "k_bsAstW" | |
85 | 85 | ||
86 | 86 | let k_totalPositionSize = "k_totalPositionSize" | |
87 | 87 | ||
88 | 88 | let k_totalLongPositionSize = "k_totalLongPositionSize" | |
89 | 89 | ||
90 | 90 | let k_totalShortPositionSize = "k_totalShortPositionSize" | |
91 | 91 | ||
92 | 92 | let k_openInterestNotional = "k_openInterestNotional" | |
93 | 93 | ||
94 | 94 | let k_openInterestShort = "k_openInterestShort" | |
95 | 95 | ||
96 | 96 | let k_openInterestLong = "k_openInterestLong" | |
97 | 97 | ||
98 | 98 | let k_coordinatorAddress = "k_coordinatorAddress" | |
99 | 99 | ||
100 | 100 | let k_vault_address = "k_vault_address" | |
101 | 101 | ||
102 | 102 | let k_admin_address = "k_admin_address" | |
103 | 103 | ||
104 | 104 | let k_admin_public_key = "k_admin_public_key" | |
105 | 105 | ||
106 | 106 | let k_quote_asset = "k_quote_asset" | |
107 | 107 | ||
108 | 108 | let k_quote_staking = "k_quote_staking" | |
109 | 109 | ||
110 | 110 | let k_staking_address = "k_staking_address" | |
111 | 111 | ||
112 | 112 | let k_miner_address = "k_miner_address" | |
113 | 113 | ||
114 | 114 | let k_orders_address = "k_orders_address" | |
115 | 115 | ||
116 | 116 | let k_referral_address = "k_referral_address" | |
117 | 117 | ||
118 | 118 | let k_collateral_address = "k_collateral_address" | |
119 | 119 | ||
120 | 120 | let k_exchange_address = "k_exchange_address" | |
121 | 121 | ||
122 | 122 | let k_nft_manager_address = "k_nft_manager_address" | |
123 | 123 | ||
124 | 124 | let k_trader_market_asset_collateral = "k_trader_market_asset_collateral" | |
125 | 125 | ||
126 | 126 | func toCompositeKey (_key,_address) = ((_key + "_") + _address) | |
127 | 127 | ||
128 | 128 | ||
129 | 129 | func coordinator () = valueOrErrorMessage(addressFromString(getStringValue(this, k_coordinatorAddress)), "Coordinator not set") | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | func adminAddress () = addressFromString(getStringValue(coordinator(), k_admin_address)) | |
133 | 133 | ||
134 | 134 | ||
135 | 135 | func adminPublicKey () = fromBase58String(getStringValue(coordinator(), k_admin_public_key)) | |
136 | 136 | ||
137 | 137 | ||
138 | 138 | func quoteAsset () = fromBase58String(getStringValue(coordinator(), k_quote_asset)) | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | func quoteAssetStaking () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_quote_staking)), "Quote asset staking not set") | |
142 | 142 | ||
143 | 143 | ||
144 | 144 | func stakingAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_staking_address)), "Staking not set") | |
145 | 145 | ||
146 | 146 | ||
147 | 147 | func vaultAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_vault_address)), "Vault not set") | |
148 | 148 | ||
149 | 149 | ||
150 | 150 | func minerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_miner_address)), "Miner not set") | |
151 | 151 | ||
152 | 152 | ||
153 | 153 | func ordersAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_orders_address)), "Orders not set") | |
154 | 154 | ||
155 | 155 | ||
156 | 156 | func referralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_referral_address)), "Referral not set") | |
157 | 157 | ||
158 | 158 | ||
159 | 159 | func nftManagerAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_nft_manager_address)), "NFT Manager not set") | |
160 | 160 | ||
161 | 161 | ||
162 | 162 | func collateralAddress () = valueOrErrorMessage(addressFromString(getStringValue(coordinator(), k_collateral_address)), "Collateral Manager not set") | |
163 | 163 | ||
164 | 164 | ||
165 | 165 | func swapAddress () = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(coordinator(), k_exchange_address), "No swap address")), "Invalid swap address") | |
166 | 166 | ||
167 | 167 | ||
168 | 168 | let k_whitelist_asset = "k_whitelist_asset" | |
169 | 169 | ||
170 | 170 | func isWhitelistAsset (_assetId) = valueOrElse(getBoolean(collateralAddress(), toCompositeKey(k_whitelist_asset, _assetId)), false) | |
171 | 171 | ||
172 | 172 | ||
173 | 173 | let k_token_param = "k_token_param" | |
174 | 174 | ||
175 | 175 | let k_token_type = "k_token_type" | |
176 | 176 | ||
177 | 177 | let FEE_REDUCTION_TOKEN_TYPE = "fee_reduction" | |
178 | 178 | ||
179 | 179 | let DIR_LONG = 1 | |
180 | 180 | ||
181 | 181 | let DIR_SHORT = 2 | |
182 | 182 | ||
183 | 183 | let TWAP_INTERVAL = 15 | |
184 | 184 | ||
185 | 185 | let ORACLE_INTERVAL = 15 | |
186 | 186 | ||
187 | 187 | let SECONDS = 1000 | |
188 | 188 | ||
189 | 189 | let DECIMAL_NUMBERS = 6 | |
190 | 190 | ||
191 | 191 | let DECIMAL_UNIT = (1 * (((((10 * 10) * 10) * 10) * 10) * 10)) | |
192 | 192 | ||
193 | 193 | let ONE_DAY = (86400 * DECIMAL_UNIT) | |
194 | 194 | ||
195 | 195 | let ALL_FEES = 100 | |
196 | 196 | ||
197 | 197 | let PNL_OPTION_SPOT = 1 | |
198 | 198 | ||
199 | 199 | let PNL_OPTION_ORACLE = 2 | |
200 | 200 | ||
201 | 201 | func s (_x) = (toString(_x) + ",") | |
202 | 202 | ||
203 | 203 | ||
204 | 204 | func divd (_x,_y) = fraction(_x, DECIMAL_UNIT, _y, HALFEVEN) | |
205 | 205 | ||
206 | 206 | ||
207 | 207 | func muld (_x,_y) = fraction(_x, _y, DECIMAL_UNIT, HALFEVEN) | |
208 | 208 | ||
209 | 209 | ||
210 | 210 | func sqrtd (_x) = sqrt(_x, DECIMAL_NUMBERS, DECIMAL_NUMBERS, HALFEVEN) | |
211 | 211 | ||
212 | 212 | ||
213 | 213 | func powd (_x,_y) = pow(_x, DECIMAL_NUMBERS, _y, DECIMAL_NUMBERS, DECIMAL_NUMBERS, HALFEVEN) | |
214 | 214 | ||
215 | 215 | ||
216 | 216 | func bdivd (_x,_y) = fraction(_x, toBigInt(DECIMAL_UNIT), _y, HALFEVEN) | |
217 | 217 | ||
218 | 218 | ||
219 | 219 | func bmuld (_x,_y) = fraction(_x, _y, toBigInt(DECIMAL_UNIT), HALFEVEN) | |
220 | 220 | ||
221 | 221 | ||
222 | 222 | func bsqrtd (_x) = sqrtBigInt(_x, DECIMAL_NUMBERS, DECIMAL_NUMBERS, HALFEVEN) | |
223 | 223 | ||
224 | 224 | ||
225 | 225 | func bpowd (_x,_y) = pow(_x, DECIMAL_NUMBERS, _y, DECIMAL_NUMBERS, DECIMAL_NUMBERS, HALFEVEN) | |
226 | 226 | ||
227 | 227 | ||
228 | 228 | func abs (_x) = if ((_x > 0)) | |
229 | 229 | then _x | |
230 | 230 | else -(_x) | |
231 | 231 | ||
232 | 232 | ||
233 | 233 | func vmax (_x,_y) = if ((_x >= _y)) | |
234 | 234 | then _x | |
235 | 235 | else _y | |
236 | 236 | ||
237 | 237 | ||
238 | 238 | func listToStr (_list) = { | |
239 | 239 | func _join (accumulator,val) = ((accumulator + val) + ",") | |
240 | 240 | ||
241 | 241 | let newListStr = { | |
242 | 242 | let $l = _list | |
243 | 243 | let $s = size($l) | |
244 | 244 | let $acc0 = "" | |
245 | 245 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
246 | 246 | then $a | |
247 | 247 | else _join($a, $l[$i]) | |
248 | 248 | ||
249 | 249 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
250 | 250 | then $a | |
251 | 251 | else throw("List size exceeds 20") | |
252 | 252 | ||
253 | 253 | $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) | |
254 | 254 | } | |
255 | 255 | let newListStrU = dropRight(newListStr, 1) | |
256 | 256 | let newListStrR = if ((take(newListStrU, 1) == ",")) | |
257 | 257 | then drop(newListStrU, 1) | |
258 | 258 | else newListStrU | |
259 | 259 | newListStrR | |
260 | 260 | } | |
261 | 261 | ||
262 | 262 | ||
263 | 263 | func strToList (_str) = split(_str, ",") | |
264 | 264 | ||
265 | 265 | ||
266 | 266 | func pushToQueue (_list,_maxSize,_value) = if ((size(_list) > _maxSize)) | |
267 | 267 | then (removeByIndex(_list, 0) :+ _value) | |
268 | 268 | else (_list :+ _value) | |
269 | 269 | ||
270 | 270 | ||
271 | 271 | func int (k) = valueOrErrorMessage(getInteger(this, k), ("no value for " + k)) | |
272 | 272 | ||
273 | 273 | ||
274 | 274 | func intOr (k,def) = valueOrElse(getInteger(this, k), def) | |
275 | 275 | ||
276 | 276 | ||
277 | 277 | func strA (_address,_key) = { | |
278 | 278 | let val = valueOrErrorMessage(getString(_address, _key), ("No value for key " + _key)) | |
279 | 279 | val | |
280 | 280 | } | |
281 | 281 | ||
282 | 282 | ||
283 | 283 | func intA (_address,_key) = { | |
284 | 284 | let val = valueOrErrorMessage(getInteger(_address, _key), ("No value for key " + _key)) | |
285 | 285 | val | |
286 | 286 | } | |
287 | 287 | ||
288 | 288 | ||
289 | 289 | func cbalance () = int(k_balance) | |
290 | 290 | ||
291 | 291 | ||
292 | 292 | func fee () = int(k_fee) | |
293 | 293 | ||
294 | 294 | ||
295 | 295 | func initMarginRatio () = int(k_initMarginRatio) | |
296 | 296 | ||
297 | 297 | ||
298 | 298 | func qtAstR () = int(k_quoteAssetReserve) | |
299 | 299 | ||
300 | 300 | ||
301 | 301 | func bsAstR () = int(k_baseAssetReserve) | |
302 | 302 | ||
303 | 303 | ||
304 | 304 | func qtAstW () = intOr(k_quoteAssetWeight, DECIMAL_UNIT) | |
305 | 305 | ||
306 | 306 | ||
307 | 307 | func bsAstW () = intOr(k_baseAssetWeight, DECIMAL_UNIT) | |
308 | 308 | ||
309 | 309 | ||
310 | 310 | func totalPositionSize () = int(k_totalPositionSize) | |
311 | 311 | ||
312 | 312 | ||
313 | 313 | func openInterestNotional () = int(k_openInterestNotional) | |
314 | 314 | ||
315 | 315 | ||
316 | 316 | func openInterestShort () = int(k_openInterestShort) | |
317 | 317 | ||
318 | 318 | ||
319 | 319 | func openInterestLong () = int(k_openInterestLong) | |
320 | 320 | ||
321 | 321 | ||
322 | 322 | func nextFundingBlockTimestamp () = int(k_nextFundingBlock) | |
323 | 323 | ||
324 | 324 | ||
325 | 325 | func fundingPeriodRaw () = int(k_fundingPeriod) | |
326 | 326 | ||
327 | 327 | ||
328 | 328 | func fundingPeriodDecimal () = (fundingPeriodRaw() * DECIMAL_UNIT) | |
329 | 329 | ||
330 | 330 | ||
331 | 331 | func fundingPeriodSeconds () = (fundingPeriodRaw() * SECONDS) | |
332 | 332 | ||
333 | 333 | ||
334 | 334 | func maintenanceMarginRatio () = int(k_maintenanceMarginRatio) | |
335 | 335 | ||
336 | 336 | ||
337 | 337 | func liquidationFeeRatio () = int(k_liquidationFeeRatio) | |
338 | 338 | ||
339 | 339 | ||
340 | 340 | func partialLiquidationRatio () = int(k_partialLiquidationRatio) | |
341 | 341 | ||
342 | 342 | ||
343 | 343 | func spreadLimit () = int(k_spreadLimit) | |
344 | 344 | ||
345 | 345 | ||
346 | 346 | func maxPriceImpact () = int(k_maxPriceImpact) | |
347 | 347 | ||
348 | 348 | ||
349 | 349 | func maxPriceSpread () = int(k_maxPriceSpread) | |
350 | 350 | ||
351 | 351 | ||
352 | 352 | func maxOpenNotional () = int(k_maxOpenNotional) | |
353 | 353 | ||
354 | 354 | ||
355 | 355 | func latestLongCumulativePremiumFraction () = int(k_latestLongCumulativePremiumFraction) | |
356 | 356 | ||
357 | 357 | ||
358 | 358 | func latestShortCumulativePremiumFraction () = int(k_latestShortCumulativePremiumFraction) | |
359 | 359 | ||
360 | 360 | ||
361 | 361 | func totalShortPositionSize () = int(k_totalShortPositionSize) | |
362 | 362 | ||
363 | 363 | ||
364 | 364 | func totalLongPositionSize () = int(k_totalLongPositionSize) | |
365 | 365 | ||
366 | 366 | ||
367 | 367 | func lastSequence () = intOr(k_sequence, 0) | |
368 | 368 | ||
369 | 369 | ||
370 | 370 | func feeToStakersPercent () = int(k_feeToStakersPercent) | |
371 | 371 | ||
372 | 372 | ||
373 | 373 | func maxOracleDelay () = int(k_maxOracleDelay) | |
374 | 374 | ||
375 | 375 | ||
376 | 376 | func getActualCaller (i) = valueOrElse(getString(ordersAddress(), "k_sender"), toString(i.caller)) | |
377 | 377 | ||
378 | 378 | ||
379 | 379 | func requireMoreMarginRatio (_marginRatio,_baseMarginRatio,_largerThanOrEqualTo) = { | |
380 | 380 | let remainingMarginRatio = (_marginRatio - _baseMarginRatio) | |
381 | 381 | if (if (_largerThanOrEqualTo) | |
382 | 382 | then (0 > remainingMarginRatio) | |
383 | 383 | else false) | |
384 | 384 | then throw("Invalid margin") | |
385 | 385 | else if (if (!(_largerThanOrEqualTo)) | |
386 | 386 | then (remainingMarginRatio >= 0) | |
387 | 387 | else false) | |
388 | 388 | then throw("Invalid margin") | |
389 | 389 | else true | |
390 | 390 | } | |
391 | 391 | ||
392 | 392 | ||
393 | 393 | func latestCumulativePremiumFraction (_positionSize) = if ((_positionSize == 0)) | |
394 | 394 | then throw("Should not be called with _positionSize == 0") | |
395 | 395 | else if ((_positionSize > 0)) | |
396 | 396 | then latestLongCumulativePremiumFraction() | |
397 | 397 | else latestShortCumulativePremiumFraction() | |
398 | 398 | ||
399 | 399 | ||
400 | 400 | func getPosition (_trader) = { | |
401 | 401 | let positionSizeOpt = getInteger(this, toCompositeKey(k_positionSize, _trader)) | |
402 | 402 | match positionSizeOpt { | |
403 | 403 | case positionSize: Int => | |
404 | 404 | $Tuple4(positionSize, getIntegerValue(this, toCompositeKey(k_positionMargin, _trader)), getIntegerValue(this, toCompositeKey(k_positionOpenNotional, _trader)), getIntegerValue(this, toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _trader))) | |
405 | 405 | case _ => | |
406 | 406 | $Tuple4(0, 0, 0, 0) | |
407 | 407 | } | |
408 | 408 | } | |
409 | 409 | ||
410 | 410 | ||
411 | 411 | func getPositionAsset (_trader) = { | |
412 | 412 | let positionAssetOpt = getString(this, toCompositeKey(k_positionAsset, _trader)) | |
413 | 413 | match positionAssetOpt { | |
414 | 414 | case positionAsset: String => | |
415 | 415 | positionAsset | |
416 | 416 | case _ => | |
417 | 417 | toBase58String(quoteAsset()) | |
418 | 418 | } | |
419 | 419 | } | |
420 | 420 | ||
421 | 421 | ||
422 | 422 | func requireOpenPosition (_trader) = if ((getPosition(_trader)._1 == 0)) | |
423 | 423 | then throw("No open position") | |
424 | 424 | else true | |
425 | 425 | ||
426 | 426 | ||
427 | 427 | func initialized () = valueOrElse(getBoolean(this, k_initialized), false) | |
428 | 428 | ||
429 | 429 | ||
430 | 430 | func paused () = valueOrElse(getBoolean(this, k_paused), false) | |
431 | 431 | ||
432 | 432 | ||
433 | 433 | func closeOnly () = valueOrElse(getBoolean(this, k_closeOnly), false) | |
434 | 434 | ||
435 | 435 | ||
436 | 436 | func updateReserve (_isAdd,_quoteAssetAmount,_baseAssetAmount) = if (_isAdd) | |
437 | 437 | then { | |
438 | 438 | let newBase = (bsAstR() - _baseAssetAmount) | |
439 | 439 | if ((0 >= newBase)) | |
440 | 440 | then throw("Tx lead to base asset reserve <= 0, revert") | |
441 | 441 | else $Tuple3((qtAstR() + _quoteAssetAmount), newBase, (totalPositionSize() + _baseAssetAmount)) | |
442 | 442 | } | |
443 | 443 | else { | |
444 | 444 | let newQuote = (qtAstR() - _quoteAssetAmount) | |
445 | 445 | if ((0 >= newQuote)) | |
446 | 446 | then throw("Tx lead to base quote reserve <= 0, revert") | |
447 | 447 | else $Tuple3(newQuote, (bsAstR() + _baseAssetAmount), (totalPositionSize() - _baseAssetAmount)) | |
448 | 448 | } | |
449 | 449 | ||
450 | 450 | ||
451 | 451 | func calcInvariant (_qtAstR,_qtAstW,_bsAstR,_bsAstW) = { | |
452 | 452 | let bqtAstR = toBigInt(_qtAstR) | |
453 | 453 | let bqtAstW = toBigInt(_qtAstW) | |
454 | 454 | let bbsAstR = toBigInt(_bsAstR) | |
455 | 455 | let bbsAstW = toBigInt(_bsAstW) | |
456 | 456 | bmuld(bmuld(bqtAstR, bqtAstW), bmuld(bbsAstR, bbsAstW)) | |
457 | 457 | } | |
458 | 458 | ||
459 | 459 | ||
460 | 460 | func swapInput (_isAdd,_quoteAssetAmount) = { | |
461 | 461 | let _qtAstR = qtAstR() | |
462 | 462 | let _bsAstR = bsAstR() | |
463 | 463 | let _qtAstW = qtAstW() | |
464 | 464 | let _bsAstW = bsAstW() | |
465 | 465 | let k = calcInvariant(_qtAstR, _qtAstW, _bsAstR, _bsAstW) | |
466 | 466 | let quoteAssetReserveAfter = if (_isAdd) | |
467 | 467 | then (_qtAstR + _quoteAssetAmount) | |
468 | 468 | else (_qtAstR - _quoteAssetAmount) | |
469 | 469 | let baseAssetReserveAfter = toInt(bdivd(k, toBigInt(muld(quoteAssetReserveAfter, _qtAstW)))) | |
470 | 470 | let amountBaseAssetBoughtAbs = divd(abs((baseAssetReserveAfter - _bsAstR)), _qtAstW) | |
471 | 471 | let amountBaseAssetBought = if (_isAdd) | |
472 | 472 | then amountBaseAssetBoughtAbs | |
473 | 473 | else -(amountBaseAssetBoughtAbs) | |
474 | 474 | let $t01680516968 = updateReserve(_isAdd, _quoteAssetAmount, amountBaseAssetBoughtAbs) | |
475 | 475 | let quoteAssetReserveAfter1 = $t01680516968._1 | |
476 | 476 | let baseAssetReserveAfter1 = $t01680516968._2 | |
477 | 477 | let totalPositionSizeAfter1 = $t01680516968._3 | |
478 | 478 | let priceBefore = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
479 | 479 | let marketPrice = divd(_quoteAssetAmount, amountBaseAssetBoughtAbs) | |
480 | 480 | let priceDiff = abs((priceBefore - marketPrice)) | |
481 | 481 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
482 | 482 | let maxPriceImpactValue = maxPriceImpact() | |
483 | 483 | if ((priceImpact > maxPriceImpactValue)) | |
484 | 484 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_qtAstR)) + " before base asset: ") + toString(_bsAstR)) + " quote asset amount to exchange: ") + toString(_quoteAssetAmount)) + " price before: ") + toString(priceBefore)) + " marketPrice: ") + toString(marketPrice))) | |
485 | 485 | else $Tuple4(amountBaseAssetBought, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1) | |
486 | 486 | } | |
487 | 487 | ||
488 | 488 | ||
489 | 489 | func calcRemainMarginWithFundingPayment (_oldPositionSize,_oldPositionMargin,_oldPositionCumulativePremiumFraction,_marginDelta) = { | |
490 | 490 | let fundingPayment = if ((_oldPositionSize != 0)) | |
491 | 491 | then { | |
492 | 492 | let _latestCumulativePremiumFraction = latestCumulativePremiumFraction(_oldPositionSize) | |
493 | 493 | muld((_latestCumulativePremiumFraction - _oldPositionCumulativePremiumFraction), _oldPositionSize) | |
494 | 494 | } | |
495 | 495 | else 0 | |
496 | 496 | let signedMargin = ((_marginDelta - fundingPayment) + _oldPositionMargin) | |
497 | 497 | let $t01845518582 = if ((0 > signedMargin)) | |
498 | 498 | then $Tuple2(0, abs(signedMargin)) | |
499 | 499 | else $Tuple2(abs(signedMargin), 0) | |
500 | 500 | let remainMargin = $t01845518582._1 | |
501 | 501 | let badDebt = $t01845518582._2 | |
502 | 502 | $Tuple3(remainMargin, badDebt, fundingPayment) | |
503 | 503 | } | |
504 | 504 | ||
505 | 505 | ||
506 | 506 | func swapOutputWithReserves (_isAdd,_baseAssetAmount,_checkMaxPriceImpact,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
507 | 507 | let priceBefore = divd(muld(_quoteAssetReserve, _quoteAssetWeight), muld(_baseAssetReserve, _baseAssetWeight)) | |
508 | 508 | if ((_baseAssetAmount == 0)) | |
509 | 509 | then throw("Invalid base asset amount") | |
510 | 510 | else { | |
511 | 511 | let k = calcInvariant(_quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight) | |
512 | 512 | let baseAssetPoolAmountAfter = if (_isAdd) | |
513 | 513 | then (_baseAssetReserve + _baseAssetAmount) | |
514 | 514 | else (_baseAssetReserve - _baseAssetAmount) | |
515 | 515 | let quoteAssetAfter = toInt(bdivd(k, toBigInt(muld(baseAssetPoolAmountAfter, _baseAssetWeight)))) | |
516 | 516 | let quoteAssetSold = abs((quoteAssetAfter - muld(_quoteAssetReserve, _quoteAssetWeight))) | |
517 | 517 | let maxPriceImpactValue = maxPriceImpact() | |
518 | 518 | let $t01977019931 = updateReserve(!(_isAdd), quoteAssetSold, _baseAssetAmount) | |
519 | 519 | let quoteAssetReserveAfter1 = $t01977019931._1 | |
520 | 520 | let baseAssetReserveAfter1 = $t01977019931._2 | |
521 | 521 | let totalPositionSizeAfter1 = $t01977019931._3 | |
522 | 522 | let marketPrice = divd(quoteAssetSold, _baseAssetAmount) | |
523 | 523 | let priceDiff = abs((priceBefore - marketPrice)) | |
524 | 524 | let priceImpact = (DECIMAL_UNIT - divd(priceBefore, (priceBefore + priceDiff))) | |
525 | 525 | if (if ((priceImpact > maxPriceImpactValue)) | |
526 | 526 | then _checkMaxPriceImpact | |
527 | 527 | else false) | |
528 | 528 | then throw(((((((((((((("Price impact " + toString(priceImpact)) + " > max price impact ") + toString(maxPriceImpactValue)) + " before quote asset: ") + toString(_quoteAssetReserve)) + " before base asset: ") + toString(_baseAssetReserve)) + " base asset amount to exchange: ") + toString(_baseAssetAmount)) + " price before: ") + toString(priceBefore)) + " market price: ") + toString(marketPrice))) | |
529 | 529 | else $Tuple7(quoteAssetSold, quoteAssetReserveAfter1, baseAssetReserveAfter1, totalPositionSizeAfter1, (totalLongPositionSize() - (if (_isAdd) | |
530 | 530 | then abs(_baseAssetAmount) | |
531 | 531 | else 0)), (totalShortPositionSize() - (if (!(_isAdd)) | |
532 | 532 | then abs(_baseAssetAmount) | |
533 | 533 | else 0)), priceImpact) | |
534 | 534 | } | |
535 | 535 | } | |
536 | 536 | ||
537 | 537 | ||
538 | 538 | func swapOutput (_isAdd,_baseAssetAmount,_checkMaxPriceImpact) = swapOutputWithReserves(_isAdd, _baseAssetAmount, _checkMaxPriceImpact, qtAstR(), qtAstW(), bsAstR(), bsAstW()) | |
539 | 539 | ||
540 | 540 | ||
541 | 541 | func getOraclePrice () = { | |
542 | 542 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
543 | 543 | let priceKey = getStringValue(this, k_ora_key) | |
544 | 544 | let lastValue = valueOrErrorMessage(getInteger(oracle, priceKey), ((("Can not get oracle price. Oracle: " + toString(oracle)) + " key: ") + priceKey)) | |
545 | 545 | let blockKey = valueOrElse(getString(this, k_ora_block_key), "") | |
546 | 546 | if ((blockKey != "")) | |
547 | 547 | then { | |
548 | 548 | let currentBlock = lastBlock.height | |
549 | 549 | let lastOracleBlock = valueOrErrorMessage(getInteger(oracle, blockKey), ((("Can not get oracle block. Oracle: " + toString(oracle)) + " key: ") + blockKey)) | |
550 | 550 | if (((currentBlock - lastOracleBlock) > maxOracleDelay())) | |
551 | 551 | then throw(((("Oracle stale data. Last oracle block: " + toString(lastOracleBlock)) + " current block: ") + toString(currentBlock))) | |
552 | 552 | else lastValue | |
553 | 553 | } | |
554 | 554 | else lastValue | |
555 | 555 | } | |
556 | 556 | ||
557 | 557 | ||
558 | 558 | func isMarketClosed () = { | |
559 | 559 | let oracle = valueOrErrorMessage(addressFromString(getStringValue(this, k_ora)), "") | |
560 | 560 | let openKey = valueOrElse(getString(this, k_ora_open_key), "") | |
561 | 561 | if ((openKey != "")) | |
562 | 562 | then { | |
563 | 563 | let isOpen = valueOrErrorMessage(getBoolean(oracle, openKey), ((("Can not get oracle is open/closed. Oracle: " + toString(oracle)) + " key: ") + openKey)) | |
564 | 564 | !(isOpen) | |
565 | 565 | } | |
566 | 566 | else false | |
567 | 567 | } | |
568 | 568 | ||
569 | 569 | ||
570 | 570 | func absPriceDiff (_oraclePrice,_quoteAssetReserve,_baseAssetReserve,_qtAstW,_bsAstW) = { | |
571 | 571 | let priceAfter = divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
572 | 572 | let averagePrice = divd((_oraclePrice + priceAfter), (2 * DECIMAL_UNIT)) | |
573 | 573 | let absPriceDiff = divd(abs((_oraclePrice - priceAfter)), averagePrice) | |
574 | 574 | absPriceDiff | |
575 | 575 | } | |
576 | 576 | ||
577 | 577 | ||
578 | 578 | func requireNotOverSpreadLimit (_quoteAssetReserve,_baseAssetReserve) = { | |
579 | 579 | let oraclePrice = getOraclePrice() | |
580 | 580 | let _qtAstW = qtAstW() | |
581 | 581 | let _bsAstW = bsAstW() | |
582 | 582 | let absPriceDiffBefore = absPriceDiff(oraclePrice, qtAstR(), bsAstR(), _qtAstW, _bsAstW) | |
583 | 583 | let absPriceDiffAfter = absPriceDiff(oraclePrice, _quoteAssetReserve, _baseAssetReserve, _qtAstW, _bsAstW) | |
584 | 584 | if (if ((absPriceDiffAfter > maxPriceSpread())) | |
585 | 585 | then (absPriceDiffAfter > absPriceDiffBefore) | |
586 | 586 | else false) | |
587 | 587 | then throw(((("Price spread " + toString(absPriceDiffAfter)) + " > max price spread ") + toString(maxPriceSpread()))) | |
588 | 588 | else true | |
589 | 589 | } | |
590 | 590 | ||
591 | 591 | ||
592 | 592 | func requireNotOverMaxOpenNotional (_longOpenNotional,_shortOpenNotional) = { | |
593 | 593 | let _maxOpenNotional = maxOpenNotional() | |
594 | 594 | if ((_longOpenNotional > _maxOpenNotional)) | |
595 | 595 | then throw(((("Long open notional " + toString(_longOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
596 | 596 | else if ((_shortOpenNotional > _maxOpenNotional)) | |
597 | 597 | then throw(((("Short open notional " + toString(_shortOpenNotional)) + " > max open notional ") + toString(_maxOpenNotional))) | |
598 | 598 | else true | |
599 | 599 | } | |
600 | 600 | ||
601 | 601 | ||
602 | 602 | func getSpotPrice () = { | |
603 | 603 | let _quoteAssetReserve = qtAstR() | |
604 | 604 | let _baseAssetReserve = bsAstR() | |
605 | 605 | let _qtAstW = qtAstW() | |
606 | 606 | let _bsAstW = bsAstW() | |
607 | 607 | divd(muld(_quoteAssetReserve, _qtAstW), muld(_baseAssetReserve, _bsAstW)) | |
608 | 608 | } | |
609 | 609 | ||
610 | 610 | ||
611 | 611 | func isOverFluctuationLimit () = { | |
612 | 612 | let oraclePrice = getOraclePrice() | |
613 | 613 | let currentPrice = getSpotPrice() | |
614 | 614 | (divd(abs((oraclePrice - currentPrice)), oraclePrice) > spreadLimit()) | |
615 | 615 | } | |
616 | 616 | ||
617 | 617 | ||
618 | 618 | func getPositionAdjustedOpenNotional (_positionSize,_option,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight) = { | |
619 | 619 | let positionSizeAbs = abs(_positionSize) | |
620 | 620 | let isShort = (0 > _positionSize) | |
621 | 621 | let positionNotional = if ((_option == PNL_OPTION_SPOT)) | |
622 | 622 | then { | |
623 | 623 | let $t02488225102 = swapOutputWithReserves(!(isShort), positionSizeAbs, false, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight) | |
624 | 624 | let outPositionNotional = $t02488225102._1 | |
625 | 625 | let x1 = $t02488225102._2 | |
626 | 626 | let x2 = $t02488225102._3 | |
627 | 627 | let x3 = $t02488225102._4 | |
628 | 628 | outPositionNotional | |
629 | 629 | } | |
630 | 630 | else muld(positionSizeAbs, getOraclePrice()) | |
631 | 631 | positionNotional | |
632 | 632 | } | |
633 | 633 | ||
634 | 634 | ||
635 | 635 | func getPositionNotionalAndUnrealizedPnlByValues (_positionSize,_positionOpenNotional,_quoteAssetReserve,_quoteAssetWeight,_baseAssetReserve,_baseAssetWeight,_option) = if ((_positionSize == 0)) | |
636 | 636 | then throw("Invalid position size") | |
637 | 637 | else { | |
638 | 638 | let isShort = (0 > _positionSize) | |
639 | 639 | let positionNotional = getPositionAdjustedOpenNotional(_positionSize, _option, _quoteAssetReserve, _quoteAssetWeight, _baseAssetReserve, _baseAssetWeight) | |
640 | 640 | let unrealizedPnl = if (isShort) | |
641 | 641 | then (_positionOpenNotional - positionNotional) | |
642 | 642 | else (positionNotional - _positionOpenNotional) | |
643 | 643 | $Tuple2(positionNotional, unrealizedPnl) | |
644 | 644 | } | |
645 | 645 | ||
646 | 646 | ||
647 | 647 | func getPositionNotionalAndUnrealizedPnl (_trader,_option) = { | |
648 | 648 | let $t02652326651 = getPosition(_trader) | |
649 | 649 | let positionSize = $t02652326651._1 | |
650 | 650 | let positionMargin = $t02652326651._2 | |
651 | 651 | let positionOpenNotional = $t02652326651._3 | |
652 | 652 | let positionLstUpdCPF = $t02652326651._4 | |
653 | 653 | getPositionNotionalAndUnrealizedPnlByValues(positionSize, positionOpenNotional, qtAstR(), qtAstW(), bsAstR(), bsAstW(), _option) | |
654 | 654 | } | |
655 | 655 | ||
656 | 656 | ||
657 | 657 | func calcMarginRatio (_remainMargin,_badDebt,_positionNotional) = divd((_remainMargin - _badDebt), _positionNotional) | |
658 | 658 | ||
659 | 659 | ||
660 | 660 | func getMarginRatioByOption (_trader,_option) = { | |
661 | 661 | let $t02716427275 = getPosition(_trader) | |
662 | 662 | let positionSize = $t02716427275._1 | |
663 | 663 | let positionMargin = $t02716427275._2 | |
664 | 664 | let pon = $t02716427275._3 | |
665 | 665 | let positionLstUpdCPF = $t02716427275._4 | |
666 | 666 | let $t02728127374 = getPositionNotionalAndUnrealizedPnl(_trader, _option) | |
667 | 667 | let positionNotional = $t02728127374._1 | |
668 | 668 | let unrealizedPnl = $t02728127374._2 | |
669 | 669 | let $t02737927545 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
670 | 670 | let remainMargin = $t02737927545._1 | |
671 | 671 | let badDebt = $t02737927545._2 | |
672 | 672 | calcMarginRatio(remainMargin, badDebt, positionNotional) | |
673 | 673 | } | |
674 | 674 | ||
675 | 675 | ||
676 | 676 | func getMarginRatio (_trader) = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
677 | 677 | ||
678 | 678 | ||
679 | 679 | func getPartialLiquidationAmount (_trader,_positionSize) = { | |
680 | 680 | let maximumRatio = vmax(partialLiquidationRatio(), (DECIMAL_UNIT - divd(getMarginRatio(_trader), maintenanceMarginRatio()))) | |
681 | 681 | let maxExchangedPositionSize = muld(abs(_positionSize), maximumRatio) | |
682 | 682 | let swapResult = swapOutput((_positionSize > 0), maxExchangedPositionSize, false) | |
683 | 683 | let maxExchangedQuoteAssetAmount = swapResult._1 | |
684 | 684 | let priceImpact = swapResult._7 | |
685 | 685 | if ((maxPriceImpact() > priceImpact)) | |
686 | 686 | then maxExchangedQuoteAssetAmount | |
687 | 687 | else { | |
688 | 688 | let exchangedPositionSize = muld(abs(_positionSize), partialLiquidationRatio()) | |
689 | 689 | let exchangedQuoteAssetAmount = swapOutput((_positionSize > 0), exchangedPositionSize, false)._1 | |
690 | 690 | exchangedQuoteAssetAmount | |
691 | 691 | } | |
692 | 692 | } | |
693 | 693 | ||
694 | 694 | ||
695 | 695 | func internalClosePosition (_trader,_checkMaxPriceImpact) = { | |
696 | 696 | let $t02878528913 = getPosition(_trader) | |
697 | 697 | let positionSize = $t02878528913._1 | |
698 | 698 | let positionMargin = $t02878528913._2 | |
699 | 699 | let positionOpenNotional = $t02878528913._3 | |
700 | 700 | let positionLstUpdCPF = $t02878528913._4 | |
701 | 701 | let unrealizedPnl = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT)._2 | |
702 | 702 | let $t02900829176 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
703 | 703 | let remainMargin = $t02900829176._1 | |
704 | 704 | let badDebt = $t02900829176._2 | |
705 | 705 | let exchangedPositionSize = -(positionSize) | |
706 | 706 | let realizedPnl = unrealizedPnl | |
707 | 707 | let marginToVault = -(remainMargin) | |
708 | 708 | let $t02930329577 = swapOutput((positionSize > 0), abs(positionSize), _checkMaxPriceImpact) | |
709 | 709 | let exchangedQuoteAssetAmount = $t02930329577._1 | |
710 | 710 | let quoteAssetReserveAfter = $t02930329577._2 | |
711 | 711 | let baseAssetReserveAfter = $t02930329577._3 | |
712 | 712 | let totalPositionSizeAfter = $t02930329577._4 | |
713 | 713 | let totalLongAfter = $t02930329577._5 | |
714 | 714 | let totalShortAfter = $t02930329577._6 | |
715 | 715 | let openInterestNotionalAfter = (openInterestNotional() - positionOpenNotional) | |
716 | 716 | $Tuple13(exchangedPositionSize, badDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, exchangedQuoteAssetAmount, totalLongAfter, totalShortAfter, (openInterestLong() - (if ((positionSize > 0)) | |
717 | 717 | then positionOpenNotional | |
718 | 718 | else 0)), (openInterestShort() - (if ((0 > positionSize)) | |
719 | 719 | then positionOpenNotional | |
720 | 720 | else 0))) | |
721 | 721 | } | |
722 | 722 | ||
723 | 723 | ||
724 | 724 | func getTwapSpotPrice () = { | |
725 | 725 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
726 | 726 | let startMinuteId = (minuteId - TWAP_INTERVAL) | |
727 | 727 | let listStr = valueOrElse(getString(this, k_lastDataStr), "") | |
728 | 728 | let list = split(listStr, ",") | |
729 | 729 | func filterFn (accumulator,next) = if ((startMinuteId >= parseIntValue(next))) | |
730 | 730 | then (accumulator :+ parseIntValue(next)) | |
731 | 731 | else accumulator | |
732 | 732 | ||
733 | 733 | let listF = { | |
734 | 734 | let $l = list | |
735 | 735 | let $s = size($l) | |
736 | 736 | let $acc0 = nil | |
737 | 737 | func $f0_1 ($a,$i) = if (($i >= $s)) | |
738 | 738 | then $a | |
739 | 739 | else filterFn($a, $l[$i]) | |
740 | 740 | ||
741 | 741 | func $f0_2 ($a,$i) = if (($i >= $s)) | |
742 | 742 | then $a | |
743 | 743 | else throw("List size exceeds 20") | |
744 | 744 | ||
745 | 745 | $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) | |
746 | 746 | } | |
747 | 747 | let maxIndex = if ((size(listF) > 0)) | |
748 | 748 | then max(listF) | |
749 | 749 | else parseIntValue(list[0]) | |
750 | 750 | let lastMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
751 | 751 | let endLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(lastMinuteId))), 0) | |
752 | 752 | let endLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(lastMinuteId))), 0) | |
753 | 753 | let nowCumulativePrice = (endLastCumulativePrice + ((minuteId - lastMinuteId) * endLastPrice)) | |
754 | 754 | let startLastCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(maxIndex))), 0) | |
755 | 755 | let startLastPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(maxIndex))), 0) | |
756 | 756 | let startCumulativePrice = (startLastCumulativePrice + ((startMinuteId - maxIndex) * startLastPrice)) | |
757 | 757 | ((nowCumulativePrice - startCumulativePrice) / TWAP_INTERVAL) | |
758 | 758 | } | |
759 | 759 | ||
760 | 760 | ||
761 | 761 | func getTerminalAmmState () = { | |
762 | 762 | let _positionSize = totalPositionSize() | |
763 | 763 | if ((_positionSize == 0)) | |
764 | 764 | then $Tuple2(qtAstR(), bsAstR()) | |
765 | 765 | else { | |
766 | 766 | let direction = (_positionSize > 0) | |
767 | 767 | let $t03170031879 = swapOutput(direction, abs(_positionSize), false) | |
768 | 768 | let currentNetMarketValue = $t03170031879._1 | |
769 | 769 | let terminalQuoteAssetReserve = $t03170031879._2 | |
770 | 770 | let terminalBaseAssetReserve = $t03170031879._3 | |
771 | 771 | $Tuple2(terminalQuoteAssetReserve, terminalBaseAssetReserve) | |
772 | 772 | } | |
773 | 773 | } | |
774 | 774 | ||
775 | 775 | ||
776 | 776 | func getQuoteAssetWeight (baseAssetReserve,totalPositionSize,quoteAssetReserve,targetPrice) = { | |
777 | 777 | let b = toBigInt(baseAssetReserve) | |
778 | 778 | let sz = toBigInt(totalPositionSize) | |
779 | 779 | let q = toBigInt(quoteAssetReserve) | |
780 | 780 | let p = toBigInt(targetPrice) | |
781 | 781 | let bs2 = bpowd((b + sz), toBigInt((2 * DECIMAL_UNIT))) | |
782 | 782 | let qbs2 = bmuld(q, bs2) | |
783 | 783 | let ps4 = (toBigInt(4) * bmuld(p, sz)) | |
784 | 784 | let sqr = bsqrtd(bmuld(qbs2, (q - ps4))) | |
785 | 785 | let bq = bmuld(b, q) | |
786 | 786 | let qs = bmuld(q, sz) | |
787 | 787 | let top = ((-(sqr) + bq) + qs) | |
788 | 788 | let bot = (toBigInt(2) * bmuld(q, sz)) | |
789 | 789 | let result = bdivd(top, bot) | |
790 | 790 | toInt(result) | |
791 | 791 | } | |
792 | 792 | ||
793 | 793 | ||
794 | 794 | func getSyncTerminalPrice (_terminalPrice,_qtAstR,_bsAstR) = { | |
795 | 795 | let _positionSize = totalPositionSize() | |
796 | 796 | if ((_positionSize == 0)) | |
797 | 797 | then { | |
798 | 798 | let newQtAstW = divd(muld(_terminalPrice, _bsAstR), _qtAstR) | |
799 | 799 | $Tuple3(newQtAstW, DECIMAL_UNIT, 0) | |
800 | 800 | } | |
801 | 801 | else { | |
802 | 802 | let direction = (_positionSize > 0) | |
803 | 803 | let currentNetMarketValue = swapOutput(direction, abs(_positionSize), false)._1 | |
804 | 804 | let newQtAstW = getQuoteAssetWeight(_bsAstR, _positionSize, _qtAstR, _terminalPrice) | |
805 | 805 | let newBsAstW = DECIMAL_UNIT | |
806 | 806 | let marginToVault = getPositionNotionalAndUnrealizedPnlByValues(_positionSize, currentNetMarketValue, _qtAstR, newQtAstW, _bsAstR, newBsAstW, PNL_OPTION_SPOT)._2 | |
807 | 807 | $Tuple3(newQtAstW, newBsAstW, marginToVault) | |
808 | 808 | } | |
809 | 809 | } | |
810 | 810 | ||
811 | 811 | ||
812 | 812 | func getFunding () = { | |
813 | 813 | let underlyingPrice = getOraclePrice() | |
814 | 814 | let spotTwapPrice = getTwapSpotPrice() | |
815 | 815 | let premium = (spotTwapPrice - underlyingPrice) | |
816 | 816 | if (if (if ((totalShortPositionSize() == 0)) | |
817 | 817 | then true | |
818 | 818 | else (totalLongPositionSize() == 0)) | |
819 | 819 | then true | |
820 | 820 | else isMarketClosed()) | |
821 | 821 | then $Tuple2(0, 0) | |
822 | 822 | else if ((0 > premium)) | |
823 | 823 | then { | |
824 | 824 | let shortPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
825 | 825 | let longPremiumFraction = divd(muld(shortPremiumFraction, totalShortPositionSize()), totalLongPositionSize()) | |
826 | 826 | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
827 | 827 | } | |
828 | 828 | else { | |
829 | 829 | let longPremiumFraction = divd(muld(premium, fundingPeriodDecimal()), ONE_DAY) | |
830 | 830 | let shortPremiumFraction = divd(muld(longPremiumFraction, totalLongPositionSize()), totalShortPositionSize()) | |
831 | 831 | $Tuple2(shortPremiumFraction, longPremiumFraction) | |
832 | 832 | } | |
833 | 833 | } | |
834 | 834 | ||
835 | 835 | ||
836 | 836 | func getAdjustedFee (_artifactId,_baseFeeDiscount) = { | |
837 | 837 | let baseFeeRaw = fee() | |
838 | 838 | let baseFee = muld(baseFeeRaw, _baseFeeDiscount) | |
839 | 839 | let $t03492735422 = if ((_artifactId != "")) | |
840 | 840 | then { | |
841 | 841 | let artifactKind = strA(nftManagerAddress(), toCompositeKey(k_token_type, _artifactId)) | |
842 | 842 | if ((artifactKind == FEE_REDUCTION_TOKEN_TYPE)) | |
843 | 843 | then { | |
844 | 844 | let reduction = intA(nftManagerAddress(), toCompositeKey(k_token_param, _artifactId)) | |
845 | 845 | let adjustedFee = muld(baseFee, reduction) | |
846 | 846 | $Tuple2(adjustedFee, true) | |
847 | 847 | } | |
848 | 848 | else throw("Invalid attached artifact") | |
849 | 849 | } | |
850 | 850 | else $Tuple2(baseFee, false) | |
851 | 851 | let adjustedFee = $t03492735422._1 | |
852 | 852 | let burnArtifact = $t03492735422._2 | |
853 | 853 | $Tuple2(adjustedFee, burnArtifact) | |
854 | 854 | } | |
855 | 855 | ||
856 | 856 | ||
857 | 857 | func isSameAssetOrNoPosition (_trader,_assetId) = { | |
858 | 858 | let oldPositionSize = getPosition(_trader)._1 | |
859 | 859 | if ((oldPositionSize == 0)) | |
860 | 860 | then true | |
861 | 861 | else (getPositionAsset(_trader) == _assetId) | |
862 | 862 | } | |
863 | 863 | ||
864 | 864 | ||
865 | 865 | func isSameAsset (_trader,_assetId) = (getPositionAsset(_trader) == _assetId) | |
866 | 866 | ||
867 | 867 | ||
868 | 868 | func getBorrowedByTraderInMarketKey (_amm,_assetId,_trader) = ((((((k_trader_market_asset_collateral + "_") + _amm) + "_") + _assetId) + "_") + _trader) | |
869 | 869 | ||
870 | 870 | ||
871 | 871 | func getBorrowedByTrader (_trader) = { | |
872 | 872 | let positionAsset = getPositionAsset(_trader) | |
873 | 873 | if ((positionAsset == toBase58String(quoteAsset()))) | |
874 | 874 | then $Tuple2(0, positionAsset) | |
875 | 875 | else { | |
876 | 876 | let key = getBorrowedByTraderInMarketKey(toString(this), positionAsset, _trader) | |
877 | 877 | let borrow = valueOrElse(getInteger(collateralAddress(), key), 0) | |
878 | 878 | $Tuple2(borrow, positionAsset) | |
879 | 879 | } | |
880 | 880 | } | |
881 | 881 | ||
882 | 882 | ||
883 | 883 | func getForTraderWithArtifact (_trader,_artifactId) = { | |
884 | 884 | let doGetFeeDiscount = invoke(minerAddress(), "computeFeeDiscount", [_trader], nil) | |
885 | 885 | if ((doGetFeeDiscount == doGetFeeDiscount)) | |
886 | 886 | then { | |
887 | 887 | let feeDiscount = match doGetFeeDiscount { | |
888 | 888 | case x: Int => | |
889 | 889 | x | |
890 | 890 | case _ => | |
891 | 891 | throw("Invalid computeFeeDiscount result") | |
892 | 892 | } | |
893 | 893 | let $t03665336727 = getAdjustedFee(_artifactId, feeDiscount) | |
894 | 894 | let adjustedFee = $t03665336727._1 | |
895 | 895 | let burnArtifact = $t03665336727._2 | |
896 | 896 | $Tuple2(adjustedFee, burnArtifact) | |
897 | 897 | } | |
898 | 898 | else throw("Strict value is not equal to itself.") | |
899 | 899 | } | |
900 | 900 | ||
901 | 901 | ||
902 | 902 | func getArtifactId (i) = { | |
903 | 903 | let artifactId = if ((size(i.payments) > 1)) | |
904 | 904 | then toBase58String(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifactId")) | |
905 | 905 | else "" | |
906 | 906 | artifactId | |
907 | 907 | } | |
908 | 908 | ||
909 | 909 | ||
910 | 910 | func distributeFee (_feeAmount) = { | |
911 | 911 | let feeToStakers = muld(_feeAmount, feeToStakersPercent()) | |
912 | 912 | let feeToVault = (_feeAmount - feeToStakers) | |
913 | 913 | $Tuple2(feeToStakers, feeToVault) | |
914 | 914 | } | |
915 | 915 | ||
916 | 916 | ||
917 | 917 | func updateSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay) = [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), IntegerEntry(k_partialLiquidationRatio, _partialLiquidationRatio), IntegerEntry(k_maxPriceSpread, _maxPriceSpread), IntegerEntry(k_maxOpenNotional, _maxOpenNotional), IntegerEntry(k_feeToStakersPercent, _feeToStakersPercent), IntegerEntry(k_maxOracleDelay, _feeToStakersPercent)] | |
918 | 918 | ||
919 | 919 | ||
920 | 920 | func updateFunding (_nextFundingBlock,_latestLongCumulativePremiumFraction,_latestShortCumulativePremiumFraction,_longFundingRate,_shortFundingRate) = [IntegerEntry(k_nextFundingBlock, _nextFundingBlock), IntegerEntry(k_latestLongCumulativePremiumFraction, _latestLongCumulativePremiumFraction), IntegerEntry(k_latestShortCumulativePremiumFraction, _latestShortCumulativePremiumFraction), IntegerEntry(k_longFundingRate, _longFundingRate), IntegerEntry(k_shortFundingRate, _shortFundingRate)] | |
921 | 921 | ||
922 | 922 | ||
923 | 923 | func updatePositionAsset (_address,_assetId) = [StringEntry(toCompositeKey(k_positionAsset, _address), _assetId)] | |
924 | 924 | ||
925 | 925 | ||
926 | 926 | func incrementPositionSequenceNumber (isNewPosition,_address) = if (isNewPosition) | |
927 | 927 | then { | |
928 | 928 | let currentSequence = lastSequence() | |
929 | 929 | [IntegerEntry(toCompositeKey(k_positionSequence, _address), (currentSequence + 1)), IntegerEntry(k_sequence, (currentSequence + 1))] | |
930 | 930 | } | |
931 | 931 | else nil | |
932 | 932 | ||
933 | 933 | ||
934 | 934 | func updatePosition (_address,_size,_margin,_openNotional,_latestCumulativePremiumFraction) = [IntegerEntry(toCompositeKey(k_positionSize, _address), _size), IntegerEntry(toCompositeKey(k_positionMargin, _address), _margin), IntegerEntry(toCompositeKey(k_positionOpenNotional, _address), _openNotional), IntegerEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address), _latestCumulativePremiumFraction)] | |
935 | 935 | ||
936 | 936 | ||
937 | 937 | func appendTwap (_price) = { | |
938 | 938 | let minuteId = ((lastBlock.timestamp / 1000) / 60) | |
939 | 939 | let previousMinuteId = valueOrElse(getInteger(this, k_lastMinuteId), 0) | |
940 | 940 | if ((previousMinuteId > minuteId)) | |
941 | 941 | then throw("TWAP out-of-order") | |
942 | 942 | else { | |
943 | 943 | let lastMinuteId = if ((previousMinuteId == 0)) | |
944 | 944 | then minuteId | |
945 | 945 | else previousMinuteId | |
946 | 946 | if ((minuteId > previousMinuteId)) | |
947 | 947 | then { | |
948 | 948 | let prevCumulativePrice = valueOrElse(getInteger(this, ((k_twapDataLastCumulativePrice + "_") + toString(previousMinuteId))), 0) | |
949 | 949 | let prevPrice = valueOrElse(getInteger(this, ((k_twapDataLastPrice + "_") + toString(previousMinuteId))), _price) | |
950 | 950 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - lastMinuteId) * prevPrice)) | |
951 | 951 | let list = pushToQueue(strToList(valueOrElse(getString(this, k_lastDataStr), "")), TWAP_INTERVAL, toString(minuteId)) | |
952 | 952 | [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), _price), IntegerEntry(toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId)), previousMinuteId), IntegerEntry(k_lastMinuteId, minuteId), StringEntry(k_lastDataStr, listToStr(list))] | |
953 | 953 | } | |
954 | 954 | else { | |
955 | 955 | let twapDataPreviousMinuteId = valueOrElse(getInteger(this, toCompositeKey(k_twapDataPreviousMinuteId, toString(minuteId))), 0) | |
956 | 956 | let prevCumulativePrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastCumulativePrice, toString(twapDataPreviousMinuteId))), 0) | |
957 | 957 | let prevPrice = valueOrElse(getInteger(this, toCompositeKey(k_twapDataLastPrice, toString(twapDataPreviousMinuteId))), _price) | |
958 | 958 | let lastCumulativePrice = (prevCumulativePrice + ((minuteId - twapDataPreviousMinuteId) * prevPrice)) | |
959 | 959 | [IntegerEntry(toCompositeKey(k_twapDataLastCumulativePrice, toString(minuteId)), lastCumulativePrice), IntegerEntry(toCompositeKey(k_twapDataLastPrice, toString(minuteId)), _price)] | |
960 | 960 | } | |
961 | 961 | } | |
962 | 962 | } | |
963 | 963 | ||
964 | 964 | ||
965 | 965 | func updateAmmReserves (_qtAstR,_bsAstR) = [IntegerEntry(k_quoteAssetReserve, _qtAstR), IntegerEntry(k_baseAssetReserve, _bsAstR)] | |
966 | 966 | ||
967 | 967 | ||
968 | 968 | func updateAmmWeights (_qtAstW,_bsAstW) = [IntegerEntry(k_quoteAssetWeight, _qtAstW), IntegerEntry(k_baseAssetWeight, _bsAstW)] | |
969 | 969 | ||
970 | 970 | ||
971 | 971 | func updateAmm (_qtAstR,_bsAstR,_totalPositionSizeAfter,_openInterestNotional,_totalLongPositionSize,_totalShortPositionSize,_totalLongOpenNotional,_totalShortOpenNotional) = { | |
972 | 972 | let _qtAstW = qtAstW() | |
973 | 973 | let _bsAstW = bsAstW() | |
974 | 974 | if (((_totalLongPositionSize - _totalShortPositionSize) != _totalPositionSizeAfter)) | |
975 | 975 | then throw(((((("Invalid AMM state data: " + toString(_totalLongPositionSize)) + " + ") + toString(_totalShortPositionSize)) + " != ") + toString(_totalPositionSizeAfter))) | |
976 | 976 | else ((updateAmmReserves(_qtAstR, _bsAstR) ++ [IntegerEntry(k_totalPositionSize, _totalPositionSizeAfter), IntegerEntry(k_openInterestNotional, _openInterestNotional), IntegerEntry(k_totalLongPositionSize, _totalLongPositionSize), IntegerEntry(k_totalShortPositionSize, _totalShortPositionSize), IntegerEntry(k_openInterestLong, _totalLongOpenNotional), IntegerEntry(k_openInterestShort, _totalShortOpenNotional)]) ++ appendTwap(divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)))) | |
977 | 977 | } | |
978 | 978 | ||
979 | 979 | ||
980 | 980 | func deletePosition (_address) = [DeleteEntry(toCompositeKey(k_positionSize, _address)), DeleteEntry(toCompositeKey(k_positionMargin, _address)), DeleteEntry(toCompositeKey(k_positionOpenNotional, _address)), DeleteEntry(toCompositeKey(k_positionLastUpdatedCumulativePremiumFraction, _address)), DeleteEntry(toCompositeKey(k_positionAsset, _address))] | |
981 | 981 | ||
982 | 982 | ||
983 | 983 | func withdraw (_address,_amount) = { | |
984 | 984 | let balance = assetBalance(this, quoteAsset()) | |
985 | 985 | if ((_amount > balance)) | |
986 | 986 | then throw(((("Unable to withdraw " + toString(_amount)) + " from contract balance ") + toString(balance))) | |
987 | 987 | else [ScriptTransfer(_address, _amount, quoteAsset())] | |
988 | 988 | } | |
989 | 989 | ||
990 | 990 | ||
991 | 991 | func updateBalance (i) = if ((0 > i)) | |
992 | 992 | then throw("Balance") | |
993 | 993 | else [IntegerEntry(k_balance, i)] | |
994 | 994 | ||
995 | 995 | ||
996 | 996 | func transferFee (i) = [ScriptTransfer(stakingAddress(), i, quoteAsset())] | |
997 | 997 | ||
998 | 998 | ||
999 | 999 | func doBurnArtifact (_burnArtifact,i) = if (_burnArtifact) | |
1000 | 1000 | then [Burn(valueOrErrorMessage(i.payments[1].assetId, "Invalid artifact"), 1)] | |
1001 | 1001 | else nil | |
1002 | 1002 | ||
1003 | 1003 | ||
1004 | 1004 | @Callable(i) | |
1005 | 1005 | func pause () = if ((i.caller != adminAddress())) | |
1006 | 1006 | then throw("Invalid pause params") | |
1007 | 1007 | else [BooleanEntry(k_paused, true)] | |
1008 | 1008 | ||
1009 | 1009 | ||
1010 | 1010 | ||
1011 | 1011 | @Callable(i) | |
1012 | 1012 | func unpause () = if ((i.caller != adminAddress())) | |
1013 | 1013 | then throw("Invalid unpause params") | |
1014 | 1014 | else [BooleanEntry(k_paused, false)] | |
1015 | 1015 | ||
1016 | 1016 | ||
1017 | 1017 | ||
1018 | 1018 | @Callable(i) | |
1019 | 1019 | func setCloseOnly () = if ((i.caller != adminAddress())) | |
1020 | 1020 | then throw("Invalid setCloseOnly params") | |
1021 | 1021 | else [BooleanEntry(k_closeOnly, true)] | |
1022 | 1022 | ||
1023 | 1023 | ||
1024 | 1024 | ||
1025 | 1025 | @Callable(i) | |
1026 | 1026 | func unsetCloseOnly () = if ((i.caller != adminAddress())) | |
1027 | 1027 | then throw("Invalid unsetCloseOnly params") | |
1028 | 1028 | else [BooleanEntry(k_closeOnly, false)] | |
1029 | 1029 | ||
1030 | 1030 | ||
1031 | 1031 | ||
1032 | 1032 | @Callable(i) | |
1033 | 1033 | func addLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
1034 | 1034 | then true | |
1035 | 1035 | else (0 >= _quoteAssetAmount)) | |
1036 | 1036 | then throw("Invalid addLiquidity params") | |
1037 | 1037 | else { | |
1038 | 1038 | let _qtAstR = qtAstR() | |
1039 | 1039 | let _bsAstR = bsAstR() | |
1040 | 1040 | let _qtAstW = qtAstW() | |
1041 | 1041 | let _bsAstW = bsAstW() | |
1042 | 1042 | let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
1043 | 1043 | let qtAstRAfter = (_qtAstR + _quoteAssetAmount) | |
1044 | 1044 | let baseAssetAmountToAdd = (divd(muld(qtAstRAfter, _qtAstW), price) - _bsAstR) | |
1045 | 1045 | let bsAstRAfter = (_bsAstR + baseAssetAmountToAdd) | |
1046 | 1046 | let $t04574945900 = getSyncTerminalPrice(getOraclePrice(), qtAstRAfter, bsAstRAfter) | |
1047 | 1047 | let newQuoteAssetWeight = $t04574945900._1 | |
1048 | 1048 | let newBaseAssetWeight = $t04574945900._2 | |
1049 | 1049 | let marginToVault = $t04574945900._3 | |
1050 | 1050 | let doExchangePnL = if ((marginToVault != 0)) | |
1051 | 1051 | then { | |
1052 | 1052 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
1053 | 1053 | if ((doExchangePnL == doExchangePnL)) | |
1054 | 1054 | then nil | |
1055 | 1055 | else throw("Strict value is not equal to itself.") | |
1056 | 1056 | } | |
1057 | 1057 | else nil | |
1058 | 1058 | if ((doExchangePnL == doExchangePnL)) | |
1059 | 1059 | then (updateAmmReserves(qtAstRAfter, bsAstRAfter) ++ updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight)) | |
1060 | 1060 | else throw("Strict value is not equal to itself.") | |
1061 | 1061 | } | |
1062 | 1062 | ||
1063 | 1063 | ||
1064 | 1064 | ||
1065 | 1065 | @Callable(i) | |
1066 | 1066 | func removeLiquidity (_quoteAssetAmount) = if (if ((i.caller != adminAddress())) | |
1067 | 1067 | then true | |
1068 | 1068 | else (0 >= _quoteAssetAmount)) | |
1069 | 1069 | then throw("Invalid removeLiquidity params") | |
1070 | 1070 | else { | |
1071 | 1071 | let _qtAstR = qtAstR() | |
1072 | 1072 | let _bsAstR = bsAstR() | |
1073 | 1073 | let _qtAstW = qtAstW() | |
1074 | 1074 | let _bsAstW = bsAstW() | |
1075 | 1075 | let price = divd(muld(_qtAstR, _qtAstW), muld(_bsAstR, _bsAstW)) | |
1076 | 1076 | let baseAssetAmountToRemove = divd(_quoteAssetAmount, price) | |
1077 | 1077 | let qtAstRAfter = (_qtAstR - _quoteAssetAmount) | |
1078 | 1078 | let bsAstRAfter = (_bsAstR - baseAssetAmountToRemove) | |
1079 | 1079 | updateAmmReserves(qtAstRAfter, bsAstRAfter) | |
1080 | 1080 | } | |
1081 | 1081 | ||
1082 | 1082 | ||
1083 | 1083 | ||
1084 | 1084 | @Callable(i) | |
1085 | 1085 | func changeSettings (_initMarginRatio,_mmr,_liquidationFeeRatio,_fundingPeriod,_fee,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay) = if ((i.caller != adminAddress())) | |
1086 | 1086 | then throw("Invalid changeSettings params") | |
1087 | 1087 | else updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay) | |
1088 | 1088 | ||
1089 | 1089 | ||
1090 | 1090 | ||
1091 | 1091 | @Callable(i) | |
1092 | 1092 | func initialize (_qtAstR,_bsAstR,_fundingPeriod,_initMarginRatio,_mmr,_liquidationFeeRatio,_fee,_oracle,_oracleKey,_oracleBlockKey,_coordinator,_spreadLimit,_maxPriceImpact,_partialLiquidationRatio,_maxPriceSpread,_maxOpenNotional,_feeToStakersPercent,_maxOracleDelay) = if (if (if (if (if (if (if (if (if (if (if (if (if (if (if (if ((0 >= _qtAstR)) | |
1093 | 1093 | then true | |
1094 | 1094 | else (0 >= _bsAstR)) | |
1095 | 1095 | then true | |
1096 | 1096 | else (0 >= _fundingPeriod)) | |
1097 | 1097 | then true | |
1098 | 1098 | else (0 >= _initMarginRatio)) | |
1099 | 1099 | then true | |
1100 | 1100 | else (0 >= _mmr)) | |
1101 | 1101 | then true | |
1102 | 1102 | else (0 >= _liquidationFeeRatio)) | |
1103 | 1103 | then true | |
1104 | 1104 | else (0 >= _fee)) | |
1105 | 1105 | then true | |
1106 | 1106 | else (0 >= _spreadLimit)) | |
1107 | 1107 | then true | |
1108 | 1108 | else (0 >= _maxPriceImpact)) | |
1109 | 1109 | then true | |
1110 | 1110 | else (0 >= _partialLiquidationRatio)) | |
1111 | 1111 | then true | |
1112 | 1112 | else (0 >= _maxPriceSpread)) | |
1113 | 1113 | then true | |
1114 | 1114 | else (0 >= _maxOpenNotional)) | |
1115 | 1115 | then true | |
1116 | 1116 | else (0 >= _feeToStakersPercent)) | |
1117 | 1117 | then true | |
1118 | 1118 | else (_feeToStakersPercent > DECIMAL_UNIT)) | |
1119 | 1119 | then true | |
1120 | 1120 | else (0 >= _maxOracleDelay)) | |
1121 | 1121 | then true | |
1122 | 1122 | else initialized()) | |
1123 | 1123 | then throw("Invalid initialize parameters") | |
1124 | 1124 | else ((((updateAmm(_qtAstR, _bsAstR, 0, 0, 0, 0, 0, 0) ++ updateSettings(_initMarginRatio, _mmr, _liquidationFeeRatio, _fundingPeriod, _fee, _spreadLimit, _maxPriceImpact, _partialLiquidationRatio, _maxPriceSpread, _maxOpenNotional, _feeToStakersPercent, _maxOracleDelay)) ++ updateFunding((lastBlock.timestamp + _fundingPeriod), 0, 0, 0, 0)) ++ updateBalance(0)) ++ [BooleanEntry(k_initialized, true), StringEntry(k_ora, _oracle), StringEntry(k_ora_key, _oracleKey), StringEntry(k_ora_block_key, _oracleBlockKey), StringEntry(k_coordinatorAddress, _coordinator)]) | |
1125 | 1125 | ||
1126 | 1126 | ||
1127 | 1127 | ||
1128 | 1128 | @Callable(i) | |
1129 | 1129 | func decreasePosition (_amount,_leverage,_minBaseAssetAmount) = { | |
1130 | 1130 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1131 | 1131 | if ((sync == sync)) | |
1132 | 1132 | then { | |
1133 | 1133 | let _trader = getActualCaller(i) | |
1134 | 1134 | if (if (if (if (if (if ((0 >= _amount)) | |
1135 | 1135 | then true | |
1136 | 1136 | else !(initialized())) | |
1137 | 1137 | then true | |
1138 | 1138 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
1139 | 1139 | then true | |
1140 | 1140 | else !(requireOpenPosition(_trader))) | |
1141 | 1141 | then true | |
1142 | 1142 | else paused()) | |
1143 | 1143 | then true | |
1144 | 1144 | else isMarketClosed()) | |
1145 | 1145 | then throw("Invalid decreasePosition parameters") | |
1146 | 1146 | else { | |
1147 | 1147 | let $t04976749907 = getPosition(_trader) | |
1148 | 1148 | let oldPositionSize = $t04976749907._1 | |
1149 | 1149 | let oldPositionMargin = $t04976749907._2 | |
1150 | 1150 | let oldPositionOpenNotional = $t04976749907._3 | |
1151 | 1151 | let oldPositionLstUpdCPF = $t04976749907._4 | |
1152 | 1152 | let _direction = if ((oldPositionSize > 0)) | |
1153 | 1153 | then DIR_SHORT | |
1154 | 1154 | else DIR_LONG | |
1155 | 1155 | let isAdd = (_direction == DIR_LONG) | |
1156 | 1156 | let openNotional = muld(_amount, _leverage) | |
1157 | 1157 | let $t05008050184 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1158 | 1158 | let oldPositionNotional = $t05008050184._1 | |
1159 | 1159 | let unrealizedPnl = $t05008050184._2 | |
1160 | - | let $ | |
1160 | + | let $t05019052832 = if ((oldPositionNotional > openNotional)) | |
1161 | 1161 | then { | |
1162 | 1162 | let $t05060550789 = swapInput(isAdd, openNotional) | |
1163 | 1163 | let exchangedPositionSize = $t05060550789._1 | |
1164 | 1164 | let quoteAssetReserveAfter = $t05060550789._2 | |
1165 | 1165 | let baseAssetReserveAfter = $t05060550789._3 | |
1166 | 1166 | let totalPositionSizeAfter = $t05060550789._4 | |
1167 | 1167 | let exchangedPositionSizeAbs = abs(exchangedPositionSize) | |
1168 | 1168 | if (if ((_minBaseAssetAmount != 0)) | |
1169 | 1169 | then (_minBaseAssetAmount > exchangedPositionSizeAbs) | |
1170 | 1170 | else false) | |
1171 | 1171 | then throw(((("Too little base asset exchanged, got " + toString(exchangedPositionSizeAbs)) + " expected ") + toString(_minBaseAssetAmount))) | |
1172 | 1172 | else { | |
1173 | 1173 | let realizedPnl = divd(muld(unrealizedPnl, exchangedPositionSizeAbs), abs(oldPositionSize)) | |
1174 | - | let $t05122651471 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1175 | - | let remainMargin = $t05122651471._1 | |
1176 | - | let badDebt = $t05122651471._2 | |
1177 | - | let fundingPayment = $t05122651471._3 | |
1174 | + | let $t05122651455 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1175 | + | let remainMargin = $t05122651455._1 | |
1176 | + | let badDebt = $t05122651455._2 | |
1178 | 1177 | let exchangedQuoteAssetAmount = openNotional | |
1179 | 1178 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1180 | 1179 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1181 | 1180 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1182 | 1181 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
1183 | 1182 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1184 | 1183 | $Tuple12(newPositionSize, remainMargin, abs(remainOpenNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() - openNotional), (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
1185 | 1184 | then abs(exchangedPositionSize) | |
1186 | 1185 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1187 | 1186 | then abs(exchangedPositionSize) | |
1188 | 1187 | else 0)), (openInterestLong() - (if ((newPositionSize > 0)) | |
1189 | 1188 | then openNotional | |
1190 | 1189 | else 0)), (openInterestShort() - (if ((0 > newPositionSize)) | |
1191 | 1190 | then openNotional | |
1192 | 1191 | else 0))) | |
1193 | 1192 | } | |
1194 | 1193 | } | |
1195 | 1194 | else throw("Close position first") | |
1196 | - | let newPositionSize = $ | |
1197 | - | let newPositionRemainMargin = $ | |
1198 | - | let newPositionOpenNotional = $ | |
1199 | - | let newPositionLatestCPF = $ | |
1200 | - | let baseAssetReserveAfter = $ | |
1201 | - | let quoteAssetReserveAfter = $ | |
1202 | - | let totalPositionSizeAfter = $ | |
1203 | - | let openInterestNotionalAfter = $ | |
1204 | - | let totalLongAfter = $ | |
1205 | - | let totalShortAfter = $ | |
1206 | - | let totalLongOpenInterestAfter = $ | |
1207 | - | let totalShortOpenInterestAfter = $ | |
1195 | + | let newPositionSize = $t05019052832._1 | |
1196 | + | let newPositionRemainMargin = $t05019052832._2 | |
1197 | + | let newPositionOpenNotional = $t05019052832._3 | |
1198 | + | let newPositionLatestCPF = $t05019052832._4 | |
1199 | + | let baseAssetReserveAfter = $t05019052832._5 | |
1200 | + | let quoteAssetReserveAfter = $t05019052832._6 | |
1201 | + | let totalPositionSizeAfter = $t05019052832._7 | |
1202 | + | let openInterestNotionalAfter = $t05019052832._8 | |
1203 | + | let totalLongAfter = $t05019052832._9 | |
1204 | + | let totalShortAfter = $t05019052832._10 | |
1205 | + | let totalLongOpenInterestAfter = $t05019052832._11 | |
1206 | + | let totalShortOpenInterestAfter = $t05019052832._12 | |
1208 | 1207 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1209 | 1208 | if ((notifyNotional == notifyNotional)) | |
1210 | 1209 | then (updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) | |
1211 | 1210 | else throw("Strict value is not equal to itself.") | |
1212 | 1211 | } | |
1213 | 1212 | } | |
1214 | 1213 | else throw("Strict value is not equal to itself.") | |
1215 | 1214 | } | |
1216 | 1215 | ||
1217 | 1216 | ||
1218 | 1217 | ||
1219 | 1218 | @Callable(i) | |
1220 | 1219 | func increasePosition (_direction,_leverage,_minBaseAssetAmount,_refLink) = { | |
1221 | 1220 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1222 | 1221 | if ((sync == sync)) | |
1223 | 1222 | then { | |
1224 | 1223 | let _trader = getActualCaller(i) | |
1225 | 1224 | let _rawAmount = i.payments[0].amount | |
1226 | 1225 | let _assetId = i.payments[0].assetId | |
1227 | 1226 | let _assetIdStr = toBase58String(value(_assetId)) | |
1228 | 1227 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1229 | 1228 | let isCollateralAsset = isWhitelistAsset(_assetIdStr) | |
1230 | 1229 | if (if (if (if (if (if (if (if (if (if ((_direction != DIR_LONG)) | |
1231 | 1230 | then (_direction != DIR_SHORT) | |
1232 | 1231 | else false) | |
1233 | 1232 | then true | |
1234 | 1233 | else (0 >= _rawAmount)) | |
1235 | 1234 | then true | |
1236 | 1235 | else !(initialized())) | |
1237 | 1236 | then true | |
1238 | 1237 | else if (!(isQuoteAsset)) | |
1239 | 1238 | then !(isCollateralAsset) | |
1240 | 1239 | else false) | |
1241 | 1240 | then true | |
1242 | 1241 | else !(isSameAssetOrNoPosition(_trader, _assetIdStr))) | |
1243 | 1242 | then true | |
1244 | 1243 | else !(requireMoreMarginRatio(divd(DECIMAL_UNIT, _leverage), initMarginRatio(), true))) | |
1245 | 1244 | then true | |
1246 | 1245 | else paused()) | |
1247 | 1246 | then true | |
1248 | 1247 | else closeOnly()) | |
1249 | 1248 | then true | |
1250 | 1249 | else isMarketClosed()) | |
1251 | 1250 | then throw("Invalid increasePosition parameters") | |
1252 | 1251 | else { | |
1253 | - | let $ | |
1254 | - | let adjustedFee = $ | |
1255 | - | let burnArtifact = $ | |
1252 | + | let $t05429454379 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1253 | + | let adjustedFee = $t05429454379._1 | |
1254 | + | let burnArtifact = $t05429454379._2 | |
1256 | 1255 | let rawFeeAmount = muld(_rawAmount, adjustedFee) | |
1257 | 1256 | let _amount = (_rawAmount - rawFeeAmount) | |
1258 | 1257 | let distributeFeeAmount = if (isCollateralAsset) | |
1259 | 1258 | then { | |
1260 | 1259 | let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)]) | |
1261 | 1260 | if ((doBorrow == doBorrow)) | |
1262 | 1261 | then { | |
1263 | 1262 | let balanceBefore = assetBalance(this, quoteAsset()) | |
1264 | 1263 | if ((balanceBefore == balanceBefore)) | |
1265 | 1264 | then { | |
1266 | 1265 | let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)]) | |
1267 | 1266 | if ((doSwap == doSwap)) | |
1268 | 1267 | then { | |
1269 | 1268 | let balanceAfter = assetBalance(this, quoteAsset()) | |
1270 | 1269 | if ((balanceAfter == balanceAfter)) | |
1271 | 1270 | then { | |
1272 | 1271 | let exchangedAmount = (balanceAfter - balanceBefore) | |
1273 | 1272 | if ((exchangedAmount == exchangedAmount)) | |
1274 | 1273 | then exchangedAmount | |
1275 | 1274 | else throw("Strict value is not equal to itself.") | |
1276 | 1275 | } | |
1277 | 1276 | else throw("Strict value is not equal to itself.") | |
1278 | 1277 | } | |
1279 | 1278 | else throw("Strict value is not equal to itself.") | |
1280 | 1279 | } | |
1281 | 1280 | else throw("Strict value is not equal to itself.") | |
1282 | 1281 | } | |
1283 | 1282 | else throw("Strict value is not equal to itself.") | |
1284 | 1283 | } | |
1285 | 1284 | else rawFeeAmount | |
1286 | 1285 | if ((distributeFeeAmount == distributeFeeAmount)) | |
1287 | 1286 | then { | |
1288 | 1287 | let referrerFeeAny = invoke(referralAddress(), "acceptPaymentWithLink", [_trader, _refLink], [AttachedPayment(quoteAsset(), distributeFeeAmount)]) | |
1289 | 1288 | if ((referrerFeeAny == referrerFeeAny)) | |
1290 | 1289 | then { | |
1291 | 1290 | let referrerFee = match referrerFeeAny { | |
1292 | 1291 | case x: Int => | |
1293 | 1292 | x | |
1294 | 1293 | case _ => | |
1295 | 1294 | throw("Invalid referrerFee") | |
1296 | 1295 | } | |
1297 | 1296 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1298 | - | let $ | |
1299 | - | let oldPositionSize = $ | |
1300 | - | let oldPositionMargin = $ | |
1301 | - | let oldPositionOpenNotional = $ | |
1302 | - | let oldPositionLstUpdCPF = $ | |
1297 | + | let $t05569555835 = getPosition(_trader) | |
1298 | + | let oldPositionSize = $t05569555835._1 | |
1299 | + | let oldPositionMargin = $t05569555835._2 | |
1300 | + | let oldPositionOpenNotional = $t05569555835._3 | |
1301 | + | let oldPositionLstUpdCPF = $t05569555835._4 | |
1303 | 1302 | let isNewPosition = (oldPositionSize == 0) | |
1304 | 1303 | let isSameDirection = if ((oldPositionSize > 0)) | |
1305 | 1304 | then (_direction == DIR_LONG) | |
1306 | 1305 | else (_direction == DIR_SHORT) | |
1307 | 1306 | let expandExisting = if (!(isNewPosition)) | |
1308 | 1307 | then isSameDirection | |
1309 | 1308 | else false | |
1310 | 1309 | let isAdd = (_direction == DIR_LONG) | |
1311 | - | let $ | |
1310 | + | let $t05612459165 = if (if (isNewPosition) | |
1312 | 1311 | then true | |
1313 | 1312 | else expandExisting) | |
1314 | 1313 | then { | |
1315 | 1314 | let openNotional = muld(_amount, _leverage) | |
1316 | - | let $ | |
1317 | - | let amountBaseAssetBought = $ | |
1318 | - | let quoteAssetReserveAfter = $ | |
1319 | - | let baseAssetReserveAfter = $ | |
1320 | - | let totalPositionSizeAfter = $ | |
1315 | + | let $t05658656759 = swapInput(isAdd, openNotional) | |
1316 | + | let amountBaseAssetBought = $t05658656759._1 | |
1317 | + | let quoteAssetReserveAfter = $t05658656759._2 | |
1318 | + | let baseAssetReserveAfter = $t05658656759._3 | |
1319 | + | let totalPositionSizeAfter = $t05658656759._4 | |
1321 | 1320 | if (if ((_minBaseAssetAmount != 0)) | |
1322 | 1321 | then (_minBaseAssetAmount > abs(amountBaseAssetBought)) | |
1323 | 1322 | else false) | |
1324 | 1323 | then throw(((("Limit error: " + toString(abs(amountBaseAssetBought))) + " < ") + toString(_minBaseAssetAmount))) | |
1325 | 1324 | else { | |
1326 | 1325 | let newPositionSize = (oldPositionSize + amountBaseAssetBought) | |
1327 | 1326 | let totalLongOpenInterestAfter = (openInterestLong() + (if ((newPositionSize > 0)) | |
1328 | 1327 | then openNotional | |
1329 | 1328 | else 0)) | |
1330 | 1329 | let totalShortOpenInterestAfter = (openInterestShort() + (if ((0 > newPositionSize)) | |
1331 | 1330 | then openNotional | |
1332 | 1331 | else 0)) | |
1333 | 1332 | let increaseMarginRequirement = divd(openNotional, _leverage) | |
1334 | - | let $ | |
1335 | - | let remainMargin = $ | |
1336 | - | let x1 = $ | |
1337 | - | let x2 = $ | |
1333 | + | let $t05736757606 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, increaseMarginRequirement) | |
1334 | + | let remainMargin = $t05736757606._1 | |
1335 | + | let x1 = $t05736757606._2 | |
1336 | + | let x2 = $t05736757606._3 | |
1338 | 1337 | if (!(requireNotOverSpreadLimit(quoteAssetReserveAfter, baseAssetReserveAfter))) | |
1339 | 1338 | then throw("Over max spread limit") | |
1340 | 1339 | else if (!(requireNotOverMaxOpenNotional(totalLongOpenInterestAfter, totalShortOpenInterestAfter))) | |
1341 | 1340 | then throw("Over max open notional") | |
1342 | 1341 | else $Tuple12(newPositionSize, remainMargin, (oldPositionOpenNotional + openNotional), latestCumulativePremiumFraction(newPositionSize), baseAssetReserveAfter, quoteAssetReserveAfter, totalPositionSizeAfter, (openInterestNotional() + openNotional), (totalLongPositionSize() + (if ((newPositionSize > 0)) | |
1343 | 1342 | then abs(amountBaseAssetBought) | |
1344 | 1343 | else 0)), (totalShortPositionSize() + (if ((0 > newPositionSize)) | |
1345 | 1344 | then abs(amountBaseAssetBought) | |
1346 | 1345 | else 0)), totalLongOpenInterestAfter, totalShortOpenInterestAfter) | |
1347 | 1346 | } | |
1348 | 1347 | } | |
1349 | 1348 | else { | |
1350 | 1349 | let openNotional = muld(_amount, _leverage) | |
1351 | - | let $ | |
1352 | - | let oldPositionNotional = $ | |
1353 | - | let unrealizedPnl = $ | |
1350 | + | let $t05886558981 = getPositionNotionalAndUnrealizedPnl(toString(i.caller), PNL_OPTION_SPOT) | |
1351 | + | let oldPositionNotional = $t05886558981._1 | |
1352 | + | let unrealizedPnl = $t05886558981._2 | |
1354 | 1353 | if ((oldPositionNotional > openNotional)) | |
1355 | 1354 | then throw("Use decreasePosition to decrease position size") | |
1356 | 1355 | else throw("Close position first") | |
1357 | 1356 | } | |
1358 | - | let newPositionSize = $ | |
1359 | - | let newPositionRemainMargin = $ | |
1360 | - | let newPositionOpenNotional = $ | |
1361 | - | let newPositionLatestCPF = $ | |
1362 | - | let baseAssetReserveAfter = $ | |
1363 | - | let quoteAssetReserveAfter = $ | |
1364 | - | let totalPositionSizeAfter = $ | |
1365 | - | let openInterestNotionalAfter = $ | |
1366 | - | let totalLongAfter = $ | |
1367 | - | let totalShortAfter = $ | |
1368 | - | let totalLongOpenInterestAfter = $ | |
1369 | - | let totalShortOpenInterestAfter = $ | |
1370 | - | let $ | |
1371 | - | let feeToStakers = $ | |
1372 | - | let feeToVault = $ | |
1357 | + | let newPositionSize = $t05612459165._1 | |
1358 | + | let newPositionRemainMargin = $t05612459165._2 | |
1359 | + | let newPositionOpenNotional = $t05612459165._3 | |
1360 | + | let newPositionLatestCPF = $t05612459165._4 | |
1361 | + | let baseAssetReserveAfter = $t05612459165._5 | |
1362 | + | let quoteAssetReserveAfter = $t05612459165._6 | |
1363 | + | let totalPositionSizeAfter = $t05612459165._7 | |
1364 | + | let openInterestNotionalAfter = $t05612459165._8 | |
1365 | + | let totalLongAfter = $t05612459165._9 | |
1366 | + | let totalShortAfter = $t05612459165._10 | |
1367 | + | let totalLongOpenInterestAfter = $t05612459165._11 | |
1368 | + | let totalShortOpenInterestAfter = $t05612459165._12 | |
1369 | + | let $t05917159228 = distributeFee(feeAmount) | |
1370 | + | let feeToStakers = $t05917159228._1 | |
1371 | + | let feeToVault = $t05917159228._2 | |
1373 | 1372 | let stake = if (isQuoteAsset) | |
1374 | 1373 | then { | |
1375 | 1374 | let stake = invoke(vaultAddress(), "addLocked", [false], [AttachedPayment(quoteAsset(), _amount)]) | |
1376 | 1375 | if ((stake == stake)) | |
1377 | 1376 | then nil | |
1378 | 1377 | else throw("Strict value is not equal to itself.") | |
1379 | 1378 | } | |
1380 | 1379 | else nil | |
1381 | 1380 | if ((stake == stake)) | |
1382 | 1381 | then { | |
1383 | 1382 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1384 | 1383 | if ((depositInsurance == depositInsurance)) | |
1385 | 1384 | then { | |
1386 | 1385 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
1387 | 1386 | if ((notifyFee == notifyFee)) | |
1388 | 1387 | then { | |
1389 | 1388 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1390 | 1389 | if ((notifyNotional == notifyNotional)) | |
1391 | 1390 | then ((((((updatePosition(_trader, newPositionSize, newPositionRemainMargin, newPositionOpenNotional, newPositionLatestCPF) ++ incrementPositionSequenceNumber(isNewPosition, _trader)) ++ updatePositionAsset(_trader, _assetIdStr)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i)) | |
1392 | 1391 | else throw("Strict value is not equal to itself.") | |
1393 | 1392 | } | |
1394 | 1393 | else throw("Strict value is not equal to itself.") | |
1395 | 1394 | } | |
1396 | 1395 | else throw("Strict value is not equal to itself.") | |
1397 | 1396 | } | |
1398 | 1397 | else throw("Strict value is not equal to itself.") | |
1399 | 1398 | } | |
1400 | 1399 | else throw("Strict value is not equal to itself.") | |
1401 | 1400 | } | |
1402 | 1401 | else throw("Strict value is not equal to itself.") | |
1403 | 1402 | } | |
1404 | 1403 | } | |
1405 | 1404 | else throw("Strict value is not equal to itself.") | |
1406 | 1405 | } | |
1407 | 1406 | ||
1408 | 1407 | ||
1409 | 1408 | ||
1410 | 1409 | @Callable(i) | |
1411 | 1410 | func addMargin () = { | |
1412 | 1411 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1413 | 1412 | if ((sync == sync)) | |
1414 | 1413 | then { | |
1415 | 1414 | let _trader = toString(i.caller) | |
1416 | 1415 | let _rawAmount = i.payments[0].amount | |
1417 | 1416 | let _assetId = i.payments[0].assetId | |
1418 | 1417 | let _assetIdStr = toBase58String(value(_assetId)) | |
1419 | 1418 | let isQuoteAsset = (_assetId == quoteAsset()) | |
1420 | 1419 | let isCollateralAsset = isWhitelistAsset(_assetIdStr) | |
1421 | 1420 | if (if (if (if (if (if (if (if (!(isQuoteAsset)) | |
1422 | 1421 | then !(isCollateralAsset) | |
1423 | 1422 | else false) | |
1424 | 1423 | then true | |
1425 | 1424 | else !(requireOpenPosition(toString(i.caller)))) | |
1426 | 1425 | then true | |
1427 | 1426 | else !(isSameAsset(_trader, _assetIdStr))) | |
1428 | 1427 | then true | |
1429 | 1428 | else !(initialized())) | |
1430 | 1429 | then true | |
1431 | 1430 | else paused()) | |
1432 | 1431 | then true | |
1433 | 1432 | else closeOnly()) | |
1434 | 1433 | then true | |
1435 | 1434 | else isMarketClosed()) | |
1436 | 1435 | then throw("Invalid addMargin parameters") | |
1437 | 1436 | else { | |
1438 | - | let $ | |
1439 | - | let adjustedFee = $ | |
1440 | - | let burnArtifact = $ | |
1437 | + | let $t06120061285 = getForTraderWithArtifact(_trader, getArtifactId(i)) | |
1438 | + | let adjustedFee = $t06120061285._1 | |
1439 | + | let burnArtifact = $t06120061285._2 | |
1441 | 1440 | let rawFeeAmount = muld(_rawAmount, adjustedFee) | |
1442 | 1441 | let _amount = (_rawAmount - rawFeeAmount) | |
1443 | 1442 | let distributeFeeAmount = if (isCollateralAsset) | |
1444 | 1443 | then { | |
1445 | 1444 | let doBorrow = invoke(collateralAddress(), "borrow", [_trader], [AttachedPayment(_assetId, _amount)]) | |
1446 | 1445 | if ((doBorrow == doBorrow)) | |
1447 | 1446 | then { | |
1448 | 1447 | let balanceBefore = assetBalance(this, quoteAsset()) | |
1449 | 1448 | if ((balanceBefore == balanceBefore)) | |
1450 | 1449 | then { | |
1451 | 1450 | let doSwap = invoke(swapAddress(), "swap", [toBase58String(quoteAsset()), 0], [AttachedPayment(_assetId, rawFeeAmount)]) | |
1452 | 1451 | if ((doSwap == doSwap)) | |
1453 | 1452 | then { | |
1454 | 1453 | let balanceAfter = assetBalance(this, quoteAsset()) | |
1455 | 1454 | if ((balanceAfter == balanceAfter)) | |
1456 | 1455 | then { | |
1457 | 1456 | let exchangedAmount = (balanceAfter - balanceBefore) | |
1458 | 1457 | if ((exchangedAmount == exchangedAmount)) | |
1459 | 1458 | then exchangedAmount | |
1460 | 1459 | else throw("Strict value is not equal to itself.") | |
1461 | 1460 | } | |
1462 | 1461 | else throw("Strict value is not equal to itself.") | |
1463 | 1462 | } | |
1464 | 1463 | else throw("Strict value is not equal to itself.") | |
1465 | 1464 | } | |
1466 | 1465 | else throw("Strict value is not equal to itself.") | |
1467 | 1466 | } | |
1468 | 1467 | else throw("Strict value is not equal to itself.") | |
1469 | 1468 | } | |
1470 | 1469 | else rawFeeAmount | |
1471 | 1470 | if ((distributeFeeAmount == distributeFeeAmount)) | |
1472 | 1471 | then { | |
1473 | 1472 | let referrerFeeAny = invoke(referralAddress(), "acceptPayment", [_trader], [AttachedPayment(quoteAsset(), distributeFeeAmount)]) | |
1474 | 1473 | if ((referrerFeeAny == referrerFeeAny)) | |
1475 | 1474 | then { | |
1476 | 1475 | let referrerFee = match referrerFeeAny { | |
1477 | 1476 | case x: Int => | |
1478 | 1477 | x | |
1479 | 1478 | case _ => | |
1480 | 1479 | throw("Invalid referrerFee") | |
1481 | 1480 | } | |
1482 | 1481 | let feeAmount = (distributeFeeAmount - referrerFee) | |
1483 | - | let $ | |
1484 | - | let oldPositionSize = $ | |
1485 | - | let oldPositionMargin = $ | |
1486 | - | let oldPositionOpenNotional = $ | |
1487 | - | let oldPositionLstUpdCPF = $ | |
1488 | - | let $ | |
1489 | - | let feeToStakers = $ | |
1490 | - | let feeToVault = $ | |
1482 | + | let $t06258462724 = getPosition(_trader) | |
1483 | + | let oldPositionSize = $t06258462724._1 | |
1484 | + | let oldPositionMargin = $t06258462724._2 | |
1485 | + | let oldPositionOpenNotional = $t06258462724._3 | |
1486 | + | let oldPositionLstUpdCPF = $t06258462724._4 | |
1487 | + | let $t06273062787 = distributeFee(feeAmount) | |
1488 | + | let feeToStakers = $t06273062787._1 | |
1489 | + | let feeToVault = $t06273062787._2 | |
1491 | 1490 | let stake = if (isQuoteAsset) | |
1492 | 1491 | then { | |
1493 | 1492 | let stake = invoke(vaultAddress(), "addLocked", [false], [AttachedPayment(quoteAsset(), _amount)]) | |
1494 | 1493 | if ((stake == stake)) | |
1495 | 1494 | then nil | |
1496 | 1495 | else throw("Strict value is not equal to itself.") | |
1497 | 1496 | } | |
1498 | 1497 | else nil | |
1499 | 1498 | if ((stake == stake)) | |
1500 | 1499 | then { | |
1501 | 1500 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1502 | 1501 | if ((depositInsurance == depositInsurance)) | |
1503 | 1502 | then { | |
1504 | 1503 | let notifyFee = invoke(minerAddress(), "notifyFees", [_trader, feeAmount], nil) | |
1505 | 1504 | if ((notifyFee == notifyFee)) | |
1506 | 1505 | then (((updatePosition(_trader, oldPositionSize, (oldPositionMargin + _amount), oldPositionOpenNotional, oldPositionLstUpdCPF) ++ transferFee(feeToStakers)) ++ updateBalance((cbalance() + _amount))) ++ doBurnArtifact(burnArtifact, i)) | |
1507 | 1506 | else throw("Strict value is not equal to itself.") | |
1508 | 1507 | } | |
1509 | 1508 | else throw("Strict value is not equal to itself.") | |
1510 | 1509 | } | |
1511 | 1510 | else throw("Strict value is not equal to itself.") | |
1512 | 1511 | } | |
1513 | 1512 | else throw("Strict value is not equal to itself.") | |
1514 | 1513 | } | |
1515 | 1514 | else throw("Strict value is not equal to itself.") | |
1516 | 1515 | } | |
1517 | 1516 | } | |
1518 | 1517 | else throw("Strict value is not equal to itself.") | |
1519 | 1518 | } | |
1520 | 1519 | ||
1521 | 1520 | ||
1522 | 1521 | ||
1523 | 1522 | @Callable(i) | |
1524 | 1523 | func removeMargin (_amount) = { | |
1525 | 1524 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1526 | 1525 | if ((sync == sync)) | |
1527 | 1526 | then { | |
1528 | 1527 | let _trader = toString(i.caller) | |
1529 | 1528 | if (if (if (if (if ((0 >= _amount)) | |
1530 | 1529 | then true | |
1531 | 1530 | else !(requireOpenPosition(_trader))) | |
1532 | 1531 | then true | |
1533 | 1532 | else !(initialized())) | |
1534 | 1533 | then true | |
1535 | 1534 | else paused()) | |
1536 | 1535 | then true | |
1537 | 1536 | else isMarketClosed()) | |
1538 | 1537 | then throw("Invalid removeMargin parameters") | |
1539 | 1538 | else { | |
1540 | - | let $ | |
1541 | - | let oldPositionSize = $ | |
1542 | - | let oldPositionMargin = $ | |
1543 | - | let oldPositionOpenNotional = $ | |
1544 | - | let oldPositionLstUpdCPF = $ | |
1539 | + | let $t06392364063 = getPosition(_trader) | |
1540 | + | let oldPositionSize = $t06392364063._1 | |
1541 | + | let oldPositionMargin = $t06392364063._2 | |
1542 | + | let oldPositionOpenNotional = $t06392364063._3 | |
1543 | + | let oldPositionLstUpdCPF = $t06392364063._4 | |
1545 | 1544 | let marginDelta = -(_amount) | |
1546 | - | let $ | |
1547 | - | let remainMargin = $ | |
1548 | - | let badDebt = $ | |
1545 | + | let $t06410064279 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, marginDelta) | |
1546 | + | let remainMargin = $t06410064279._1 | |
1547 | + | let badDebt = $t06410064279._2 | |
1549 | 1548 | if ((badDebt != 0)) | |
1550 | 1549 | then throw("Invalid removed margin amount") | |
1551 | 1550 | else { | |
1552 | 1551 | let marginRatio = calcMarginRatio(remainMargin, badDebt, oldPositionOpenNotional) | |
1553 | 1552 | if (!(requireMoreMarginRatio(marginRatio, initMarginRatio(), true))) | |
1554 | 1553 | then throw(((("Too much margin removed: " + toString(marginRatio)) + " < ") + toString(initMarginRatio()))) | |
1555 | 1554 | else { | |
1556 | 1555 | let quoteAssetStr = toBase58String(quoteAsset()) | |
1557 | - | let $ | |
1558 | - | let borrowed = $ | |
1559 | - | let assetId = $ | |
1556 | + | let $t06472364777 = getBorrowedByTrader(_trader) | |
1557 | + | let borrowed = $t06472364777._1 | |
1558 | + | let assetId = $t06472364777._2 | |
1560 | 1559 | let toRepay = if ((_amount > borrowed)) | |
1561 | 1560 | then borrowed | |
1562 | 1561 | else _amount | |
1563 | 1562 | let toWithdraw = if ((borrowed > _amount)) | |
1564 | 1563 | then 0 | |
1565 | 1564 | else (_amount - borrowed) | |
1566 | 1565 | let finalBorrow = (borrowed - toRepay) | |
1567 | 1566 | let switchPositionToQuote = if ((finalBorrow > 0)) | |
1568 | 1567 | then nil | |
1569 | 1568 | else updatePositionAsset(_trader, quoteAssetStr) | |
1570 | 1569 | let doSanityCheck = if (((toRepay + toWithdraw) != _amount)) | |
1571 | 1570 | then throw(((((("toRepay=" + toString(toRepay)) + " + toWithdraw=") + toString(toWithdraw)) + " != ") + toString(_amount))) | |
1572 | 1571 | else nil | |
1573 | 1572 | if ((doSanityCheck == doSanityCheck)) | |
1574 | 1573 | then { | |
1575 | 1574 | let doUnstake = if ((toWithdraw > 0)) | |
1576 | 1575 | then { | |
1577 | 1576 | let doUnstake = invoke(vaultAddress(), "withdrawLocked", [toWithdraw], nil) | |
1578 | 1577 | if ((doUnstake == doUnstake)) | |
1579 | 1578 | then nil | |
1580 | 1579 | else throw("Strict value is not equal to itself.") | |
1581 | 1580 | } | |
1582 | 1581 | else nil | |
1583 | 1582 | if ((doUnstake == doUnstake)) | |
1584 | 1583 | then { | |
1585 | 1584 | let returnCollateralAction = if ((toRepay > 0)) | |
1586 | 1585 | then { | |
1587 | 1586 | let doRepay = invoke(collateralAddress(), "repay", [_trader, toRepay, assetId], nil) | |
1588 | 1587 | if ((doRepay == doRepay)) | |
1589 | 1588 | then [ScriptTransfer(i.caller, toRepay, fromBase58String(assetId))] | |
1590 | 1589 | else throw("Strict value is not equal to itself.") | |
1591 | 1590 | } | |
1592 | 1591 | else nil | |
1593 | 1592 | if ((returnCollateralAction == returnCollateralAction)) | |
1594 | 1593 | then ((((updatePosition(_trader, oldPositionSize, remainMargin, oldPositionOpenNotional, latestCumulativePremiumFraction(oldPositionSize)) ++ (if ((toWithdraw > 0)) | |
1595 | 1594 | then withdraw(i.caller, toWithdraw) | |
1596 | 1595 | else nil)) ++ updateBalance((cbalance() - _amount))) ++ switchPositionToQuote) ++ returnCollateralAction) | |
1597 | 1596 | else throw("Strict value is not equal to itself.") | |
1598 | 1597 | } | |
1599 | 1598 | else throw("Strict value is not equal to itself.") | |
1600 | 1599 | } | |
1601 | 1600 | else throw("Strict value is not equal to itself.") | |
1602 | 1601 | } | |
1603 | 1602 | } | |
1604 | 1603 | } | |
1605 | 1604 | } | |
1606 | 1605 | else throw("Strict value is not equal to itself.") | |
1607 | 1606 | } | |
1608 | 1607 | ||
1609 | 1608 | ||
1610 | 1609 | ||
1611 | 1610 | @Callable(i) | |
1612 | 1611 | func closePosition (_size,_minQuoteAssetAmount) = { | |
1613 | 1612 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1614 | 1613 | if ((sync == sync)) | |
1615 | 1614 | then { | |
1616 | 1615 | let _trader = getActualCaller(i) | |
1617 | 1616 | let _traderAddress = valueOrErrorMessage(addressFromString(_trader), "Invalid caller") | |
1618 | 1617 | if (if (if (if (if (if (!(requireOpenPosition(_trader))) | |
1619 | 1618 | then true | |
1620 | 1619 | else !(initialized())) | |
1621 | 1620 | then true | |
1622 | 1621 | else paused()) | |
1623 | 1622 | then true | |
1624 | 1623 | else (0 >= _size)) | |
1625 | 1624 | then true | |
1626 | 1625 | else (0 > _minQuoteAssetAmount)) | |
1627 | 1626 | then true | |
1628 | 1627 | else isMarketClosed()) | |
1629 | 1628 | then throw("Invalid closePosition parameters") | |
1630 | 1629 | else { | |
1631 | - | let $ | |
1632 | - | let oldPositionSize = $ | |
1633 | - | let oldPositionMargin = $ | |
1634 | - | let oldPositionOpenNotional = $ | |
1635 | - | let oldPositionLstUpdCPF = $ | |
1636 | - | let $ | |
1630 | + | let $t06696167101 = getPosition(_trader) | |
1631 | + | let oldPositionSize = $t06696167101._1 | |
1632 | + | let oldPositionMargin = $t06696167101._2 | |
1633 | + | let oldPositionOpenNotional = $t06696167101._3 | |
1634 | + | let oldPositionLstUpdCPF = $t06696167101._4 | |
1635 | + | let $t06710772237 = if ((abs(oldPositionSize) > _size)) | |
1637 | 1636 | then { | |
1638 | 1637 | let _direction = if ((oldPositionSize > 0)) | |
1639 | 1638 | then DIR_SHORT | |
1640 | 1639 | else DIR_LONG | |
1641 | 1640 | let isAdd = (_direction == DIR_LONG) | |
1642 | - | let $ | |
1643 | - | let exchangedQuoteAssetAmount = $ | |
1644 | - | let quoteAssetReserveAfter = $ | |
1645 | - | let baseAssetReserveAfter = $ | |
1646 | - | let totalPositionSizeAfter = $ | |
1641 | + | let $t06769867920 = swapOutput((oldPositionSize > 0), _size, true) | |
1642 | + | let exchangedQuoteAssetAmount = $t06769867920._1 | |
1643 | + | let quoteAssetReserveAfter = $t06769867920._2 | |
1644 | + | let baseAssetReserveAfter = $t06769867920._3 | |
1645 | + | let totalPositionSizeAfter = $t06769867920._4 | |
1647 | 1646 | let exchangedPositionSize = if ((oldPositionSize > 0)) | |
1648 | 1647 | then -(_size) | |
1649 | 1648 | else _size | |
1650 | - | let $ | |
1651 | - | let oldPositionNotional = $ | |
1652 | - | let unrealizedPnl = $ | |
1649 | + | let $t06801168165 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1650 | + | let oldPositionNotional = $t06801168165._1 | |
1651 | + | let unrealizedPnl = $t06801168165._2 | |
1653 | 1652 | let mr = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
1654 | 1653 | let realizedRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize)) | |
1655 | 1654 | let realizedPnl = muld(unrealizedPnl, realizedRatio) | |
1656 | 1655 | let remainMarginBefore = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, unrealizedPnl)._1 | |
1657 | - | let $ | |
1658 | - | let | |
1659 | - | let positionBadDebt = $ | |
1660 | - | let fundingPayment = $ | |
1656 | + | let $t06866668894 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1657 | + | let x1 = $t06866668894._1 | |
1658 | + | let positionBadDebt = $t06866668894._2 | |
1659 | + | let fundingPayment = $t06866668894._3 | |
1661 | 1660 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1662 | 1661 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1663 | 1662 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1664 | 1663 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
1665 | 1664 | let newPositionOpenNotional = abs(remainOpenNotional) | |
1666 | 1665 | let newPositionMargin = if ((oldPositionSize > 0)) | |
1667 | 1666 | then (muld((newPositionOpenNotional + unrealizedPnlAfter), mr) - unrealizedPnlAfter) | |
1668 | 1667 | else (muld((newPositionOpenNotional - unrealizedPnlAfter), mr) - unrealizedPnlAfter) | |
1668 | + | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
1669 | 1669 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1670 | 1670 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1671 | - | let openInterestNotionalAfter = (openInterestNotional() - | |
1671 | + | let openInterestNotionalAfter = (openInterestNotional() - openNotionalDelta) | |
1672 | 1672 | if (if ((_minQuoteAssetAmount != 0)) | |
1673 | 1673 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
1674 | 1674 | else false) | |
1675 | 1675 | then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount))) | |
1676 | 1676 | else $Tuple15(newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF, positionBadDebt, realizedPnl, (remainMarginBefore - (newPositionMargin + unrealizedPnlAfter)), quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
1677 | 1677 | then abs(exchangedPositionSize) | |
1678 | 1678 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1679 | 1679 | then abs(exchangedPositionSize) | |
1680 | 1680 | else 0)), (openInterestLong() - (if ((newPositionSize > 0)) | |
1681 | - | then | |
1681 | + | then openNotionalDelta | |
1682 | 1682 | else 0)), (openInterestShort() - (if ((0 > newPositionSize)) | |
1683 | - | then | |
1683 | + | then openNotionalDelta | |
1684 | 1684 | else 0))) | |
1685 | 1685 | } | |
1686 | 1686 | else if ((_size > abs(oldPositionSize))) | |
1687 | 1687 | then throw("Invalid closePosition parameters") | |
1688 | 1688 | else { | |
1689 | - | let $ | |
1690 | - | let exchangedQuoteAssetAmount = $ | |
1691 | - | let positionBadDebt = $ | |
1692 | - | let realizedPnl = $ | |
1693 | - | let marginToVault = $ | |
1694 | - | let quoteAssetReserveAfter = $ | |
1695 | - | let baseAssetReserveAfter = $ | |
1696 | - | let totalPositionSizeAfter = $ | |
1697 | - | let openInterestNotionalAfter = $ | |
1698 | - | let x2 = $ | |
1699 | - | let totalLongAfter = $ | |
1700 | - | let totalShortAfter = $ | |
1701 | - | let totalLongOpenInterestAfter = $ | |
1702 | - | let totalShortOpenInterestAfter = $ | |
1689 | + | let $t07117871597 = internalClosePosition(_trader, true) | |
1690 | + | let exchangedQuoteAssetAmount = $t07117871597._1 | |
1691 | + | let positionBadDebt = $t07117871597._2 | |
1692 | + | let realizedPnl = $t07117871597._3 | |
1693 | + | let marginToVault = $t07117871597._4 | |
1694 | + | let quoteAssetReserveAfter = $t07117871597._5 | |
1695 | + | let baseAssetReserveAfter = $t07117871597._6 | |
1696 | + | let totalPositionSizeAfter = $t07117871597._7 | |
1697 | + | let openInterestNotionalAfter = $t07117871597._8 | |
1698 | + | let x2 = $t07117871597._9 | |
1699 | + | let totalLongAfter = $t07117871597._10 | |
1700 | + | let totalShortAfter = $t07117871597._11 | |
1701 | + | let totalLongOpenInterestAfter = $t07117871597._12 | |
1702 | + | let totalShortOpenInterestAfter = $t07117871597._13 | |
1703 | 1703 | if (if ((_minQuoteAssetAmount != 0)) | |
1704 | 1704 | then (_minQuoteAssetAmount > exchangedQuoteAssetAmount) | |
1705 | 1705 | else false) | |
1706 | 1706 | then throw(((("Limit error: " + toString(exchangedQuoteAssetAmount)) + " < ") + toString(_minQuoteAssetAmount))) | |
1707 | 1707 | else $Tuple15(0, 0, 0, 0, positionBadDebt, realizedPnl, marginToVault, quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter) | |
1708 | 1708 | } | |
1709 | - | let newPositionSize = $ | |
1710 | - | let newPositionMargin = $ | |
1711 | - | let newPositionOpenNotional = $ | |
1712 | - | let newPositionLstUpdCPF = $ | |
1713 | - | let positionBadDebt = $ | |
1714 | - | let realizedPnl = $ | |
1715 | - | let marginToVault = $ | |
1716 | - | let quoteAssetReserveAfter = $ | |
1717 | - | let baseAssetReserveAfter = $ | |
1718 | - | let totalPositionSizeAfter = $ | |
1719 | - | let openInterestNotionalAfter = $ | |
1720 | - | let totalLongAfter = $ | |
1721 | - | let totalShortAfter = $ | |
1722 | - | let totalLongOpenInterestAfter = $ | |
1723 | - | let totalShortOpenInterestAfter = $ | |
1709 | + | let newPositionSize = $t06710772237._1 | |
1710 | + | let newPositionMargin = $t06710772237._2 | |
1711 | + | let newPositionOpenNotional = $t06710772237._3 | |
1712 | + | let newPositionLstUpdCPF = $t06710772237._4 | |
1713 | + | let positionBadDebt = $t06710772237._5 | |
1714 | + | let realizedPnl = $t06710772237._6 | |
1715 | + | let marginToVault = $t06710772237._7 | |
1716 | + | let quoteAssetReserveAfter = $t06710772237._8 | |
1717 | + | let baseAssetReserveAfter = $t06710772237._9 | |
1718 | + | let totalPositionSizeAfter = $t06710772237._10 | |
1719 | + | let openInterestNotionalAfter = $t06710772237._11 | |
1720 | + | let totalLongAfter = $t06710772237._12 | |
1721 | + | let totalShortAfter = $t06710772237._13 | |
1722 | + | let totalLongOpenInterestAfter = $t06710772237._14 | |
1723 | + | let totalShortOpenInterestAfter = $t06710772237._15 | |
1724 | 1724 | if ((positionBadDebt > 0)) | |
1725 | 1725 | then throw("Unable to close position with bad debt") | |
1726 | 1726 | else { | |
1727 | 1727 | let withdrawAmount = abs(marginToVault) | |
1728 | 1728 | let ammBalance = (cbalance() - withdrawAmount) | |
1729 | - | let $ | |
1729 | + | let $t07244672653 = if ((0 > ammBalance)) | |
1730 | 1730 | then $Tuple2(0, abs(ammBalance)) | |
1731 | 1731 | else $Tuple2(ammBalance, 0) | |
1732 | - | let ammNewBalance = $ | |
1733 | - | let x11 = $ | |
1734 | - | let $ | |
1735 | - | let borrowed = $ | |
1736 | - | let assetId = $ | |
1737 | - | let $ | |
1732 | + | let ammNewBalance = $t07244672653._1 | |
1733 | + | let x11 = $t07244672653._2 | |
1734 | + | let $t07266072714 = getBorrowedByTrader(_trader) | |
1735 | + | let borrowed = $t07266072714._1 | |
1736 | + | let assetId = $t07266072714._2 | |
1737 | + | let $t07272973588 = if ((borrowed > 0)) | |
1738 | 1738 | then if ((withdrawAmount >= borrowed)) | |
1739 | 1739 | then { | |
1740 | 1740 | let doRepay = invoke(collateralAddress(), "repay", [_trader, borrowed, assetId], nil) | |
1741 | 1741 | if ((doRepay == doRepay)) | |
1742 | 1742 | then $Tuple2([ScriptTransfer(_traderAddress, borrowed, fromBase58String(assetId))], (withdrawAmount - borrowed)) | |
1743 | 1743 | else throw("Strict value is not equal to itself.") | |
1744 | 1744 | } | |
1745 | 1745 | else { | |
1746 | 1746 | let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, withdrawAmount, assetId], nil) | |
1747 | 1747 | if ((realizeAndClose == realizeAndClose)) | |
1748 | 1748 | then $Tuple2([ScriptTransfer(_traderAddress, withdrawAmount, fromBase58String(assetId))], 0) | |
1749 | 1749 | else throw("Strict value is not equal to itself.") | |
1750 | 1750 | } | |
1751 | 1751 | else $Tuple2(nil, withdrawAmount) | |
1752 | - | if (($ | |
1752 | + | if (($t07272973588 == $t07272973588)) | |
1753 | 1753 | then { | |
1754 | - | let quoteWithdrawAmount = $ | |
1755 | - | let sendCollateralAction = $ | |
1754 | + | let quoteWithdrawAmount = $t07272973588._2 | |
1755 | + | let sendCollateralAction = $t07272973588._1 | |
1756 | 1756 | let unstake = if ((quoteWithdrawAmount > 0)) | |
1757 | 1757 | then { | |
1758 | 1758 | let unstake = invoke(vaultAddress(), "withdrawLocked", [quoteWithdrawAmount], nil) | |
1759 | 1759 | if ((unstake == unstake)) | |
1760 | 1760 | then nil | |
1761 | 1761 | else throw("Strict value is not equal to itself.") | |
1762 | 1762 | } | |
1763 | 1763 | else nil | |
1764 | 1764 | if ((unstake == unstake)) | |
1765 | 1765 | then { | |
1766 | 1766 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil) | |
1767 | 1767 | if ((notifyNotional == notifyNotional)) | |
1768 | 1768 | then (((((if ((newPositionSize == 0)) | |
1769 | 1769 | then deletePosition(_trader) | |
1770 | 1770 | else updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF)) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ (if ((quoteWithdrawAmount > 0)) | |
1771 | 1771 | then withdraw(_traderAddress, quoteWithdrawAmount) | |
1772 | 1772 | else nil)) ++ updateBalance(ammNewBalance)) ++ sendCollateralAction) | |
1773 | 1773 | else throw("Strict value is not equal to itself.") | |
1774 | 1774 | } | |
1775 | 1775 | else throw("Strict value is not equal to itself.") | |
1776 | 1776 | } | |
1777 | 1777 | else throw("Strict value is not equal to itself.") | |
1778 | 1778 | } | |
1779 | 1779 | } | |
1780 | 1780 | } | |
1781 | 1781 | else throw("Strict value is not equal to itself.") | |
1782 | 1782 | } | |
1783 | 1783 | ||
1784 | 1784 | ||
1785 | 1785 | ||
1786 | 1786 | @Callable(i) | |
1787 | 1787 | func liquidate (_trader) = { | |
1788 | 1788 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1789 | 1789 | if ((sync == sync)) | |
1790 | 1790 | then { | |
1791 | 1791 | let spotMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_SPOT) | |
1792 | 1792 | let marginRatio = if (isOverFluctuationLimit()) | |
1793 | 1793 | then { | |
1794 | 1794 | let oracleMarginRatio = getMarginRatioByOption(_trader, PNL_OPTION_ORACLE) | |
1795 | 1795 | vmax(spotMarginRatio, oracleMarginRatio) | |
1796 | 1796 | } | |
1797 | 1797 | else spotMarginRatio | |
1798 | 1798 | if (if (if (if (if (!(requireMoreMarginRatio(marginRatio, maintenanceMarginRatio(), false))) | |
1799 | 1799 | then true | |
1800 | 1800 | else !(requireOpenPosition(_trader))) | |
1801 | 1801 | then true | |
1802 | 1802 | else !(initialized())) | |
1803 | 1803 | then true | |
1804 | 1804 | else paused()) | |
1805 | 1805 | then true | |
1806 | 1806 | else isMarketClosed()) | |
1807 | 1807 | then throw("Unable to liquidate") | |
1808 | 1808 | else if (if (if ((spotMarginRatio > liquidationFeeRatio())) | |
1809 | 1809 | then (partialLiquidationRatio() > 0) | |
1810 | 1810 | else false) | |
1811 | 1811 | then (DECIMAL_UNIT > partialLiquidationRatio()) | |
1812 | 1812 | else false) | |
1813 | 1813 | then { | |
1814 | - | let $ | |
1815 | - | let oldPositionSize = $ | |
1816 | - | let oldPositionMargin = $ | |
1817 | - | let oldPositionOpenNotional = $ | |
1818 | - | let oldPositionLstUpdCPF = $ | |
1814 | + | let $t07590976059 = getPosition(_trader) | |
1815 | + | let oldPositionSize = $t07590976059._1 | |
1816 | + | let oldPositionMargin = $t07590976059._2 | |
1817 | + | let oldPositionOpenNotional = $t07590976059._3 | |
1818 | + | let oldPositionLstUpdCPF = $t07590976059._4 | |
1819 | 1819 | let _direction = if ((oldPositionSize > 0)) | |
1820 | 1820 | then DIR_SHORT | |
1821 | 1821 | else DIR_LONG | |
1822 | 1822 | let isAdd = (_direction == DIR_LONG) | |
1823 | 1823 | let exchangedQuoteAssetAmount = getPartialLiquidationAmount(_trader, oldPositionSize) | |
1824 | - | let $ | |
1825 | - | let oldPositionNotional = $ | |
1826 | - | let unrealizedPnl = $ | |
1827 | - | let $ | |
1828 | - | let exchangedPositionSize = $ | |
1829 | - | let quoteAssetReserveAfter = $ | |
1830 | - | let baseAssetReserveAfter = $ | |
1831 | - | let totalPositionSizeAfter = $ | |
1824 | + | let $t07628476388 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
1825 | + | let oldPositionNotional = $t07628476388._1 | |
1826 | + | let unrealizedPnl = $t07628476388._2 | |
1827 | + | let $t07639676583 = swapInput(isAdd, exchangedQuoteAssetAmount) | |
1828 | + | let exchangedPositionSize = $t07639676583._1 | |
1829 | + | let quoteAssetReserveAfter = $t07639676583._2 | |
1830 | + | let baseAssetReserveAfter = $t07639676583._3 | |
1831 | + | let totalPositionSizeAfter = $t07639676583._4 | |
1832 | 1832 | let liquidationRatio = divd(abs(exchangedPositionSize), abs(oldPositionSize)) | |
1833 | 1833 | let realizedPnl = muld(unrealizedPnl, liquidationRatio) | |
1834 | - | let $ | |
1835 | - | let remainMargin = $ | |
1836 | - | let badDebt = $ | |
1837 | - | let fundingPayment = $ | |
1834 | + | let $t07687277105 = calcRemainMarginWithFundingPayment(oldPositionSize, oldPositionMargin, oldPositionLstUpdCPF, realizedPnl) | |
1835 | + | let remainMargin = $t07687277105._1 | |
1836 | + | let badDebt = $t07687277105._2 | |
1837 | + | let fundingPayment = $t07687277105._3 | |
1838 | 1838 | let unrealizedPnlAfter = (unrealizedPnl - realizedPnl) | |
1839 | 1839 | let remainOpenNotional = if ((oldPositionSize > 0)) | |
1840 | 1840 | then ((oldPositionNotional - exchangedQuoteAssetAmount) - unrealizedPnlAfter) | |
1841 | 1841 | else ((unrealizedPnlAfter + oldPositionNotional) - exchangedQuoteAssetAmount) | |
1842 | 1842 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1843 | 1843 | let feeToLiquidator = (liquidationPenalty / 2) | |
1844 | 1844 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1845 | 1845 | let newPositionMargin = (remainMargin - liquidationPenalty) | |
1846 | 1846 | let newPositionSize = (oldPositionSize + exchangedPositionSize) | |
1847 | 1847 | let newPositionOpenNotional = abs(remainOpenNotional) | |
1848 | + | let openNotionalDelta = (oldPositionOpenNotional - newPositionOpenNotional) | |
1848 | 1849 | let newPositionLstUpdCPF = latestCumulativePremiumFraction(newPositionSize) | |
1849 | - | let openInterestNotionalAfter = (openInterestNotional() - | |
1850 | + | let openInterestNotionalAfter = (openInterestNotional() - openNotionalDelta) | |
1850 | 1851 | let ammBalance = (cbalance() - liquidationPenalty) | |
1851 | - | let $ | |
1852 | + | let $t07834678475 = if ((0 > ammBalance)) | |
1852 | 1853 | then $Tuple2(0, abs(ammBalance)) | |
1853 | 1854 | else $Tuple2(ammBalance, 0) | |
1854 | - | let newAmmBalance = $ | |
1855 | - | let x11 = $ | |
1856 | - | let $ | |
1857 | - | let borrowed = $ | |
1858 | - | let assetId = $ | |
1855 | + | let newAmmBalance = $t07834678475._1 | |
1856 | + | let x11 = $t07834678475._2 | |
1857 | + | let $t07848378537 = getBorrowedByTrader(_trader) | |
1858 | + | let borrowed = $t07848378537._1 | |
1859 | + | let assetId = $t07848378537._2 | |
1859 | 1860 | let doLiquidateCollateral = if ((borrowed > 0)) | |
1860 | 1861 | then { | |
1861 | 1862 | let collateralToSell = muld(borrowed, liquidationRatio) | |
1862 | 1863 | let realizeAndClose = invoke(collateralAddress(), "realizePartially", [_trader, assetId, collateralToSell], nil) | |
1863 | 1864 | if ((realizeAndClose == realizeAndClose)) | |
1864 | 1865 | then nil | |
1865 | 1866 | else throw("Strict value is not equal to itself.") | |
1866 | 1867 | } | |
1867 | 1868 | else nil | |
1868 | 1869 | if ((doLiquidateCollateral == doLiquidateCollateral)) | |
1869 | 1870 | then { | |
1870 | 1871 | let unstake = invoke(vaultAddress(), "withdrawLocked", [liquidationPenalty], nil) | |
1871 | 1872 | if ((unstake == unstake)) | |
1872 | 1873 | then { | |
1873 | 1874 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1874 | 1875 | if ((depositInsurance == depositInsurance)) | |
1875 | 1876 | then { | |
1876 | 1877 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, newPositionOpenNotional], nil) | |
1877 | 1878 | if ((notifyNotional == notifyNotional)) | |
1878 | 1879 | then (((updatePosition(_trader, newPositionSize, newPositionMargin, newPositionOpenNotional, newPositionLstUpdCPF) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, (totalLongPositionSize() - (if ((newPositionSize > 0)) | |
1879 | 1880 | then abs(exchangedPositionSize) | |
1880 | 1881 | else 0)), (totalShortPositionSize() - (if ((0 > newPositionSize)) | |
1881 | 1882 | then abs(exchangedPositionSize) | |
1882 | 1883 | else 0)), (openInterestLong() - (if ((newPositionSize > 0)) | |
1883 | - | then | |
1884 | + | then openNotionalDelta | |
1884 | 1885 | else 0)), (openInterestShort() - (if ((0 > newPositionSize)) | |
1885 | - | then | |
1886 | + | then openNotionalDelta | |
1886 | 1887 | else 0)))) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1887 | 1888 | else throw("Strict value is not equal to itself.") | |
1888 | 1889 | } | |
1889 | 1890 | else throw("Strict value is not equal to itself.") | |
1890 | 1891 | } | |
1891 | 1892 | else throw("Strict value is not equal to itself.") | |
1892 | 1893 | } | |
1893 | 1894 | else throw("Strict value is not equal to itself.") | |
1894 | 1895 | } | |
1895 | 1896 | else { | |
1896 | - | let $ | |
1897 | - | let x1 = $ | |
1898 | - | let badDebt = $ | |
1899 | - | let x2 = $ | |
1900 | - | let x3 = $ | |
1901 | - | let quoteAssetReserveAfter = $ | |
1902 | - | let baseAssetReserveAfter = $ | |
1903 | - | let totalPositionSizeAfter = $ | |
1904 | - | let openInterestNotionalAfter = $ | |
1905 | - | let exchangedQuoteAssetAmount = $ | |
1906 | - | let totalLongAfter = $ | |
1907 | - | let totalShortAfter = $ | |
1908 | - | let totalLongOpenInterestAfter = $ | |
1909 | - | let totalShortOpenInterestAfter = $ | |
1897 | + | let $t08021680711 = internalClosePosition(_trader, false) | |
1898 | + | let x1 = $t08021680711._1 | |
1899 | + | let badDebt = $t08021680711._2 | |
1900 | + | let x2 = $t08021680711._3 | |
1901 | + | let x3 = $t08021680711._4 | |
1902 | + | let quoteAssetReserveAfter = $t08021680711._5 | |
1903 | + | let baseAssetReserveAfter = $t08021680711._6 | |
1904 | + | let totalPositionSizeAfter = $t08021680711._7 | |
1905 | + | let openInterestNotionalAfter = $t08021680711._8 | |
1906 | + | let exchangedQuoteAssetAmount = $t08021680711._9 | |
1907 | + | let totalLongAfter = $t08021680711._10 | |
1908 | + | let totalShortAfter = $t08021680711._11 | |
1909 | + | let totalLongOpenInterestAfter = $t08021680711._12 | |
1910 | + | let totalShortOpenInterestAfter = $t08021680711._13 | |
1910 | 1911 | let liquidationPenalty = muld(exchangedQuoteAssetAmount, liquidationFeeRatio()) | |
1911 | 1912 | let feeToLiquidator = (liquidationPenalty / 2) | |
1912 | 1913 | let feeToVault = (liquidationPenalty - feeToLiquidator) | |
1913 | 1914 | let ammBalance = (cbalance() - liquidationPenalty) | |
1914 | - | let $ | |
1915 | + | let $t08111981248 = if ((0 > ammBalance)) | |
1915 | 1916 | then $Tuple2(0, abs(ammBalance)) | |
1916 | 1917 | else $Tuple2(ammBalance, 0) | |
1917 | - | let newAmmBalance = $ | |
1918 | - | let x11 = $ | |
1919 | - | let $ | |
1920 | - | let borrowed = $ | |
1921 | - | let assetId = $ | |
1918 | + | let newAmmBalance = $t08111981248._1 | |
1919 | + | let x11 = $t08111981248._2 | |
1920 | + | let $t08125681310 = getBorrowedByTrader(_trader) | |
1921 | + | let borrowed = $t08125681310._1 | |
1922 | + | let assetId = $t08125681310._2 | |
1922 | 1923 | let doLiquidateCollateral = if ((borrowed > 0)) | |
1923 | 1924 | then { | |
1924 | 1925 | let realizeAndClose = invoke(collateralAddress(), "realizePartiallyAndClose", [_trader, 0, assetId], nil) | |
1925 | 1926 | if ((realizeAndClose == realizeAndClose)) | |
1926 | 1927 | then nil | |
1927 | 1928 | else throw("Strict value is not equal to itself.") | |
1928 | 1929 | } | |
1929 | 1930 | else nil | |
1930 | 1931 | if ((doLiquidateCollateral == doLiquidateCollateral)) | |
1931 | 1932 | then { | |
1932 | 1933 | let x = if ((badDebt > 0)) | |
1933 | 1934 | then { | |
1934 | 1935 | let lockBadDebt = invoke(vaultAddress(), "exchangeFreeAndLocked", [badDebt], nil) | |
1935 | 1936 | if ((lockBadDebt == lockBadDebt)) | |
1936 | 1937 | then nil | |
1937 | 1938 | else throw("Strict value is not equal to itself.") | |
1938 | 1939 | } | |
1939 | 1940 | else nil | |
1940 | 1941 | if ((x == x)) | |
1941 | 1942 | then { | |
1942 | 1943 | let unstake = invoke(vaultAddress(), "withdrawLocked", [liquidationPenalty], nil) | |
1943 | 1944 | if ((unstake == unstake)) | |
1944 | 1945 | then { | |
1945 | 1946 | let depositInsurance = invoke(vaultAddress(), "addFree", nil, [AttachedPayment(quoteAsset(), feeToVault)]) | |
1946 | 1947 | if ((depositInsurance == depositInsurance)) | |
1947 | 1948 | then { | |
1948 | 1949 | let notifyNotional = invoke(minerAddress(), "notifyNotional", [_trader, 0], nil) | |
1949 | 1950 | if ((notifyNotional == notifyNotional)) | |
1950 | 1951 | then (((deletePosition(_trader) ++ updateAmm(quoteAssetReserveAfter, baseAssetReserveAfter, totalPositionSizeAfter, openInterestNotionalAfter, totalLongAfter, totalShortAfter, totalLongOpenInterestAfter, totalShortOpenInterestAfter)) ++ withdraw(i.caller, feeToLiquidator)) ++ updateBalance(newAmmBalance)) | |
1951 | 1952 | else throw("Strict value is not equal to itself.") | |
1952 | 1953 | } | |
1953 | 1954 | else throw("Strict value is not equal to itself.") | |
1954 | 1955 | } | |
1955 | 1956 | else throw("Strict value is not equal to itself.") | |
1956 | 1957 | } | |
1957 | 1958 | else throw("Strict value is not equal to itself.") | |
1958 | 1959 | } | |
1959 | 1960 | else throw("Strict value is not equal to itself.") | |
1960 | 1961 | } | |
1961 | 1962 | } | |
1962 | 1963 | else throw("Strict value is not equal to itself.") | |
1963 | 1964 | } | |
1964 | 1965 | ||
1965 | 1966 | ||
1966 | 1967 | ||
1967 | 1968 | @Callable(i) | |
1968 | 1969 | func payFunding () = { | |
1969 | 1970 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
1970 | 1971 | if ((sync == sync)) | |
1971 | 1972 | then { | |
1972 | 1973 | let fundingBlockTimestamp = nextFundingBlockTimestamp() | |
1973 | 1974 | if (if (if ((fundingBlockTimestamp > lastBlock.timestamp)) | |
1974 | 1975 | then true | |
1975 | 1976 | else !(initialized())) | |
1976 | 1977 | then true | |
1977 | 1978 | else paused()) | |
1978 | 1979 | then throw(((("Invalid funding block timestamp: " + toString(lastBlock.timestamp)) + " < ") + toString(fundingBlockTimestamp))) | |
1979 | 1980 | else { | |
1980 | 1981 | let underlyingPrice = getOraclePrice() | |
1981 | - | let $ | |
1982 | - | let shortPremiumFraction = $ | |
1983 | - | let longPremiumFraction = $ | |
1982 | + | let $t08318283244 = getFunding() | |
1983 | + | let shortPremiumFraction = $t08318283244._1 | |
1984 | + | let longPremiumFraction = $t08318283244._2 | |
1984 | 1985 | updateFunding((fundingBlockTimestamp + fundingPeriodSeconds()), (latestLongCumulativePremiumFraction() + longPremiumFraction), (latestShortCumulativePremiumFraction() + shortPremiumFraction), divd(longPremiumFraction, underlyingPrice), divd(shortPremiumFraction, underlyingPrice)) | |
1985 | 1986 | } | |
1986 | 1987 | } | |
1987 | 1988 | else throw("Strict value is not equal to itself.") | |
1988 | 1989 | } | |
1989 | 1990 | ||
1990 | 1991 | ||
1991 | 1992 | ||
1992 | 1993 | @Callable(i) | |
1993 | 1994 | func syncTerminalPriceToOracle () = { | |
1994 | 1995 | let _qtAstR = qtAstR() | |
1995 | 1996 | let _bsAstR = bsAstR() | |
1996 | - | let $ | |
1997 | - | let newQuoteAssetWeight = $ | |
1998 | - | let newBaseAssetWeight = $ | |
1999 | - | let marginToVault = $ | |
1997 | + | let $t08367683811 = getSyncTerminalPrice(getOraclePrice(), _qtAstR, _bsAstR) | |
1998 | + | let newQuoteAssetWeight = $t08367683811._1 | |
1999 | + | let newBaseAssetWeight = $t08367683811._2 | |
2000 | + | let marginToVault = $t08367683811._3 | |
2000 | 2001 | let doExchangePnL = if ((marginToVault != 0)) | |
2001 | 2002 | then { | |
2002 | 2003 | let doExchangePnL = invoke(vaultAddress(), "exchangeFreeAndLocked", [marginToVault], nil) | |
2003 | 2004 | if ((doExchangePnL == doExchangePnL)) | |
2004 | 2005 | then nil | |
2005 | 2006 | else throw("Strict value is not equal to itself.") | |
2006 | 2007 | } | |
2007 | 2008 | else nil | |
2008 | 2009 | if ((doExchangePnL == doExchangePnL)) | |
2009 | 2010 | then (updateAmmWeights(newQuoteAssetWeight, newBaseAssetWeight) ++ appendTwap(divd(muld(_qtAstR, newQuoteAssetWeight), muld(_bsAstR, newBaseAssetWeight)))) | |
2010 | 2011 | else throw("Strict value is not equal to itself.") | |
2011 | 2012 | } | |
2012 | 2013 | ||
2013 | 2014 | ||
2014 | 2015 | ||
2015 | 2016 | @Callable(i) | |
2016 | 2017 | func view_calcRemainMarginWithFundingPayment (_trader) = { | |
2017 | 2018 | let sync = invoke(this, "syncTerminalPriceToOracle", nil, nil) | |
2018 | 2019 | if ((sync == sync)) | |
2019 | 2020 | then { | |
2020 | - | let $ | |
2021 | - | let positionSize = $ | |
2022 | - | let positionMargin = $ | |
2023 | - | let pon = $ | |
2024 | - | let positionLstUpdCPF = $ | |
2025 | - | let $ | |
2026 | - | let positionNotional = $ | |
2027 | - | let unrealizedPnl = $ | |
2028 | - | let $ | |
2029 | - | let remainMargin = $ | |
2030 | - | let badDebt = $ | |
2031 | - | let fundingPayment = $ | |
2021 | + | let $t08438084481 = getPosition(_trader) | |
2022 | + | let positionSize = $t08438084481._1 | |
2023 | + | let positionMargin = $t08438084481._2 | |
2024 | + | let pon = $t08438084481._3 | |
2025 | + | let positionLstUpdCPF = $t08438084481._4 | |
2026 | + | let $t08448484585 = getPositionNotionalAndUnrealizedPnl(_trader, PNL_OPTION_SPOT) | |
2027 | + | let positionNotional = $t08448484585._1 | |
2028 | + | let unrealizedPnl = $t08448484585._2 | |
2029 | + | let $t08458884760 = calcRemainMarginWithFundingPayment(positionSize, positionMargin, positionLstUpdCPF, unrealizedPnl) | |
2030 | + | let remainMargin = $t08458884760._1 | |
2031 | + | let badDebt = $t08458884760._2 | |
2032 | + | let fundingPayment = $t08458884760._3 | |
2032 | 2033 | throw((((((s(remainMargin) + s(fundingPayment)) + s(getMarginRatio(_trader))) + s(unrealizedPnl)) + s(badDebt)) + s(positionNotional))) | |
2033 | 2034 | } | |
2034 | 2035 | else throw("Strict value is not equal to itself.") | |
2035 | 2036 | } | |
2036 | 2037 | ||
2037 | 2038 | ||
2038 | 2039 | ||
2039 | 2040 | @Callable(i) | |
2040 | 2041 | func view_getPegAdjustCost (_price) = { | |
2041 | 2042 | let _qtAstR = qtAstR() | |
2042 | 2043 | let _bsAstR = bsAstR() | |
2043 | 2044 | let result = getSyncTerminalPrice(_price, _qtAstR, _bsAstR) | |
2044 | 2045 | throw(toString(result._3)) | |
2045 | 2046 | } | |
2046 | 2047 | ||
2047 | 2048 | ||
2048 | 2049 | ||
2049 | 2050 | @Callable(i) | |
2050 | 2051 | func view_getTerminalAmmPrice () = { | |
2051 | - | let $ | |
2052 | - | let terminalQuoteAssetReserve = $ | |
2053 | - | let terminalBaseAssetReserve = $ | |
2052 | + | let $t08517685257 = getTerminalAmmState() | |
2053 | + | let terminalQuoteAssetReserve = $t08517685257._1 | |
2054 | + | let terminalBaseAssetReserve = $t08517685257._2 | |
2054 | 2055 | let price = divd(muld(terminalQuoteAssetReserve, qtAstW()), muld(terminalBaseAssetReserve, bsAstW())) | |
2055 | 2056 | throw(toString(price)) | |
2056 | 2057 | } | |
2057 | 2058 | ||
2058 | 2059 | ||
2059 | 2060 | ||
2060 | 2061 | @Callable(i) | |
2061 | 2062 | func view_getFunding () = { | |
2062 | 2063 | let underlyingPrice = getOraclePrice() | |
2063 | - | let $ | |
2064 | - | let shortPremiumFraction = $ | |
2065 | - | let longPremiumFraction = $ | |
2064 | + | let $t08547285534 = getFunding() | |
2065 | + | let shortPremiumFraction = $t08547285534._1 | |
2066 | + | let longPremiumFraction = $t08547285534._2 | |
2066 | 2067 | let longFunding = divd(longPremiumFraction, underlyingPrice) | |
2067 | 2068 | let shortFunding = divd(shortPremiumFraction, underlyingPrice) | |
2068 | 2069 | throw((((s(longFunding) + s(shortFunding)) + s(getTwapSpotPrice())) + s(getOraclePrice()))) | |
2069 | 2070 | } | |
2070 | 2071 | ||
2071 | 2072 | ||
2072 | 2073 | ||
2073 | 2074 | @Callable(i) | |
2074 | 2075 | func view_getBorrowedByTrader (_trader) = { | |
2075 | - | let $ | |
2076 | - | let borrowed = $ | |
2077 | - | let assetId = $ | |
2076 | + | let $t08582085874 = getBorrowedByTrader(_trader) | |
2077 | + | let borrowed = $t08582085874._1 | |
2078 | + | let assetId = $t08582085874._2 | |
2078 | 2079 | throw((s(borrowed) + assetId)) | |
2079 | 2080 | } | |
2080 | 2081 | ||
2081 | 2082 | ||
2082 | 2083 | ||
2083 | 2084 | @Callable(i) | |
2084 | 2085 | func computeSpotPrice () = { | |
2085 | 2086 | let result = getSpotPrice() | |
2086 | 2087 | $Tuple2(nil, result) | |
2087 | 2088 | } | |
2088 | 2089 | ||
2089 | 2090 | ||
2090 | 2091 | ||
2091 | 2092 | @Callable(i) | |
2092 | 2093 | func computeFeeForTraderWithArtifact (_trader,_artifactId) = { | |
2093 | 2094 | let result = getForTraderWithArtifact(_trader, _artifactId) | |
2094 | 2095 | $Tuple2(nil, result) | |
2095 | 2096 | } | |
2096 | 2097 | ||
2097 | 2098 | ||
2098 | 2099 | @Verifier(tx) | |
2099 | 2100 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], adminPublicKey()) | |
2100 | 2101 |
github/deemru/w8io/026f985 317.27 ms ◑