diff --git a/package.json b/package.json index 13978e1415..c04961ee95 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "tscheck": "yarn ts:clean && tsc -p tsconfig.json --noEmit", "prettier": "prettier --write src/**/*.{js,ts,jsx,tsx,css,scss}", "typechain": "typechain --target ethers-v6 --out-dir ./src/typechain-types './sdk/src/abis/*.json'", + "typechain:stargate": "typechain --target ethers-v6 --out-dir ./src/typechain-types-stargate './node_modules/@stargatefinance/stg-evm-sdk-v2/artifacts/src/interfaces/IStargate.sol/IStargate.json'", "postinstall": "yarn typechain && cd ./sdk && echo \"Building SDK\" && yarn && yarn build", "prebuild": "cd ./sdk && yarn tsx scripts/prebuild" }, @@ -40,10 +41,12 @@ "@gelatonetwork/relay-sdk": "5.6.0", "@gemini-wallet/rainbow": "0.2.0", "@headlessui/react": "1.7.19", + "@layerzerolabs/lz-v2-utilities": "3.0.85", "@lingui/core": "4.10.0", "@lingui/macro": "4.11.3", "@lingui/react": "4.10.0", "@rainbow-me/rainbowkit": "2.2.0", + "@stargatefinance/stg-evm-sdk-v2": "1.1.12", "@tanstack/react-query": "5.25.0", "@taskworld.com/rereselect": "0.3.0", "@testing-library/jest-dom": "5.16.1", @@ -96,10 +99,10 @@ "reselect": "5.1.0", "sass": "1.55.0", "shallowequal": "1.1.0", - "swr": "2.2.1", + "swr": "2.3.3", "typescript": "5.4.2", "use-context-selector": "1.4.1", - "viem": "2.7.20", + "viem": "2.26.2", "wagmi": "2.12.29", "web-vitals": "1.1.2", "worker-loader": "3.0.8" diff --git a/sdk/package.json b/sdk/package.json index 6807d925eb..61ff09ce99 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -72,7 +72,7 @@ "query-string": "7.1.1", "typescript": "5.4.2", "universal-perf-hooks": "1.0.1", - "viem": "^2.7.20" + "viem": "^2.26.2" }, "devDependencies": { "@babel/plugin-proposal-private-property-in-object": "7.21.11", diff --git a/sdk/src/abis/ClaimHandler.json b/sdk/src/abis/ClaimHandler.json index ce09bca5cc..b38721ec29 100644 --- a/sdk/src/abis/ClaimHandler.json +++ b/sdk/src/abis/ClaimHandler.json @@ -1,5 +1,5 @@ { - "abi": [ + "abi": [ { "inputs": [ { @@ -420,20 +420,5 @@ "stateMutability": "nonpayable", "type": "function" } - ], - "libraries": {}, - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } - } + ] +} diff --git a/sdk/src/abis/CustomErrors.json b/sdk/src/abis/CustomErrors.json index 6e9f068195..0124d633c5 100644 --- a/sdk/src/abis/CustomErrors.json +++ b/sdk/src/abis/CustomErrors.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Errors", - "sourceName": "contracts/error/Errors.sol", "abi": [ { "inputs": [], @@ -113,6 +110,11 @@ "name": "BlockNumbersNotSorted", "type": "error" }, + { + "inputs": [], + "name": "BridgeOutNotSupportedDuringShift", + "type": "error" + }, { "inputs": [ { @@ -208,6 +210,11 @@ "name": "ConfigValueExceedsAllowedRange", "type": "error" }, + { + "inputs": [], + "name": "DataListLengthExceeded", + "type": "error" + }, { "inputs": [ { @@ -268,6 +275,17 @@ "name": "DisabledMarket", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "existingDistributionId", + "type": "uint256" + } + ], + "name": "DuplicateClaimTerms", + "type": "error" + }, { "inputs": [ { @@ -295,6 +313,17 @@ "name": "DuplicatedMarketInSwapPath", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EdgeDataStreamIdAlreadyExistsForToken", + "type": "error" + }, { "inputs": [], "name": "EmptyAccount", @@ -318,7 +347,7 @@ }, { "inputs": [], - "name": "EmptyChainlinkPaymentToken", + "name": "EmptyAmount", "type": "error" }, { @@ -348,6 +377,17 @@ "name": "EmptyClaimFeesMarket", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyClaimableAmount", + "type": "error" + }, { "inputs": [ { @@ -385,6 +425,11 @@ "name": "EmptyDepositAmountsAfterSwap", "type": "error" }, + { + "inputs": [], + "name": "EmptyFundingAccount", + "type": "error" + }, { "inputs": [ { @@ -452,6 +497,38 @@ "name": "EmptyMarketTokenSupply", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyMultichainTransferInAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyMultichainTransferOutAmount", + "type": "error" + }, { "inputs": [], "name": "EmptyOrder", @@ -462,6 +539,11 @@ "name": "EmptyPosition", "type": "error" }, + { + "inputs": [], + "name": "EmptyPositionImpactWithdrawalAmount", + "type": "error" + }, { "inputs": [ { @@ -478,6 +560,11 @@ "name": "EmptyReceiver", "type": "error" }, + { + "inputs": [], + "name": "EmptyReduceLentAmount", + "type": "error" + }, { "inputs": [], "name": "EmptyRelayFeeAddress", @@ -498,6 +585,16 @@ "name": "EmptySizeDeltaInTokens", "type": "error" }, + { + "inputs": [], + "name": "EmptyTarget", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyToken", + "type": "error" + }, { "inputs": [ { @@ -529,6 +626,17 @@ "name": "EndOfOracleSimulation", "type": "error" }, + { + "inputs": [ + { + "internalType": "string", + "name": "key", + "type": "string" + } + ], + "name": "EventItemNotFound", + "type": "error" + }, { "inputs": [ { @@ -1129,6 +1237,33 @@ "name": "InsufficientExecutionGasForErrorHandling", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeProvided", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "feeRequired", + "type": "uint256" + } + ], + "name": "InsufficientFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InsufficientFunds", + "type": "error" + }, { "inputs": [ { @@ -1145,6 +1280,22 @@ "name": "InsufficientFundsToPayForCosts", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minHandleExecutionErrorGas", + "type": "uint256" + } + ], + "name": "InsufficientGasForAutoCancellation", + "type": "error" + }, { "inputs": [ { @@ -1161,6 +1312,22 @@ "name": "InsufficientGasForCancellation", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimatedGasLimit", + "type": "uint256" + } + ], + "name": "InsufficientGasLeft", + "type": "error" + }, { "inputs": [ { @@ -1193,6 +1360,27 @@ "name": "InsufficientHandleExecutionErrorGas", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "withdrawalAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "poolValue", + "type": "uint256" + }, + { + "internalType": "int256", + "name": "totalPendingImpactAmount", + "type": "int256" + } + ], + "name": "InsufficientImpactPoolValueForWithdrawal", + "type": "error" + }, { "inputs": [ { @@ -1209,6 +1397,32 @@ "name": "InsufficientMarketTokens", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientMultichainBalance", + "type": "error" + }, { "inputs": [ { @@ -1305,22 +1519,6 @@ "name": "InsufficientSwapOutputAmount", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "wntAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - } - ], - "name": "InsufficientWntAmount", - "type": "error" - }, { "inputs": [ { @@ -1396,6 +1594,17 @@ "name": "InvalidBlockRangeSet", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InvalidBridgeOutToken", + "type": "error" + }, { "inputs": [ { @@ -1476,6 +1685,33 @@ "name": "InvalidClaimFundingFeesInput", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "recoveredSigner", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSigner", + "type": "address" + } + ], + "name": "InvalidClaimTermsSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "expectedSigner", + "type": "address" + } + ], + "name": "InvalidClaimTermsSignatureForContract", + "type": "error" + }, { "inputs": [ { @@ -1503,6 +1739,17 @@ "name": "InvalidClaimableFactor", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "InvalidClaimableReductionFactor", + "type": "error" + }, { "inputs": [ { @@ -1569,7 +1816,114 @@ "type": "bytes32" } ], - "name": "InvalidDataStreamFeedId", + "name": "InvalidDataStreamFeedId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "int192", + "name": "bid", + "type": "int192" + }, + { + "internalType": "int192", + "name": "ask", + "type": "int192" + } + ], + "name": "InvalidDataStreamPrices", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "spreadReductionFactor", + "type": "uint256" + } + ], + "name": "InvalidDataStreamSpreadReductionFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionSizeInUsd", + "type": "uint256" + } + ], + "name": "InvalidDecreaseOrderSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "decreasePositionSwapType", + "type": "uint256" + } + ], + "name": "InvalidDecreasePositionSwapType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "bid", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ask", + "type": "uint256" + } + ], + "name": "InvalidEdgeDataStreamBidAsk", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "int256", + "name": "expo", + "type": "int256" + } + ], + "name": "InvalidEdgeDataStreamExpo", "type": "error" }, { @@ -1580,60 +1934,44 @@ "type": "address" }, { - "internalType": "int192", + "internalType": "uint256", "name": "bid", - "type": "int192" + "type": "uint256" }, { - "internalType": "int192", + "internalType": "uint256", "name": "ask", - "type": "int192" + "type": "uint256" } ], - "name": "InvalidDataStreamPrices", + "name": "InvalidEdgeDataStreamPrices", "type": "error" }, { "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, { "internalType": "uint256", - "name": "spreadReductionFactor", + "name": "recoverError", "type": "uint256" } ], - "name": "InvalidDataStreamSpreadReductionFactor", + "name": "InvalidEdgeSignature", "type": "error" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "positionSizeInUsd", - "type": "uint256" - } - ], - "name": "InvalidDecreaseOrderSize", + "inputs": [], + "name": "InvalidEdgeSigner", "type": "error" }, { "inputs": [ { "internalType": "uint256", - "name": "decreasePositionSwapType", + "name": "eid", "type": "uint256" } ], - "name": "InvalidDecreasePositionSwapType", + "name": "InvalidEid", "type": "error" }, { @@ -1888,6 +2226,22 @@ "name": "InvalidGmSignerMinMaxPrice", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "InvalidHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitializer", + "type": "error" + }, { "inputs": [ { @@ -2030,6 +2384,28 @@ "name": "InvalidMinMaxForPrice", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "InvalidMultichainEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "InvalidMultichainProvider", + "type": "error" + }, { "inputs": [ { @@ -2104,7 +2480,7 @@ "inputs": [ { "internalType": "address", - "name": "receiver", + "name": "signer", "type": "address" } ], @@ -2153,6 +2529,17 @@ "name": "InvalidOutputToken", "type": "error" }, + { + "inputs": [ + { + "internalType": "string", + "name": "reason", + "type": "string" + } + ], + "name": "InvalidParams", + "type": "error" + }, { "inputs": [ { @@ -2191,6 +2578,22 @@ "name": "InvalidPoolValueForWithdrawal", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "distributionAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "positionImpactPoolAmount", + "type": "uint256" + } + ], + "name": "InvalidPositionImpactPoolDistributionRate", + "type": "error" + }, { "inputs": [ { @@ -2293,6 +2696,32 @@ "name": "InvalidReceiverForSubaccountOrder", "type": "error" }, + { + "inputs": [ + { + "internalType": "string", + "name": "signatureType", + "type": "string" + }, + { + "internalType": "address", + "name": "recovered", + "type": "address" + }, + { + "internalType": "address", + "name": "recoveredFromMinified", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSigner", + "type": "address" + } + ], + "name": "InvalidRecoveredSigner", + "type": "error" + }, { "inputs": [ { @@ -2352,6 +2781,28 @@ "name": "InvalidSizeDeltaForAdl", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidSubaccountApprovalDesChainId", + "type": "error" + }, { "inputs": [ { @@ -2427,6 +2878,17 @@ "name": "InvalidTimelockDelay", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InvalidToken", + "type": "error" + }, { "inputs": [ { @@ -2443,6 +2905,16 @@ "name": "InvalidTokenIn", "type": "error" }, + { + "inputs": [], + "name": "InvalidTransferRequestsLength", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTrustedSignerAddress", + "type": "error" + }, { "inputs": [ { @@ -2462,17 +2934,12 @@ { "inputs": [ { - "internalType": "uint256", - "name": "storedUserNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" } ], - "name": "InvalidUserNonce", + "name": "InvalidUserDigest", "type": "error" }, { @@ -2624,6 +3091,22 @@ "name": "MaxCallbackGasLimitExceeded", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "dataLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxDataLength", + "type": "uint256" + } + ], + "name": "MaxDataListLengthExceeded", + "type": "error" + }, { "inputs": [ { @@ -2640,6 +3123,27 @@ "name": "MaxFundingFactorPerSecondLimitExceeded", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "poolUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLendableUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lentUsd", + "type": "uint256" + } + ], + "name": "MaxLendableFactorForWithdrawalsExceeded", + "type": "error" + }, { "inputs": [ { @@ -3023,8 +3527,18 @@ "name": "OpenInterestCannotBeUpdatedForSwapOnlyMarket", "type": "error" }, + { + "inputs": [], + "name": "OraclePriceOutdated", + "type": "error" + }, { "inputs": [ + { + "internalType": "address", + "name": "oracle", + "type": "address" + }, { "internalType": "address", "name": "token", @@ -3034,6 +3548,22 @@ "name": "OracleProviderAlreadyExistsForToken", "type": "error" }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "OracleProviderMinChangeDelayNotYetPassed", + "type": "error" + }, { "inputs": [ { @@ -3274,6 +3804,22 @@ "name": "PriceImpactLargerThanOrderSize", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "lentAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "totalReductionAmount", + "type": "uint256" + } + ], + "name": "ReductionExceedsLentAmount", + "type": "error" + }, { "inputs": [ { @@ -3434,6 +3980,17 @@ "name": "SubaccountApprovalExpired", "type": "error" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + } + ], + "name": "SubaccountIntegrationIdDisabled", + "type": "error" + }, { "inputs": [ { @@ -3562,6 +4119,11 @@ "name": "ThereMustBeAtLeastOneTimelockMultiSig", "type": "error" }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, { "inputs": [ { @@ -3636,6 +4198,16 @@ "name": "UnableToGetOppositeToken", "type": "error" }, + { + "inputs": [], + "name": "UnableToPayOrderFee", + "type": "error" + }, + { + "inputs": [], + "name": "UnableToPayOrderFeeFromCollateral", + "type": "error" + }, { "inputs": [ { @@ -3770,6 +4342,17 @@ "name": "UnsupportedOrderType", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "orderType", + "type": "uint256" + } + ], + "name": "UnsupportedOrderTypeForAutoCancellation", + "type": "error" + }, { "inputs": [ { @@ -3845,7 +4428,5 @@ "name": "WithdrawalNotFound", "type": "error" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} + ] } diff --git a/sdk/src/abis/DataStore.json b/sdk/src/abis/DataStore.json index ed8b75aa3b..af4759dd50 100644 --- a/sdk/src/abis/DataStore.json +++ b/sdk/src/abis/DataStore.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "DataStore", - "sourceName": "contracts/data/DataStore.sol", "abi": [ { "inputs": [ @@ -204,6 +201,30 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "applyDeltaToUint", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -1434,7 +1455,5 @@ "stateMutability": "view", "type": "function" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} + ] } diff --git a/sdk/src/abis/EventEmitter.json b/sdk/src/abis/EventEmitter.json index 66eb07810f..db462aed3f 100644 --- a/sdk/src/abis/EventEmitter.json +++ b/sdk/src/abis/EventEmitter.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "EventEmitter", - "sourceName": "contracts/event/EventEmitter.sol", "abi": [ { "inputs": [ @@ -2059,7 +2056,5 @@ "stateMutability": "view", "type": "function" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} + ] } diff --git a/sdk/src/abis/ExchangeRouter.json b/sdk/src/abis/ExchangeRouter.json index 20265119c3..34c56df37c 100644 --- a/sdk/src/abis/ExchangeRouter.json +++ b/sdk/src/abis/ExchangeRouter.json @@ -1,5 +1,4 @@ { - "address": "0x69C527fC77291722b52649E45c838e41be8Bf5d5", "abi": [ { "inputs": [ @@ -142,22 +141,6 @@ "name": "EmptyTokenTranferGasLimit", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimAffiliateRewardsInput", - "type": "error" - }, { "inputs": [ { @@ -179,38 +162,6 @@ "name": "InvalidClaimCollateralInput", "type": "error" }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimFundingFeesInput", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "marketsLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensLength", - "type": "uint256" - } - ], - "name": "InvalidClaimUiFeesInput", - "type": "error" - }, { "inputs": [ { @@ -353,6 +304,25 @@ "name": "Unauthorized", "type": "error" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, { "inputs": [ { @@ -531,44 +501,51 @@ { "components": [ { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IDepositUtils.CreateDepositParamsAddresses", + "name": "addresses", + "type": "tuple" }, { "internalType": "uint256", @@ -589,9 +566,14 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], - "internalType": "struct DepositUtils.CreateDepositParams", + "internalType": "struct IDepositUtils.CreateDepositParams", "name": "params", "type": "tuple" } @@ -729,6 +711,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams", @@ -752,29 +739,36 @@ { "components": [ { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct IShiftUtils.CreateShiftParamsAddresses", + "name": "addresses", + "type": "tuple" }, { "internalType": "uint256", @@ -790,9 +784,14 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], - "internalType": "struct ShiftUtils.CreateShiftParams", + "internalType": "struct IShiftUtils.CreateShiftParams", "name": "params", "type": "tuple" } @@ -813,34 +812,41 @@ { "components": [ { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + "name": "addresses", + "type": "tuple" }, { "internalType": "uint256", @@ -866,9 +872,14 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], - "internalType": "struct WithdrawalUtils.CreateWithdrawalParams", + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", "name": "params", "type": "tuple" } @@ -928,34 +939,41 @@ { "components": [ { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + "name": "addresses", + "type": "tuple" }, { "internalType": "uint256", @@ -981,9 +999,14 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], - "internalType": "struct WithdrawalUtils.CreateWithdrawalParams", + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", "name": "params", "type": "tuple" }, @@ -1053,7 +1076,7 @@ ], "name": "makeExternalCalls", "outputs": [], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { @@ -1679,123 +1702,5 @@ "stateMutability": "view", "type": "function" } - ], - "transactionHash": "0x723bba33993a46238da285f8900a6c411564432b8af409c3dc8d3b1f6d5c7167", - "receipt": { - "to": null, - "from": "0xE7BfFf2aB721264887230037940490351700a068", - "contractAddress": "0x69C527fC77291722b52649E45c838e41be8Bf5d5", - "transactionIndex": 6, - "gasUsed": "6362339", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xd18c90532e420963f4dc93793b032a792fdde7171138710bc41c4088e2aa5d59", - "transactionHash": "0x723bba33993a46238da285f8900a6c411564432b8af409c3dc8d3b1f6d5c7167", - "logs": [], - "blockNumber": 222747030, - "cumulativeGasUsed": "6942059", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", - "0x3c3d99FD298f679DBC2CEcd132b4eC4d0F5e6e72", - "0xFD70de6b91282D8017aA4E741e9Ae325CAb992d8", - "0xC8ee91A54287DB53897056e12D9819156D3822Fb", - "0x321f3739983CC3E911fd67a83d1ee76238894Bd0", - "0xA19fA3F0D8E7b7A8963420De504b624167e709B2", - "0xEa90EC1228F7D1b3D47D84d1c9D46dBDFEfF7709", - "0xB0Fc2a48b873da40e7bc25658e5E6137616AC2Ee", - "0x389CEf541397e872dC04421f166B5Bc2E0b374a5" - ], - "numDeployments": 6, - "solcInputHash": "292dd15f99d7c1e4e4b27476672071d7", - "libraries": { - "CallbackUtils": "0x501e34E31f1594ffbd3D0C17634D6de6C6C5c7A3", - "DepositStoreUtils": "0x3063A99D2df2A871068D47041eB8d089E5DE1Cdc", - "FeeUtils": "0x7Fd8d13A778a22F5c2acB67226A193C7d0b0a336", - "MarketEventUtils": "0x1F493E17bcF5390d3e5E49eE0bce17d4d068f90b", - "MarketStoreUtils": "0xbbf05cF8e1c6548092A6a02c4c5330E76BF0fE2D", - "OrderStoreUtils": "0x67040c411C1b3195361801E9Ad8a91D1Fe9C0BC2", - "ReferralUtils": "0x27346Fdab142e2b8B6C6d2ecFe73e75B5e249A57", - "ShiftStoreUtils": "0xCfad9CB2a681b63884AEf98af28458692137c9E3", - "WithdrawalStoreUtils": "0xD521Cb31B14bB9F70D9a59b47D8763336CAD0395" - }, - "devdoc": { - "details": "Router for exchange functions, supports functions which require token transfers from the user IMPORTANT: PayableMulticall uses delegatecall, msg.value will be the same for each delegatecall extra care should be taken when using msg.value in any of the functions in this contract To avoid front-running issues, most actions require two steps to execute: - User sends transaction with request details, e.g. deposit / withdraw liquidity, swap, increase / decrease position - Keepers listen for the transactions, include the prices for the request then send a transaction to execute the request Prices are provided by an off-chain oracle system: - Oracle keepers continually check the latest blocks - When there is a new block, oracle keepers fetch the latest prices from reference exchanges - Oracle keepers then sign the median price for each token together with the block hash - Oracle keepers then send the data and signature to archive nodes - Archive nodes display this information for anyone to query Example: - Block 100 is finalized on the blockchain - Oracle keepers observe this block - Oracle keepers pull the latest prices from reference exchanges, token A: price 20,000, token B: price 80,000 - Oracle keepers sign [chainId, blockhash(100), 20,000], [chainId, blockhash(100), 80,000] - If in block 100, there was a market order to open a long position for token A, the market order would have a block number of 100 - The prices signed at block 100 can be used to execute this order - Order keepers would bundle the signature and price data for token A then execute the order", - "kind": "dev", - "methods": { - "cancelOrder(bytes32)": { - "details": "Cancels the given order. The `cancelOrder()` feature must be enabled for the given order type. The caller must be the owner of the order, and the order must not be a market order. The order is cancelled by calling the `cancelOrder()` function in the `OrderUtils` contract. This function also records the starting gas amount and the reason for cancellation, which is passed to the `cancelOrder()` function.", - "params": { - "key": "The unique ID of the order to be cancelled" - } - }, - "claimAffiliateRewards(address[],address[],address)": { - "details": "Claims affiliate rewards for the given markets and tokens on behalf of the caller, and sends the rewards to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimAffiliateReward()` function in the `ReferralUtils` contract is called to claim the rewards for the caller.", - "params": { - "markets": "An array of market addresses", - "receiver": "The address to which the claimed rewards should be sent", - "tokens": "An array of token addresses, corresponding to the given markets" - } - }, - "claimFundingFees(address[],address[],address)": { - "details": "Claims funding fees for the given markets and tokens on behalf of the caller, and sends the fees to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimFundingFees()` function in the `MarketUtils` contract is called to claim the fees for the caller.", - "params": { - "markets": "An array of market addresses", - "receiver": "The address to which the claimed fees should be sent", - "tokens": "An array of token addresses, corresponding to the given markets" - } - }, - "createDeposit((address,address,address,address,address,address,address[],address[],uint256,bool,uint256,uint256))": { - "details": "Creates a new deposit with the given long token, short token, long token amount, short token amount, and deposit parameters. The deposit is created by transferring the specified amounts of long and short tokens from the caller's account to the deposit store, and then calling the `createDeposit()` function on the deposit handler contract.", - "params": { - "params": "The deposit parameters, as specified in the `DepositUtils.CreateDepositParams` struct" - }, - "returns": { - "_0": "The unique ID of the newly created deposit" - } - }, - "createOrder(((address,address,address,address,address,address,address[]),(uint256,uint256,uint256,uint256,uint256,uint256,uint256),uint8,uint8,bool,bool,bool,bytes32))": { - "details": "Creates a new order with the given amount, order parameters. The order is created by transferring the specified amount of collateral tokens from the caller's account to the order store, and then calling the `createOrder()` function on the order handler contract. The referral code is also set on the caller's account using the referral storage contract." - }, - "multicall(bytes[])": { - "details": "Receives and executes a batch of function calls on this contract." - }, - "updateOrder(bytes32,uint256,uint256,uint256,uint256,bool)": { - "details": "Updates the given order with the specified size delta, acceptable price, and trigger price. The `updateOrder()` feature must be enabled for the given order type. The caller must be the owner of the order, and the order must not be a market order. The size delta, trigger price, and acceptable price are updated on the order, and the order is unfrozen. Any additional WNT that is transferred to the contract is added to the order's execution fee. The updated order is then saved in the order store, and an `OrderUpdated` event is emitted.", - "params": { - "acceptablePrice": "The new acceptable price for the order", - "key": "The unique ID of the order to be updated", - "sizeDeltaUsd": "The new size delta for the order", - "triggerPrice": "The new trigger price for the order" - } - } - }, - "title": "ExchangeRouter", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 115, - "contract": "contracts/router/ExchangeRouter.sol:ExchangeRouter", - "label": "_status", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - ], - "types": { - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} + ] +} \ No newline at end of file diff --git a/sdk/src/abis/GelatoRelayRouter.json b/sdk/src/abis/GelatoRelayRouter.json index e11e92f4b7..081aa5dd9d 100644 --- a/sdk/src/abis/GelatoRelayRouter.json +++ b/sdk/src/abis/GelatoRelayRouter.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "GelatoRelayRouter", - "sourceName": "contracts/router/relay/GelatoRelayRouter.sol", "abi": [ { "inputs": [ @@ -10,6 +7,11 @@ "name": "_router", "type": "address" }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, { "internalType": "contract DataStore", "name": "_dataStore", @@ -21,7 +23,7 @@ "type": "address" }, { - "internalType": "contract Oracle", + "internalType": "contract IOracle", "name": "_oracle", "type": "address" }, @@ -35,6 +37,11 @@ "name": "_orderVault", "type": "address" }, + { + "internalType": "contract ISwapHandler", + "name": "_swapHandler", + "type": "address" + }, { "internalType": "contract IExternalHandler", "name": "_externalHandler", @@ -71,6 +78,11 @@ "name": "DisabledFeature", "type": "error" }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, { "inputs": [], "name": "EmptyOrder", @@ -82,8 +94,14 @@ "type": "error" }, { - "inputs": [], - "name": "EmptyRelayFeeAddress", + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", "type": "error" }, { @@ -102,6 +120,17 @@ "name": "InsufficientRelayFee", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, { "inputs": [ { @@ -137,28 +166,23 @@ { "inputs": [ { - "internalType": "string", - "name": "signatureType", - "type": "string" + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" } ], - "name": "InvalidSignature", + "name": "InvalidSrcChainId", "type": "error" }, { "inputs": [ { - "internalType": "uint256", - "name": "storedUserNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" } ], - "name": "InvalidUserNonce", + "name": "InvalidUserDigest", "type": "error" }, { @@ -182,20 +206,35 @@ "name": "NonEmptyExternalCallsForSubaccountOrder", "type": "error" }, + { + "inputs": [], + "name": "RelayEmptyBatch", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, { "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, { "internalType": "uint256", - "name": "calldataLength", + "name": "amount", "type": "uint256" } ], - "name": "RelayCalldataTooLong", - "type": "error" - }, - { - "inputs": [], - "name": "RelayEmptyBatch", + "name": "TokenTransferError", "type": "error" }, { @@ -247,43 +286,23 @@ "type": "error" }, { - "inputs": [], - "name": "DOMAIN_SEPARATOR_NAME_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR_TYPEHASH", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR_VERSION_HASH", - "outputs": [ + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" } ], - "stateMutability": "view", - "type": "function" + "name": "TokenTransferReverted", + "type": "event" }, { "inputs": [ @@ -344,7 +363,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -391,7 +410,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -413,7 +432,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -431,9 +450,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -564,6 +588,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", @@ -613,7 +642,7 @@ "type": "uint256" } ], - "internalType": "struct UpdateOrderParams[]", + "internalType": "struct IRelayUtils.UpdateOrderParams[]", "name": "updateOrderParamsList", "type": "tuple[]" }, @@ -623,7 +652,7 @@ "type": "bytes32[]" } ], - "internalType": "struct BatchParams", + "internalType": "struct IRelayUtils.BatchParams", "name": "params", "type": "tuple" } @@ -698,7 +727,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -745,7 +774,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -767,7 +796,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -785,9 +814,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -866,7 +900,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -913,7 +947,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -935,7 +969,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -953,9 +987,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -1084,6 +1123,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams", @@ -1115,6 +1159,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "eventEmitter", @@ -1141,12 +1204,31 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "oracle", "outputs": [ { - "internalType": "contract Oracle", + "internalType": "contract IOracle", "name": "", "type": "address" } @@ -1180,6 +1262,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "router", @@ -1193,6 +1288,78 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1252,7 +1419,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -1299,7 +1466,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -1321,7 +1488,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -1339,9 +1506,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -1393,7 +1565,7 @@ "type": "uint256" } ], - "internalType": "struct UpdateOrderParams", + "internalType": "struct IRelayUtils.UpdateOrderParams", "name": "params", "type": "tuple" } @@ -1402,25 +1574,6 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userNonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] -} +} \ No newline at end of file diff --git a/sdk/src/abis/GlvReader.json b/sdk/src/abis/GlvReader.json index ab67f5cd1b..e22282986d 100644 --- a/sdk/src/abis/GlvReader.json +++ b/sdk/src/abis/GlvReader.json @@ -1,1415 +1,1471 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "GlvReader", - "sourceName": "contracts/reader/GlvReader.sol", - "abi": [ - { - "inputs": [], - "name": "EmptyMarketTokenSupply", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - } - ], - "name": "GlvNegativeMarketPoolValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountGlvDeposits", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvDeposit.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getAccountGlvWithdrawals", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvWithdrawal.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "getGlv", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - } - ], - "name": "getGlvBySalt", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvDeposit", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvDeposit.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvDeposits", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvDeposit.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvDeposit.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDeposit.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvDeposit.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - } - ], - "name": "getGlvInfo", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "glv", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "internalType": "struct GlvReader.GlvInfo", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvInfoList", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props", - "name": "glv", - "type": "tuple" - }, - { - "internalType": "address[]", - "name": "markets", - "type": "address[]" - } - ], - "internalType": "struct GlvReader.GlvInfo[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvShift", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct GlvShift.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - } - ], - "internalType": "struct GlvShift.Numbers", - "name": "numbers", - "type": "tuple" - } - ], - "internalType": "struct GlvShift.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvShifts", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "fromMarket", - "type": "address" - }, - { - "internalType": "address", - "name": "toMarket", - "type": "address" - } - ], - "internalType": "struct GlvShift.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "marketTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minMarketTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - } - ], - "internalType": "struct GlvShift.Numbers", - "name": "numbers", - "type": "tuple" - } - ], - "internalType": "struct GlvShift.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address[]", - "name": "marketAddresses", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "indexTokenPrices", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getGlvTokenPrice", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "address[]", - "name": "marketAddresses", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "indexTokenPrices", - "type": "tuple[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "longTokenPrice", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props", - "name": "shortTokenPrice", - "type": "tuple" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "bool", - "name": "maximize", - "type": "bool" - } - ], - "name": "getGlvValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "getGlvWithdrawal", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvWithdrawal.Props", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvWithdrawals", - "outputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - } - ], - "internalType": "struct GlvWithdrawal.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "glvTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawal.Numbers", - "name": "numbers", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - } - ], - "internalType": "struct GlvWithdrawal.Flags", - "name": "flags", - "type": "tuple" - } - ], - "internalType": "struct GlvWithdrawal.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract DataStore", - "name": "dataStore", - "type": "address" - }, - { - "internalType": "uint256", - "name": "start", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "end", - "type": "uint256" - } - ], - "name": "getGlvs", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glvToken", - "type": "address" - }, - { - "internalType": "address", - "name": "longToken", - "type": "address" - }, - { - "internalType": "address", - "name": "shortToken", - "type": "address" - } - ], - "internalType": "struct Glv.Props[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ] - } - \ No newline at end of file + "abi": [ + { + "inputs": [], + "name": "EmptyMarketTokenSupply", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "GlvNegativeMarketPoolValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getAccountGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlv", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "name": "getGlvBySalt", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvDeposit", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvDeposit.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvDeposits", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvDeposit.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvDeposit.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + } + ], + "internalType": "struct GlvDeposit.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvDeposit.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + } + ], + "name": "getGlvInfo", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvInfoList", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props", + "name": "glv", + "type": "tuple" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + } + ], + "internalType": "struct GlvReader.GlvInfo[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvShift", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvShifts", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct GlvShift.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "marketTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + } + ], + "internalType": "struct GlvShift.Numbers", + "name": "numbers", + "type": "tuple" + } + ], + "internalType": "struct GlvShift.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvTokenPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "address[]", + "name": "marketAddresses", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "indexTokenPrices", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "bool", + "name": "maximize", + "type": "bool" + } + ], + "name": "getGlvValue", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "getGlvWithdrawal", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvWithdrawal.Props", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvWithdrawals", + "outputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct GlvWithdrawal.Addresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "glvTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct GlvWithdrawal.Numbers", + "name": "numbers", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "internalType": "struct GlvWithdrawal.Flags", + "name": "flags", + "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct GlvWithdrawal.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "uint256", + "name": "start", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "end", + "type": "uint256" + } + ], + "name": "getGlvs", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "glvToken", + "type": "address" + }, + { + "internalType": "address", + "name": "longToken", + "type": "address" + }, + { + "internalType": "address", + "name": "shortToken", + "type": "address" + } + ], + "internalType": "struct Glv.Props[]", + "name": "", + "type": "tuple[]" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/GlvRouter.json b/sdk/src/abis/GlvRouter.json index 1862af97d2..f8a34452c9 100644 --- a/sdk/src/abis/GlvRouter.json +++ b/sdk/src/abis/GlvRouter.json @@ -1,707 +1,764 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "GlvRouter", - "sourceName": "contracts/router/GlvRouter.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "contract Router", - "name": "_router", - "type": "address" - }, - { - "internalType": "contract RoleStore", - "name": "_roleStore", - "type": "address" - }, - { - "internalType": "contract DataStore", - "name": "_dataStore", - "type": "address" - }, - { - "internalType": "contract EventEmitter", - "name": "_eventEmitter", - "type": "address" - }, - { - "internalType": "contract IGlvHandler", - "name": "_glvHandler", - "type": "address" - }, - { - "internalType": "contract IExternalHandler", - "name": "_externalHandler", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "EmptyGlvDeposit", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyGlvWithdrawal", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyHoldingAddress", - "type": "error" - }, - { - "inputs": [], - "name": "EmptyReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "EmptyTokenTranferGasLimit", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - } - ], - "name": "InvalidNativeTokenSender", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "msgSender", - "type": "address" - }, - { - "internalType": "string", - "name": "role", - "type": "string" - } - ], - "name": "Unauthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelGlvDeposit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - } - ], - "name": "cancelGlvWithdrawal", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "initialLongToken", - "type": "address" - }, - { - "internalType": "address", - "name": "initialShortToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "minGlvTokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "bool", - "name": "isMarketTokenDeposit", - "type": "bool" - } - ], - "internalType": "struct GlvDepositUtils.CreateGlvDepositParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvDeposit", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "glv", - "type": "address" - }, - { - "internalType": "address[]", - "name": "longTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "shortTokenSwapPath", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "minLongTokenAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShortTokenAmount", - "type": "uint256" - }, - { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - } - ], - "internalType": "struct GlvWithdrawalUtils.CreateGlvWithdrawalParams", - "name": "params", - "type": "tuple" - } - ], - "name": "createGlvWithdrawal", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "dataStore", - "outputs": [ - { - "internalType": "contract DataStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eventEmitter", - "outputs": [ - { - "internalType": "contract EventEmitter", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "externalHandler", - "outputs": [ - { - "internalType": "contract IExternalHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "glvHandler", - "outputs": [ - { - "internalType": "contract IGlvHandler", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "externalCallTargets", - "type": "address[]" - }, - { - "internalType": "bytes[]", - "name": "externalCallDataList", - "type": "bytes[]" - }, - { - "internalType": "address[]", - "name": "refundTokens", - "type": "address[]" - }, - { - "internalType": "address[]", - "name": "refundReceivers", - "type": "address[]" - } - ], - "name": "makeExternalCalls", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "roleStore", - "outputs": [ - { - "internalType": "contract RoleStore", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "router", - "outputs": [ - { - "internalType": "contract Router", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendNativeToken", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendTokens", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "sendWnt", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteGlvDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "key", - "type": "bytes32" - }, - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteGlvWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestGlvDeposit", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address[]", - "name": "primaryTokens", - "type": "address[]" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Price.Props[]", - "name": "primaryPrices", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "minTimestamp", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTimestamp", - "type": "uint256" - } - ], - "internalType": "struct OracleUtils.SimulatePricesParams", - "name": "simulatedOracleParams", - "type": "tuple" - } - ], - "name": "simulateExecuteLatestGlvWithdrawal", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] - } - \ No newline at end of file + "abi": [ + { + "inputs": [ + { + "internalType": "contract Router", + "name": "_router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract IGlvDepositHandler", + "name": "_glvDepositHandler", + "type": "address" + }, + { + "internalType": "contract IGlvWithdrawalHandler", + "name": "_glvWithdrawalHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "_externalHandler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyGlvDeposit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyGlvWithdrawal", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelGlvWithdrawal", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IGlvDepositUtils.CreateGlvDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvDepositHandler", + "outputs": [ + { + "internalType": "contract IGlvDepositHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvWithdrawalHandler", + "outputs": [ + { + "internalType": "contract IGlvWithdrawalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "name": "makeExternalCalls", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteGlvWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestGlvDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address[]", + "name": "primaryTokens", + "type": "address[]" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props[]", + "name": "primaryPrices", + "type": "tuple[]" + }, + { + "internalType": "uint256", + "name": "minTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTimestamp", + "type": "uint256" + } + ], + "internalType": "struct OracleUtils.SimulatePricesParams", + "name": "simulatedOracleParams", + "type": "tuple" + } + ], + "name": "simulateExecuteLatestGlvWithdrawal", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/GovToken.json b/sdk/src/abis/GovToken.json index 003eeaeeb7..88796b1360 100644 --- a/sdk/src/abis/GovToken.json +++ b/sdk/src/abis/GovToken.json @@ -1,5 +1,4 @@ { - "address": "0x2A29D3a792000750807cc401806d6fd539928481", "abi": [ { "inputs": [ @@ -765,357 +764,5 @@ "stateMutability": "nonpayable", "type": "function" } - ], - "transactionHash": "0xf41d2b874807c8dea4d0b21d1215669c990495bda5cdfa8ef7bb822e6edf3043", - "receipt": { - "to": null, - "from": "0xE7BfFf2aB721264887230037940490351700a068", - "contractAddress": "0x2A29D3a792000750807cc401806d6fd539928481", - "transactionIndex": 1, - "gasUsed": "15199775", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0xc6e67e18e1c484c3ddd3cd5db795adc007a2633bf83bfc7d1c28ee352d90f9f6", - "transactionHash": "0xf41d2b874807c8dea4d0b21d1215669c990495bda5cdfa8ef7bb822e6edf3043", - "logs": [], - "blockNumber": 168596066, - "cumulativeGasUsed": "15199775", - "status": 1, - "byzantium": true - }, - "args": [ - "0x3c3d99FD298f679DBC2CEcd132b4eC4d0F5e6e72", - "GMX DAO", - "GMX_DAO", - 18 - ], - "numDeployments": 1, - "solcInputHash": "ddb2cd26020caa6335eda5082c5c80ae", - "libraries": {}, - "devdoc": { - "events": { - "Approval(address,address,uint256)": { - "details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance." - }, - "DelegateChanged(address,address,address)": { - "details": "Emitted when an account changes their delegate." - }, - "DelegateVotesChanged(address,uint256,uint256)": { - "details": "Emitted when a token transfer or delegate change results in changes to a delegate's number of votes." - }, - "EIP712DomainChanged()": { - "details": "MAY be emitted to signal that the domain could have changed." - }, - "Transfer(address,address,uint256)": { - "details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero." - } - }, - "kind": "dev", - "methods": { - "CLOCK_MODE()": { - "details": "Description of the clock" - }, - "DOMAIN_SEPARATOR()": { - "details": "See {IERC20Permit-DOMAIN_SEPARATOR}." - }, - "allowance(address,address)": { - "details": "See {IERC20-allowance}." - }, - "approve(address,uint256)": { - "details": "See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address." - }, - "balanceOf(address)": { - "details": "See {IERC20-balanceOf}." - }, - "checkpoints(address,uint32)": { - "details": "Get the `pos`-th checkpoint for `account`." - }, - "clock()": { - "details": "Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting)." - }, - "decimals()": { - "details": "Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}." - }, - "decreaseAllowance(address,uint256)": { - "details": "Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`." - }, - "delegate(address)": { - "details": "Delegate votes from the sender to `delegatee`." - }, - "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)": { - "details": "Delegates votes from signer to `delegatee`" - }, - "delegates(address)": { - "details": "Get the address `account` is currently delegating to." - }, - "eip712Domain()": { - "details": "See {EIP-5267}. _Available since v4.9._" - }, - "getPastTotalSupply(uint256)": { - "details": "Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past" - }, - "getPastVotes(address,uint256)": { - "details": "Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past" - }, - "getVotes(address)": { - "details": "Gets the current votes balance for `account`" - }, - "increaseAllowance(address,uint256)": { - "details": "Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address." - }, - "name()": { - "details": "Returns the name of the token." - }, - "nonces(address)": { - "details": "See {IERC20Permit-nonces}." - }, - "numCheckpoints(address)": { - "details": "Get number of checkpoints for `account`." - }, - "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": { - "details": "See {IERC20Permit-permit}." - }, - "symbol()": { - "details": "Returns the symbol of the token, usually a shorter version of the name." - }, - "totalSupply()": { - "details": "See {IERC20-totalSupply}." - }, - "transfer(address,uint256)": { - "details": "See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`." - }, - "transferFrom(address,address,uint256)": { - "details": "See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 207, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_balances", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_uint256)" - }, - { - "astId": 213, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_allowances", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_address,t_uint256))" - }, - { - "astId": 215, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_totalSupply", - "offset": 0, - "slot": "2", - "type": "t_uint256" - }, - { - "astId": 217, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_name", - "offset": 0, - "slot": "3", - "type": "t_string_storage" - }, - { - "astId": 219, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_symbol", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 3579, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_nameFallback", - "offset": 0, - "slot": "5", - "type": "t_string_storage" - }, - { - "astId": 3581, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_versionFallback", - "offset": 0, - "slot": "6", - "type": "t_string_storage" - }, - { - "astId": 879, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_nonces", - "offset": 0, - "slot": "7", - "type": "t_mapping(t_address,t_struct(Counter)2557_storage)" - }, - { - "astId": 887, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_PERMIT_TYPEHASH_DEPRECATED_SLOT", - "offset": 0, - "slot": "8", - "type": "t_bytes32" - }, - { - "astId": 1054, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_delegates", - "offset": 0, - "slot": "9", - "type": "t_mapping(t_address,t_address)" - }, - { - "astId": 1060, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_checkpoints", - "offset": 0, - "slot": "10", - "type": "t_mapping(t_address,t_array(t_struct(Checkpoint)1045_storage)dyn_storage)" - }, - { - "astId": 1064, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_totalSupplyCheckpoints", - "offset": 0, - "slot": "11", - "type": "t_array(t_struct(Checkpoint)1045_storage)dyn_storage" - }, - { - "astId": 27701, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_decimals", - "offset": 0, - "slot": "12", - "type": "t_uint8" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Checkpoint)1045_storage)dyn_storage": { - "base": "t_struct(Checkpoint)1045_storage", - "encoding": "dynamic_array", - "label": "struct ERC20Votes.Checkpoint[]", - "numberOfBytes": "32" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_address)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_address,t_array(t_struct(Checkpoint)1045_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct ERC20Votes.Checkpoint[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Checkpoint)1045_storage)dyn_storage" - }, - "t_mapping(t_address,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_mapping(t_address,t_struct(Counter)2557_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Counters.Counter)", - "numberOfBytes": "32", - "value": "t_struct(Counter)2557_storage" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(Checkpoint)1045_storage": { - "encoding": "inplace", - "label": "struct ERC20Votes.Checkpoint", - "members": [ - { - "astId": 1042, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "fromBlock", - "offset": 0, - "slot": "0", - "type": "t_uint32" - }, - { - "astId": 1044, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "votes", - "offset": 4, - "slot": "0", - "type": "t_uint224" - } - ], - "numberOfBytes": "32" - }, - "t_struct(Counter)2557_storage": { - "encoding": "inplace", - "label": "struct Counters.Counter", - "members": [ - { - "astId": 2556, - "contract": "contracts/gov/GovToken.sol:GovToken", - "label": "_value", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - ], - "numberOfBytes": "32" - }, - "t_uint224": { - "encoding": "inplace", - "label": "uint224", - "numberOfBytes": "28" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file + ] +} diff --git a/sdk/src/abis/LayerZeroProvider.json b/sdk/src/abis/LayerZeroProvider.json new file mode 100644 index 0000000000..288d23a34b --- /dev/null +++ b/sdk/src/abis/LayerZeroProvider.json @@ -0,0 +1,372 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "_eventEmitter", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "_multichainVault", + "type": "address" + }, + { + "internalType": "contract IMultichainGmRouter", + "name": "_multichainGmRouter", + "type": "address" + }, + { + "internalType": "contract IMultichainGlvRouter", + "name": "_multichainGlvRouter", + "type": "address" + }, + { + "internalType": "contract IMultichainOrderRouter", + "name": "_multichainOrderRouter", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyWithdrawalAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "gas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "estimatedGasLimit", + "type": "uint256" + } + ], + "name": "InsufficientGasLeft", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "InvalidBridgeOutToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "eid", + "type": "uint256" + } + ], + "name": "InvalidEid", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IRelayUtils.BridgeOutParams", + "name": "params", + "type": "tuple" + } + ], + "name": "bridgeOut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "lzCompose", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainGlvRouter", + "outputs": [ + { + "internalType": "contract IMultichainGlvRouter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "multichainGmRouter", + "outputs": [ + { + "internalType": "contract IMultichainGmRouter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "multichainOrderRouter", + "outputs": [ + { + "internalType": "contract IMultichainOrderRouter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/Multicall.json b/sdk/src/abis/Multicall.json index da2ad0a409..df41650472 100644 --- a/sdk/src/abis/Multicall.json +++ b/sdk/src/abis/Multicall.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Multicall2", - "sourceName": "contracts/mock/Multicall2.sol", "abi": [ { "inputs": [ @@ -18,7 +15,7 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Call[]", + "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" } @@ -36,7 +33,108 @@ "type": "bytes[]" } ], - "stateMutability": "nonpayable", + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call3[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call3Value[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3Value", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", "type": "function" }, { @@ -54,7 +152,7 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Call[]", + "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" } @@ -84,12 +182,25 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Result[]", + "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" } ], - "stateMutability": "nonpayable", + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "basefee", + "type": "uint256" + } + ], + "stateMutability": "view", "type": "function" }, { @@ -126,12 +237,12 @@ }, { "inputs": [], - "name": "getCurrentBlockCoinbase", + "name": "getChainId", "outputs": [ { - "internalType": "address", - "name": "coinbase", - "type": "address" + "internalType": "uint256", + "name": "chainid", + "type": "uint256" } ], "stateMutability": "view", @@ -139,12 +250,12 @@ }, { "inputs": [], - "name": "getCurrentBlockDifficulty", + "name": "getCurrentBlockCoinbase", "outputs": [ { - "internalType": "uint256", - "name": "difficulty", - "type": "uint256" + "internalType": "address", + "name": "coinbase", + "type": "address" } ], "stateMutability": "view", @@ -195,19 +306,6 @@ "stateMutability": "view", "type": "function" }, - { - "inputs": [], - "name": "getL1BlockNumber", - "outputs": [ - { - "internalType": "uint256", - "name": "l1BlockNumber", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, { "inputs": [], "name": "getLastBlockHash", @@ -241,7 +339,7 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Call[]", + "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" } @@ -261,12 +359,12 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Result[]", + "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" } ], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" }, { @@ -289,7 +387,7 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Call[]", + "internalType": "struct Multicall3.Call[]", "name": "calls", "type": "tuple[]" } @@ -319,15 +417,13 @@ "type": "bytes" } ], - "internalType": "struct Multicall2.Result[]", + "internalType": "struct Multicall3.Result[]", "name": "returnData", "type": "tuple[]" } ], - "stateMutability": "nonpayable", + "stateMutability": "payable", "type": "function" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainClaimsRouter.json b/sdk/src/abis/MultichainClaimsRouter.json new file mode 100644 index 0000000000..9f8fff6d9c --- /dev/null +++ b/sdk/src/abis/MultichainClaimsRouter.json @@ -0,0 +1,1266 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "adjustedClaimableAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimedAmount", + "type": "uint256" + } + ], + "name": "CollateralAlreadyClaimed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + } + ], + "name": "DisabledMarket", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyAddressInMarketTokenBalanceValidation", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyMarket", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "marketsLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "timeKeysLength", + "type": "uint256" + } + ], + "name": "InvalidClaimCollateralInput", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "InvalidClaimableFactor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "expectedMinBalance", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "claimableFundingFeeAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForClaimableFunding", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "collateralAmount", + "type": "uint256" + } + ], + "name": "InvalidMarketTokenBalanceForCollateralAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimAffiliateRewards", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "timeKeys", + "type": "uint256[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimCollateral", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "markets", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "claimFundingFees", + "outputs": [ + { + "internalType": "uint256[]", + "name": "", + "type": "uint256[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainGlvRouter.json b/sdk/src/abis/MultichainGlvRouter.json new file mode 100644 index 0000000000..96c32a3d8e --- /dev/null +++ b/sdk/src/abis/MultichainGlvRouter.json @@ -0,0 +1,1150 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "contract IGlvDepositHandler", + "name": "_glvDepositHandler", + "type": "address" + }, + { + "internalType": "contract IGlvWithdrawalHandler", + "name": "_glvWithdrawalHandler", + "type": "address" + }, + { + "internalType": "contract GlvVault", + "name": "_glvVault", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTransferRequestsLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "receivers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "internalType": "struct IRelayUtils.TransferRequests", + "name": "transferRequests", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minGlvTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isMarketTokenDeposit", + "type": "bool" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IGlvDepositUtils.CreateGlvDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "receivers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "internalType": "struct IRelayUtils.TransferRequests", + "name": "transferRequests", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "glv", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createGlvWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvDepositHandler", + "outputs": [ + { + "internalType": "contract IGlvDepositHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvVault", + "outputs": [ + { + "internalType": "contract GlvVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "glvWithdrawalHandler", + "outputs": [ + { + "internalType": "contract IGlvWithdrawalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainGmRouter.json b/sdk/src/abis/MultichainGmRouter.json new file mode 100644 index 0000000000..b758655f6e --- /dev/null +++ b/sdk/src/abis/MultichainGmRouter.json @@ -0,0 +1,1449 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "contract DepositVault", + "name": "_depositVault", + "type": "address" + }, + { + "internalType": "contract IDepositHandler", + "name": "_depositHandler", + "type": "address" + }, + { + "internalType": "contract WithdrawalVault", + "name": "_withdrawalVault", + "type": "address" + }, + { + "internalType": "contract IWithdrawalHandler", + "name": "_withdrawalHandler", + "type": "address" + }, + { + "internalType": "contract ShiftVault", + "name": "_shiftVault", + "type": "address" + }, + { + "internalType": "contract IShiftHandler", + "name": "_shiftHandler", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidTransferRequestsLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "receivers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "internalType": "struct IRelayUtils.TransferRequests", + "name": "transferRequests", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialLongToken", + "type": "address" + }, + { + "internalType": "address", + "name": "initialShortToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IDepositUtils.CreateDepositParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IDepositUtils.CreateDepositParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createDeposit", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "receivers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "internalType": "struct IRelayUtils.TransferRequests", + "name": "transferRequests", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "fromMarket", + "type": "address" + }, + { + "internalType": "address", + "name": "toMarket", + "type": "address" + } + ], + "internalType": "struct IShiftUtils.CreateShiftParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minMarketTokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IShiftUtils.CreateShiftParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createShift", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "receivers", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "internalType": "struct IRelayUtils.TransferRequests", + "name": "transferRequests", + "type": "tuple" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address[]", + "name": "longTokenSwapPath", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "shortTokenSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "minLongTokenAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShortTokenAmount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IWithdrawalUtils.CreateWithdrawalParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createWithdrawal", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositHandler", + "outputs": [ + { + "internalType": "contract IDepositHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "depositVault", + "outputs": [ + { + "internalType": "contract DepositVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "shiftHandler", + "outputs": [ + { + "internalType": "contract IShiftHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "shiftVault", + "outputs": [ + { + "internalType": "contract ShiftVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalHandler", + "outputs": [ + { + "internalType": "contract IWithdrawalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "withdrawalVault", + "outputs": [ + { + "internalType": "contract WithdrawalVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainOrderRouter.json b/sdk/src/abis/MultichainOrderRouter.json new file mode 100644 index 0000000000..ab2e009bcb --- /dev/null +++ b/sdk/src/abis/MultichainOrderRouter.json @@ -0,0 +1,1820 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + }, + { + "internalType": "contract IReferralStorage", + "name": "_referralStorage", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyOrder", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "RelayEmptyBatch", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", + "name": "createOrderParamsList", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFeeIncrease", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.UpdateOrderParams[]", + "name": "updateOrderParamsList", + "type": "tuple[]" + }, + { + "internalType": "bytes32[]", + "name": "cancelOrderKeys", + "type": "bytes32[]" + } + ], + "internalType": "struct IRelayUtils.BatchParams", + "name": "params", + "type": "tuple" + } + ], + "name": "batch", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "referralStorage", + "outputs": [ + { + "internalType": "contract IReferralStorage", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + } + ], + "name": "setTraderReferralCode", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFeeIncrease", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.UpdateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "updateOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainSubaccountRouter.json b/sdk/src/abis/MultichainSubaccountRouter.json new file mode 100644 index 0000000000..9b23af0f17 --- /dev/null +++ b/sdk/src/abis/MultichainSubaccountRouter.json @@ -0,0 +1,2069 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyOrder", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "RelayEmptyBatch", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bool", + "name": "shouldAdd", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "expiresAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAllowedCount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SubaccountApproval", + "name": "subaccountApproval", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", + "name": "createOrderParamsList", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFeeIncrease", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.UpdateOrderParams[]", + "name": "updateOrderParamsList", + "type": "tuple[]" + }, + { + "internalType": "bytes32[]", + "name": "cancelOrderKeys", + "type": "bytes32[]" + } + ], + "internalType": "struct IRelayUtils.BatchParams", + "name": "params", + "type": "tuple" + } + ], + "name": "batch", + "outputs": [ + { + "internalType": "bytes32[]", + "name": "", + "type": "bytes32[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bool", + "name": "shouldAdd", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "expiresAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAllowedCount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SubaccountApproval", + "name": "subaccountApproval", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "cancelOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bool", + "name": "shouldAdd", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "expiresAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAllowedCount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SubaccountApproval", + "name": "subaccountApproval", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "components": [ + { + "components": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsAddresses", + "name": "addresses", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParamsNumbers", + "name": "numbers", + "type": "tuple" + }, + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "bytes32", + "name": "referralCode", + "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" + } + ], + "internalType": "struct IBaseOrderUtils.CreateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "createOrder", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + } + ], + "name": "removeSubaccount", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "subaccountApprovalNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bool", + "name": "shouldAdd", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "expiresAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxAllowedCount", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + } + ], + "internalType": "struct SubaccountApproval", + "name": "subaccountApproval", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "components": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "executionFeeIncrease", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.UpdateOrderParams", + "name": "params", + "type": "tuple" + } + ], + "name": "updateOrder", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainTransferRouter.json b/sdk/src/abis/MultichainTransferRouter.json new file mode 100644 index 0000000000..ccc2d3ba91 --- /dev/null +++ b/sdk/src/abis/MultichainTransferRouter.json @@ -0,0 +1,915 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "contract Router", + "name": "router", + "type": "address" + }, + { + "internalType": "contract RoleStore", + "name": "roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "address" + }, + { + "internalType": "contract EventEmitter", + "name": "eventEmitter", + "type": "address" + }, + { + "internalType": "contract IOracle", + "name": "oracle", + "type": "address" + }, + { + "internalType": "contract OrderVault", + "name": "orderVault", + "type": "address" + }, + { + "internalType": "contract IOrderHandler", + "name": "orderHandler", + "type": "address" + }, + { + "internalType": "contract ISwapHandler", + "name": "swapHandler", + "type": "address" + }, + { + "internalType": "contract IExternalHandler", + "name": "externalHandler", + "type": "address" + }, + { + "internalType": "contract MultichainVault", + "name": "multichainVault", + "type": "address" + } + ], + "internalType": "struct MultichainRouter.BaseConstructorParams", + "name": "params", + "type": "tuple" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "currentTimestamp", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + } + ], + "name": "DeadlinePassed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "key", + "type": "bytes32" + } + ], + "name": "DisabledFeature", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "requiredRelayFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "availableFeeAmount", + "type": "uint256" + } + ], + "name": "InsufficientRelayFee", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "name": "InvalidDestinationChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "sendTokensLength", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sendAmountsLength", + "type": "uint256" + } + ], + "name": "InvalidExternalCalls", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitializer", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "InvalidMultichainProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedSpender", + "type": "address" + } + ], + "name": "InvalidPermitSpender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "name": "InvalidSrcChainId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" + } + ], + "name": "InvalidUserDigest", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxFeeUsd", + "type": "uint256" + } + ], + "name": "MaxRelayFeeSwapForSubaccountExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NonEmptyExternalCallsForSubaccountOrder", + "type": "error" + }, + { + "inputs": [], + "name": "TokenPermitsNotAllowedForMultichain", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnexpectedRelayFeeToken", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedFeeToken", + "type": "address" + } + ], + "name": "UnsupportedRelayFeeToken", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "bridgeIn", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "components": [ + { + "internalType": "address[]", + "name": "tokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "providers", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" + }, + { + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" + }, + { + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" + }, + { + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" + }, + { + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.ExternalCalls", + "name": "externalCalls", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint8", + "name": "v", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "r", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "internalType": "struct IRelayUtils.TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" + }, + { + "components": [ + { + "internalType": "address", + "name": "feeToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" + }, + { + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" + } + ], + "internalType": "struct IRelayUtils.FeeParams", + "name": "fee", + "type": "tuple" + }, + { + "internalType": "uint256", + "name": "userNonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "signature", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + } + ], + "internalType": "struct IRelayUtils.RelayParams", + "name": "relayParams", + "type": "tuple" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IRelayUtils.BridgeOutParams", + "name": "params", + "type": "tuple" + } + ], + "name": "bridgeOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IRelayUtils.BridgeOutParams", + "name": "params", + "type": "tuple" + } + ], + "name": "bridgeOutFromController", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eventEmitter", + "outputs": [ + { + "internalType": "contract EventEmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "externalHandler", + "outputs": [ + { + "internalType": "contract IExternalHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_multichainProvider", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "multichainProvider", + "outputs": [ + { + "internalType": "contract IMultichainProvider", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "multichainVault", + "outputs": [ + { + "internalType": "contract MultichainVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "oracle", + "outputs": [ + { + "internalType": "contract IOracle", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderHandler", + "outputs": [ + { + "internalType": "contract IOrderHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "orderVault", + "outputs": [ + { + "internalType": "contract OrderVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "router", + "outputs": [ + { + "internalType": "contract Router", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minAmountOut", + "type": "uint256" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "internalType": "struct IRelayUtils.BridgeOutParams", + "name": "params", + "type": "tuple" + } + ], + "name": "transferOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] +} diff --git a/sdk/src/abis/MultichainUtils.json b/sdk/src/abis/MultichainUtils.json new file mode 100644 index 0000000000..7e60599995 --- /dev/null +++ b/sdk/src/abis/MultichainUtils.json @@ -0,0 +1,133 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyMultichainTransferInAmount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "InsufficientMultichainBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "InvalidMultichainEndpoint", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "InvalidMultichainProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "DataStore" + }, + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "getMultichainBalanceAmount", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "DataStore" + }, + { + "internalType": "address", + "name": "endpoint", + "type": "address" + } + ], + "name": "validateMultichainEndpoint", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract DataStore", + "name": "dataStore", + "type": "DataStore" + }, + { + "internalType": "address", + "name": "provider", + "type": "address" + } + ], + "name": "validateMultichainProvider", + "outputs": [], + "stateMutability": "view", + "type": "function" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/MultichainVault.json b/sdk/src/abis/MultichainVault.json new file mode 100644 index 0000000000..5c12340f79 --- /dev/null +++ b/sdk/src/abis/MultichainVault.json @@ -0,0 +1,275 @@ +{ + "abi": [ + { + "inputs": [ + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, + { + "internalType": "contract DataStore", + "name": "_dataStore", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, + { + "inputs": [], + "name": "EmptyReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + } + ], + "name": "InvalidNativeTokenSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "SelfTransferNotSupported", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "TokenTransferError", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" + } + ], + "name": "TokenTransferReverted", + "type": "event" + }, + { + "inputs": [], + "name": "dataStore", + "outputs": [ + { + "internalType": "contract DataStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "recordTransferIn", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "syncTokenBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "tokenBalances", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + } + ], + "name": "transferOut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transferOutNativeToken", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] +} \ No newline at end of file diff --git a/sdk/src/abis/ReferralStorage.json b/sdk/src/abis/ReferralStorage.json index 3c957a8fa0..edfad6e67a 100644 --- a/sdk/src/abis/ReferralStorage.json +++ b/sdk/src/abis/ReferralStorage.json @@ -1,8 +1,21 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "ReferralStorage", - "sourceName": "contracts/referrals/ReferralStorage.sol", "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "msgSender", + "type": "address" + }, + { + "internalType": "string", + "name": "role", + "type": "string" + } + ], + "name": "Unauthorized", + "type": "error" + }, { "anonymous": false, "inputs": [ @@ -66,6 +79,25 @@ "name": "SetCodeOwner", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "prevGov", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "nextGov", + "type": "address" + } + ], + "name": "SetGov", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -180,6 +212,13 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [ { @@ -273,6 +312,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "pendingGov", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -342,19 +394,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [ - { - "internalType": "address", - "name": "_gov", - "type": "address" - } - ], - "name": "setGov", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -500,8 +539,19 @@ ], "stateMutability": "view", "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newGov", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} + ] } diff --git a/sdk/src/abis/RelayParams.json b/sdk/src/abis/RelayParams.json index 817cd09e80..56922f895f 100644 --- a/sdk/src/abis/RelayParams.json +++ b/sdk/src/abis/RelayParams.json @@ -1,109 +1,146 @@ { "abi": [ { - "type": "tuple", "components": [ { - "type": "address[]", - "name": "tokens" + "internalType": "address[]", + "name": "tokens", + "type": "address[]" }, { - "type": "address[]", - "name": "providers" + "internalType": "address[]", + "name": "providers", + "type": "address[]" }, { - "type": "bytes[]", - "name": "data" + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" } - ] + ], + "internalType": "struct OracleUtils.SetPricesParams", + "name": "oracleParams", + "type": "tuple" }, { - "type": "tuple", "components": [ { - "type": "address[]", - "name": "sendTokens" + "internalType": "address[]", + "name": "sendTokens", + "type": "address[]" }, { - "type": "uint256[]", - "name": "sendAmounts" + "internalType": "uint256[]", + "name": "sendAmounts", + "type": "uint256[]" }, { - "type": "address[]", - "name": "externalCallTargets" + "internalType": "address[]", + "name": "externalCallTargets", + "type": "address[]" }, { - "type": "bytes[]", - "name": "externalCallDataList" + "internalType": "bytes[]", + "name": "externalCallDataList", + "type": "bytes[]" }, { - "type": "address[]", - "name": "refundTokens" + "internalType": "address[]", + "name": "refundTokens", + "type": "address[]" }, { - "type": "address[]", - "name": "refundReceivers" + "internalType": "address[]", + "name": "refundReceivers", + "type": "address[]" } - ] + ], + "internalType": "struct ExternalCalls", + "name": "externalCalls", + "type": "tuple" }, { - "type": "tuple[]", "components": [ { - "type": "address", - "name": "owner" + "internalType": "address", + "name": "owner", + "type": "address" }, { - "type": "address", - "name": "spender" + "internalType": "address", + "name": "spender", + "type": "address" }, { - "type": "uint256", - "name": "value" + "internalType": "uint256", + "name": "value", + "type": "uint256" }, { - "type": "uint256", - "name": "deadline" + "internalType": "uint256", + "name": "deadline", + "type": "uint256" }, { - "type": "uint8", - "name": "v" + "internalType": "uint8", + "name": "v", + "type": "uint8" }, { - "type": "bytes32", - "name": "r" + "internalType": "bytes32", + "name": "r", + "type": "bytes32" }, { - "type": "bytes32", - "name": "s" + "internalType": "bytes32", + "name": "s", + "type": "bytes32" }, { - "type": "address", - "name": "token" + "internalType": "address", + "name": "token", + "type": "address" } - ] + ], + "internalType": "struct TokenPermit[]", + "name": "tokenPermits", + "type": "tuple[]" }, { - "type": "tuple", "components": [ { - "type": "address", - "name": "feeToken" + "internalType": "address", + "name": "feeToken", + "type": "address" }, { - "type": "uint256", - "name": "feeAmount" + "internalType": "uint256", + "name": "feeAmount", + "type": "uint256" }, { - "type": "address[]", - "name": "feeSwapPath" + "internalType": "address[]", + "name": "feeSwapPath", + "type": "address[]" } - ] + ], + "internalType": "struct FeeParams", + "name": "fee", + "type": "tuple" }, { + "internalType": "uint256", + "name": "userNonce", "type": "uint256" }, { + "internalType": "uint256", + "name": "deadline", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desChainId", "type": "uint256" } ] diff --git a/sdk/src/abis/SubaccountGelatoRelayRouter.json b/sdk/src/abis/SubaccountGelatoRelayRouter.json index 9a80d72606..a1ed16bf23 100644 --- a/sdk/src/abis/SubaccountGelatoRelayRouter.json +++ b/sdk/src/abis/SubaccountGelatoRelayRouter.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "SubaccountGelatoRelayRouter", - "sourceName": "contracts/router/relay/SubaccountGelatoRelayRouter.sol", "abi": [ { "inputs": [ @@ -10,6 +7,11 @@ "name": "_router", "type": "address" }, + { + "internalType": "contract RoleStore", + "name": "_roleStore", + "type": "address" + }, { "internalType": "contract DataStore", "name": "_dataStore", @@ -21,7 +23,7 @@ "type": "address" }, { - "internalType": "contract Oracle", + "internalType": "contract IOracle", "name": "_oracle", "type": "address" }, @@ -35,6 +37,11 @@ "name": "_orderVault", "type": "address" }, + { + "internalType": "contract ISwapHandler", + "name": "_swapHandler", + "type": "address" + }, { "internalType": "contract IExternalHandler", "name": "_externalHandler", @@ -71,6 +78,11 @@ "name": "DisabledFeature", "type": "error" }, + { + "inputs": [], + "name": "EmptyHoldingAddress", + "type": "error" + }, { "inputs": [], "name": "EmptyOrder", @@ -82,8 +94,14 @@ "type": "error" }, { - "inputs": [], - "name": "EmptyRelayFeeAddress", + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + } + ], + "name": "EmptyTokenTranferGasLimit", "type": "error" }, { @@ -105,17 +123,12 @@ { "inputs": [ { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedCancellationReceiver", - "type": "address" + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "name": "InvalidCancellationReceiverForSubaccountOrder", + "name": "InvalidDestinationChainId", "type": "error" }, { @@ -152,61 +165,24 @@ }, { "inputs": [ - { - "internalType": "address", - "name": "receiver", - "type": "address" - } - ], - "name": "InvalidReceiver", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "signatureType", - "type": "string" - } - ], - "name": "InvalidSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "storedNonce", - "type": "uint256" - }, { "internalType": "uint256", - "name": "nonce", + "name": "srcChainId", "type": "uint256" } ], - "name": "InvalidSubaccountApprovalNonce", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidSubaccountApprovalSubaccount", + "name": "InvalidSrcChainId", "type": "error" }, { "inputs": [ { - "internalType": "uint256", - "name": "storedUserNonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "userNonce", - "type": "uint256" + "internalType": "bytes32", + "name": "digest", + "type": "bytes32" } ], - "name": "InvalidUserNonce", + "name": "InvalidUserDigest", "type": "error" }, { @@ -231,35 +207,34 @@ "type": "error" }, { - "inputs": [ - { - "internalType": "uint256", - "name": "calldataLength", - "type": "uint256" - } - ], - "name": "RelayCalldataTooLong", + "inputs": [], + "name": "RelayEmptyBatch", "type": "error" }, { "inputs": [], - "name": "RelayEmptyBatch", + "name": "TokenPermitsNotAllowedForMultichain", "type": "error" }, { "inputs": [ { - "internalType": "uint256", - "name": "currentTimestamp", - "type": "uint256" + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" }, { "internalType": "uint256", - "name": "deadline", + "name": "amount", "type": "uint256" } ], - "name": "SubaccountApprovalDeadlinePassed", + "name": "TokenTransferError", "type": "error" }, { @@ -311,43 +286,23 @@ "type": "error" }, { - "inputs": [], - "name": "DOMAIN_SEPARATOR_NAME_HASH", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR_TYPEHASH", - "outputs": [ + "anonymous": false, + "inputs": [ { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR_VERSION_HASH", - "outputs": [ + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" + }, { - "internalType": "bytes32", - "name": "", - "type": "bytes32" + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" } ], - "stateMutability": "view", - "type": "function" + "name": "TokenTransferReverted", + "type": "event" }, { "inputs": [ @@ -408,7 +363,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -455,7 +410,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -477,7 +432,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -495,9 +450,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -533,11 +493,21 @@ "name": "nonce", "type": "uint256" }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, { "internalType": "bytes", "name": "signature", @@ -680,6 +650,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams[]", @@ -729,7 +704,7 @@ "type": "uint256" } ], - "internalType": "struct UpdateOrderParams[]", + "internalType": "struct IRelayUtils.UpdateOrderParams[]", "name": "updateOrderParamsList", "type": "tuple[]" }, @@ -739,7 +714,7 @@ "type": "bytes32[]" } ], - "internalType": "struct BatchParams", + "internalType": "struct IRelayUtils.BatchParams", "name": "params", "type": "tuple" } @@ -814,7 +789,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -861,7 +836,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -883,7 +858,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -901,9 +876,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -939,11 +919,21 @@ "name": "nonce", "type": "uint256" }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, { "internalType": "bytes", "name": "signature", @@ -1034,7 +1024,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -1081,7 +1071,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -1103,7 +1093,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -1121,9 +1111,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -1159,11 +1154,21 @@ "name": "nonce", "type": "uint256" }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, { "internalType": "bytes", "name": "signature", @@ -1304,6 +1309,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams", @@ -1335,6 +1345,25 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "digests", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "eventEmitter", @@ -1361,12 +1390,31 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [], "name": "oracle", "outputs": [ { - "internalType": "contract Oracle", + "internalType": "contract IOracle", "name": "", "type": "address" } @@ -1459,7 +1507,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -1506,7 +1554,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -1528,7 +1576,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -1546,9 +1594,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -1568,6 +1621,19 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [], + "name": "roleStore", + "outputs": [ + { + "internalType": "contract RoleStore", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [], "name": "router", @@ -1581,6 +1647,65 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendNativeToken", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendTokens", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "sendWnt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -1600,6 +1725,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "swapHandler", + "outputs": [ + { + "internalType": "contract ISwapHandler", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -1659,7 +1797,7 @@ "type": "address[]" } ], - "internalType": "struct ExternalCalls", + "internalType": "struct IRelayUtils.ExternalCalls", "name": "externalCalls", "type": "tuple" }, @@ -1706,7 +1844,7 @@ "type": "address" } ], - "internalType": "struct TokenPermit[]", + "internalType": "struct IRelayUtils.TokenPermit[]", "name": "tokenPermits", "type": "tuple[]" }, @@ -1728,7 +1866,7 @@ "type": "address[]" } ], - "internalType": "struct FeeParams", + "internalType": "struct IRelayUtils.FeeParams", "name": "fee", "type": "tuple" }, @@ -1746,9 +1884,14 @@ "internalType": "bytes", "name": "signature", "type": "bytes" + }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" } ], - "internalType": "struct RelayParams", + "internalType": "struct IRelayUtils.RelayParams", "name": "relayParams", "type": "tuple" }, @@ -1784,11 +1927,21 @@ "name": "nonce", "type": "uint256" }, + { + "internalType": "uint256", + "name": "desChainId", + "type": "uint256" + }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + }, { "internalType": "bytes", "name": "signature", @@ -1852,7 +2005,7 @@ "type": "uint256" } ], - "internalType": "struct UpdateOrderParams", + "internalType": "struct IRelayUtils.UpdateOrderParams", "name": "params", "type": "tuple" } @@ -1861,25 +2014,6 @@ "outputs": [], "stateMutability": "nonpayable", "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "userNonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" } ] } diff --git a/sdk/src/abis/SubaccountRouter.json b/sdk/src/abis/SubaccountRouter.json index 1b70713013..f7ef1334c5 100644 --- a/sdk/src/abis/SubaccountRouter.json +++ b/sdk/src/abis/SubaccountRouter.json @@ -1,5 +1,4 @@ { - "address": "0xe5485a4fD6527911e9b82A75A1bFEd6e47BE2241", "abi": [ { "inputs": [ @@ -89,80 +88,41 @@ "inputs": [ { "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedReceiver", - "type": "address" - } - ], - "name": "InvalidReceiverForSubaccountOrder", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", + "name": "token", "type": "address" }, { "internalType": "address", - "name": "subaccount", + "name": "receiver", "type": "address" }, { "internalType": "uint256", - "name": "count", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxCount", + "name": "amount", "type": "uint256" } ], - "name": "MaxSubaccountActionCountExceeded", + "name": "TokenTransferError", "type": "error" }, { + "anonymous": false, "inputs": [ { - "internalType": "address", - "name": "account", - "type": "address" + "indexed": false, + "internalType": "string", + "name": "reason", + "type": "string" }, { - "internalType": "address", - "name": "subaccount", - "type": "address" + "indexed": false, + "internalType": "bytes", + "name": "returndata", + "type": "bytes" } ], - "name": "SubaccountNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "TokenTransferError", - "type": "error" + "name": "TokenTransferReverted", + "type": "event" }, { "inputs": [ @@ -317,6 +277,11 @@ "internalType": "bytes32", "name": "referralCode", "type": "bytes32" + }, + { + "internalType": "bytes32[]", + "name": "dataList", + "type": "bytes32[]" } ], "internalType": "struct IBaseOrderUtils.CreateOrderParams", @@ -504,6 +469,24 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "integrationId", + "type": "bytes32" + } + ], + "name": "setIntegrationId", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -545,6 +528,29 @@ "stateMutability": "payable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "subaccount", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "actionType", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "expiresAt", + "type": "uint256" + } + ], + "name": "setSubaccountExpiresAt", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, { "inputs": [ { @@ -592,67 +598,5 @@ "stateMutability": "payable", "type": "receive" } - ], - "transactionHash": "0xe5b71c86f938f547820ca3262678fb70c379c15ef02430fbb773ee4d37e86e09", - "receipt": { - "to": null, - "from": "0xE7BfFf2aB721264887230037940490351700a068", - "contractAddress": "0xe5485a4fD6527911e9b82A75A1bFEd6e47BE2241", - "transactionIndex": 0, - "gasUsed": "3707710", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x00c9beda5865106776abea90f56310f05628852d29d91b7c235c44a20123b601", - "transactionHash": "0xe5b71c86f938f547820ca3262678fb70c379c15ef02430fbb773ee4d37e86e09", - "logs": [], - "blockNumber": 46822607, - "cumulativeGasUsed": "3707710", - "status": 1, - "byzantium": true - }, - "args": [ - "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", - "0xA44F830B6a2B6fa76657a3B92C1fe74fcB7C6AfD", - "0x2F0b22339414ADeD7D5F06f9D604c7fF5b2fe3f6", - "0xDb17B211c34240B014ab6d61d4A31FA0C0e20c26", - "0x32A0258007a6ea78265a5AE4DBb28f176be4a8EB", - "0xD3D60D22d415aD43b7e64b510D86A30f19B1B12C" - ], - "numDeployments": 3, - "solcInputHash": "95ed34927f843d6700c121bcc6faf594", - "libraries": { - "OrderStoreUtils": "0x805a15bf16582eC8d76841062A47dFfEa7903131" - }, - "devdoc": { - "kind": "dev", - "methods": { - "multicall(bytes[])": { - "details": "Receives and executes a batch of function calls on this contract." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 115, - "contract": "contracts/router/SubaccountRouter.sol:SubaccountRouter", - "label": "_status", - "offset": 0, - "slot": "0", - "type": "t_uint256" - } - ], - "types": { - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} + ] +} \ No newline at end of file diff --git a/sdk/src/abis/SyntheticsReader.json b/sdk/src/abis/SyntheticsReader.json index 2374a4f583..762bafb2cc 100644 --- a/sdk/src/abis/SyntheticsReader.json +++ b/sdk/src/abis/SyntheticsReader.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Reader", - "sourceName": "contracts/reader/Reader.sol", "abi": [ { "inputs": [ @@ -31,143 +28,165 @@ { "components": [ { - "components": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "receiver", - "type": "address" - }, - { - "internalType": "address", - "name": "cancellationReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "callbackContract", - "type": "address" - }, - { - "internalType": "address", - "name": "uiFeeReceiver", - "type": "address" - }, - { - "internalType": "address", - "name": "market", - "type": "address" - }, - { - "internalType": "address", - "name": "initialCollateralToken", - "type": "address" - }, - { - "internalType": "address[]", - "name": "swapPath", - "type": "address[]" - } - ], - "internalType": "struct Order.Addresses", - "name": "addresses", - "type": "tuple" - }, - { - "components": [ - { - "internalType": "enum Order.OrderType", - "name": "orderType", - "type": "uint8" - }, - { - "internalType": "enum Order.DecreasePositionSwapType", - "name": "decreasePositionSwapType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "sizeDeltaUsd", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "initialCollateralDeltaAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "triggerPrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "acceptablePrice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "executionFee", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "callbackGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minOutputAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "updatedAtTime", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "validFromTime", - "type": "uint256" - } - ], - "internalType": "struct Order.Numbers", - "name": "numbers", - "type": "tuple" + "internalType": "bytes32", + "name": "orderKey", + "type": "bytes32" }, { "components": [ { - "internalType": "bool", - "name": "isLong", - "type": "bool" + "components": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "address", + "name": "cancellationReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "callbackContract", + "type": "address" + }, + { + "internalType": "address", + "name": "uiFeeReceiver", + "type": "address" + }, + { + "internalType": "address", + "name": "market", + "type": "address" + }, + { + "internalType": "address", + "name": "initialCollateralToken", + "type": "address" + }, + { + "internalType": "address[]", + "name": "swapPath", + "type": "address[]" + } + ], + "internalType": "struct Order.Addresses", + "name": "addresses", + "type": "tuple" }, { - "internalType": "bool", - "name": "shouldUnwrapNativeToken", - "type": "bool" + "components": [ + { + "internalType": "enum Order.OrderType", + "name": "orderType", + "type": "uint8" + }, + { + "internalType": "enum Order.DecreasePositionSwapType", + "name": "decreasePositionSwapType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "sizeDeltaUsd", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "initialCollateralDeltaAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "triggerPrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "acceptablePrice", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "executionFee", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "callbackGasLimit", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minOutputAmount", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "updatedAtTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "validFromTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" + } + ], + "internalType": "struct Order.Numbers", + "name": "numbers", + "type": "tuple" }, { - "internalType": "bool", - "name": "isFrozen", - "type": "bool" + "components": [ + { + "internalType": "bool", + "name": "isLong", + "type": "bool" + }, + { + "internalType": "bool", + "name": "shouldUnwrapNativeToken", + "type": "bool" + }, + { + "internalType": "bool", + "name": "isFrozen", + "type": "bool" + }, + { + "internalType": "bool", + "name": "autoCancel", + "type": "bool" + } + ], + "internalType": "struct Order.Flags", + "name": "flags", + "type": "tuple" }, { - "internalType": "bool", - "name": "autoCancel", - "type": "bool" + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" } ], - "internalType": "struct Order.Flags", - "name": "flags", + "internalType": "struct Order.Props", + "name": "order", "type": "tuple" } ], - "internalType": "struct Order.Props[]", + "internalType": "struct ReaderUtils.OrderInfo[]", "name": "", "type": "tuple[]" } @@ -321,6 +340,11 @@ "name": "collateralAmount", "type": "uint256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "uint256", "name": "borrowingFactor", @@ -648,12 +672,27 @@ }, { "internalType": "uint256", - "name": "priceImpactDiffUsd", + "name": "executionPrice", "type": "uint256" }, + { + "internalType": "bool", + "name": "balanceWasImproved", + "type": "bool" + }, + { + "internalType": "int256", + "name": "proportionalPendingImpactUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "totalImpactUsd", + "type": "int256" + }, { "internalType": "uint256", - "name": "executionPrice", + "name": "priceImpactDiffUsd", "type": "uint256" } ], @@ -751,6 +790,11 @@ "name": "collateralAmount", "type": "uint256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "uint256", "name": "borrowingFactor", @@ -1009,6 +1053,11 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" } ], "internalType": "struct Deposit.Numbers", @@ -1026,6 +1075,11 @@ "internalType": "struct Deposit.Flags", "name": "flags", "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" } ], "internalType": "struct Deposit.Props", @@ -1180,18 +1234,59 @@ { "components": [ { - "internalType": "uint256", - "name": "min", - "type": "uint256" + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "indexTokenPrice", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "longTokenPrice", + "type": "tuple" }, { - "internalType": "uint256", - "name": "max", - "type": "uint256" + "components": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "internalType": "struct Price.Props", + "name": "shortTokenPrice", + "type": "tuple" } ], - "internalType": "struct Price.Props", - "name": "indexTokenPrice", + "internalType": "struct MarketUtils.MarketPrices", + "name": "prices", "type": "tuple" }, { @@ -1209,6 +1304,11 @@ "name": "sizeDeltaUsd", "type": "int256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "bool", "name": "isLong", @@ -1226,12 +1326,27 @@ }, { "internalType": "uint256", - "name": "priceImpactDiffUsd", + "name": "executionPrice", "type": "uint256" }, + { + "internalType": "bool", + "name": "balanceWasImproved", + "type": "bool" + }, + { + "internalType": "int256", + "name": "proportionalPendingImpactUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "totalImpactUsd", + "type": "int256" + }, { "internalType": "uint256", - "name": "executionPrice", + "name": "priceImpactDiffUsd", "type": "uint256" } ], @@ -2181,6 +2296,11 @@ "internalType": "uint256", "name": "impactPoolAmount", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lentImpactPoolAmount", + "type": "uint256" } ], "internalType": "struct MarketPoolValueInfo.Props", @@ -2503,6 +2623,11 @@ "internalType": "uint256", "name": "validFromTime", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" } ], "internalType": "struct Order.Numbers", @@ -2535,6 +2660,11 @@ "internalType": "struct Order.Flags", "name": "flags", "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" } ], "internalType": "struct Order.Props", @@ -2795,6 +2925,11 @@ "name": "collateralAmount", "type": "uint256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "uint256", "name": "borrowingFactor", @@ -2992,6 +3127,11 @@ "name": "collateralAmount", "type": "uint256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "uint256", "name": "borrowingFactor", @@ -3319,12 +3459,27 @@ }, { "internalType": "uint256", - "name": "priceImpactDiffUsd", + "name": "executionPrice", "type": "uint256" }, + { + "internalType": "bool", + "name": "balanceWasImproved", + "type": "bool" + }, + { + "internalType": "int256", + "name": "proportionalPendingImpactUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "totalImpactUsd", + "type": "int256" + }, { "internalType": "uint256", - "name": "executionPrice", + "name": "priceImpactDiffUsd", "type": "uint256" } ], @@ -3487,6 +3642,11 @@ "name": "collateralAmount", "type": "uint256" }, + { + "internalType": "int256", + "name": "pendingImpactAmount", + "type": "int256" + }, { "internalType": "uint256", "name": "borrowingFactor", @@ -3814,12 +3974,27 @@ }, { "internalType": "uint256", - "name": "priceImpactDiffUsd", + "name": "executionPrice", "type": "uint256" }, + { + "internalType": "bool", + "name": "balanceWasImproved", + "type": "bool" + }, + { + "internalType": "int256", + "name": "proportionalPendingImpactUsd", + "type": "int256" + }, + { + "internalType": "int256", + "name": "totalImpactUsd", + "type": "int256" + }, { "internalType": "uint256", - "name": "executionPrice", + "name": "priceImpactDiffUsd", "type": "uint256" } ], @@ -4055,11 +4230,21 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" } ], "internalType": "struct Shift.Numbers", "name": "numbers", "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" } ], "internalType": "struct Shift.Props", @@ -4404,6 +4589,11 @@ "internalType": "uint256", "name": "callbackGasLimit", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "srcChainId", + "type": "uint256" } ], "internalType": "struct Withdrawal.Numbers", @@ -4421,6 +4611,11 @@ "internalType": "struct Withdrawal.Flags", "name": "flags", "type": "tuple" + }, + { + "internalType": "bytes32[]", + "name": "_dataList", + "type": "bytes32[]" } ], "internalType": "struct Withdrawal.Props", @@ -4661,6 +4856,11 @@ "internalType": "bool", "name": "shouldValidateMinCollateralUsd", "type": "bool" + }, + { + "internalType": "bool", + "name": "forLiquidation", + "type": "bool" } ], "name": "isPositionLiquidatable", @@ -4701,337 +4901,5 @@ "stateMutability": "view", "type": "function" } - ], - "linkReferences": { - "contracts/deposit/DepositStoreUtils.sol": { - "DepositStoreUtils": [ - { - "length": 20, - "start": 2495 - } - ] - }, - "contracts/market/MarketStoreUtils.sol": { - "MarketStoreUtils": [ - { - "length": 20, - "start": 3440 - }, - { - "length": 20, - "start": 3703 - }, - { - "length": 20, - "start": 4153 - }, - { - "length": 20, - "start": 4566 - }, - { - "length": 20, - "start": 4739 - } - ] - }, - "contracts/market/MarketUtils.sol": { - "MarketUtils": [ - { - "length": 20, - "start": 2198 - } - ] - }, - "contracts/position/PositionStoreUtils.sol": { - "PositionStoreUtils": [ - { - "length": 20, - "start": 1669 - }, - { - "length": 20, - "start": 2355 - }, - { - "length": 20, - "start": 5061 - } - ] - }, - "contracts/position/PositionUtils.sol": { - "PositionUtils": [ - { - "length": 20, - "start": 1795 - }, - { - "length": 20, - "start": 5200 - } - ] - }, - "contracts/reader/ReaderDepositUtils.sol": { - "ReaderDepositUtils": [ - { - "length": 20, - "start": 3996 - } - ] - }, - "contracts/reader/ReaderPositionUtils.sol": { - "ReaderPositionUtils": [ - { - "length": 20, - "start": 1956 - }, - { - "length": 20, - "start": 4278 - }, - { - "length": 20, - "start": 4930 - }, - { - "length": 20, - "start": 5482 - } - ] - }, - "contracts/reader/ReaderPricingUtils.sol": { - "ReaderPricingUtils": [ - { - "length": 20, - "start": 3014 - }, - { - "length": 20, - "start": 3565 - }, - { - "length": 20, - "start": 3841 - } - ] - }, - "contracts/reader/ReaderUtils.sol": { - "ReaderUtils": [ - { - "length": 20, - "start": 2788 - }, - { - "length": 20, - "start": 3166 - }, - { - "length": 20, - "start": 3303 - }, - { - "length": 20, - "start": 4416 - }, - { - "length": 20, - "start": 5349 - }, - { - "length": 20, - "start": 5646 - } - ] - }, - "contracts/reader/ReaderWithdrawalUtils.sol": { - "ReaderWithdrawalUtils": [ - { - "length": 20, - "start": 2638 - } - ] - }, - "contracts/shift/ShiftStoreUtils.sol": { - "ShiftStoreUtils": [ - { - "length": 20, - "start": 4804 - } - ] - }, - "contracts/withdrawal/WithdrawalStoreUtils.sol": { - "WithdrawalStoreUtils": [ - { - "length": 20, - "start": 5767 - } - ] - } - }, - "deployedLinkReferences": { - "contracts/deposit/DepositStoreUtils.sol": { - "DepositStoreUtils": [ - { - "length": 20, - "start": 2462 - } - ] - }, - "contracts/market/MarketStoreUtils.sol": { - "MarketStoreUtils": [ - { - "length": 20, - "start": 3407 - }, - { - "length": 20, - "start": 3670 - }, - { - "length": 20, - "start": 4120 - }, - { - "length": 20, - "start": 4533 - }, - { - "length": 20, - "start": 4706 - } - ] - }, - "contracts/market/MarketUtils.sol": { - "MarketUtils": [ - { - "length": 20, - "start": 2165 - } - ] - }, - "contracts/position/PositionStoreUtils.sol": { - "PositionStoreUtils": [ - { - "length": 20, - "start": 1636 - }, - { - "length": 20, - "start": 2322 - }, - { - "length": 20, - "start": 5028 - } - ] - }, - "contracts/position/PositionUtils.sol": { - "PositionUtils": [ - { - "length": 20, - "start": 1762 - }, - { - "length": 20, - "start": 5167 - } - ] - }, - "contracts/reader/ReaderDepositUtils.sol": { - "ReaderDepositUtils": [ - { - "length": 20, - "start": 3963 - } - ] - }, - "contracts/reader/ReaderPositionUtils.sol": { - "ReaderPositionUtils": [ - { - "length": 20, - "start": 1923 - }, - { - "length": 20, - "start": 4245 - }, - { - "length": 20, - "start": 4897 - }, - { - "length": 20, - "start": 5449 - } - ] - }, - "contracts/reader/ReaderPricingUtils.sol": { - "ReaderPricingUtils": [ - { - "length": 20, - "start": 2981 - }, - { - "length": 20, - "start": 3532 - }, - { - "length": 20, - "start": 3808 - } - ] - }, - "contracts/reader/ReaderUtils.sol": { - "ReaderUtils": [ - { - "length": 20, - "start": 2755 - }, - { - "length": 20, - "start": 3133 - }, - { - "length": 20, - "start": 3270 - }, - { - "length": 20, - "start": 4383 - }, - { - "length": 20, - "start": 5316 - }, - { - "length": 20, - "start": 5613 - } - ] - }, - "contracts/reader/ReaderWithdrawalUtils.sol": { - "ReaderWithdrawalUtils": [ - { - "length": 20, - "start": 2605 - } - ] - }, - "contracts/shift/ShiftStoreUtils.sol": { - "ShiftStoreUtils": [ - { - "length": 20, - "start": 4771 - } - ] - }, - "contracts/withdrawal/WithdrawalStoreUtils.sol": { - "WithdrawalStoreUtils": [ - { - "length": 20, - "start": 5734 - } - ] - } - } + ] } diff --git a/sdk/src/abis/SyntheticsRouter.json b/sdk/src/abis/SyntheticsRouter.json index a7d3d239e8..03aaf7617c 100644 --- a/sdk/src/abis/SyntheticsRouter.json +++ b/sdk/src/abis/SyntheticsRouter.json @@ -1,7 +1,4 @@ { - "_format": "hh-sol-artifact-1", - "contractName": "Router", - "sourceName": "contracts/router/Router.sol", "abi": [ { "inputs": [ @@ -71,7 +68,5 @@ "stateMutability": "view", "type": "function" } - ], - "linkReferences": {}, - "deployedLinkReferences": {} -} + ] +} \ No newline at end of file diff --git a/sdk/src/abis/index.ts b/sdk/src/abis/index.ts index 54f1534ccf..d08ec1ac47 100644 --- a/sdk/src/abis/index.ts +++ b/sdk/src/abis/index.ts @@ -15,8 +15,17 @@ import GlvRouter from "./GlvRouter.json"; import GMT from "./GMT.json"; import GmxMigrator from "./GmxMigrator.json"; import GovToken from "./GovToken.json"; +import LayerZeroProvider from "./LayerZeroProvider.json"; import MintableBaseToken from "./MintableBaseToken.json"; import Multicall from "./Multicall.json"; +import MultichainClaimsRouter from "./MultichainClaimsRouter.json"; +import MultichainGlvRouter from "./MultichainGlvRouter.json"; +import MultichainGmRouter from "./MultichainGmRouter.json"; +import MultichainOrderRouter from "./MultichainOrderRouter.json"; +import MultichainSubaccountRouter from "./MultichainSubaccountRouter.json"; +import MultichainTransferRouter from "./MultichainTransferRouter.json"; +import MultichainUtils from "./MultichainUtils.json"; +import MultichainVault from "./MultichainVault.json"; import OrderBook from "./OrderBook.json"; import OrderBookReader from "./OrderBookReader.json"; import OrderExecutor from "./OrderExecutor.json"; @@ -25,6 +34,7 @@ import PositionRouter from "./PositionRouter.json"; import Reader from "./Reader.json"; import ReaderV2 from "./ReaderV2.json"; import ReferralStorage from "./ReferralStorage.json"; +import RelayParams from "./RelayParams.json"; import RewardReader from "./RewardReader.json"; import RewardRouter from "./RewardRouter.json"; import RewardTracker from "./RewardTracker.json"; @@ -50,20 +60,36 @@ import YieldFarm from "./YieldFarm.json"; import YieldToken from "./YieldToken.json"; export type AbiId = + | "AbstractSubaccountApprovalNonceable" + | "ArbitrumNodeInterface" + | "ClaimHandler" | "CustomErrors" | "DataStore" - | "ERC721" | "ERC20" + | "ERC20PermitInterface" + | "ERC20PermitInterface" + | "ERC721" | "EventEmitter" | "ExchangeRouter" + | "GelatoRelayRouter" + | "GelatoRelayRouter" | "GlpManager" | "GlvReader" | "GlvRouter" | "GMT" | "GmxMigrator" | "GovToken" + | "LayerZeroProvider" | "MintableBaseToken" | "Multicall" + | "MultichainClaimsRouter" + | "MultichainGlvRouter" + | "MultichainGmRouter" + | "MultichainOrderRouter" + | "MultichainSubaccountRouter" + | "MultichainTransferRouter" + | "MultichainUtils" + | "MultichainVault" | "OrderBook" | "OrderBookReader" | "OrderExecutor" @@ -72,11 +98,15 @@ export type AbiId = | "Reader" | "ReaderV2" | "ReferralStorage" + | "RelayParams" | "RewardReader" | "RewardRouter" | "RewardTracker" - | "Router-v2" | "Router" + | "RouterV2" + | "StBTC" + | "SubaccountGelatoRelayRouter" + | "SubaccountGelatoRelayRouter" | "SubaccountRouter" | "SyntheticsReader" | "SyntheticsRouter" @@ -92,13 +122,7 @@ export type AbiId = | "Vester" | "WETH" | "YieldFarm" - | "YieldToken" - | "SubaccountGelatoRelayRouter" - | "ERC20PermitInterface" - | "GelatoRelayRouter" - | "ArbitrumNodeInterface" - | "StBTC" - | "ClaimHandler"; + | "YieldToken"; /** Copied from ethers to enable compatibility with GMX UI */ interface JsonFragmentType { @@ -121,22 +145,57 @@ interface JsonFragment { readonly gas?: string; } +const AbstractSubaccountApprovalNonceable = [ + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "subaccountApprovalNonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + export const abis: Record = { + AbstractSubaccountApprovalNonceable, + ArbitrumNodeInterface: ArbitrumNodeInterface.abi, + ClaimHandler: ClaimHandler.abi, CustomErrors: CustomErrors.abi, DataStore: DataStore.abi, - ERC721: ERC721.abi, ERC20: erc20Abi, ERC20PermitInterface: ERC20PermitInterface.abi, + ERC721: ERC721.abi, EventEmitter: EventEmitter.abi, ExchangeRouter: ExchangeRouter.abi, + GelatoRelayRouter: GelatoRelayRouter.abi, GlpManager: GlpManager.abi, GlvReader: GlvReader.abi, GlvRouter: GlvRouter.abi, GMT: GMT.abi, GmxMigrator: GmxMigrator.abi, GovToken: GovToken.abi, + LayerZeroProvider: LayerZeroProvider.abi, MintableBaseToken: MintableBaseToken.abi, Multicall: Multicall.abi, + MultichainClaimsRouter: MultichainClaimsRouter.abi, + MultichainGlvRouter: MultichainGlvRouter.abi, + MultichainGmRouter: MultichainGmRouter.abi, + MultichainOrderRouter: MultichainOrderRouter.abi, + MultichainSubaccountRouter: MultichainSubaccountRouter.abi, + MultichainTransferRouter: MultichainTransferRouter.abi, + MultichainUtils: MultichainUtils.abi, + MultichainVault: MultichainVault.abi, OrderBook: OrderBook.abi, OrderBookReader: OrderBookReader.abi, OrderExecutor: OrderExecutor.abi, @@ -145,11 +204,14 @@ export const abis: Record = { Reader: Reader.abi, ReaderV2: ReaderV2.abi, ReferralStorage: ReferralStorage.abi, + RelayParams: RelayParams.abi, RewardReader: RewardReader.abi, RewardRouter: RewardRouter.abi, RewardTracker: RewardTracker.abi, - RouterV2: RouterV2.abi, Router: Router.abi, + RouterV2: RouterV2.abi, + StBTC: StBTC.abi, + SubaccountGelatoRelayRouter: SubaccountGelatoRelayRouter.abi, SubaccountRouter: SubaccountRouter.abi, SyntheticsReader: SyntheticsReader.abi, SyntheticsRouter: SyntheticsRouter.abi, @@ -166,9 +228,4 @@ export const abis: Record = { WETH: WETH.abi, YieldFarm: YieldFarm.abi, YieldToken: YieldToken.abi, - SubaccountGelatoRelayRouter: SubaccountGelatoRelayRouter.abi, - GelatoRelayRouter: GelatoRelayRouter.abi, - ArbitrumNodeInterface: ArbitrumNodeInterface.abi, - StBTC: StBTC.abi, - ClaimHandler: ClaimHandler.abi, -} as any; +} satisfies Record as any; diff --git a/sdk/src/configs/__tests__/markets.spec.ts b/sdk/src/configs/__tests__/markets.spec.ts index 7f57976dc9..d0299fb21c 100644 --- a/sdk/src/configs/__tests__/markets.spec.ts +++ b/sdk/src/configs/__tests__/markets.spec.ts @@ -1,7 +1,7 @@ import { withRetry } from "viem"; -import { describe, it, expect } from "vitest"; +import { describe, expect, it } from "vitest"; -import { SUPPORTED_CHAIN_IDS } from "configs/chains"; +import { CONTRACTS_CHAIN_IDS_DEV } from "configs/chains"; import { MARKETS } from "configs/markets"; import { getOracleKeeperUrl } from "configs/oracleKeeper"; @@ -24,7 +24,7 @@ const getKeeperMarkets = async (chainId: number): Promise<{ markets: KeeperMarke }; describe("markets config", () => { - SUPPORTED_CHAIN_IDS.forEach(async (chainId) => { + CONTRACTS_CHAIN_IDS_DEV.forEach(async (chainId) => { it(`markets should be consistent with keeper for ${chainId}`, async () => { const keeperMarkets = await withRetry(() => getKeeperMarkets(chainId), { retryCount: 2, diff --git a/sdk/src/configs/__tests__/permits.spec.ts b/sdk/src/configs/__tests__/permits.spec.ts index 1843cb63ac..de813348db 100644 --- a/sdk/src/configs/__tests__/permits.spec.ts +++ b/sdk/src/configs/__tests__/permits.spec.ts @@ -2,13 +2,13 @@ import { createPublicClient, http, zeroAddress } from "viem"; import { describe, it } from "vitest"; import { abis } from "abis"; -import { getChainName, getViemChain, SUPPORTED_CHAIN_IDS } from "configs/chains"; +import { getChainName, getViemChain, CONTRACTS_CHAIN_IDS } from "configs/chains"; import { getV2Tokens } from "configs/tokens"; const validPermitErrorParts = ["ERC20Permit", "permit-expired", "permit is expired"]; describe("UI token permit configs", () => { - SUPPORTED_CHAIN_IDS.forEach(async (chainId) => { + CONTRACTS_CHAIN_IDS.forEach(async (chainId) => { const publicClient = createPublicClient({ chain: getViemChain(chainId) as any, transport: http(), diff --git a/sdk/src/configs/__tests__/tokens.spec.ts b/sdk/src/configs/__tests__/tokens.spec.ts index ff6c7566a6..e68bc7d71f 100644 --- a/sdk/src/configs/__tests__/tokens.spec.ts +++ b/sdk/src/configs/__tests__/tokens.spec.ts @@ -1,7 +1,7 @@ import { withRetry, zeroAddress } from "viem"; import { describe, expect, it } from "vitest"; -import { ARBITRUM, AVALANCHE, BOTANIX, getChainName, SUPPORTED_CHAIN_IDS } from "configs/chains"; +import { ARBITRUM, AVALANCHE, BOTANIX, getChainName, CONTRACTS_CHAIN_IDS } from "configs/chains"; import { getOracleKeeperUrl } from "configs/oracleKeeper"; import { TOKENS } from "configs/tokens"; @@ -36,7 +36,7 @@ const getIgnoredTokensByChain = (chainId: number) => { }; describe("tokens config", () => { - SUPPORTED_CHAIN_IDS.forEach(async (chainId) => { + CONTRACTS_CHAIN_IDS.forEach(async (chainId) => { it(`tokens should be consistent with keeper for ${getChainName(chainId)}`, async () => { const keeperTokens = await withRetry(() => getKeeperTokens(chainId), { retryCount: 2, diff --git a/sdk/src/configs/batch.ts b/sdk/src/configs/batch.ts index a1d460eb3f..19a5119e2e 100644 --- a/sdk/src/configs/batch.ts +++ b/sdk/src/configs/batch.ts @@ -1,9 +1,19 @@ import { ClientConfig, MulticallBatchOptions } from "viem"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiSupportedChain } from "./chains"; +import { + AnyChainId, + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, +} from "./chains"; export const BATCH_CONFIGS: Record< - UiSupportedChain, + AnyChainId, { http: MulticallBatchOptions; client: ClientConfig["batch"]; @@ -33,6 +43,20 @@ export const BATCH_CONFIGS: Record< }, }, }, + + [SOURCE_BASE_MAINNET]: { + http: { + batchSize: 0, + wait: 0, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 0, + }, + }, + }, + [AVALANCHE_FUJI]: { http: { batchSize: 40, @@ -57,4 +81,40 @@ export const BATCH_CONFIGS: Record< }, }, }, + [ARBITRUM_SEPOLIA]: { + http: { + batchSize: 40, + wait: 100, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 100, + }, + }, + }, + [SOURCE_OPTIMISM_SEPOLIA]: { + http: { + batchSize: 40, + wait: 100, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 100, + }, + }, + }, + [SOURCE_SEPOLIA]: { + http: { + batchSize: 40, + wait: 100, + }, + client: { + multicall: { + batchSize: 1024 * 1024, + wait: 100, + }, + }, + }, }; diff --git a/sdk/src/configs/chains.ts b/sdk/src/configs/chains.ts index 677f066e46..8656c8558f 100644 --- a/sdk/src/configs/chains.ts +++ b/sdk/src/configs/chains.ts @@ -1,30 +1,72 @@ import { defineChain } from "viem"; -import { arbitrum, avalanche, avalancheFuji, Chain } from "viem/chains"; +import { + arbitrum, + arbitrumSepolia, + avalanche, + avalancheFuji, + base, + Chain, + optimismSepolia, + sepolia, +} from "viem/chains"; +import type { GasLimitsConfig } from "types/fees"; + +export const ETH_MAINNET = 1; +// Production export const AVALANCHE = 43114; -export const AVALANCHE_FUJI = 43113; export const ARBITRUM = 42161; -export const ETH_MAINNET = 1; export const BOTANIX = 3637; +// Production source +export const SOURCE_BASE_MAINNET = 8453; +// Testnets +export const AVALANCHE_FUJI = 43113; +export const ARBITRUM_SEPOLIA = 421614; +// Testnet source +export const SOURCE_OPTIMISM_SEPOLIA = 11155420; +export const SOURCE_SEPOLIA = 11155111; + +export const CONTRACTS_CHAIN_IDS: ContractsChainId[] = [ARBITRUM, AVALANCHE, BOTANIX]; +export const CONTRACTS_CHAIN_IDS_DEV: ContractsChainId[] = [...CONTRACTS_CHAIN_IDS, AVALANCHE_FUJI, ARBITRUM_SEPOLIA]; -export const SUPPORTED_CHAIN_IDS: UiSupportedChain[] = [ARBITRUM, AVALANCHE, BOTANIX]; -export const SUPPORTED_CHAIN_IDS_DEV: UiSupportedChain[] = [...SUPPORTED_CHAIN_IDS, AVALANCHE_FUJI]; +export type ContractsChainId = + | typeof ARBITRUM + | typeof AVALANCHE + | typeof AVALANCHE_FUJI + | typeof BOTANIX + | typeof ARBITRUM_SEPOLIA; -export type UiContractsChain = typeof ARBITRUM | typeof AVALANCHE | typeof AVALANCHE_FUJI | typeof BOTANIX; -export type UiSupportedChain = UiContractsChain; +export type SettlementChainId = typeof ARBITRUM_SEPOLIA | typeof ARBITRUM | typeof AVALANCHE; +export type SourceChainId = typeof SOURCE_OPTIMISM_SEPOLIA | typeof SOURCE_SEPOLIA | typeof SOURCE_BASE_MAINNET; +export type AnyChainId = ContractsChainId | SettlementChainId | SourceChainId; -export const CHAIN_NAMES_MAP: Record = { +export type ChainName = + | "Arbitrum" + | "Avalanche" + | "Avalanche Fuji" + | "Arbitrum Sepolia" + | "Optimism Sepolia" + | "Sepolia" + | "Botanix" + | "Base"; + +export const CHAIN_NAMES_MAP: Record = { [ARBITRUM]: "Arbitrum", [AVALANCHE]: "Avalanche", [AVALANCHE_FUJI]: "Avalanche Fuji", [BOTANIX]: "Botanix", + [ARBITRUM_SEPOLIA]: "Arbitrum Sepolia", + [SOURCE_OPTIMISM_SEPOLIA]: "Optimism Sepolia", + [SOURCE_SEPOLIA]: "Sepolia", + [SOURCE_BASE_MAINNET]: "Base", }; -export const HIGH_EXECUTION_FEES_MAP: Record = { +export const HIGH_EXECUTION_FEES_MAP: Record = { [ARBITRUM]: 5, // 5 USD [AVALANCHE]: 5, // 5 USD [AVALANCHE_FUJI]: 5, // 5 USD [BOTANIX]: 5, // 5 USD + [ARBITRUM_SEPOLIA]: 5, // 5 USD }; // added to maxPriorityFeePerGas @@ -46,14 +88,15 @@ export const GAS_PRICE_PREMIUM_MAP: Record = { /* that was a constant value in ethers v5, after ethers v6 migration we use it as a minimum for maxPriorityFeePerGas */ -export const MAX_PRIORITY_FEE_PER_GAS_MAP: Record = { +export const MAX_PRIORITY_FEE_PER_GAS_MAP: Record = { [ARBITRUM]: 1500000000n, [AVALANCHE]: 1500000000n, [AVALANCHE_FUJI]: 1500000000n, + [ARBITRUM_SEPOLIA]: 1500000000n, [BOTANIX]: 7n, }; -export const EXCESSIVE_EXECUTION_FEES_MAP: Record = { +export const EXCESSIVE_EXECUTION_FEES_MAP: Partial> = { [ARBITRUM]: 10, // 10 USD [AVALANCHE]: 10, // 10 USD [AVALANCHE_FUJI]: 10, // 10 USD @@ -62,7 +105,7 @@ export const EXCESSIVE_EXECUTION_FEES_MAP: Record = { // avoid botanix gas spikes when chain is not actively used // if set, execution fee value should not be less than this in USD equivalent -export const MIN_EXECUTION_FEE_USD: Record = { +export const MIN_EXECUTION_FEE_USD: Partial> = { [ARBITRUM]: undefined, [AVALANCHE]: undefined, [AVALANCHE_FUJI]: undefined, @@ -121,14 +164,18 @@ export const botanix: Chain = defineChain({ }, }); -const VIEM_CHAIN_BY_CHAIN_ID: Record = { +const VIEM_CHAIN_BY_CHAIN_ID: Record = { [AVALANCHE_FUJI]: avalancheFuji, [ARBITRUM]: arbitrum, [AVALANCHE]: avalanche, + [ARBITRUM_SEPOLIA]: arbitrumSepolia, [BOTANIX]: botanix, + [SOURCE_OPTIMISM_SEPOLIA]: optimismSepolia, + [SOURCE_SEPOLIA]: sepolia, + [SOURCE_BASE_MAINNET]: base, }; -export function getChainName(chainId: number) { +export function getChainName(chainId: number): ChainName { return CHAIN_NAMES_MAP[chainId]; } @@ -144,12 +191,12 @@ export function getExcessiveExecutionFee(chainId: number) { return EXCESSIVE_EXECUTION_FEES_MAP[chainId] ?? 10; } -export function isSupportedChain(chainId: number, dev = false) { - return (dev ? SUPPORTED_CHAIN_IDS_DEV : SUPPORTED_CHAIN_IDS).includes(chainId as UiSupportedChain); +export function isContractsChain(chainId: number, dev = false): chainId is ContractsChainId { + return (dev ? CONTRACTS_CHAIN_IDS_DEV : CONTRACTS_CHAIN_IDS).includes(chainId as ContractsChainId); } export const EXECUTION_FEE_CONFIG_V2: { - [chainId in UiSupportedChain]: { + [chainId in ContractsChainId]: { shouldUseMaxPriorityFeePerGas: boolean; defaultBufferBps?: number; }; @@ -166,43 +213,59 @@ export const EXECUTION_FEE_CONFIG_V2: { shouldUseMaxPriorityFeePerGas: false, defaultBufferBps: 3000, // 30% }, + [ARBITRUM_SEPOLIA]: { + shouldUseMaxPriorityFeePerGas: false, + defaultBufferBps: 1000, // 10% + }, [BOTANIX]: { shouldUseMaxPriorityFeePerGas: true, defaultBufferBps: 3000, // 30% }, }; -export const GAS_LIMITS_STATIC_CONFIG: Record< - UiSupportedChain, - { - createOrderGasLimit: bigint; - updateOrderGasLimit: bigint; - cancelOrderGasLimit: bigint; - tokenPermitGasLimit: bigint; - } -> = { +type StaticGasLimitsConfig = Pick< + GasLimitsConfig, + | "createOrderGasLimit" + | "updateOrderGasLimit" + | "cancelOrderGasLimit" + | "tokenPermitGasLimit" + | "gmxAccountCollateralGasLimit" +>; + +export const GAS_LIMITS_STATIC_CONFIG: Record = { [ARBITRUM]: { createOrderGasLimit: 1_000_000n, updateOrderGasLimit: 800_000n, cancelOrderGasLimit: 700_000n, tokenPermitGasLimit: 90_000n, + gmxAccountCollateralGasLimit: 0n, }, [AVALANCHE]: { createOrderGasLimit: 1_000_000n, updateOrderGasLimit: 800_000n, cancelOrderGasLimit: 700_000n, tokenPermitGasLimit: 90_000n, + gmxAccountCollateralGasLimit: 0n, }, [AVALANCHE_FUJI]: { createOrderGasLimit: 1_000_000n, updateOrderGasLimit: 800_000n, cancelOrderGasLimit: 700_000n, tokenPermitGasLimit: 90_000n, + gmxAccountCollateralGasLimit: 0n, + }, + [ARBITRUM_SEPOLIA]: { + createOrderGasLimit: 1_000_000n, + updateOrderGasLimit: 800_000n, + cancelOrderGasLimit: 1_500_000n, + tokenPermitGasLimit: 90_000n, + gmxAccountCollateralGasLimit: 400_000n, }, [BOTANIX]: { createOrderGasLimit: 1_000_000n, updateOrderGasLimit: 800_000n, cancelOrderGasLimit: 700_000n, tokenPermitGasLimit: 90_000n, + gmxAccountCollateralGasLimit: 0n, }, }; diff --git a/sdk/src/configs/contracts.ts b/sdk/src/configs/contracts.ts index b58e862a2a..a6f6e04b94 100644 --- a/sdk/src/configs/contracts.ts +++ b/sdk/src/configs/contracts.ts @@ -1,10 +1,10 @@ import { type Address, zeroAddress } from "viem"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "./chains"; export const CONTRACTS = { [ARBITRUM]: { - // arbitrum mainnet + // V1 Vault: "0x489ee077994B6658eAfA855C308275EAd8097C4A", Router: "0xaBBc5F99639c9B6bCb58544ddf04EFA6802F4064", VaultReader: "0xfebB9f4CAC4cD523598fE1C5771181440143F24A", @@ -50,33 +50,44 @@ export const CONTRACTS = { // Synthetics DataStore: "0xFD70de6b91282D8017aA4E741e9Ae325CAb992d8", EventEmitter: "0xC8ee91A54287DB53897056e12D9819156D3822Fb", - SubaccountRouter: "0xa329221a77BE08485f59310b873b14815c82E10D", - ExchangeRouter: "0x602b805EedddBbD9ddff44A7dcBD46cb07849685", + SubaccountRouter: "0x5b9A353F18d543B9F8a57B2AE50a4FBc80033EC1", + ExchangeRouter: "0x87d66368cD08a7Ca42252f5ab44B2fb6d1Fb8d15", DepositVault: "0xF89e77e8Dc11691C9e8757e84aaFbCD8A67d7A55", WithdrawalVault: "0x0628D46b5D145f183AdB6Ef1f2c97eD1C4701C55", OrderVault: "0x31eF83a530Fde1B38EE9A18093A333D8Bbbc40D5", ShiftVault: "0xfe99609C4AA83ff6816b64563Bdffd7fa68753Ab", - SyntheticsReader: "0xcF2845Ab3866842A6b51Fb6a551b92dF58333574", + SyntheticsReader: "0x65A6CC451BAfF7e7B4FDAb4157763aB4b6b44D0E", SyntheticsRouter: "0x7452c558d45f8afC8c83dAe62C3f8A5BE19c71f6", - GlvReader: "0x6a9505D0B44cFA863d9281EA5B0b34cB36243b45", - GlvRouter: "0x994c598e3b0661bb805d53c6fa6b4504b23b68dd", + GlvReader: "0xb51e34dc3A7c80E4ABbC3800aD0e487b7b878339", + GlvRouter: "0x10Fa5Bd343373101654E896B43Ca38Fd8f3789F9", GlvVault: "0x393053B58f9678C9c28c2cE941fF6cac49C3F8f9", - GelatoRelayRouter: "0x9EB239eDf4c6f4c4fC9d30ea2017F8716d049C8D", - SubaccountGelatoRelayRouter: "0x5F345B765d5856bC0843cEE8bE234b575eC77DBC", + GelatoRelayRouter: "0x0C08518C41755C6907135266dCCf09d51aE53CC4", + SubaccountGelatoRelayRouter: "0xA1D94802EcD642051B677dBF37c8E78ce6dd3784", - ExternalHandler: "0x389CEf541397e872dC04421f166B5Bc2E0b374a5", - OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + MultichainClaimsRouter: "0x2A7244EE5373D2F161cE99F0D144c12860D651Af", + MultichainGlvRouter: "0xFdaFa6fbd4B480017FD37205Cb3A24AE93823956", + MultichainGmRouter: "0xF53e30CE07f148fdE6e531Be7dC0b6ad670E8C6e", + MultichainOrderRouter: "0x3c796504d47013Ea0552CCa57373B59DF03D34a0", + MultichainSubaccountRouter: "0x99CD306B777C5aAb842bA65e4f7FF0554ECDe808", + MultichainTransferRouter: "0xC1D1354A948bf717d6d873e5c0bE614359AF954D", + MultichainVault: "0xCeaadFAf6A8C489B250e407987877c5fDfcDBE6E", + LayerZeroProvider: "0x7129Ea01F0826c705d6F7ab01Cf3C06bb83E9397", - ChainlinkPriceFeedProvider: "0x527FB0bCfF63C47761039bB386cFE181A92a4701", + ChainlinkPriceFeedProvider: "0x38B8dB61b724b51e42A88Cb8eC564CD685a0f53B", + ClaimHandler: "0x28f1F4AA95F49FAB62464536A269437B13d48976", - Multicall: "0x842ec2c7d803033edf55e478f461fc547bc54eb2", + // External + ExternalHandler: "0x389CEf541397e872dC04421f166B5Bc2E0b374a5", + OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + Multicall: "0xe79118d6D92a4b23369ba356C90b9A7ABf1CB961", ArbitrumNodeInterface: "0x00000000000000000000000000000000000000C8", - ClaimHandler: "0x28f1F4AA95F49FAB62464536A269437B13d48976", + LayerZeroEndpoint: "0x1a44076050125825900e736c501f859c50fE728c", + GelatoRelayAddress: "0xaBcC9b596420A9E9172FD5938620E265a0f9Df92", }, [AVALANCHE]: { - // avalanche + // V1 Vault: "0x9ab2De34A33fB459b538c43f251eB825645e8595", Router: "0x5F719c2F1095F7B9fc68a68e35B51194f4b6abe8", VaultReader: "0x66eC8fc33A26feAEAe156afA3Cb46923651F6f0D", @@ -123,61 +134,82 @@ export const CONTRACTS = { // Synthetics DataStore: "0x2F0b22339414ADeD7D5F06f9D604c7fF5b2fe3f6", EventEmitter: "0xDb17B211c34240B014ab6d61d4A31FA0C0e20c26", - SubaccountRouter: "0x5aEb6AD978f59e220aA9099e09574e1c5E03AafD", - ExchangeRouter: "0xFa843af557824Be5127eaCB3c4B5D86EADEB73A1", + SubaccountRouter: "0x88a5c6D94634Abd7745f5348e5D8C42868ed4AC3", + ExchangeRouter: "0xF0864BE1C39C0AB28a8f1918BC8321beF8F7C317", DepositVault: "0x90c670825d0C62ede1c5ee9571d6d9a17A722DFF", WithdrawalVault: "0xf5F30B10141E1F63FC11eD772931A8294a591996", OrderVault: "0xD3D60D22d415aD43b7e64b510D86A30f19B1B12C", ShiftVault: "0x7fC46CCb386e9bbBFB49A2639002734C3Ec52b39", - SyntheticsReader: "0xc304F8e9872A9c00371A7406662dC10A10740AA8", + SyntheticsReader: "0x1EC018d2b6ACCA20a0bEDb86450b7E27D1D8355B", SyntheticsRouter: "0x820F5FfC5b525cD4d88Cd91aCf2c28F16530Cc68", - GlvReader: "0xae9596a1C438675AcC75f69d32E21Ac9c8fF99bD", - GlvRouter: "0x16500c1d8ffe2f695d8dcadf753f664993287ae4", + GlvReader: "0x12Ac77003B3D11b0853d1FD12E5AF22a9060eC4b", + GlvRouter: "0x4729D9f61c0159F5e02D2C2e5937B3225e55442C", GlvVault: "0x527FB0bCfF63C47761039bB386cFE181A92a4701", - GelatoRelayRouter: "0x035A9A047d20a486e14A613B04d5a95d7A617c5D", - SubaccountGelatoRelayRouter: "0x3B753c0D0aE55530f24532B8Bb9d0bAcD5B675C0", + GelatoRelayRouter: "0xa61f92ab63cc5C3d60574d40A6e73861c37aaC95", + SubaccountGelatoRelayRouter: "0x58b09FD12863218F2ca156808C2Ae48aaCD0c072", - ExternalHandler: "0xD149573a098223a9185433290a5A5CDbFa54a8A9", - OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + MultichainClaimsRouter: "0x9080f8A35Da53F4200a68533FB1dC1cA05357bDB", + MultichainGlvRouter: "0x2A7244EE5373D2F161cE99F0D144c12860D651Af", + MultichainGmRouter: "0x10Fa5Bd343373101654E896B43Ca38Fd8f3789F9", + MultichainOrderRouter: "0x99CD306B777C5aAb842bA65e4f7FF0554ECDe808", + MultichainSubaccountRouter: "0xB36a4c6cDeDea3f31b3d16F33553F93b96b178F4", + MultichainTransferRouter: "0x8c6e20A2211D1b70cD7c0789EcE44fDB19567621", + MultichainVault: "0x6D5F3c723002847B009D07Fe8e17d6958F153E4e", + LayerZeroProvider: "0xA1D94802EcD642051B677dBF37c8E78ce6dd3784", - ChainlinkPriceFeedProvider: "0x713c6a2479f6C079055A6AD3690D95dEDCEf9e1e", + ChainlinkPriceFeedProvider: "0x05d97cee050bfb81FB3EaD4A9368584F8e72C88e", + ClaimHandler: "0x7FfedCAC2eCb2C29dDc027B60D6F8107295Ff2eA", - Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", + // External + ExternalHandler: "0xD149573a098223a9185433290a5A5CDbFa54a8A9", + OpenOceanRouter: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", + Multicall: "0x50474CAe810B316c294111807F94F9f48527e7F8", ArbitrumNodeInterface: zeroAddress, - ClaimHandler: "0x7FfedCAC2eCb2C29dDc027B60D6F8107295Ff2eA", + LayerZeroEndpoint: "0x1a44076050125825900e736c501f859c50fE728c", + GelatoRelayAddress: "0xaBcC9b596420A9E9172FD5938620E265a0f9Df92", }, [BOTANIX]: { + // Synthetics DataStore: "0xA23B81a89Ab9D7D89fF8fc1b5d8508fB75Cc094d", EventEmitter: "0xAf2E131d483cedE068e21a9228aD91E623a989C2", - SubaccountRouter: "0x31568A44593297788Cae4D0A70b0746c26886208", - ExchangeRouter: "0xB11214E34796d6Df5F17172D82B5F3221E17253d", + SubaccountRouter: "0x11E590f6092D557bF71BaDEd50D81521674F8275", + ExchangeRouter: "0x72fa3978E2E330C7B2debc23CB676A3ae63333F6", DepositVault: "0x4D12C3D3e750e051e87a2F3f7750fBd94767742c", WithdrawalVault: "0x46BAeAEdbF90Ce46310173A04942e2B3B781Bf0e", OrderVault: "0xe52B3700D17B45dE9de7205DEe4685B4B9EC612D", ShiftVault: "0xa7EE2737249e0099906cB079BCEe85f0bbd837d4", - SyntheticsReader: "0xcA3D8Ea2aCfd46D7D3732F4264bD62996A04Bb3F", + SyntheticsReader: "0xa254B60cbB85a92F6151B10E1233639F601f2F0F", SyntheticsRouter: "0x3d472afcd66F954Fe4909EEcDd5c940e9a99290c", - GlvReader: "0x5AE7478d10C7298E06f38E90cf544dAE28fFE88B", - GlvRouter: "0x8C142F1826a6679Abcc9bAa54ddbf11CC080C106", + GlvReader: "0x490d660A21fB75701b7781E191cB888D1FE38315", + GlvRouter: "0x348Eca94e7c6F35430aF1cAccE27C29E9Bef9ae3", GlvVault: "0xd336087512BeF8Df32AF605b492f452Fd6436CD8", - GelatoRelayRouter: "0xfF95979396B138E7e014E91932A12D78d569f3B8", - SubaccountGelatoRelayRouter: "0x0817645a12215EAb65379AEe23fD9f9b69BAa063", + GelatoRelayRouter: "0x7f8eF83C92B48a4B5B954A24D98a6cD0Ed4D160a", + SubaccountGelatoRelayRouter: "0xfbb9C41046E27405224a911f44602C3667f9D8f6", - ExternalHandler: "0x36b906eA6AE7c74aeEE8cDE66D01B3f1f8843872", - OpenOceanRouter: zeroAddress, + MultichainClaimsRouter: "0x790Ee987b9B253374d700b07F16347a7d4C4ff2e", + MultichainGlvRouter: "0xEE027373517a6D96Fe62f70E9A0A395cB5a39Eee", + MultichainGmRouter: "0x4ef8394CD5DD7E3EE6D30824689eF461783a3360", + MultichainOrderRouter: "0x5c5DBbcDf420B5d81d4FfDBa5b26Eb24E6E60d52", + MultichainSubaccountRouter: "0xd3B6E962f135634C43415d57A28E688Fb4f15A58", + MultichainTransferRouter: "0x901f26a57edCe65Ef3FBcCD260433De9B2279852", + MultichainVault: "0x9a535f9343434D96c4a39fF1d90cC685A4F6Fb20", + LayerZeroProvider: "0x61af99b07995cb7Ee8c2FACF6D8fb6042FeAA0d9", - ChainlinkPriceFeedProvider: "0x8c0dF501394C0fee105f92F5CA59D7B876393B99", + ChainlinkPriceFeedProvider: "0xDc613305e9267f0770072dEaB8c03162e0554b2d", + ClaimHandler: "0x3ca0f3ad78a9d0b2a0c060fe86d1141118a285c4", + // External + ExternalHandler: "0x36b906eA6AE7c74aeEE8cDE66D01B3f1f8843872", + OpenOceanRouter: zeroAddress, Multicall: "0x4BaA24f93a657f0c1b4A0Ffc72B91011E35cA46b", - - Timelock: "0xca3e30b51A7c3bd40bFc52a61AB0cE57B3Ab3ad8", - + LayerZeroEndpoint: "0x6F475642a6e85809B1c36Fa62763669b1b48DD5B", ArbitrumNodeInterface: zeroAddress, + GelatoRelayAddress: "0x61aCe8fBA7B80AEf8ED67f37CB60bE00180872aD", Vault: zeroAddress, Reader: zeroAddress, @@ -221,6 +253,7 @@ export const CONTRACTS = { }, [AVALANCHE_FUJI]: { + // V1 Vault: zeroAddress, Router: zeroAddress, VaultReader: zeroAddress, @@ -259,41 +292,128 @@ export const CONTRACTS = { PositionManager: zeroAddress, TraderJoeGmxAvaxPool: zeroAddress, - ReferralStorage: "0x58726dB901C9DF3654F45a37DD307a0C44b6420e", + ReferralStorage: "0x192e82A18a4ab446dD9968f055431b60640B155D", ReferralReader: zeroAddress, // Synthetics DataStore: "0xEA1BFb4Ea9A412dCCd63454AbC127431eBB0F0d4", EventEmitter: "0xc67D98AC5803aFD776958622CeEE332A0B2CabB9", - ExchangeRouter: "0x52A1c10c462ca4e5219d0Eb4da5052cc73F9050D", - SubaccountRouter: "0x0595f01860aa5c4C6091EED096515b4b9FE372CE", + ExchangeRouter: "0x0a458C96Ac0B2a130DA4BdF1aAdD4cb7Be036d11", + SubaccountRouter: "0xD5EE3ECAF5754CE5Ff74847d0caf094EBB12ed5e", DepositVault: "0x2964d242233036C8BDC1ADC795bB4DeA6fb929f2", WithdrawalVault: "0x74d49B6A630Bf519bDb6E4efc4354C420418A6A2", OrderVault: "0x25D23e8E655727F2687CC808BB9589525A6F599B", ShiftVault: "0x257D0EA0B040E2Cd1D456fB4C66d7814102aD346", - SyntheticsReader: "0xA71e8b30c9414852F065e4cE12bbCC05cF50937A", + SyntheticsReader: "0xf82Cc6EB57F8FF86bc5c5e90B8BA83DbBFB517eE", SyntheticsRouter: "0x5e7d61e4C52123ADF651961e4833aCc349b61491", Timelock: zeroAddress, - GlvReader: "0x4599Ed5939C673505B7AFcd020E1d603b0dCAf69", - GlvRouter: "0x377d979AB35Cd848497707ffa6Ee91783f925b80", + GlvReader: "0xdeaC9ea3c72C102f2a9654b8E1A14Ef86Cdd3146", + GlvRouter: "0x6B6595389A0196F882C0f66CB1F401f1D24afEdC", GlvVault: "0x76f93b5240DF811a3fc32bEDd58daA5784e46C96", - GelatoRelayRouter: zeroAddress, - SubaccountGelatoRelayRouter: zeroAddress, + GelatoRelayRouter: "0xC2917611f422b1624D7316375690B532c149F54b", + SubaccountGelatoRelayRouter: "0x9022ADce7c964852475aB0de801932BaDEB0C765", - OpenOceanRouter: zeroAddress, + MultichainClaimsRouter: "0xa080c3E026467E1fa6E76D29A057Bf1261a4ec86", + MultichainGlvRouter: "0x5060A75868ca21A54C650a70E96fa92405831b15", + MultichainGmRouter: "0xe32632F65198eF3080ccDe22A6d23819203dBc42", + MultichainOrderRouter: "0x6169DD9Bc75B1d4B7138109Abe58f5645BA6B8fE", + MultichainSubaccountRouter: "0xa51181CC37D23d3a4b4B263D2B54e1F34B834432", + MultichainTransferRouter: "0x0bD6966B894D9704Ce540babcd425C93d2BD549C", + MultichainVault: "0xFd86A5d9D6dF6f0cB6B0e6A18Bea7CB07Ada4F79", + LayerZeroProvider: "0xdaa9194bFD143Af71A8d2cFc8F2c0643094a77C5", + + ChainlinkPriceFeedProvider: "0x2e149AbC99cDC98FB0207d6F184DC323CEBB955B", + ClaimHandler: "0x01D68cf13B8f67b041b8D565931e1370774cCeBd", + // External + OpenOceanRouter: zeroAddress, ExternalHandler: "0x0d9F90c66C392c4d0e70EE0d399c43729B942512", + Multicall: "0x966D1F5c54a714C6443205F0Ec49eEF81F10fdfD", + ArbitrumNodeInterface: zeroAddress, + LayerZeroEndpoint: "0x6EDCE65403992e310A62460808c4b910D972f10f", + }, - ChainlinkPriceFeedProvider: zeroAddress, + [ARBITRUM_SEPOLIA]: { + // Synthetics + DataStore: "0xCF4c2C4c53157BcC01A596e3788fFF69cBBCD201", + EventEmitter: "0xa973c2692C1556E1a3d478e745e9a75624AEDc73", + ExchangeRouter: "0x657F9215FA1e839FbA15cF44B1C00D95cF71ed10", + SubaccountRouter: "0x7d4dD31B32F6Ae51893B6cffCAb15E75eA30D69b", + DepositVault: "0x809Ea82C394beB993c2b6B0d73b8FD07ab92DE5A", + WithdrawalVault: "0x7601c9dBbDCf1f5ED1E7Adba4EFd9f2cADa037A5", + OrderVault: "0x1b8AC606de71686fd2a1AEDEcb6E0EFba28909a2", + ShiftVault: "0x6b6F9B7B9a6b69942DAE74FB95E694ec277117af", + SyntheticsReader: "0x37a0A165389B2f959a04685aC8fc126739e86926", + SyntheticsRouter: "0x72F13a44C8ba16a678CAD549F17bc9e06d2B8bD2", + + GlvReader: "0x4843D570c726cFb44574c1769f721a49c7e9c350", + GlvRouter: "0x7F8af0741e8925C132E84147762902EBBc485d11", + GlvVault: "0x40bD50de0977c68ecB958ED4A065E14E1091ce64", + + GelatoRelayRouter: "0x44904137A4d8734a5AB13B32083FFd6B93664491", + SubaccountGelatoRelayRouter: "0x209E4408D68EE049957dBba7Ac62177f10ee00ab", + + MultichainClaimsRouter: "0xe06534c26c90AE8c3241BC90dDB69d4Af438f17f", + MultichainGlvRouter: "0x29b9a624a29327b1c76317bfF08373281c582B79", + MultichainGmRouter: "0x9868Ab73D1cB4DcEEd74e5eB9f86346C935488F3", + MultichainOrderRouter: "0x2B977188b3Bf8fbCa2Ca5D6e00DC8542b7690C9E", + MultichainSubaccountRouter: "0xf8fbE9411f90618B3c68A8826555Ab54dE090ED7", + MultichainTransferRouter: "0xeCfcA6af46B9d20793f82b28bc749dfFC6DEE535", + MultichainVault: "0xCd46EF5ed7d08B345c47b5a193A719861Aa2CD91", + LayerZeroProvider: "0x3f85e237E950A7FB7cfb6DD4C262353A82588d51", + + ChainlinkPriceFeedProvider: "0xa76BF7f977E80ac0bff49BDC98a27b7b070a937d", + ReferralStorage: "0xBbCdA58c228Bb29B5769778181c81Ac8aC546c11", + ClaimHandler: "0x96FE82b9C6FE46af537cE465B3befBD7b076C982", + + // External + Multicall: "0xD84793ae65842fFac5C20Ab8eaBD699ea1FC79F3", + NATIVE_TOKEN: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + LayerZeroEndpoint: "0x6EDCE65403992e310A62460808c4b910D972f10f", + ArbitrumNodeInterface: "0x00000000000000000000000000000000000000C8", + GelatoRelayAddress: "0xaBcC9b596420A9E9172FD5938620E265a0f9Df92", + ExternalHandler: zeroAddress, - Multicall: "0x0f53e512b49202a37c81c6085417C9a9005F2196", - ArbitrumNodeInterface: zeroAddress, + GLP: zeroAddress, + GMX: zeroAddress, + ES_GMX: zeroAddress, + BN_GMX: zeroAddress, + USDG: zeroAddress, + ES_GMX_IOU: zeroAddress, + OpenOceanRouter: zeroAddress, + Vault: zeroAddress, + PositionRouter: zeroAddress, + RewardRouter: zeroAddress, + StakedGmxTracker: zeroAddress, + BonusGmxTracker: zeroAddress, + FeeGmxTracker: zeroAddress, + StakedGlpTracker: zeroAddress, + FeeGlpTracker: zeroAddress, + ExtendedGmxTracker: zeroAddress, + StakedGmxDistributor: zeroAddress, + StakedGlpDistributor: zeroAddress, + GmxVester: zeroAddress, + GlpVester: zeroAddress, + AffiliateVester: zeroAddress, + Router: zeroAddress, + VaultReader: zeroAddress, + Reader: zeroAddress, + GlpManager: zeroAddress, + RewardReader: zeroAddress, + GlpRewardRouter: zeroAddress, + Timelock: zeroAddress, }, }; -export function getContract(chainId: number, name: string): Address { +type ExtractContractNames = { + [K in keyof T]: keyof T[K]; +}[keyof T]; + +export type ContractName = ExtractContractNames; + +export function getContract(chainId: ContractsChainId, name: ContractName): Address { if (!CONTRACTS[chainId]) { throw new Error(`Unknown chainId ${chainId}`); } diff --git a/sdk/src/configs/dataStore.ts b/sdk/src/configs/dataStore.ts index 6589933e36..b9ef676c17 100644 --- a/sdk/src/configs/dataStore.ts +++ b/sdk/src/configs/dataStore.ts @@ -41,6 +41,14 @@ export const MAX_PNL_FACTOR_FOR_TRADERS_KEY = hashString("MAX_PNL_FACTOR_FOR_TRA export const MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY = hashString( "MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS" ); +export const CLAIMABLE_COLLATERAL_DELAY_KEY = hashString("CLAIMABLE_COLLATERAL_DELAY"); +export const CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY = hashString("CLAIMABLE_COLLATERAL_REDUCTION_FACTOR"); +export const CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY = hashString("CLAIMABLE_COLLATERAL_TIME_DIVISOR"); +export const MAX_LENDABLE_IMPACT_FACTOR_KEY = hashString("MAX_LENDABLE_IMPACT_FACTOR"); +export const MAX_LENDABLE_IMPACT_USD_KEY = hashString("MAX_LENDABLE_IMPACT_USD"); +export const MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY = hashString("MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS"); +export const LENT_POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("LENT_POSITION_IMPACT_POOL_AMOUNT"); + export const POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("POSITION_IMPACT_POOL_AMOUNT"); export const MIN_POSITION_IMPACT_POOL_AMOUNT_KEY = hashString("MIN_POSITION_IMPACT_POOL_AMOUNT"); export const POSITION_IMPACT_POOL_DISTRIBUTION_RATE_KEY = hashString("POSITION_IMPACT_POOL_DISTRIBUTION_RATE"); @@ -81,8 +89,10 @@ export const SUBACCOUNT_LIST_KEY = hashString("SUBACCOUNT_LIST"); export const MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT = hashString("MAX_ALLOWED_SUBACCOUNT_ACTION_COUNT"); export const SUBACCOUNT_ACTION_COUNT = hashString("SUBACCOUNT_ACTION_COUNT"); export const SUBACCOUNT_ORDER_ACTION = hashString("SUBACCOUNT_ORDER_ACTION"); +export const SUBACCOUNT_INTEGRATION_ID = hashString("SUBACCOUNT_INTEGRATION_ID"); export const SUBACCOUNT_AUTO_TOP_UP_AMOUNT = hashString("SUBACCOUNT_AUTO_TOP_UP_AMOUNT"); export const GLV_MAX_MARKET_TOKEN_BALANCE_USD = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_USD"); +export const MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY = hashString("MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION"); export const GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT = hashString("GLV_MAX_MARKET_TOKEN_BALANCE_AMOUNT"); export const IS_GLV_MARKET_DISABLED = hashString("IS_GLV_MARKET_DISABLED"); export const GLV_SHIFT_LAST_EXECUTED_AT = hashString("GLV_SHIFT_LAST_EXECUTED_AT"); @@ -95,6 +105,7 @@ export const OPTIMAL_USAGE_FACTOR = hashString("OPTIMAL_USAGE_FACTOR"); export const BASE_BORROWING_FACTOR = hashString("BASE_BORROWING_FACTOR"); export const ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR = hashString("ABOVE_OPTIMAL_USAGE_BORROWING_FACTOR"); export const SUBACCOUNT_EXPIRES_AT = hashString("SUBACCOUNT_EXPIRES_AT"); +export const MULTICHAIN_BALANCE = hashString("MULTICHAIN_BALANCE"); export const PRICE_FEED_KEY = hashString("PRICE_FEED"); export const GASLESS_FEATURE_DISABLED_KEY = hashString("GASLESS_FEATURE_DISABLED"); export const GELATO_RELAY_FEE_MULTIPLIER_FACTOR_KEY = hashString("GELATO_RELAY_FEE_MULTIPLIER_FACTOR"); @@ -302,6 +313,10 @@ export function minCollateralFactorKey(market: string) { return hashData(["bytes32", "address"], [MIN_COLLATERAL_FACTOR_KEY, market]); } +export function minCollateralFactorForLiquidationKey(market: string) { + return hashData(["bytes32", "address"], [MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY, market]); +} + export function minCollateralFactorForOpenInterest(market: string, isLong: boolean) { return hashData( ["bytes32", "address", "bool"], @@ -374,10 +389,30 @@ export function subaccountActionCountKey(account: string, subaccount: string, ac ); } +export function maxLendableImpactFactorKey(market: string) { + return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_FACTOR_KEY, market]); +} + +export function maxLendableImpactFactorForWithdrawalsKey(market: string) { + return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY, market]); +} + +export function maxLendableImpactUsdKey(market: string) { + return hashData(["bytes32", "address"], [MAX_LENDABLE_IMPACT_USD_KEY, market]); +} + +export function subaccountIntegrationIdKey(account: string, subaccount: string) { + return hashData(["bytes32", "address", "address"], [SUBACCOUNT_INTEGRATION_ID, account, subaccount]); +} + export function subaccountAutoTopUpAmountKey(account: string, subaccount: string) { return hashData(["bytes32", "address", "address"], [SUBACCOUNT_AUTO_TOP_UP_AMOUNT, account, subaccount]); } +export function multichainBalanceKey(account: string, token: string) { + return hashData(["bytes32", "address", "address"], [MULTICHAIN_BALANCE, account, token]); +} + export function priceFeedKey(token: string) { return hashData(["bytes32", "address"], [PRICE_FEED_KEY, token]); } diff --git a/sdk/src/configs/express.ts b/sdk/src/configs/express.ts index b3a200e402..8ac568e5e2 100644 --- a/sdk/src/configs/express.ts +++ b/sdk/src/configs/express.ts @@ -2,7 +2,7 @@ import { Token } from "types/tokens"; import { expandDecimals, USD_DECIMALS } from "utils/numbers"; import { periodToSeconds } from "utils/time"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiContractsChain } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "./chains"; import { getTokenBySymbol, getWrappedToken } from "./tokens"; export const SUBACCOUNT_MESSAGE = @@ -20,13 +20,17 @@ export const MIN_RELAYER_FEE_USD = 5n ** BigInt(USD_DECIMALS - 1); // 0.5$ export const EXPRESS_EXTRA_EXECUTION_FEE_BUFFER_BPS = 1000; -const GAS_PAYMENT_TOKENS: Record = { +const GAS_PAYMENT_TOKENS: Record = { [ARBITRUM]: [getTokenBySymbol(ARBITRUM, "USDC").address, getTokenBySymbol(ARBITRUM, "WETH").address], [AVALANCHE]: [getTokenBySymbol(AVALANCHE, "USDC").address, getTokenBySymbol(AVALANCHE, "WAVAX").address], [AVALANCHE_FUJI]: [ getTokenBySymbol(AVALANCHE_FUJI, "USDC").address, getTokenBySymbol(AVALANCHE_FUJI, "WAVAX").address, ], + [ARBITRUM_SEPOLIA]: [ + getTokenBySymbol(ARBITRUM_SEPOLIA, "USDC.SG").address, + getTokenBySymbol(ARBITRUM_SEPOLIA, "WETH").address, + ], [BOTANIX]: [getTokenBySymbol(BOTANIX, "pBTC").address], }; diff --git a/sdk/src/configs/factors.ts b/sdk/src/configs/factors.ts index f88f117917..350d5662bd 100644 --- a/sdk/src/configs/factors.ts +++ b/sdk/src/configs/factors.ts @@ -3,7 +3,7 @@ export { USD_DECIMALS, BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, BASIS_ // V2 export const HIGH_PRICE_IMPACT_BPS = 80; // 0.8% export const HIGH_POSITION_IMPACT_BPS = 50; // 0.5% -export const HIGH_COLLATERAL_IMPACT_BPS = 500; // 5% +export const HIGH_COLLATERAL_IMPACT_BPS = 2000; // 20% export const HIGH_SWAP_IMPACT_BPS = 50; // 0.5% export const DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER = 30; // 0.3% export const HIGH_ALLOWED_SWAP_SLIPPAGE_BPS = 20; // 0.2% diff --git a/sdk/src/configs/markets.ts b/sdk/src/configs/markets.ts index d6ed92b3ae..3fa046796f 100644 --- a/sdk/src/configs/markets.ts +++ b/sdk/src/configs/markets.ts @@ -2,7 +2,7 @@ This files is used to pre-build data during the build process. Avoid adding client-side code here, as it can break the build process. */ -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiContractsChain } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "./chains"; export const SWAP_GRAPH_MAX_MARKETS_PER_TOKEN = 5; @@ -17,7 +17,7 @@ export type MarketConfig = { ATTENTION When adding new markets, please add them also to the end of the list in ./src/configs/static/sortedMarkets.ts */ -export const MARKETS: Record> = { +export const MARKETS: Record> = { [ARBITRUM]: { // BTC/USD [WBTC.e-USDC] "0x47c031236e19d024b42f8AE6780E44A573170703": { @@ -983,6 +983,43 @@ export const MARKETS: Record> = { shortTokenAddress: "0x3Bd8e00c25B12E6E60fc8B6f1E1E2236102073Ca", }, }, + [ARBITRUM_SEPOLIA]: { + // ETH/USD [WETH-USDC] + "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF": { + marketTokenAddress: "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF", + indexTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + shortTokenAddress: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f", + }, + // BTC/USD [BTC-USDC] + "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D": { + marketTokenAddress: "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D", + indexTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12", + longTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12", + shortTokenAddress: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f", + }, + // ETH/USD [WETH-USDC.SG] + "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc": { + marketTokenAddress: "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc", + indexTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", + }, + // BTC/USD [BTC-USDC.SG] + "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf": { + marketTokenAddress: "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf", + indexTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12", + longTokenAddress: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12", + shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", + }, + // CRV/USD [WETH-USDC] + "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c": { + marketTokenAddress: "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c", + indexTokenAddress: "0xD5DdAED48B09fa1D7944bd662CB05265FCD7077C", + longTokenAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + shortTokenAddress: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", + }, + }, [BOTANIX]: { // BTC/USD [stBTC-stBTC] "0x6682BB60590a045A956541B1433f016Ed22E361d": { diff --git a/sdk/src/configs/oracleKeeper.ts b/sdk/src/configs/oracleKeeper.ts index f46f32d561..3fb12beed8 100644 --- a/sdk/src/configs/oracleKeeper.ts +++ b/sdk/src/configs/oracleKeeper.ts @@ -1,6 +1,6 @@ -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiContractsChain } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "./chains"; -const ORACLE_KEEPER_URLS: Record = { +const ORACLE_KEEPER_URLS: Record = { [ARBITRUM]: "https://arbitrum-api.gmxinfra.io", [AVALANCHE]: "https://avalanche-api.gmxinfra.io", @@ -8,9 +8,11 @@ const ORACLE_KEEPER_URLS: Record = { [AVALANCHE_FUJI]: "https://synthetics-api-avax-fuji-upovm.ondigitalocean.app", [BOTANIX]: "https://botanix-api.gmxinfra.io", + + [ARBITRUM_SEPOLIA]: "https://dolphin-app-a2dup.ondigitalocean.app", }; -const ORACLE_KEEPER_FALLBACK_URLS: Record = { +const ORACLE_KEEPER_FALLBACK_URLS: Record = { [ARBITRUM]: ["https://arbitrum-api-fallback.gmxinfra.io", "https://arbitrum-api-fallback.gmxinfra2.io"], [AVALANCHE]: ["https://avalanche-api-fallback.gmxinfra.io", "https://avalanche-api-fallback.gmxinfra2.io"], @@ -18,6 +20,8 @@ const ORACLE_KEEPER_FALLBACK_URLS: Record = { [AVALANCHE_FUJI]: ["https://synthetics-api-avax-fuji-upovm.ondigitalocean.app"], [BOTANIX]: ["https://botanix-api-fallback.gmxinfra.io", "https://botanix-api-fallback.gmxinfra2.io"], + + [ARBITRUM_SEPOLIA]: ["https://dolphin-app-a2dup.ondigitalocean.app"], }; export function getOracleKeeperUrl(chainId: number) { diff --git a/sdk/src/configs/tokens.ts b/sdk/src/configs/tokens.ts index 66a93f05ba..5c72361cb4 100644 --- a/sdk/src/configs/tokens.ts +++ b/sdk/src/configs/tokens.ts @@ -2,7 +2,7 @@ import { zeroAddress } from "viem"; import type { Token, TokenAddressTypesMap, TokenCategory } from "types/tokens"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "./chains"; import { getContract } from "./contracts"; export const NATIVE_TOKEN_ADDRESS = zeroAddress; @@ -1637,6 +1637,107 @@ export const TOKENS: { [chainId: number]: Token[] } = { isPlatformToken: true, }, ], + [ARBITRUM_SEPOLIA]: [ + { + name: "Ethereum", + symbol: "ETH", + decimals: 18, + address: zeroAddress, + wrappedAddress: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + isNative: true, + isShortable: true, + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", + }, + { + name: "Wrapped ETH", + symbol: "WETH", + address: "0x980B62Da83eFf3D4576C647993b0c1D7faf17c73", + decimals: 18, + isWrapped: true, + baseSymbol: "ETH", + categories: ["layer1"], + imageUrl: "https://assets.coingecko.com/coins/images/279/small/ethereum.png?1595348880", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", + }, + { + name: "Bitcoin", + symbol: "BTC", + address: "0xF79cE1Cf38A09D572b021B4C5548b75A14082F12", + decimals: 8, + imageUrl: "https://assets.coingecko.com/coins/images/1/small/bitcoin.png?1746042828", + coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin", + }, + { + name: "USD Coin GMX", + symbol: "USDC", + address: "0x3321Fd36aEaB0d5CdfD26f4A3A93E2D2aAcCB99f", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin", + }, + { + name: "USD Coin Stargate", + symbol: "USDC.SG", + address: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", + decimals: 6, + isStable: true, + imageUrl: "https://assets.coingecko.com/coins/images/6319/thumb/USD_Coin_icon.png?1547042389", + coingeckoUrl: "https://www.coingecko.com/en/coins/usd-coin", + }, + { + name: "CRV", + symbol: "CRV", + address: "0xD5DdAED48B09fa1D7944bd662CB05265FCD7077C", + decimals: 18, + priceDecimals: 5, + imageUrl: "https://assets.coingecko.com/coins/images/12134/small/curve.png?1596358786", + isSynthetic: true, + coingeckoUrl: "https://www.coingecko.com/en/coins/curve-dao-token", + }, + /** Placeholder tokens */ + { + name: "GMX", + symbol: "GMX", + address: "", + decimals: 18, + imageUrl: "https://assets.coingecko.com/coins/images/18323/small/arbit.png?1631532468", + isPlatformToken: true, + }, + { + name: "Escrowed GMX", + symbol: "ESGMX", + address: "", + decimals: 18, + isPlatformToken: true, + }, + { + name: "GMX LP", + symbol: "GLP", + address: "", + decimals: 18, + imageUrl: "https://github.com/gmx-io/gmx-assets/blob/main/GMX-Assets/PNG/GLP_LOGO%20ONLY.png?raw=true", + isPlatformToken: true, + }, + { + name: "GMX Market tokens", + symbol: "GM", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GM_LOGO.png", + isPlatformToken: true, + }, + { + name: "GLV Market tokens", + symbol: "GLV", + address: "", + decimals: 18, + imageUrl: "https://raw.githubusercontent.com/gmx-io/gmx-assets/main/GMX-Assets/PNG/GLV_LOGO.png", + isPlatformToken: true, + }, + ], [BOTANIX]: [ { name: "Bitcoin", @@ -1785,7 +1886,7 @@ export const TOKENS_BY_SYMBOL_MAP: { [chainId: number]: { [symbol: string]: Toke export const WRAPPED_TOKENS_MAP: { [chainId: number]: Token } = {}; export const NATIVE_TOKENS_MAP: { [chainId: number]: Token } = {}; -const CHAIN_IDS = [ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX]; +const CHAIN_IDS = [ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ARBITRUM_SEPOLIA]; for (let j = 0; j < CHAIN_IDS.length; j++) { const chainId = CHAIN_IDS[j]; @@ -1872,6 +1973,10 @@ export function isValidToken(chainId: number, address: string) { return address in TOKENS_MAP[chainId]; } +export function isValidTokenSafe(chainId: number, address: string) { + return address in TOKENS_MAP[chainId]; +} + export function getToken(chainId: number, address: string) { // FIXME APE_deprecated token which is not in use but can be displayed if (chainId === ARBITRUM && address === "0x74885b4D524d497261259B38900f54e6dbAd2210") { diff --git a/sdk/src/modules/markets/index.ts b/sdk/src/modules/markets/index.ts index 2c6776adfd..e972feb57d 100644 --- a/sdk/src/modules/markets/index.ts +++ b/sdk/src/modules/markets/index.ts @@ -248,17 +248,27 @@ export class Markets extends Module { minCollateralFactorForOpenInterestShort: dataStoreValues.minCollateralFactorForOpenInterestShort.returnValues[0], - positionFeeFactorForPositiveImpact: dataStoreValues.positionFeeFactorForPositiveImpact.returnValues[0], - positionFeeFactorForNegativeImpact: dataStoreValues.positionFeeFactorForNegativeImpact.returnValues[0], + minCollateralFactorForLiquidation: dataStoreValues.minCollateralFactorForLiquidation.returnValues[0], + + positionFeeFactorForBalanceWasImproved: + dataStoreValues.positionFeeFactorForBalanceWasImproved.returnValues[0], + positionFeeFactorForBalanceWasNotImproved: + dataStoreValues.positionFeeFactorForBalanceWasNotImproved.returnValues[0], positionImpactFactorPositive: dataStoreValues.positionImpactFactorPositive.returnValues[0], positionImpactFactorNegative: dataStoreValues.positionImpactFactorNegative.returnValues[0], maxPositionImpactFactorPositive: dataStoreValues.maxPositionImpactFactorPositive.returnValues[0], maxPositionImpactFactorNegative: dataStoreValues.maxPositionImpactFactorNegative.returnValues[0], maxPositionImpactFactorForLiquidations: dataStoreValues.maxPositionImpactFactorForLiquidations.returnValues[0], + maxLendableImpactFactor: dataStoreValues.maxLendableImpactFactor.returnValues[0], + maxLendableImpactFactorForWithdrawals: + dataStoreValues.maxLendableImpactFactorForWithdrawals.returnValues[0], + maxLendableImpactUsd: dataStoreValues.maxLendableImpactUsd.returnValues[0], + lentPositionImpactPoolAmount: dataStoreValues.lentPositionImpactPoolAmount.returnValues[0], positionImpactExponentFactor: dataStoreValues.positionImpactExponentFactor.returnValues[0], - swapFeeFactorForPositiveImpact: dataStoreValues.swapFeeFactorForPositiveImpact.returnValues[0], - swapFeeFactorForNegativeImpact: dataStoreValues.swapFeeFactorForNegativeImpact.returnValues[0], + swapFeeFactorForBalanceWasImproved: dataStoreValues.swapFeeFactorForBalanceWasImproved.returnValues[0], + swapFeeFactorForBalanceWasNotImproved: + dataStoreValues.swapFeeFactorForBalanceWasNotImproved.returnValues[0], swapImpactFactorPositive: dataStoreValues.swapImpactFactorPositive.returnValues[0], atomicSwapFeeFactor: dataStoreValues.atomicSwapFeeFactor.returnValues[0], swapImpactFactorNegative: dataStoreValues.swapImpactFactorNegative.returnValues[0], diff --git a/sdk/src/modules/markets/query-builders.ts b/sdk/src/modules/markets/query-builders.ts index 25719801e8..eaca1adca0 100644 --- a/sdk/src/modules/markets/query-builders.ts +++ b/sdk/src/modules/markets/query-builders.ts @@ -1,3 +1,4 @@ +import { ContractsChainId } from "configs/chains"; import { getContract } from "configs/contracts"; import { CLAIMABLE_FUNDING_AMOUNT, MAX_PNL_FACTOR_FOR_TRADERS_KEY } from "configs/dataStore"; import { MarketsData } from "types/markets"; @@ -20,7 +21,7 @@ export function buildClaimableFundingDataRequest({ marketsAddresses: string[] | undefined; marketsData: MarketsData | undefined; account: string; - chainId: number; + chainId: ContractsChainId; }) { if (!marketsAddresses) { return {}; @@ -374,13 +375,13 @@ export async function buildMarketsConfigsRequest( methodName: "getUint", params: [prebuiltHashedKeys.maxPnlFactorForTradersShort], }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { methodName: "getUint", - params: [prebuiltHashedKeys.positionFeeFactorForPositiveImpact], + params: [prebuiltHashedKeys.positionFeeFactorForBalanceWasImproved], }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { methodName: "getUint", - params: [prebuiltHashedKeys.positionFeeFactorForNegativeImpact], + params: [prebuiltHashedKeys.positionFeeFactorForBalanceWasNotImproved], }, positionImpactFactorPositive: { methodName: "getUint", @@ -402,10 +403,30 @@ export async function buildMarketsConfigsRequest( methodName: "getUint", params: [prebuiltHashedKeys.maxPositionImpactFactorForLiquidations], }, + maxLendableImpactFactor: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxLendableImpactFactor], + }, + maxLendableImpactFactorForWithdrawals: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxLendableImpactFactorForWithdrawals], + }, + maxLendableImpactUsd: { + methodName: "getUint", + params: [prebuiltHashedKeys.maxLendableImpactUsd], + }, + lentPositionImpactPoolAmount: { + methodName: "getUint", + params: [prebuiltHashedKeys.lentPositionImpactPoolAmount], + }, minCollateralFactor: { methodName: "getUint", params: [prebuiltHashedKeys.minCollateralFactor], }, + minCollateralFactorForLiquidation: { + methodName: "getUint", + params: [prebuiltHashedKeys.minCollateralFactorForLiquidation], + }, minCollateralFactorForOpenInterestLong: { methodName: "getUint", params: [prebuiltHashedKeys.minCollateralFactorForOpenInterestLong], @@ -418,13 +439,13 @@ export async function buildMarketsConfigsRequest( methodName: "getUint", params: [prebuiltHashedKeys.positionImpactExponentFactor], }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { methodName: "getUint", - params: [prebuiltHashedKeys.swapFeeFactorForPositiveImpact], + params: [prebuiltHashedKeys.swapFeeFactorForBalanceWasImproved], }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { methodName: "getUint", - params: [prebuiltHashedKeys.swapFeeFactorForNegativeImpact], + params: [prebuiltHashedKeys.swapFeeFactorForBalanceWasNotImproved], }, atomicSwapFeeFactor: { methodName: "getUint", diff --git a/sdk/src/modules/markets/types.ts b/sdk/src/modules/markets/types.ts index e3c8857d05..d14d7744fe 100644 --- a/sdk/src/modules/markets/types.ts +++ b/sdk/src/modules/markets/types.ts @@ -75,18 +75,23 @@ export type MarketConfig = Pick< | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" | "minCollateralFactor" + | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" - | "positionFeeFactorForPositiveImpact" - | "positionFeeFactorForNegativeImpact" + | "positionFeeFactorForBalanceWasImproved" + | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" + | "maxLendableImpactFactor" + | "maxLendableImpactFactorForWithdrawals" + | "maxLendableImpactUsd" + | "lentPositionImpactPoolAmount" | "positionImpactExponentFactor" - | "swapFeeFactorForPositiveImpact" - | "swapFeeFactorForNegativeImpact" + | "swapFeeFactorForBalanceWasImproved" + | "swapFeeFactorForBalanceWasNotImproved" | "swapImpactFactorPositive" | "swapImpactFactorNegative" | "swapImpactExponentFactor" @@ -161,19 +166,24 @@ export type MarketConfigMulticallRequestConfig = MulticallRequestConfig<{ | "maxFundingFactorPerSecond" | "maxPnlFactorForTradersLong" | "maxPnlFactorForTradersShort" - | "positionFeeFactorForPositiveImpact" - | "positionFeeFactorForNegativeImpact" + | "positionFeeFactorForBalanceWasImproved" + | "positionFeeFactorForBalanceWasNotImproved" | "positionImpactFactorPositive" | "positionImpactFactorNegative" | "maxPositionImpactFactorPositive" | "maxPositionImpactFactorNegative" | "maxPositionImpactFactorForLiquidations" + | "maxLendableImpactFactor" + | "maxLendableImpactFactorForWithdrawals" + | "maxLendableImpactUsd" + | "lentPositionImpactPoolAmount" | "minCollateralFactor" + | "minCollateralFactorForLiquidation" | "minCollateralFactorForOpenInterestLong" | "minCollateralFactorForOpenInterestShort" | "positionImpactExponentFactor" - | "swapFeeFactorForPositiveImpact" - | "swapFeeFactorForNegativeImpact" + | "swapFeeFactorForBalanceWasImproved" + | "swapFeeFactorForBalanceWasNotImproved" | "atomicSwapFeeFactor" | "swapImpactFactorPositive" | "swapImpactFactorNegative" diff --git a/sdk/src/modules/orders/helpers.spec.ts b/sdk/src/modules/orders/helpers.spec.ts index 1b833af3b9..6e9f245670 100644 --- a/sdk/src/modules/orders/helpers.spec.ts +++ b/sdk/src/modules/orders/helpers.spec.ts @@ -6,7 +6,7 @@ import { TokenData, TokensData } from "types/tokens"; import { getByKey } from "utils/objects"; import * as swapPath from "utils/swap/swapPath"; import { arbitrumSdk } from "utils/testUtil"; -import * as tradeAmounts from "utils/trade/amounts"; +import * as tradeAmounts from "utils/trade/increase"; describe("increaseOrderHelper", () => { let marketsInfoData: MarketsInfoData; diff --git a/sdk/src/modules/orders/helpers.ts b/sdk/src/modules/orders/helpers.ts index cd2feb9182..c134787121 100644 --- a/sdk/src/modules/orders/helpers.ts +++ b/sdk/src/modules/orders/helpers.ts @@ -7,7 +7,7 @@ import { getByKey } from "utils/objects"; import { getSwapAmountsByFromValue, getSwapAmountsByToValue } from "utils/swap"; import { createFindSwapPath } from "utils/swap/swapPath"; import { convertToUsd, getIsUnwrap, getIsWrap, getTokensRatioByPrice } from "utils/tokens"; -import { getIncreasePositionAmounts } from "utils/trade/amounts"; +import { getIncreasePositionAmounts } from "utils/trade/increase"; import type { GmxSdk } from "../.."; diff --git a/sdk/src/modules/orders/utils.ts b/sdk/src/modules/orders/utils.ts index 5c8f0ae6bb..ae7a17ceec 100644 --- a/sdk/src/modules/orders/utils.ts +++ b/sdk/src/modules/orders/utils.ts @@ -1,14 +1,15 @@ import { Address, isAddressEqual } from "viem"; +import type { ContractsChainId } from "configs/chains"; import { getContract } from "configs/contracts"; import { accountOrderListKey } from "configs/dataStore"; import { getWrappedToken } from "configs/tokens"; -import { MarketFilterLongShortDirection, MarketFilterLongShortItemData } from "modules/trades/trades"; -import { GasLimitsConfig } from "types/fees"; -import { MarketsInfoData } from "types/markets"; +import type { MarketFilterLongShortDirection, MarketFilterLongShortItemData } from "modules/trades/trades"; +import type { GasLimitsConfig } from "types/fees"; +import type { MarketsInfoData } from "types/markets"; import { DecreasePositionSwapType, Order, OrderType } from "types/orders"; import { SidecarLimitOrderEntry, SidecarSlTpOrderEntry } from "types/sidecarOrders"; -import { TokensData } from "types/tokens"; +import type { TokensData } from "types/tokens"; import { estimateOrderOraclePriceCount } from "utils/fees/estimateOraclePriceCount"; import { estimateExecuteDecreaseOrderGasLimit, getExecutionFee } from "utils/fees/executionFee"; import type { MulticallRequestConfig, MulticallResult } from "utils/multicall"; @@ -154,7 +155,7 @@ export function matchByMarket({ export const DEFAULT_COUNT = 1000; -export function buildGetOrdersMulticall(chainId: number, account: string) { +export function buildGetOrdersMulticall(chainId: ContractsChainId, account: string) { return { dataStore: { contractAddress: getContract(chainId, "DataStore"), @@ -186,13 +187,42 @@ export function buildGetOrdersMulticall(chainId: number, account: string) { export function parseGetOrdersResponse(res: MulticallResult>) { const count = Number(res.data.dataStore.count.returnValues[0]); const orderKeys = res.data.dataStore.keys.returnValues; - const orders = res.data.reader.orders.returnValues as any[]; + const orders = res.data.reader.orders.returnValues as { + orderKey: string; + order: { + addresses: { + account: string; + receiver: string; + cancellationReceiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + initialCollateralToken: string; + swapPath: string[]; + }; + numbers: { + orderType: bigint; + decreasePositionSwapType: bigint; + sizeDeltaUsd: bigint; + initialCollateralDeltaAmount: bigint; + triggerPrice: bigint; + acceptablePrice: bigint; + executionFee: bigint; + callbackGasLimit: bigint; + minOutputAmount: bigint; + updatedAtTime: bigint; + validFromTime: bigint; + srcChainId: bigint; + }; + flags: { isLong: boolean; shouldUnwrapNativeToken: boolean; isFrozen: boolean; autoCancel: boolean }; + _dataList: string[]; + }; + }[]; return { count, - orders: orders.map((order, i) => { + orders: orders.map(({ order }, i) => { const key = orderKeys[i]; - const { data } = order; const orderData: Order = { key, @@ -213,12 +243,12 @@ export function parseGetOrdersResponse(res: MulticallResult 0, + closeAcceptablePriceInfo?.balanceWasImproved ?? false, userReferralInfo, uiFeeFactor ); @@ -592,6 +599,17 @@ export class Positions extends Module { const pnlPercentage = collateralUsd !== undefined && collateralUsd != 0n ? getBasisPoints(pnl, collateralUsd) : 0n; + const netPriceImapctValues = + marketInfo && closeAcceptablePriceInfo + ? getNetPriceImpactDeltaUsdForDecrease({ + marketInfo, + sizeInUsd: position.sizeInUsd, + pendingImpactAmount: position.pendingImpactAmount, + sizeDeltaUsd: position.sizeInUsd, + priceImpactDeltaUsd: closeAcceptablePriceInfo.priceImpactDeltaUsd, + }) + : undefined; + const netValue = getPositionNetValue({ collateralUsd: collateralUsd, pnl, @@ -599,9 +617,20 @@ export class Positions extends Module { pendingFundingFeesUsd: pendingFundingFeesUsd, closingFeeUsd, uiFeeUsd, + totalPendingImpactDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, + }); + + const pnlAfterFees = getPositionPnlAfterFees({ + pnl, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd: pendingFundingFeesUsd, + closingFeeUsd, + uiFeeUsd, + totalPendingImpactDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, }); - const pnlAfterFees = pnl - totalPendingFeesUsd - closingFeeUsd - uiFeeUsd; const pnlAfterFeesPercentage = collateralUsd != 0n ? getBasisPoints(pnlAfterFees, collateralUsd + closingFeeUsd) : 0n; @@ -632,6 +661,7 @@ export class Positions extends Module { sizeInTokens: position.sizeInTokens, collateralUsd, collateralAmount: position.collateralAmount, + pendingImpactAmount: position.pendingImpactAmount, userReferralInfo, minCollateralUsd, pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, @@ -667,6 +697,8 @@ export class Positions extends Module { pnlAfterFees, pnlAfterFeesPercentage, netValue, + netPriceImapctDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, closingFeeUsd, uiFeeUsd, pendingFundingFeesUsd, diff --git a/sdk/src/modules/utils/utils.ts b/sdk/src/modules/utils/utils.ts index 14a312f93c..38f560174f 100644 --- a/sdk/src/modules/utils/utils.ts +++ b/sdk/src/modules/utils/utils.ts @@ -142,8 +142,9 @@ export class Utils extends Module { updateOrderGasLimit: staticGasLimits.updateOrderGasLimit, cancelOrderGasLimit: staticGasLimits.cancelOrderGasLimit, tokenPermitGasLimit: staticGasLimits.tokenPermitGasLimit, + gmxAccountCollateralGasLimit: staticGasLimits.gmxAccountCollateralGasLimit, gelatoRelayFeeMultiplierFactor: getBigInt("gelatoRelayFeeMultiplierFactor"), - }; + } satisfies GasLimitsConfig; }); this._gasLimits = gasLimits; diff --git a/sdk/src/prebuilt/hashedKinkModelMarketRatesKeys.json b/sdk/src/prebuilt/hashedKinkModelMarketRatesKeys.json index b59f5b0ff7..33f059c95b 100644 --- a/sdk/src/prebuilt/hashedKinkModelMarketRatesKeys.json +++ b/sdk/src/prebuilt/hashedKinkModelMarketRatesKeys.json @@ -1126,5 +1126,47 @@ "aboveOptimalUsageBorrowingFactorLong": "0xa9e22e9d3e4438cd0c056f6f9e39b103e741d9c87a30625643f02ad053731869", "aboveOptimalUsageBorrowingFactorShort": "0x1ecf10a4f1f28b4e3c1f1fae6af7ea5a7e93d90844720b89b38509945c507896" } + }, + "421614": { + "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF": { + "optimalUsageFactorLong": "0x6758150d36bd49f2cf7e45b455012350f4c1146c13bdbd4cdc28ea55cd71e316", + "optimalUsageFactorShort": "0x9a7ec04e07d2316bd65469899746e1c285db5bbe3240ef4060e3c11ce8ae4df5", + "baseBorrowingFactorLong": "0xb53527bebd470fb83050b3869b09b97e5ebb9fe3f180833281fe71ccaadb200e", + "baseBorrowingFactorShort": "0xfcece4d6deca50446c64fa5fa5d2af6f6e49692abe4364f7f58013e80afa0dc4", + "aboveOptimalUsageBorrowingFactorLong": "0x3f884f571097eadcba55b27095cdc82ef3dcb2b79e0838e8ee71a01affed0816", + "aboveOptimalUsageBorrowingFactorShort": "0xb36cf9dd1ae5b776c21d7b0a6e469614d7067d23fa42751ab174a736afb70629" + }, + "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D": { + "optimalUsageFactorLong": "0x75fd219b8629177fb7acf93eaa7fac5870e2cc069e203920a41b4a37aa010f9c", + "optimalUsageFactorShort": "0xe454ed049bb948c915476a75b235a24c447372eb2cb7007200012a1052195448", + "baseBorrowingFactorLong": "0xafe05d9f07f23a276e58ed97f1a88191d4316b3222c1f214bd3e99511a85c892", + "baseBorrowingFactorShort": "0xcabe7245363c65f9bf212740bad39323939ea9d58f253cc03b17fd7f2ca1e83a", + "aboveOptimalUsageBorrowingFactorLong": "0xf32454317f5f8ee7728d4dea105693e9e39b19b4873097108c6aa10acc3f5dad", + "aboveOptimalUsageBorrowingFactorShort": "0x9d6bfae49b9a43ddd279d371ae2d2411e79cbe4d9cb9df90aa0a8b7b3251f62a" + }, + "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc": { + "optimalUsageFactorLong": "0x39d0409d01146b0ba49cfcc3c9b8acf01330e70a1f331c10ab5a1c62dd7d6019", + "optimalUsageFactorShort": "0x4a0417fe45068725e2e3cb65912cc361ca6be12a1ea4cf49c72d3cdb9484a098", + "baseBorrowingFactorLong": "0x543d708670c459c9f8d99df36fb9bb1439d70254316b5115ab20663c4882f1a1", + "baseBorrowingFactorShort": "0x744984e2df298f85753485477cb5391581b19da90c81e982469f960b237f784b", + "aboveOptimalUsageBorrowingFactorLong": "0x9cd4468687a60514947b2540388be2b30e0460c34e0918f963f549c378a16cd9", + "aboveOptimalUsageBorrowingFactorShort": "0xf09c1ae2f99b6ee3757da419eff4dccc064a486e3fd0e9aa738b6ca32e76bb77" + }, + "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf": { + "optimalUsageFactorLong": "0xc51db96778409d633aee5ec25d8fecda981ed0771fe9ea24a6d8f5f6c98418e1", + "optimalUsageFactorShort": "0x57dc47eb52a0a422319dd2f0e97b6df1b5d268611c38a0b822cb5b07317331d9", + "baseBorrowingFactorLong": "0xfe52fceebf4b2604b07dd8e7e0c6fe439d7b7f1eea5616eb9cf271928a76d817", + "baseBorrowingFactorShort": "0xc5c09d7b447503db6827286e552d6fa64e91ea3f8a3d1f71617ce492aabc6a53", + "aboveOptimalUsageBorrowingFactorLong": "0x3ee19bd398d803e76c7bffbb1e7300dc675b8cea1e3b39b514164eead7a6b549", + "aboveOptimalUsageBorrowingFactorShort": "0xb3a445394f1161006fc1f9159b741726c697158bd79724039c1d9f07033aff9c" + }, + "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c": { + "optimalUsageFactorLong": "0x7136f26f09b6e9de850ea3cd43b4f6a60779ff34ba9ac83e30fef73389bf3ba1", + "optimalUsageFactorShort": "0x5537de50a15619be6b974fec617f4282f8b82cc29c22479c91e6d8e85de313e7", + "baseBorrowingFactorLong": "0x341ce2c61502e18c0a11d0889850a521bfd796e443b84c24aed2a5d1cb4ec3c4", + "baseBorrowingFactorShort": "0x08ebdf8759d1b00beab7f018572ca0db3f029ac3f5608c11bd22a65c9e7540ff", + "aboveOptimalUsageBorrowingFactorLong": "0xfa8a2b862611b3e908f294a3daad7a493fe2665e5a266b6297b59662b2d487a5", + "aboveOptimalUsageBorrowingFactorShort": "0x56ee4e8daf9b4eb0d069222038c5e55ae54264aead84d9499839eef176e12c2a" + } } -} +} \ No newline at end of file diff --git a/sdk/src/prebuilt/hashedMarketConfigKeys.json b/sdk/src/prebuilt/hashedMarketConfigKeys.json index d13ce3ca80..f9d07dbb3f 100644 --- a/sdk/src/prebuilt/hashedMarketConfigKeys.json +++ b/sdk/src/prebuilt/hashedMarketConfigKeys.json @@ -30,19 +30,24 @@ "maxFundingFactorPerSecond": "0xf880113d343712cab3812feabf11130764ad8d4ce146fcbff76f6351565d2f17", "maxPnlFactorForTradersLong": "0x18de6c5527ecbd4cdcb5e91185c0b31d6a725508c3f6c07d1104e3d30618bce6", "maxPnlFactorForTradersShort": "0xdc6d824c4b03495ea4fd0d98b1f6a57069b5ad662490a91d6f44166e0d33c48d", - "positionFeeFactorForPositiveImpact": "0xf9d4c5d5fa290d04bf7b517af61f419cc12f0c591c15f8a0956cbd3fc5ff6bb0", - "positionFeeFactorForNegativeImpact": "0xfd0c7ba47ba7bdd1f03ab209f90075b4b97bd978f952e1f296658e93010823fa", + "positionFeeFactorForBalanceWasImproved": "0xf9d4c5d5fa290d04bf7b517af61f419cc12f0c591c15f8a0956cbd3fc5ff6bb0", + "positionFeeFactorForBalanceWasNotImproved": "0xfd0c7ba47ba7bdd1f03ab209f90075b4b97bd978f952e1f296658e93010823fa", "positionImpactFactorPositive": "0xa4239fa93c7d5c36884e2bfeb9fbfbaec17026758f959bafd260799080ae5541", "positionImpactFactorNegative": "0x19cfb0f7abb434cc833aa334e452092610e3ce15814c4458fcaa27bfdb521f16", "maxPositionImpactFactorPositive": "0xfc5bed622848c4e3e455c308358b9909d5c8b565bebb2874dffd1d4f54eaad2b", "maxPositionImpactFactorNegative": "0x6be447408c855216316c492f3f14b036eea188f1b5e003014c0dcd607382cc04", "maxPositionImpactFactorForLiquidations": "0xcb99d885f7f3f027e0358eb5ec14e6191d1138e3fbdef65a26ed61fb60102f20", + "maxLendableImpactFactor": "0xb3b4d74b781ec6f82e806ecd6ce4cb612a17981e3f5a33ebba331f9b374305d3", + "maxLendableImpactFactorForWithdrawals": "0x70a96897ef7c782fa079c3c699e0db2961876bda507b913949cda60d449094ba", + "maxLendableImpactUsd": "0xf5cfdf88e82055ee2d11fe3022611436d86010b01c8535d97fa35e312d9b17a4", + "lentPositionImpactPoolAmount": "0xa9a8e06c724cdb1ec3731dd2bb477864ab9cd6b77a38087e2bedae1678a9354e", "minCollateralFactor": "0x7ed8bbc84a504f7593aeb499af806615332528c198809a44c6e5dba3e0d72e88", + "minCollateralFactorForLiquidation": "0x4ad6ed9b76315a721ed0263f8e550ae6e6dc5ed2bc623569492a2d94a64b0083", "minCollateralFactorForOpenInterestLong": "0xf6af02901769f5d0431c90ada09d6c367624e1076786532fd2ce8e6d717667a2", "minCollateralFactorForOpenInterestShort": "0xaa5c6a876f5b9214f7f2ab110afac5d785b3fe106ac7cd7a0d18984414c5b6d6", "positionImpactExponentFactor": "0xc803b8cb75cba8e65bcdb755850a3b00ed19f35a17433db4d7b00c0ff8d3c3c6", - "swapFeeFactorForPositiveImpact": "0xd2f7a87d5d57a855fe4a2f329dc1e09ace6cb08c7e2836429f1d102e810972f0", - "swapFeeFactorForNegativeImpact": "0x08f90c2709ec73ef9e0fcb703ea79aba37782b5569c8d8382a4028b876a4baf6", + "swapFeeFactorForBalanceWasImproved": "0xd2f7a87d5d57a855fe4a2f329dc1e09ace6cb08c7e2836429f1d102e810972f0", + "swapFeeFactorForBalanceWasNotImproved": "0x08f90c2709ec73ef9e0fcb703ea79aba37782b5569c8d8382a4028b876a4baf6", "atomicSwapFeeFactor": "0xd150b7f649c4be53a26b4b617b831c4f675acdd63f8b8974388503c3560ddb6d", "swapImpactFactorPositive": "0xa3eb1cf6b16b64b67753729439ad7f9a154facab21aaa09cadea6e51ed69fe47", "swapImpactFactorNegative": "0x96fdadeb1e61115c586f2886fa40f103f462d1a508917578820872f807d214bf", @@ -81,19 +86,24 @@ "maxFundingFactorPerSecond": "0xfcfc49fdb6d57ddb08658d6d6d25c53a4f3d500e69c6e6049722b593ac53f76d", "maxPnlFactorForTradersLong": "0x6d7460d4543897cfb4373a1d5eaeec93a5032f39f573a936a205a6fbd6594ca4", "maxPnlFactorForTradersShort": "0x58542f1aec8f133258f6c8474548a8812815c7d182f79962a59893ae18b38c54", - "positionFeeFactorForPositiveImpact": "0x4af350796a03809751c38802108bc15fb788c0233254797527d79743603199fa", - "positionFeeFactorForNegativeImpact": "0x1e56383917330162ee938d9d6e4567c417bcbb84e75ef46a71f07c2e2994d810", + "positionFeeFactorForBalanceWasImproved": "0x4af350796a03809751c38802108bc15fb788c0233254797527d79743603199fa", + "positionFeeFactorForBalanceWasNotImproved": "0x1e56383917330162ee938d9d6e4567c417bcbb84e75ef46a71f07c2e2994d810", "positionImpactFactorPositive": "0x8301e78d67eae4dcd2dfda129a7805f3bddeba3b2ac08087241568595926eb1c", "positionImpactFactorNegative": "0x7f8eab1f73f4ef7822d1b98fdb0e8ab427f134e2cfd8741e6ef4dc9ca9c6b621", "maxPositionImpactFactorPositive": "0xc646aeff6a40d8e58e806be1d4cb09a381114176f0d41d24c0c84bd48985aeab", "maxPositionImpactFactorNegative": "0xaba0b2684cc102be8fd5f7b30a5a6145685486fcf0716a940f38a819b5e4ef05", "maxPositionImpactFactorForLiquidations": "0xce239b525e44abc42127078a80acc0ca884808425048ab0d2121cebe16e7f98c", + "maxLendableImpactFactor": "0x658bbfa2b1b2de1d796e9f42065f3fa4f04f40c1c13f9dd7ba9b31fd45f77409", + "maxLendableImpactFactorForWithdrawals": "0xa54e8211f80772d6b427270405b6196679ec52fddffd0b5bc94e3b91a7e8b0ae", + "maxLendableImpactUsd": "0xcd2081c201e37d58d61de758812d8b5c9bb64461b216e162c2dc412c128f6a73", + "lentPositionImpactPoolAmount": "0x09e59e71260c00a444e1d9c964c22fb3ac89e8181d66b479468b235b3a12408f", "minCollateralFactor": "0xbd15bc48a477042fe084c278c9596a903cb537c13f134405e2e59ca977784a0d", + "minCollateralFactorForLiquidation": "0x41a57a040d3da82057a2affe225c24c19c04b76c3e7fe0fe5043304ce5ceab11", "minCollateralFactorForOpenInterestLong": "0x9d952e960da486bb07fd5da270a9f38c80dd0c394d4fb940d08357e82f052e73", "minCollateralFactorForOpenInterestShort": "0xc4f39f26f1ebe2c2b425c07a1bd72b91ec14e54bdff50e69cd84cb57cfe9964f", "positionImpactExponentFactor": "0xb3eecb6e2939f73b7f6ce67479385071d99057835f8b6d5cff1255c57424cbf0", - "swapFeeFactorForPositiveImpact": "0x4bb062bfb969a41fb8ac9a3338dcca06a312d60aa511535de9b290de56008e6d", - "swapFeeFactorForNegativeImpact": "0x4ea0ffd481b6caa50138a2c69d320b236cadb1c69536683ef92e93454acaba84", + "swapFeeFactorForBalanceWasImproved": "0x4bb062bfb969a41fb8ac9a3338dcca06a312d60aa511535de9b290de56008e6d", + "swapFeeFactorForBalanceWasNotImproved": "0x4ea0ffd481b6caa50138a2c69d320b236cadb1c69536683ef92e93454acaba84", "atomicSwapFeeFactor": "0xd7a0acca1804516a01dd5e0058950cb3911bed3405408adeb025867ccecf1da7", "swapImpactFactorPositive": "0x849e771df499463b3a5aa83b5bc195e882c5a28bf0ec0d3f060d82ddb3fc2024", "swapImpactFactorNegative": "0xaca989b67d45cf4d4a0e9d12ad35b0e21a61196eff7882388a0d164c646c9499", @@ -132,19 +142,24 @@ "maxFundingFactorPerSecond": "0x5a6134016c035bfffcb21fc2809587b0fa5b3e556162e82a535b056e6ea54b68", "maxPnlFactorForTradersLong": "0x63eeece3bf80287fa9fb7d6e04e1d79ec8dd3f1df5f2c6cf7f3cd7a0fbb13834", "maxPnlFactorForTradersShort": "0x1e4dd44f3f0459fe502755579c34b9494e68d7e023663955e9354bc25aa48364", - "positionFeeFactorForPositiveImpact": "0xd98fade7af9578cbd174c2f64055ede1559e56298e99e2104e00f1453893fb72", - "positionFeeFactorForNegativeImpact": "0xa383623178ff731293ce6eac7671a17ff11cf83e6642b2786af012c95f92db50", + "positionFeeFactorForBalanceWasImproved": "0xd98fade7af9578cbd174c2f64055ede1559e56298e99e2104e00f1453893fb72", + "positionFeeFactorForBalanceWasNotImproved": "0xa383623178ff731293ce6eac7671a17ff11cf83e6642b2786af012c95f92db50", "positionImpactFactorPositive": "0xce514a8e429c0d44bfff47cea0d289e9e760b1b28dc193749fda6e8506f25e3c", "positionImpactFactorNegative": "0x5f630a7956732b0817c7986736e0ba662952a3e06ab6538148b76cb32a4bb5a3", "maxPositionImpactFactorPositive": "0x6300b13437d9a0d96a62ba0da66443df91dd794220546cdc550eb60beb03c826", "maxPositionImpactFactorNegative": "0xff404de67c0b942e79e928e22942dd79b5600bf92ac747ccf35cc81e64f4f516", "maxPositionImpactFactorForLiquidations": "0xc9c06eed1436e553e6cc768636d82c351b67462238586458aeb0593e58b83480", + "maxLendableImpactFactor": "0x00f7e298035fd0489e5684f68edd8007a30c90cf845dd4414d315179a740dbf7", + "maxLendableImpactFactorForWithdrawals": "0x6bb138b1f713ee7af70636d267357ca61715b92e2872c36129ddf72c692aa0a3", + "maxLendableImpactUsd": "0x838407f1b29bc14b64743ad319ba863818b6030de20b716eef108b01b80325d7", + "lentPositionImpactPoolAmount": "0x442013a39a11f2dffdc8e5c62979abc7555481843ff3f7fe8b8a19daabdeaa8a", "minCollateralFactor": "0xcd93d636a3d94818a19e2935b5f42cc4bae73e41c1bd9187dde1fec46924a6b4", + "minCollateralFactorForLiquidation": "0x3e41b2e14a4c728e9642f31e79846e7deb22a24feae6ccf6dc92f1fc0c5e859a", "minCollateralFactorForOpenInterestLong": "0x223b38a763d5c6d1491fd45fabecfd4c04b4f8f61778d8ceced8f12921458b9c", "minCollateralFactorForOpenInterestShort": "0x23b2ddf33c216cd62a8f20e0f3bdf3462bc508bf83ccf6ffcd1e1da2fa441835", "positionImpactExponentFactor": "0x822d156e2f4eac206a436a3826ef14b7e28f80a6b797cdcf2e48700518f3cb5d", - "swapFeeFactorForPositiveImpact": "0x898c067070bed020aa6a881338f66cf7a27aafaaec39fdf10a667a124e9c00fb", - "swapFeeFactorForNegativeImpact": "0xd27b69dce975cffcfbd239a58f7e1865719df4b5eb74c074a750e6459dfc057d", + "swapFeeFactorForBalanceWasImproved": "0x898c067070bed020aa6a881338f66cf7a27aafaaec39fdf10a667a124e9c00fb", + "swapFeeFactorForBalanceWasNotImproved": "0xd27b69dce975cffcfbd239a58f7e1865719df4b5eb74c074a750e6459dfc057d", "atomicSwapFeeFactor": "0xb7b0fd446d2505bb7aaceb2616f7d4766db720c6f938bf6b0e7b923b13b7c120", "swapImpactFactorPositive": "0x257d59b0ff05ca7063136a8bab2b182646d022866c6bb60bf5e1a951f56a4f33", "swapImpactFactorNegative": "0x225da45bd850b96bbe246e4f7f53ed51dccb165b1d1a16d2c4495d2bf1c01cbc", @@ -185,19 +200,24 @@ "maxFundingFactorPerSecond": "0x4f7dc082dba2aa22249007c05bb4928623521833aa4d2993e150a90fbfa114e3", "maxPnlFactorForTradersLong": "0xaa8e9afe1a8ae000f057254aec33b0b038be8079bfcb184ea356dc917326331a", "maxPnlFactorForTradersShort": "0xfa31ea001f0ed9b3fa3d2f1deea9bf79493c211600b8f203f50dd95591e516da", - "positionFeeFactorForPositiveImpact": "0x4b9bdba3ff745320751079b586d3c4f84cf87f7c3e79e39f1158b174c405cf67", - "positionFeeFactorForNegativeImpact": "0xdd207fe702bdff93bb945786cd5d98c3259d3dbd7cf37c63c161714e938ba434", + "positionFeeFactorForBalanceWasImproved": "0x4b9bdba3ff745320751079b586d3c4f84cf87f7c3e79e39f1158b174c405cf67", + "positionFeeFactorForBalanceWasNotImproved": "0xdd207fe702bdff93bb945786cd5d98c3259d3dbd7cf37c63c161714e938ba434", "positionImpactFactorPositive": "0x57f9be924ba0f2c763e255396dd8fdd27b3ff06fcde5fee6018b4ed0292eae0a", "positionImpactFactorNegative": "0x3b778e8ac16a3dc330bcceed5db97c4b853b0a696209858f5dd19591a1b3566e", "maxPositionImpactFactorPositive": "0x825201d62a913028fa553544c19e6e9e45885502ad94b3e9ccb79e2911daf669", "maxPositionImpactFactorNegative": "0xa0145413fea58392aad72c6aaba18435a1b6e00ff9346d8418c207d8b3f0ad1d", "maxPositionImpactFactorForLiquidations": "0xb7ab4d8339ba5934253d04b55d4141017d73b9801df9a8810ea10d1c3ea3fc6f", + "maxLendableImpactFactor": "0x0585fc9618ad8521b5d612e41c802de36cb4bbf6e8313771e290c791ad3fe68a", + "maxLendableImpactFactorForWithdrawals": "0xe44a4f4906ef59a042e098c6578cde4b0d1b58c73f98ec0779b71d31fbf6d9e5", + "maxLendableImpactUsd": "0x728ec84ffba417f5cd111b992612c69bee78f19ac678b1584aae070e63f455a7", + "lentPositionImpactPoolAmount": "0x0d4630d7cd67859e7c9d3f814f184368775b4f00da40372c8e9dc1217cda0e41", "minCollateralFactor": "0x0edf8a0fa860b71e689cfeb511c6b83c96d23eaf71c6f757184d23954fcb3169", + "minCollateralFactorForLiquidation": "0x9c713920b491455ee33d87a6d12394a42e83d5f426958697dc08a318be13ed91", "minCollateralFactorForOpenInterestLong": "0x18ab1bf4fdef11804a1212c94ba4ed35498ef5942b3d385fc9c33f933f17f60d", "minCollateralFactorForOpenInterestShort": "0xf5cca0ad2e4b2341858ed82455e0d4e3e2dc289d93124403d67c010ca53b62de", "positionImpactExponentFactor": "0xbe60fcfd99ab63b9f7c2a82da310aa88958ee0146cbc9ea008d8cc16a97ac70f", - "swapFeeFactorForPositiveImpact": "0x695ec0e29327f505d4955e89ec25f98741aedf22d209dbc35e1d2d61e683877c", - "swapFeeFactorForNegativeImpact": "0x6805e3bd65fab2c6cda687df591a5e9011a99df2ff0aa98287114c693ef8583e", + "swapFeeFactorForBalanceWasImproved": "0x695ec0e29327f505d4955e89ec25f98741aedf22d209dbc35e1d2d61e683877c", + "swapFeeFactorForBalanceWasNotImproved": "0x6805e3bd65fab2c6cda687df591a5e9011a99df2ff0aa98287114c693ef8583e", "atomicSwapFeeFactor": "0xc125515896b48c72fad34d60a7735c27394bbfda809bac0461966a907a9dbabb", "swapImpactFactorPositive": "0x79d8fe854154b43d003a20314c803b78ec01391248008659c0c8e998e866d7d7", "swapImpactFactorNegative": "0xe8438cfb97aef79fdebd4e948dd086e7c042ae7b47a2414454f6b691ebcc2419", @@ -236,19 +256,24 @@ "maxFundingFactorPerSecond": "0x424c5a83737ee1e6ae9a863e64a6772ad7d591da777c4774b2484370d927b97a", "maxPnlFactorForTradersLong": "0x04e55b2a6b73d4cb774accdc2d7f0de0f4aa8a8ae6a084be73a43ca8f17f3586", "maxPnlFactorForTradersShort": "0x02badce9cdb1639287015c8989426be5963e2b0c8a41abd9723284ebff7f2e9e", - "positionFeeFactorForPositiveImpact": "0x914f66951bf2600e37ce4f2e2fd45983c6d842e40cda838267764e38fbad3594", - "positionFeeFactorForNegativeImpact": "0xe1a9164e4ffd3e27713953d91592d29e5e51e16c1df48725a919fa8785b184af", + "positionFeeFactorForBalanceWasImproved": "0x914f66951bf2600e37ce4f2e2fd45983c6d842e40cda838267764e38fbad3594", + "positionFeeFactorForBalanceWasNotImproved": "0xe1a9164e4ffd3e27713953d91592d29e5e51e16c1df48725a919fa8785b184af", "positionImpactFactorPositive": "0xb2d34408902891f7a1ffb5a66609a793e142ed6dffc6d7c0c8b9b9bc6d6dd380", "positionImpactFactorNegative": "0x68cc8c831904230bbfe2ba8d3ee911509896dac5b48cc45c1323718a54fb4016", "maxPositionImpactFactorPositive": "0xc230e1e4d328166be2c9c1e775203c706519bd3f17777d460f0bd159e2680920", "maxPositionImpactFactorNegative": "0xf0304143d99ab54dd4a90b22df08fec271f1c69fc31cdcbdbcaaf2f3f9abbe90", "maxPositionImpactFactorForLiquidations": "0x2d8a11f53ea0e4da886046922afbdaf2f98111c2c3617ce8d53320e5368ece53", + "maxLendableImpactFactor": "0x4112eb8d7aed1bb72e882220f586aaac2019f97fbf59808eaf687468dc13737c", + "maxLendableImpactFactorForWithdrawals": "0xeed571225e3a9bdef852f7b8b0ffaea55a32d3ca54cfdac61584c70c4d4cc016", + "maxLendableImpactUsd": "0xb8f98bea93a1cea67ff9bd16f527fa76903a2cc5898a48a5e98cd3d6194f5cad", + "lentPositionImpactPoolAmount": "0x94f7c35748bbd731455c2f94c52f99bffd762f5d4169361b85d14e2ec6cb95b5", "minCollateralFactor": "0xcf1cefe1a11576531900922002113a6cf623823d2c813a4534c5d181976450ae", + "minCollateralFactorForLiquidation": "0xefc3fc73b918e0aa9a9a9f306393b25a2919aad551cbd5c5535834b6ea9d9934", "minCollateralFactorForOpenInterestLong": "0xbcf38cdb77fa9cb02787c89b5b616dc4d91337a400795d617a2580ae49a6e209", "minCollateralFactorForOpenInterestShort": "0x635ce4b3864fcc94a0eb30789ab0eedb1724ed4bb51ebad2fa2e9a2bc051f60a", "positionImpactExponentFactor": "0xd3fb6cf1d6db9b533ada6f4f3e7f52adf7fa871788e67b80e7ae6e63811017e5", - "swapFeeFactorForPositiveImpact": "0xd795542d99d4dc3faa6f4e4a11da9347d4f58fcfce910ccd9878f8fd79234324", - "swapFeeFactorForNegativeImpact": "0x4a0e3a43fc8a8e48629f6d4e1c0c1ae7098a35d9834cd0c13446fc2b802a24a7", + "swapFeeFactorForBalanceWasImproved": "0xd795542d99d4dc3faa6f4e4a11da9347d4f58fcfce910ccd9878f8fd79234324", + "swapFeeFactorForBalanceWasNotImproved": "0x4a0e3a43fc8a8e48629f6d4e1c0c1ae7098a35d9834cd0c13446fc2b802a24a7", "atomicSwapFeeFactor": "0xe9ea68981039e8c7bdda3234e3fc66eccc1b21bb30ec5c053662a442b6b38958", "swapImpactFactorPositive": "0x801066104b68a8504d32a319a865f5010a763e0b3f4372e0b03f3fe87ab77eb7", "swapImpactFactorNegative": "0x1a282191426197cc0dacd8fdca48acc252d354470638b44ca410893f9bc8d576", @@ -287,19 +312,24 @@ "maxFundingFactorPerSecond": "0xf9eebd782b6379771362c4bac105681bfa6f503b704718bcad8352c0de19f688", "maxPnlFactorForTradersLong": "0x4ad6b8b2ba952450663a8d5bf31ee14ed32607a478d6cd7294fe55a4a4ef90d2", "maxPnlFactorForTradersShort": "0x6c1fad48bb23f5fbd6f258f605f43fb3ced23cc7af730b7a7b4e8f05687c6939", - "positionFeeFactorForPositiveImpact": "0x0a91a7ca843ae3371debc48312c71f1ed0ae40a087d2626c6c43fd86002de08c", - "positionFeeFactorForNegativeImpact": "0x8e901273173d5fd00df54a257dc627db643127f496f5e187609a3210ba484b27", + "positionFeeFactorForBalanceWasImproved": "0x0a91a7ca843ae3371debc48312c71f1ed0ae40a087d2626c6c43fd86002de08c", + "positionFeeFactorForBalanceWasNotImproved": "0x8e901273173d5fd00df54a257dc627db643127f496f5e187609a3210ba484b27", "positionImpactFactorPositive": "0x0c641238e5258665a42ece9c3874c8c5e0d627522aaf8c60cf0bbc5e64c5c5d8", "positionImpactFactorNegative": "0xc4bfa605ffb9f50e0f18e0399ccdac8f6fe971a739a91a6a726517653177e0e7", "maxPositionImpactFactorPositive": "0xef102c726b741df58e10ba28b7f783ebaa6c2076f27b615f9d21a4edfba791c1", "maxPositionImpactFactorNegative": "0x98bec1ab62f465a2a83119494f5f21c753b0527908dc422f67220e613c532771", "maxPositionImpactFactorForLiquidations": "0x5fbccb68c5d1de0fd2d39c7a60110688e10a969992910911b5a7ff5461a7fddd", + "maxLendableImpactFactor": "0x93de0069d2725e09bf4c058941d76e098ccc24e408c20d09e981af35375bf806", + "maxLendableImpactFactorForWithdrawals": "0xaf9aa8b02ddbf97ce8464ba2de02f40ad91ee33358d46ec67f08f2aadf3377dd", + "maxLendableImpactUsd": "0x80be7e0fa9db2f39a0b71c58828c1c43984f5794d61afab943e2f3882d718cee", + "lentPositionImpactPoolAmount": "0x1f0483a8730089f19663b082cb3b071d32c7ae51972a1c164107d45956ba4e1d", "minCollateralFactor": "0x832e125ad1a59ec76a096a906db0abca415fae50215a04713ba7d26b806170d7", + "minCollateralFactorForLiquidation": "0xb5942ec068620932b817a6dfdc8481a8d8f06dc0563a60f643926b6a103c672f", "minCollateralFactorForOpenInterestLong": "0x47ece80b5a8441270dc51b704ac241ee205157d6e79a17ec9a7a78d5a1c405cc", "minCollateralFactorForOpenInterestShort": "0x3ac33ae245dfa87c5023e2ada76a30d63b5d4a462868f2df4cf285c450c055bb", "positionImpactExponentFactor": "0x8185adf991484ed9941b9d357c45b4aaa04298bf56481c3ac20410b14c6e0426", - "swapFeeFactorForPositiveImpact": "0x67a550e4fa661b4a6f6f7a4f2f276a0dac54970e784fe703031ee403f04b4665", - "swapFeeFactorForNegativeImpact": "0x5f0f923b62e09d2ebb7df2b4b505d5eb8843b57816cb1fc36090965cfa939bfd", + "swapFeeFactorForBalanceWasImproved": "0x67a550e4fa661b4a6f6f7a4f2f276a0dac54970e784fe703031ee403f04b4665", + "swapFeeFactorForBalanceWasNotImproved": "0x5f0f923b62e09d2ebb7df2b4b505d5eb8843b57816cb1fc36090965cfa939bfd", "atomicSwapFeeFactor": "0x10d37a7e8e1567aad34f48c74ecd3ed0100bc2bb6f7248f5bbd6a3be6c10fe2d", "swapImpactFactorPositive": "0x0538cdd47f4c430b1fcb396d2d4b81d55cc0fb604620d2cc1d1092d9a3d13b4a", "swapImpactFactorNegative": "0x7eb5c1dc27cc686df401fe1cc4a36537b363bfaa4d94f77d6fe72fd5ede61d08", @@ -338,19 +368,24 @@ "maxFundingFactorPerSecond": "0xd84ef4cc15df47ff3afd13c9d28e9a859dbabf200c94bcd0206c29b95f24e436", "maxPnlFactorForTradersLong": "0x72419a34e63cbfb23ab394e4439234ac97ea134e828df7be5bfb5df3ec881fb4", "maxPnlFactorForTradersShort": "0xa6300cb5902ed56008bca5c8649dc25ae7b7f119a00b42fa383e2d76f5ae5cb1", - "positionFeeFactorForPositiveImpact": "0xc2e64a5a0c61ef9bb36e3f5d49f7ae23191b915b9b453689a7abd06820fb9b6a", - "positionFeeFactorForNegativeImpact": "0xa6be8c7c302085742a3296b00ad87b973361d8a174bb7d30ffbf88e4c6f4d8cf", + "positionFeeFactorForBalanceWasImproved": "0xc2e64a5a0c61ef9bb36e3f5d49f7ae23191b915b9b453689a7abd06820fb9b6a", + "positionFeeFactorForBalanceWasNotImproved": "0xa6be8c7c302085742a3296b00ad87b973361d8a174bb7d30ffbf88e4c6f4d8cf", "positionImpactFactorPositive": "0x04bcbebc64b09778830c1b12d8c1b2d32504c94d71d5f64f2d547d6fe1ed4ff0", "positionImpactFactorNegative": "0x0c00767fffed8b00ff6d17106121d436ec02b7ff6c01968d8aecb9d29972e75a", "maxPositionImpactFactorPositive": "0x10951da02818a2ad689fc04ff3ca1935a2bd85a7023d53189f9f2526c1ad19df", "maxPositionImpactFactorNegative": "0x789029ddd96ed090034a9b9f30b7b5b6c658b3b2c03c3d8e8b99087572e6c29f", "maxPositionImpactFactorForLiquidations": "0xe67bb29085a2c9505c14cb22b778ffd89bab7484bcf0142d4b8f0d94823fe8b8", + "maxLendableImpactFactor": "0xf1cddf409a74490b6b9b71da45699a2664842cb2095addd15856e5ca4488e749", + "maxLendableImpactFactorForWithdrawals": "0x996605603a143fcffe8d5a8a49d57f3b166610dbc943f4e4504b16c5af6e6da8", + "maxLendableImpactUsd": "0x98840a7c390a3d473387dba2f260538403d20a4302fb5208143594a82858305c", + "lentPositionImpactPoolAmount": "0xc65ef81ed98cb824f6d29e22e0d433409224dbeb6a8fd2da59ceae6496c906a8", "minCollateralFactor": "0x25ca6ce85c0568d84138f6b3264fedf1668f1ddfc320f7ba409d3d6019411833", + "minCollateralFactorForLiquidation": "0xa7a3d6ff9c0a71648dc0e6cf384fa77bd83e4b2ff8395f57d3c34f2b36367977", "minCollateralFactorForOpenInterestLong": "0x3c2241385fd888324a03ea03eb3606df19e300ae2c3cf2dcafbe2d235a04b676", "minCollateralFactorForOpenInterestShort": "0xeca78003c8f185c46542ba76034dd77edf8c1cee1a710cc59fde908d5b92f309", "positionImpactExponentFactor": "0xf1f5a97e4945291c333c8857cc08ec673be5b6c9cde98be1ad86931599685acc", - "swapFeeFactorForPositiveImpact": "0x6a1d8e63575704359c436b79657db011d72a92f67f1bd5e14afb57e9a2912498", - "swapFeeFactorForNegativeImpact": "0xaf4fad6d380803699ec362dd04941db2d6c038f504ad922664c8f9d1a4ef7160", + "swapFeeFactorForBalanceWasImproved": "0x6a1d8e63575704359c436b79657db011d72a92f67f1bd5e14afb57e9a2912498", + "swapFeeFactorForBalanceWasNotImproved": "0xaf4fad6d380803699ec362dd04941db2d6c038f504ad922664c8f9d1a4ef7160", "atomicSwapFeeFactor": "0x25494613773e872f0f6580192c653bd12541ec9658a7c4afbc1ff86518cc6ef1", "swapImpactFactorPositive": "0x5d50cff84fe2d5abc20ecbe3156a438d1b3479175f4748dae1d121887ed30eec", "swapImpactFactorNegative": "0xb9cc0f62898c08c383e014640b673a6cecc479fa1080544ea3250f029f3c304c", @@ -389,19 +424,24 @@ "maxFundingFactorPerSecond": "0xb67c5c79dea1409495a4296882f29f55711c3613b3962c49406e76fb41cb3bd2", "maxPnlFactorForTradersLong": "0xa5a61d7f4a7f07641ab50335ad1305741802139fe956021e15cc7d9bc7be8d7f", "maxPnlFactorForTradersShort": "0xd493bce0cc5d3d5c297296e7eabc2585c31272109c39bbb39cabbfbe0030600d", - "positionFeeFactorForPositiveImpact": "0xff452922f847142c79ed67c6b9f0f1f57d703384dacf714a43ea097072f341c1", - "positionFeeFactorForNegativeImpact": "0x7e7eac91fdbffd192d12b66d7d34f83b12ca2709d7f6cea208e64c3b7905560a", + "positionFeeFactorForBalanceWasImproved": "0xff452922f847142c79ed67c6b9f0f1f57d703384dacf714a43ea097072f341c1", + "positionFeeFactorForBalanceWasNotImproved": "0x7e7eac91fdbffd192d12b66d7d34f83b12ca2709d7f6cea208e64c3b7905560a", "positionImpactFactorPositive": "0x04a7dc43056b287535c2fddccef2e0b361e2fc841de23ce8e630db13d4e3cabe", "positionImpactFactorNegative": "0xd1fa1ed0858635234f05b957d0f102dcdcff2d59307f5b378d07c404c515be22", "maxPositionImpactFactorPositive": "0x35e161be38af516eabcc7215e158450e46aa9123dfd22a127a3a22717f68e412", "maxPositionImpactFactorNegative": "0xad122e0fa63007cec09c08f304aa598044be6f5191018370739bc16a9c439816", "maxPositionImpactFactorForLiquidations": "0x1a5334adfb5b61b4aa80163c205dda0a875dea3d2db2fe0850b7b0614f31cdbd", + "maxLendableImpactFactor": "0xd98beda89a305501d34136119ca30e1ca2b5b2f434e35296cdb5561208c5b4bf", + "maxLendableImpactFactorForWithdrawals": "0x76da0d9c850d2920a310f5aa18b371ca8d2a90b38815cfe6ba6456cdb5c85d50", + "maxLendableImpactUsd": "0x8237ec27bdb004d4107c6c6b79c9041a2c4a937dd1252e13d5477a27d2e29eda", + "lentPositionImpactPoolAmount": "0x29633419e1322cedab43c68d3d50aa905f37ab8ff6adf3af34e2543c38129de9", "minCollateralFactor": "0x2bcb8363ff421d07360a2a95773d3f7b64319b6bc58f328c6c734e090562cdc1", + "minCollateralFactorForLiquidation": "0xf28436ee632c09e66f86fd35aaa5d18095399b9108d4ba85c8525a3072af2568", "minCollateralFactorForOpenInterestLong": "0x7f97bdae1ee1c0424ccd6dc21526e5ef1e0cb581856d3c0b3279c518b2b140f6", "minCollateralFactorForOpenInterestShort": "0xa370583d9939495b60095d94f3906c9b15ba4e7a3d7422210d6f541c426d4010", "positionImpactExponentFactor": "0xe33c49e3c7a970aa64a71f22c589f0436ff537390a61d71088600b2f1fe24fb6", - "swapFeeFactorForPositiveImpact": "0x1dbf6ea5c40ddb4981c0c991291ebcfe9ca18da36b55476f46c07db6f9d4d796", - "swapFeeFactorForNegativeImpact": "0xbdfacc5a3aafccef508a92c25358d876d54cab9266f562bfeb0f075011400b5f", + "swapFeeFactorForBalanceWasImproved": "0x1dbf6ea5c40ddb4981c0c991291ebcfe9ca18da36b55476f46c07db6f9d4d796", + "swapFeeFactorForBalanceWasNotImproved": "0xbdfacc5a3aafccef508a92c25358d876d54cab9266f562bfeb0f075011400b5f", "atomicSwapFeeFactor": "0x2fa11c68d618568b2ec47f2af07043ea0617b92ffb1b3392c5686ba9a063a7f5", "swapImpactFactorPositive": "0xa24690e158bd6148dd1ee7619d26d4db4c22e063bf7fbc4849b248713ecc4be6", "swapImpactFactorNegative": "0xea3e78f194aabd8ee877feb4dd76f0f10e28e5375fe88a39575480d27d265afd", @@ -440,19 +480,24 @@ "maxFundingFactorPerSecond": "0x5c35b3218147478cc4180f5aa2855d0f28596ba4441f9d2e8d209ae71eeccd89", "maxPnlFactorForTradersLong": "0x62b1329a211b95ce1332d70babea14c068cd8ba5a664cd92aefa4dfcaa4f167a", "maxPnlFactorForTradersShort": "0x974b387f81e50088e3c3ac618012d346cc44ada48d7755853beaf23ab5cf13d7", - "positionFeeFactorForPositiveImpact": "0xb1bf22ec2a6afd7bcc3c9005e3c3c2487c8dae699c0f4ef601cd0bf2ec00b0fb", - "positionFeeFactorForNegativeImpact": "0x491eab7041f5a8e59a24551f5f7c7f88554dfc7d8aa1cc32dc8447d4e0a3433d", + "positionFeeFactorForBalanceWasImproved": "0xb1bf22ec2a6afd7bcc3c9005e3c3c2487c8dae699c0f4ef601cd0bf2ec00b0fb", + "positionFeeFactorForBalanceWasNotImproved": "0x491eab7041f5a8e59a24551f5f7c7f88554dfc7d8aa1cc32dc8447d4e0a3433d", "positionImpactFactorPositive": "0x058ef893f1d5f6ef1fc9eafb5b98f219ba86fe1ff1732bd8e621ed9314b04c2f", "positionImpactFactorNegative": "0xc3dd689dd953a4ead23ac3691cce97602c03ec497d0b618b927045ee6b05ec94", "maxPositionImpactFactorPositive": "0x76f07a9c4842e03295e606a17118aa7055df974c7e8119e90c54366f8438c824", "maxPositionImpactFactorNegative": "0xa90e6926653827715ada027f4112fe7c882a3ccaf37c922462d40fa4ea8d03ab", "maxPositionImpactFactorForLiquidations": "0x41af16a1d0ba06020391564578914ec605001bc8ed683269ff1c10ecde331864", + "maxLendableImpactFactor": "0xab56d4d760405991ddef068434a5d406ba016e6d8146fc4902e4e0d598b4880f", + "maxLendableImpactFactorForWithdrawals": "0x4ee32ae87de6b8212db46ab2f997b72a42a3c045b784611792cb3b3abcc09ef5", + "maxLendableImpactUsd": "0xf795ef00b0e40b4c87bb36bc3cb5d3bba6e56a2579c1d175c4b5cf66b0ccf2ed", + "lentPositionImpactPoolAmount": "0x1e85f0f543912b7ecf686ead9f1409fb5756f6a5a58d68e96c143a932a4cbb7b", "minCollateralFactor": "0x47e6ae06f279a68f0ca067d5a30ed3650bb14114110b8ee80883b47804ef6a3b", + "minCollateralFactorForLiquidation": "0xc256c83913d960d9206dcc2892b610d70f1215a7c0dca18cbf2a253a86a4e27b", "minCollateralFactorForOpenInterestLong": "0x2baf62173b9765c40d17461b94ede9de9288eaceb9bea879a93916d6fbc22a19", "minCollateralFactorForOpenInterestShort": "0x2d87dc943787f13f340d4ca58bc57c9779423fb4b7a25951482d25d8cedc88ed", "positionImpactExponentFactor": "0x255ba96b3ea4034ce13d81ee90f50b43d11aa4cf3d7f6cf6e214708c8cfcdd02", - "swapFeeFactorForPositiveImpact": "0x3de65a272685fe435c3bf061d018861d43e0981580e7f7fbbee8322549a24448", - "swapFeeFactorForNegativeImpact": "0x16ac4a989200e46829ff7e2a35892009f28622ddbe6474b3bcbf0be26843bc8a", + "swapFeeFactorForBalanceWasImproved": "0x3de65a272685fe435c3bf061d018861d43e0981580e7f7fbbee8322549a24448", + "swapFeeFactorForBalanceWasNotImproved": "0x16ac4a989200e46829ff7e2a35892009f28622ddbe6474b3bcbf0be26843bc8a", "atomicSwapFeeFactor": "0x921b5c21abfe7c96a3983ee5dc525afa485a1a3d75e2622780e5fd988ed51039", "swapImpactFactorPositive": "0xdd0713bd8c7d7d813cf41f2134c5c4171d1dd731b92f992bca75cee16f113bbf", "swapImpactFactorNegative": "0x2c1ef24611bfb6198a766b0251729bb7dac63eadd6743ed5585dcfba706d2b58", @@ -491,19 +536,24 @@ "maxFundingFactorPerSecond": "0x1ef61f8f945d86cd58ef7e1e4bc7729da62fef5ec14affddbba24e7fd1c961bf", "maxPnlFactorForTradersLong": "0xef8aaa370644aaf3abf0f745c8d419b4e8b022fa74bd591331b9049f01a776a5", "maxPnlFactorForTradersShort": "0xa0ddc4194a3ed609bab97fffba907154c8b2fab359f5339b564c416dd307fdfc", - "positionFeeFactorForPositiveImpact": "0xe0a8dfbd751b5d5206a4421add9c6138627ad8b1dd6c33c53e903e54a873d6bd", - "positionFeeFactorForNegativeImpact": "0xb1d9a20a9576c7c8e95d076152d6b7471f325274e27944234317d1655b9a7c68", + "positionFeeFactorForBalanceWasImproved": "0xe0a8dfbd751b5d5206a4421add9c6138627ad8b1dd6c33c53e903e54a873d6bd", + "positionFeeFactorForBalanceWasNotImproved": "0xb1d9a20a9576c7c8e95d076152d6b7471f325274e27944234317d1655b9a7c68", "positionImpactFactorPositive": "0xa72f633da73261095054c3c45e61c545b71b34515676776202071552eb46744e", "positionImpactFactorNegative": "0x06aa2f3ce1399efdc7ced916c85dab36fdb5f78075b6ffa4cad253f726e194e1", "maxPositionImpactFactorPositive": "0x5c9741051d509ce2c9f6984c4c7f98516b2cbf91e1342f56f0e1b5d40056b688", "maxPositionImpactFactorNegative": "0xc5e52b000c6cf276f134adfe885de18e057f3c5f68a128cd952aae394b3c11cf", "maxPositionImpactFactorForLiquidations": "0xe124a4a1a960aab0503ef70a732184bbc30732fd4697eb1ce4d4463f3a25c509", + "maxLendableImpactFactor": "0xb3c4274beae095399cacdb1878d1c016eed094b245bbc1fa72b69721f8a4e7d7", + "maxLendableImpactFactorForWithdrawals": "0x37e67266b53cbe2d3941590fc1b3d26a20850d5c2236ea80b98ccf17bd696c64", + "maxLendableImpactUsd": "0x84ace13dc5d67763acb52f7555c4393f595076dc9ea38d5d1a5457fabe6a7ca6", + "lentPositionImpactPoolAmount": "0x5a5ad8ffd0624583964edb52b4ca5302dd7852a311d0d00268aa3812e0347830", "minCollateralFactor": "0x96dbb6d13d7c6ad973f98461378032ffcf09dcfff780a087bfb18e8b2345b446", + "minCollateralFactorForLiquidation": "0xdc1582e6529d9cc8f1962399984c6069dcaa98f558366ed6c054c2b725b86eb7", "minCollateralFactorForOpenInterestLong": "0x55f19e1cb6994dac8de0f0595716c8ce1c98c4a0fe7ab84d94a2581a2857ef77", "minCollateralFactorForOpenInterestShort": "0x661c2ecf5182f780d9b14cd701f17b54d2fec0a3c78259175f382a53aaa17c85", "positionImpactExponentFactor": "0x9c4e91c06294bf042d7bf732cb8ef8eacbc2b113523e0a3d00ca94d3baee95b5", - "swapFeeFactorForPositiveImpact": "0x1e388b1aefe26c7999b5916b8d315dc220aab3bd1abf69d022fb2ca798af1d87", - "swapFeeFactorForNegativeImpact": "0x42455fb0390e5144cf404e735d539d273f23e0599527cd4cfbea64781471c11b", + "swapFeeFactorForBalanceWasImproved": "0x1e388b1aefe26c7999b5916b8d315dc220aab3bd1abf69d022fb2ca798af1d87", + "swapFeeFactorForBalanceWasNotImproved": "0x42455fb0390e5144cf404e735d539d273f23e0599527cd4cfbea64781471c11b", "atomicSwapFeeFactor": "0x142a11abfeb0ce942f834c8c1824cd4f4054f9c895ecd8cd620997fc38524384", "swapImpactFactorPositive": "0x8879db97a79f1b27c0eaf1b7e8326ca6b02dde9dab4a136bf6de2ae5bc87eb43", "swapImpactFactorNegative": "0x267ab1bdc0e337337fb57913abbc1774c61393c941ec14405210702c243dd087", @@ -542,19 +592,24 @@ "maxFundingFactorPerSecond": "0x80fbfee732d414f7e197bd2dca60406b5443b01a07b4bcdb3e9c79809d5b1c98", "maxPnlFactorForTradersLong": "0x0d971c00493d5db7d3270c7a8cfa9cc7aa0a99e5005fb913d5dc26b445f551f7", "maxPnlFactorForTradersShort": "0xf9a064f376e3c391caabd7d692c3e5e5c601ac3a9ebd1d2c105ef84117e3588b", - "positionFeeFactorForPositiveImpact": "0x57a019d7c544d1c83cd3118bf0c636b2e212af7f8c5c1e1ad5267adf98f3bbd6", - "positionFeeFactorForNegativeImpact": "0x99694bed9c85088df5242e4cfb72caecd4c1cb1870445956483f383b2ad6a5c0", + "positionFeeFactorForBalanceWasImproved": "0x57a019d7c544d1c83cd3118bf0c636b2e212af7f8c5c1e1ad5267adf98f3bbd6", + "positionFeeFactorForBalanceWasNotImproved": "0x99694bed9c85088df5242e4cfb72caecd4c1cb1870445956483f383b2ad6a5c0", "positionImpactFactorPositive": "0x48e76a2a5d0acb603c2113e72183f2ff900dad314753ccd89847cbb3ab21a522", "positionImpactFactorNegative": "0x2892774a5b56d753852b4a0f3bfb467e3a8ec009f9363ea1e87a1fb0be8949eb", "maxPositionImpactFactorPositive": "0x2ff3590362f429c9e9fed9dbdd6d9b7af0fadc3db5958cbdad4915effd446ab5", "maxPositionImpactFactorNegative": "0xc5700a9f0f48d7f11ad44433d1848041e475133baa14ceabfd308aa05291380c", "maxPositionImpactFactorForLiquidations": "0x95b07614a06ac0a81e49b6e02b6b5be9ff94bec514e0e62042c8e1f5c1429733", + "maxLendableImpactFactor": "0x62fff146684d5367acfd3186d198f360d343641ec714f75bbfe1da5d15cc2d1a", + "maxLendableImpactFactorForWithdrawals": "0xb7655a124cfb3abd74e70cc7eb1e86ef590f4256be7b19dfa5a16a13a0853875", + "maxLendableImpactUsd": "0xb2b39807618c901e81778682b8c1784c922b07d57729cafc0f85fc55e6e17b74", + "lentPositionImpactPoolAmount": "0x3b7935cb9f25478bed786cbbc2db533c3f370637796f07b4d7b2776b12e10fa4", "minCollateralFactor": "0xda500b491a746b24ab50e0b8b019f220ead47914b3745a2a7e7fdbd254e98380", + "minCollateralFactorForLiquidation": "0x34f110ea583e9f5ddde6db52500fdfa0f533d4289608e8385d6e8eb52b6ccc43", "minCollateralFactorForOpenInterestLong": "0x766fd0d002f43488d55b72193e9da1714d44851b4eb0e813cc8d280bef17a17e", "minCollateralFactorForOpenInterestShort": "0xd7db435910f38921a33518f369da861bc79b935c47e55310cda4cac15d5e8817", "positionImpactExponentFactor": "0x2efcc03e271bba8971dffc9f4ceb1afc8fc3c3c21d00a7c3b55ce76374ad79d8", - "swapFeeFactorForPositiveImpact": "0x33809fa251f2a79834e55024e55c4f8108575f4de5b2cb36a20328e5ab447533", - "swapFeeFactorForNegativeImpact": "0x2cedab9e26e3f9beb8d6b7ed636b6bafb5c22480925bba846038f0c06b622eaa", + "swapFeeFactorForBalanceWasImproved": "0x33809fa251f2a79834e55024e55c4f8108575f4de5b2cb36a20328e5ab447533", + "swapFeeFactorForBalanceWasNotImproved": "0x2cedab9e26e3f9beb8d6b7ed636b6bafb5c22480925bba846038f0c06b622eaa", "atomicSwapFeeFactor": "0x2e955a1d4b845ed986f466bb7d4be7403cef7c3ef1da3cd000250bbb251d2bf9", "swapImpactFactorPositive": "0xb63747d677b3f4894bf83370aa290ba493a3279ab6c71e8f627d6a19200fd0c1", "swapImpactFactorNegative": "0x6db11718caa3c178b5c71b0ebb38438e678887ee9808ee5fff12f45dff61f523", @@ -593,19 +648,24 @@ "maxFundingFactorPerSecond": "0xe7a76386a66a7510ccb548446cb42001ef38df88ed137941f22f742a80662a9f", "maxPnlFactorForTradersLong": "0xd5f058fb977929295998ca0eff3c526b05bc44fad34dd48f5067d6d63b7eae2c", "maxPnlFactorForTradersShort": "0x50c66a2e6ed8488a2a6ba5ada5720a9475a809201089d4fc87977b851c382866", - "positionFeeFactorForPositiveImpact": "0x52f8b77c96eee555524449d744f3f6c6ab77a4f26db48d6df363a32fba500e11", - "positionFeeFactorForNegativeImpact": "0xe4b8f5be03631cd111cafc0ac01dc8a8ab8f8ffc65b2a47287e8f9cf72b9c39d", + "positionFeeFactorForBalanceWasImproved": "0x52f8b77c96eee555524449d744f3f6c6ab77a4f26db48d6df363a32fba500e11", + "positionFeeFactorForBalanceWasNotImproved": "0xe4b8f5be03631cd111cafc0ac01dc8a8ab8f8ffc65b2a47287e8f9cf72b9c39d", "positionImpactFactorPositive": "0x4c9c2a48ed819ebea8ffdd30af8644af6bca85d2a73c6212b3e116d565ea6f1a", "positionImpactFactorNegative": "0x14770004251515604996859abeaefb248ed77bac98b0182e5d0de798e73a9880", "maxPositionImpactFactorPositive": "0x3bd8a0156fa25ff8ede082290885def48ebc2b978d3d3bb634261bbd940aa8ee", "maxPositionImpactFactorNegative": "0x01d477fd068479d04cb497540a393c8b5ef72afcc50e7b820000f5d863d185b0", "maxPositionImpactFactorForLiquidations": "0x4ec66905f0f5391fc597d1928fcb5b1785f5ff1c58238c67026b62121f2c02ce", + "maxLendableImpactFactor": "0x3a9c470b53c165ab932328154f9874548715861c6460f805ee9a4a80a8fea78b", + "maxLendableImpactFactorForWithdrawals": "0x9fad6c729230ce1e718f2c8d59dc4d4b71cabdc42bdc9671eb9f3a657c96a76c", + "maxLendableImpactUsd": "0x9862560ef3b5dac5ce2b74ef17a25dbe09eb8a96671a982b6a965c5269d3cd45", + "lentPositionImpactPoolAmount": "0x9d097f5509c3c67bdeed446ec4598dac8db0935f13a8c9023bb1eb6baf52dca7", "minCollateralFactor": "0x0319e091a3ec1a799e073a0b7936f425076d1918f56c3ebca0a61a077925d1a7", + "minCollateralFactorForLiquidation": "0x44c72c9b6faaa5a6a01ee3029c34a5998526cf5d06621babe61728a74452cc9c", "minCollateralFactorForOpenInterestLong": "0x534530389b87caf5d983a7e0e861fa8081b2a7a13384cf923705a64a186c5230", "minCollateralFactorForOpenInterestShort": "0xe5b9a75cc9c16a9e118200b3e6bd4b4a4a3849781b494af86fd3b61368f3a9ef", "positionImpactExponentFactor": "0x2f3fcc42ff0aebd5654ab91b39ee87bf3782130d659ee6dcb17bfd46609a202b", - "swapFeeFactorForPositiveImpact": "0x76240fbd6e985d59376b17429e35328adb92d235eaed290e881d2905f4fee93c", - "swapFeeFactorForNegativeImpact": "0x98d812495968f772c1430ad5bda82be56209a512f5038e644d21baa4649258b7", + "swapFeeFactorForBalanceWasImproved": "0x76240fbd6e985d59376b17429e35328adb92d235eaed290e881d2905f4fee93c", + "swapFeeFactorForBalanceWasNotImproved": "0x98d812495968f772c1430ad5bda82be56209a512f5038e644d21baa4649258b7", "atomicSwapFeeFactor": "0x5f7d86e6dc36460d2f9ad7dd34579a510203f38e3b7fad173fd2e07d1a930cfc", "swapImpactFactorPositive": "0x322d07f82afd4f2749d56278757d206f52add338aa5bc9359b259a5ddef4e514", "swapImpactFactorNegative": "0xe765a130a8cb9790e3c622efbb5422a8fd76ba0ed4a41840a89b667104954b19", @@ -644,19 +704,24 @@ "maxFundingFactorPerSecond": "0x99b8fb43ab749f6efe10459bf77c6e6d1cc46a02d8556deaae37bfce7e310fed", "maxPnlFactorForTradersLong": "0xe819b259874d89abd8406b4d8b5e978103e20599ce37ae5e6fcf35aadd672806", "maxPnlFactorForTradersShort": "0xc08bed49b3149d637af537bd879916ad2179e5f790c6a4d9fa254f70468f8c54", - "positionFeeFactorForPositiveImpact": "0xa33ef0e7e5737b815d4ee3818c9dda824c74ca1c0010ceca073401987419dd6e", - "positionFeeFactorForNegativeImpact": "0xbaa718f209c80155d83205a86874b4ec814ad173901eb25ef539652c4c0f7102", + "positionFeeFactorForBalanceWasImproved": "0xa33ef0e7e5737b815d4ee3818c9dda824c74ca1c0010ceca073401987419dd6e", + "positionFeeFactorForBalanceWasNotImproved": "0xbaa718f209c80155d83205a86874b4ec814ad173901eb25ef539652c4c0f7102", "positionImpactFactorPositive": "0x01e45a73c87ea6a24bd3e4b646a8fb50e525994b47b2e071688832b3db9a36a3", "positionImpactFactorNegative": "0x0eb07128e77ab3ed0303be75bf40e58de698d31f3587002010201f1f87383ba8", "maxPositionImpactFactorPositive": "0x3aaa745ed518dd8c579ee6533f0abc0f71f0b5856a057d7cdb74765251b41f7c", "maxPositionImpactFactorNegative": "0x28706d4a1fdc22299d49f2506ff82c9d9acc08e657e2d01a527678b6c6762247", "maxPositionImpactFactorForLiquidations": "0x15bcf662fdf9b8cd990c2b62c63190df2eb471bed3de8b9252a8d9f1d25fe9df", + "maxLendableImpactFactor": "0xc6fe342f7964206bc124b771ff423c0ea289d1bb7de474110589adeffee82944", + "maxLendableImpactFactorForWithdrawals": "0x2870d8d25ffee717545ddf07c91cf6fd196b65e8f90c3ef166432c3fc0822382", + "maxLendableImpactUsd": "0xfcadfede8ed4a86ac6707ff911ab8013568d1a6aafc8533f4414ac34eab356b6", + "lentPositionImpactPoolAmount": "0xf4aec56aee11b79d98c7f6d4a454ba0e56205a687bd987c3826f0e97fd58be46", "minCollateralFactor": "0xff3a85b820937ac9b174e1f49510b221d1e2eccc89cbdb68794b1e04f82c5e1e", + "minCollateralFactorForLiquidation": "0x04392113bc40d454de730f577ae537fe8a7a03c8699523dd377868df099dd735", "minCollateralFactorForOpenInterestLong": "0xce841b0d0a75f7f23b3068a8731d79d46ffd5224bf752b82c99278c615ce9610", "minCollateralFactorForOpenInterestShort": "0x095df3a0a35194c30b382a21aa95ff97440c497a9fa7308d9046a7c6a830a077", "positionImpactExponentFactor": "0xa776cf8b6750764a7baceb04c49b3e8316f86ba63007da12ce39fac78ce94815", - "swapFeeFactorForPositiveImpact": "0xa5c03fcca15132bd6eaab72fcb0be1671560cbff2bb1216ba7a680423f852cc5", - "swapFeeFactorForNegativeImpact": "0xad609e8a1ec4b62de757f26762513889a12b50c490a2c972b4cffdab526ce5b1", + "swapFeeFactorForBalanceWasImproved": "0xa5c03fcca15132bd6eaab72fcb0be1671560cbff2bb1216ba7a680423f852cc5", + "swapFeeFactorForBalanceWasNotImproved": "0xad609e8a1ec4b62de757f26762513889a12b50c490a2c972b4cffdab526ce5b1", "atomicSwapFeeFactor": "0x21912c9b2d2663de7ed5f3dba461a5b257e5c2aec9f3f7d0ee25da86d40ef075", "swapImpactFactorPositive": "0x40780b4dfe67cb9032a30a9ae910a8e63c568c0bfcfbac6962149a0480760e02", "swapImpactFactorNegative": "0x981313e20ad119ffd4e7297d65ac074bda816af74f76dc5ebef3a288ea0420c6", @@ -695,19 +760,24 @@ "maxFundingFactorPerSecond": "0x8b5935796ab74f3629e2ecb0efb2aaa95ec6c22cac58d7d2549715ec3b637f02", "maxPnlFactorForTradersLong": "0xdbff4e5388b3cadab3adb3cbea18328ab85615d1d33540f1daa3637191bd2a7a", "maxPnlFactorForTradersShort": "0x25e92f539fa9d6181cb3175d855b0e3db892f87e7cf44683c2bd88c3987151f1", - "positionFeeFactorForPositiveImpact": "0x75342f90740d718e915d25876def103e0aadb790eeec0e51cf80a0164fdb998d", - "positionFeeFactorForNegativeImpact": "0xa3181a5fa6716d137684451c14456bd1e089a30d7e4195041e1d03c5877fbdb1", + "positionFeeFactorForBalanceWasImproved": "0x75342f90740d718e915d25876def103e0aadb790eeec0e51cf80a0164fdb998d", + "positionFeeFactorForBalanceWasNotImproved": "0xa3181a5fa6716d137684451c14456bd1e089a30d7e4195041e1d03c5877fbdb1", "positionImpactFactorPositive": "0xfaf02c5d36cb1652804abd1004a4a3cc59b1d9639b6451440e856c507ca45e8e", "positionImpactFactorNegative": "0x68e601b74c240b88ff66adfef9b198da08f6b4eb2f6bbc5745217e2ee220c74c", "maxPositionImpactFactorPositive": "0x55682cadf8c0c42f07f7537e036888e6509b4c1fefbe791f8806c0122464065c", "maxPositionImpactFactorNegative": "0xcc4ecb935ca3ee301c72b4a0a5a2e0ec012bb977e18988abbf65ec31dacfb01d", "maxPositionImpactFactorForLiquidations": "0x53e40c837b0c78b8e732b33a14b1a71eafb92ad162e389509adf12d012804445", + "maxLendableImpactFactor": "0x8b638a3a6144458459f5ae1ded90a00fd71368b16e55375547465bc1c64dd948", + "maxLendableImpactFactorForWithdrawals": "0xfdae05a2ec9ea4f7ebd165c878f4ed38f7241ad080746ac736ed1fd290f88f44", + "maxLendableImpactUsd": "0xe70223bfaf4074aff312a883325204bd961829e8cc013550374a8ff390d757a6", + "lentPositionImpactPoolAmount": "0xff73e8c386163960756bf4028b8fad2438daf59d62a27b8ec82f8df3bd90bd7d", "minCollateralFactor": "0x19551441f4fad115496cad924a5234a7c54fdfb4c8a1488f93b7bbd6b0ecedc1", + "minCollateralFactorForLiquidation": "0xdfc2ee462858568defefb730ffe6b557448fd43946f479e841fb1d8a07246f89", "minCollateralFactorForOpenInterestLong": "0x2236f68da88942f622d2e117770f8f2147a2e26a5ae248e7facaed024241fff9", "minCollateralFactorForOpenInterestShort": "0x97b31e77e2349e5ca9393f9b039ae4c6e08b561674013325694aee511fa70f4d", "positionImpactExponentFactor": "0xd29cc14774ff37425210a4b4982d64598d960517246358ca6ae31e8278b88171", - "swapFeeFactorForPositiveImpact": "0x2453b281ca272f6b3c4aabcc06da5f61a03fde91143ecbb636906d8760751038", - "swapFeeFactorForNegativeImpact": "0x43fdf293b2369b23c689953b361e57206f130569d07cdec5b02a91f7db302988", + "swapFeeFactorForBalanceWasImproved": "0x2453b281ca272f6b3c4aabcc06da5f61a03fde91143ecbb636906d8760751038", + "swapFeeFactorForBalanceWasNotImproved": "0x43fdf293b2369b23c689953b361e57206f130569d07cdec5b02a91f7db302988", "atomicSwapFeeFactor": "0x7dfd70277f86278a779644d88083c0680c47bb02f02bdc9161268e2c24f8d092", "swapImpactFactorPositive": "0x6e872e48337e83b9b0974c98123f42c6c42133a809dda28947e45044fef0d763", "swapImpactFactorNegative": "0x7f74925d83c9749b52d3c463b52f75f56d3df222aa8091d320be024fcc136ab5", @@ -746,19 +816,24 @@ "maxFundingFactorPerSecond": "0x77905364bba50c4f33e22bccadbd317691a1c22b10fb45c5dc8c32129526044b", "maxPnlFactorForTradersLong": "0x9dfce95f35750ed7989c98bc3fa7b9ffdc4d923342b99b475bd1a68dd2bea55f", "maxPnlFactorForTradersShort": "0x3f7a7d4fa7b04934a74b5c4fe364e15ec7f182a731e00665a8087943d90d8ef3", - "positionFeeFactorForPositiveImpact": "0x2afa6ab01eaffdcdce3de67ca9408d171dca6f345e4a933977f017c3f935a150", - "positionFeeFactorForNegativeImpact": "0x16a9815fd641b782481c256ae44f741d91f98e60f198e6f67711c2f872654659", + "positionFeeFactorForBalanceWasImproved": "0x2afa6ab01eaffdcdce3de67ca9408d171dca6f345e4a933977f017c3f935a150", + "positionFeeFactorForBalanceWasNotImproved": "0x16a9815fd641b782481c256ae44f741d91f98e60f198e6f67711c2f872654659", "positionImpactFactorPositive": "0x163076b9dd0072442b9329b1e08c52eaf7f5d809f427178601592806a5200645", "positionImpactFactorNegative": "0xc27bde803397efc87d5d72964b6602262a80df80f9793084055ef0d6dd08b1af", "maxPositionImpactFactorPositive": "0x1c69876249545cf8f840054e487971e4faa2bf1574ac216060f5367e8fc4a611", "maxPositionImpactFactorNegative": "0xc6af5f36195b175198abc4774b59c643fd769f4e2c9e249c1e3006b88b70fa9e", "maxPositionImpactFactorForLiquidations": "0xbf51cc5c91b13d3465f57f3e9c7b3d9a464a01ad65b0cd7a784fd2d83ccb7051", + "maxLendableImpactFactor": "0xf8570b1f7724a306cad7e751facf358775d2836bdb89a795e7cf10e9e5d300c4", + "maxLendableImpactFactorForWithdrawals": "0x8d6265e42640b0ac32cc3f53e56a5c09e3a813d783e81ac771a2a059cf5853a1", + "maxLendableImpactUsd": "0xe51022439894366b3a6e88867c5b10c08d7f7ff243117df10e59009a28aaf91d", + "lentPositionImpactPoolAmount": "0x38e5c5fb9fdd6a81cf67e9c963912c548f1c8b75cb9f3049dc6d67109bce6860", "minCollateralFactor": "0x7cc57d46d5ff50a03e5a0f29242e18131d031794b2629b7f6398de7841588dbc", + "minCollateralFactorForLiquidation": "0x72e936023ba9fcbaf12a7120e82d41da53972b921ffd5dd1ad50ac1ae93bb900", "minCollateralFactorForOpenInterestLong": "0xc91baace01ed132d5a1f539fb6ddacfa913f012c6d706993f1f9d21e28646417", "minCollateralFactorForOpenInterestShort": "0x42ab637ba5ede5ce450b490c92fd5308a4b63d814d521886092107e000564243", "positionImpactExponentFactor": "0xfbaadfdbb5b204e122e8a78505941f01262e57d5b600482db442a452bdf0c5e4", - "swapFeeFactorForPositiveImpact": "0x13c0be771ab61c6f159c7b5afdf946b2e46e53aafb8881484d71a028dd441160", - "swapFeeFactorForNegativeImpact": "0x7b665b4b365ff791322993f71e61afeba792f6ccb7a2f5f2163825643637c897", + "swapFeeFactorForBalanceWasImproved": "0x13c0be771ab61c6f159c7b5afdf946b2e46e53aafb8881484d71a028dd441160", + "swapFeeFactorForBalanceWasNotImproved": "0x7b665b4b365ff791322993f71e61afeba792f6ccb7a2f5f2163825643637c897", "atomicSwapFeeFactor": "0x1509233a29eaeb1b61f20040be4dd415f027c0b543b6222075a8c10f6a3546c1", "swapImpactFactorPositive": "0x6d7c56088daa2bea15028f86d6f54e24a63768356083dce669015965c9f5b873", "swapImpactFactorNegative": "0x3b2c183b4353852490404ae6be59826b51e24517576e18db1483a6c593a1a99a", @@ -797,19 +872,24 @@ "maxFundingFactorPerSecond": "0xfaa2e2d54bd6c23be91d8e5c47cb3ae9d9fec59b9aa8290ef792420f15b2469c", "maxPnlFactorForTradersLong": "0x85ec736c56013977c51d5e19da50497a732239f0fca988471f4e0a3066fca75b", "maxPnlFactorForTradersShort": "0x8edb1f5246ad1af8d59a7ad26d8f41fe7dd2a1813a1569cdcfe40851df6ea6cf", - "positionFeeFactorForPositiveImpact": "0x529d29c9843efe4be2f9872d2e78fcf6e0440a13d77141765380fc76817f5c87", - "positionFeeFactorForNegativeImpact": "0x8e3f4978a3cf5cce73d79ff5773e2edb617da3267e8017ac64dfb274f7742094", + "positionFeeFactorForBalanceWasImproved": "0x529d29c9843efe4be2f9872d2e78fcf6e0440a13d77141765380fc76817f5c87", + "positionFeeFactorForBalanceWasNotImproved": "0x8e3f4978a3cf5cce73d79ff5773e2edb617da3267e8017ac64dfb274f7742094", "positionImpactFactorPositive": "0x84bf3fb933429f4de132e3c58aff52a078506381c7f24020b466fccf28905941", "positionImpactFactorNegative": "0xf54c7c49ce94e0c61f7c5038863aff7eb4a7aa1a1097acf42851ffe9350bb0a5", "maxPositionImpactFactorPositive": "0x8fba80b3646c853ff0999394fbddf236bfdb72482b4fb1dadf6fbc81caa1b9f8", "maxPositionImpactFactorNegative": "0x12ba189cc009055d7cb1907f44c8b32ba8b8c6a8f0359713a84ba3179420f542", "maxPositionImpactFactorForLiquidations": "0xf630085ecccd08f436223030db10c9c8bbbf96d9b8e0dfdf97d02c978c024b14", + "maxLendableImpactFactor": "0xf403c0635696149bfb203b07cf6aa938a603884ce708fe342d0c95bb9c77f6c0", + "maxLendableImpactFactorForWithdrawals": "0x9f4f21d5d90fb9137601d9e8f67d52fc46912abe323569b8717ded1b8ca4dea4", + "maxLendableImpactUsd": "0x3facc7f4177d656a98252b3d56766e2797a66c79f6d86c6bcbf3d661dd49659d", + "lentPositionImpactPoolAmount": "0x5e1acb7b2b0e3a0aae60283a53fd1869b55460eb4c7a6874a69028084749c9e9", "minCollateralFactor": "0x44d3450628900783da0a74bb9d83b0bca2ff8504e6c4d420a2c5480085883855", + "minCollateralFactorForLiquidation": "0x045488831e4d7b120737807287cdd91326b56a531a357dfc178b1e621a073fda", "minCollateralFactorForOpenInterestLong": "0x95ed56a404dad3b4f299ec1ce25cef2de1a828458f02787a404fff019baaafa4", "minCollateralFactorForOpenInterestShort": "0x8f5bb4ea781f12eefd8cc65f9cbe17af85a9e315fef4cc50fe63e7471af42531", "positionImpactExponentFactor": "0x2ad9516b4cf9062372bbb664ccbba50dff378bedfb8e9defbdc4eadab8306d1d", - "swapFeeFactorForPositiveImpact": "0xcd711380dcd676e0544ad089e8c882686c308f656fa651d48a0747b7f70fd564", - "swapFeeFactorForNegativeImpact": "0xfeadc380b20cab88593bd96433d4b0ee08368051055dfcfbfcc594a02a98cf08", + "swapFeeFactorForBalanceWasImproved": "0xcd711380dcd676e0544ad089e8c882686c308f656fa651d48a0747b7f70fd564", + "swapFeeFactorForBalanceWasNotImproved": "0xfeadc380b20cab88593bd96433d4b0ee08368051055dfcfbfcc594a02a98cf08", "atomicSwapFeeFactor": "0xe7e08dc2e46bdec6bdb17e9860d93dbd8ec4c73bfc46e0fd78170aa3c5bd33de", "swapImpactFactorPositive": "0x737c7f824ed4b98d1e563da86dd27bc6555ef0c5e3a7735a9d2efad4b87dddc1", "swapImpactFactorNegative": "0x71533255ae7a74548b062c095bfbf28d36199e44d3481ed295bc9075f5137ef7", @@ -848,19 +928,24 @@ "maxFundingFactorPerSecond": "0xc3d8ca914f0cc679122fb0f2cf851dd828b598d7d60d3b5fcc56ed86d8cc33fa", "maxPnlFactorForTradersLong": "0xea0ab7ba61168c2bee279288a503df6416568c2bbabfa80fe953fe824954d628", "maxPnlFactorForTradersShort": "0xab9ca42c0baf668370ea036fec734f4badac8b93f7d98bf8aca0c7bc53e3a100", - "positionFeeFactorForPositiveImpact": "0xe5e2c324445803bae980161bc19f60163527312fb3ba12a69c42ac9d2d1ce824", - "positionFeeFactorForNegativeImpact": "0x3c8892db6ea33607529e998daf052e2d7631399762ee3d4ed1dc0ef43290fa54", + "positionFeeFactorForBalanceWasImproved": "0xe5e2c324445803bae980161bc19f60163527312fb3ba12a69c42ac9d2d1ce824", + "positionFeeFactorForBalanceWasNotImproved": "0x3c8892db6ea33607529e998daf052e2d7631399762ee3d4ed1dc0ef43290fa54", "positionImpactFactorPositive": "0x3bea7fd67f7eb844908e5e28482f18674e6bba80493bcac40694608c91afb23a", "positionImpactFactorNegative": "0xe6d8bca55d639e4693467c4031793f201d42fb885127ca38006b4948dd7af1e0", "maxPositionImpactFactorPositive": "0x4263f2ff7af12d6564bab215180503848e8bbaae4bf39c4e6e4e5d73b9a8add3", "maxPositionImpactFactorNegative": "0xf398b3bf767ae253c3dcace78389d530c601ae67be971378528e0b5a0bf2164d", "maxPositionImpactFactorForLiquidations": "0x8fe8d9a666bd04e67d114209c1926e70a58a132db2beeed4177f31ae9d0318c3", + "maxLendableImpactFactor": "0x1749895678e38a3343c373c2d2c043ee94127a7fa863488817f099d6ff98760a", + "maxLendableImpactFactorForWithdrawals": "0x3a41d7ec40650324eb9ffdc44c4cdebda6d53a5383a74f986d3d0cbb6819de34", + "maxLendableImpactUsd": "0xfabf16315fd84c105d19c87edd5186946f5a33dbd327d2c3ec395a67ac401043", + "lentPositionImpactPoolAmount": "0x62da073ddbddfeaf8aeef839b7d6134b84491635b7915b1426c5ff8720519e2e", "minCollateralFactor": "0x6a8d715582ce7a436f0926fce0f99d60dd260a473e14babbb4560315a488cc1f", + "minCollateralFactorForLiquidation": "0xd0362b4c48dedbb4f87db87c773b0f4329525d6197ab8617c15dd6e4668d3264", "minCollateralFactorForOpenInterestLong": "0x6d844c42863e83e23fa960ab45a1a5696e1be08fa1e4e772366172c0ac93229f", "minCollateralFactorForOpenInterestShort": "0x47f7b3459fe7e68075e8c6444215e21468de24ee4f0fdb3ddc04af016f6755b4", "positionImpactExponentFactor": "0x6193f8d462c3326bc8cb666374837667c596f93cd996cffbd81668a636843061", - "swapFeeFactorForPositiveImpact": "0x2fc46450b98092e9b66e0bf7696ce02d4c833be88de497cfb915d3f39e3812ec", - "swapFeeFactorForNegativeImpact": "0xb37a74e4f029bbab4db5c9a9bf086565143dc8e25ac8cd13909d079fb770d4c6", + "swapFeeFactorForBalanceWasImproved": "0x2fc46450b98092e9b66e0bf7696ce02d4c833be88de497cfb915d3f39e3812ec", + "swapFeeFactorForBalanceWasNotImproved": "0xb37a74e4f029bbab4db5c9a9bf086565143dc8e25ac8cd13909d079fb770d4c6", "atomicSwapFeeFactor": "0xfdf1e814ffbae35f4df6a90a4d167e0a998a23174ca373a153e356504f28e7ae", "swapImpactFactorPositive": "0x027553df27e8e9b5a65bebc5f963f76e85ff58fb8d9c1ae933ca099379ca4b60", "swapImpactFactorNegative": "0xb75f6793ffd5ebc77458bcfe941d32c2939bfde678876cb5795ef174242a34fd", @@ -899,19 +984,24 @@ "maxFundingFactorPerSecond": "0x55069748b013aeafed958fcb91ec1fd542ea8544b742f6eb55c55776ac9f35dd", "maxPnlFactorForTradersLong": "0x8eb7ba2e0073ed92d420187aebffc7b087a92b226be547ff071f08274a0a4bfd", "maxPnlFactorForTradersShort": "0xd16159783f2f3480377b1016b40459ce05c08c5dba1055f792df1a4244251f45", - "positionFeeFactorForPositiveImpact": "0x0c5805974efe868ce0ca027b4a7633ad68158550b1bb97bc30278ebbf228c14d", - "positionFeeFactorForNegativeImpact": "0xdb16d4b4d8013bcc93d01321c277effb94bf6b8550cc8344b7b66819a29638fb", + "positionFeeFactorForBalanceWasImproved": "0x0c5805974efe868ce0ca027b4a7633ad68158550b1bb97bc30278ebbf228c14d", + "positionFeeFactorForBalanceWasNotImproved": "0xdb16d4b4d8013bcc93d01321c277effb94bf6b8550cc8344b7b66819a29638fb", "positionImpactFactorPositive": "0xb11d8986c9d5f1ddb9a54c87c508436447121d439f07f9095a366cc5cc07527d", "positionImpactFactorNegative": "0x37dbbde80316028bcc42ab769e2d1dea559042641b0ef5e7e8b2c9bbdc92d21a", "maxPositionImpactFactorPositive": "0xc48d8c6bc423b09532b41f9989b3379cf2f045332ff8653091fe4d7269132d16", "maxPositionImpactFactorNegative": "0x56c740c2ca614eab1d549b7bb7a4f6288cf040a585c97ec247670cc345d4ec91", "maxPositionImpactFactorForLiquidations": "0x73aac72421893e1c0d682fad9aed3749e082ff69084394c9acc9b4ed0a0cc3b1", + "maxLendableImpactFactor": "0xde1ba05fe687e529a6a0c58d2100de1139ad4928b37e52862c8d1ebdb22a1a61", + "maxLendableImpactFactorForWithdrawals": "0xee346d2edd361d19d698b4dd0789969a134d4ed19a464cd4201596b74ce53fed", + "maxLendableImpactUsd": "0xcfce9499d841b6c0e363c365ac82b6f7a3da5f3af87fcddff222e8582f34d63d", + "lentPositionImpactPoolAmount": "0x4454cc660ad883b095ddc9c0857ae37b951ea31b82b25bf07708c2525e7300f2", "minCollateralFactor": "0x5b9cbe70edfdfea83201f44a0f1c912fb82a4a1ee106f9a3842bb29cb5301035", + "minCollateralFactorForLiquidation": "0x71ff8d76e7fc434950cad2cccf97e7b7ba4f414cbf807094440bd8599e6a61d6", "minCollateralFactorForOpenInterestLong": "0x2a50bf17c53f122cad04b207535a3c74b062687e8c8f8657ea2f927b501c1062", "minCollateralFactorForOpenInterestShort": "0xff365ea9e77f3aff0dea18e392461b9ca0e3b42051708fa32969f77d5ca76b87", "positionImpactExponentFactor": "0xd0d2c3fbe177c70b48f1f2866e4a15ccedeae13f3e7c96726a6e367325a045dd", - "swapFeeFactorForPositiveImpact": "0xf9e19bb3189d432360663917ab7316f9eb15e32ca0fc81158e76cdcd51084b52", - "swapFeeFactorForNegativeImpact": "0xe5f10a8eee33843ebf12cef81e4141d649bfb8c2584c80c0fc1e71d1e32d0d0e", + "swapFeeFactorForBalanceWasImproved": "0xf9e19bb3189d432360663917ab7316f9eb15e32ca0fc81158e76cdcd51084b52", + "swapFeeFactorForBalanceWasNotImproved": "0xe5f10a8eee33843ebf12cef81e4141d649bfb8c2584c80c0fc1e71d1e32d0d0e", "atomicSwapFeeFactor": "0x6f191cb60f240eb255b18e35b30e69a2555b7cd004db58df4413f6ce73989ac1", "swapImpactFactorPositive": "0x51f43de19f522a77191e09d4d845cabc4a6b411ed843bd7333c97c0dd2a1e99d", "swapImpactFactorNegative": "0xdb943b0a66e6c7d34998c8e3ff6ce90d1f79df2b550aac083000d80ca80b1277", @@ -950,19 +1040,24 @@ "maxFundingFactorPerSecond": "0x62aa103c40f4782518c92f328ea7e13953221a344bbe17e1182069e74bdccd43", "maxPnlFactorForTradersLong": "0x5c46a769b0e6fc8e1900598d8b17673417a9f295712f0839f2ba621fdaaa1420", "maxPnlFactorForTradersShort": "0x3157f0b83f7f288d4345b32021f8625dd0211a0bb3a856869d8449883481df51", - "positionFeeFactorForPositiveImpact": "0x8e1966a3f947cb6695cd3294ede56aa8667a859843a47c8a1dfa15355ae302bd", - "positionFeeFactorForNegativeImpact": "0x3d52d46103b4fd7fe8a8d527bf5a484d3950554a42a2879766c90dcaf48541a1", + "positionFeeFactorForBalanceWasImproved": "0x8e1966a3f947cb6695cd3294ede56aa8667a859843a47c8a1dfa15355ae302bd", + "positionFeeFactorForBalanceWasNotImproved": "0x3d52d46103b4fd7fe8a8d527bf5a484d3950554a42a2879766c90dcaf48541a1", "positionImpactFactorPositive": "0x7938767f73461676c26d5a862999ac1f38ce4efa8b026f6ac6b1e8df69c4a8f7", "positionImpactFactorNegative": "0x9028c1019ee95416ba45534f1a394daea60dc7fdd77b5320961b263773789bb5", "maxPositionImpactFactorPositive": "0x8cc0069408f08a8a1e914d23f0bd90ab2edd81dcb73ba80808c1cb161d7f866b", "maxPositionImpactFactorNegative": "0x8326d13e731e4a06711e304528185e6df2a513e097f53a509c44e802ebc0c816", "maxPositionImpactFactorForLiquidations": "0x3ffd3e2d8443b5c30958a5bac0fdf3d6c024ea77777f91dea6aeaeff923797cf", + "maxLendableImpactFactor": "0x04ebe570057f2180ebd8a9974508c054a9ce74f674831b8416c93266451a1283", + "maxLendableImpactFactorForWithdrawals": "0x6deeca3b9918df157ac6b79b200ae21f3325e0d5f776ed8cd20b4a84d38fea1e", + "maxLendableImpactUsd": "0x8d8d59ace8460900776b284975c4d174a52b808a53c04a79828065217ed88e0d", + "lentPositionImpactPoolAmount": "0x3ac5b008a4a45cde1635b3032377df6d75074abf6c7d9a80b4b93fdf82711019", "minCollateralFactor": "0x69a941e84ede0f13d1c7a57eb687f63ce8927eeef908b0e1e8dc22f9fda6c050", + "minCollateralFactorForLiquidation": "0x5cbd1eda2c597db32bc6c3e5e9098bc9dbf2442d0956252f63722275452b0da7", "minCollateralFactorForOpenInterestLong": "0x9a7f1df75521d5245272629ae3d633c5b1df32b56dbfb7bcb79f6ed1783f3207", "minCollateralFactorForOpenInterestShort": "0xa3964e38e2bfad919081510f192eb40d3c12b8102f229d74230e94476af37ba5", "positionImpactExponentFactor": "0xc59aff205787697cfac1654c750728376206127692ee4e7134bb41d79217bcb6", - "swapFeeFactorForPositiveImpact": "0x3364c0f9fc9f8bb96a1008c317d26b51f20c5ea1d1130799e4662d8c4a7bf3b9", - "swapFeeFactorForNegativeImpact": "0x305d6a42c6ccdab58c16ec512fc0b9394bf2dbdf82516c15d09cdcb76085e4b2", + "swapFeeFactorForBalanceWasImproved": "0x3364c0f9fc9f8bb96a1008c317d26b51f20c5ea1d1130799e4662d8c4a7bf3b9", + "swapFeeFactorForBalanceWasNotImproved": "0x305d6a42c6ccdab58c16ec512fc0b9394bf2dbdf82516c15d09cdcb76085e4b2", "atomicSwapFeeFactor": "0xa911e8a22efd7c8716579f5327ca2b5363b5957bee2a2ac32ebc7b04a009c024", "swapImpactFactorPositive": "0x6ca9dab5d892a8a0c799579aad85021f29ddde1c808da563752093e0ddf2d4c7", "swapImpactFactorNegative": "0x0a2d863399db84d689cfdc9148b1a486ad96583764fdf636a66862500cc51b96", @@ -1001,19 +1096,24 @@ "maxFundingFactorPerSecond": "0x2e363ac3de945f9e347a42944c7ddc509c53f8ce07b05316181a4834368d4af7", "maxPnlFactorForTradersLong": "0xc2b6ba297e2818e9751c3039ff2071b2ae3b4d72dee96205fd6c62cc9545a5ab", "maxPnlFactorForTradersShort": "0xa7db2c7ecf2ff216c4276556a88d852ea7296c5da8839673baa4f00f17e708c1", - "positionFeeFactorForPositiveImpact": "0xd777c5b4d55d87e7a3876930db0af4b021a643cfa9070d896e77bda6b5681d6a", - "positionFeeFactorForNegativeImpact": "0xa94fd16219d3c4b400807acb21ef6ac91bb6f1870bca3cb5ba5a19dc4f6e6c9c", + "positionFeeFactorForBalanceWasImproved": "0xd777c5b4d55d87e7a3876930db0af4b021a643cfa9070d896e77bda6b5681d6a", + "positionFeeFactorForBalanceWasNotImproved": "0xa94fd16219d3c4b400807acb21ef6ac91bb6f1870bca3cb5ba5a19dc4f6e6c9c", "positionImpactFactorPositive": "0x644525ed476f4be317620be6a478b562b0de82d724dbced4b69c638ebdfdec79", "positionImpactFactorNegative": "0x1d5d8012f2837929e603657bc2d70a612947a3a1926d332e48e709b209d90f9d", "maxPositionImpactFactorPositive": "0x5319f499876d4621e715dc632e7d7cb3933dc765ea1acf8d430e17a55393e986", "maxPositionImpactFactorNegative": "0x7e416f0acea3cc9622087968a015c15cf9a9039935214cbd69d6e7a2059f93fc", "maxPositionImpactFactorForLiquidations": "0x1763e966632029c1f297e56d1a17944619af4ac6276c6f897ecd10bedd501f28", + "maxLendableImpactFactor": "0xebef0970db3654b327983d90211b1d5835ca7aba423825a79892ebc3830b8290", + "maxLendableImpactFactorForWithdrawals": "0x94f2a84873648f9fdb79ac47c08980d65bc572ac20486f76d6aff0d08b39e68e", + "maxLendableImpactUsd": "0x5b357ad4bb38a6e6c6bb0046dbff6dd7e04211880474c6776313374c3801b90e", + "lentPositionImpactPoolAmount": "0x82ab418657d08d9c6646d415bbf1151bf53f6fdf275d3d8e50e6a373504e3ccc", "minCollateralFactor": "0x658da6dd132bb7e1756b246c646e4f3681462f841ea26f37d83a1bc7a7c640af", + "minCollateralFactorForLiquidation": "0x3f735896b5ad89fc720a25fd616b3c729789db640f8a0620238eefaf2fc2de7c", "minCollateralFactorForOpenInterestLong": "0x5b29bc756da04509ebef8e49358a85e1b080ee9d9b19f646413c7ec366643c4f", "minCollateralFactorForOpenInterestShort": "0xc386fa4fcdecdfd9ac1d63b2d86d391f4676ced1e3ddb89d47bbb629bfcbde6e", "positionImpactExponentFactor": "0x2214e49931ae131c89d827b277789c69bccf736319f9448888c99ff753982a5f", - "swapFeeFactorForPositiveImpact": "0xcf099a51e285d31b3ded24bb284f311662deae9715dff06251f99a1a623a7c01", - "swapFeeFactorForNegativeImpact": "0x54f7ac0acaf50fddc48a4d1687ef164394bd31f48441c86b9fea6d348f7d83c8", + "swapFeeFactorForBalanceWasImproved": "0xcf099a51e285d31b3ded24bb284f311662deae9715dff06251f99a1a623a7c01", + "swapFeeFactorForBalanceWasNotImproved": "0x54f7ac0acaf50fddc48a4d1687ef164394bd31f48441c86b9fea6d348f7d83c8", "atomicSwapFeeFactor": "0x16e598fd74c94ad3c757bdf8764ccf02388d376df4d70c59d9e7e5b05a8dc129", "swapImpactFactorPositive": "0x004df3c0dc3d5b0aef8045ddf6c7170646212a2708d9c8efd90d42aa68887f7c", "swapImpactFactorNegative": "0xddc46fbfef1ad897fbe83b4250c0e21dc33408f6035ed37f98b4349cac818569", @@ -1052,19 +1152,24 @@ "maxFundingFactorPerSecond": "0x600ebc560d5b1d959a5561e38cfc1e6fbafa3f74e4b84d3c77c000003913420f", "maxPnlFactorForTradersLong": "0x48fbe5087841455da95914af5afadfdb9bff2c13381ddd257abb5a01860d302e", "maxPnlFactorForTradersShort": "0x22cd9499d49aeaa2f91b64be08489a3ce928b8022d46363d16d60d459b0d7f94", - "positionFeeFactorForPositiveImpact": "0x97c1a448f396a50ccc22e2ea500e54434962a5249dc5a661d06658985ae59383", - "positionFeeFactorForNegativeImpact": "0xddf9c6e8a3146f2034501e798506b8a353893e80b3de3748c74b87532f824982", + "positionFeeFactorForBalanceWasImproved": "0x97c1a448f396a50ccc22e2ea500e54434962a5249dc5a661d06658985ae59383", + "positionFeeFactorForBalanceWasNotImproved": "0xddf9c6e8a3146f2034501e798506b8a353893e80b3de3748c74b87532f824982", "positionImpactFactorPositive": "0xb906177bd22906fb4855b38744d7322883feb6e061495886d5c12d0b8f810ccf", "positionImpactFactorNegative": "0xc75f07b39b2aaf3050d588849ef734198cff5801bfa21c4559b08a95e281f72d", "maxPositionImpactFactorPositive": "0xe38a3799bc01e41c85e5fd8df2d75f32af5e85731835f96bec4cc30adab2fe75", "maxPositionImpactFactorNegative": "0x409c6508fd9685bb329819c23f0ec5e609025de5ee993837362348919dfb86b3", "maxPositionImpactFactorForLiquidations": "0x49704998ebf84402cb8e86f8e617cfc500631b77d9589d637e25350c84582f29", + "maxLendableImpactFactor": "0x1c73ec35a26f4307497d8cf7691e2b2af2c1d8d575d497ee365bd1aeee24d11b", + "maxLendableImpactFactorForWithdrawals": "0xe747a8862385c810a6a424472e69c7774549bbbf532d91c87861d0ac1bcb93df", + "maxLendableImpactUsd": "0xa9b9ec70460741f91d78a921f8aabbdb18ece7faefbc2934034a21ce9f38b78b", + "lentPositionImpactPoolAmount": "0x1e63a813f114a0e36791d2cf3cb9c8ba278c895facd33bf82652b841c163964f", "minCollateralFactor": "0x99b3701cc7c1265785f49ccd881b41099fbe598b8eec779a1cb9f9d0ab47c538", + "minCollateralFactorForLiquidation": "0xa3555afc1b6acabe022942d56a72327d65daf86bf7eec60ebd84645c8793ad58", "minCollateralFactorForOpenInterestLong": "0xc711c4d6d1307e7c53adb1d3e70e48374818834facdddda9f3aa07ab3b84b6eb", "minCollateralFactorForOpenInterestShort": "0x43728b39e120b4a41ea9f74f87206a5de82c1fd6020b9c20e8a12becd690628a", "positionImpactExponentFactor": "0x58ff383b5858a0568214aa46f74f6c6acda40c2de4e119a9fc703e6e9f883533", - "swapFeeFactorForPositiveImpact": "0xc88b708cf46980ee7b53f2d31c02cae3f4097451afe3d262d1ae325896e2fb2f", - "swapFeeFactorForNegativeImpact": "0xae26f90162d5a9dd0c751088ef6e3d8ad0a4e4d4296c92959aecebe6eba55438", + "swapFeeFactorForBalanceWasImproved": "0xc88b708cf46980ee7b53f2d31c02cae3f4097451afe3d262d1ae325896e2fb2f", + "swapFeeFactorForBalanceWasNotImproved": "0xae26f90162d5a9dd0c751088ef6e3d8ad0a4e4d4296c92959aecebe6eba55438", "atomicSwapFeeFactor": "0x5671a7614ebe14a1898c515d300b8190920c147b248e214499e630554e877391", "swapImpactFactorPositive": "0x9afe4fd264c1db9a7311ade7ccd92b9901cda321ff91dc4a544e60e9aefdd403", "swapImpactFactorNegative": "0x24b8ea4213ef6ea1381eef1d22c8be6e6a2776542043f94cd0b75451e722acc3", @@ -1103,19 +1208,24 @@ "maxFundingFactorPerSecond": "0x791b8aacf46146f2c630c31e87150454705394d0ddee283d9a218093004c4991", "maxPnlFactorForTradersLong": "0x61205f138d458d410fb24113fddaf8bfb906c41a5bd1243e09a60bd3fa95e6ad", "maxPnlFactorForTradersShort": "0xef08c3656d3ce51df1b75f08a987d879463632460692bcda68e4ef17ebac29c7", - "positionFeeFactorForPositiveImpact": "0x55eb1bd845d62653b5e99b5862c3604b078e1609942fddc47148214a9f1b6c98", - "positionFeeFactorForNegativeImpact": "0xeab5b72f46abf95fba34f585b311a74eb14eb8c40d3030aa04e806881a5338f3", + "positionFeeFactorForBalanceWasImproved": "0x55eb1bd845d62653b5e99b5862c3604b078e1609942fddc47148214a9f1b6c98", + "positionFeeFactorForBalanceWasNotImproved": "0xeab5b72f46abf95fba34f585b311a74eb14eb8c40d3030aa04e806881a5338f3", "positionImpactFactorPositive": "0x5639f816f2049a823282162b24c26bccad96430b6cc80cfd802a6e0a4daa48e8", "positionImpactFactorNegative": "0x64b33aa4893fc85aeec723156a0fc0c151ec4e7d9e8c3f2f3225e52cdc6f5453", "maxPositionImpactFactorPositive": "0xebacab0fccc785fffddf4ce399ec5f857e302fa137d3b3443f5a3153b5d925b1", "maxPositionImpactFactorNegative": "0x0a64b1059a69b7fb1f5738256b5d1009c654a0343331b552b0946bce23fa5abb", "maxPositionImpactFactorForLiquidations": "0x9f5eb4d0a87742d78eb809fd1c85d378f22e830e2155e4c130147b107606db2c", + "maxLendableImpactFactor": "0xfbe064e19c3e25cc5bfd9034893728a86c34fe48c285de49de11478c9763c2c2", + "maxLendableImpactFactorForWithdrawals": "0x6f18cbb5bc5d13d823dfa54644e3830fa136f22c5249c629344ce22761600d77", + "maxLendableImpactUsd": "0x760f274dbc4197734350f453e31e52e0f92218688034645fd667c249904ce555", + "lentPositionImpactPoolAmount": "0xf1161f028f91a3ff65d2ed847183aaaee60d6601e3dcf8eb35b30636a1dfadbf", "minCollateralFactor": "0x505fc7c1a1954b72fd3b5f7f9b5250661340b75ce9e9044e6dd11c8da2d692db", + "minCollateralFactorForLiquidation": "0xf2a71a4e761efd126653b700f3f521749f94b22a97852ad66374cdd674e545c9", "minCollateralFactorForOpenInterestLong": "0x7be7f22de8ae3c36d8218b44d06c5a126ea07b5bf1176ff4e90c34ccdae32302", "minCollateralFactorForOpenInterestShort": "0x49034ddfa16113a80d2c700f7fa75fee26f684beec367e2c7d7e4f3f08320bb8", "positionImpactExponentFactor": "0xd0316ba8768fcb3880ea8519def956514eb9bc7d1cd1d9805bc936e379eb8610", - "swapFeeFactorForPositiveImpact": "0x3097eb783f61d26eb308b82a5f390ad8a3b17605c548f16f6c22a9e4a9d4fdfc", - "swapFeeFactorForNegativeImpact": "0x8439bc00c0643f5214a648849ed64fad4e16c6fdaa17c415cec3232757a71e70", + "swapFeeFactorForBalanceWasImproved": "0x3097eb783f61d26eb308b82a5f390ad8a3b17605c548f16f6c22a9e4a9d4fdfc", + "swapFeeFactorForBalanceWasNotImproved": "0x8439bc00c0643f5214a648849ed64fad4e16c6fdaa17c415cec3232757a71e70", "atomicSwapFeeFactor": "0x5c32414b2d8daead8b548e58f19445b0a6fa9c0ab06c88a953caa92b0e0e09eb", "swapImpactFactorPositive": "0xcc58aaa5866cf4113e41fc4df9e5ee80b1d697ae5449bb1aada134f5eb228cbf", "swapImpactFactorNegative": "0x02fcf4c3f06217571778935d3f7e97c3e8d72c50baa6e937265d4b9d3cb65b37", @@ -1154,19 +1264,24 @@ "maxFundingFactorPerSecond": "0x0a6526a497e4489cf4be22651eccc3b5071dc85cdaf2db76ebbee48f55fe4b44", "maxPnlFactorForTradersLong": "0x9ddabf7f3e53a1821379516b58312039c6eb26b81ee291c1252ef022bc03dc64", "maxPnlFactorForTradersShort": "0xbd9f0a0545529a2ddc6068c9d4d8c38529cab28e6dbea62d20017cdf93bba76f", - "positionFeeFactorForPositiveImpact": "0x483710f439356b530fcbd39fe35dca94e09ae68f9b42137c2426b15c7eecab44", - "positionFeeFactorForNegativeImpact": "0x9fcbf5b6ce818dc0a039fe77c3344216992a26473d6aa52571b5f9b1ebdd29f6", + "positionFeeFactorForBalanceWasImproved": "0x483710f439356b530fcbd39fe35dca94e09ae68f9b42137c2426b15c7eecab44", + "positionFeeFactorForBalanceWasNotImproved": "0x9fcbf5b6ce818dc0a039fe77c3344216992a26473d6aa52571b5f9b1ebdd29f6", "positionImpactFactorPositive": "0x6e0611944f4603e4b3eb24878be8b06c454f0d32cdbd115b6989ce8666412b9f", "positionImpactFactorNegative": "0x6e3f4836d516e2b3c7d97f4eb14b647210743805f6625f18dc048184d42f3236", "maxPositionImpactFactorPositive": "0xa49f2ccad33245c6c3e4e65abbc1b574fb1b260c790a598aa1607b7916af939b", "maxPositionImpactFactorNegative": "0x1264f0fe836dba8344c27cfd30a27687f01ede436cbcb88905f3d099866aa385", "maxPositionImpactFactorForLiquidations": "0x3bee549827b24a6c7258484153433d3e8975a38058ca8301a06274c57c12febb", + "maxLendableImpactFactor": "0xa75bce095842fe06e45af063eb831699f32ddf980e20fcfc902ca2631ca02613", + "maxLendableImpactFactorForWithdrawals": "0x31db483709baba5a5308053acd07bf2634f332731b317661879c618d0f5c602a", + "maxLendableImpactUsd": "0x29e9b1977298989ed1a7683018b65cb8acbcc60e5192fd76c1059701b553e10a", + "lentPositionImpactPoolAmount": "0x3c32fa51b15bd069ea7b9492ae965d188a2b02920e70ab1a161dea34f0f3ad41", "minCollateralFactor": "0x23996b6d9b7a115e3ce89b84c1fb992e361ab8b7d0eee682f20dee97ec68ffe1", + "minCollateralFactorForLiquidation": "0x7c2459f97adc8e43337e81a934c826ed807ff31274e3f0092cc5677aa9ff20d2", "minCollateralFactorForOpenInterestLong": "0x35859412d8490a4c126fe4f1bfc34c55cb8fe37dfa500acd3c8b86af666c5ec3", "minCollateralFactorForOpenInterestShort": "0x9fbb1a4f2cee065baea2f8cc6c37830cef07cbbc7a5c433a7a525949f5ecebd1", "positionImpactExponentFactor": "0xb6bff386e5ea9af0e6720bebfdd73d88abd8d3028c1819942bcee244f2ca9405", - "swapFeeFactorForPositiveImpact": "0xaaf64b979df9faef0f42c389d81152da8e9d914ed4fae4f41a31ef0f70334eb0", - "swapFeeFactorForNegativeImpact": "0xbe982294c986c3affb4919d120c418c791a8602c614700dc2bb0ca07815e6ed0", + "swapFeeFactorForBalanceWasImproved": "0xaaf64b979df9faef0f42c389d81152da8e9d914ed4fae4f41a31ef0f70334eb0", + "swapFeeFactorForBalanceWasNotImproved": "0xbe982294c986c3affb4919d120c418c791a8602c614700dc2bb0ca07815e6ed0", "atomicSwapFeeFactor": "0xf53ef4c33158142d328bfc7c66ddd8ddda3b43d1f6a9ebcdf63a7e2a1d439ca1", "swapImpactFactorPositive": "0x9fd271446b4cb4dabfda536750bd6f93b58bfb591131e601bae3c640d9609b2a", "swapImpactFactorNegative": "0x4a7f2a5421a3eb1067a7e45de84e107fc455e79cfbf6236aa396f99272cfe4b0", @@ -1205,19 +1320,24 @@ "maxFundingFactorPerSecond": "0x5b6b8bfa2a902a4700b5a546209cb4097cb278eaffa6c775832110dec862dd16", "maxPnlFactorForTradersLong": "0x7e878f228e830c2c29edf1cebd86787df291d03924e2681eb9192db2925e2576", "maxPnlFactorForTradersShort": "0x13a5a683a8052446dd311ec4c4a537be6c046a45cdf374b87ecbd3663196e07c", - "positionFeeFactorForPositiveImpact": "0x546c33b1dba15b428da83872dde33a920eb215ff6f219683cd72ba4a26d5c533", - "positionFeeFactorForNegativeImpact": "0x8d6b3bf9f919ba71b67feb739447c6b300ac0f9f79068132584ce16c2a1e0fda", + "positionFeeFactorForBalanceWasImproved": "0x546c33b1dba15b428da83872dde33a920eb215ff6f219683cd72ba4a26d5c533", + "positionFeeFactorForBalanceWasNotImproved": "0x8d6b3bf9f919ba71b67feb739447c6b300ac0f9f79068132584ce16c2a1e0fda", "positionImpactFactorPositive": "0x799fd72dcd8bc0b912b482f186a074b67fdab11aec58c5fc3c09a5ab601bfe4d", "positionImpactFactorNegative": "0xc35bd69b22ba7b4339033e97d3d4ad5735fbb434b54e10be44bac834d63d4ca6", "maxPositionImpactFactorPositive": "0xe2991c2345da0cfdfd5b8ec9e7676658276be8890053e15fcccb194d3bf7e12b", "maxPositionImpactFactorNegative": "0xe113eb600d7bbf5d1eecc81235c5881d5d33afb2f11d9ec2a2be8028b471a17b", "maxPositionImpactFactorForLiquidations": "0x5837f920215e0e61cea98ec67e54f88ea6b2c37942ce77134be57426826ea24e", + "maxLendableImpactFactor": "0xd6ed141e8b8c6e2661ae4c99f03c1a2ee9ad0e40c565c5425075c5e1deb120a7", + "maxLendableImpactFactorForWithdrawals": "0xb6877a6bd2fa681248dd21765f9e70148c4a9d8828b25b28477a2b545880afd8", + "maxLendableImpactUsd": "0x46ef0d545d15cab8085e3b3fa590e5f0cd1dbe97e8f24becb729ed6174433f85", + "lentPositionImpactPoolAmount": "0xb1ffe51e28a73953e596bb398eb721fbaa5e76baa0daf35ed61480cb11298899", "minCollateralFactor": "0x36ab3e3013ad52ba6a0d8f4a0453b7102f49cac48a2a11fa6c73dbe0aefe816f", + "minCollateralFactorForLiquidation": "0x5bfcbab875f4417b539e955ceac950cd006a69b7f451081607ba40e7fbb369dc", "minCollateralFactorForOpenInterestLong": "0xb53e1f7357d8985ac911799567e535ae47b4b735a3aa570d896d2675c5ebb6d9", "minCollateralFactorForOpenInterestShort": "0x24518edda98ceefe82f1204ce0f521627a009586216d80895e53abfe2ecf184a", "positionImpactExponentFactor": "0xd0f2eee3c7933f4cd4be61e89645e29cc81fe2e6b8182b4622055eda40e77d48", - "swapFeeFactorForPositiveImpact": "0x95cc059a74ab0cc2d211ba23f2332e2b506142a89fddc54e2006bc3f35931464", - "swapFeeFactorForNegativeImpact": "0x4771d81fc424f4ad1751f397a8bf3cccc268f477d6a35c745a0e9d1841e1027b", + "swapFeeFactorForBalanceWasImproved": "0x95cc059a74ab0cc2d211ba23f2332e2b506142a89fddc54e2006bc3f35931464", + "swapFeeFactorForBalanceWasNotImproved": "0x4771d81fc424f4ad1751f397a8bf3cccc268f477d6a35c745a0e9d1841e1027b", "atomicSwapFeeFactor": "0x121d44595c73c7cf96dbeb5db9d1e30a4f96ace8ca98fc55606bb043dab27176", "swapImpactFactorPositive": "0xb5f17a97f65ee498fdac7f1788550bbd6a729107081de95c3890c697fe931481", "swapImpactFactorNegative": "0xddcb4f9e4b88feb61b957dbc5dc0bd03435c471d8ab9c3c985699b0cad17ffc2", @@ -1256,19 +1376,24 @@ "maxFundingFactorPerSecond": "0x6c5d09a30a097dc3ce6bc2bdf3ae5515da61cf6eee5ffe30776669db8d0299ff", "maxPnlFactorForTradersLong": "0xa4856280b896701f3961e30b5ae67819ccfb3ecfcc1b02b51a279498566bab2a", "maxPnlFactorForTradersShort": "0x9261ef9a90b9f9785f18258aee39f431e7af66971ce7628b37dd197d93bde9dd", - "positionFeeFactorForPositiveImpact": "0x98853d8dfbb87c8e9d5e028e404924d8e05219c0b47225b2044b7e7877f7a173", - "positionFeeFactorForNegativeImpact": "0x37f06a157c23a33de4ca7196216ce1915ec1a3cc92d0a99ad8546b9ec307ccd9", + "positionFeeFactorForBalanceWasImproved": "0x98853d8dfbb87c8e9d5e028e404924d8e05219c0b47225b2044b7e7877f7a173", + "positionFeeFactorForBalanceWasNotImproved": "0x37f06a157c23a33de4ca7196216ce1915ec1a3cc92d0a99ad8546b9ec307ccd9", "positionImpactFactorPositive": "0x548ce19161df3c4381f589d02db21974b0760e345caad0f3d209d39e87ef0e93", "positionImpactFactorNegative": "0x7f948d551673d7db11bc768d5e619644ad8fcd7d3b5ea979802542bef58c1ac2", "maxPositionImpactFactorPositive": "0xcc90fb298e671c27c085ae0f7416295fadedbd92249139252ddc869a5ca25dc7", "maxPositionImpactFactorNegative": "0x08e3b3b485b631d3a46abbc16ece5d6f745d41def3f018df49b7c4943d4a15e0", "maxPositionImpactFactorForLiquidations": "0x52ac32768630686448d7056b478dbb59679a30728f24b36d590687f6188e1491", + "maxLendableImpactFactor": "0x1377b71f205affe712d85cc326a1813712cb326b30389154258cad6dad05449f", + "maxLendableImpactFactorForWithdrawals": "0x12e5f81e5061c091fe8da4eb9fc0578d98e6295028fb78b95908fddd566f75a0", + "maxLendableImpactUsd": "0x40eac551dff2fa3fd0b390d4fe083c05fde69ac07714f4c3b7b7effde854972e", + "lentPositionImpactPoolAmount": "0x5e10504e2df2f7b9e0d4f93203ac210d795d5515f628c4a893ddd59c87b9d7ba", "minCollateralFactor": "0xb763d546f4c43a22e39e6d544d2a097e2b739449ac8125be625ca1b3edb6c7e6", + "minCollateralFactorForLiquidation": "0x58a728580355a6c6f82d3091d369b941e0376ff8b3d79274d71ad1d29d0748e2", "minCollateralFactorForOpenInterestLong": "0x4279cffcd52e0915df8447175e708381712393531426166172e9a466f544ea6e", "minCollateralFactorForOpenInterestShort": "0xa7dd5e63b8b99bbd36c61b26e144889399099bdc86c904aa8dcf3d53670a8806", "positionImpactExponentFactor": "0x3a2cd4a711e8cba8017733aa537e32ebfd2e5fa858bf0a773a3967ca2f7b30b0", - "swapFeeFactorForPositiveImpact": "0x4965fc8a21524ad70b41143626dd638286b9b42ceaa02dbb9bc821f614cf9fdf", - "swapFeeFactorForNegativeImpact": "0xf890051400774cc25b9f4e404ba50d42ebd497e3b1c8b9541fa1da94174e71c2", + "swapFeeFactorForBalanceWasImproved": "0x4965fc8a21524ad70b41143626dd638286b9b42ceaa02dbb9bc821f614cf9fdf", + "swapFeeFactorForBalanceWasNotImproved": "0xf890051400774cc25b9f4e404ba50d42ebd497e3b1c8b9541fa1da94174e71c2", "atomicSwapFeeFactor": "0xcfb92ad1dd016d2ee0067cd81c7dc4c64f292f95f56158b5ab39d25a80821d77", "swapImpactFactorPositive": "0xa6399402207293d84fc48222f3238feae062d86e26e725edaca06fab54bf2e4b", "swapImpactFactorNegative": "0x8c3bbbb69bd132cae186a17c0f17fec773e3b7d2ef52c639a31ce3ecc4bba196", @@ -1307,19 +1432,24 @@ "maxFundingFactorPerSecond": "0x3835500eefeba57cbe50ccb407e19aaec2f84810d63c5390fd9e7b6754d9166e", "maxPnlFactorForTradersLong": "0x1383fddcb6581558336fbc217cfc3db183cd69fb3e7cdac5fdf5ddafcfe3c75e", "maxPnlFactorForTradersShort": "0x71d36d7c6a247209ce0590c54c0d14752956059486987fc5161b7bec6739c8b3", - "positionFeeFactorForPositiveImpact": "0x2708cfa61a406341dc08ec540f21a474d06cc5091f45dad2888452f9619320f1", - "positionFeeFactorForNegativeImpact": "0x3596e5879e782fc01324e6c9391e2fe90856824c369c31b33c23987e61304bb7", + "positionFeeFactorForBalanceWasImproved": "0x2708cfa61a406341dc08ec540f21a474d06cc5091f45dad2888452f9619320f1", + "positionFeeFactorForBalanceWasNotImproved": "0x3596e5879e782fc01324e6c9391e2fe90856824c369c31b33c23987e61304bb7", "positionImpactFactorPositive": "0x5871f75e257b7d79f48e659a4c02d14ddd0b8baca3c4a1583219d85f177c5268", "positionImpactFactorNegative": "0x46340a568baf8d8bdd7d3198bfd3d4327a7532eac8a249a7cd6fe33cc05a86ea", "maxPositionImpactFactorPositive": "0x19d692d2b95d1189dba6f596c97673a944821958599797b977eb5408ce276ba3", "maxPositionImpactFactorNegative": "0x36ed3cee02b2c2f532d0985c0ea3f92ed5e980ce06a1116a0b6f2f65fa0de69d", "maxPositionImpactFactorForLiquidations": "0xc7ca98bf7ac93f2ca8dc4a8a99e99194279493898e08ebf4b7e8f6cfe0452d7c", + "maxLendableImpactFactor": "0x186d29173beb29e46af8507ad99c5439541dde2f0ee0c5daaa001ff1522560f4", + "maxLendableImpactFactorForWithdrawals": "0xe646136991d826f11c1fd55ac36d40ea073be24c6353d193a821948bb77807cf", + "maxLendableImpactUsd": "0xc2038495be0ecd8d1bda4b8095be40012716d2c89bd121fa47fb714fd43a3ff4", + "lentPositionImpactPoolAmount": "0x86993b1b8299f1d667b8e7cf1df927971d6ab63c3001caef307649681d3c52b9", "minCollateralFactor": "0x1cddd19b6c5ab7bac13bca435de5c29b7eb8b6d8f63653990ca7d124b6630211", + "minCollateralFactorForLiquidation": "0x59c09f1291f52daa4c169c57c3226ef99241adaf315a955970e8f7c25f3735a2", "minCollateralFactorForOpenInterestLong": "0xf62a2cd524471634da150460345daeb42bcc47fc9a8b5ea5b1a581013edfef77", "minCollateralFactorForOpenInterestShort": "0xd9b39ffa382462e2b24dd0ebd1c3baec3d78c5ade8d4cbee813c5b8a51baeb20", "positionImpactExponentFactor": "0xa2af6371bc1aeebd6802ac29ccd755b5ab13703022b5b772111b4e555273e745", - "swapFeeFactorForPositiveImpact": "0xa08dd6fcd6029bc48ce2addf2868af78d216638205a73838668634ca2a4981b7", - "swapFeeFactorForNegativeImpact": "0xc9bbb4bcd2036e8e18f3fd37c85140389749faa6bb95005ded218d00ab217029", + "swapFeeFactorForBalanceWasImproved": "0xa08dd6fcd6029bc48ce2addf2868af78d216638205a73838668634ca2a4981b7", + "swapFeeFactorForBalanceWasNotImproved": "0xc9bbb4bcd2036e8e18f3fd37c85140389749faa6bb95005ded218d00ab217029", "atomicSwapFeeFactor": "0xf8346cdca37cb62bdba7aa727ef4a442631ad1e0b5043132b92388fddf5aec81", "swapImpactFactorPositive": "0x9f5c1ba768149251f1ac9bbe83db59ca66c5bc1dac404af7fe71e644dfe9cbb7", "swapImpactFactorNegative": "0xded0c3d499ee81a6f139dbbbafd11a57b4b0d741c4deed0eb81b462952739816", @@ -1358,19 +1488,24 @@ "maxFundingFactorPerSecond": "0x0bf8542c05326ad5f245f8ba4f53a5413526ee86b08ab300cbcfa53c8f7e75bd", "maxPnlFactorForTradersLong": "0x7e1a7f613272fff1571d4406fb4f7943444c3fe98768f85cdaf2742879ff334f", "maxPnlFactorForTradersShort": "0x20c8ff6d63e62ce262a9cd193aaa60b95cf9ddbe860ab71336988a646baf26e0", - "positionFeeFactorForPositiveImpact": "0xc7f070dd821b1624b6a2929d567327bb3867502d02dcd2e71065cdd41ee23cf3", - "positionFeeFactorForNegativeImpact": "0xd5c959261e7a34eddeae5b309b1cca01ca260753eb2124ca19d3ed308287e0a5", + "positionFeeFactorForBalanceWasImproved": "0xc7f070dd821b1624b6a2929d567327bb3867502d02dcd2e71065cdd41ee23cf3", + "positionFeeFactorForBalanceWasNotImproved": "0xd5c959261e7a34eddeae5b309b1cca01ca260753eb2124ca19d3ed308287e0a5", "positionImpactFactorPositive": "0x24d1fea37d4c67a275c1d219f987fdd8716789d24675e2a5d1c83afa319a327d", "positionImpactFactorNegative": "0x80a256eee5da715b887d848baaf967bb8f7f9082d982e4678f4ce3cb6130d7b0", "maxPositionImpactFactorPositive": "0x6823916303f2ab71c4c0c51d8ebe85bd81c3e041feeead165128a864338a7e2b", "maxPositionImpactFactorNegative": "0xbea9f39702340352b6210661276d0196a3d4f0f52787211fdf3b2aa7e428ea83", "maxPositionImpactFactorForLiquidations": "0x21fe4ef5e0d11726ac12f09444f2a2a5296577de3e50ecaf41f28796c2f315ed", + "maxLendableImpactFactor": "0x893c92528968bfdcb2a8db3a3fd0d59a0469784a6a49c05e26bbf0696d241251", + "maxLendableImpactFactorForWithdrawals": "0x7d85b777c2461c1a7e4da064d63497d13736603dd9f5325cf60cc03e87e4e1d3", + "maxLendableImpactUsd": "0x8a0266bb93a239abfff419f4b80eb82e728536bd984d277b856de7864bb9ace1", + "lentPositionImpactPoolAmount": "0x046561480a0472652830888bd731acf65628b4a2dff051f19d7dbc909088b582", "minCollateralFactor": "0xcc59cb6b61c7943f711dc18dfc2fa4726e3e0e23320769e9599a2362835575cd", + "minCollateralFactorForLiquidation": "0x917066ba7cd6f4221b0632336d34aded85c1e557fa3093cc7014cb86885d30fc", "minCollateralFactorForOpenInterestLong": "0xd0b617f09379ad18f7bc551443b94d4b5c55e0023fb79c7165eec37289860743", "minCollateralFactorForOpenInterestShort": "0x45b9bea14109e02351108100e302342f22e4658eb48584be5fe6b4d585dfe27d", "positionImpactExponentFactor": "0x751f7109c025778b3f40dbc637af12a93d5a0c622c49f4115dc80f784b299eb7", - "swapFeeFactorForPositiveImpact": "0x83492ab5df99806cdbd8314795b516b6a9782b0942161be4f1af9bca88951ac1", - "swapFeeFactorForNegativeImpact": "0x63766eeca2ae5b09a2e0eb72120df5dbe6a8875527d67cd7b45ef9aba940e951", + "swapFeeFactorForBalanceWasImproved": "0x83492ab5df99806cdbd8314795b516b6a9782b0942161be4f1af9bca88951ac1", + "swapFeeFactorForBalanceWasNotImproved": "0x63766eeca2ae5b09a2e0eb72120df5dbe6a8875527d67cd7b45ef9aba940e951", "atomicSwapFeeFactor": "0x8e88387d1a012a6f06628e8788e16bad6616eb06ba1404096c0c11a9bccea974", "swapImpactFactorPositive": "0x5a6f6f80c4a3e8d65986a384398e538c8faf9088f78210ea7b4f0f390633a51d", "swapImpactFactorNegative": "0x8f02874c8602664244cb90ca2139b5ba51aa0d59bd1479b6b94603a7cce88086", @@ -1409,19 +1544,24 @@ "maxFundingFactorPerSecond": "0x1da7debb0b6df3807925c7cbebd7dbc68d0ee443039816f3a8fd68c1f747b861", "maxPnlFactorForTradersLong": "0x7cfde814ebf3d1250c0842f9cdb144ced475a1dd2822a2c51c668916a60b5e4d", "maxPnlFactorForTradersShort": "0x69c09c494cb8be5ceec8b05f2fe89d979733230188b1fad94a8ecaeb1b277a3b", - "positionFeeFactorForPositiveImpact": "0xdf5425159f0f0d87b1f2539ee40a039a381156da40713f7016b06cf7a4b16b15", - "positionFeeFactorForNegativeImpact": "0x654dfb3012335aec94c961545f0be05714f87c533d86962a9ea736f56124362a", + "positionFeeFactorForBalanceWasImproved": "0xdf5425159f0f0d87b1f2539ee40a039a381156da40713f7016b06cf7a4b16b15", + "positionFeeFactorForBalanceWasNotImproved": "0x654dfb3012335aec94c961545f0be05714f87c533d86962a9ea736f56124362a", "positionImpactFactorPositive": "0x95058468ab52487db6520bc0a691ebe5ca226682fc034aca2f4291925890f7de", "positionImpactFactorNegative": "0x141ad82e988c1652d94c149e0ffc2b2f296d8226f0804545b9b2f30f3a3e50ae", "maxPositionImpactFactorPositive": "0xe74534e23b02234d9c1b63786b1e0595a47d733a393bb45daaff8b82dc4937d4", "maxPositionImpactFactorNegative": "0xe75fecd581da9d267408fb6b502d011f69de3d9d39119b2ab286e8856516bc22", "maxPositionImpactFactorForLiquidations": "0x631fd71c9b5735e3fe95e1cacc9080c5cf9a54e0785e4f57040a029e36e71131", + "maxLendableImpactFactor": "0x5c1355c208968eb059ad9b5206638c84d384a7bd050a8a5bd779d176eb061ed1", + "maxLendableImpactFactorForWithdrawals": "0xaabc0fbaf18db25648fee631c4ed2517dd0441bda5c364f31c021fc0d69f7e34", + "maxLendableImpactUsd": "0x1583168790a4d36c333daa89d68788c041ea06b9d22f8175f90f241efee55e71", + "lentPositionImpactPoolAmount": "0x0e13f064d811c29ca1726ac1b6088563060aeb7e1dfe8b4dbf01b596621e16c5", "minCollateralFactor": "0xc887506d87b14983ab7ed186f9178fed3a134abbbe8245a13be07e42e313249e", + "minCollateralFactorForLiquidation": "0x306a88af5ce2a5f6da2d23fa1fc4da931f660d33ff5b01adb996552ee7a1d8bf", "minCollateralFactorForOpenInterestLong": "0x974698c39aecd68284a0766fb070354eb0cc788557c000717eb1187a717a465e", "minCollateralFactorForOpenInterestShort": "0x2cbcfa8219414a67ac30cbf47e0c87e3f98fa566922e42b7109f5148feb792a0", "positionImpactExponentFactor": "0x8799f37db27fe4c64571774da8d11bb61b5a5b914a054aa230e26e58f694148e", - "swapFeeFactorForPositiveImpact": "0x6141d666bb9b2a68a9749663d3c3dab876615cb1c1c19cd40b04bc1c90e89109", - "swapFeeFactorForNegativeImpact": "0x154777b0009efb8b45f129e93dd06b79d93a034e74db99ee4c7f53fd6bb1064c", + "swapFeeFactorForBalanceWasImproved": "0x6141d666bb9b2a68a9749663d3c3dab876615cb1c1c19cd40b04bc1c90e89109", + "swapFeeFactorForBalanceWasNotImproved": "0x154777b0009efb8b45f129e93dd06b79d93a034e74db99ee4c7f53fd6bb1064c", "atomicSwapFeeFactor": "0x896ab2b294e8a2d39a9c6be1b2d256a79d7f6b414e42c5e79f5d364db730dc8b", "swapImpactFactorPositive": "0x461e2c7445b7c5765c40de6c216908f8dae1dd7515416d2b39d09c59c9410f9c", "swapImpactFactorNegative": "0x844b935996c3559c7315004f459033cb6b4daba806b740a81bd8e9bee4d5f47a", @@ -1460,19 +1600,24 @@ "maxFundingFactorPerSecond": "0xa86190d0831a71843286266b26bb09d290e7274457d4c6884dcc1ce7af8b75d5", "maxPnlFactorForTradersLong": "0xae6a9602886e00e8f9cc9fae500cea6315539ce497876e3d8c68a7c2bce8ff83", "maxPnlFactorForTradersShort": "0x7e0d5ffba6ead92454e3b86bdf9a7e5f05b90fe3f4191b817c4f1a5a88f31e19", - "positionFeeFactorForPositiveImpact": "0xb12a559764e28d5b6e2828f2dafd4ec774c41481df3dc7a8b1d01051025775af", - "positionFeeFactorForNegativeImpact": "0xe6787e7aff99034a0a90b9df8364057d42c7f114ef414a94b798cf7d9fb3499b", + "positionFeeFactorForBalanceWasImproved": "0xb12a559764e28d5b6e2828f2dafd4ec774c41481df3dc7a8b1d01051025775af", + "positionFeeFactorForBalanceWasNotImproved": "0xe6787e7aff99034a0a90b9df8364057d42c7f114ef414a94b798cf7d9fb3499b", "positionImpactFactorPositive": "0x6f738a6e9c2976fa3398260c2678ceeebbc372c8740bca3d419def2cdd72d7fe", "positionImpactFactorNegative": "0x042414808b145a04357da24216c441d4cb1866192323c65253d7d5d7ae5b16e6", "maxPositionImpactFactorPositive": "0x417f05c74dda8045134d4ea5faa8558b54bd35e13417dad8988bac462d511986", "maxPositionImpactFactorNegative": "0x8ca16c9c73994cd267eff2951818721a251b0c048efd9f87e97dee49a7b4960d", "maxPositionImpactFactorForLiquidations": "0x0d1c038bdc72efeda626efe5e534102d4a9b352b46a778ae44aca00da277fde1", + "maxLendableImpactFactor": "0xe673faf468e6416b8c56ac71f23fdd068a2338d118d006721482a7ea1dda1206", + "maxLendableImpactFactorForWithdrawals": "0xe73a020ca1218e9283b00c7c0667640c24988729c31c72ae05f74ab52aff1bbb", + "maxLendableImpactUsd": "0xe8b581b93595f7d71c84dabb879ee50a8ef943c07755fbe6ed96a27d9419b169", + "lentPositionImpactPoolAmount": "0x0c3be9a030ff7b1218f36ddd6d2be296a046c03a579df55a6d1f9ab9431299b6", "minCollateralFactor": "0x306c4d11774ba8acc5857bc2b9eed4e6f4eaebd78ca19cc36c9e7543ee4e2baa", + "minCollateralFactorForLiquidation": "0xf999a6e4677e32df80732fac308066abf0b941fa1b8de71fa6ca65c62766fe19", "minCollateralFactorForOpenInterestLong": "0x1a91d60f924b7371fe96dc19aec25c04a3c778b64b02909898c8ba552f8f8d74", "minCollateralFactorForOpenInterestShort": "0x64a53510be4bbae7a856bad32346bdf81c3f6d8895c5cdb6d9b4c3061c7113d3", "positionImpactExponentFactor": "0x8ccbfcefe45e6333409c1703e2b19a344996c8805280f1a49c6922a10509a67e", - "swapFeeFactorForPositiveImpact": "0x1590ee2481a3040cb0d23eb50d8e5f03df05af2a0adb6647b64d9dd18409e4bf", - "swapFeeFactorForNegativeImpact": "0x9ef8535355d5ea75d57b8faa5093312c6a291fecf76f923fd04bbd8cf9461f0a", + "swapFeeFactorForBalanceWasImproved": "0x1590ee2481a3040cb0d23eb50d8e5f03df05af2a0adb6647b64d9dd18409e4bf", + "swapFeeFactorForBalanceWasNotImproved": "0x9ef8535355d5ea75d57b8faa5093312c6a291fecf76f923fd04bbd8cf9461f0a", "atomicSwapFeeFactor": "0xc3292e50be21e9087d06b18f3b871f63e311e17c7d06deacbb676bbe7ef65890", "swapImpactFactorPositive": "0x3ce367a95fad78d15965cfa917ca6137f707a3d77022ba1f643a316323402f4b", "swapImpactFactorNegative": "0x4cbf632cb133bbcc438fd421654e7dae88fa165ba171fd6e6044c505eb728017", @@ -1511,19 +1656,24 @@ "maxFundingFactorPerSecond": "0xa5f8602de310b7ef0eac8c0b938744a9c6b0127e0d806d7f8f0b58b6318614d5", "maxPnlFactorForTradersLong": "0x10c8eb29dea6e099e25573dccff9650d218c309953f6ba9b03690e8cfdd66b5b", "maxPnlFactorForTradersShort": "0xeca0d151e83f98ef5e12410b0a2d223e29cc7d97f228f9d63edb1a90d9467696", - "positionFeeFactorForPositiveImpact": "0x10d2a12dc0ae3d3ebf4846a7fbe21f4c46517ee74bdd7c6fd72417e75ec1caaf", - "positionFeeFactorForNegativeImpact": "0x611c3bc2e992fc865409dc0b81a02796f19cf207d98a8636ba04889156767b3c", + "positionFeeFactorForBalanceWasImproved": "0x10d2a12dc0ae3d3ebf4846a7fbe21f4c46517ee74bdd7c6fd72417e75ec1caaf", + "positionFeeFactorForBalanceWasNotImproved": "0x611c3bc2e992fc865409dc0b81a02796f19cf207d98a8636ba04889156767b3c", "positionImpactFactorPositive": "0xe26bfc6ea0695527daaf43790b252c6cd520b6f041d52b89fa1765e332b0a2ba", "positionImpactFactorNegative": "0x29078683fd16217f167c57ce10332c45b25a7e2a42b7e317f4993cdd182ee4f0", "maxPositionImpactFactorPositive": "0x92c555de2df6a801fca90169a37445fa9e1b6127ad2b24e9aae09e610daa64d8", "maxPositionImpactFactorNegative": "0x836e6ed579eef0ce940ce76d025708ed4872eb6897ffdbecbaeba7d3a54e5a90", "maxPositionImpactFactorForLiquidations": "0x52fb95366a88cf85b51d86af2a6aaca9b2a742d85554af7cbe67a75a2a683f1c", + "maxLendableImpactFactor": "0x50bd4bfb7307a385bd505be86ebdd20719b391325c8092ec079e46e0b391d514", + "maxLendableImpactFactorForWithdrawals": "0xdd7e3e401c46e60998a084f097c1db69203022f848eb4c0b2699bb9925b7572b", + "maxLendableImpactUsd": "0x5fbd94369fc89ae1535ac8c26187fd9566d8bff81ec7c12e8bb0a71480eaa81a", + "lentPositionImpactPoolAmount": "0xf4dc83edc0a9cbf135ec125b0a2260e5459b43740e5ced199393dc08094fa0e2", "minCollateralFactor": "0xf222dcd515762a01b5dcd95d0d7bf6220adebaeeca37241b2334aec31858d008", + "minCollateralFactorForLiquidation": "0x9a80dc36f347f59c5ebe196f2c8ec5e2915f9143d378ee582a5421ce121bb69e", "minCollateralFactorForOpenInterestLong": "0x159b5efb14ba5fdf82eb9483ce36a5cc511603ddc0851867d2f62e061a1eb5a5", "minCollateralFactorForOpenInterestShort": "0x5ea79f8f1091195b3a4b2e7b906f73a855a4677d85a563c73c636da18a4c3b61", "positionImpactExponentFactor": "0x5de08cfc1c45dc70944717fb92318d5f3f66c26fc83ad52ac82277eb036d81db", - "swapFeeFactorForPositiveImpact": "0x8039a612505e93d3b3b411b3e667f13e1a54b0d830e9dcc16cb41d838b85c6bd", - "swapFeeFactorForNegativeImpact": "0x07bcac70080ce14495a72e4e38fcbf3cf15913013379a12d4cab5ac6c741851d", + "swapFeeFactorForBalanceWasImproved": "0x8039a612505e93d3b3b411b3e667f13e1a54b0d830e9dcc16cb41d838b85c6bd", + "swapFeeFactorForBalanceWasNotImproved": "0x07bcac70080ce14495a72e4e38fcbf3cf15913013379a12d4cab5ac6c741851d", "atomicSwapFeeFactor": "0xe3c7dc581d6b949ca503f256de43caf8a5615491c7b5750fd52d054c50989417", "swapImpactFactorPositive": "0x16e0ad50beb175b5eb950fb44fac610b3289a7a74fe8a788d974cf667cb024a9", "swapImpactFactorNegative": "0xf4d68d4587e30f6e4d7a9ee6eb78d8d4c1c05ace6f9bafd291483c9ce9eb1bb7", @@ -1562,19 +1712,24 @@ "maxFundingFactorPerSecond": "0x33a776a9e8fdf2baa5a32b016dd8e6a333cf2e461554870d0c06cfc1f15bce5a", "maxPnlFactorForTradersLong": "0x7b53f5192016caedcfe36d2c9283142ab453a038f9f58d3b6956a3d4e5b9723b", "maxPnlFactorForTradersShort": "0x2fb89797b374a76143438b2cec9ffb464bfc30d36738dcd9fed215190b5d6323", - "positionFeeFactorForPositiveImpact": "0xf3bf654aaa18bed4473e41fbf07fda8631a7c410c2e3f63a85158e40cc7d9b7a", - "positionFeeFactorForNegativeImpact": "0xe348ca82ff412191d0856eab30d838889649105a16951e03680ecbc33572fba5", + "positionFeeFactorForBalanceWasImproved": "0xf3bf654aaa18bed4473e41fbf07fda8631a7c410c2e3f63a85158e40cc7d9b7a", + "positionFeeFactorForBalanceWasNotImproved": "0xe348ca82ff412191d0856eab30d838889649105a16951e03680ecbc33572fba5", "positionImpactFactorPositive": "0x1db5aaa72739243e2cd7cbb59e13526bb779b6513f648c3be647a3945ee0b6ff", "positionImpactFactorNegative": "0x9f4b1c96ad48b04dcb2e090029b07fa05c74137e2b3264b5b31b659c69c194de", "maxPositionImpactFactorPositive": "0x054407c473f235dea7a7f175def0de1c030b1617f399a34315331710b5dc0c72", "maxPositionImpactFactorNegative": "0x7a7bd10cbcf566e8e80449dbcb0b9461c37aa3ca35e289a7f2777b1cf04b2a68", "maxPositionImpactFactorForLiquidations": "0x5c8317b7e68038721e2b6020e3d99c388914cf6acf570fde1ceacc34bc2abef4", + "maxLendableImpactFactor": "0x0eafdffb45f992eecaba504f59d5b5274c6097c4755e607272d17d0b7526da97", + "maxLendableImpactFactorForWithdrawals": "0x7b9e2471dc5e5527de90ac527bcb204e159a4e800416d8f50b202df161e71e1e", + "maxLendableImpactUsd": "0x5e1be6e2cd707a9073c0528e7bb5f4878fdae6b4fdaae7b22e7757c70ba1d508", + "lentPositionImpactPoolAmount": "0x314032f20c89ed75de8135a3261e61d7461883f9743ee1a68c8b38f18e256250", "minCollateralFactor": "0x37c9327170636d2644b4aef9428093a4b840396c017062d69214990437f11295", + "minCollateralFactorForLiquidation": "0x6427bd32e101cea4a95641d89d9c833ff5045eec210d362d5a271894653c6bfb", "minCollateralFactorForOpenInterestLong": "0x3037baca9542bb9bf19e795a3ea8588f62fd7aa7f391835394eb39113b24f199", "minCollateralFactorForOpenInterestShort": "0xdb99a450e0b3214c2eac3f7523de613aab2352d659dae70c2a748d158dcb92f7", "positionImpactExponentFactor": "0x24d3d26a6be3949ac749df173c37d80cf593084309fc6214c3f2b987b8b5bf3a", - "swapFeeFactorForPositiveImpact": "0xea7cc342e21f8f0d3929c81522fc565f43b539e5cdcd8b06e27fd147f5ea8122", - "swapFeeFactorForNegativeImpact": "0x293b0ec6f9d1dfd04f394f6a2ac44c3c5dc6390cc10d3cdf91808e413ca6cad7", + "swapFeeFactorForBalanceWasImproved": "0xea7cc342e21f8f0d3929c81522fc565f43b539e5cdcd8b06e27fd147f5ea8122", + "swapFeeFactorForBalanceWasNotImproved": "0x293b0ec6f9d1dfd04f394f6a2ac44c3c5dc6390cc10d3cdf91808e413ca6cad7", "atomicSwapFeeFactor": "0x4b45a7b2d6be1622e1f2aa8ea096a9dc8b58452956fac9b4ab17829876da0f17", "swapImpactFactorPositive": "0x43815a7794b4f7f293baf4954ce22899083f202f8bacb7c6318febdd200c8647", "swapImpactFactorNegative": "0x1b4e062640c62d2ea26baac2c515da1c438db5cdde51ce3b7e87c389c4588648", @@ -1613,19 +1768,24 @@ "maxFundingFactorPerSecond": "0xa9ef8b74a174c9e223b7d703e4ecd5529724a3ed601cb05ad3972d69abd47b9e", "maxPnlFactorForTradersLong": "0x5a378457c164946c52e07daa0bd710b55462b6c1166b1f9db12dc0cf90f0b09d", "maxPnlFactorForTradersShort": "0xfa1252240c112896c95967a9f25716248b91106fa011dc48460dc122f7a01a8f", - "positionFeeFactorForPositiveImpact": "0x7ad381a480212f1a2cd99216ab2fd20d2d3278de35a579524373361be43b638b", - "positionFeeFactorForNegativeImpact": "0x7d17a4ff2eaec3da855d96f23a19e78ee118553b7ec5e877fd6ba2ecdeb70a38", + "positionFeeFactorForBalanceWasImproved": "0x7ad381a480212f1a2cd99216ab2fd20d2d3278de35a579524373361be43b638b", + "positionFeeFactorForBalanceWasNotImproved": "0x7d17a4ff2eaec3da855d96f23a19e78ee118553b7ec5e877fd6ba2ecdeb70a38", "positionImpactFactorPositive": "0xc762ad5da3a0eff95f66232719c3912fc2f2ac454f86df09fcee9ccc1125906e", "positionImpactFactorNegative": "0xdeaa0bb6c0dd14655f2b47aa4e7fbd84a48891105499b6d39ccac6773de55908", "maxPositionImpactFactorPositive": "0x5d881863abefde1acac40bd9a69e9985a6946e409beee4bc2b1c250afcac9c0f", "maxPositionImpactFactorNegative": "0x4d5ed30598d7ad750ac5cbb67c1cc9f880103986f5778a65104f0c0a2feb5b0e", "maxPositionImpactFactorForLiquidations": "0x39c2c99bcc2c851bd93b362e0d6854420c9d73c24c2a64655fe575897284a5af", + "maxLendableImpactFactor": "0xafebff4ab40589e68a893108e1eca470ee021f6cf38fac40a564a47689a60145", + "maxLendableImpactFactorForWithdrawals": "0xe44b633524783518c74f5a088a5934399ae847c0dbc9d804dd6f1e2b0cca9771", + "maxLendableImpactUsd": "0x821fde56a37c89cb5a9277f0897836a1cae8b3a61c46528261926617d51fdc25", + "lentPositionImpactPoolAmount": "0xf145257db0baa708476a01d3fbbcc2016a88081a4083d76641ec44a11cefbfbd", "minCollateralFactor": "0x26cf36b642d845e4537b703e1988ec4f179852681fa1da1da83f0c4f07aaa277", + "minCollateralFactorForLiquidation": "0x6af824714604d471f55475449bcebc7aa7b3aca42f27ceba6c7d803506af84c3", "minCollateralFactorForOpenInterestLong": "0x093de38ced41ca0b1ed4b1125b61d2b919957df4784cfd03a2bec7169efe69d4", "minCollateralFactorForOpenInterestShort": "0x26036e46776ea0eb1742bf11074ac5e347c4a16656bffb61ea87249d85908f71", "positionImpactExponentFactor": "0x5c860ae9aabebb3cbd58b3aef502c6e8d7de7ee9352d4287a53912877b065f6d", - "swapFeeFactorForPositiveImpact": "0x83f7fd8f66ad11eaec868ce47d0d0f0541d3c5b97db7510c6a5221f3d7742049", - "swapFeeFactorForNegativeImpact": "0xd55ebff53d86bd23cf89b366ce663d0666ff69f0b57bca785f06f9a8241278b7", + "swapFeeFactorForBalanceWasImproved": "0x83f7fd8f66ad11eaec868ce47d0d0f0541d3c5b97db7510c6a5221f3d7742049", + "swapFeeFactorForBalanceWasNotImproved": "0xd55ebff53d86bd23cf89b366ce663d0666ff69f0b57bca785f06f9a8241278b7", "atomicSwapFeeFactor": "0x2c55e0139a71c101d54a4a5c27d08df124018ba5e5a018b86f0d305d6d122b65", "swapImpactFactorPositive": "0x554aa25ead86224ab91bef3c3666a62e090f2ff373660d1ad93b5bce40d86280", "swapImpactFactorNegative": "0xa635d2782a0a1a49d0f0109507ad9f758eb8d886465a59b2a6aa4a0d4402b411", @@ -1664,19 +1824,24 @@ "maxFundingFactorPerSecond": "0xaea060ad5c01b6855a8ba41c879877ad9e7c0d89d22c24b2d808dfca154c3192", "maxPnlFactorForTradersLong": "0x0cca8f43022acf6faf517d0057db8de6c50145c84c4c178375f32c525504e162", "maxPnlFactorForTradersShort": "0xa5db5e8014020874226641a8db0eb55033824863e8c3218a983672ff9962d866", - "positionFeeFactorForPositiveImpact": "0x4a1f770da272d53d04cf31e8c4a04ef9fe459681c1ec5278abb1fab151d7ec92", - "positionFeeFactorForNegativeImpact": "0x8f7d93c1516186baf16daaaed34af81384d055695f0fc0c143cbee3bbd8e73ec", + "positionFeeFactorForBalanceWasImproved": "0x4a1f770da272d53d04cf31e8c4a04ef9fe459681c1ec5278abb1fab151d7ec92", + "positionFeeFactorForBalanceWasNotImproved": "0x8f7d93c1516186baf16daaaed34af81384d055695f0fc0c143cbee3bbd8e73ec", "positionImpactFactorPositive": "0xe30ca65f7576e63a00ad697a68075c47c69ba27e489fafd76ff29fb752b6a091", "positionImpactFactorNegative": "0xb375b763eff4f0763ada21285731c4887d417d372dd7464b74a29c8bc3fdf350", "maxPositionImpactFactorPositive": "0xfe35d1068a4bf727664f3683964a8585efa69f42b3fa05eb9bf95678e5fd0e9e", "maxPositionImpactFactorNegative": "0x8559fb313fda3675ef298adde1583c8eed97bc729c3f1797b4238c7e0b169ec8", "maxPositionImpactFactorForLiquidations": "0xf224c1634c4a4f1e74b27f1f86b940b3848610a8742fe6e05a979282184a8320", + "maxLendableImpactFactor": "0x4cb347550b736035c5556779419d724c8c41b3e914a948e225c03ae1f7b99715", + "maxLendableImpactFactorForWithdrawals": "0x96916ca557ff5867c9842839682a863984bb584c9cc3b81e67d5c89d65791417", + "maxLendableImpactUsd": "0x90c4b4a43e31fb0fda3a72f64fe6f592493a7ec4ce8713ddb9a904bde23095ba", + "lentPositionImpactPoolAmount": "0x6c5cfd677c3223f1e3aa3be0c4392eb8103e0107434cba35aca561e4061b3764", "minCollateralFactor": "0x9796d33d6fd886b0f785e0e524e2b25f1e7c291b682ece47fe5ae62611e448cc", + "minCollateralFactorForLiquidation": "0x3393a73bc28e5c25db9ac6cb5d316468446a57bc0eab962823b7b1e58e0205ed", "minCollateralFactorForOpenInterestLong": "0x1677f8025e1e4279b5a1db64264a79835c58c80818191018a56890aa23e9416d", "minCollateralFactorForOpenInterestShort": "0xc62d3cca1c3f6cf4e2770239bc3db387c22a0874a46b28bd8d86bea5d0fd882b", "positionImpactExponentFactor": "0x8d37091394262b6981015a549871fe3c908943afaa10321a82aabd7fdca918d3", - "swapFeeFactorForPositiveImpact": "0x5cb96b68635c2011b20c1a103f94a8fae1fd3a1a31f929db520a540f3521a224", - "swapFeeFactorForNegativeImpact": "0x3af0747e232c7341bb056cedc52a023be289515396288b8bea2867bd132efe38", + "swapFeeFactorForBalanceWasImproved": "0x5cb96b68635c2011b20c1a103f94a8fae1fd3a1a31f929db520a540f3521a224", + "swapFeeFactorForBalanceWasNotImproved": "0x3af0747e232c7341bb056cedc52a023be289515396288b8bea2867bd132efe38", "atomicSwapFeeFactor": "0xdc378c54100ad2d83cfd42eb62e50eca23df736d38d7ebaf9d4567b5f9905a70", "swapImpactFactorPositive": "0x7c0dcaa54ea81581befa553bf6ad5d1ed18aa7ad80bd7b80fcd6ef9b1615bd43", "swapImpactFactorNegative": "0xd9536a29966ec9255729ded57ca8f7dddb0c0b9af89354db014171689595efc0", @@ -1715,19 +1880,24 @@ "maxFundingFactorPerSecond": "0x34406dae1f399278c36439e30610303e8881eb0c1eb42c6865deeba2e1ca66a8", "maxPnlFactorForTradersLong": "0x91f778de8f64270aac0b40bb44479cf9a7d2aefb2acabefea02adfa91b4ac80b", "maxPnlFactorForTradersShort": "0x795d4f86e291bed384ac47280b3905bab11d4b622389f9abd295265a4cb3b9bc", - "positionFeeFactorForPositiveImpact": "0xf140e4b048ebb70318a767afaf2861c9824c804046133fe53a8c28fd95abc1ac", - "positionFeeFactorForNegativeImpact": "0xae6cc55956556a8a91c679697b2fdc574ba1119a77475d516a526734dff64e36", + "positionFeeFactorForBalanceWasImproved": "0xf140e4b048ebb70318a767afaf2861c9824c804046133fe53a8c28fd95abc1ac", + "positionFeeFactorForBalanceWasNotImproved": "0xae6cc55956556a8a91c679697b2fdc574ba1119a77475d516a526734dff64e36", "positionImpactFactorPositive": "0xb5896aa101e635b6dd6b537b9cc24882580b95e8c282a544938c78a62ebc3185", "positionImpactFactorNegative": "0x673862b9af47f7a839c274fe6743e7836f5ccdd9e426777a733b88fa9e38b2e9", "maxPositionImpactFactorPositive": "0x83cfcad7830ac109e2d615c46c7061e128c7ecedbaa7b2eaa0f9c37fc1685633", "maxPositionImpactFactorNegative": "0xdb820abf9ef22cfc064719c1e3f14e54fe667051dd75f879853d5b9181d866ba", "maxPositionImpactFactorForLiquidations": "0x287b8c27f13d7884cb5147e3748649d0fa2072aad502b1a578d4927b4d908e98", + "maxLendableImpactFactor": "0xa384ae723aebe010b544d776903a19dbdf526c96a6269378389805872b13077e", + "maxLendableImpactFactorForWithdrawals": "0xc42aa701db13972c5846ace00f090eca1caec9e2fe83498a10ca01c637a48878", + "maxLendableImpactUsd": "0xb082c68f34392068dec1fd23f594d0e9232e6a4cafd65ace1fff7de68254942a", + "lentPositionImpactPoolAmount": "0x165c2b3fd05d13c4760d6604eb6121b5e2903cc7b201e08a8cc38e3bf2430638", "minCollateralFactor": "0xdfe35a4a7d6fcea0730ea6a1d1296f1e1186dcdab4fec5c377a43ce80f26992b", + "minCollateralFactorForLiquidation": "0x70b5c091c0658a67df16c7e57093a054c69c4e6d02e411141176276f33a3517f", "minCollateralFactorForOpenInterestLong": "0x28e3fb3d6672b82c0d07651dc08f2dc5b1a60a464edcc11c4ea8b5e0421cb3e7", "minCollateralFactorForOpenInterestShort": "0x85d241676b23e38f5edd65fff0fbaf35ab45a4c062d5971bd99d31a6cff3be9a", "positionImpactExponentFactor": "0x4fcc2ef0a8e8cbd0a35c3560320662a39b102617306b41d31e0db602ccbdca2e", - "swapFeeFactorForPositiveImpact": "0x762f094bbedc499cfb8ab344894a1337fa2827d9ca29c1652ef501a23a5796de", - "swapFeeFactorForNegativeImpact": "0xb98d0057d669fde48bf1bfc5fc807f6783d140cce36c5c796f0c9d1f957924c8", + "swapFeeFactorForBalanceWasImproved": "0x762f094bbedc499cfb8ab344894a1337fa2827d9ca29c1652ef501a23a5796de", + "swapFeeFactorForBalanceWasNotImproved": "0xb98d0057d669fde48bf1bfc5fc807f6783d140cce36c5c796f0c9d1f957924c8", "atomicSwapFeeFactor": "0x31cf5da07077e68eb185b9d1b8716f538cf11fa63e92e22919c55fcc93cae57c", "swapImpactFactorPositive": "0x609b62f795290278ccdd73a7134158fd53801275c79a62f4741c967904d3bbd6", "swapImpactFactorNegative": "0xd1aa256ef61e9f42f8c1ea56925edaaab20bf4c9c894a1769748459cdc9f1a13", @@ -1766,19 +1936,24 @@ "maxFundingFactorPerSecond": "0xc8050137da6a9f433046c4b36fbf2bc953dceba773ef1225633240d2d85c0a8d", "maxPnlFactorForTradersLong": "0xca07f7c616ab6f9805c6e8073e3b8774cba4deab4083dae0fdc4534f8564b643", "maxPnlFactorForTradersShort": "0xa7b778271fee1571b28cb6708c350cabaa3ed6ef606b0cbff46697782a9bd25b", - "positionFeeFactorForPositiveImpact": "0xe59160e09d9e46a995adb177032b42fc9903f8c1a9be530e9399f9663268e619", - "positionFeeFactorForNegativeImpact": "0x53d747159802d68a32d22fc72977cd9444145e25509d61bbb7bae73a62b076fd", + "positionFeeFactorForBalanceWasImproved": "0xe59160e09d9e46a995adb177032b42fc9903f8c1a9be530e9399f9663268e619", + "positionFeeFactorForBalanceWasNotImproved": "0x53d747159802d68a32d22fc72977cd9444145e25509d61bbb7bae73a62b076fd", "positionImpactFactorPositive": "0x855cd8b64b05e4e41158e5a1b01a07c030cf28d5023707edf00319f7b34acc35", "positionImpactFactorNegative": "0x2300b73380f1ea8b3fcc88f736adbcc7196d4e5cb58d48e6aa23fdeb13056564", "maxPositionImpactFactorPositive": "0xed918a7f0b5755162e808591716e05d3b487c7039d952e15ac9acd2a92c961c6", "maxPositionImpactFactorNegative": "0x4e865b46729b1650053cd17db3a4367ab0184d8d12518ac0a29217034b6c2950", "maxPositionImpactFactorForLiquidations": "0xa9251e003d2653e3c04825e915d3cc179577d520b90c0214fd4f656c94ea579f", + "maxLendableImpactFactor": "0xf44d56ce7e139490f7b7a4310497c507fcd82e006e6b7b93f2de4ee91278b911", + "maxLendableImpactFactorForWithdrawals": "0x229e5e1def9c9266dd5c3e7d22f10393319821c27fe674770002dfdb9dd30c3a", + "maxLendableImpactUsd": "0x476dabd1519700890e85a295007d0980df5d982e1e43daa18ebd3fdf91b32a5d", + "lentPositionImpactPoolAmount": "0x6df11507fb2833373189cd5b17663ad050e5e845540f143e3d69bedcbc2a89fa", "minCollateralFactor": "0x71a615ceb63b3067aa53360b743986465151e56e727f6963baeb6f4a25483e6f", + "minCollateralFactorForLiquidation": "0xb0d9ffa1e7e99f2fcef00b4b23323d9b2d060bab7c552c2e7e56c32a638309e7", "minCollateralFactorForOpenInterestLong": "0x5b602b41a9133139c01e6d0627ad253da782dfa70d615dea06e636974c0d2190", "minCollateralFactorForOpenInterestShort": "0xb184fd747edc421383cd0ef45d3eca4c4551ef1be063daa0f93b350e0ca63299", "positionImpactExponentFactor": "0x56936ed105ce2e078a8a02d6d884ec7ca0971f6e5bb24cd79e1a74c33be26c37", - "swapFeeFactorForPositiveImpact": "0x0c2a02cb5d4ca72eb638bbc23178fbd9ef50fcad6ed4563b43600dbdc7f69874", - "swapFeeFactorForNegativeImpact": "0x6ad012eb794a17a8ffcf7423e99c003381fe99e2f8a45ee381645195a360a090", + "swapFeeFactorForBalanceWasImproved": "0x0c2a02cb5d4ca72eb638bbc23178fbd9ef50fcad6ed4563b43600dbdc7f69874", + "swapFeeFactorForBalanceWasNotImproved": "0x6ad012eb794a17a8ffcf7423e99c003381fe99e2f8a45ee381645195a360a090", "atomicSwapFeeFactor": "0xd90a7caf21cfec07cbb77bda9745cb5a367f9f089333ca34ea7124a53d1b611b", "swapImpactFactorPositive": "0xf173e2084eda5671a0f4ea671bd7f0837776cdeda6178d17d5926537f468c7c3", "swapImpactFactorNegative": "0xb792682cfb2272eee71294b3bed2d420d96f3b838650917f08eeaf20c6861eb6", @@ -1817,19 +1992,24 @@ "maxFundingFactorPerSecond": "0xc73d22835ccf44694188b7d84e65857850e9346bed1c61a7c0a44d52fa26b2b3", "maxPnlFactorForTradersLong": "0x3435ce1dc9ba5d1ad05c18a88bf1506c3e19fd9e5112f612b1a6c973c8ea3fde", "maxPnlFactorForTradersShort": "0xf8400e70e5699ced498165dbcd4f673a2ceac4a31bbcb00a04a51ac0ee607390", - "positionFeeFactorForPositiveImpact": "0x1ff672b4479b096ec040e2f446a621d71be58dbbbe1f19af6cba6b4f719c9e5c", - "positionFeeFactorForNegativeImpact": "0x9f7bbc000233b9646d97ae3bb79a70b2ef9ffc4b4dad350a64f0662d8a3e0773", + "positionFeeFactorForBalanceWasImproved": "0x1ff672b4479b096ec040e2f446a621d71be58dbbbe1f19af6cba6b4f719c9e5c", + "positionFeeFactorForBalanceWasNotImproved": "0x9f7bbc000233b9646d97ae3bb79a70b2ef9ffc4b4dad350a64f0662d8a3e0773", "positionImpactFactorPositive": "0x592471e23e8877fed51e465f6b98a83185d15c69346222166e9e70112a399da6", "positionImpactFactorNegative": "0x172259f1b039320c8dbe0337fc3c4669009ea3e33fbed0f1f72de64834abefc1", "maxPositionImpactFactorPositive": "0x7ad9019e284cfbcafb6a562e8c38d38afbf8ceb039fabbda946ab2c4016f27f7", "maxPositionImpactFactorNegative": "0x7cd82495926051f9036de5ae9a571872375dba1755c20cb061227c8c7cfe1396", "maxPositionImpactFactorForLiquidations": "0x990890ecc20200de9a1bd87598b95848787445930857aef49c72aab7ba037e97", + "maxLendableImpactFactor": "0xc20b6cbf996644c2edfbc13175a89c561b9a6eede297cf186e514e71d47fedc9", + "maxLendableImpactFactorForWithdrawals": "0xf4d8ec3322874c694e3e3a263efee74d7d2d26289153ea6359ffa0a99b2d79fa", + "maxLendableImpactUsd": "0x07ec6051ce67255d5560112358474ea5d701dfbe4a2e70245dbe06b842e552f2", + "lentPositionImpactPoolAmount": "0x65341f28ad76202a7d9e80d060cebb19ace428b91df9a33bf46d81fee7d52d5e", "minCollateralFactor": "0xc3e99d30df1bb7237cf5b6a371f53440e558f68381ad34cd7a39c8083f6835f3", + "minCollateralFactorForLiquidation": "0x2a0767e62c001f898fd730979111f1910f5191d8fad78cce263bdf4caa573131", "minCollateralFactorForOpenInterestLong": "0xa9b976f225b7a1d9aa149a1674b712b8da2245e1d36f7e336a96c3794de912cc", "minCollateralFactorForOpenInterestShort": "0x67fcd6cd3ab04ad285b2a1bb5393df7d7e368846bc8c2654c872e61cbdadb18d", "positionImpactExponentFactor": "0x6fe9d3e57df23a89ed73e33f91d91d31fd23406654cf3de63dedfb6568389941", - "swapFeeFactorForPositiveImpact": "0xc1d2acd5c88eedc10e84ea9905b6cee5274b2e01c1325a574170d39a27a28603", - "swapFeeFactorForNegativeImpact": "0x9eb334e661c82faf90d0bfabbd8831d8bbfffc2a15d5caf6a53bea1a52a11f2a", + "swapFeeFactorForBalanceWasImproved": "0xc1d2acd5c88eedc10e84ea9905b6cee5274b2e01c1325a574170d39a27a28603", + "swapFeeFactorForBalanceWasNotImproved": "0x9eb334e661c82faf90d0bfabbd8831d8bbfffc2a15d5caf6a53bea1a52a11f2a", "atomicSwapFeeFactor": "0xa517d70cfd722c6194d5cf52f6f06947406e1a79aa6ee92031a9924894d5c0e0", "swapImpactFactorPositive": "0x995b47106472df08b1d99bfcdf5a5c58a22fd505cb0454ba3c65d25836e5e383", "swapImpactFactorNegative": "0x6fde49ded6431284fad0ab80a5d2bb9e23bc71bdb6768018feb1d0d92cea86f9", @@ -1868,19 +2048,24 @@ "maxFundingFactorPerSecond": "0xbdcdf2207e1ed7bbf132ff481b5821964c764f82b9a0d3710cb1c3e2ebfacab8", "maxPnlFactorForTradersLong": "0x1e9639bf478f9c1c6e3f2c86487f1d095e877143acfa2abec4d8e529c16ddfdc", "maxPnlFactorForTradersShort": "0x9e2ccf0a5e3d1e61b01dab339e6b8e898fec0c99aa7f3eb9357c92c3a1973226", - "positionFeeFactorForPositiveImpact": "0xf07887eec3f30afc0147d9f489b64d03f360068f48998d05a9ccb06187b6be07", - "positionFeeFactorForNegativeImpact": "0x0f7f470662d96642b2c2c82cccde4267736d60b558afaf66fbe7ab57ba67cee0", + "positionFeeFactorForBalanceWasImproved": "0xf07887eec3f30afc0147d9f489b64d03f360068f48998d05a9ccb06187b6be07", + "positionFeeFactorForBalanceWasNotImproved": "0x0f7f470662d96642b2c2c82cccde4267736d60b558afaf66fbe7ab57ba67cee0", "positionImpactFactorPositive": "0xb9b5fcedd5c91a9d3c5c40a7a7a065885bd09fcb02181cad7b8c323c373875db", "positionImpactFactorNegative": "0x2ad2b91e53b4a3a925e04f8c6d6eab8bbd1e770f8354fe3518d501bb86115c20", "maxPositionImpactFactorPositive": "0x19b6035bb9a91088962ca09e26b08a5bf95d95b97c90f4f98ce550cb3e280d23", "maxPositionImpactFactorNegative": "0xf37ffd53b8ec3da5920c7e9003549490450e14e5f51725b0629e5dd81b4516a5", "maxPositionImpactFactorForLiquidations": "0x768e1e0b9c1bee456110ec4ba84080574645b213cf3551ac1d0146c3fcf1ae78", + "maxLendableImpactFactor": "0xdf991481ba292a004f06af191f9ebb817694b2e7b12bfe21dc145fe72b321dd6", + "maxLendableImpactFactorForWithdrawals": "0x264dd9fe7edc154fc6ceeb16f6691474d0bbd1150ce2781e268f416b7737040c", + "maxLendableImpactUsd": "0x05dac597c6a585a40b6fd862a6ca41af6a8802157b0ff18cd2dd20bd349871e1", + "lentPositionImpactPoolAmount": "0x91fe0550c90f1066419d94226afba5d1b82139e28894200654faa3d5ff7f78cb", "minCollateralFactor": "0x063c26170386b99ed813e28bbc466b472d58fbc4c565896708a259e15c426026", + "minCollateralFactorForLiquidation": "0x184f66f184f238b6d676e9de3e79ca166004e6e66c6ef5e51ee3ead951e11a5d", "minCollateralFactorForOpenInterestLong": "0x49b7345940105477f772afb7f563688a99053ca3edca50f043ea031ef1bfa630", "minCollateralFactorForOpenInterestShort": "0xafcbb8875e23ba9ea3aea7c817003ce9fd6c9f7e3a7397dc9d355d7030c1c6b9", "positionImpactExponentFactor": "0x0e24bdb43d7906365809d9ad11ddd0a0b2d13541544125fd45e8f3e772df585a", - "swapFeeFactorForPositiveImpact": "0x48cff709ea1bc1d7c25bbd8a21ec36fb0103a61fea7b2d79e71443214893b878", - "swapFeeFactorForNegativeImpact": "0x0404920bfb8782dd3c3ca6bfaf367ed5b12377e0ed5cc20539714b87331a1e35", + "swapFeeFactorForBalanceWasImproved": "0x48cff709ea1bc1d7c25bbd8a21ec36fb0103a61fea7b2d79e71443214893b878", + "swapFeeFactorForBalanceWasNotImproved": "0x0404920bfb8782dd3c3ca6bfaf367ed5b12377e0ed5cc20539714b87331a1e35", "atomicSwapFeeFactor": "0x9eada6b539ee0375006e15e7e12028007d7ce834db4e1d6624ed151abb77b704", "swapImpactFactorPositive": "0x19e448c0928954fcb9a9cabbcf59f3132cc20f890325d3b12a4c7e8cda0fc283", "swapImpactFactorNegative": "0x6a0d172623fbdc523516101821ee8863144416e7dd357b967bc205842b287bcf", @@ -1919,19 +2104,24 @@ "maxFundingFactorPerSecond": "0x231ae23473685d04ef11c3f42aa7abc80bda19111e19f8af81a16565c0d341fc", "maxPnlFactorForTradersLong": "0x0e6ee86e4636087f668e859c1446bbdb621df2e89db4c80682767bd8c3f4a2e0", "maxPnlFactorForTradersShort": "0x758917d8b45db106bfde22a64cb91efadb0e76531160f2e79daa9da99961bbf2", - "positionFeeFactorForPositiveImpact": "0x493d7cf32315ed2576fdb6556232938b3ba4d8fc4c7c129f795f312aaedf1e99", - "positionFeeFactorForNegativeImpact": "0x0f09eb3de794846219c162423714c95efcb52241bf3495ba262a8b65a5f15077", + "positionFeeFactorForBalanceWasImproved": "0x493d7cf32315ed2576fdb6556232938b3ba4d8fc4c7c129f795f312aaedf1e99", + "positionFeeFactorForBalanceWasNotImproved": "0x0f09eb3de794846219c162423714c95efcb52241bf3495ba262a8b65a5f15077", "positionImpactFactorPositive": "0x40cff93be7a95242a1789f12175aef67bc23fcc2daeab8753ea2bb08fed670f6", "positionImpactFactorNegative": "0xf54c1402f09610ae072a8746966b94006d7c7a1de7eb44f47b7eb29fbaef02ec", "maxPositionImpactFactorPositive": "0x786d142f5056003f1e7cd12b82c7954ac0f65b0ddeee41aaab69846be14ba1be", "maxPositionImpactFactorNegative": "0xbd154e1d9827e166d594ccb658c4b5babe79cdbcf980e65cd25c661aa87071dd", "maxPositionImpactFactorForLiquidations": "0x10f4c29b08a9a5521940a0f61df0361c0a98e01e3be448bfc8a877fed3e66a67", + "maxLendableImpactFactor": "0xdff7d16f81d953b578a822edaabed7fb5ff494ea6094374791de6d5cb13773d0", + "maxLendableImpactFactorForWithdrawals": "0x4da16212d85f59f9b6708a03c1d3e84f5c264b72ccf4f9c364d6b4ac9f592650", + "maxLendableImpactUsd": "0x3eb8c05030e5c10e984bd45d2f23868fc2c4569788bad788ff4b540ee1e65f63", + "lentPositionImpactPoolAmount": "0x549e6fd0cf6e4d3901590baf980d1f657669a7cc8893469ddab2cf0679830645", "minCollateralFactor": "0xb30c0c9c615ca78136924ffcfd347ccbcfbd07cfbb066331490e171eb1a0a98f", + "minCollateralFactorForLiquidation": "0x716807f898c897a453ca05d0f2aa6ddcca6f7db64055b57f81c8e41ea7848fa3", "minCollateralFactorForOpenInterestLong": "0xffea67e6c99a9d19d8e0fc2310bfa16b75cdc3634fa319d67a8ddedd5aaaab29", "minCollateralFactorForOpenInterestShort": "0x5b380cc5290171b8adb5730fc97eeaa8eb027e04035944e2ee6dd395cc26143f", "positionImpactExponentFactor": "0xc883aaf52b8c7712b5e3de31516b99dddb2d07514d55d14f1a8ccde642ac9ffa", - "swapFeeFactorForPositiveImpact": "0x54ed8f84ebf52a26785f7383623bfeea82c8602db2cec9305c72de8bb57c9880", - "swapFeeFactorForNegativeImpact": "0x69273f9d47ea8b35c92c122a3100ed560284f8f1dd8a75144f5b184e13f2f88a", + "swapFeeFactorForBalanceWasImproved": "0x54ed8f84ebf52a26785f7383623bfeea82c8602db2cec9305c72de8bb57c9880", + "swapFeeFactorForBalanceWasNotImproved": "0x69273f9d47ea8b35c92c122a3100ed560284f8f1dd8a75144f5b184e13f2f88a", "atomicSwapFeeFactor": "0xb3f675c4eda79a6a026b5204f3291148c4fd7aa5b441661d8c5b218f4f77689a", "swapImpactFactorPositive": "0xff7b5bd53c1fed235757a116187bd94c2bfcc5dccf9c79d3afb485782a5a86e8", "swapImpactFactorNegative": "0x2349db6b6cb6bc3749db19a55dfa7795476c7bfbb8ee0474769e5537adc48653", @@ -1970,19 +2160,24 @@ "maxFundingFactorPerSecond": "0x6dd09fe578a0d2f802a55247f16e453c5e0975fe31470136c13f70b57707b47c", "maxPnlFactorForTradersLong": "0x8e310d1456f3e834278f007a80efac7013d816f68aca59d6a478e049914ca1f9", "maxPnlFactorForTradersShort": "0x1f09ebbd17b78d190303bc6331e789197fe9b781c767d947eefba5904256e90e", - "positionFeeFactorForPositiveImpact": "0x5c0d2e79c65ad90be3dfb25475dbecdf197f86d6d288318a16ed53493201ba7c", - "positionFeeFactorForNegativeImpact": "0x2705f2437c8e5e3bdfe0663ff0e749ea4d73671b89d2ec3e72626200b6b75c2a", + "positionFeeFactorForBalanceWasImproved": "0x5c0d2e79c65ad90be3dfb25475dbecdf197f86d6d288318a16ed53493201ba7c", + "positionFeeFactorForBalanceWasNotImproved": "0x2705f2437c8e5e3bdfe0663ff0e749ea4d73671b89d2ec3e72626200b6b75c2a", "positionImpactFactorPositive": "0x9f78a2142db60a7d5eab84476a06f69252bb6e21e4b0fce2de8145e5b8765509", "positionImpactFactorNegative": "0xf9f25ffd4b9320df0e661297bad0f80ce9ec7d0f2c672f70d8376da8e2bcdfcd", "maxPositionImpactFactorPositive": "0x554195019be19dded2deebdf7bba714dedc29cf6194613468be1447e51a8aa7a", "maxPositionImpactFactorNegative": "0x0c49426f88135deb7578441b1a06e9cd0458f2610f844a0e06ee61e846cfca66", "maxPositionImpactFactorForLiquidations": "0x8d46a381a9692d246102e90ea5b4f53000b4f9407ec0d053e82d3a9ab324cecd", + "maxLendableImpactFactor": "0x79f4de524adfca59337487db23a19d9ce11471b5f0acaca903475028621ef792", + "maxLendableImpactFactorForWithdrawals": "0x943db693f24a5f67f6db804d36870b3f62823d87ee12f99076a832c8a6814aad", + "maxLendableImpactUsd": "0xf4158b055f1f0f76b4688b6f31e847b863fc03b6dae2bf72fb6d6a2c0bd98b5d", + "lentPositionImpactPoolAmount": "0xdd99060f77d0633a2efd4afbb52b296a9fd0cc02456405b653b0c1a4c70f5bd0", "minCollateralFactor": "0xaf529b6d8c16416ab7e8dea0fee2c88b02a2582e96fd786c3c4aa1b6dd7ab315", + "minCollateralFactorForLiquidation": "0x3bb903a46ad84ce28b36d1c2d16311120b9390829b2edb3e8495b0ef53784c01", "minCollateralFactorForOpenInterestLong": "0x4d83d368f9ff304adca7477a95605fca7d41bd25fb35ffdba3dc61e7bff2a83b", "minCollateralFactorForOpenInterestShort": "0x62e8fc9c6e9f155895f43e9edcf84239b180c4e9737887a8b86545ada24195c0", "positionImpactExponentFactor": "0xc2b2c25918334d3d885588d558503500beb43b71d72e9cb05e3e2b86e5bca6e5", - "swapFeeFactorForPositiveImpact": "0x4fb41fdd043a724e464d95478c74670b21d3a4ea15c7c2e96269b41df178abc6", - "swapFeeFactorForNegativeImpact": "0xfbaf2e48e418c8af4d690859073a3a79040c63c1f4b4cd1c41bae9a5787190ec", + "swapFeeFactorForBalanceWasImproved": "0x4fb41fdd043a724e464d95478c74670b21d3a4ea15c7c2e96269b41df178abc6", + "swapFeeFactorForBalanceWasNotImproved": "0xfbaf2e48e418c8af4d690859073a3a79040c63c1f4b4cd1c41bae9a5787190ec", "atomicSwapFeeFactor": "0x7fd3db35948558ae1c117892536d43456b15a2bc8f4bdedf385a8de5ba9ae99c", "swapImpactFactorPositive": "0x7459c01ebffc50f3aea8bf2ef8ab6cf36d2b2e7398811e79ae65b427c7a4cc45", "swapImpactFactorNegative": "0x42f1b2dcd3ff9e25ca0ea9e9ae7ce948a668d2ac2ab3d078020a55ef96400ce5", @@ -2021,19 +2216,24 @@ "maxFundingFactorPerSecond": "0xbb71ae099045fbdabdb856feee219f73d825249c1e141e62e4d6c8311d96850e", "maxPnlFactorForTradersLong": "0x2cadfcd4e17d654ada050a5d994209e709d70637f6fea841b8c6dc6fa6b7dda1", "maxPnlFactorForTradersShort": "0xa9d11314eb3f8f6667b2ce35bf54ba6007ef811471a03c2812901fc845968cb1", - "positionFeeFactorForPositiveImpact": "0x6a8195663337d4db3cb56a6f8702a7aeb0b9a25864376dfa9727b59bf15fa1a0", - "positionFeeFactorForNegativeImpact": "0xd732b50d5a27eeeb3c9f13320266b5c0f48a4cf28bd08ee3341e5d17ef6a57a2", + "positionFeeFactorForBalanceWasImproved": "0x6a8195663337d4db3cb56a6f8702a7aeb0b9a25864376dfa9727b59bf15fa1a0", + "positionFeeFactorForBalanceWasNotImproved": "0xd732b50d5a27eeeb3c9f13320266b5c0f48a4cf28bd08ee3341e5d17ef6a57a2", "positionImpactFactorPositive": "0x99695421d96317555b37f315cdf03725584fda95559fb3c6d3adca06c38d23de", "positionImpactFactorNegative": "0xc4c5609be5dd555ca967fe416a04fd54438a86edd4f859a111207dfc9ec9ed1e", "maxPositionImpactFactorPositive": "0xb24b2729d4b986448d34d3161d59c59e280251393ce4262181a2bf7b70e645a4", "maxPositionImpactFactorNegative": "0x093f21e9a0ab2debd31074f3e73a51eae6adb17095a69777b31fbf09ee66794b", "maxPositionImpactFactorForLiquidations": "0x6e206fd42772e8fe8a8835b6306583de3b225215da66ffddfff05e9fb823a8e4", + "maxLendableImpactFactor": "0x85aa7cfb347e01586d92dca985ea1a0e36b50a35e5c25d595b708f4fe001dd61", + "maxLendableImpactFactorForWithdrawals": "0x092a2d629322699c7ec10fde7e4c4064effacd509bb1a530cb300df8f2ec999a", + "maxLendableImpactUsd": "0xb3f6e2c9d5a0c535e6114a8218f072fe191dddc6b2197df078e7a4e1ac504fbf", + "lentPositionImpactPoolAmount": "0xfe76998dd2b774c72072da177dc87bdaf48671b71fb209e11388fae61aba029f", "minCollateralFactor": "0xde8e2683a32db2582bae01bac254fc9ffdf847f49c73f8e40d70831d516a0d63", + "minCollateralFactorForLiquidation": "0x1c9315aa7049bbb5d2b8bc32ed041d6e07526fc71e2658d12fc64700ba0a85cc", "minCollateralFactorForOpenInterestLong": "0x2352a72b34e744b19d46183f2e17312f8c6d8e6e55ee031745c01426f29f46ec", "minCollateralFactorForOpenInterestShort": "0xcb4811e66720bbc8c900831dbe35327485a8fa6aa48d94e28be4ad20e7cfeb05", "positionImpactExponentFactor": "0x335695a5a27844054e1229edd8c203f61834fdae52a2761be583d5a8b2d87f5f", - "swapFeeFactorForPositiveImpact": "0x0dbec8f5dddc19030eadf103f8d951bb8a586ec11a30f86b8fdf75d565d9ac58", - "swapFeeFactorForNegativeImpact": "0x59d63cc7ab7a3dff92097678f7a98e7f1a3cf7a97616b312e871fc39bcf673df", + "swapFeeFactorForBalanceWasImproved": "0x0dbec8f5dddc19030eadf103f8d951bb8a586ec11a30f86b8fdf75d565d9ac58", + "swapFeeFactorForBalanceWasNotImproved": "0x59d63cc7ab7a3dff92097678f7a98e7f1a3cf7a97616b312e871fc39bcf673df", "atomicSwapFeeFactor": "0x85a84c358cc5dfa7d09a8dabc2856e21e985b799c3eeb59371c15d87a4517059", "swapImpactFactorPositive": "0x461a95b066cf6086852497f137b3ea75bd3ffec0796c7d9400c8e5a92037d7cc", "swapImpactFactorNegative": "0x499433d197d5305ea41dc1d247e491dd6975ce88fab6979e485537a86d043d6d", @@ -2072,19 +2272,24 @@ "maxFundingFactorPerSecond": "0xcf7b665da2d105bcb27781fe68c363db8732c0794e0df27ca9c2bcb907990433", "maxPnlFactorForTradersLong": "0x284fd994c8c1361d712bbfe0bef917ebe7486477cda2bb8c3d17ced46552f834", "maxPnlFactorForTradersShort": "0x3a1cca2b9c435bad26e1ff77b841a349feaabd02386f9e7b2d58a14b3c69aa1b", - "positionFeeFactorForPositiveImpact": "0xe21f27a70af775536902487c5ce88233c67cf0c743555b8490ef2483150513ba", - "positionFeeFactorForNegativeImpact": "0xa665c582bf2cd99dc19fb0302fad3c4ed2ed0e7423e288d22ff13816351a93a0", + "positionFeeFactorForBalanceWasImproved": "0xe21f27a70af775536902487c5ce88233c67cf0c743555b8490ef2483150513ba", + "positionFeeFactorForBalanceWasNotImproved": "0xa665c582bf2cd99dc19fb0302fad3c4ed2ed0e7423e288d22ff13816351a93a0", "positionImpactFactorPositive": "0x32beb3676955e674bfa936e22b7e4c93a75a451387f996c4248243cbe1d323c5", "positionImpactFactorNegative": "0x0b90f13784d0f8129e986101813c02d873aff0fd427569138444995f46e6e662", "maxPositionImpactFactorPositive": "0x19a1bd926c6151f48a05d3aac08ff880ab7bc87a6ed2b5292569196a64c4a525", "maxPositionImpactFactorNegative": "0x431d4f40d2fffb4de5d661edcbc6b0e6554964ec51cff739f127f68ded07377d", "maxPositionImpactFactorForLiquidations": "0x561b7c6b780552b688ab9f8e3bc96dbcc018702e3caff500fe80d5ffa9d62de3", + "maxLendableImpactFactor": "0xb04fe6a6c1deeac6f2a338514cd89d6c5c9e2c9486abb7be28cbc3412319e88d", + "maxLendableImpactFactorForWithdrawals": "0x0a0a26cb36e51ab9db31acafc82145edd6fe873661f62d861ccb84c15eed6e2a", + "maxLendableImpactUsd": "0x7bf131701265e68dea800bb92e5b2925a107dbd666d437e2cba416a10a63aea1", + "lentPositionImpactPoolAmount": "0x644139f34b3bd6c2ce0b14473ad054a9c728a84e61c95bb946a447cd310648d0", "minCollateralFactor": "0xe12f227cd7530228e3e5fd17cc6e483d16da92b2a84c0e5ff1da9e812a5b165f", + "minCollateralFactorForLiquidation": "0x5424fa2cdf22e059599b3129445bc0af41411203cd1c67432b1676ab75977d3f", "minCollateralFactorForOpenInterestLong": "0x17278babb19736222b2d9de676d18653ddf62c086d3665741aea4e5073e56fc6", "minCollateralFactorForOpenInterestShort": "0xd5a1fad8da19fe7337b65624c25c09577ce75115b54770ff38ef6bb95dda326c", "positionImpactExponentFactor": "0x804b39a27e2dd8f1ff7b9c8b9e8c617f279de79423a04c8fa048b1a7d04e0a87", - "swapFeeFactorForPositiveImpact": "0x19c203129972249281a0b60e7b622a8d66a1d7bf798dc42ac056684d96e71805", - "swapFeeFactorForNegativeImpact": "0x323d04891a07265a4b585037fdbdb85d79170c22cd5f34dc3864039d93a1a6c0", + "swapFeeFactorForBalanceWasImproved": "0x19c203129972249281a0b60e7b622a8d66a1d7bf798dc42ac056684d96e71805", + "swapFeeFactorForBalanceWasNotImproved": "0x323d04891a07265a4b585037fdbdb85d79170c22cd5f34dc3864039d93a1a6c0", "atomicSwapFeeFactor": "0xcf9a0b348c47c4c56342906d69d1ee4c2fc385c51a90629ff71a814173c6984f", "swapImpactFactorPositive": "0xa71869892b9b6533e98daebca840e5d5536dc60b02f242dd2aa099f47e3a36bb", "swapImpactFactorNegative": "0x4179e67be0eb7afc3c56a4d16854b7b691f85c5592c3c13c743bbfe2e519a76c", @@ -2123,19 +2328,24 @@ "maxFundingFactorPerSecond": "0x236ef1bb27f759ec8f3561653ffe9db18a8bd37b5414d803ea24ffef8db7e1f6", "maxPnlFactorForTradersLong": "0x28c6560a3d84672c3d84081988ff32450a9f1b417062644ea4ae62ea4ddfbe59", "maxPnlFactorForTradersShort": "0x727dddeb2f67de8636f5e9dcc0dfab740c594b2c6464457e3ee6ac5e05c155c8", - "positionFeeFactorForPositiveImpact": "0xb8130da30b2d52f0da6b00cca4d6e27796e8e29cc770424d81830d468f6e46ab", - "positionFeeFactorForNegativeImpact": "0x86619920b9bd2a757bdb46082f9e7814b07b346b85ec327426e81ed2b98c9512", + "positionFeeFactorForBalanceWasImproved": "0xb8130da30b2d52f0da6b00cca4d6e27796e8e29cc770424d81830d468f6e46ab", + "positionFeeFactorForBalanceWasNotImproved": "0x86619920b9bd2a757bdb46082f9e7814b07b346b85ec327426e81ed2b98c9512", "positionImpactFactorPositive": "0xe9a08eac13757d3e3c9ec273c660957e20735fe6b0fbb100efa42fd2dc103e03", "positionImpactFactorNegative": "0xe3a1c8fa81526ad49a0e29a269d6322584f06fc8360bdeffeac122ce5bd71412", "maxPositionImpactFactorPositive": "0xc5830d4233c3c4b40396b597456329984dd1fa00d54ccc6a0ff3ed8ad24318ed", "maxPositionImpactFactorNegative": "0xeac0372e3d88ea3b6591a48a239ca5cd3bec458c763374376558ae8de853c342", "maxPositionImpactFactorForLiquidations": "0xdc60fe72bf55e425533f747c6952ba5d44777e6d701caf52570b3b72f481bc77", + "maxLendableImpactFactor": "0xac8263f8aad77e8440d7519e2ccb1bc6df8c27e3cd335fc293090929e8ccd9d4", + "maxLendableImpactFactorForWithdrawals": "0x4c498f0497fb8a82fb336a222ead9d6cd2dc6538bef226bbd9ea604d60745b63", + "maxLendableImpactUsd": "0xa40dd2d46fe34bb43d4cd0f4e47af87dd9e8416f5eaccf9b2ee8766839ed8715", + "lentPositionImpactPoolAmount": "0x38fb5105ed878c704c1bb0b5a6a2d3445010eb2796f43f9b22178bf5a1f0d980", "minCollateralFactor": "0xd1a9d8c3945e025659b09a50bbdf19d4b9a115dadcc662b86b59a61af9e795ce", + "minCollateralFactorForLiquidation": "0xf753b5b18d0dd10ddf23bdd1059939f3879247e5f5e1c6b0352cb01bcf4cf5e2", "minCollateralFactorForOpenInterestLong": "0xbf0cbbcddabe14afa33f3d923e06fc7c713ad118078f7e77f3d2bb9a8d648619", "minCollateralFactorForOpenInterestShort": "0xd54c4e668acaeb80926b6c76790870e89a47e80823955189e02c504021ada729", "positionImpactExponentFactor": "0x0d0b5deb037a6e299a4f6746578fb10d363fcdbb8f713c4194e64cb0344002b0", - "swapFeeFactorForPositiveImpact": "0xa766d46faa67189be6ffb6615e6ea31a5f403e8ece029a45b4cd3eeb08cbe02c", - "swapFeeFactorForNegativeImpact": "0xab3e9d384304687b4fcfaf1fa93376f0f72ba120fc0511f2d7f009e7e46622f2", + "swapFeeFactorForBalanceWasImproved": "0xa766d46faa67189be6ffb6615e6ea31a5f403e8ece029a45b4cd3eeb08cbe02c", + "swapFeeFactorForBalanceWasNotImproved": "0xab3e9d384304687b4fcfaf1fa93376f0f72ba120fc0511f2d7f009e7e46622f2", "atomicSwapFeeFactor": "0x7c769c06dc7c6a4ac6f4e0848dbaf356ad5fc344dd59201cc5f9970f51f7a105", "swapImpactFactorPositive": "0x13eda227af6bd9bd0817e3771f202173a24574f81d1ae84a0b394fcf675dfa8e", "swapImpactFactorNegative": "0xd5d924bf90f87618ba23759e1df30db025573ec12a4af3940533c4f03cad76ad", @@ -2174,19 +2384,24 @@ "maxFundingFactorPerSecond": "0x2d6fd46347386695821f8183b44b3c52e4adb3e05d21baed6c3ee136c929634a", "maxPnlFactorForTradersLong": "0x42206deb102983b56125efa6b7a1a9a91c9718f60f6c08ed39086d427a01c070", "maxPnlFactorForTradersShort": "0x5d6715d11e8d236acf70c9866d3d10e50d66db002aa8af4daf308319e839c55a", - "positionFeeFactorForPositiveImpact": "0xe6e6eeaa3e7c8031ae37ee72d1fffa975b364d1c44f948e43af20211f346eafe", - "positionFeeFactorForNegativeImpact": "0x4f59fabf762b3e86dd3205e0f99ca9b63b08c14c90e0d50bef53f10df085a060", + "positionFeeFactorForBalanceWasImproved": "0xe6e6eeaa3e7c8031ae37ee72d1fffa975b364d1c44f948e43af20211f346eafe", + "positionFeeFactorForBalanceWasNotImproved": "0x4f59fabf762b3e86dd3205e0f99ca9b63b08c14c90e0d50bef53f10df085a060", "positionImpactFactorPositive": "0xd38ee3b78399bc9248c38814306468884b4fc7516eeec324cd19733ceefc652a", "positionImpactFactorNegative": "0x6ec836bdd3077fc5d55b47e37b5adb4451d7a355521c503092cfd8ab8860c6f4", "maxPositionImpactFactorPositive": "0x2d159b4e62a983c5c028f2c9257af7d9dc7813e54bb7ec68cb5abe37af1f8509", "maxPositionImpactFactorNegative": "0xb09e57cdc10afaa5d73dcb0b84982faf2bb6fcc8ffce9dc77c3a70668dfe917a", "maxPositionImpactFactorForLiquidations": "0x264ca4cdc35dd30b69ff7cb46b77b8e60659253ac3c1486a85acce86d758ad6d", + "maxLendableImpactFactor": "0xe71b2fe24fcb64b2aee6954430f838ba6446c64f61ce8df03ba35e2aeff60031", + "maxLendableImpactFactorForWithdrawals": "0xd00738ffc5c7205a5e40a094b0e53fc88107dba7dc1460e648c58d97d61474dd", + "maxLendableImpactUsd": "0x0df0549faf708fc4ac7c15268724150a810bd639c2503a582946fccd53ac76bb", + "lentPositionImpactPoolAmount": "0x16810e11234a60e065de1af42a4b98ccd19642a8c17d5b226e8c8293ac7f985d", "minCollateralFactor": "0xeda57e7c9f036aced07cbf0300755e5a198f5b38b8f38709a4b3db66c6614d70", + "minCollateralFactorForLiquidation": "0xaab69b6b17ca07fc7c5e074a238946779c61ba7b06c80ab5ae092d0fa14f5d04", "minCollateralFactorForOpenInterestLong": "0x4e55b36b90bb86b6c710c7a94743860cf086374614e1de9788b5d60f6f2af678", "minCollateralFactorForOpenInterestShort": "0x0c8510fa2a221d973bba3edcb9353a25738e7d0e3a217a5618077208ed4df0da", "positionImpactExponentFactor": "0x142524c8e6b264412253aab7e884fea1fcf5610232b882cebb399d9d5a20adfe", - "swapFeeFactorForPositiveImpact": "0x8882eb6d03e0ebad72e73c10506efbfb2062a15fb87ef045b2a5da71e2807ce0", - "swapFeeFactorForNegativeImpact": "0xf572e75310cd3f77b9a3f87cf5815f0a95e7c97841906d11ece78caf827475b3", + "swapFeeFactorForBalanceWasImproved": "0x8882eb6d03e0ebad72e73c10506efbfb2062a15fb87ef045b2a5da71e2807ce0", + "swapFeeFactorForBalanceWasNotImproved": "0xf572e75310cd3f77b9a3f87cf5815f0a95e7c97841906d11ece78caf827475b3", "atomicSwapFeeFactor": "0xc9ba772087f3c8e13388048b4fa1b89c1f85215090717860d20c0b6fd5864356", "swapImpactFactorPositive": "0x2c164a61e689a8a81aeda0f29bff44d8a7f2d8895878c64b4e41c5aab8c4389d", "swapImpactFactorNegative": "0xb88ad88aaa77586d993ed016bbee3584738069ab1f80fc3f7d9a8544cd6b6916", @@ -2225,19 +2440,24 @@ "maxFundingFactorPerSecond": "0xc054005cc2f37c32e1ef3b76b389a7ee9bf66a860b8b46bb02614b59630502c2", "maxPnlFactorForTradersLong": "0xa94654778e8d045b745c37d4949fca238c14141ffb3f39955f72692d7723420a", "maxPnlFactorForTradersShort": "0xc353eb203a1beb0be8441b249a43981a15bd0a6841bab87b3ca6fb9ca1228935", - "positionFeeFactorForPositiveImpact": "0x797f04bc0775c8db2983c4b6a39a9ff455e6074fa15d697b497ed9a0323bdbb1", - "positionFeeFactorForNegativeImpact": "0xd714718d551b78772cb65cfe1a4c6f8bb77cc66af359c92adf8568ff6a15f033", + "positionFeeFactorForBalanceWasImproved": "0x797f04bc0775c8db2983c4b6a39a9ff455e6074fa15d697b497ed9a0323bdbb1", + "positionFeeFactorForBalanceWasNotImproved": "0xd714718d551b78772cb65cfe1a4c6f8bb77cc66af359c92adf8568ff6a15f033", "positionImpactFactorPositive": "0x3c21979d6fa1a52812bbea6ed9c4e45edc07fb528d1288d8dc454da59655d385", "positionImpactFactorNegative": "0x9add40936e4063e215522e32a8ae7847e0db2e8b27b4db0284f3f3f9401b808b", "maxPositionImpactFactorPositive": "0xac08965b798a991c076440d2e2678d2e18bf6a22c4a1b7323eefbd345cbf2ddb", "maxPositionImpactFactorNegative": "0x8e393b5ffccbfaaf16c5ae93cd98901ec890efb2554a03fb723c082280ab2991", "maxPositionImpactFactorForLiquidations": "0xdcab036d83ec75c77aac09db90596f2b3ad8bb2fa8f908917acff8c9c702822d", + "maxLendableImpactFactor": "0xa4f62f601d3256e54696361f07a5311f84a99bad5aab511eaec3462fcd04a27f", + "maxLendableImpactFactorForWithdrawals": "0x2e7060aa7c0e96af71f094bc2fdee585d9fb1cc58bd9d06616040b634f612a5c", + "maxLendableImpactUsd": "0xb6636bd7d6c845b8e827c4737a6046dcc18f33ca9fc08e3e632b4fc0f6d298aa", + "lentPositionImpactPoolAmount": "0x2b7d8014d69c6256c58ca4cc371bf72964cdd024778fd12f492d23f7accf43b7", "minCollateralFactor": "0x77bde089799540169026c8dd1d4ae2e2128599fd8b9e31446c4dcc83bb9c23e7", + "minCollateralFactorForLiquidation": "0x07395d2acf2523661f22bac10669c8a51ca55b1618d2d5d8f9e293fce20539de", "minCollateralFactorForOpenInterestLong": "0x36e72daab303600b4522ff9c0d0bb9a1eaf31c1cce97b8ae17084f0ebefe5924", "minCollateralFactorForOpenInterestShort": "0x93a0ba9c685fab64917a6ab1a5e27dff7537836ea12f0c7645c76abd965d21e4", "positionImpactExponentFactor": "0x78b509b0ba1718dc95363e99b4b27fbc80a15ff26f4c7af4d09bff22b4708a36", - "swapFeeFactorForPositiveImpact": "0x1bb948b925f5b0890197e4a96a36efa3405166da0bb37057376b1c9afc67a1f9", - "swapFeeFactorForNegativeImpact": "0x3936d99bd3d40af388a17a62030f9472559e4073150a3b7df3e29aa7b5652a9c", + "swapFeeFactorForBalanceWasImproved": "0x1bb948b925f5b0890197e4a96a36efa3405166da0bb37057376b1c9afc67a1f9", + "swapFeeFactorForBalanceWasNotImproved": "0x3936d99bd3d40af388a17a62030f9472559e4073150a3b7df3e29aa7b5652a9c", "atomicSwapFeeFactor": "0xc1251742314a5c7bbc29fc0d0ae9f882f422cfbefa2b4cef4b1094e2ee40240d", "swapImpactFactorPositive": "0x43fd312437e0556e2d89f99e604d50d1ed9c4b02d4e9804bf69d8c71c1ff2928", "swapImpactFactorNegative": "0xe5ea472c4d680fd020ee7c372c33683a5739fb3822fe39d969f07cbe4167bd0d", @@ -2276,19 +2496,24 @@ "maxFundingFactorPerSecond": "0x7c7d2c063e2459eab3f0b4617d9a10deef46d0b92fd039e83e83ab508de22dbb", "maxPnlFactorForTradersLong": "0x88880540378c25ab3984cf20f61798200656efa0a6df24c9848bbb980be23a17", "maxPnlFactorForTradersShort": "0x7c292ade526b200d6dab2668fd249b4e1c8462c4fee902f3d8b5dd10438a0297", - "positionFeeFactorForPositiveImpact": "0x60b0929e249f03887b7653b500ef4fd2f72f5338f946b5a9b4243ffbde989eb7", - "positionFeeFactorForNegativeImpact": "0x2b9925b6789771e207b9223ca7476cc9fbc5b742a243e5b7cb4e836a20817807", + "positionFeeFactorForBalanceWasImproved": "0x60b0929e249f03887b7653b500ef4fd2f72f5338f946b5a9b4243ffbde989eb7", + "positionFeeFactorForBalanceWasNotImproved": "0x2b9925b6789771e207b9223ca7476cc9fbc5b742a243e5b7cb4e836a20817807", "positionImpactFactorPositive": "0x2758725c04034379168a8d828ed91d9d3e855a2d10aff4dd54326b154d640a15", "positionImpactFactorNegative": "0x51783acf88ad8bb641add39a04bea27fe7715c01fa0ebdbe7ef3f72d473e2fc5", "maxPositionImpactFactorPositive": "0x8c12b034ee8ad6fc1164338e82528933622843f83631cef944038173ec07125f", "maxPositionImpactFactorNegative": "0x812b06e8a9ae30129f248baa9f7e032708f037b1138d7f487060bca9cb4287f6", "maxPositionImpactFactorForLiquidations": "0xf129060dfcad1deca65540e0b1641443a5f0fcec26235aa946eacb088c0eadf2", + "maxLendableImpactFactor": "0x2e64eee7491505d680b57c4c65166533cc03a150e3aaa4f6b886de62ca91baad", + "maxLendableImpactFactorForWithdrawals": "0xb16b9e1df74cf0b2170913a3fbe6983fdad89a333d154b095e3e2f0666b7d8cb", + "maxLendableImpactUsd": "0xd351d973906e71859bd3af9cf85c2cce74231224edd2c67726a5a3bd39e7dd30", + "lentPositionImpactPoolAmount": "0xf3e0a20ec0adccb47462bb3c3e5755187c6988471571b3812959c46e0fac1440", "minCollateralFactor": "0x64c28b87c54a43b52e4e78491ecc0749386e5fa99986c78e5855e4e0039fdd01", + "minCollateralFactorForLiquidation": "0x80c09ef7c9fd9bd8cfac4a4dfea9a09e895612ea378f41668a753350c6932f69", "minCollateralFactorForOpenInterestLong": "0xb1f9e034cd8013cd53cef9f0bdec7c7bdbc4db862e555e88eb9d1cf5e6511956", "minCollateralFactorForOpenInterestShort": "0x20b6d2f9b79b868e1524b9e961bab3641f9f799c6d97d63911dea52d70c5cada", "positionImpactExponentFactor": "0x9f1b87272507fe9ec122c5535383fff447e2ebf7c92121965b17bf0f4184fd41", - "swapFeeFactorForPositiveImpact": "0xadd2c67471f951b61e2eff6f7decbdf8c2ef20f48059afcbdea87d9a435d01c5", - "swapFeeFactorForNegativeImpact": "0x31edee4dfd4291a0492f60b88b76f2f0752edfe619e20e30710894daac78e1ca", + "swapFeeFactorForBalanceWasImproved": "0xadd2c67471f951b61e2eff6f7decbdf8c2ef20f48059afcbdea87d9a435d01c5", + "swapFeeFactorForBalanceWasNotImproved": "0x31edee4dfd4291a0492f60b88b76f2f0752edfe619e20e30710894daac78e1ca", "atomicSwapFeeFactor": "0xaa1e103bf62db569d5534ff50ca53b37314f09c697813b0f9d753cebcb252601", "swapImpactFactorPositive": "0x36e871427ac1ce490403c9351e871024aaee072fa90fafeea3a09ee1296c5100", "swapImpactFactorNegative": "0x6a34903a427c705b14eebd04e3d807ce9465c22b28c84ae75b83b142bc0e34ab", @@ -2327,19 +2552,24 @@ "maxFundingFactorPerSecond": "0xbc1f8614236a23d18e95db9ce4af307af690e5ab8206ffea12ca642c6cd6dea7", "maxPnlFactorForTradersLong": "0xcbb5ee9549df2459619925fd79c95020edd6b39393c707c37ca096d31570720a", "maxPnlFactorForTradersShort": "0x4e7efb010dd37130af7c8133f32a850a2390afd139b7893e47fb75df081b7eea", - "positionFeeFactorForPositiveImpact": "0xb65ad101925e7990ccca3a06feb91cffe0d80cbcb201841f6b5b7ca816079b4e", - "positionFeeFactorForNegativeImpact": "0xef6385c6a2f181806f748dd22a2c0ccc32882d9fb08e7747514a1b41929100fa", + "positionFeeFactorForBalanceWasImproved": "0xb65ad101925e7990ccca3a06feb91cffe0d80cbcb201841f6b5b7ca816079b4e", + "positionFeeFactorForBalanceWasNotImproved": "0xef6385c6a2f181806f748dd22a2c0ccc32882d9fb08e7747514a1b41929100fa", "positionImpactFactorPositive": "0xc2acf82f196514ddbcfb4250e4aaf2765fb3fda2f0e09da76e552cef2f83a8fa", "positionImpactFactorNegative": "0x78bf708597d31ecf8d57abcec8dabfa5c0d21147ac154d5d288f5c20f5f220c6", "maxPositionImpactFactorPositive": "0xb0a73010ecdba53705c694d2f936d18e4a05df0f17c700bdace6271ca813c9a3", "maxPositionImpactFactorNegative": "0xd5e633acde47db2e2ffff00c56aa46345ef121f1a456f1d77b79706719b2c3f6", "maxPositionImpactFactorForLiquidations": "0xb9f158697849b94901cc34c765b0796456aef9657a895abbbc4da40e752e6e89", + "maxLendableImpactFactor": "0xae87f11395854df27730c03627fe9fa049226d435b0408025dcfb489fcf06a0c", + "maxLendableImpactFactorForWithdrawals": "0xd43e4b0d9ebf88c4144b022f8d3241dab3b5c39e4351eee9674cc079ed8df106", + "maxLendableImpactUsd": "0xf45c560e511f5fe46d095ba361ff156cb4a0f51a14bc5edd67ef771816704a80", + "lentPositionImpactPoolAmount": "0xa6fcea5015ef7382e3050920351cada8e11a61c54a083e02e1c63bcc19f3ce09", "minCollateralFactor": "0xe987e328f86edb1ddbe92a10a5a8ed7cc9e27012a3f8eacabb95015d8d4a5029", + "minCollateralFactorForLiquidation": "0xa872cd93df49b89091c0c052b1f9816b051bc3c837802ad34c28a32716a65cf2", "minCollateralFactorForOpenInterestLong": "0x43fd25f73c5ad7cfa51e170a8e62c4b5267f167b881d77c8db40d0fff9b0cbfd", "minCollateralFactorForOpenInterestShort": "0xbe919143794d2b200798bb5ce729615b2c0da3f4918a5928f7020ea6fd19899d", "positionImpactExponentFactor": "0x68e38c9e7e097fb2dca604ab440cc4c81ec75b7cb19de8a626c93bd00019e02e", - "swapFeeFactorForPositiveImpact": "0xed597aacfcc0d2c97088b29821bc7c5481db8decbdc266300b3998ae014dba2c", - "swapFeeFactorForNegativeImpact": "0x605173de6a0cb1f167f584339ff5b46851ceff4ddd725a1db918231f9912a43b", + "swapFeeFactorForBalanceWasImproved": "0xed597aacfcc0d2c97088b29821bc7c5481db8decbdc266300b3998ae014dba2c", + "swapFeeFactorForBalanceWasNotImproved": "0x605173de6a0cb1f167f584339ff5b46851ceff4ddd725a1db918231f9912a43b", "atomicSwapFeeFactor": "0x572c7a723c1c49a0e78bd8ffa219de256d375f1098f3accf55ca7c0d303d141e", "swapImpactFactorPositive": "0x208c6acc0507566d2cb55884616eee785678beeba5542607b18d32de7007639e", "swapImpactFactorNegative": "0xbc075ce4fb66dc695cd10edf51e201ae23591004d823be69ee8ad5ab0ccf87f5", @@ -2378,19 +2608,24 @@ "maxFundingFactorPerSecond": "0x5d86ad2a0ee3b0f58abf8bb7c1aa17dc35b005d746a5b027877a3d0ef626ee1c", "maxPnlFactorForTradersLong": "0x23941bc4b4dbc0978d113bb410060704c55e1a0adb646b54e5a3de1c46715451", "maxPnlFactorForTradersShort": "0xa854cfc761aecf46ad9aba88804d4ea337d88de6716e057ee78c6774832fd66a", - "positionFeeFactorForPositiveImpact": "0x8feb0270a20287d1a5124b49803492bfae97c6b5638dc765bbf3114a5439b54a", - "positionFeeFactorForNegativeImpact": "0xf4fd4b73132ab0990fec091ab4316539ebc88b4981c0449fdb89f91d0cb90b49", + "positionFeeFactorForBalanceWasImproved": "0x8feb0270a20287d1a5124b49803492bfae97c6b5638dc765bbf3114a5439b54a", + "positionFeeFactorForBalanceWasNotImproved": "0xf4fd4b73132ab0990fec091ab4316539ebc88b4981c0449fdb89f91d0cb90b49", "positionImpactFactorPositive": "0x495905a35817f5fff10ae3f21225d5e5522efded696273bf51f1669dd880ca91", "positionImpactFactorNegative": "0xd9f43c76d06fc8135a75b267ffb77032a20aed233064fe4a1cdace0201339441", "maxPositionImpactFactorPositive": "0x01e8f1ec1cca444aff7fb4841c5e04551eca12a3e3f40d802057aea21b946eec", "maxPositionImpactFactorNegative": "0x428bc3887bc7489c9485260579d0e0763d783139851ee3f18a14d55cc74cec96", "maxPositionImpactFactorForLiquidations": "0x309b153983005d88ec9b50ee2d382f58b3d94dbf502ebac9a1df9200f806f7a4", + "maxLendableImpactFactor": "0xabeef6af10a3f56b35364626ee2ce74ac4b2fc5e5c73249ff5d2821ee2b4389c", + "maxLendableImpactFactorForWithdrawals": "0x99773bf20f3592fbba4ae7d96470d273aedbbc7be2a59f8e0b937733aaa35bfa", + "maxLendableImpactUsd": "0x45a363babd50926907d227376a252d13abf447ed356916cbfcae1ad20d79a858", + "lentPositionImpactPoolAmount": "0x9b5e96a39a758cf2b91a6c525554121f2b13bf3b7d3f84ceac955336851faeac", "minCollateralFactor": "0x4f281cdc49e1f75ea1a028c8c23e00c1331011026e794caf8547cdcfc8afbdd6", + "minCollateralFactorForLiquidation": "0x17804f6665dca57aaf8fefd6e6134d40f30afe8dae60b79da13190d4ca798641", "minCollateralFactorForOpenInterestLong": "0xb41bba385bea8b61ee3a31a77f9b22ca93ddd1ddd4c0b2122a1479c41245a918", "minCollateralFactorForOpenInterestShort": "0xa3cfc4f602f38bf736284ff16d11b328ba89cdf571d87a27d801101fe18a89d3", "positionImpactExponentFactor": "0x4717cfc01a1a24ef675701768beb7343fad800404065332a016f33c3fec290d8", - "swapFeeFactorForPositiveImpact": "0x712f5742039b496858cdc383ea6f4f6db9dafd98bd4bc0682e8bec1036758869", - "swapFeeFactorForNegativeImpact": "0x39ff0ec8537e6c67dc3aeb20d22f14835a509939dd4c2535b1d83677bdb58dfd", + "swapFeeFactorForBalanceWasImproved": "0x712f5742039b496858cdc383ea6f4f6db9dafd98bd4bc0682e8bec1036758869", + "swapFeeFactorForBalanceWasNotImproved": "0x39ff0ec8537e6c67dc3aeb20d22f14835a509939dd4c2535b1d83677bdb58dfd", "atomicSwapFeeFactor": "0x70b27f118f4f8264a881ff28afcf50d90a22ddd062536d52cfc0c09831ce599d", "swapImpactFactorPositive": "0xf36010feb1e7e5bf88eba48c62b7cdc9a00bbd23007f4afb33cc373619624b2c", "swapImpactFactorNegative": "0xfb915dffefd667c9f6211dad9e8b7236026971701504f4c5b591c964d750c9aa", @@ -2429,19 +2664,24 @@ "maxFundingFactorPerSecond": "0x2f69beeaf53db976baa8d119d7c271708c4813cf85476d76004568544ef32779", "maxPnlFactorForTradersLong": "0xa2800b3ce78a5d0389732d81038e88feff40e3bd49f09ffee56811f40ee38803", "maxPnlFactorForTradersShort": "0x1450231125af74d89355c10b08e1244c6930ae82e7c6a43f541a02c87e85b32c", - "positionFeeFactorForPositiveImpact": "0xbc139966b077397a4c0f20ac3b08651b6c91952888bf60fc6b03879a297c4b4a", - "positionFeeFactorForNegativeImpact": "0x4dd266ff9795afbab0849ca9b10a61a56f7b9b3df788cdd4a427a615d9ef59e8", + "positionFeeFactorForBalanceWasImproved": "0xbc139966b077397a4c0f20ac3b08651b6c91952888bf60fc6b03879a297c4b4a", + "positionFeeFactorForBalanceWasNotImproved": "0x4dd266ff9795afbab0849ca9b10a61a56f7b9b3df788cdd4a427a615d9ef59e8", "positionImpactFactorPositive": "0xb5dfa58ab68838cfab396a23a6458a19b08332f7a04cebb1c6f71f2821947e9a", "positionImpactFactorNegative": "0x56823d6116f0891a5d4838c542ef05dc745c9ae5c68f9a99f22a8b55b4d230f7", "maxPositionImpactFactorPositive": "0x1ceebfd867b9918efbe8423ec199d06ce78ca441d305aa9662d3764ab7a9faf5", "maxPositionImpactFactorNegative": "0xcf7ee5b0a80d4662ffda30f4d157d17612195104d15bb91bee6de03ae3e3599e", "maxPositionImpactFactorForLiquidations": "0x930f7239b83bc0b01c885d62e1739adb7f47483b2f95d68cb6ae0586991421d0", + "maxLendableImpactFactor": "0x761ab4d85c8d02769f1892e9544527e03bf6c30f447f04de8536fe2f3c8700a1", + "maxLendableImpactFactorForWithdrawals": "0x760851489978dd8127b1ee813fc067383fa463de207a6ba4fae5d02888dc1d65", + "maxLendableImpactUsd": "0x3fa3b2f9d004c88d67722537d6e17392f8c8dbb12709f592ff982371c6bcd483", + "lentPositionImpactPoolAmount": "0xed9d636ee89e792a0f7c913aa64beee264ab111f8afcd74b702e155b11507bae", "minCollateralFactor": "0x6e2e2d9c129dee202f1002e2c7b8fa62b854c04ed92b2e84ccc8d7874d1d2b82", + "minCollateralFactorForLiquidation": "0xe95b93b905611839520fd90f7f70626dda38eac36b11245e48bd0013c4a96ca8", "minCollateralFactorForOpenInterestLong": "0xc777cb82bf5fcf2085423ebb02d83a2e797ee69fe92e28bb541585d6d3ef9776", "minCollateralFactorForOpenInterestShort": "0xea1786adf77d76ecc08ae1ddfb961397bbf8037fcc1f39f407ca682bd0cd31d2", "positionImpactExponentFactor": "0x9fb394e7a8ca562a80c61ff34aafa3780f223eae1c7bab55bdd65f3e74d7c10d", - "swapFeeFactorForPositiveImpact": "0x8fe25e4cd1a3645c942c5754cb52f61d884f867f40c795ac14d8c0c4cb5a58f0", - "swapFeeFactorForNegativeImpact": "0xfe43f1671a9753bc846216959f80192c4bd06d228525f64f1bb0ec0b21616e08", + "swapFeeFactorForBalanceWasImproved": "0x8fe25e4cd1a3645c942c5754cb52f61d884f867f40c795ac14d8c0c4cb5a58f0", + "swapFeeFactorForBalanceWasNotImproved": "0xfe43f1671a9753bc846216959f80192c4bd06d228525f64f1bb0ec0b21616e08", "atomicSwapFeeFactor": "0x98488815b3e5a70a0181740e0bd65220f81a07d1c039b338bbe14abe54844499", "swapImpactFactorPositive": "0x79e2b21fccda79427457db054b84bc2dd39d6e71e802603330463debd9e2cf2e", "swapImpactFactorNegative": "0x3fb93539d5a21b0bfb035b684c90c976559174c5b3cb61a31eda7052cd0a8df8", @@ -2480,19 +2720,24 @@ "maxFundingFactorPerSecond": "0xc99b408fa3abdf793c7508311103c10f75b6459450a8f7ba205fbc854f11848e", "maxPnlFactorForTradersLong": "0xdec4bd5c55d0af82123c937bd7b6f886e517f0c7e1c940459a068e346a47fa1a", "maxPnlFactorForTradersShort": "0x99a75d71a9aa0d00fde825a755f89eea3f4fb0c905591fdfe52f37099e98c49e", - "positionFeeFactorForPositiveImpact": "0xdde7cf99fc26d3c9e7e5ae67f7558d1d21fabe5b5881f645ecd574acbc1e999e", - "positionFeeFactorForNegativeImpact": "0x5c6320bcdc9efacd98b6a01febab34934936dd529ac3c8158b58232b6692cdba", + "positionFeeFactorForBalanceWasImproved": "0xdde7cf99fc26d3c9e7e5ae67f7558d1d21fabe5b5881f645ecd574acbc1e999e", + "positionFeeFactorForBalanceWasNotImproved": "0x5c6320bcdc9efacd98b6a01febab34934936dd529ac3c8158b58232b6692cdba", "positionImpactFactorPositive": "0x12350a6709e67181b6145c62f115ee66069858250ea4eb2b0dec9ee9da2f1a49", "positionImpactFactorNegative": "0xc7c8e8dd75f9b18d858379050bfcddc53b2f2d1f7092df2a35e079bc529dfb85", "maxPositionImpactFactorPositive": "0x66f52be66a69bc53a3985ef3c01c7c7906e8b0ab5b51f155f5fb827401b8c716", "maxPositionImpactFactorNegative": "0x3ffb5d3349a72f3953a21481cbed2007a44e98153f737f733789c1fc3db6109b", "maxPositionImpactFactorForLiquidations": "0x47b22aaab270336bca023ac06e6b5231bbb44f56716a9387e91e99241870f616", + "maxLendableImpactFactor": "0x8f2d0ed4f96fe24ed2d9c8dd642fb1acfc10a5567e47c4787f50deef6de62e22", + "maxLendableImpactFactorForWithdrawals": "0x2ba1e6446967b1ea874ebf51400cc46af88e33787ed9d452ff0bd45e47e3e0d9", + "maxLendableImpactUsd": "0x2997295762567bfb9f36140349930ff5febba89eb2aae6d21e157d82bd601168", + "lentPositionImpactPoolAmount": "0xae71a7ae57b6453066097069e546d52946ced985ef929af81540698680327d02", "minCollateralFactor": "0xc27860b61b54460909bb28e4c88e66aa1d27de104b8b444fba674362795a4068", + "minCollateralFactorForLiquidation": "0xefd57fd6c01e403503503b2f4e057243ce629c1fbb965350bc5b699db54e3515", "minCollateralFactorForOpenInterestLong": "0x3e352a600ba2709aa41ad9fe571943bf3119a5d4e2ed56b8d9c26f6b61c24df4", "minCollateralFactorForOpenInterestShort": "0x74cd50f69586972d5835b60030fc59197abcd83dc5ed4952cf7211769bf9303c", "positionImpactExponentFactor": "0x5be4f5dd05e107edd86e920723f94647246b593d1e08b704e42721024d182c3c", - "swapFeeFactorForPositiveImpact": "0xb7614344f2d22e57b6d2476711c7aad17d112f92c7f0b87606553bffaa0e7588", - "swapFeeFactorForNegativeImpact": "0x3c744c1515881778c9d315637561923c3d185bb0922e2816b2672425cf9c942f", + "swapFeeFactorForBalanceWasImproved": "0xb7614344f2d22e57b6d2476711c7aad17d112f92c7f0b87606553bffaa0e7588", + "swapFeeFactorForBalanceWasNotImproved": "0x3c744c1515881778c9d315637561923c3d185bb0922e2816b2672425cf9c942f", "atomicSwapFeeFactor": "0xb1d430a0cefc57e981a25023afc486a84ea4adff0e5dc45ed25b930df872e0c6", "swapImpactFactorPositive": "0x88f491f2b910faaca2409fa56898c9873596d94f61459a799f22aed18c3f0024", "swapImpactFactorNegative": "0x063d716f2663e42baa3255283db6cadd96bc6e066eea5397683e050758613f72", @@ -2531,19 +2776,24 @@ "maxFundingFactorPerSecond": "0xe567c9d6c7b881eadf4a419a3f7a800435fac673e27db053fda52f9513755994", "maxPnlFactorForTradersLong": "0x9cbacb634cf93a6fa613b31a68ce1ded9aca5143679ab689a82e9bbfc7c8783b", "maxPnlFactorForTradersShort": "0x8de9a79752873cb14006e67313ab378ec606bb658c2d296b165bf145345a2593", - "positionFeeFactorForPositiveImpact": "0x8e33a75ecab6ae62818b3a34b74cecec08237ff1bdee24a6df2afee80d3cf513", - "positionFeeFactorForNegativeImpact": "0x5fc7dc3aabe90cf80ba4506802d75ca1fb6af53d099cd8d4526168b0ccd7db5a", + "positionFeeFactorForBalanceWasImproved": "0x8e33a75ecab6ae62818b3a34b74cecec08237ff1bdee24a6df2afee80d3cf513", + "positionFeeFactorForBalanceWasNotImproved": "0x5fc7dc3aabe90cf80ba4506802d75ca1fb6af53d099cd8d4526168b0ccd7db5a", "positionImpactFactorPositive": "0xfc9f106532cffec12b6d284757fb145910b0ec592a415c981d5fe42f068d661e", "positionImpactFactorNegative": "0x6db1edf5d6b901c21934667c8dbbfe802f182c1572aec99759ea829a18554844", "maxPositionImpactFactorPositive": "0xcdbb8852bd100d2a2c9e96c3df6c8a3a1fa5166d2b0e6c0a026ff47efdfcec3d", "maxPositionImpactFactorNegative": "0x02b2d57b10ba38e67b996de41580805338380c5a38991b67cca1d5cd26ae8245", "maxPositionImpactFactorForLiquidations": "0x60a9b69a9726114c020d44750e3d51dfa117631eef925c2e5bb7d90a8bf0f16d", + "maxLendableImpactFactor": "0x280acb1c344ac555de42d4466eff401fd585fa62c27a0d1e3bf74c6a52e90731", + "maxLendableImpactFactorForWithdrawals": "0xce052928845fde42d14590daf8b4b29cec8ba7f4ef1fc3767ec4c2c8882aa57a", + "maxLendableImpactUsd": "0x32a2ddb5e22d3feceeffa3c959588640a038d3fcf8e70f27b9903c36ba56ada9", + "lentPositionImpactPoolAmount": "0x0fdf775c457064438c45c88dec178fa52e3bf0795d656abbd58d0f978044d177", "minCollateralFactor": "0xaf43ec1b76b9c6c2c5167932b08308377bec48ef36aee9e4f40bf44013315ea6", + "minCollateralFactorForLiquidation": "0x751618cd5038dcbf1a35c7b6a4fad895b25d3c85860a57fd5e6f5f677ec85bba", "minCollateralFactorForOpenInterestLong": "0x1b990975b2ec9cb3d7800bdcf4c2483ad891a580d9bb318b533b40c52c2f9ba8", "minCollateralFactorForOpenInterestShort": "0xa7ab6290b680865cdb9d52ee69ecbff08162372ac6787a60fa23c1576752b9ef", "positionImpactExponentFactor": "0x4e8013515d6c6158dbe6773d5523bd3aa689ceca388b13daebe66b8535a1141d", - "swapFeeFactorForPositiveImpact": "0xe7891c63da843b7666b5eb17a233335244d607ef5e28491ff80a739409753cc1", - "swapFeeFactorForNegativeImpact": "0xff76682edc62a55d824fb3027104a8eeefc1aedcefe710468bda4a16e940df65", + "swapFeeFactorForBalanceWasImproved": "0xe7891c63da843b7666b5eb17a233335244d607ef5e28491ff80a739409753cc1", + "swapFeeFactorForBalanceWasNotImproved": "0xff76682edc62a55d824fb3027104a8eeefc1aedcefe710468bda4a16e940df65", "atomicSwapFeeFactor": "0x53fb9a87309e0503a17a7cb3eb74b75cde5bd7b36a87ca33a03323ea8fed03ea", "swapImpactFactorPositive": "0x914773be0246bae3852f2415f162581641c3fcbff05d9f9968dc8831bf8182c0", "swapImpactFactorNegative": "0x736841319b2b2e9d22670e879ec64651e9e2ffd751de069908bc1edbedd8d0d7", @@ -2582,19 +2832,24 @@ "maxFundingFactorPerSecond": "0xaeb94b425d4f56f779214c9f9e87c4ee626cc51a74837db1a49b47432059c161", "maxPnlFactorForTradersLong": "0x1faad52e65ed438f621fcc8af05068c362aa4ff4c660f93606ad9fa95d5aa83d", "maxPnlFactorForTradersShort": "0x23729526acd13b670a94585d21a25c4293bb7b5fb8f1ebedb8af840b2d984b4b", - "positionFeeFactorForPositiveImpact": "0x25c6091da422459bf8e56ea2176383d6a14ab920c5a588df462db76cf3da7d69", - "positionFeeFactorForNegativeImpact": "0xe8c215ead248d58af1e22f00e423ada0096f747e49179f83f4c8bcdf9bb010d7", + "positionFeeFactorForBalanceWasImproved": "0x25c6091da422459bf8e56ea2176383d6a14ab920c5a588df462db76cf3da7d69", + "positionFeeFactorForBalanceWasNotImproved": "0xe8c215ead248d58af1e22f00e423ada0096f747e49179f83f4c8bcdf9bb010d7", "positionImpactFactorPositive": "0x2511daf43d5a9e3063f5e74f46def864a7d94cac6b5430bde3553e0bf2f920d9", "positionImpactFactorNegative": "0xd994d099044c3dff63fb5cd824e94e19ed41dbf6d984c2635aa607257de07f56", "maxPositionImpactFactorPositive": "0xb6030074cf76d818b5e23fff7d930392bdfaff530804a4c269f43ea0c743bdcb", "maxPositionImpactFactorNegative": "0xf788cd2f0dbfdde4498546dbbf8ae4c3d7f72390ee8ea10079f0a24b88ecf064", "maxPositionImpactFactorForLiquidations": "0xd9d7a07c1d5606567f0366e489c3262b466af8fe55e8608cf926ee705da17b6f", + "maxLendableImpactFactor": "0x9bde08cd019f4d098e8014d5b59827bf15a02053eb110a570e17724780fef0ec", + "maxLendableImpactFactorForWithdrawals": "0x6e3e2275f3536b7802157f33a7463a6e30962c362542dd877c9c77b3b035535b", + "maxLendableImpactUsd": "0x7b3e8843f6bf26cb9724c627ea4e654dc7617e1582e78ce5405bffa27e3a4793", + "lentPositionImpactPoolAmount": "0x6e619860837358f304e18598e71571c6e17424b2afe08d0a9a1ae922a4d0651e", "minCollateralFactor": "0xacfac03e8ca9bc9ba4e4139fb22189ce60223a4acf5fcb1c52fe6f5720c8285c", + "minCollateralFactorForLiquidation": "0x0e0c4eca25323de2ad594c25be09587a84873207c577ed3466d2c25c5c588307", "minCollateralFactorForOpenInterestLong": "0x7aba0e66c4752d2788a33b21c7156bee0a7e7db1ddec971a23e4745cb4af6a44", "minCollateralFactorForOpenInterestShort": "0x7877dc6df20ea3c1896337e048ee1dad2b313d2753a43186a3d574f71f06069c", "positionImpactExponentFactor": "0x15f86469a0ce25e4d194855ed6445f3c23aea50cb148f365967050da0ce93cde", - "swapFeeFactorForPositiveImpact": "0x4db5b6b4f93926225227f3e2887f72c9730b813d441fe6ce335cacd22f2461d4", - "swapFeeFactorForNegativeImpact": "0xac158b78400849537bf0f83aade16c435943f4194a4767e602aca8c41e366e77", + "swapFeeFactorForBalanceWasImproved": "0x4db5b6b4f93926225227f3e2887f72c9730b813d441fe6ce335cacd22f2461d4", + "swapFeeFactorForBalanceWasNotImproved": "0xac158b78400849537bf0f83aade16c435943f4194a4767e602aca8c41e366e77", "atomicSwapFeeFactor": "0x8dc037ec9bd8964e45b14319b948aa9956a0c8db71bd5a78d1d06130e76ebae5", "swapImpactFactorPositive": "0xa3b7813df6db3b7ed3edef24c4e1955bd5e9062c80ff1abdb528cd2c550e8abd", "swapImpactFactorNegative": "0xa77511e977f042648b2b03ea93d721a59db658e5437b141a25987849ea22dea2", @@ -2633,19 +2888,24 @@ "maxFundingFactorPerSecond": "0xa738498ce60a1e9fb8a472d19570e7f4d00f74c31c36a97b171f906801db7c7b", "maxPnlFactorForTradersLong": "0x47aed923299f3fc09a40d6edc10f33df888b0ad47bfb0310fc4c733d2ca23d69", "maxPnlFactorForTradersShort": "0x5869feb1e30115c20d820201f07c0022f6c4fc17de5dbe34fc6068e433873514", - "positionFeeFactorForPositiveImpact": "0x89539fbe79008640ad6cb051248458e02b54818bb63a2d7ebb190095335b23da", - "positionFeeFactorForNegativeImpact": "0xf21f4e2bdd357839c21dcf6d38fc0acc4342a53b79215e4658eae1d6cd4c775b", + "positionFeeFactorForBalanceWasImproved": "0x89539fbe79008640ad6cb051248458e02b54818bb63a2d7ebb190095335b23da", + "positionFeeFactorForBalanceWasNotImproved": "0xf21f4e2bdd357839c21dcf6d38fc0acc4342a53b79215e4658eae1d6cd4c775b", "positionImpactFactorPositive": "0xd28bfb3ca08c7494e67067bf0119c7bdba424b1387c306a28aff5dda8b377789", "positionImpactFactorNegative": "0x39f461176d6cc8c5c445eea54a55500c067e773445570b228b27e5493c720160", "maxPositionImpactFactorPositive": "0x985ded2301ade7f01d33f689a689b151bc07de2912a960554b32ff02786eaeb3", "maxPositionImpactFactorNegative": "0x9f08921887c462f296204ce4faf11345ac3175e596f6d544cc8b93fef3d4d0a2", "maxPositionImpactFactorForLiquidations": "0xa7b0973d0ec6caacca6e19044c9914fa639d36bc97ce2751e18c9ec3328bee16", + "maxLendableImpactFactor": "0x5073ac467dc2c2772cef5a355213369d78663bf0cb05153167e39db26e383c48", + "maxLendableImpactFactorForWithdrawals": "0xea083ff57c4f2b40a56513c09f35108e64c3c8a55d5b9c85b4e8c5162d846020", + "maxLendableImpactUsd": "0x823fee4780ac0aacc1528039fc1ae323c007c04cb5f641d08bf1e7d97fe04bc9", + "lentPositionImpactPoolAmount": "0x68e07e3ff441ee9303817bbae7608d4ed52d779dfe1699b57d1f994866445222", "minCollateralFactor": "0x6dc630ed9d38eb4d509bd15a962a8f3f3e85c305ed38bd87b5a691f8e80c6718", + "minCollateralFactorForLiquidation": "0x5e72cbdf15c7c2759bcf483ad4e11e757e1be816fb2cfb21d0a451017677e93f", "minCollateralFactorForOpenInterestLong": "0xe92ef25b6ac87cf0fe6420ff0b94dedb1dbcb99afdf6c01f4b0db2532a75bcfe", "minCollateralFactorForOpenInterestShort": "0xb35e315882bf52eca4d8f8a1c1d0d0e47e8bf6d2e607efee31f62929e397ad33", "positionImpactExponentFactor": "0xfd23c3422c995f8918ebd2dd7c73eeeff142ce0c12d07195868aa9d28d66cacf", - "swapFeeFactorForPositiveImpact": "0xcb64f5f3f45dc3723f11856db5925f30725fccf1bc1b2a79a60b5604b7b28fd6", - "swapFeeFactorForNegativeImpact": "0x440a1479e78766ccba8b1bda85ea239877dfbb362fc1ca7e790944538d1b11f5", + "swapFeeFactorForBalanceWasImproved": "0xcb64f5f3f45dc3723f11856db5925f30725fccf1bc1b2a79a60b5604b7b28fd6", + "swapFeeFactorForBalanceWasNotImproved": "0x440a1479e78766ccba8b1bda85ea239877dfbb362fc1ca7e790944538d1b11f5", "atomicSwapFeeFactor": "0xbdd876ef95fe02c21b1be1058a8d1de9fdf924a675eec857ed69c3a03f82231e", "swapImpactFactorPositive": "0x45a4bf705485557d4d27f88259722f6f264abf19c6067e7e7c80cdc45091f812", "swapImpactFactorNegative": "0x102f11c727669364e295911cf2eeec0f717be0aa5c2954b9271ab9f497dd878a", @@ -2684,19 +2944,24 @@ "maxFundingFactorPerSecond": "0xeb92533e6e161f74bf676c89ee359ec5c068d6c778fdb591257e578e71d2454c", "maxPnlFactorForTradersLong": "0x1a2f6559d9f91c12210d3b6aff192fadd82f4cc3d8b2909e8c279bb5f36331ca", "maxPnlFactorForTradersShort": "0x5bcc0c5f30cd53d5ed94d21c9caca0f4759ba82e89ae1dd7338d58ba3c46b0cf", - "positionFeeFactorForPositiveImpact": "0x69452664e040373e176a46455a6c69626760edcf593b9748b6e49fcdb9207a89", - "positionFeeFactorForNegativeImpact": "0x821b76dbcb68243ea72fd9f2f17fe6b225854dda300a06e396d151a436a4bfb5", + "positionFeeFactorForBalanceWasImproved": "0x69452664e040373e176a46455a6c69626760edcf593b9748b6e49fcdb9207a89", + "positionFeeFactorForBalanceWasNotImproved": "0x821b76dbcb68243ea72fd9f2f17fe6b225854dda300a06e396d151a436a4bfb5", "positionImpactFactorPositive": "0x2478343077084acd3c7216ac2b5c943c00327604671cda4c7972e45006652fc9", "positionImpactFactorNegative": "0x6cf62baa4a882cd293413510ffd531011af5693c6d0581ea345c50272f78bfe8", "maxPositionImpactFactorPositive": "0xd17fe776c6710be10212b8230e5bc255c13cc6af2b50cac277a13f8c4d6cd675", "maxPositionImpactFactorNegative": "0x9516040fbf31d98a9814482b56244c126fbf03066c9b2d2c2f8a456b1453fd77", "maxPositionImpactFactorForLiquidations": "0x3e8a22ffba6968744d62efd7de40d2472b6624acad87770d5dd4ef10357b4555", + "maxLendableImpactFactor": "0x1b745ff1648a88505d8071fd9f56d0ac11fad07ea60590542c7b725466cab15e", + "maxLendableImpactFactorForWithdrawals": "0x13e180d1a458621dc1a012653d5c163bfc736196ab576bd438f57fe9ad4936d7", + "maxLendableImpactUsd": "0xe4bbdea4d6f47bfe9357d37aee197ecc5b66673f6c585cb4cc723a12dd0557dd", + "lentPositionImpactPoolAmount": "0xea50da76a92602c6f9614ea72225692565cba936381d848c8c6ad83e2bde49ba", "minCollateralFactor": "0xde6358bbb99972ed5e13eab04486dbe4a4fc8610e3b7c77b120e6bd807cd78b4", + "minCollateralFactorForLiquidation": "0xb62e8ac26d1c39798214c05ecd3b4d2dc5d3af8866088b3f315949b47730a843", "minCollateralFactorForOpenInterestLong": "0xe51ceab2786b6da44608fcf1c9da64d1760bf55d57ff7ea1f9376b82886cbb20", "minCollateralFactorForOpenInterestShort": "0xb0560b186b7882b503fcbe17a89c5103ccfa322beb5d1f323dc56c929db3ab3e", "positionImpactExponentFactor": "0xb5eece59faa64c0cdbc8ee882453fb67959494a8c73137a924d203b375a1468e", - "swapFeeFactorForPositiveImpact": "0xbee33858c2f53747681135515053cc556c047320c641ae43bf2ff98c77b29113", - "swapFeeFactorForNegativeImpact": "0x0bfde157fd2ee3277abf7b7ff6c1c7fab4f935d0af6f51626219ff39a43792c2", + "swapFeeFactorForBalanceWasImproved": "0xbee33858c2f53747681135515053cc556c047320c641ae43bf2ff98c77b29113", + "swapFeeFactorForBalanceWasNotImproved": "0x0bfde157fd2ee3277abf7b7ff6c1c7fab4f935d0af6f51626219ff39a43792c2", "atomicSwapFeeFactor": "0xd73ce0d7096bf317aa16e7d1245e8e75965719f1f557bad58a9c567a6b75bd19", "swapImpactFactorPositive": "0xd4a5ae415f77d62783af1a2f28e78949cc864fd201805dbe149f5ba71a7bb5f0", "swapImpactFactorNegative": "0xfca9588687c74abf7fbde4beebb4a829136a5a82f3f370b2de4e0c73e1579aac", @@ -2735,19 +3000,24 @@ "maxFundingFactorPerSecond": "0x5a28cc017bae74342dc55e0306a1689f0ebd446d7a5fd1e4f69c62e6bb7d1e45", "maxPnlFactorForTradersLong": "0x7ee64b10ca3672add3b5595621a0a85b1464e5baa88109cf21dd92d2de7b37f1", "maxPnlFactorForTradersShort": "0x44444fe884bda49dea6f16541f03a6f19bc4816a798201061bcc080868400340", - "positionFeeFactorForPositiveImpact": "0x4213ddb8b15cfe22e449464885b90c34587d1348102935814128d4f93564924d", - "positionFeeFactorForNegativeImpact": "0x24284ef4308f320d77eabb3547f89f1511230c1f7623cd72bcc5ce402ead1526", + "positionFeeFactorForBalanceWasImproved": "0x4213ddb8b15cfe22e449464885b90c34587d1348102935814128d4f93564924d", + "positionFeeFactorForBalanceWasNotImproved": "0x24284ef4308f320d77eabb3547f89f1511230c1f7623cd72bcc5ce402ead1526", "positionImpactFactorPositive": "0x7f3f29d1890b46600da48478685b3d055d9a4d094541f910d3c572bd6ffbcd18", "positionImpactFactorNegative": "0x05fc07d81775825dd074d3658bb264d33c01c3ca320ebb478359e5d42f42e10d", "maxPositionImpactFactorPositive": "0xf859b25857e23b61ee284c499197fb6f73683db766cd2b2637edd28191f7e629", "maxPositionImpactFactorNegative": "0x0e36c4bf7768cf3820f171278211a65d274cc60972a4f72ea6c28f3836763f53", "maxPositionImpactFactorForLiquidations": "0xf74bf32733bb1d7982b56ad9de64a3908e498950b3f5dfc5014b11b0a824c574", + "maxLendableImpactFactor": "0x4e8f427a15641a64d02c069e41212d767f084cf5beb7cdeee73087b51caa18d3", + "maxLendableImpactFactorForWithdrawals": "0x88f85dfc2b759826e747760206e5bb4ace1299758e3b3bd5627bf8306211d108", + "maxLendableImpactUsd": "0x7a6801727c0d162294cc14fa0727bf7580c8c9ad479bd4c1f1725b4d6c6641f2", + "lentPositionImpactPoolAmount": "0x3beb34e325a0559ba81778d8f79289d78330d8ee206d1dcb858d5cf69e152e2d", "minCollateralFactor": "0xa8f02a22712a973ce74cc208414ed1f87bff38cccb528fe8aa5dfaaac33387ff", + "minCollateralFactorForLiquidation": "0x4d588606a1bcba8846d247f4195a5ef8db551e3172b7588dda7a762c4b02dc5c", "minCollateralFactorForOpenInterestLong": "0xf326ae64850d57c362abbe3e1a2223c94f4a69b17e96139800b5016fe434d4ba", "minCollateralFactorForOpenInterestShort": "0x1140f50b1bdc82bc058279354f46501bfbec07ddf4351360e7fa48c5b974f4f5", "positionImpactExponentFactor": "0x024d5e4b55579b3102b32e4abfad4d3ea602e20e4ee9e2f3c8b64f3724f0f580", - "swapFeeFactorForPositiveImpact": "0xa18cd10451678dd24a842554853984bdea8ee65419c7424c47fbdacee4ada0d4", - "swapFeeFactorForNegativeImpact": "0xb49a685327e0d1c29eec16feea9c99a0d4d0b5e7ed7de8c46fb83c37ab54cedc", + "swapFeeFactorForBalanceWasImproved": "0xa18cd10451678dd24a842554853984bdea8ee65419c7424c47fbdacee4ada0d4", + "swapFeeFactorForBalanceWasNotImproved": "0xb49a685327e0d1c29eec16feea9c99a0d4d0b5e7ed7de8c46fb83c37ab54cedc", "atomicSwapFeeFactor": "0xfbff4d8c9a7c549991c154234f48ef32736e27536dc2cc91124e03e3f1ee71ec", "swapImpactFactorPositive": "0x04d496484fc2cfc2e5031d2700045b81467c218ed0e70e99c4c5964389cd3fe2", "swapImpactFactorNegative": "0xc7bdfaea94692f0b55dbdaafc9983db489cbc376bf88b3776f57f175713b2ed7", @@ -2786,19 +3056,24 @@ "maxFundingFactorPerSecond": "0x2dd5ac4c1223f9d1263588914bea5e89f3e0e779408819eb63989dba9e247547", "maxPnlFactorForTradersLong": "0x247c69fdf78c9dfad71d03fc086389723570353fbc52843b757c314410b003a3", "maxPnlFactorForTradersShort": "0x7cc5c8fcda211a9b92cd626a408e3fbc393f0c4ea81281a504770dbe89999911", - "positionFeeFactorForPositiveImpact": "0x9f42b71783cc6ced4d228c3a1cdb3ee53eb1c3934339f151155df532bb4d1a2b", - "positionFeeFactorForNegativeImpact": "0xf9f088871c68a5c744fa762744110706e273b6e17c512b9c7c683fe3dc9064c1", + "positionFeeFactorForBalanceWasImproved": "0x9f42b71783cc6ced4d228c3a1cdb3ee53eb1c3934339f151155df532bb4d1a2b", + "positionFeeFactorForBalanceWasNotImproved": "0xf9f088871c68a5c744fa762744110706e273b6e17c512b9c7c683fe3dc9064c1", "positionImpactFactorPositive": "0x10eb2d755e495c24fcd89f3a54b10d05972c0f759d2424c2d6fab44d8cb6e626", "positionImpactFactorNegative": "0x48e3f3213c6b90f6705565760463eee86b3cb17c6607f33593ae8eee66567f8f", "maxPositionImpactFactorPositive": "0xe24fe8e0a7bf583053b0850fa5a89ae870e0f4c7f1056a941f3c5119e9b626de", "maxPositionImpactFactorNegative": "0xea48c7733e09bd6c42892be2c6c63cc52eddf6bd2414e6454843803c853b8a98", "maxPositionImpactFactorForLiquidations": "0x1047ffbe213559d8d5e64a95f8b790cf9b5f58837998080930284ebe9d5d167e", + "maxLendableImpactFactor": "0x910deff99a9c7c4041bcbe7140c4fbc75eb27109d1643f2ac719094e026cce79", + "maxLendableImpactFactorForWithdrawals": "0xd4689134121be2f40b99593ec0c6cfb536e1c4472ab5f317b4e3de13fff577f3", + "maxLendableImpactUsd": "0x228ccbaab0faf5b2247fc5c7bb3bdf152ea87deef6a048ee3d574242d15823ed", + "lentPositionImpactPoolAmount": "0x1f58ff2d1f061a9d3a0c9565f5ece4f09b6f5e0fd60e8d9b97aeec70eaea0628", "minCollateralFactor": "0x381baf1ffa3e7466635bafa799da30f2b9b7d274d6c5373aed1627655f1c84cc", + "minCollateralFactorForLiquidation": "0x09f7ab7442e66755f5bfd66d2e3eb08ec1ce60a9fe6f6369b638528f70c6e25f", "minCollateralFactorForOpenInterestLong": "0x7c973b82d160218ec7405501b5ddc34bb772866294bff340a0046a665e2247d3", "minCollateralFactorForOpenInterestShort": "0xd3f8f45c87c1735b5bd16535061d0f4515b1e7f673b9877125011e406f02c6ee", "positionImpactExponentFactor": "0x2987c92bacb9397e9b34e5f025f773730c282ee0ee4d7af7955d65f401508660", - "swapFeeFactorForPositiveImpact": "0x588f3720f115097a80ad6bce732ba1b277c43fd71d9bd09abb31b5ec5ecc4244", - "swapFeeFactorForNegativeImpact": "0xcac53996c0bcd4b4376d5cca41f5ec9258a4d089c1b0362ece54643a97a16547", + "swapFeeFactorForBalanceWasImproved": "0x588f3720f115097a80ad6bce732ba1b277c43fd71d9bd09abb31b5ec5ecc4244", + "swapFeeFactorForBalanceWasNotImproved": "0xcac53996c0bcd4b4376d5cca41f5ec9258a4d089c1b0362ece54643a97a16547", "atomicSwapFeeFactor": "0xcf6703dd9a4ed9e9beeb69c09936e37c791dc0114c3fa334fad308359fdcc2d9", "swapImpactFactorPositive": "0x2a5710804a712f5b0eb07536474d337dc633791ed8ab8adf49ade86114305f9d", "swapImpactFactorNegative": "0xbc15a6da3861fdc596e77225e3d77376b10df0f3f60809dee735fa659a3a094f", @@ -2837,19 +3112,24 @@ "maxFundingFactorPerSecond": "0x3f5f9c81a311ffb195588d8d2a1406b6be0843e754ead6c42d4e3a9a228958d0", "maxPnlFactorForTradersLong": "0x50f46e76f53049cbfac213b70bbaa631e0b7f6ec49d7e8f4ceb2ae193c7e6686", "maxPnlFactorForTradersShort": "0x90d010e60b9c6c085d351ee1bb8b290ccae5fbf0f488a39c8425d8996cc7b7b0", - "positionFeeFactorForPositiveImpact": "0x3a1710a087639aa8cd40aa7622d69edc8b5aeda3d09b2050db1191033990a818", - "positionFeeFactorForNegativeImpact": "0x3def1740be201793d19f1907d81f57467fe3358a18a0f657b2c26dbb7633a398", + "positionFeeFactorForBalanceWasImproved": "0x3a1710a087639aa8cd40aa7622d69edc8b5aeda3d09b2050db1191033990a818", + "positionFeeFactorForBalanceWasNotImproved": "0x3def1740be201793d19f1907d81f57467fe3358a18a0f657b2c26dbb7633a398", "positionImpactFactorPositive": "0x55ade57dff077ae0cfbc8e7e87dac0abee5631f5854005f418ee719fcd9a1de4", "positionImpactFactorNegative": "0x1574bbdec27482f6cd0b9503c89d23f2ffb3fa62ea5c2409cc0f453213464031", "maxPositionImpactFactorPositive": "0x9e02885d6622621808b0428cad1e6f86b729d3743d3f4917ca6887d62137b8a9", "maxPositionImpactFactorNegative": "0x5fcadf11f64a3fd603c4947b84d914fcf8213538b9a8108cb154f3826d849cb8", "maxPositionImpactFactorForLiquidations": "0x6215ceff639dd1317d038fbaaef7e547ab0a4bcc7797721073a0d8aa4787df86", + "maxLendableImpactFactor": "0xdaaf876a03460b3249d6fed5b583e70757f5483e9fa0198c32ccb8a3a959750f", + "maxLendableImpactFactorForWithdrawals": "0x33df74336a7404127079f5c81aa656bce170179bba7b35e9563f727c6859bdcc", + "maxLendableImpactUsd": "0x3101e2eeb89e61a703e9aa3a52542bd271dcf019a3025afc14196a278393fd9a", + "lentPositionImpactPoolAmount": "0xdde34cc0979d43c77785df3be9a3547fe1ab41cac5d582ef9d999bcb1dfab87a", "minCollateralFactor": "0x20d8ab78d0283316afeab33bf731344b07da86f7203514d76ee23baee753707e", + "minCollateralFactorForLiquidation": "0x4678d0672e6f710a1b949e87f9d131a666582b002ba33e4611370cb314c4fbbe", "minCollateralFactorForOpenInterestLong": "0xb67d83d1aa168418e39a9e63db05fc226ef950870c88cef6489ba60614555ec3", "minCollateralFactorForOpenInterestShort": "0x3fa9ef62043d4b2c98b738e3e792a2cd7dfa6a906403619d068417f199d3e51d", "positionImpactExponentFactor": "0xf40ffc6279286522266a0f262193cd2f2e3ab58182dd4ac525ffa47de5d45fac", - "swapFeeFactorForPositiveImpact": "0x5e06aa364ca3ec60ae841d9563ab289f341be788b71e1195751a1f5a6608d83f", - "swapFeeFactorForNegativeImpact": "0x379a330b77e5901172434cb0ea61bccadbe9ccddbe4c4b44574312ca7e8f9cf4", + "swapFeeFactorForBalanceWasImproved": "0x5e06aa364ca3ec60ae841d9563ab289f341be788b71e1195751a1f5a6608d83f", + "swapFeeFactorForBalanceWasNotImproved": "0x379a330b77e5901172434cb0ea61bccadbe9ccddbe4c4b44574312ca7e8f9cf4", "atomicSwapFeeFactor": "0x2caf89716bc0a40f6c0098a2797798ec47de5f269eed4bb0766c6a14e1a80180", "swapImpactFactorPositive": "0x4dfff87fbccb5b88103d2c18923fe113cabf5ea0683519bdf5aaa014901e5485", "swapImpactFactorNegative": "0x948eb486fa79aecc31b6f33201e895a7a280dd196b0d44d58826f51052959432", @@ -2888,19 +3168,24 @@ "maxFundingFactorPerSecond": "0x4ee72ac3d07cc7996644888cd430c9b2af6663ade143269b0f163c30e60711b1", "maxPnlFactorForTradersLong": "0x2007ac1281a64c05a58188dcc4746347dc8baf24093eae44e9d0adf74e2aa161", "maxPnlFactorForTradersShort": "0x258ea651931bbfbd89ab1b0c50961f9af713c552128cd62335d38f7454fb3e7c", - "positionFeeFactorForPositiveImpact": "0x7f6b38e2af31f0e1d6193d5cafffacbf10ce3c9e34654d9a6d8e012c3d23dae1", - "positionFeeFactorForNegativeImpact": "0x9ee47e77eb16355b9e0f26f0b3d35d3007c23828886d90fbbfef792d34c83613", + "positionFeeFactorForBalanceWasImproved": "0x7f6b38e2af31f0e1d6193d5cafffacbf10ce3c9e34654d9a6d8e012c3d23dae1", + "positionFeeFactorForBalanceWasNotImproved": "0x9ee47e77eb16355b9e0f26f0b3d35d3007c23828886d90fbbfef792d34c83613", "positionImpactFactorPositive": "0xa6b8dc22fae5a3a3d30c9dc1fc679924822f3ce06151f15e5a699d28f4c5090a", "positionImpactFactorNegative": "0x2b7ab6b910c3fd27027b1fe63a7d384342777c75bfa768d924743b609662362c", "maxPositionImpactFactorPositive": "0x68831a394cdb16c32bf312f5c948d383c58754a438caaaf51383d97ab6c97e4d", "maxPositionImpactFactorNegative": "0x18e0e262a34ad1142f0be76b66ed8c655241d4b2d0e4f2d453b1fe347d1b21c7", "maxPositionImpactFactorForLiquidations": "0x190906736b8dfbfb8905e01464105472a332ab43303122acea7d280f99a89e58", + "maxLendableImpactFactor": "0x81e057e65b35d424b515c9d77bf4026c3427d140b9419c6200ba809dd4f2f419", + "maxLendableImpactFactorForWithdrawals": "0x906e115c1e1eb40ac022f964967ddeeba02b0c78951d5e016a2286fe6a611cd1", + "maxLendableImpactUsd": "0x31d2e65ebed0c8f9c4a1c7647640fcb6cd873429e923ab11432bad93b9f5098b", + "lentPositionImpactPoolAmount": "0xe4484870a22e98ab6bc91ffea8cc17b8e03faee4c909bf126db859dde45bcacf", "minCollateralFactor": "0x464c137d7e96e96fcec38af328f9f2e20e1ec3ca751b7e347850ba39d3c519c2", + "minCollateralFactorForLiquidation": "0x63f56c8c49720b8c624535a0612b2838aa6c2fd809d28660be826e5593a84ab5", "minCollateralFactorForOpenInterestLong": "0xac1d1a8dd04b4b1ce72264801861bb8c24d7085a54a992bd00af1c678dab9606", "minCollateralFactorForOpenInterestShort": "0xeb291f3c33fe4214bc3c2127cb7b4e5531517e60b055d0cef9f35e20144b85ad", "positionImpactExponentFactor": "0xe2a98a7ee53e527429ff24a4bc99e39428f49da9eb48d9cce1b3814e1fe30893", - "swapFeeFactorForPositiveImpact": "0x7c8c38c435c69d053cda438aec9ba9b3b04cbed369c8ebf00855a4e5fe237e1c", - "swapFeeFactorForNegativeImpact": "0x520be5e89bd1667cf2473019ce4efe8c6c8844418027fbdb89c72725fc7c87f6", + "swapFeeFactorForBalanceWasImproved": "0x7c8c38c435c69d053cda438aec9ba9b3b04cbed369c8ebf00855a4e5fe237e1c", + "swapFeeFactorForBalanceWasNotImproved": "0x520be5e89bd1667cf2473019ce4efe8c6c8844418027fbdb89c72725fc7c87f6", "atomicSwapFeeFactor": "0xb649f84aef632b821933f087fdf47095e2959db56fff928b569c0034c646a71e", "swapImpactFactorPositive": "0x5c8a37f30c9ecc13ee46d77b70d4331b6132fc1d387d3d6c8b4874daa9e45ee3", "swapImpactFactorNegative": "0x728f7a1b5e5c7393136e513b4f434934682e69750993b9eda930b21a7aced4f7", @@ -2939,19 +3224,24 @@ "maxFundingFactorPerSecond": "0xb00a848de94a4e84ad04a054b52b29dbeecffdded85d5bfe0937842fa610f9c4", "maxPnlFactorForTradersLong": "0x09bf3a2601ed70a79d530344658e77d36302a0255588684fb388734a57452389", "maxPnlFactorForTradersShort": "0x3cd79d723dadb79c31c7239fed102b724ce23ffe698a6df53486cfcf2bc4e980", - "positionFeeFactorForPositiveImpact": "0x8d56dcf0c488d0b86f23175f78a65a0c4b91eb4c7781b4f4c0c475159b64324d", - "positionFeeFactorForNegativeImpact": "0xd1af617cd6a3e2647dc6d7425372ea0a453f414ae9e49b372f3b1cb97cfff5b8", + "positionFeeFactorForBalanceWasImproved": "0x8d56dcf0c488d0b86f23175f78a65a0c4b91eb4c7781b4f4c0c475159b64324d", + "positionFeeFactorForBalanceWasNotImproved": "0xd1af617cd6a3e2647dc6d7425372ea0a453f414ae9e49b372f3b1cb97cfff5b8", "positionImpactFactorPositive": "0x56832fc87dbbbc799267fec5d6f05ef0d548d625dfb016efc230a8ff62dba3c3", "positionImpactFactorNegative": "0x75fc8c5f45563729360cb9c59219ae3a7ba5e7fa35881282062efd1bda8ffa22", "maxPositionImpactFactorPositive": "0x4830dab4380c54ddb0ef53e357ed6fa3a58a90317544a59a3a4672828f16a9c6", "maxPositionImpactFactorNegative": "0x84a8dab8863b30af4f8f17deeb4e8e04e13f946d4486fa1865ac74974b5ad824", "maxPositionImpactFactorForLiquidations": "0x2a86139fe39821bccc6fd82f93be035edc70f4cb61cdae30917956b8ffce8243", + "maxLendableImpactFactor": "0x7b2838de670aaddf75fc39a8e07ebb8b9ee6df9ff61c2818e8aea056458b8ba8", + "maxLendableImpactFactorForWithdrawals": "0x6ff0d20259999b453cd3b269bd10324de0c37d28038acbbf876429482dc00a97", + "maxLendableImpactUsd": "0x8a6e25ea26a52c10705407eb6152e0047ebf18a901143d38d52873163db1a069", + "lentPositionImpactPoolAmount": "0x85c402443e027e0899d4cc1f1a5da2f11c01067263bc00bc9ccbb1a605e83cfa", "minCollateralFactor": "0x68a19f588c4ad0d3e1ee1c870ff0c3d4600a57e7be82732621425395992cbde1", + "minCollateralFactorForLiquidation": "0x7bfa38b3b418ccf0e7148ef4f83761ef84dfac2ede0009121e61a79cca9a8869", "minCollateralFactorForOpenInterestLong": "0x3b95e2164fa00e54a136f46ac7791ab382b33ca305385943a18908b26110b691", "minCollateralFactorForOpenInterestShort": "0x92f543ff91b7e17ebe09b0a5632ba8fe800907683b0400e11b507585b22485dc", "positionImpactExponentFactor": "0x0fff84ee08b85a7dc2f7064113bb23bba06f731bfb6fcaf0b0924fdb86198310", - "swapFeeFactorForPositiveImpact": "0x10a5906caf61db02617a22f487386bcaa73018c7170652ac5f829a8d9fc61204", - "swapFeeFactorForNegativeImpact": "0xd9cfb7f87d3d639a348d35889198ee8deab2cf9d84a50e57dda704d84fd6e960", + "swapFeeFactorForBalanceWasImproved": "0x10a5906caf61db02617a22f487386bcaa73018c7170652ac5f829a8d9fc61204", + "swapFeeFactorForBalanceWasNotImproved": "0xd9cfb7f87d3d639a348d35889198ee8deab2cf9d84a50e57dda704d84fd6e960", "atomicSwapFeeFactor": "0x061c448fae50d49a8f50a8d32e134e7649e6a815cc71e5341389655a702cf9a1", "swapImpactFactorPositive": "0x1ca2c01d2280bd5ce2953044135a4ac1612cbc1e51eb4789094d5277695ea547", "swapImpactFactorNegative": "0x12d72f558e812074fe92ca12d0b09ec2fce12f75ad277ade95bb96d90d0d5feb", @@ -2990,19 +3280,24 @@ "maxFundingFactorPerSecond": "0x1221c040547c0b2c832ae1ae21ea71b6cfe703bbcce79da15d6bfb97b8fce14d", "maxPnlFactorForTradersLong": "0xd0c316afb75722d83ac95f036d09c9c42e2875fd6ea447493e057d14d21cfc83", "maxPnlFactorForTradersShort": "0x556e053b351738204ceb961c323050c2dcb5b167160fbec74dcef7ac665ce1a8", - "positionFeeFactorForPositiveImpact": "0xaccd9226cb98a1157f4dd7aaa3bca3867c8711717f02e1024679623e69ef1267", - "positionFeeFactorForNegativeImpact": "0x1b389553bcb979e53eefe32cf5b32de096277c55c6a9fb516e998e1d29483f8d", + "positionFeeFactorForBalanceWasImproved": "0xaccd9226cb98a1157f4dd7aaa3bca3867c8711717f02e1024679623e69ef1267", + "positionFeeFactorForBalanceWasNotImproved": "0x1b389553bcb979e53eefe32cf5b32de096277c55c6a9fb516e998e1d29483f8d", "positionImpactFactorPositive": "0xafeb1e085d75e737b9082bafa645b5ff9d88c86101ce1eb9bf53086eda79fce4", "positionImpactFactorNegative": "0xeeb2de5e802c7deefc7506ee2ed78ef90c42f81562339b7ac4dbf9989c8c66f6", "maxPositionImpactFactorPositive": "0x951fa1a7252ce2217d6e71fdf8b445f94f389b7b73ecf1297df051acf958fbc3", "maxPositionImpactFactorNegative": "0xe7b058ca894961f4f40dc9e2566920dfce773f64c438b5d415c1176f92a8b4bd", "maxPositionImpactFactorForLiquidations": "0x6aac356dc62435be1465f2f736baa23e6ee3db9636a0dadfa42494493729693f", + "maxLendableImpactFactor": "0xd8bd66997d12ba501a38b32b2d8f229fc3de3d67c9244a6153ab1183468f20c7", + "maxLendableImpactFactorForWithdrawals": "0x519789779c6ac9e09dac42534471068f2f66ba3af0bf3e9bbcc7f5dcb8723c1f", + "maxLendableImpactUsd": "0x67d08113992d07e0d31c1d901044d8106805e2b0a9dad9bf7bc799ef06417e53", + "lentPositionImpactPoolAmount": "0xb9f3834e621a32b9f4c7d0935a0df69c6c0e74699f08124b521a99bd395a6ea4", "minCollateralFactor": "0xf57f95847b05863e3bb30297592097fcf7c8b2a2e25dec83ec531b914747bb4b", + "minCollateralFactorForLiquidation": "0xda84c5039b11ba8791d306f10ba8eb5897908ddfb3553dd90ae15b19a34558ea", "minCollateralFactorForOpenInterestLong": "0x7ee7a2ce8cf97ae51b250ef153c4e47b752fe2a51865364cd7e5e0d96213560a", "minCollateralFactorForOpenInterestShort": "0x038f5c86febee95ef8fa08667309942a2242cce1fd1b73e5c9f889fb199e8bc5", "positionImpactExponentFactor": "0xf20108440f12472008e2502eb559780bec72ab8a376f5f4ce9d978642f37134f", - "swapFeeFactorForPositiveImpact": "0xa3be727905b20731888cc2db25d31e4e8a41bbeaedb036c2aeb9570b03eade4a", - "swapFeeFactorForNegativeImpact": "0x73f6253a8128c8d5eb5486d65b6bbef9e92a29d142827a94e16d7c1e0d1c8c78", + "swapFeeFactorForBalanceWasImproved": "0xa3be727905b20731888cc2db25d31e4e8a41bbeaedb036c2aeb9570b03eade4a", + "swapFeeFactorForBalanceWasNotImproved": "0x73f6253a8128c8d5eb5486d65b6bbef9e92a29d142827a94e16d7c1e0d1c8c78", "atomicSwapFeeFactor": "0x69b16fd7680e79a4444e31dc65f69ef65097908b8c7d378fcae8e1fd420204e7", "swapImpactFactorPositive": "0x21b32f554b31bdc78df56611840c5b22c3f83e6cf98ccfa40a961b576bb8f27a", "swapImpactFactorNegative": "0xc2d2bcf31bf9a8344f5325216298aad7e5db29a9da562598e268aa22650ac8ae", @@ -3041,19 +3336,24 @@ "maxFundingFactorPerSecond": "0xa716fed1ac79547e9a76aeacfac182f569aa0051b9adce527be60494b1970788", "maxPnlFactorForTradersLong": "0xebab50cf54031c7f5a039b99599bd02c6ce508826096b21939bdd5404531adac", "maxPnlFactorForTradersShort": "0x739d43d5c438663669936efa064b6da0f27b4cba3025b28bc441d48f9ab5a4bf", - "positionFeeFactorForPositiveImpact": "0xcb5daf2eecf37ca9cfb7d2b481dd87a9f2ce982e0f9246e6343002ad028cee96", - "positionFeeFactorForNegativeImpact": "0xfa33e9a8d5a686dbe77ec54459519c9f4eb83f3e948e4494952afedc0bbf5905", + "positionFeeFactorForBalanceWasImproved": "0xcb5daf2eecf37ca9cfb7d2b481dd87a9f2ce982e0f9246e6343002ad028cee96", + "positionFeeFactorForBalanceWasNotImproved": "0xfa33e9a8d5a686dbe77ec54459519c9f4eb83f3e948e4494952afedc0bbf5905", "positionImpactFactorPositive": "0x660dafad2e4c7acef21088d044cb91771c793f9ec1ab1ecc89905e726a703017", "positionImpactFactorNegative": "0xd5146ea76962da49c37a3cf7cb089ff75f8ac2593f10c4acddabb68005b6e686", "maxPositionImpactFactorPositive": "0xdd5137f15d530282126920738b90327f8b0900665509f7244b3f790125559213", "maxPositionImpactFactorNegative": "0x2240a4aec542c64a8ce2af813d9ffcce8a3cb53c501e67bb56c19e292105d1ec", "maxPositionImpactFactorForLiquidations": "0xa4fe55cb4ba68ec434258ec31884b8f617ae8d1c8f6d0fff7fd9ddb535812722", + "maxLendableImpactFactor": "0xaceaa6ad7a40f895b33159fef9d68e6541bae7e2809915eba26d0866ad3a3c7e", + "maxLendableImpactFactorForWithdrawals": "0x5dfd61350cb491e144e2503d41570158cb53a420b25d81a1a3c085595ab3ebce", + "maxLendableImpactUsd": "0x1a15338129bd487248d0aed2daa8622bd892913b84243c6f2d80e4be9722ea85", + "lentPositionImpactPoolAmount": "0x6ba48a6c4030c524de2c59cfbe6b64fee861b42666ad0b6785dc99cb05922fdb", "minCollateralFactor": "0x876a4e9018e1ba1655bb96f13e4ca16365b7a5ad565f3f2005205f84cc1df97f", + "minCollateralFactorForLiquidation": "0x46faae59a599d91c70cf77626c8a6d97ddf7017fec20821a1d6cdbaa485a9178", "minCollateralFactorForOpenInterestLong": "0xdbe85b764eb648e48f9fc7ee2ca91b67515bd3c9e5093fc110b0db61825fc00b", "minCollateralFactorForOpenInterestShort": "0x90d4beb803fbe580d51f0aef508be25221595bad32eead1bbf3c93bd37e876e2", "positionImpactExponentFactor": "0x1a0c0dc2b23888100da389151b52c1ce3fc7b82e3e5347ff425be72c6fa91b05", - "swapFeeFactorForPositiveImpact": "0x18e4dfabef67599963a713e17ab75a97ae9a856c7f928a774b55a854d2e8271c", - "swapFeeFactorForNegativeImpact": "0xbcd1f183a9fef531ff9db7158ef135533c7dad2c76a4539fa8ffb261613b5941", + "swapFeeFactorForBalanceWasImproved": "0x18e4dfabef67599963a713e17ab75a97ae9a856c7f928a774b55a854d2e8271c", + "swapFeeFactorForBalanceWasNotImproved": "0xbcd1f183a9fef531ff9db7158ef135533c7dad2c76a4539fa8ffb261613b5941", "atomicSwapFeeFactor": "0xa80450c5250a5e1c80e3ce7ff5da3a8ad5b40b0206abfcc350e25b68fa9f96a4", "swapImpactFactorPositive": "0x8678662699138feac68d6aaeb7318df4d064532ecb21d27591c5329cd16e1df5", "swapImpactFactorNegative": "0x37fb6cda1dbc827e2bed64832211f7e3b22fd76d68eafc898864d33e3d28f7d7", @@ -3092,19 +3392,24 @@ "maxFundingFactorPerSecond": "0x5d7e2d74fcbc72cc8ac54171254ef83eeaa67ea9384263799cefc2dea798ff7e", "maxPnlFactorForTradersLong": "0x2dd25d7a9185ab192d7157198769a10d3bc22b4adf53a49989ff8b5cc9f22f5c", "maxPnlFactorForTradersShort": "0x894227f8a19303a369a7d58c20474e716b64d037c5344c283486f994ef540be3", - "positionFeeFactorForPositiveImpact": "0x8de3360a74370e5a1deb4c0584cd2b2a8f370807bca4a40dd63c6bd13677e148", - "positionFeeFactorForNegativeImpact": "0x24abce2c1fa286b1f26e955d5c9f81027f81a3e969fe6ac068954c5c7020d495", + "positionFeeFactorForBalanceWasImproved": "0x8de3360a74370e5a1deb4c0584cd2b2a8f370807bca4a40dd63c6bd13677e148", + "positionFeeFactorForBalanceWasNotImproved": "0x24abce2c1fa286b1f26e955d5c9f81027f81a3e969fe6ac068954c5c7020d495", "positionImpactFactorPositive": "0xf0377e82644972b454a3b5daed12bd739ac82c6c2cb07157150bd15940e0fb31", "positionImpactFactorNegative": "0x240cdb280108e1b493cfa7a4cb0e18c8b7958c63eaaebe43f11044f3799ff0d7", "maxPositionImpactFactorPositive": "0x16df3f537a8c0c960d6eb333e2954d65c3ca572a594869e3d2e770d2ea872c69", "maxPositionImpactFactorNegative": "0xf73adfe3484d77447f9965114289574d908d3939379f298a8b6c60c3391f4a70", "maxPositionImpactFactorForLiquidations": "0x603199403c207ee830b69e57605b19208e115487aaea260ba310330df2976383", + "maxLendableImpactFactor": "0xc27401710cef786e506dc79ea1f00389be98e1816acb10be44c34bb83432e01c", + "maxLendableImpactFactorForWithdrawals": "0xad60473e5dec097f1450caba4b97a0d3c5ce91549067ae465f31c08914b1d28a", + "maxLendableImpactUsd": "0x503a20bd9e89616ebb0c2f629d49ae2fb07d4552848f62dba0befbc3cfd339f5", + "lentPositionImpactPoolAmount": "0xdb09e993c789c1053a7d8d177123604ed860d7331a10cb8fb2e6f0be9f47fb8c", "minCollateralFactor": "0xf8b84b1cf5ca5b669e90e9fa97bc22a784f39654433ffaf839591bbb9fba803d", + "minCollateralFactorForLiquidation": "0xdccb44a6021a756a790c10935251bd0bc376b3969322208dc9af6c87e11f56b8", "minCollateralFactorForOpenInterestLong": "0x74c0a14f2a215ff8ff5908b12fbaa3065d35c06a533007ed5e577223ebf46e4b", "minCollateralFactorForOpenInterestShort": "0x94f50bb5bf06625aa0686259c5aaef25ec277ae0d18952431e8a79c424b16c4c", "positionImpactExponentFactor": "0x19d95eb25a54270fdff0e791d1ebdbd32acf1ee56f11502fa019a1fad987c154", - "swapFeeFactorForPositiveImpact": "0x0b4f9aafd26ffb34fa8ed5f7ac3afcaa2fa8eb3bc6674abf977dcc940b58fef3", - "swapFeeFactorForNegativeImpact": "0xd57dd2fb2b0d6bf254f2c7ce4bc34f29a69d0274fdba121d2678558e6aec1ae0", + "swapFeeFactorForBalanceWasImproved": "0x0b4f9aafd26ffb34fa8ed5f7ac3afcaa2fa8eb3bc6674abf977dcc940b58fef3", + "swapFeeFactorForBalanceWasNotImproved": "0xd57dd2fb2b0d6bf254f2c7ce4bc34f29a69d0274fdba121d2678558e6aec1ae0", "atomicSwapFeeFactor": "0x7e9b13adb16b9ae09bd6f2530cfe171baf41e3e8e18c3fbe63b818aa15cf5f1e", "swapImpactFactorPositive": "0xe3b67132e0f4393269e4b1a857cf64173c3f439061273ecf56a280f4c93de89a", "swapImpactFactorNegative": "0xbb17be4a833e071fcd118fd099e5441fa4853dd41297654cc57483bad2c4ad04", @@ -3143,19 +3448,24 @@ "maxFundingFactorPerSecond": "0xefc3b2ab35080c2dbd038bc152b9a74d5c3b8bdd2fc6bf5dfa1f31e8caa7e985", "maxPnlFactorForTradersLong": "0xe75fffd4d448c87a46cca3a9b7098d406e8f3bc9bf311da298a989b6d7d7976d", "maxPnlFactorForTradersShort": "0x6c91f5580ab490648e285bdbf7a64d395f922610dbeb6bd3476696c0ffe94b74", - "positionFeeFactorForPositiveImpact": "0x246b89f9c45166ddd8149156fc0378e4a85ba91a41847d89e589c775b613f608", - "positionFeeFactorForNegativeImpact": "0x2fdd80b2d1a7b2ba121fcc94d39910377653574bb900257f8f16822f91cf36ea", + "positionFeeFactorForBalanceWasImproved": "0x246b89f9c45166ddd8149156fc0378e4a85ba91a41847d89e589c775b613f608", + "positionFeeFactorForBalanceWasNotImproved": "0x2fdd80b2d1a7b2ba121fcc94d39910377653574bb900257f8f16822f91cf36ea", "positionImpactFactorPositive": "0x2a0b4b3beab009559d0ba4e7ebc3ce46814186fa089bceee28a8cabb128b8734", "positionImpactFactorNegative": "0xee45a29138dcd27cec55588b13a476457b6f59098697700e870f332212b00ccf", "maxPositionImpactFactorPositive": "0x96f96a3dcbac9181d1291533d01cfb863334e4841412fd3bbb89fc252fca1590", "maxPositionImpactFactorNegative": "0xd2ec0dd1d422983089f9f513b3ee1983a2771a7d3420becdffb6ecbb6b07e82d", "maxPositionImpactFactorForLiquidations": "0xab08f01b9295494f0d6e576dce047ae84eee136a8c3b2c5302812a75c65b018b", + "maxLendableImpactFactor": "0xa8f2560e946160759082aaa313cd2c092a0b062e95cc01a2070211a0e9199cf2", + "maxLendableImpactFactorForWithdrawals": "0x4a5efe9a5faf160836b4b55a024b41157e0be5a5fd38f96fd854fbf79d809d4f", + "maxLendableImpactUsd": "0x70d4966337c2ecb624614d2358cb2865b871651eb6eda2f17d2fcfa80341f90b", + "lentPositionImpactPoolAmount": "0xade099a38978b6d93e15dd49561d7f04cded44421f1cadf603ed6359df468c99", "minCollateralFactor": "0xe9bee751eeaee778244a0b05e5dea9741d42b8f60a6527812d559db10378364c", + "minCollateralFactorForLiquidation": "0xf8251492b7b09de9de757e6c12b0417e0e8afc7471ea341141af2c59de187e55", "minCollateralFactorForOpenInterestLong": "0xa588997b3b52f45c5ae3dd23491184ecdd8c73a4a3ad208d2d9b4b83d653cf2e", "minCollateralFactorForOpenInterestShort": "0x5b71809f9c6cc7c5456b1a517e15e37bb710f1e8f8178edc89be82aa6922432a", "positionImpactExponentFactor": "0xd6579b433a10d66cea53361ab3fd4b674bc36ae60752875ea1bb45c8bb96460b", - "swapFeeFactorForPositiveImpact": "0x02db1c795da4d08231be629c36bdd0b0300c763404833b049786d618d4c5cb3b", - "swapFeeFactorForNegativeImpact": "0xafc8b06e138caf77b195ea98c6b1454b3d1a80d39a3225b2ccb155c31a8562d8", + "swapFeeFactorForBalanceWasImproved": "0x02db1c795da4d08231be629c36bdd0b0300c763404833b049786d618d4c5cb3b", + "swapFeeFactorForBalanceWasNotImproved": "0xafc8b06e138caf77b195ea98c6b1454b3d1a80d39a3225b2ccb155c31a8562d8", "atomicSwapFeeFactor": "0x7b40bd1154f0c0b63a4a7e8d0b508e5ed5e8b6f36a99fa352b3d24383cce2d18", "swapImpactFactorPositive": "0xd8dccee431a28e96dad6b7fe8268ab59607042762992a7833e78b16764e5239b", "swapImpactFactorNegative": "0xbeadf9c02cf8cffd063af197414f3af86d3691554a06b63f4130db8e86501697", @@ -3194,19 +3504,24 @@ "maxFundingFactorPerSecond": "0x571381c79d99d2433da47300740ac2cf56d5f573288d81765d1dcfe1d5509f98", "maxPnlFactorForTradersLong": "0x1bc7dcf41411799ea846b1e435d7207e87bd8470d6bcabf006e773c3ccf650b1", "maxPnlFactorForTradersShort": "0xa10652486af799bdf9fc52fcd7b78bd2edeae561dbd6921f1f3f01b5a14944bb", - "positionFeeFactorForPositiveImpact": "0x485e5ba479fe14d7297e82caa9a6dfebdd1090537a5f3ebc8595a0a0a3e24143", - "positionFeeFactorForNegativeImpact": "0x85691dbbbd49dbc8267640716d91d7101c592ba4e5af6e7309067de0bfd2a092", + "positionFeeFactorForBalanceWasImproved": "0x485e5ba479fe14d7297e82caa9a6dfebdd1090537a5f3ebc8595a0a0a3e24143", + "positionFeeFactorForBalanceWasNotImproved": "0x85691dbbbd49dbc8267640716d91d7101c592ba4e5af6e7309067de0bfd2a092", "positionImpactFactorPositive": "0xd807ea14f321cb31d2d947d5ff941382054f9569c4bc7424ea5fb53b7691c4ec", "positionImpactFactorNegative": "0x3163150b4a2ddbfc6e2d00a08e2d3db1f1a08878af03cc5f906e4876b7d9412a", "maxPositionImpactFactorPositive": "0x82fd63cb2e91678055b06933cdfb846823e9c3b1481501047881465cb095afc2", "maxPositionImpactFactorNegative": "0x300e239bc48235396d1fd413d2c8ac9564271f998a2d6d8c76168d4a1a33b3d4", "maxPositionImpactFactorForLiquidations": "0x81f46680fdbbaf55d36de372843c18dd236a048355c44468a8e675fb7ef344eb", + "maxLendableImpactFactor": "0x6597b060c7043b7ffaf7cb3d929817b3f45c47e81f83b063090d41c1e1e93e75", + "maxLendableImpactFactorForWithdrawals": "0x4ffbbfe4b22be85287e38705df449305a9d176cd27e7459cd05d6c3e99443dfa", + "maxLendableImpactUsd": "0xd43a5d0f9ad8d80a0df71a21de112f24c8c4b72c397f5e3593fbaede2c1619e2", + "lentPositionImpactPoolAmount": "0x82e1b538ca1b185d0b3e0549cd04f483b89663c7b99e60799b9c8ded2ece36d1", "minCollateralFactor": "0xe62544109042c59f4f79a7aaa8e44233eb129115b7b113a691ecfe81d6cc82ed", + "minCollateralFactorForLiquidation": "0xda36895ddb7fc90ac64dc9ca121874177903db68868ec4aca2e26c9877083fd1", "minCollateralFactorForOpenInterestLong": "0x23d5a4de10d52ac5736f00723cb93b596ccb210a54534daf46984afe304838d6", "minCollateralFactorForOpenInterestShort": "0x1a58e0ba8fc5c636b76d61a8c60ec71c99b9f3745706c79766c8cf0dcafed224", "positionImpactExponentFactor": "0xb9cae052e8bfcce30a99ba0cc4f0812cb630723820d72a1110b112396114aa81", - "swapFeeFactorForPositiveImpact": "0x49b65dbdf43ce39b69e841c6230ae6627ceacc9334c4d819b206a8b0ef2d8e6f", - "swapFeeFactorForNegativeImpact": "0xf2ba731e689b507ae2035884b13ec6c67d222f165fba0061d615a11954f6e421", + "swapFeeFactorForBalanceWasImproved": "0x49b65dbdf43ce39b69e841c6230ae6627ceacc9334c4d819b206a8b0ef2d8e6f", + "swapFeeFactorForBalanceWasNotImproved": "0xf2ba731e689b507ae2035884b13ec6c67d222f165fba0061d615a11954f6e421", "atomicSwapFeeFactor": "0xa31641fa0e5934a15bde4d72e8cef277ea19728e3d27bbff3839f1b2292adfd5", "swapImpactFactorPositive": "0x9978b4eb0dfa425718a72f52aee70a622401b0ea0398043e50e286fade3369df", "swapImpactFactorNegative": "0xe602c87380a47190b95ca4de2c92202818d7e26fa1ca73c8e1005fe7f1d2ce7c", @@ -3245,19 +3560,24 @@ "maxFundingFactorPerSecond": "0x958ff648969e44b4659d79a393f28042f97cfcfdc8fc698c9010fa1da452fd3f", "maxPnlFactorForTradersLong": "0xd8ccd387611f6b39a5f16eb0f13c0835179bf58208af7938f7a6ea98ffcfbfae", "maxPnlFactorForTradersShort": "0x626e1b71533247a7b932b107904f1433bbc09b1de4bbd51932958fa8d444f613", - "positionFeeFactorForPositiveImpact": "0x3ba3e82158ca7a20ec5ac93874ab157c9467cb8ff224e0b0a1b7e1e2dc21f874", - "positionFeeFactorForNegativeImpact": "0x699524c62e892e3db59c9a3c858ed04d9f514dcb47513187c9aad9ae3815269c", + "positionFeeFactorForBalanceWasImproved": "0x3ba3e82158ca7a20ec5ac93874ab157c9467cb8ff224e0b0a1b7e1e2dc21f874", + "positionFeeFactorForBalanceWasNotImproved": "0x699524c62e892e3db59c9a3c858ed04d9f514dcb47513187c9aad9ae3815269c", "positionImpactFactorPositive": "0xdc6271c18394b8a7062c7e9b84361c35e34e920fac4f7e13f9ef1a4595aebb9b", "positionImpactFactorNegative": "0x156aa170f4820ef2479670eb20af8fc7ea2e5491f603493dbc2b9070cc948e52", "maxPositionImpactFactorPositive": "0xeca13146281a419baa821b94f4498cbc4276ff0992e34aa2737f8fb79b508223", "maxPositionImpactFactorNegative": "0x7c36e7cd53d579958cb553bb9fd79face0c9a226720cf88b05c3620ad9c54dda", "maxPositionImpactFactorForLiquidations": "0xe1b63d9189f4f9f092128feec975a80cc218a5078db1338445d96c1bf9db4526", + "maxLendableImpactFactor": "0x931757e2340ad964545999c2359c1e5034f1254c4a5ee40fbf9a9102bbc1e89b", + "maxLendableImpactFactorForWithdrawals": "0x100160edcd2bfedde8802fce2c9f72bfc6c51761e924993cda9f3b3defc0aa32", + "maxLendableImpactUsd": "0x3be800af705a3107131e9f2e966fe51e48125a537594aee72f16eba592138a8c", + "lentPositionImpactPoolAmount": "0x7720f3c426ac4cf7ddd9a6c889d503d351ad6d7caba452ad52abf2f05bff0e27", "minCollateralFactor": "0xc119284ca99194e4d943a6af90e4dd7fb4bb14b050a974fb83142774cba81786", + "minCollateralFactorForLiquidation": "0x4e67474f7d9ec9e7dfccdebd0892b8f96bc85a36a16a90e6c8e1a54e85c4817d", "minCollateralFactorForOpenInterestLong": "0xdc7d2b11c98f133ad856f4e38b92fae525d6a2ae80ceeb3b420e240dfad9849a", "minCollateralFactorForOpenInterestShort": "0x5c5f8d9af53545a1214654f78ad1e9a6ab37aecd5469c2e5c4cbcf8cd2e63551", "positionImpactExponentFactor": "0xcc823670635973134c5087c8d47979affcca515532603cc92ebc945c51ed08c4", - "swapFeeFactorForPositiveImpact": "0x014fda6121726da59e193a952cc3a1cfd31b925febc198a559b2cc1e4d27f819", - "swapFeeFactorForNegativeImpact": "0x1a0c447e52ff673b57162b390edd27e8040ee4be5e52ea646e13630bf98457ba", + "swapFeeFactorForBalanceWasImproved": "0x014fda6121726da59e193a952cc3a1cfd31b925febc198a559b2cc1e4d27f819", + "swapFeeFactorForBalanceWasNotImproved": "0x1a0c447e52ff673b57162b390edd27e8040ee4be5e52ea646e13630bf98457ba", "atomicSwapFeeFactor": "0xe7b3759bff35df68019e544ae31cdc1a6e3cd561db220208b66e655b27d1c681", "swapImpactFactorPositive": "0x2f10e629b89a4e353d8d563afb62870a006f03e0cbd77759101e3e646d7f9631", "swapImpactFactorNegative": "0xe6988279f833b1014b0483425d0eb061c1b244073b18b54d1eebf3a9de1f75cb", @@ -3296,19 +3616,24 @@ "maxFundingFactorPerSecond": "0x2ad9d83577d571a8ce3521912811bf5b7c2770021a2c8af368fe8848a1bc4395", "maxPnlFactorForTradersLong": "0x0f01b59ae43dd839e912fd5b24f5406c50afa7c2c37fce4f2268023e9c569959", "maxPnlFactorForTradersShort": "0x46626df8db05a87d31252ce589cf2d44633ae1b0a2593ff6e43642ac83380acf", - "positionFeeFactorForPositiveImpact": "0xa17412d9fb8836576acf564f6b7d917e2523edc2b22e54160bf847b075938f12", - "positionFeeFactorForNegativeImpact": "0xa283b96249bd91fa6bf8027982b11be3b157850d5a7a9409a1bd92993b352d34", + "positionFeeFactorForBalanceWasImproved": "0xa17412d9fb8836576acf564f6b7d917e2523edc2b22e54160bf847b075938f12", + "positionFeeFactorForBalanceWasNotImproved": "0xa283b96249bd91fa6bf8027982b11be3b157850d5a7a9409a1bd92993b352d34", "positionImpactFactorPositive": "0x98286b1d1ff96f67cba51e90d3335fa9395fbffee6ea6d6188f2f4d785fa5730", "positionImpactFactorNegative": "0x8a2e5ca0fcd5b03675d20b12386f3b185a06f71604235ef8d305d427e65161cf", "maxPositionImpactFactorPositive": "0xc81436f5558cb283c8c590d8b08d2685f138a0a10bf14cf46e547a0bda68720b", "maxPositionImpactFactorNegative": "0xb375a902c092145cac64c3a449027132cd12c0e9cef6b72d54024276ab1fd84b", "maxPositionImpactFactorForLiquidations": "0xfd8dcd34d1379f246478a28f69d7ffb710935582517b883cc2114ccd8e574e5e", + "maxLendableImpactFactor": "0x9a3bf9c78080a358487159a8b6e44275cf31d3137a1097c7d64622757e25d32a", + "maxLendableImpactFactorForWithdrawals": "0xa295945573837b377763d6f09ac4ce18ec3eb2557e4292b645d37104a4501184", + "maxLendableImpactUsd": "0x03e814c56af2eac103ecfc5e34c139e8bb79c7e6c3e4f00b8173368e6ee22342", + "lentPositionImpactPoolAmount": "0x7d30fd1aa9dff7273c9a6073d15e5d3e37037dccbf4862050cad961a4288dcbe", "minCollateralFactor": "0xc3b683211f897fd3d5139249aff11aa9339db2b59342fb4dde8b9f241ac744b7", + "minCollateralFactorForLiquidation": "0xa4dcc59c9562a3cdb7480e3bbd33b15e0a7272ccf9d3d453df784176ac492b18", "minCollateralFactorForOpenInterestLong": "0x632d6bc9d36199ead3660e1d54803d97147abc31e2cac1b18dd386d250f44a2a", "minCollateralFactorForOpenInterestShort": "0x03289b688ce32f30e096f9f305f6f1e4d654785db89ccc5a81812876233e02ab", "positionImpactExponentFactor": "0x6af5e63b59afc60c71a45a325ded80a245d81947f6c9a9bff20d5f97e402fbc8", - "swapFeeFactorForPositiveImpact": "0x4f5ebafeb87725474637f4b264962f556c830765f047576f68ff7e5dde5ba384", - "swapFeeFactorForNegativeImpact": "0xec05b3db52f1252fa492f3bfd694cbe7c6b86bfba73abfea88f0a55026e61f3c", + "swapFeeFactorForBalanceWasImproved": "0x4f5ebafeb87725474637f4b264962f556c830765f047576f68ff7e5dde5ba384", + "swapFeeFactorForBalanceWasNotImproved": "0xec05b3db52f1252fa492f3bfd694cbe7c6b86bfba73abfea88f0a55026e61f3c", "atomicSwapFeeFactor": "0x7d5cd589e9c54faead67eea92b39d394d3dee91b21670112950f08cbc2cee5f5", "swapImpactFactorPositive": "0x40d4a5c09e6e2f7d78e3dccf44cdd2813b205c5f57942264bda60aee2add42db", "swapImpactFactorNegative": "0x60918f5a146bcc03569cbf6e35e786a85e270d98a4db0043a431be58ecb5a3fc", @@ -3347,19 +3672,24 @@ "maxFundingFactorPerSecond": "0xb8b59b8e83c4387f3137e1d93b17e05ebb5ee09657a23e38be51a0b166871b30", "maxPnlFactorForTradersLong": "0x0db2cfd5722d5941892740a8f929ca0005e95b48a333cede62a8e8baf05312c0", "maxPnlFactorForTradersShort": "0x227e06582e069889ac13cbb616d3fdeeae60ecf7f8168d1c6735b88a0e1d43f3", - "positionFeeFactorForPositiveImpact": "0xd25728fc562ef369c5f9ca0569746770730f799eaf63c4b0eaa0ec16a272b652", - "positionFeeFactorForNegativeImpact": "0xe22b635fa6d9a5d645504462c7a6d08eef0c7bd5fd22a5c51e6fff32ab045a34", + "positionFeeFactorForBalanceWasImproved": "0xd25728fc562ef369c5f9ca0569746770730f799eaf63c4b0eaa0ec16a272b652", + "positionFeeFactorForBalanceWasNotImproved": "0xe22b635fa6d9a5d645504462c7a6d08eef0c7bd5fd22a5c51e6fff32ab045a34", "positionImpactFactorPositive": "0xc6dc725a1219aff8e142a456a399c768a7ba63b3cf8c7bba44991324511dff23", "positionImpactFactorNegative": "0xc4425eddf8a89bbd5df8ec5c5f26ef4066769441bb055defcc4171293450155d", "maxPositionImpactFactorPositive": "0x8cc4653a53206f190ed9e6141322f03b880455663553ae906eaea51d7f7f9593", "maxPositionImpactFactorNegative": "0x8d6cc7722076a7f7c3481a48edef3eb7ae0c3857f46de999989aa6e26f76eb2c", "maxPositionImpactFactorForLiquidations": "0x6c6d07eef5df4c62d9a6814f48a7dd355fc4cbef5a22b7cd055286f4c4018eba", + "maxLendableImpactFactor": "0x39410aa221bb52fda47a9a9aa5bbc3fc56ac816190b4f2fb9ffbcae10a758041", + "maxLendableImpactFactorForWithdrawals": "0x701e4d0f98cc7a405c786c2285854dcefbbb646aa3b7ceeca24c3dbd24e698f9", + "maxLendableImpactUsd": "0x9fb3ea52913ff1ff83859b0864d2b69e30ac8e3e7e58b75f0c504add0ed57b4c", + "lentPositionImpactPoolAmount": "0x58228cc255c9cdb64eea767639bb2533df63991bb9855e5ac80740d32c1c43cc", "minCollateralFactor": "0x74ff3abbabfffd3a5805a7c152e5b6f0d38444c6b1cf3684540fa3faf6f7bf57", + "minCollateralFactorForLiquidation": "0x373062bd389b4f542a94179cebaf0e1979ec7f3d420160cf1004f6599899fca1", "minCollateralFactorForOpenInterestLong": "0x635e26e9daa2510e295f35fa17f561563e7428351b9282c13d5c56878aa57f83", "minCollateralFactorForOpenInterestShort": "0x632cd25d22c65823f350addf0c66e3d333b599100702c61f455fd6404350eebd", "positionImpactExponentFactor": "0x3d6458a712d40d0d9feba464a4d7cc2541ceaca6a3cd139baf5acedb67490c82", - "swapFeeFactorForPositiveImpact": "0x07679aa91501709e499e12f6f80e0ee1b50c26cf4fe198f1d57b702626c8bc62", - "swapFeeFactorForNegativeImpact": "0xe92bea4730d8e0aeddb90dc9ab5aaaa8c2ca3f9602b8cd47d3e73008fc60315f", + "swapFeeFactorForBalanceWasImproved": "0x07679aa91501709e499e12f6f80e0ee1b50c26cf4fe198f1d57b702626c8bc62", + "swapFeeFactorForBalanceWasNotImproved": "0xe92bea4730d8e0aeddb90dc9ab5aaaa8c2ca3f9602b8cd47d3e73008fc60315f", "atomicSwapFeeFactor": "0x9ffb7fa432de58e38ffdd8a092e66367438d3c576f448a16519c6ea37a68e4a4", "swapImpactFactorPositive": "0xe7ce551847a9a3c438d4b9e7a4099b50291bf4ab3242383a4b621ac959238f8d", "swapImpactFactorNegative": "0x599c414476937eeb2a4b91d90d9ca824d874a17112d7a5b7a7a7a6f6aad5628a", @@ -3398,19 +3728,24 @@ "maxFundingFactorPerSecond": "0x165feae3bd1ab2eb1c9b96390f8e1fca5e9672ef7dfba842db1fa1ef6565ea1a", "maxPnlFactorForTradersLong": "0x77b27385bab5c8d5ed0fa84f2066e56cb9e87c0ba5ba36c35644129d849638dc", "maxPnlFactorForTradersShort": "0x0571bc79d5f2e7ac963ef77dcc8db61ab10117ece969811a6111959a54ee76fc", - "positionFeeFactorForPositiveImpact": "0x988dfbd600a0d356c99e2d7cdb6472503b3c188edf670ff9baf49bddba8da86b", - "positionFeeFactorForNegativeImpact": "0x97be254933fc6763edb5aba3e16fd3195f269f9344ffb3477c65e2557f1b8cff", + "positionFeeFactorForBalanceWasImproved": "0x988dfbd600a0d356c99e2d7cdb6472503b3c188edf670ff9baf49bddba8da86b", + "positionFeeFactorForBalanceWasNotImproved": "0x97be254933fc6763edb5aba3e16fd3195f269f9344ffb3477c65e2557f1b8cff", "positionImpactFactorPositive": "0x2ae31cc08f53dccf910ca8d14bff6f143a1daeb6308c48417e93dab69ba2cf37", "positionImpactFactorNegative": "0x939bf505096c7330665342c1763b56d68b607607ea69f5afcc92b2bc753e28db", "maxPositionImpactFactorPositive": "0x9feaaedae8e2a793d61085d2d1545f6b03b5ddc48e06a8a4492c2c66701797b9", "maxPositionImpactFactorNegative": "0xd2f75c6291a799c429b9fc0ead5e7e999583c93ae7e7dbcd94c693acab115f98", "maxPositionImpactFactorForLiquidations": "0x0dc9c6e1420908930d17d95aa2f6b86cbb245c6c47f36b9f8bd7a51a3d82344e", + "maxLendableImpactFactor": "0x788f98ffa2190a5988b35dc79455c3e80c54a0c8f6d797588ef056a348ab0c38", + "maxLendableImpactFactorForWithdrawals": "0x5184f8265c3a48b345a8c09d321d60ebefc9df83b223ac00fe70440baeb2f23c", + "maxLendableImpactUsd": "0x110a45da52b3e7db79bce35164417ea3233f51addcf53ea56a5cb548b3fedbcd", + "lentPositionImpactPoolAmount": "0x63a990834e9688db1597465ad191bfc5899c6158d1eb5e56bf0b43b4570ddfb9", "minCollateralFactor": "0x331419dea97f8be91933915bded722dd38f3b607cffba6deabf347336fdc3141", + "minCollateralFactorForLiquidation": "0x008138086200d4db7f493cd1697d2047828dee4c011532ed6d71a47f71aa6ca6", "minCollateralFactorForOpenInterestLong": "0xbc8a5091e0c1ff7f8b613fe045ad5ada27f7f46e2025bd0365840c89e99bbdbc", "minCollateralFactorForOpenInterestShort": "0xf612745ffdf98a5dc5d3c7043463ad56ee7554569609b8329755e5dac407e1cf", "positionImpactExponentFactor": "0xb9f2ac464580caead32af83210f8ec22c484b3987a0f6a817ed0cb94f08e41fa", - "swapFeeFactorForPositiveImpact": "0x8607c2a1d0ee1c4c21a541044c8adb91d9a89509c6c861cd6b9a197f272bcedb", - "swapFeeFactorForNegativeImpact": "0x67659dc676411b9d0f40e02dcb934b664abc8f22a45fd6934a1dfd6cfcd9deb1", + "swapFeeFactorForBalanceWasImproved": "0x8607c2a1d0ee1c4c21a541044c8adb91d9a89509c6c861cd6b9a197f272bcedb", + "swapFeeFactorForBalanceWasNotImproved": "0x67659dc676411b9d0f40e02dcb934b664abc8f22a45fd6934a1dfd6cfcd9deb1", "atomicSwapFeeFactor": "0x064cd155fd94e4059e207e32db7756c0097be19306c57bf61774e0a1024d2d24", "swapImpactFactorPositive": "0xc99541a0a2b9d346b58261c0f9438a8b0406a64d5bcd334a1b4671a81191c4a0", "swapImpactFactorNegative": "0x6d6b01ffa99d507be49eb5b27911ed5c7682570a8105329a96ac502a102003e1", @@ -3449,19 +3784,24 @@ "maxFundingFactorPerSecond": "0x58ece9ebee476c6992b7e4411b02419d81d20383d2f311d307465a9f9e00aa56", "maxPnlFactorForTradersLong": "0x0f923bb0dd0946e1050b7ba75dd88bf9967278e4dfe561715889540d385495a2", "maxPnlFactorForTradersShort": "0xc9fe228bf6e22c68a23fdd312a66fd5ad61f9ba483081749b95cf2996d66e476", - "positionFeeFactorForPositiveImpact": "0x2dfe4e7a40a54d4735a5af55c781797d9b9a06190405585b6df4df42a0bd00b6", - "positionFeeFactorForNegativeImpact": "0x92a73e06bc1f50304c5efd275d352907f5e631cb1894e723d750b208b6eb231b", + "positionFeeFactorForBalanceWasImproved": "0x2dfe4e7a40a54d4735a5af55c781797d9b9a06190405585b6df4df42a0bd00b6", + "positionFeeFactorForBalanceWasNotImproved": "0x92a73e06bc1f50304c5efd275d352907f5e631cb1894e723d750b208b6eb231b", "positionImpactFactorPositive": "0xfe23009c84d86851927ecd97ec6347799ff32715b0fe20b75501e126ef8eb443", "positionImpactFactorNegative": "0x824d020df218432323640679d977c7c98fe3f3029ccafbd63195aa2422eaf290", "maxPositionImpactFactorPositive": "0xb50a00942d131a9cdc67aeb2b021f253c5f7770f1a1ba680495a485f25d9e13b", "maxPositionImpactFactorNegative": "0x93e43b69e532e6d6b7788fb09d13d70e2c6e5b1cac594fe1af51e466f3703af7", "maxPositionImpactFactorForLiquidations": "0x355b4df66f1c85fa3f11ecb95ce5e55103d0ed24f5670379791a0e82b88352eb", + "maxLendableImpactFactor": "0xdad319cf45697bcedde77cfcbe34250d74395c10cca8144e0cd9ce7c3db4a5f9", + "maxLendableImpactFactorForWithdrawals": "0xa0dcc39feebd4d40a2fa906c4dd57ad7568e21d02ca7b29f80f2a65cfaba8df7", + "maxLendableImpactUsd": "0xc041071fc0ff246cb4e5fb3bdf450e6e15863d4123e7681df11b25b75c0e2e72", + "lentPositionImpactPoolAmount": "0x3f8b0002f7421a5195a29a0d8a608e2564aa28856e490bfffdacc955f679bee5", "minCollateralFactor": "0x14f519d670ec6e5b2cdef769007dfcac09f7edd6f64da52fddd8a2160f7c51fe", + "minCollateralFactorForLiquidation": "0x41ba01e8c89c5d7646bfb600f8196c7bdba39101507971f06b9b0377054a7023", "minCollateralFactorForOpenInterestLong": "0x12be7656b291987a3022965d8be409d4ed7feb1d382eeec36e6d67225d120789", "minCollateralFactorForOpenInterestShort": "0x5c18aa8765ecd905d817d6f09fc2d40fc0793a5b3e88ef7e071dea5e352eea51", "positionImpactExponentFactor": "0x1cda6cde74b36b50f765db60993e7a63bf269f5b217d1279cf5f84cefc42ab75", - "swapFeeFactorForPositiveImpact": "0xeb2fab73e9fdff0596c8c72b854279382d79404b4aade537b8b8c1dbf352f45b", - "swapFeeFactorForNegativeImpact": "0xf589ab4da11879eaa7be922fbdb14ad14e6be45d55021a50ed0f509c5a5ac0e5", + "swapFeeFactorForBalanceWasImproved": "0xeb2fab73e9fdff0596c8c72b854279382d79404b4aade537b8b8c1dbf352f45b", + "swapFeeFactorForBalanceWasNotImproved": "0xf589ab4da11879eaa7be922fbdb14ad14e6be45d55021a50ed0f509c5a5ac0e5", "atomicSwapFeeFactor": "0xd23b9d2924fefa998a226ea0487fa1d4c1f94ebe2e71bc8b03b027659190d2a1", "swapImpactFactorPositive": "0xb87eba0a263b57b8d2a7dff56d73ab92c164811cd1e56f479690b134e73821ce", "swapImpactFactorNegative": "0x21eb71230a7c89a8134055d6cd127bc1cbd69041800989e1a5ee25ee1186e241", @@ -3500,19 +3840,24 @@ "maxFundingFactorPerSecond": "0x54fa90bc24f8ec4d11915477e376d3a3ba2eaff68805cc56f3010ee26ee58df4", "maxPnlFactorForTradersLong": "0xc096c65bba34dae39facecb48ff0681b31d49086bb6d5de9b06e8ccc7a4d683d", "maxPnlFactorForTradersShort": "0xf52d306b64f46f2b063e645f3774377ec308c0968723bb3ab0fca3423c4d0496", - "positionFeeFactorForPositiveImpact": "0x369579ab28cf003f555199fa0ad696810a2b5ce6c6b99b68c651421dccf9eb51", - "positionFeeFactorForNegativeImpact": "0xa8007eb5a7381de3671f24aa819ea3b3a78aee7c9af638c0ed219f4a94e006a3", + "positionFeeFactorForBalanceWasImproved": "0x369579ab28cf003f555199fa0ad696810a2b5ce6c6b99b68c651421dccf9eb51", + "positionFeeFactorForBalanceWasNotImproved": "0xa8007eb5a7381de3671f24aa819ea3b3a78aee7c9af638c0ed219f4a94e006a3", "positionImpactFactorPositive": "0xf2b3a944c7ff519fc4a0e90e963750bde57de840a4e834a2bb1c84e7c3e3536c", "positionImpactFactorNegative": "0x5d775398a3a1d3decdf0c0b7ff2f38c4245a2585a4bf7e2414b181c550825889", "maxPositionImpactFactorPositive": "0xef1ee058e62d2940f4c6bdb5d4284a74a47fdfd67bf40881d81675898d995c53", "maxPositionImpactFactorNegative": "0x6ae25f9f315f358886ff70b307f9d4c7642e783156df77121699c12723850724", "maxPositionImpactFactorForLiquidations": "0x962ac7fc3cbc4fd8d0aa8dbb670ddc393d37a7f65e15ab52a5324a7d7ec99145", + "maxLendableImpactFactor": "0x82e7f2ec187c1ff710ba4e3e47862c411ae48d8830278a64fe9799990f3523a7", + "maxLendableImpactFactorForWithdrawals": "0xe0b2a367ae98b305796ad880a05b938d573d1bbbda6b0ad17b8b0979e19e4038", + "maxLendableImpactUsd": "0x861ab51a6e050f8f87ea38c363c0dd0daa424191e606a9a3168fa28d926917a1", + "lentPositionImpactPoolAmount": "0xc674683266af6726324d60d4d9ab8343d0adedb4e571e32a91fa7faf189464a2", "minCollateralFactor": "0x522dce74cbd5b4d440202a34f633bc1a0fad761cc20ccbfd6a6ed661a8e22601", + "minCollateralFactorForLiquidation": "0x9b94fc585564e4ce1edae95b097a9949730d58e43dbafd70e0a5c10203b6d9a0", "minCollateralFactorForOpenInterestLong": "0x561ab444da9e0a84f33004689eaee0620921f53832690234974beadbb2874c16", "minCollateralFactorForOpenInterestShort": "0x9fa2d3d66e68869a791c2035796e490049a5eef5abb51228c8c92aa66eb2abd2", "positionImpactExponentFactor": "0x96e4e16197024832d8c5faa031a256a9ce1bc452407a2f713fbfb49a4ea1eb38", - "swapFeeFactorForPositiveImpact": "0xa6143605375dc242962140d0c9e0f878d85c68e51a3d8e88fe5a56ca06960270", - "swapFeeFactorForNegativeImpact": "0x412275642d4466535fa1e10c5215a27411e8188aacf2c49e83198b5cdf636ebb", + "swapFeeFactorForBalanceWasImproved": "0xa6143605375dc242962140d0c9e0f878d85c68e51a3d8e88fe5a56ca06960270", + "swapFeeFactorForBalanceWasNotImproved": "0x412275642d4466535fa1e10c5215a27411e8188aacf2c49e83198b5cdf636ebb", "atomicSwapFeeFactor": "0xd240a56b63cd3c73e77f4732bce5e8f1f988d267f3a144307ac69a9f9a5923ba", "swapImpactFactorPositive": "0x697ece2ce23e93349986cb04edc1fd3fb4307a573d679f243701ae39bb87132a", "swapImpactFactorNegative": "0x19c2660bf05157a6c1248cb90af79be47b7804b52b52bf200a7732aa186c43e0", @@ -3551,19 +3896,24 @@ "maxFundingFactorPerSecond": "0x5c4885506d3cfcf7c3c3df4da8ba4c32705fbde03ce01fbf66ca63641f5db6e5", "maxPnlFactorForTradersLong": "0x878e83953134a8b7aae4a5eb5da30d033850a7ea4d2fdec59d0637637d767f7b", "maxPnlFactorForTradersShort": "0xba6beb80a04dabea3486aa3f32e902bf27f5bfbdde4e3123993c5c17e7900097", - "positionFeeFactorForPositiveImpact": "0x50e88ebd0aa012a81bca5764a77610505af3166c0f8ecfd5ae63b6357988f677", - "positionFeeFactorForNegativeImpact": "0x40f2441d2587c304daeb28a5bdc047acd878b49efa716575ffc8f4a77374d0b6", + "positionFeeFactorForBalanceWasImproved": "0x50e88ebd0aa012a81bca5764a77610505af3166c0f8ecfd5ae63b6357988f677", + "positionFeeFactorForBalanceWasNotImproved": "0x40f2441d2587c304daeb28a5bdc047acd878b49efa716575ffc8f4a77374d0b6", "positionImpactFactorPositive": "0x26b2e3333bc77d9220de66a9684adafda830b2dd3984fc0135d832c9c9aebda2", "positionImpactFactorNegative": "0x1d33b34963c591c09fb0dc2f8250ffbb341eb9eb1dd6498b4148137181d6072a", "maxPositionImpactFactorPositive": "0xf3bc0955f963d0405f9e49d759d533014c9d06e7e60049c1b11ad3cf51b02cd4", "maxPositionImpactFactorNegative": "0xe8584089e60a1fe0f7b9dfd3064915a786668ee667eaae8ab4344ce463488bbf", "maxPositionImpactFactorForLiquidations": "0x874f76b33cc43ca63e6bbbccf8d5c047081f0d93bc3c8969584c39c6502afbef", + "maxLendableImpactFactor": "0xfd3549353cae50095a9c0773319d142d01774ec32b1132b0160e55da5c4b4489", + "maxLendableImpactFactorForWithdrawals": "0xb2fe4bf7818c52e2efafc54a069ceb3ef1bff7e3268efd1ec1d4629f6b50b219", + "maxLendableImpactUsd": "0x5c585e7bdc935a88ba8ef289ff518c08d861a30adc519571656489406bb425ed", + "lentPositionImpactPoolAmount": "0x2a3c3512270776586d597030cbab06098af2f26b51fca00e5172aa14e922adf0", "minCollateralFactor": "0xffdda94c552e89c37aa851adc7a18e6bc47663010a27d83661a2e2fa8492ad71", + "minCollateralFactorForLiquidation": "0x3a606eb444659fc6d8703d1f4915560cd0e71813d3c824fbb4634c73002f3d62", "minCollateralFactorForOpenInterestLong": "0xcb36c8d66209bda963fcd3a7029ca669b114218607d825722851aa897eba7ee6", "minCollateralFactorForOpenInterestShort": "0x53c5a6626ef4a008718fb02907498f647eb955e8d2e9db15607b547a0e9e0d66", "positionImpactExponentFactor": "0x6a63ed472aa0faeb03e4fe460e669a1671d1ca63f2fdb32c39f1c11786c97460", - "swapFeeFactorForPositiveImpact": "0xea517b49e33c27e75463e484f6c8b1fa64d533a6148e33a64a825cce02e3c6ce", - "swapFeeFactorForNegativeImpact": "0xa7d5519d3e5d0ce9c05ec4df62c4b00339295007b40272ed1284c5a9e47bd77a", + "swapFeeFactorForBalanceWasImproved": "0xea517b49e33c27e75463e484f6c8b1fa64d533a6148e33a64a825cce02e3c6ce", + "swapFeeFactorForBalanceWasNotImproved": "0xa7d5519d3e5d0ce9c05ec4df62c4b00339295007b40272ed1284c5a9e47bd77a", "atomicSwapFeeFactor": "0xec0dc1c5be5c65cc62c6a41e7da4842a8b97475be0f2830a19705061d5d4c5f6", "swapImpactFactorPositive": "0x42aaaeae3f86b5e671a389d5b004816565f03a19ee4da5165ac22336d040cad2", "swapImpactFactorNegative": "0x33b9b4cb5a208b266e11de020970e508843c67544b51565d15e87b65c6aab0c1", @@ -3602,19 +3952,24 @@ "maxFundingFactorPerSecond": "0xb24d1a91550b99c973ce6afa96c6ab8b46696ae228ad5f7df4b9e79527211acc", "maxPnlFactorForTradersLong": "0x10abc2fb3642e6b77e373d7feb742ae7b4f43b8d165ccc63ed20cf7be3a38ff4", "maxPnlFactorForTradersShort": "0x36f7436deb57e87fb5231f1e926f3c374c28799403850aea708cc0a0b7a13be6", - "positionFeeFactorForPositiveImpact": "0x230d558789cdeaad85855af6d57dfb2579792b0e4bb659a8ca77e13403775717", - "positionFeeFactorForNegativeImpact": "0x85d3d3c8408ed4186fb1d31418526ce075322c262bd78196a82be5f47f263d5f", + "positionFeeFactorForBalanceWasImproved": "0x230d558789cdeaad85855af6d57dfb2579792b0e4bb659a8ca77e13403775717", + "positionFeeFactorForBalanceWasNotImproved": "0x85d3d3c8408ed4186fb1d31418526ce075322c262bd78196a82be5f47f263d5f", "positionImpactFactorPositive": "0xfb4ed8070ac47be8f9c3ce03faf5c8f0842e961739cd65e3b48883aa4adf73a1", "positionImpactFactorNegative": "0x14d2c5a86f041487eb054bdc08827a46d9eef3a079e8275e703ec0b3ac5d7639", "maxPositionImpactFactorPositive": "0xd13f53228e8d8bf025faddd4631cc12fd68e4d48f5aa750afad8589402adfa9a", "maxPositionImpactFactorNegative": "0x9c35cae350439063045993681f2c2e12a3e12aa11f77d56d357e3ceac618617c", "maxPositionImpactFactorForLiquidations": "0x814777913dda7bcd8fa344525f60a2b92045904645614e796279a2a12a91b43e", + "maxLendableImpactFactor": "0x0b27f7e85429e3bcdf576b39139a59b5f087b04e4c60934be6752d8650696937", + "maxLendableImpactFactorForWithdrawals": "0x0d78b77825c5c0319c860937d6e7913a1cddf33b55d54f3fa399403bc45469a5", + "maxLendableImpactUsd": "0xa0313f1f0a8838e9ed03e4b000d76d325bb4291f349abb20adbffe665b0df33d", + "lentPositionImpactPoolAmount": "0x82263be6ea01444d31e9f39fff7dbbd91e628f6df2038b89678be6f7f2af6a38", "minCollateralFactor": "0x8e3bed4f25e62e79d236e7ab4e5603e7622ef2eec8639585e4244725d8f409bd", + "minCollateralFactorForLiquidation": "0x67ae2314c7ad70da1afc2ff6bbc4ce36070db06a532137307b3949db7cdea89d", "minCollateralFactorForOpenInterestLong": "0x9b60006748c20ded25ebeb6cb5b8b4fa1637b243173d9721a4ccfbe3101e7de3", "minCollateralFactorForOpenInterestShort": "0x348e708289c489fd0cf6075ef11f4fbf37d202d578080b4cd5b8ca83b27d8dff", "positionImpactExponentFactor": "0x5069bbbb356975f0360cd8b8e434e3eef837db18168ba1a35726ab20805420b8", - "swapFeeFactorForPositiveImpact": "0x2870d390da5ab2fb9809a727bb1edabb063250342120237e7333410a6c0685c7", - "swapFeeFactorForNegativeImpact": "0x066947ada18828b53962d49069334357efc7942ad48f56a49ba67ad05f1492cd", + "swapFeeFactorForBalanceWasImproved": "0x2870d390da5ab2fb9809a727bb1edabb063250342120237e7333410a6c0685c7", + "swapFeeFactorForBalanceWasNotImproved": "0x066947ada18828b53962d49069334357efc7942ad48f56a49ba67ad05f1492cd", "atomicSwapFeeFactor": "0x412adb54031393da1f49f36232cc914b0d967448a86304b21c03b564fd61ed8e", "swapImpactFactorPositive": "0xbe6bf34b093a711520a573026f4af33708c3df6b22ab11fcb08a211a8f3651e8", "swapImpactFactorNegative": "0xa04e19482a64c2873c80eee75fd5e05a21ea68458c3c31ba6514ceb2e6683954", @@ -3653,19 +4008,24 @@ "maxFundingFactorPerSecond": "0x080d6f647980e27c4c29eb0fef0259e35b78776eb12952361b643a56d7467a88", "maxPnlFactorForTradersLong": "0x5b6bc87065748793b2c2f058783f46c620cb13862d8f7be9c625d32ad3ffb1aa", "maxPnlFactorForTradersShort": "0x5df3f831541534cfe8b567244ca81a1d1c17a339c5c44dd9ccf847dd420840ba", - "positionFeeFactorForPositiveImpact": "0xe52a6cdd4d02804ca2087972e592e75b4c8448296c882ec0a5bb57428684b465", - "positionFeeFactorForNegativeImpact": "0x8af552f6423c82c053f9f9a49d8976fc5bf979f90ffcfe60e48f75efe78159af", + "positionFeeFactorForBalanceWasImproved": "0xe52a6cdd4d02804ca2087972e592e75b4c8448296c882ec0a5bb57428684b465", + "positionFeeFactorForBalanceWasNotImproved": "0x8af552f6423c82c053f9f9a49d8976fc5bf979f90ffcfe60e48f75efe78159af", "positionImpactFactorPositive": "0xd4030afb92b751b6cd3e4c23d70e48accf8185636083706bc6544769347ac75b", "positionImpactFactorNegative": "0x4e56928b8af1c4dccfb8cc4fe83564a16bdbd4c86962b7cbd71ed3974d449937", "maxPositionImpactFactorPositive": "0x81474e9f281247217a132604837f1a17c01f9718727675aad11a63ff67d7f77e", "maxPositionImpactFactorNegative": "0x071ddcdc5940ce06318c56b5bdce3a27847f535f8f0eac190abca1a73af7d02f", "maxPositionImpactFactorForLiquidations": "0x65a71358652e1f3f1de3770fe7df2b8400da9e60f8d814ca9a4b13022bee2222", + "maxLendableImpactFactor": "0x4226bc69694625b88f1e7ba618f2b5278690afbd7d04d09cd6e3e56adb598b3a", + "maxLendableImpactFactorForWithdrawals": "0xa55ea1d8e2d40aabd5bb601806317bae810b955bba23d271d4d45c020248a957", + "maxLendableImpactUsd": "0x3121bf7b8abbe87c16343a7a6afae2aa37e63995a487ac70ac184789097a9bd8", + "lentPositionImpactPoolAmount": "0x28b49f2cc08c123626db4c83de6905cf697c14932854642d34ebe011ef8bfee6", "minCollateralFactor": "0x679fb485dc1559e6adc640756fe4740ee19dee07b8badd48976bdd28a87879e1", + "minCollateralFactorForLiquidation": "0xafc489671c1d4873473ecfcb310025d579c1c8ee4205d613c879338f160e3cd8", "minCollateralFactorForOpenInterestLong": "0x84677935537cfc967f4cc379eda203039e555599457a5abe92b8d3be4ff80edf", "minCollateralFactorForOpenInterestShort": "0x2d128850ff4630e5e64b78a9cc6f155791e11e268c1ee76a65a21a989aaeac95", "positionImpactExponentFactor": "0xa5c274264328d204dbd59ba0c0c702d8968334ba38a54e107124afaacad4e265", - "swapFeeFactorForPositiveImpact": "0x308a352f40b9c052ce7816de933a0a33bf97cc8e380329add568c24e7266721c", - "swapFeeFactorForNegativeImpact": "0x9f6e5823120af6d9685bdd76e8b3305529cf50e322b43f7741bd5e944250a6fb", + "swapFeeFactorForBalanceWasImproved": "0x308a352f40b9c052ce7816de933a0a33bf97cc8e380329add568c24e7266721c", + "swapFeeFactorForBalanceWasNotImproved": "0x9f6e5823120af6d9685bdd76e8b3305529cf50e322b43f7741bd5e944250a6fb", "atomicSwapFeeFactor": "0xb9c16ab0a352cd7cbdef66c7ec66d6f8c14b0d34563c4e7460065eecffb8422d", "swapImpactFactorPositive": "0x6e393cae4a648e5c019243aba3839b664048e7fe1cde4d352859420fd07959b4", "swapImpactFactorNegative": "0xc80a493f181476d72d586be4a7737108ccc7e4814d2219f4eff178a556f26fde", @@ -3704,19 +4064,24 @@ "maxFundingFactorPerSecond": "0xf41eed297201b32337b5015b04637412f8c7cf877d9207165824065b9ce12642", "maxPnlFactorForTradersLong": "0xed40a6622b17aa7f593f513d6c523e1394c152e8444f7d60fb9934ff0a0b3b36", "maxPnlFactorForTradersShort": "0x3fab9e7f459753e306a6757c56d8494284da59067b34a6dd4e52c4bcb218000c", - "positionFeeFactorForPositiveImpact": "0xab8c6a651eba9a48ac235d445205bbca5713698e9d67bb5ef0dc2f9426e6aa78", - "positionFeeFactorForNegativeImpact": "0x032ac540578f841c629bd3639d9e6d77baf2627b1904afafd787db565f967ecb", + "positionFeeFactorForBalanceWasImproved": "0xab8c6a651eba9a48ac235d445205bbca5713698e9d67bb5ef0dc2f9426e6aa78", + "positionFeeFactorForBalanceWasNotImproved": "0x032ac540578f841c629bd3639d9e6d77baf2627b1904afafd787db565f967ecb", "positionImpactFactorPositive": "0xedfc5f812a44c154869cc9f560a95108879fe5d9e62f9412566cc073e134fffd", "positionImpactFactorNegative": "0x354deb6c75877b955292480f888e8b3234e16f3f0925fe00ee8498a4d2ba2fae", "maxPositionImpactFactorPositive": "0x1eb9f2b1fe7a5cadc30bf113d195fea531766a1f93c49e2aa83237c6608dcc7b", "maxPositionImpactFactorNegative": "0xc82616a5adaf7157ed23d8b6e8bede28a99be8cb7856e8eefd9db0176ee5ac92", "maxPositionImpactFactorForLiquidations": "0x1a672707fd488daa1eb12975ace82f66a734b02e01aa1301289bd08f8b8f7879", + "maxLendableImpactFactor": "0x3cf17adf688ac44c780ab85febad2a468a583e3c3399a220e5e29d1a5e53a6ad", + "maxLendableImpactFactorForWithdrawals": "0xa6c9ede03fe1cd0adfb5e47772869d804d2fcf9c944a44174c1679abe50884ac", + "maxLendableImpactUsd": "0x3cfe77f5b4887aa393147fe72920ff17c49724b3469e887c91f257f6e35546b3", + "lentPositionImpactPoolAmount": "0x44714ed5ca4a8ed1b13348b9bc0e34c9045a5d7184c0d7e8ffa51b2716970a9f", "minCollateralFactor": "0x3fe844c40773c125c030590d8b180fc7e7eea4b4620fc68b8933bffaa4c67b4a", + "minCollateralFactorForLiquidation": "0xb44f4b78ba17e0d1eff6125cbed7f5c6818e596f01fcd6aab2e739addb731706", "minCollateralFactorForOpenInterestLong": "0x6e86a14a179aecf4b9c5d905c249fb4e36fcdaa1976cbaf81acccc340311036d", "minCollateralFactorForOpenInterestShort": "0xe4d366912356c807f7849ae1df3147f1e7d208e9fc57e01fa4c2013876d14b79", "positionImpactExponentFactor": "0xa3bd98ef7c63272fec0aae30edea3e455dd7d50b81934602367f7325466365d5", - "swapFeeFactorForPositiveImpact": "0x13b14819e4af67beb4e9eebd58f4f859b45e51fd720169f4875c52069eaa93eb", - "swapFeeFactorForNegativeImpact": "0x041dd49ae33ca7961f20bb8147d5da1eb80300c220f91b5bf5acc56d5ae6aba8", + "swapFeeFactorForBalanceWasImproved": "0x13b14819e4af67beb4e9eebd58f4f859b45e51fd720169f4875c52069eaa93eb", + "swapFeeFactorForBalanceWasNotImproved": "0x041dd49ae33ca7961f20bb8147d5da1eb80300c220f91b5bf5acc56d5ae6aba8", "atomicSwapFeeFactor": "0x86de7a3b9168b9558a4e968927972ae16bca2c45c79f3c6582d82ac1bd287cd0", "swapImpactFactorPositive": "0x3d6d4c367caf6195e2e17ccc844e61bfa11362e807edb31ed40c950aa0778457", "swapImpactFactorNegative": "0x630de465fa6597dfddf3012c25720bad36ddc1f3887a52037a864fb66dc66366", @@ -3755,19 +4120,24 @@ "maxFundingFactorPerSecond": "0x9100124446cae7a4786e50ca6761bdf352fc6a3d3204f14e120094302af3f3be", "maxPnlFactorForTradersLong": "0x91d5ef2c1dfd5cdeaccda6be41c0e81b5ff5ca1cc70b18964d8838371a1e8b8f", "maxPnlFactorForTradersShort": "0xc2e47e1d5f976a489e1e02f890681e390a7dbbb1a75c22b20e8b96fac15f6b7c", - "positionFeeFactorForPositiveImpact": "0x17a1a4c5c12a42f5051a147fc90f77a01c548f6fcac70763eabbbda3a65cdd65", - "positionFeeFactorForNegativeImpact": "0x76fe7348053bd8f758cd8e4789c39906eeb5d5ce84205afdd1eb44a7a975a9c7", + "positionFeeFactorForBalanceWasImproved": "0x17a1a4c5c12a42f5051a147fc90f77a01c548f6fcac70763eabbbda3a65cdd65", + "positionFeeFactorForBalanceWasNotImproved": "0x76fe7348053bd8f758cd8e4789c39906eeb5d5ce84205afdd1eb44a7a975a9c7", "positionImpactFactorPositive": "0x64da39f22293431948db7537bad61f51ad1777bf4d4d6d4530bffcb919749832", "positionImpactFactorNegative": "0xeb28da7fbe5a9e66cfaa0e19a9cfa3f394112a3fa0f8faee75b2f47ac283675a", "maxPositionImpactFactorPositive": "0x7420c427b32409f5e82da6c15ead871dd919fcf1e1e92f384802d5bdb4e8c8f7", "maxPositionImpactFactorNegative": "0x8503fee7cf10b36db3a5563c313bc4517f5165f26a758cc0017f9ed63275fbbd", "maxPositionImpactFactorForLiquidations": "0x95f09f9b51350da41df77fc76f4eee0a9d0463e1594b8cc5f7370edddb01cd61", + "maxLendableImpactFactor": "0x770b5fe74d57ef3470e215fa854ee1d1e5b2e48cd5701bd56221ccbd0f5ff5c0", + "maxLendableImpactFactorForWithdrawals": "0x73ca53f0d77d24492d2fdc72f88e69576692534e1a53e82437e377791579753c", + "maxLendableImpactUsd": "0x6d40bb81b7f7cadac5717511628028b36e524c0c2fa42bca0262e3f36d2f0d3d", + "lentPositionImpactPoolAmount": "0xd2289eb77c6bc9daa9a7b0bb542da8b9072890647fa75d6744b71e942e3ba512", "minCollateralFactor": "0x477063fcf3dcb2f7f5ea4dbfa8ebd08b75668e951d64c79c207fe225a1c7d3bc", + "minCollateralFactorForLiquidation": "0xca1ade249503a15c4b948131034294456c5786080676a30a2316606becce1605", "minCollateralFactorForOpenInterestLong": "0xc28f780855330cd16102ba6fdb7ab47699efa33c0df3fcef42a44026ab9cceac", "minCollateralFactorForOpenInterestShort": "0x563eda60ad895862bb3e4b14cfeb79a20588ff0aa5e3d5bdfb2ac34f5e66d398", "positionImpactExponentFactor": "0x3db4ca02007d0bcac3d2f0cfd17c0750e24ba25b8c5eed37cf4cc5eca26ad574", - "swapFeeFactorForPositiveImpact": "0x1f03c21ebeb7b5ec284e3daaecc7cee0e823b4de3dc555fb313bc64f6e1b85fc", - "swapFeeFactorForNegativeImpact": "0x79d8564cf98ebc7211cbbb5b36fa9ec46a18bf9b41c3b3ecedfd3adacbd145dd", + "swapFeeFactorForBalanceWasImproved": "0x1f03c21ebeb7b5ec284e3daaecc7cee0e823b4de3dc555fb313bc64f6e1b85fc", + "swapFeeFactorForBalanceWasNotImproved": "0x79d8564cf98ebc7211cbbb5b36fa9ec46a18bf9b41c3b3ecedfd3adacbd145dd", "atomicSwapFeeFactor": "0x9ef96e052a9f2aaab829e2a1ef21cc3e919165b44193e112a554f2a07991f25c", "swapImpactFactorPositive": "0x64e9abf3ebedf7ff2796a8a5fa366a70364fcd4f119fb9d15666e657f73eb729", "swapImpactFactorNegative": "0x2e08c5b1453619c4951c31850c9f89a154d538c544a90b73e73ba2ef063c9f17", @@ -3806,19 +4176,24 @@ "maxFundingFactorPerSecond": "0xfd17448b7052a0f4b2202a701bca57f6b687c5a0b7dadbebfd8279f57ddde32c", "maxPnlFactorForTradersLong": "0xbd4594835ab977699226e141d169ebf31221364cb1e8c00ea02158785a1bd1e2", "maxPnlFactorForTradersShort": "0x55bc4828ede3e74ebbf0451569d6e312d1109fe3e9a6bc5e40f2699cab82b71c", - "positionFeeFactorForPositiveImpact": "0x1c2b58fd5a66982e684fc09abb9ddb006bbb7bd04b22776103837b4d22fb88dc", - "positionFeeFactorForNegativeImpact": "0xfd77db7cb72af668ba7025a65dd934661476da45b8c10e28be6932247f634c66", + "positionFeeFactorForBalanceWasImproved": "0x1c2b58fd5a66982e684fc09abb9ddb006bbb7bd04b22776103837b4d22fb88dc", + "positionFeeFactorForBalanceWasNotImproved": "0xfd77db7cb72af668ba7025a65dd934661476da45b8c10e28be6932247f634c66", "positionImpactFactorPositive": "0x7baa57849b07319aaf8c28e1b5d5212e6a673612f5769a366628a21473d4bbce", "positionImpactFactorNegative": "0xba9cad4f66ee0de01e2762feedf92579733e81433bc367ab173a6d69bf710416", "maxPositionImpactFactorPositive": "0xe82f4b73da79de37c6d8828c855bc39363701137c4aafac1e50dddfb3a9841cc", "maxPositionImpactFactorNegative": "0xe66a60afb8061060957daf068784bab70e61cd6bb1ead11c3f81d4e60551076c", "maxPositionImpactFactorForLiquidations": "0xeca113ccf913f2b135ffc65612d8208716cc437352f94db4492778dbec26b3b7", + "maxLendableImpactFactor": "0xdd2a640ded519663fd6dcd0d0773556890b0bea71d5994f57ca2ae98995b007d", + "maxLendableImpactFactorForWithdrawals": "0x018bbb9224779541e9138199e7c2af6b2bbe8e1df422f70d261d08d983ca2c4b", + "maxLendableImpactUsd": "0xec2b1eab979e1acb5a68262c3c4e05ade1c5c5e7fa8d22e772a4c81b72cfb004", + "lentPositionImpactPoolAmount": "0xfad1d8649ac5eedbd8b7f1f8a8cf4c54120de09efb9bc37a7e0313192bc2300b", "minCollateralFactor": "0x66de3ebde9679ad0d1d7422384e7668a59308642f21b6ed99843bc6333dcfdbd", + "minCollateralFactorForLiquidation": "0xe5ff50ac9a0dfb0d5599b53e9c969ee858db161395ec92307f20922bc708557f", "minCollateralFactorForOpenInterestLong": "0x979afa01e39a53a0ee59cb19c28a83db1f5ecddcf336a44541738671ea529f07", "minCollateralFactorForOpenInterestShort": "0x6bd77d36ae31370d9b5b25f1b1a1301f9af23bfb9b7afbe1a76a2575570499ad", "positionImpactExponentFactor": "0x94c1d7ae56d6ee75a8fd07d00a806ad9f19aca4164c883661e618f7bc589c887", - "swapFeeFactorForPositiveImpact": "0xfda93cb94b8c430cc2c6a1e727953c276b7f78004466a98723415dc018dfca6d", - "swapFeeFactorForNegativeImpact": "0xaac48c0c555c2263a72df8ed6ebb170df9a43485c970f655c433dd9bca37c935", + "swapFeeFactorForBalanceWasImproved": "0xfda93cb94b8c430cc2c6a1e727953c276b7f78004466a98723415dc018dfca6d", + "swapFeeFactorForBalanceWasNotImproved": "0xaac48c0c555c2263a72df8ed6ebb170df9a43485c970f655c433dd9bca37c935", "atomicSwapFeeFactor": "0x8628ddab301e77531e29770e6c0b85c34631783ca617e9ee2e618c086f3005bc", "swapImpactFactorPositive": "0x380f0aa935578c5e2efc586f4286a0954ecb8de9f0841a9369d5577638949f0b", "swapImpactFactorNegative": "0x24a92c575b4320d859d42a38cd8c94af9b78339d66e79ecb7423c253d8bc732e", @@ -3857,19 +4232,24 @@ "maxFundingFactorPerSecond": "0x1fdb4813d9578c34eba7d40e8be3385373c685a85ba9d2937a79ca54b533f862", "maxPnlFactorForTradersLong": "0xcdea350cca22a37c0bee2fba1a00922504ebd7ecad69e18d81ebfe1cff20bc3f", "maxPnlFactorForTradersShort": "0x16ccdaa5770845bf1770f898bb130a218207a1abfd694b328cbca0447eefb23c", - "positionFeeFactorForPositiveImpact": "0xf89efb2df265c4bda64726efa91d82dfe2447cc6e1982d0a5df80b1a6c98e7bb", - "positionFeeFactorForNegativeImpact": "0x094f55fa807320bc8c19374bf714f9e2fc2eb9909953c31a142756810ed90bbf", + "positionFeeFactorForBalanceWasImproved": "0xf89efb2df265c4bda64726efa91d82dfe2447cc6e1982d0a5df80b1a6c98e7bb", + "positionFeeFactorForBalanceWasNotImproved": "0x094f55fa807320bc8c19374bf714f9e2fc2eb9909953c31a142756810ed90bbf", "positionImpactFactorPositive": "0xa1c42743459cc18584470bd7fcf394f287cbcd2426ee98e16b750c0cbe1843a9", "positionImpactFactorNegative": "0xff8af72e7c6be7bfbf7ebd7235d6610b6495c46ab493997b3e98e6e8c31b8a02", "maxPositionImpactFactorPositive": "0xd26604e096680008907eda5411c8f65b79e898f7fced8f2e8f3aeb2e113b2146", "maxPositionImpactFactorNegative": "0x78f8535809a6190aeef4e5fadd69800c7662133aaa6bf621f4acfc377ab01935", "maxPositionImpactFactorForLiquidations": "0x551b4069fdca4d0563164496a8b8865893dc2ebb3644af484c0ac7b5a6d9b382", + "maxLendableImpactFactor": "0x5515c68b6615a33d29c833a177c28e83eefa8d37359eadefe7f40cc4cf5e931b", + "maxLendableImpactFactorForWithdrawals": "0x523659400dbe19d15727217bcb08130ee6d223c198d685fface935b1860f2b0e", + "maxLendableImpactUsd": "0xc2bd44e6d3d1beb409b79733a13f2a124b59942c2ecd9f332ac4759623649a5b", + "lentPositionImpactPoolAmount": "0x8f5e9f8ab5f62683773f0547487f67d30d5e82dd4fceca41f857e9d994f199c0", "minCollateralFactor": "0xaea2afd33c6d2466b226b95971101b0250e5a558466f3e688135e606529cdea1", + "minCollateralFactorForLiquidation": "0xa65f72041f4bc42656406438eabaeb3a83e9f4f38aae62c9ff8235d0e81a7910", "minCollateralFactorForOpenInterestLong": "0xc425f5ca4051c07b0ef0a474ce087918aff548677159081ce684e1832a0dbfe0", "minCollateralFactorForOpenInterestShort": "0x6bbbbf6814e4de22856022d7020a208a63c369ae1fea354d25df0ff0deb385c6", "positionImpactExponentFactor": "0x528ceff820b2cc4de63f384e46d279050c14c12bbe069780248ca35209c7aa98", - "swapFeeFactorForPositiveImpact": "0xce4933def7de695772ebb91c5f48e74ddb76b3948fad48b878dd02ba9caec3f5", - "swapFeeFactorForNegativeImpact": "0x98ead5e154c29c07125c1e4e8cf110f5a0419cc47ddd938b394d97e787fa587c", + "swapFeeFactorForBalanceWasImproved": "0xce4933def7de695772ebb91c5f48e74ddb76b3948fad48b878dd02ba9caec3f5", + "swapFeeFactorForBalanceWasNotImproved": "0x98ead5e154c29c07125c1e4e8cf110f5a0419cc47ddd938b394d97e787fa587c", "atomicSwapFeeFactor": "0x07eb2d60889510925c10701aa6384befe1dd08bb022b06557431c4910710f550", "swapImpactFactorPositive": "0xde03a55a07d901e98210970ac22f0cdf4cb6bfa89ac97a87aeb924e7382d4d8c", "swapImpactFactorNegative": "0x295a64c0d9cccfd469c2db10ea4fa9661c3c1630db9f753eb6d33eb59a7c34d4", @@ -3908,19 +4288,24 @@ "maxFundingFactorPerSecond": "0x3d07c1c798dda7f35e115b1f7b3294455811db0f6b332105e6cd7640ed8d2979", "maxPnlFactorForTradersLong": "0x0643ab82acd1da935dccdca596b2467d15a15578392c8c1830c74d95cdf56bb5", "maxPnlFactorForTradersShort": "0x161cd5203040492bf6c154ee5a97667b266446a4a5ca70282f126ecd7616f1ba", - "positionFeeFactorForPositiveImpact": "0xa2642d8d9d5fb8e2ac0409d2db33e187719016ff7bf134045ae6182666bb05b8", - "positionFeeFactorForNegativeImpact": "0x23dcc4cd943557ef8ccebe9232754e9ffde52c137f085598ac91e7192a17ac59", + "positionFeeFactorForBalanceWasImproved": "0xa2642d8d9d5fb8e2ac0409d2db33e187719016ff7bf134045ae6182666bb05b8", + "positionFeeFactorForBalanceWasNotImproved": "0x23dcc4cd943557ef8ccebe9232754e9ffde52c137f085598ac91e7192a17ac59", "positionImpactFactorPositive": "0x6c77776d5e1445193adfe5b04337025ffcf54bdb11679bf34d87f421df699ec5", "positionImpactFactorNegative": "0x2565ee54946347b057bf1b32306485f036062453defc85ae44d043c9cff511c4", "maxPositionImpactFactorPositive": "0x1b5120ca944c5a33e540a1c6e406b523ce921000a984f97f95fa699d520cb7ed", "maxPositionImpactFactorNegative": "0x5296af9bb7d06b0cd08eb201218d7f1e6a2329be82fe448fdfd8b8fc39fa68a1", "maxPositionImpactFactorForLiquidations": "0xfe947f5fc6293d31166df3a75f524470845c7eeef041f8a2e420a094c3fac1cc", + "maxLendableImpactFactor": "0x0b0cf71a890beba3339150e4fce46b7790a1c75866ad17f049fa099046b1ecbf", + "maxLendableImpactFactorForWithdrawals": "0x39a407d8a89a525883f3f891a6ec25ffbe79da171cef45694bf1899c75f37fba", + "maxLendableImpactUsd": "0x5b55fff0d750ba099a6b448ed89defc38c817f3b5ea1a51b1e7c1159ea229250", + "lentPositionImpactPoolAmount": "0x7f747d0cf67f5b29218c28a4cc2d396981138a51c76a4d8ba6db2b8599352bc3", "minCollateralFactor": "0x0265939bb7d88fea6fff26636a6858305b038871546f1414e5701ad669d5dc1a", + "minCollateralFactorForLiquidation": "0xca9593cfa0c874962f22b8bb702032807b9427579010b042670806b64ab2df34", "minCollateralFactorForOpenInterestLong": "0x50d84922790ede06558e4ca6f2e96902c570c45e4f427cc6fcccdd32dddfecad", "minCollateralFactorForOpenInterestShort": "0xef11b410c5d53d8e576c956acea505ed667e5d34bb227625e99d6514bc07de92", "positionImpactExponentFactor": "0xbbea29388c648439a26a387b35619908b6b708893ec6e3555a1f26de057e27ea", - "swapFeeFactorForPositiveImpact": "0x8ef96c28cee73d45619581b8a28340afbb3e3f7d496d55e1ca67286de61e5f95", - "swapFeeFactorForNegativeImpact": "0xdf8618a78eede905a9aaa8a5ae18211a6a6bdb3737d54f794c8a999f091c0729", + "swapFeeFactorForBalanceWasImproved": "0x8ef96c28cee73d45619581b8a28340afbb3e3f7d496d55e1ca67286de61e5f95", + "swapFeeFactorForBalanceWasNotImproved": "0xdf8618a78eede905a9aaa8a5ae18211a6a6bdb3737d54f794c8a999f091c0729", "atomicSwapFeeFactor": "0x3989f95dc50e51405be5cd609ce63faeb462947821d280425454f5fff74809e4", "swapImpactFactorPositive": "0x77668158274b0da81643c91786fdaa3d98c20ae3ed3bef765d11798b06b5f5d8", "swapImpactFactorNegative": "0xb4e19689f59f1f7a32a01249c2fce76b3af38202f0259d90af683019f13690a3", @@ -3959,19 +4344,24 @@ "maxFundingFactorPerSecond": "0xc4150965d758d86afdcb22b1c6849fa84e8966c11a134af851b682fddf33e4a6", "maxPnlFactorForTradersLong": "0xf3320cdc63c3a7d6f78ad9986ddb409c5134677e3ad4a0174891020a22b24fb4", "maxPnlFactorForTradersShort": "0x228b126e5894d16fa46757d3a5a5b6d5710a5b23ea94753de3f9737c4d2c5b9a", - "positionFeeFactorForPositiveImpact": "0x19a2a68bdbc66fa5dc4851a9378ede85ccdafe9acb99e62c017676872e343a6b", - "positionFeeFactorForNegativeImpact": "0xd8d7ebb0ecd47d813c8dadf9c1af95bfe460bf83fc2315e7c4ce9f6d63f128c2", + "positionFeeFactorForBalanceWasImproved": "0x19a2a68bdbc66fa5dc4851a9378ede85ccdafe9acb99e62c017676872e343a6b", + "positionFeeFactorForBalanceWasNotImproved": "0xd8d7ebb0ecd47d813c8dadf9c1af95bfe460bf83fc2315e7c4ce9f6d63f128c2", "positionImpactFactorPositive": "0x85203630052949e2750737f79f8d56725368a5c53228abbd1afe481db132006a", "positionImpactFactorNegative": "0x1e7f9610ae2f0862b2ec16dd348ba826566595be72f4492f52ff26c34d673622", "maxPositionImpactFactorPositive": "0x2de659890a4e8d1963570ff9b59d26e46be9b33cf7e136aacfcb2bb200550ccc", "maxPositionImpactFactorNegative": "0xc1bea97710f8e10627534a240eee6f82cd830e63d7b2c2dbd76556ea4fd033f7", "maxPositionImpactFactorForLiquidations": "0xf63f2b50f2ecdaa28b16771a42a2b5cd380e09f6de782cecb71e839cdc32f851", + "maxLendableImpactFactor": "0x07a3c676f0db6db3d8db26ff2fc47883d483091dccac5fce69b3c09a9b37808d", + "maxLendableImpactFactorForWithdrawals": "0xdfb2ca3011540b213a14ddf383ba4ed001f3d1ee172ab3f00b9ee5d376a363e6", + "maxLendableImpactUsd": "0x6b9b187296c4c45699c8b5fab9955585b18a428f093ffad2f06784a62a338e1c", + "lentPositionImpactPoolAmount": "0xbb1e96fafb49ae815aaf7feddc6be0f4b1663c66c5db81071b7e5b01391dcaa1", "minCollateralFactor": "0xfb841e5374643d23b05f191cc2f0e1148808a7f71da91675b9a3d8c64b016544", + "minCollateralFactorForLiquidation": "0xd2e092583c07aa062aed1369c062d31719a80ff6e75d84ddc76b5e6bc7826054", "minCollateralFactorForOpenInterestLong": "0x6d7fcd1f8264f3f59c707af933ec7782df25287b0b6b5f420a319b58b4886f7c", "minCollateralFactorForOpenInterestShort": "0xb605b4ef503f9544c442f94b2ac131cf5ee8da1d4e1316784bb9d7cce6d79138", "positionImpactExponentFactor": "0x5d9ed32420efc0bcbf1596941636a999f62042da229abce2fdd8c931da675f9f", - "swapFeeFactorForPositiveImpact": "0x062c0c2d730d24aa33c37d80bb065f727dbd4301b42a39c8d2459487d066749c", - "swapFeeFactorForNegativeImpact": "0x00a2196092d604bf9fc2ea751e06405e37f231e0fff627ce7be4cabc40bf6ca9", + "swapFeeFactorForBalanceWasImproved": "0x062c0c2d730d24aa33c37d80bb065f727dbd4301b42a39c8d2459487d066749c", + "swapFeeFactorForBalanceWasNotImproved": "0x00a2196092d604bf9fc2ea751e06405e37f231e0fff627ce7be4cabc40bf6ca9", "atomicSwapFeeFactor": "0xaa8b5f5925e8ddcab441df093f783c1d1c83bfac7ca60f14b8bc3b84c012f08d", "swapImpactFactorPositive": "0xe317742a7019bf37820ea41ad199bdf4a6252562c7fe43a71abfce8e85ab80da", "swapImpactFactorNegative": "0xa8e910e7748bd5c02441c6d1c9a77e48c61af20a8e089b02a61a90f7b6678acc", @@ -4010,19 +4400,24 @@ "maxFundingFactorPerSecond": "0xfa6364fb56a11345b92d4983b9bd8ea66cacd614eb3b7520137399f55d354b09", "maxPnlFactorForTradersLong": "0x13a27a353c7776ef31a2a496bec36eb5dfb23d8dcdde1c4873ac3c1e35e4313e", "maxPnlFactorForTradersShort": "0x0b3a39ad3f7d8d1ae1a553ad21654b2fcfd1e55feb8c3efecdf91d53200b45c4", - "positionFeeFactorForPositiveImpact": "0xfa2c3a7f66301b3059290169c87e11fb20c062c65383b5740c7d3b090bc98e04", - "positionFeeFactorForNegativeImpact": "0xd3ebf9538ef9ea88d6f7ef51523bc2cf6669cb01aee98f1de1fec0fa53b4eda9", + "positionFeeFactorForBalanceWasImproved": "0xfa2c3a7f66301b3059290169c87e11fb20c062c65383b5740c7d3b090bc98e04", + "positionFeeFactorForBalanceWasNotImproved": "0xd3ebf9538ef9ea88d6f7ef51523bc2cf6669cb01aee98f1de1fec0fa53b4eda9", "positionImpactFactorPositive": "0x3daf5ba49e3d385f7036de1ad15a6a638d9dd0a17a2cb765e1d772d5dcd7a91e", "positionImpactFactorNegative": "0xbe0d09f14005110d076128a12f6a0f4cc2ed5f0048479ee1d1d2658480d07c11", "maxPositionImpactFactorPositive": "0x07e3c045a079b6ba9dc07038336e09bce8c716941b675d352a7b05ba5b59ce60", "maxPositionImpactFactorNegative": "0x84e0600c16972b29f7da354d54020464629310f597f791a8dabe846828986384", "maxPositionImpactFactorForLiquidations": "0xfa799d4aacb60572cdac1ee643f9cd39f700a4b389b24222533c7364f308f5be", + "maxLendableImpactFactor": "0x21318669980e0bda8d54714e965f58fd6fee60aefe7a00084c3d2e72029d9057", + "maxLendableImpactFactorForWithdrawals": "0x98cadb0d1b4caa4c04ce0fc916b0616d3cbf8d94fe8191190485c40f926b1040", + "maxLendableImpactUsd": "0x552b8ab97c40de451e32f563871104f2a3bd6cb004f97bb20d14811feffd9cac", + "lentPositionImpactPoolAmount": "0xaccf2cb5694b087908d4e6919f53fb8138036e52d2817ad19bfb412c875cdcff", "minCollateralFactor": "0x3a6062579846cca4b922db1cf9688c3f8f090eb5448600fc904bdf4b4b72bd22", + "minCollateralFactorForLiquidation": "0xabcb9f7c66df854a36c97a3cb49e635446fb7a3c56f8ab8b55b39f68d12aafd1", "minCollateralFactorForOpenInterestLong": "0x94a978d635ef737465b195eec16b7f19c6f1bff0017c978ca61a17e5fe8b7808", "minCollateralFactorForOpenInterestShort": "0x2688ed464f128f747c02828d429a6aa3dccb40e2071454408f3296fbd87a16ec", "positionImpactExponentFactor": "0xae78eeb8d250d69bc9255def1e262c819c19b3aac6ed2626248730ada04b108a", - "swapFeeFactorForPositiveImpact": "0x50bf015e1af753131c148a7f0b5a8de5e482f08b30460d48e358105925cff626", - "swapFeeFactorForNegativeImpact": "0xe248339af6d57cabcbf56a435449881c63af9318e4a9248d8d230f1596d112cb", + "swapFeeFactorForBalanceWasImproved": "0x50bf015e1af753131c148a7f0b5a8de5e482f08b30460d48e358105925cff626", + "swapFeeFactorForBalanceWasNotImproved": "0xe248339af6d57cabcbf56a435449881c63af9318e4a9248d8d230f1596d112cb", "atomicSwapFeeFactor": "0xa3fa7dc8862b484cb29feed8cfe4dbf7538e686228f907b5d4d7024ea5aa1c3d", "swapImpactFactorPositive": "0x1404bcb3b37fd6c73c429f0b67f0326ab072e3ed1c832a41cb8b3ed7eaf9047d", "swapImpactFactorNegative": "0x5b5cb62ae90c344158744facbd2041a7a9fe2104d068c90945d76de7c5d7fc7b", @@ -4061,19 +4456,24 @@ "maxFundingFactorPerSecond": "0xeae47123e370dddf6c9579930918a34f59c44b9945b68afb8a693a9444b9e6ac", "maxPnlFactorForTradersLong": "0x5bc743b0161813f436c45d2bc88a64de29d05cd30d9c1f6e1924f0b138328f57", "maxPnlFactorForTradersShort": "0xf95dd4ff89517f2fb139ba5f72e2b18bf7aa6ce454abbde2e24678c5e8c826e1", - "positionFeeFactorForPositiveImpact": "0xbbaa199810a58a8b632296eac0daae34a5f24fdf8013d5ecb0c269f5e9fd4430", - "positionFeeFactorForNegativeImpact": "0x668119f4388e461b52d33b9119d5fe66bab6e1612657d134841606b722fe5e21", + "positionFeeFactorForBalanceWasImproved": "0xbbaa199810a58a8b632296eac0daae34a5f24fdf8013d5ecb0c269f5e9fd4430", + "positionFeeFactorForBalanceWasNotImproved": "0x668119f4388e461b52d33b9119d5fe66bab6e1612657d134841606b722fe5e21", "positionImpactFactorPositive": "0x82d8a24ed60b8b954daaaa4afae9b80786c1a1d3524000b6e8fa2616c79af74a", "positionImpactFactorNegative": "0x8337e01de60f85dc0a20a5f6c2e0bdc5e8bfcdaf3ac72583acc8a80b1ebeec32", "maxPositionImpactFactorPositive": "0x2a25ce604cef5d4243bebc4f18af4f6387cbbcd46d1293e23fdfe810cd6854b9", "maxPositionImpactFactorNegative": "0x9a452777e6806271ad8cc47d6d8bd0a79dcde5bba1bf5fdb99b0c9056a752510", "maxPositionImpactFactorForLiquidations": "0xb4e94d1b92745024b727c7bcedcd895ed2e00e2ea2ccaf2eb37d50cc590131cf", + "maxLendableImpactFactor": "0x611a5706038f2743efbc3edfa3297c04acdf89cd037ac3e53652d6517659970b", + "maxLendableImpactFactorForWithdrawals": "0x84fb403374fc081fb547f1949582e0a12f3799f450b3be23e5d405da7e0f21ee", + "maxLendableImpactUsd": "0xb87743d8a51c6b26e2392bbbab800e130e3508cd359a5b592c70c6234b90adc1", + "lentPositionImpactPoolAmount": "0xf06057d3ae9088b458bc78d76f06e31965e631e1e38671ec6a45ca9d38983cd9", "minCollateralFactor": "0x0aa8885df89de8ff34563554e6069a4ad8949cd4e6f77d4e7e5fc6eed353b721", + "minCollateralFactorForLiquidation": "0xce9ba90c380212578833d426e036da7abf6c564caa45e126e5c9f3af3f39727a", "minCollateralFactorForOpenInterestLong": "0x4434267baa673353b931f72b997d623a8dbb24ad019fb1012b523e3445a9b522", "minCollateralFactorForOpenInterestShort": "0x6b1db050ad4883d52b32633aa49159bddd02262af4439b457a32cdcc5988fd43", "positionImpactExponentFactor": "0x79bfdbb2346f830a4c8d80f29a006b0baa9367418902e8b3c93a1213c9eed125", - "swapFeeFactorForPositiveImpact": "0x0faa1337b525b28e6422cd472df6548c0da443bc9077ed0fe6fa694f8ee772c7", - "swapFeeFactorForNegativeImpact": "0xf9975025f98c1742bafc5964493e42785f56e6673592097971feb7aba4729a0b", + "swapFeeFactorForBalanceWasImproved": "0x0faa1337b525b28e6422cd472df6548c0da443bc9077ed0fe6fa694f8ee772c7", + "swapFeeFactorForBalanceWasNotImproved": "0xf9975025f98c1742bafc5964493e42785f56e6673592097971feb7aba4729a0b", "atomicSwapFeeFactor": "0x12fc02d199272ac56852e8a778bf732653628467efe2892262314456f4dbea18", "swapImpactFactorPositive": "0x107517ca8068a2882de0bab37ab86b35e91cfd63473089cacda01bc81f1c7daa", "swapImpactFactorNegative": "0x1e7d0f85278824210a3ce74721f888e34dee24c518278d80952dc9f1024b7f65", @@ -4112,19 +4512,24 @@ "maxFundingFactorPerSecond": "0x0fe3f71d3f4e380ac4bd1d45ec26be57ea2ec86a9e893c45e824fddb3233e5a5", "maxPnlFactorForTradersLong": "0xd9ccc9e84419059f691fdd180aecb410ad79540c2cafa902da62d54128d754e1", "maxPnlFactorForTradersShort": "0x88354aedfe906b9fb49ba2f728bfd0ddd470c9a1cc85cc055f0d716a3f2f54fb", - "positionFeeFactorForPositiveImpact": "0x5e34672fc4f42ab23d23213fa1d40cebe0a3e7bcf87eb11b76d2fcc1be32e252", - "positionFeeFactorForNegativeImpact": "0xf8e3dafc3f767e6295802eac15d1b04db4698328bcc74af85b81335b8ff21c99", + "positionFeeFactorForBalanceWasImproved": "0x5e34672fc4f42ab23d23213fa1d40cebe0a3e7bcf87eb11b76d2fcc1be32e252", + "positionFeeFactorForBalanceWasNotImproved": "0xf8e3dafc3f767e6295802eac15d1b04db4698328bcc74af85b81335b8ff21c99", "positionImpactFactorPositive": "0xff8e09a7151d33fcf5165e2ccf6ac14c30d229f18ee3a60a95abf260d1d243ac", "positionImpactFactorNegative": "0xed76416203eb5df0eae69591d057f2870fc448171a7e014906c629b9e71cda12", "maxPositionImpactFactorPositive": "0x5dae48e6dfe9c144cd58a6e4b90c070ef559116c76518323bed64e54cb43c85f", "maxPositionImpactFactorNegative": "0xf43b9ca73005afa930d529a7b5e512a0b072819f3addcdbf14fdd3c65835f385", "maxPositionImpactFactorForLiquidations": "0x63855710f19d2605d4dc599aac16e0d6240b8336befa7f7f0f0de89ca8fe48f4", + "maxLendableImpactFactor": "0xfb808e24c79a656df31ffd89dd51ea2faeda1bc9041f5b300080910bff27aead", + "maxLendableImpactFactorForWithdrawals": "0x970aca94d332873ab727b59cf55588a44f00b9007e4bde414002310939e8b72d", + "maxLendableImpactUsd": "0xce9f727834e2984c9a690e0cb55e001ee641c931895c37ce30dbdeb49f4d3085", + "lentPositionImpactPoolAmount": "0x4b22937fd39d48f629239894ad419f0a1622516fffb17e9d100dbdf808955cce", "minCollateralFactor": "0xb10b7742e2b3281b2f4c6c986ee610bdaae744a102b587ed040bd5a26d0cfcf6", + "minCollateralFactorForLiquidation": "0x54898fae937ffecc11f45b346e2c2d31190475b9cc7829e2801c3bd2aedf7953", "minCollateralFactorForOpenInterestLong": "0x24d067bde87a33817afba6f9159b1f879be5f907de489107e0e32433665c7c1d", "minCollateralFactorForOpenInterestShort": "0x970902c830d69c75cf173a1493daf4144604122b2f7b75fe359cbe15ea3dcd4d", "positionImpactExponentFactor": "0x099e85a8f05448a4731818fa874d8796b78a9a46cc87197eef4bb972b10e456a", - "swapFeeFactorForPositiveImpact": "0x440a965a2877911c4c99d8a22338d137721fc202a2d1e7ca75cdc9f094ba65b0", - "swapFeeFactorForNegativeImpact": "0xc926687ddd09ffe9ac71036d2dc7f560dc5b6ec92d888c1cf3e6195288dd6e80", + "swapFeeFactorForBalanceWasImproved": "0x440a965a2877911c4c99d8a22338d137721fc202a2d1e7ca75cdc9f094ba65b0", + "swapFeeFactorForBalanceWasNotImproved": "0xc926687ddd09ffe9ac71036d2dc7f560dc5b6ec92d888c1cf3e6195288dd6e80", "atomicSwapFeeFactor": "0x7a0ebfae0537a6ec5958b1455006293dfae06de26368232249a3abdb986ab98f", "swapImpactFactorPositive": "0xa49e8eda8b34c14886ad044ddd88d3fa227afc72878a3c40e5d79a9528d0828a", "swapImpactFactorNegative": "0x5faab11fcfbefb319520e36256399baa608cde5c8dd19f2ca05aedf022d92b60", @@ -4163,19 +4568,24 @@ "maxFundingFactorPerSecond": "0xa8772b6fe3e4bd1d145d63b633a14f0cc582e9e9e82d9f70afd965f3a00bcd03", "maxPnlFactorForTradersLong": "0xc778833983adf3aa53bbacdea870efa89b5919c3541f7446c37fb4400a12a024", "maxPnlFactorForTradersShort": "0xff7edb9cbc1b4d90d770d471c02a00bee32110e8343ec2fba13f34c52d474088", - "positionFeeFactorForPositiveImpact": "0x0d3420aa928b1da5f586478312c805f7ae21afe9e7baa721059122518ef67f63", - "positionFeeFactorForNegativeImpact": "0xd4ade9db9240512e1c696eb045235faf299ceac74180cf1a2027c662628aa3e0", + "positionFeeFactorForBalanceWasImproved": "0x0d3420aa928b1da5f586478312c805f7ae21afe9e7baa721059122518ef67f63", + "positionFeeFactorForBalanceWasNotImproved": "0xd4ade9db9240512e1c696eb045235faf299ceac74180cf1a2027c662628aa3e0", "positionImpactFactorPositive": "0x5ce30f4b82ba55df0e987029ded936711b6d1aff9a7aaad80a7edaf4eccd1603", "positionImpactFactorNegative": "0x05bfa4d4d178163c174ca600f23edd2beacb6251cc497dae969209ba7a28d586", "maxPositionImpactFactorPositive": "0x985a11ed1a8a61ba0836724b434483e8888ebbe9e30d8ac70cf036fc4e7685e0", "maxPositionImpactFactorNegative": "0xb5d03aaa44f4e51f4b5735ce62f55c1a038c064d10f3dbec30b1594f2bc2b5bd", "maxPositionImpactFactorForLiquidations": "0x26340ddf9e54bffb55bd5cb1470652d3b32960f41efa886140a723a2349d30ba", + "maxLendableImpactFactor": "0xc8f6751279bc8ee904f588df45a88d92f862015fa055333d4fb948cc621a6865", + "maxLendableImpactFactorForWithdrawals": "0xeedc3dbfb87abeea1d05fe424b4dad10401b1f1be8e153100e2fa74de7d50d1a", + "maxLendableImpactUsd": "0x9f3f857116557171c55b06b0c7e73c89dbbea720b7f88829ba87336931047320", + "lentPositionImpactPoolAmount": "0xa426d6ee0b72483ee1706ce54780b3f38afdb278be3606e662f03e4efd86c8ab", "minCollateralFactor": "0x80cc450de3e38bf0842c74de08feef0c83bbd4bd5b057c6ce752db74e8fc2004", + "minCollateralFactorForLiquidation": "0x8fd4ed805960eda98fc4829e08f9615cd22bfcb89ca38d1947083ff245785e55", "minCollateralFactorForOpenInterestLong": "0xf2505508b048b3a9f6cd5d4f0f28decb75a374a948a988d270c8da823ffd628d", "minCollateralFactorForOpenInterestShort": "0xc3922e36cb2027c649f679b0f13d927854201b6e8c96cf50c664679c9ff837c1", "positionImpactExponentFactor": "0x8d9148077d210c110220baff03e054b10b421a3f985a98fd1db1545c7318a3fa", - "swapFeeFactorForPositiveImpact": "0xef5f72f2eb9555a8148a2e1401958032aacc197c1da4022f0ec23590e253b6fa", - "swapFeeFactorForNegativeImpact": "0x95126626376b73774a4e8e523fb0db25be1726d1a0c5b08723b2efb6276b3561", + "swapFeeFactorForBalanceWasImproved": "0xef5f72f2eb9555a8148a2e1401958032aacc197c1da4022f0ec23590e253b6fa", + "swapFeeFactorForBalanceWasNotImproved": "0x95126626376b73774a4e8e523fb0db25be1726d1a0c5b08723b2efb6276b3561", "atomicSwapFeeFactor": "0xbe395a7e6a556993f306449f4d11f63501a384176881647c46a37cc23d327072", "swapImpactFactorPositive": "0xc131b1e245ee5a6f5be3d03064d8b0b6510fe566b50f6c0c7e65a42270eb68d0", "swapImpactFactorNegative": "0x20f8d97e59061e27885e0d392886682d392172249b499132c6b686874c2353ed", @@ -4214,19 +4624,24 @@ "maxFundingFactorPerSecond": "0x8daecf054a29b3068ae7b310026a2cfc33b6d325a507d8f38600c0cd4533e22b", "maxPnlFactorForTradersLong": "0x5b696c70bfe0b7b753a58b050c1701e8d0d2a17895c180b9436a9b9a00072830", "maxPnlFactorForTradersShort": "0xb5d1ce491c48ca9730b200fd60aaf94f616beb58f1c082d860911c0a8f7e0ad7", - "positionFeeFactorForPositiveImpact": "0x9e7af6bbc811961fb58a5140293e936a7fc8e62662a854d73e063fab60dbb7a0", - "positionFeeFactorForNegativeImpact": "0xcdd1ad112670f69342d21f543b820df3250e6d0b243b1b8aefc8345b89abb2ab", + "positionFeeFactorForBalanceWasImproved": "0x9e7af6bbc811961fb58a5140293e936a7fc8e62662a854d73e063fab60dbb7a0", + "positionFeeFactorForBalanceWasNotImproved": "0xcdd1ad112670f69342d21f543b820df3250e6d0b243b1b8aefc8345b89abb2ab", "positionImpactFactorPositive": "0x7fea51d79d1e76d3cb89da3577667440e794d696ec37d7fc5f7f921a8bbfe41b", "positionImpactFactorNegative": "0x03008449d0e3cf33fed94b24e8e058423e91206a57cbdb0b0f228173099744da", "maxPositionImpactFactorPositive": "0xae8761a60ec47c251789ab4ba75ff174152d05306b538265b50ed7906a9edb99", "maxPositionImpactFactorNegative": "0x3c35a9293aae318368124f14e86c5967640ac6767c0edd9abb2830ff3cd4d534", "maxPositionImpactFactorForLiquidations": "0xbb6d346ee918ea745aeb83d09af9be9a441249dd326421e57e19e0bfe338d10e", + "maxLendableImpactFactor": "0x7afb8a83e5ae3e633a983ecf68a396b1c767ad69879003c6e8ba4764516b1e16", + "maxLendableImpactFactorForWithdrawals": "0x862443f2dd7c14b1f9db2ba42990cec39441c33db9e6c0aa951f30a8864dbba9", + "maxLendableImpactUsd": "0xb5f25ad6874ca38d7c316af80adbb6479177e5896ff6381b1c5035c6b437df10", + "lentPositionImpactPoolAmount": "0xf8fd318a9bb13d620a7286dd499629f43f6ceb45af012e421f0a313eb4c48c2c", "minCollateralFactor": "0xa5d93c751fd967d449430928a31c30b819fd3a1123a0e85297dd2a15e1975187", + "minCollateralFactorForLiquidation": "0x41bc7acbf6580c7822c4f8242416ec35d9c8b2e50be1d5379221c039a8d1119a", "minCollateralFactorForOpenInterestLong": "0x4634662dada17c503986cce2faed9f7fc072f1051ebdd20db92b238c9f9ca03b", "minCollateralFactorForOpenInterestShort": "0x55718911d60d30d9b398b5790a01cfd8f83b42419d8e02cfaea4d5187c3f4b5b", "positionImpactExponentFactor": "0xa44af56cb9b277271d9b9a56b3650c87c94903e5f5405288258716550afa72f6", - "swapFeeFactorForPositiveImpact": "0xc4ba621aee7406ad5aee070791330082eca4849f02c5b02b28c722866a81e489", - "swapFeeFactorForNegativeImpact": "0x3a9540bbf96991551bb54d2f395b5549386da9efb15ea31bd2b2324ffeb59f1c", + "swapFeeFactorForBalanceWasImproved": "0xc4ba621aee7406ad5aee070791330082eca4849f02c5b02b28c722866a81e489", + "swapFeeFactorForBalanceWasNotImproved": "0x3a9540bbf96991551bb54d2f395b5549386da9efb15ea31bd2b2324ffeb59f1c", "atomicSwapFeeFactor": "0xa1424279e592282be92a583ce5c44f2eab6258665b0793dc39c5345a33a23464", "swapImpactFactorPositive": "0xa8ef70684dcb1134f6786ae9427f62a50b92c4aef310158cd0f006bd34075508", "swapImpactFactorNegative": "0xbf74a7204ca3863044e31f33237488f15c51f51ce170161904e97f6076dc6f6c", @@ -4265,19 +4680,24 @@ "maxFundingFactorPerSecond": "0x9fe2c3a88553e6c8f1a937d605937e19ea8b8d768dfab0313ad6b0c4b727ed25", "maxPnlFactorForTradersLong": "0xefd0786c97fd0c1e5efe12c265540afe49357b5ce9410f203116ef97dfcbabaa", "maxPnlFactorForTradersShort": "0xef485852c8c3ee8c55de7e52d063da274901d0045a61839f7a8ffb2edee2037e", - "positionFeeFactorForPositiveImpact": "0xbbedf3f173f1ef4c451104ab8d9e85c4a8668255fd6383313da5e39c7e3fdf8b", - "positionFeeFactorForNegativeImpact": "0x2ef8737317c51e79612d985e398958d73119e5a3d176530ac7b67a2008c9176a", + "positionFeeFactorForBalanceWasImproved": "0xbbedf3f173f1ef4c451104ab8d9e85c4a8668255fd6383313da5e39c7e3fdf8b", + "positionFeeFactorForBalanceWasNotImproved": "0x2ef8737317c51e79612d985e398958d73119e5a3d176530ac7b67a2008c9176a", "positionImpactFactorPositive": "0x46205b42a73fde3057a08e8a43372557878909432252cf53a39eb8b568acd1e1", "positionImpactFactorNegative": "0x3fbbd6e4687059e8cd17798661898c1e6ac18c15305a69cba17f6aadb716996d", "maxPositionImpactFactorPositive": "0x09ab49987e86f02b3648e2765ed1d4d25bd1b0112530f62e0a33b726318fa816", "maxPositionImpactFactorNegative": "0x35f4914c65363c6934dbb5398de816f6e5ff326bb435026c981067b9481850d9", "maxPositionImpactFactorForLiquidations": "0x7922e33897dbbe67d00e7d6d23a286eb854b047a28ebc0809460232346fda898", + "maxLendableImpactFactor": "0xf98b5a7bea6b04cf524bfb79ac4ef7e8c2d5a63d18433a1069a4a96a5fa97631", + "maxLendableImpactFactorForWithdrawals": "0xaf51334f13ecb6f593199c15f26af85ce87d039650fd64b2841c2493c6fc202d", + "maxLendableImpactUsd": "0x822e1063ee7b9a5cefac8546f5eb8ec64948dc327a6d8d4f57e3f2c643a8bffb", + "lentPositionImpactPoolAmount": "0xa1b1838be047379eea778b2ffde45ac38a01637f2d9eba71b01be779b523cc4b", "minCollateralFactor": "0x57bc7d6117c01150e63f7d6376a598ee76432123b0a8f097c2b2e3acf36805c2", + "minCollateralFactorForLiquidation": "0x6ee2269ef5eaa11d456e4c5c24fcf4472789e05761bbccde7d124720734daca0", "minCollateralFactorForOpenInterestLong": "0xb2a7bec849de6c6b7a38d4d561e876a210dbebde36c0a50dc37aad9083f73647", "minCollateralFactorForOpenInterestShort": "0x08927937fa841003e009e8b483a7c0c26168f27b686c4bd9d2d6df5e5a0ceca5", "positionImpactExponentFactor": "0xcfcb8341caceb9af4665161bc4a5585b88134830d36019917b0cc166b439155a", - "swapFeeFactorForPositiveImpact": "0xd18573dc8f2a53bf9106216a900f943172999abf8f4b78c32a02ffb16fc9bb1e", - "swapFeeFactorForNegativeImpact": "0x6c9413f2853edd95a6752ced7c2bc05d4a59510e00f373d505f141630abbc5e8", + "swapFeeFactorForBalanceWasImproved": "0xd18573dc8f2a53bf9106216a900f943172999abf8f4b78c32a02ffb16fc9bb1e", + "swapFeeFactorForBalanceWasNotImproved": "0x6c9413f2853edd95a6752ced7c2bc05d4a59510e00f373d505f141630abbc5e8", "atomicSwapFeeFactor": "0x8523c99151414acbe1151e349da6bdad037043215e785e5ddaa7ac7536e34e11", "swapImpactFactorPositive": "0x0466561a2291ccd4142344bd5609995bd96af67dda47cc7c6477b160d5fa60a4", "swapImpactFactorNegative": "0x463b2d08a99a0fbee14d053a2dbb048bf69fea6fa054f72852401d083cff1e33", @@ -4316,19 +4736,24 @@ "maxFundingFactorPerSecond": "0x84b82ffe4834b4f94641d9a3e2a60fbc0ff1d7e4937d430ee80a014b13175f04", "maxPnlFactorForTradersLong": "0x5c42ebcdd5cc73bbf367156af70735b25897a6accb5699e2dd442a3e7aec32a8", "maxPnlFactorForTradersShort": "0x4845b537832a8b591e75676444faad0887e9747c7624c43298a64ef95d1c2d9a", - "positionFeeFactorForPositiveImpact": "0x379014e598d8d0024d508ff729cf9a31eaa22b3554e89bce3ed00e48534e7c5e", - "positionFeeFactorForNegativeImpact": "0x62a50f7f748ef2572aa3c3f6f486616ea33a0067bab4b7269610a1cacde6300e", + "positionFeeFactorForBalanceWasImproved": "0x379014e598d8d0024d508ff729cf9a31eaa22b3554e89bce3ed00e48534e7c5e", + "positionFeeFactorForBalanceWasNotImproved": "0x62a50f7f748ef2572aa3c3f6f486616ea33a0067bab4b7269610a1cacde6300e", "positionImpactFactorPositive": "0xf181edeb1432f629bf14e39df272865fcc52c85bc89c06fe329eead795328349", "positionImpactFactorNegative": "0xb409ce5f332ad37f5a8f1dd25badc32e20e7526c80ac6cba8faa43afd32f748f", "maxPositionImpactFactorPositive": "0x9acf59a110f586200c0fc1906a2b18a23d3033df529808b6dcf746e8a235e46c", "maxPositionImpactFactorNegative": "0xcf04d976c885aa14b78007f6e63a843f74393edd54f99f8d0c8f9878a33f87aa", "maxPositionImpactFactorForLiquidations": "0x78534eabae34614434e9cbca171a7f3521bb40e26621d621fe9f1280a9eeea7a", + "maxLendableImpactFactor": "0xa2b52b7d280ea3167644b7d1d88aa7490627ba799fdccba28117f2723b8da2e3", + "maxLendableImpactFactorForWithdrawals": "0xdcaab1fd6f8489a043f5b64e2d047a783e8614c7a18f156c8f1748f31fe890c4", + "maxLendableImpactUsd": "0x8e1e71664e9351f656f66459f64b2449d5523d9e7b35a9db3c7bd579fad8ac62", + "lentPositionImpactPoolAmount": "0x264b7391ab282f4bfa197d75ab376b16b7478fcd9792ed8635ba82a3a16bd279", "minCollateralFactor": "0x9286a24a3b626cd4b440c9ebc31ce5a5b709c22f2f4acc917c3135cac6b26ef6", + "minCollateralFactorForLiquidation": "0x8ed79f4e6d3d38bfdfea170a01f66193eb1ad238a766ceddb168e3621d7eada4", "minCollateralFactorForOpenInterestLong": "0x8c69704d7ad8d47b8fc79dd9f203c622ac43de9aaa60e25de14b70468e2d9b25", "minCollateralFactorForOpenInterestShort": "0xfb46f190074aa0025c421e05d226229b80b32da2a638dc566c0ee9b31a62b25e", "positionImpactExponentFactor": "0xfa76ae24b59f8ccb8233c444e1d247e8e7dd78cdb2a7e1ba29dfbb782c4d00da", - "swapFeeFactorForPositiveImpact": "0x9108de9102344a53cfaba2ef2d276e027bb6b4051c3e818d7ecbddfc291f9e1f", - "swapFeeFactorForNegativeImpact": "0xac6ef53ecc38b138b10d39e00eeabffd9e05f54cc9903fe59702b86960bef8c5", + "swapFeeFactorForBalanceWasImproved": "0x9108de9102344a53cfaba2ef2d276e027bb6b4051c3e818d7ecbddfc291f9e1f", + "swapFeeFactorForBalanceWasNotImproved": "0xac6ef53ecc38b138b10d39e00eeabffd9e05f54cc9903fe59702b86960bef8c5", "atomicSwapFeeFactor": "0xfb5cf4b45d7ee1149347aeb46aef578efd22e69901f21d1f4092a2a870c59a33", "swapImpactFactorPositive": "0xd6c74362814ea6fd65d9379cfd8fe06f850ac287b75940fd77e0bdc45264edcf", "swapImpactFactorNegative": "0x1db488bdc1bc0726b938a5242b366c388f4ee2152ebfa088e8e35bec3646688d", @@ -4367,19 +4792,24 @@ "maxFundingFactorPerSecond": "0x3c9d9d1f111fa67d6bd93cc0f9e4a1a5c246a21a0ca8f42c669cdd823bab1b9f", "maxPnlFactorForTradersLong": "0x4a26b85b0edbcc0d6335cf602ad6819e51cf6dc24e391701e6bdd1fcffcd4544", "maxPnlFactorForTradersShort": "0xa96b85aebd11c974023e9971202a74e79c3de43f9c6d4f88c15f593aed77c6ca", - "positionFeeFactorForPositiveImpact": "0x08e0db12c4cbc02b52715243b24006c9e0b1ae4dd8a65bc497ce4500a7759354", - "positionFeeFactorForNegativeImpact": "0x7ae5c5977ac6c2ff75b5c33f55891a1ee92ca01a91cace6d34537f7b086d0e39", + "positionFeeFactorForBalanceWasImproved": "0x08e0db12c4cbc02b52715243b24006c9e0b1ae4dd8a65bc497ce4500a7759354", + "positionFeeFactorForBalanceWasNotImproved": "0x7ae5c5977ac6c2ff75b5c33f55891a1ee92ca01a91cace6d34537f7b086d0e39", "positionImpactFactorPositive": "0x0944db16ab1c5ed44b2f30434f9b1f20b11406eebd67e778867da43b508b1b85", "positionImpactFactorNegative": "0x2ff6188ffe909ac033eee6b4e28cb823b6c9a8160eb32606cbed952f9befab63", "maxPositionImpactFactorPositive": "0x44c15ba958ee8bbe1a9e5c73c10b75c6936ba34584c9547fedba2728646ee3c0", "maxPositionImpactFactorNegative": "0xb4224d32c2294853cc1b30f309298e68e81abe215cf8f950ce667e6bfd815874", "maxPositionImpactFactorForLiquidations": "0x4a45d8c9790fc0c140182e1495bf7db53c570f70d467d247a75abbb6e4c7dd94", + "maxLendableImpactFactor": "0x5aad15db5c0aab031655bbfcdce39721a019dd89143749bb04023c66b3981402", + "maxLendableImpactFactorForWithdrawals": "0x7b26a8a4a53b3f84d684319a11f37d5f04064a23c6547e6e80b051a079838fff", + "maxLendableImpactUsd": "0xbaec5d6a4eb97c342d5c7755b10a84cb1e91c2d325ddebf0fc549bb0a7639b6f", + "lentPositionImpactPoolAmount": "0x1836572fb0e199827d3336bc96133057527bff84368ac582fb0cb89c757b57a0", "minCollateralFactor": "0xd47ee119ab4e108c88d288443718f11ca44df176472339b0c35e2d6ae56d3ec8", + "minCollateralFactorForLiquidation": "0x426ce46062a702d0d68326ca347a1fa5d705087d2b43789dd0310835cfdaa74a", "minCollateralFactorForOpenInterestLong": "0xdbaf0c15b855b2a4e1a68a581469b8c5d15f803cdeeb711edb1640fd38715903", "minCollateralFactorForOpenInterestShort": "0x9500d9c8dd829f81ebe5f3ce2e2346a105d682ef0a0d35b37aeac9aa198cdf04", "positionImpactExponentFactor": "0xe0b1128fdc394a8c3371e2492ddebebe5899f40de9d868c640a7b65d7bdf7626", - "swapFeeFactorForPositiveImpact": "0xf7babb8373684c29ab67c7c832c6c4b2c9b94b8a48076a67d20626bb86628c7d", - "swapFeeFactorForNegativeImpact": "0x4f1228c156db69f770af6b10bd34a80b2fef41dd296f68fb8ae17e9f3dfe963a", + "swapFeeFactorForBalanceWasImproved": "0xf7babb8373684c29ab67c7c832c6c4b2c9b94b8a48076a67d20626bb86628c7d", + "swapFeeFactorForBalanceWasNotImproved": "0x4f1228c156db69f770af6b10bd34a80b2fef41dd296f68fb8ae17e9f3dfe963a", "atomicSwapFeeFactor": "0x31d209dbe461712a524e488388590e9540ae49400a417ef88110f2a7a977d43a", "swapImpactFactorPositive": "0xb0b789da107bc523fb4849e8957a7d3df09235a6b2850f32e32fa6c800fd2d13", "swapImpactFactorNegative": "0x3bdfc565c4eef3a98276ee71419fdc582ba1352266adce60e15cae7b1ab6a3a0", @@ -4418,19 +4848,24 @@ "maxFundingFactorPerSecond": "0xc95e5766d063b66a9e4d828a8f343d3605b797acb939d8052f7cb165f12a720b", "maxPnlFactorForTradersLong": "0x69314750ad39f2f926595327d9d5783f3a5792f33631e9218dcad706b2ce94e3", "maxPnlFactorForTradersShort": "0x917f17d9d3c1f59b94587197bae5b84ca8b68cdce19ec0b0adb596e165a2ae8d", - "positionFeeFactorForPositiveImpact": "0x4dab4716911af2ebdc1d72a2f2dc28f991adae1052770fd33ecba110bc7513ac", - "positionFeeFactorForNegativeImpact": "0x69a65a7c1becf35bd454efc07b02f5463d4e2b98fb575ba61e25e43ad7206655", + "positionFeeFactorForBalanceWasImproved": "0x4dab4716911af2ebdc1d72a2f2dc28f991adae1052770fd33ecba110bc7513ac", + "positionFeeFactorForBalanceWasNotImproved": "0x69a65a7c1becf35bd454efc07b02f5463d4e2b98fb575ba61e25e43ad7206655", "positionImpactFactorPositive": "0x5e6e2a363e7c6f89c43d49f1ba94149d918067ab1b7434f796fcf4a2f6c3fead", "positionImpactFactorNegative": "0x4e8b3ce015d13d1bb91d976bcd74334b6cfbe4e745fb898e6c012e2c19c0f8e6", "maxPositionImpactFactorPositive": "0xb47910941cab06e9dc81d5662459e379e94e34b4dfbdd0c7e28fad6ad30e3e76", "maxPositionImpactFactorNegative": "0x62ce4f0b286c8db680648b24acd47740f9e6d7a8be4c30cff769e41baea09719", "maxPositionImpactFactorForLiquidations": "0xb472fc0d602f85dcd632ba64a9d563a9e46b83be79ff10fc84eb335346d9bdb1", + "maxLendableImpactFactor": "0x467d5377cb56667d1d0cf31bc63a7ceb4e120ead225195e3958bd30b44bcab7e", + "maxLendableImpactFactorForWithdrawals": "0x33cefb6f183a39a21457eebb2b74243010381d99af3f692e1860da516b1ca501", + "maxLendableImpactUsd": "0x81d4f9b3b66d42b3b7c3a3e9749146b8bff4969f429869f2094c64f8f1907778", + "lentPositionImpactPoolAmount": "0x039e702c728c5aa1acd7ea876e6337100d957dbcd32116f79bb8916122e4202b", "minCollateralFactor": "0xbe95285a19c0ce88607d7b14c5230c60f53503455db2b61c3020f104d5ddbde0", + "minCollateralFactorForLiquidation": "0x79931b37d86fd4e1c24760f0d9c923458a505993af2db87ae125d2fc1d3b69df", "minCollateralFactorForOpenInterestLong": "0x2a6d115de938ad85af12ca1d26a0f6644a2fe0599b2ab86f8acf87cb5624ae5d", "minCollateralFactorForOpenInterestShort": "0x1ebd2256b3e588b811528c35ae535b13a6318727480afd98deddbc5642ccbc3b", "positionImpactExponentFactor": "0xb245771c3ae81dfd3366eedd6e85e62cb81ded22f089f674bea08570fc61eb0f", - "swapFeeFactorForPositiveImpact": "0x80dd606da911d750d12feac8732c5a270c3c995c4ca3d3e54079dbac2379b81e", - "swapFeeFactorForNegativeImpact": "0x383121b58b83900c41c948bd2c559ea94adb05b4056fd61bbad4c59e84769e7c", + "swapFeeFactorForBalanceWasImproved": "0x80dd606da911d750d12feac8732c5a270c3c995c4ca3d3e54079dbac2379b81e", + "swapFeeFactorForBalanceWasNotImproved": "0x383121b58b83900c41c948bd2c559ea94adb05b4056fd61bbad4c59e84769e7c", "atomicSwapFeeFactor": "0x4f9d4884fbe826892eb18a9bdc05b6e6dc722527913d699264560a50c0939931", "swapImpactFactorPositive": "0x4bba0afab3bdd086e0cd858248bfc9a06b6a3b70331b7d26f8a7bfa935a4359f", "swapImpactFactorNegative": "0xb354aac74baaf2cae90e78e7317392d514e57f555419d292ed80602fc3024b5b", @@ -4469,19 +4904,24 @@ "maxFundingFactorPerSecond": "0x3b7e464dcc32f8d2c77e860a0077bb7b6e7fc8714ace34540f4b6729f2eac88d", "maxPnlFactorForTradersLong": "0xb208f47a51944a9a40b2a68077be5ea5fb7056fc84e61b956d48c8ceec66bc12", "maxPnlFactorForTradersShort": "0x837ea7e37d8fd9b843af71b7807536a04c768cb06fd91ae0e50ce8dba9666314", - "positionFeeFactorForPositiveImpact": "0x1f39632e8494b846449daae6b44f2092a07a39491e40fe93a9bf4db709fcc668", - "positionFeeFactorForNegativeImpact": "0x07e92106a27e33237eafa3dafd9f7c37e6ad36c6f6e5ab7e0381c751bf12879e", + "positionFeeFactorForBalanceWasImproved": "0x1f39632e8494b846449daae6b44f2092a07a39491e40fe93a9bf4db709fcc668", + "positionFeeFactorForBalanceWasNotImproved": "0x07e92106a27e33237eafa3dafd9f7c37e6ad36c6f6e5ab7e0381c751bf12879e", "positionImpactFactorPositive": "0xae5be4d434eba0b99dcad4871a12edc786a7da4fc7a10f3af9f1f64bc45bda4d", "positionImpactFactorNegative": "0xd306cf22995c236c2a25bcada07a1dce802918a16cb408e62c4c52df3bd940b3", "maxPositionImpactFactorPositive": "0x4f8676b09189ae01e2d7895f06b00bfd93fa644c104976a0e56d0ca82bd5f4e4", "maxPositionImpactFactorNegative": "0x92dbf0ecb90d8a9d5f8448f53a0ab2220070f4836fd4ad0f375f7b08841fbb73", "maxPositionImpactFactorForLiquidations": "0x9b98aa2ed2c3185e82bc076abca8f66ecd35ff266e183479fba3f0986da0693c", + "maxLendableImpactFactor": "0xa200fdbfcb8ef3419f225c8ef2645f7c51ac78632d1d7c0b38178d02468cf5af", + "maxLendableImpactFactorForWithdrawals": "0xc92ba1efcc554e66ee1429f7f948f37e6c8d909a1821c89b3f56b77dd257b95c", + "maxLendableImpactUsd": "0xaac0b18a1002ea6fabf3793aee54fe98a640085f40b14daee9151ab652d97555", + "lentPositionImpactPoolAmount": "0x90e3f8c855ef37b87b1556a3ba6f520da85308d2845ab662128630c1895f37b7", "minCollateralFactor": "0xa213ede0599ac0ad9d8d63cdfbd2bc353b68313ea17ae036bcc6b12ba1f3b46f", + "minCollateralFactorForLiquidation": "0x53242e803c0bb6381c1b5c42a8fcd00b54fbbe85995488a7a5dec6f225a5e5fc", "minCollateralFactorForOpenInterestLong": "0x52afa3711c1e690c0bf7e156928aa8384c28f540b26fc9b607b05ca73c18bfd8", "minCollateralFactorForOpenInterestShort": "0xbad6087b3466806fabbea91fd5fc6f95036dd696fda16dc077d0b562c1ea1889", "positionImpactExponentFactor": "0x0b1c98df3775838da85a0fdc248a1cf9af5f8bd89a1a352595f658ee771f879a", - "swapFeeFactorForPositiveImpact": "0x0742e3f8db96ac05a07e004082428d900b556728a65c070a50e583aadb586cde", - "swapFeeFactorForNegativeImpact": "0xb0bc201c5b3d7ab2b6ae7430be01c9c0e53c7c22156ba22a14e00d5c4a0e44ef", + "swapFeeFactorForBalanceWasImproved": "0x0742e3f8db96ac05a07e004082428d900b556728a65c070a50e583aadb586cde", + "swapFeeFactorForBalanceWasNotImproved": "0xb0bc201c5b3d7ab2b6ae7430be01c9c0e53c7c22156ba22a14e00d5c4a0e44ef", "atomicSwapFeeFactor": "0x5ac6e757ce8023173330912b9cf86157c369be3398b55ba4a7c490064fa6a5cb", "swapImpactFactorPositive": "0x05b1fb95bc342c7618a883a763fbbd253740020c12568b3c5841032ee9a91fb8", "swapImpactFactorNegative": "0x282f8a9226a14b7842f6da9a0232abcd867444a585257987dd9f5335a699b1be", @@ -4520,19 +4960,24 @@ "maxFundingFactorPerSecond": "0x905535745f7dcc7ead3aa76a0505be53c7023ed5513d92b1418438b715038a0d", "maxPnlFactorForTradersLong": "0xe501de2bc8a93d96072b609a4fd425fc203869cef4c669dd5fb53c8a6c87783d", "maxPnlFactorForTradersShort": "0x37d75f0c5eeee8bdbd315af93d214125900cf328a96dff2a73e020f133bd3f28", - "positionFeeFactorForPositiveImpact": "0xba562318f5a151012be658e077d0d12ad906a8842a0a842a00cc28548f25da04", - "positionFeeFactorForNegativeImpact": "0xdbcb16c248b9bf77d2fad4161594283cbf8a2ae70cee09903580ba9d7db32b7b", + "positionFeeFactorForBalanceWasImproved": "0xba562318f5a151012be658e077d0d12ad906a8842a0a842a00cc28548f25da04", + "positionFeeFactorForBalanceWasNotImproved": "0xdbcb16c248b9bf77d2fad4161594283cbf8a2ae70cee09903580ba9d7db32b7b", "positionImpactFactorPositive": "0x35db73cdefabea11f6cd0fa43405fdda2426809523af9751022b923c4b11c3f6", "positionImpactFactorNegative": "0x7e8250a02a5cba229d6b061c7c308617c8276ed6bfd08646425add04874f30da", "maxPositionImpactFactorPositive": "0xb34426026ad3844ff8e007e94303faf42789223dfda616700ff05ac9bf3fb53a", "maxPositionImpactFactorNegative": "0x36dd4505b6a81d6a5d330cfdd00766abdf2b82925c43913674f06cbed5c5f60d", "maxPositionImpactFactorForLiquidations": "0xedb4f51e93d6c8f03b0d81b69fdd15e493cca80bd51f35deefe354fbd9955f01", + "maxLendableImpactFactor": "0x452079f0f8e4232f1216d0e1dbc9899ddbb111cfc95fd67d8808bff645b9a676", + "maxLendableImpactFactorForWithdrawals": "0x4aa8d9ced2923efa1e9c767e9b96bdd98d460e517dd0638183d8e3540daa3b48", + "maxLendableImpactUsd": "0x6bc54f3ce9aeb8b08143f67bbedd05eec9d60aea96adcb960f288f6eaddbd863", + "lentPositionImpactPoolAmount": "0x7cd92d2fc980d67d61a33aac2a96004487fcdef64192e5424ca1aefbcfa21ce2", "minCollateralFactor": "0xfbd9db0e5bcf95a34b4d52a97caee4aaacf32e91fea52fb3d0f6eedaff6b16e5", + "minCollateralFactorForLiquidation": "0xad6053c2d0c04fd2f4bf6806e2dc774d14481617371e602cbc76a83e6bb47d6f", "minCollateralFactorForOpenInterestLong": "0xa7fc29d21ee4ffceb464f9889c70a3c5f92c8c48dbd5ffc824f088dda4b7515e", "minCollateralFactorForOpenInterestShort": "0xc50491facbf7c3258a02e4353a0a8ffe64cc09fb4e9b86c8128e56b23b86d861", "positionImpactExponentFactor": "0xa4552e9093aea5811829cf3a7fd9fdf23f2e84611cb07ff5aa35358e0b63be97", - "swapFeeFactorForPositiveImpact": "0x193d6f23c11a79d96b193a6e7cf4b05bbb7992031f956951ce396da8ff34812b", - "swapFeeFactorForNegativeImpact": "0xc6c49c25a6e5ba44da9722086f13b338b228602a55b3f441cf9e3088ae7bf488", + "swapFeeFactorForBalanceWasImproved": "0x193d6f23c11a79d96b193a6e7cf4b05bbb7992031f956951ce396da8ff34812b", + "swapFeeFactorForBalanceWasNotImproved": "0xc6c49c25a6e5ba44da9722086f13b338b228602a55b3f441cf9e3088ae7bf488", "atomicSwapFeeFactor": "0x2d9e442b1a976ff0bfc39bce6bc7316886f81ca7027007be437ef906d687f99f", "swapImpactFactorPositive": "0xb410710dbae13f219397473794d9620624cfe337962ea6caa4a702e0ee64f15c", "swapImpactFactorNegative": "0x789b271f70ed1b702855f3068f9d21c8443b15374529527d1a2c45c1cb7664fa", @@ -4571,19 +5016,24 @@ "maxFundingFactorPerSecond": "0x47e5eba0fec951108b66c2f06e9f318bc9453d6bd745b1b7e9abc20fd127cc56", "maxPnlFactorForTradersLong": "0xd28e554a9db012d4ed8eeca3ac8cd3f086bff391c07e8af5a410d1758ebbab6b", "maxPnlFactorForTradersShort": "0xd97bc32d7a6ec33719b5ac9e2b9b2d6f2db019c4f6d8170834ca4563475f58f2", - "positionFeeFactorForPositiveImpact": "0xc7e8a7e9eaa0ee2272f8bd1739375f19a3e3173788db16906632bd75c8718f24", - "positionFeeFactorForNegativeImpact": "0x29d9955cd26be376209096ce2ad3370e5b36ac80441815ba824f2d195e0ad0b7", + "positionFeeFactorForBalanceWasImproved": "0xc7e8a7e9eaa0ee2272f8bd1739375f19a3e3173788db16906632bd75c8718f24", + "positionFeeFactorForBalanceWasNotImproved": "0x29d9955cd26be376209096ce2ad3370e5b36ac80441815ba824f2d195e0ad0b7", "positionImpactFactorPositive": "0x36fabe1eed7764e5e1ec15bb1ed069e590e7efaaa6f9e706ccb21400871ff524", "positionImpactFactorNegative": "0x79aea67bc97087b08fd95200aab558b7a9646b9a26761bf62a1d3602c53fff0d", "maxPositionImpactFactorPositive": "0x0d08c828dc9d769eeae616f4eb633aff60e0590d4e9f139ca4ed3896cc1ecef8", "maxPositionImpactFactorNegative": "0x6d93932f4a91d8b721f586aff6195d1329e865f3e37ba0b5fb3fdb34804dc21d", "maxPositionImpactFactorForLiquidations": "0xd1ca69a240770f649eac17fcef37e1ec3f08d89c8e052f9f3a52af6bed54bd72", + "maxLendableImpactFactor": "0x86d3e82fbbb7ef85d605daf0f3e91d2e2557e78900221935c18e3d8ef4ee45c4", + "maxLendableImpactFactorForWithdrawals": "0xab9b13bcbd53b81249545d8c3c013f17a8f3502f5f2fb550b8a08237f93d992e", + "maxLendableImpactUsd": "0x332ee1eb11b5ff3fd34fafdb9c874d59aa2f3c3814865c5413f8be67ac82cbda", + "lentPositionImpactPoolAmount": "0xd2da7ed412c9439f57c9e43d01ee9add8f84943df4615ceb1619bc2abf84bfdf", "minCollateralFactor": "0x2d6c706dadc679262e11249e94c293095e1d2fbd28b2dc9bf4bb2bdae5a9b60f", + "minCollateralFactorForLiquidation": "0x7571230a5a26f9280aa55776430b802d4ce0c4b1f31edc7d7323e1fb55654fe6", "minCollateralFactorForOpenInterestLong": "0xb31a483d7cacd648d5b1cead2934dce80ffb22bbb0b1b5eacf4f680e7a7f51ef", "minCollateralFactorForOpenInterestShort": "0x9ef84ecd0f238d5e66bd19a337209e1da9e3e0c64cd87235d596cafe0b151459", "positionImpactExponentFactor": "0xd39d36b5e26e0afd6b2bf7741114b6c4bcf6a7622e6234600ac9eafdbeae8fcc", - "swapFeeFactorForPositiveImpact": "0x418a49be80d3245ccf3c39d463131554ab2a57384eea5a6c25b22516862b90b1", - "swapFeeFactorForNegativeImpact": "0x83e5cb7cd6c5e665bf17311da7f373e698f0da5dd2a33a7cfcf0e383d4b71d20", + "swapFeeFactorForBalanceWasImproved": "0x418a49be80d3245ccf3c39d463131554ab2a57384eea5a6c25b22516862b90b1", + "swapFeeFactorForBalanceWasNotImproved": "0x83e5cb7cd6c5e665bf17311da7f373e698f0da5dd2a33a7cfcf0e383d4b71d20", "atomicSwapFeeFactor": "0x3f94f7663c8911ea518a485ce2d6502e19cd61a00dd5da82b412a37a16ab296d", "swapImpactFactorPositive": "0xb1a8a4e762d68aa90bc460f82724feadceb7c265b17e612e1c139b531db2d0e2", "swapImpactFactorNegative": "0x281cb6561593d80eabe053a76d638d6ef11760761af38ca3b1157d4549682d91", @@ -4622,19 +5072,24 @@ "maxFundingFactorPerSecond": "0x2a180f41a8c4af0bf330505095cd046467771b23957c3896707338976ad8ba26", "maxPnlFactorForTradersLong": "0x73d77d7c52833b1e8b72d2b87c03a954b582f3d7889e56d3bab5c6ef8c94f85e", "maxPnlFactorForTradersShort": "0xc098c5553674aeb8cd0ab776ee7f44b18caf5c9c3a7eaec8fa78ea4660624e24", - "positionFeeFactorForPositiveImpact": "0xd5275ca6176b6f72af90745716e086778de82d015357f16baf310d0f704e8178", - "positionFeeFactorForNegativeImpact": "0x882f4679e77e4c52f383e53786ab6563d3a1ce41584498e3db3975e6c1b626e1", + "positionFeeFactorForBalanceWasImproved": "0xd5275ca6176b6f72af90745716e086778de82d015357f16baf310d0f704e8178", + "positionFeeFactorForBalanceWasNotImproved": "0x882f4679e77e4c52f383e53786ab6563d3a1ce41584498e3db3975e6c1b626e1", "positionImpactFactorPositive": "0xee9618317d95068cfa01f27051b43663135a3267f556f9fc39c444130d03d789", "positionImpactFactorNegative": "0x9d75badb56f42cc0ce64cd93cac78531fe3367324bac64c3003df3a601f2a657", "maxPositionImpactFactorPositive": "0xe8592d9bc55e18be4a49c8938a1f4ec60a13de62065d4951c9b8dcb968689176", "maxPositionImpactFactorNegative": "0x8d34d5799c99dbf0f3f2eab70aee41faedccd92ece8d3078f9cbf9124e1f9659", "maxPositionImpactFactorForLiquidations": "0x1e5e430e83f4b42f50a9e51552c788f4eebf8994e68ea332efa2bd06dc860125", + "maxLendableImpactFactor": "0x43b76d012b4f31389a3a5779df50f80164e8c084ebdb0b0c6c4e322d2996be70", + "maxLendableImpactFactorForWithdrawals": "0x66c8168dfe39c73d827d067081ebebaa988316d15fce8f6bd526d72d68787fb1", + "maxLendableImpactUsd": "0x39f5a3d9577967c6e611987af1dded1b5021ea1a79577eea0d8d907ed770498d", + "lentPositionImpactPoolAmount": "0x34e71553618df94005fe1f31b089518cb9e6d5616c2ff9d2375c426e3de1b80e", "minCollateralFactor": "0x8add9b807058f0efe927f8dcd209f053d49a4831121c5ff1df617c0aaac42fca", + "minCollateralFactorForLiquidation": "0xdd3da19ef77fae0831f70db252ee293b55b7beefe26610364d751d7a2f1ddf13", "minCollateralFactorForOpenInterestLong": "0xb053e44f2c73e33aca860160ad83dbae4c866151a88752a096ccbfc939ee4f34", "minCollateralFactorForOpenInterestShort": "0x9fb05f1825674751848bb279e1cf48b08f1f14a3b67e0a3ee96d3b205d19317c", "positionImpactExponentFactor": "0x69ae7b3841a987747052ea2f11ea3220e78baeabd7a874e37bbbedae08219fff", - "swapFeeFactorForPositiveImpact": "0xcac43dbcf0982c139a541622f069cffb4bbf7ea35038dd0e0e1774e68d651ac4", - "swapFeeFactorForNegativeImpact": "0x44e45b505ea06e2dbd3b023457dbcf31fa94e16db1c9163282a8ab43da206bbc", + "swapFeeFactorForBalanceWasImproved": "0xcac43dbcf0982c139a541622f069cffb4bbf7ea35038dd0e0e1774e68d651ac4", + "swapFeeFactorForBalanceWasNotImproved": "0x44e45b505ea06e2dbd3b023457dbcf31fa94e16db1c9163282a8ab43da206bbc", "atomicSwapFeeFactor": "0x257fb617aa6332d157ba1a605067b1e5c4c977a630ffce70b44a35e07bcaf599", "swapImpactFactorPositive": "0x783b2e4266df71eb217aae14be4eb9048958ede5620cb605a584fe56ffd31d5f", "swapImpactFactorNegative": "0x90d6976cdb86e2983cf7c8bef8d922c7484275d6a7ad3511a5c6083dd00363b2", @@ -4673,19 +5128,24 @@ "maxFundingFactorPerSecond": "0xe59999c7f93e9c0f5d269d2b807938b015990358cb696a09f0dcf9397578d955", "maxPnlFactorForTradersLong": "0xa818d680cf700698ad177e101098884b64cf3ca714b3d300eaef01a25a68cdbd", "maxPnlFactorForTradersShort": "0x351230ec92739f2c443812ce19e7bbfa3896bb6417920904b7e862849efc22ff", - "positionFeeFactorForPositiveImpact": "0x15402bfa37f912660ef6fc70f8e70a86822797bc030d8d69f72944f4e9ef815f", - "positionFeeFactorForNegativeImpact": "0x8b05f795931c137253905064c7de269860bb3d8854444ecc7147529b03c54648", + "positionFeeFactorForBalanceWasImproved": "0x15402bfa37f912660ef6fc70f8e70a86822797bc030d8d69f72944f4e9ef815f", + "positionFeeFactorForBalanceWasNotImproved": "0x8b05f795931c137253905064c7de269860bb3d8854444ecc7147529b03c54648", "positionImpactFactorPositive": "0x2243abc9598d70a11f2a93f42f12c916fe4d1acd5bdec6030ac973504cc7656c", "positionImpactFactorNegative": "0x156feca532a456c62b9f4edc94b188038147a022e2a2b83599ad1294ef3ab751", "maxPositionImpactFactorPositive": "0x27850656b1ab8bff92a4cb970443180805333fba1e5954116a96edf20af0aecd", "maxPositionImpactFactorNegative": "0xd17bf66d7dc4dcbe61681941547f70da07e6419732de1c76de9af58e14b8acf8", "maxPositionImpactFactorForLiquidations": "0x57cac5870aca44d2c8ed7cab262d525ecf7ad6474805fb1726c9da594fba1dca", + "maxLendableImpactFactor": "0x7a9398a675da4fe035a6bb70aae98124b12f2a45ba78177c4cf80f0c06b95b15", + "maxLendableImpactFactorForWithdrawals": "0x8e8faf1999fa9d901338e3d46ff1093c6b3b78dcd25eafc089199a025f777508", + "maxLendableImpactUsd": "0x1d5773e26db075dffce8c24dfc95f9769296c36454dd8a226a98ec61d2dbefae", + "lentPositionImpactPoolAmount": "0x7145ca807db24709f5474918671cd883ba269f313edf6b3cb7d68cadbf8175f2", "minCollateralFactor": "0x239aebb5a33ed980f6d1c745fe313eddae94cfa8b6dfa61640ac3204d2e1ddea", + "minCollateralFactorForLiquidation": "0xa3d3e18739ebfbaca88f4aad3aef6b2545f949bae4d37af025a2f9ca18b7e555", "minCollateralFactorForOpenInterestLong": "0x3ef566215c8b99506a5a252199891cb0268e97e592bf0ac06cf6f4227258e4ff", "minCollateralFactorForOpenInterestShort": "0xab8d10d4912c00f6ee77fe9a2647645f124c1a076ba799a9d32382c16fac6183", "positionImpactExponentFactor": "0x88a12fc0b4f12aa16021c7d1cbf24aa3cb512997c16b75286a220b8c2acec260", - "swapFeeFactorForPositiveImpact": "0x538b28d4395db6f7986920bebabc342259c741dd275250064091172e3a1ba3d9", - "swapFeeFactorForNegativeImpact": "0xe33673a8bbeb4f161224750f72466fc71c54b98eedcfb0cf4564d00af44802a9", + "swapFeeFactorForBalanceWasImproved": "0x538b28d4395db6f7986920bebabc342259c741dd275250064091172e3a1ba3d9", + "swapFeeFactorForBalanceWasNotImproved": "0xe33673a8bbeb4f161224750f72466fc71c54b98eedcfb0cf4564d00af44802a9", "atomicSwapFeeFactor": "0xac103d5917eb45342dd0844a5f1a394410222832fa4bd37010dec98599bf0419", "swapImpactFactorPositive": "0x82d479352029c855a3a6f904eff05a6539b3e0551b966ecc6e94ca3961b93df6", "swapImpactFactorNegative": "0xfba5946dca51e3c75530429ce15e40f13589f63992913fdcc7398620eb0ac04f", @@ -4724,19 +5184,24 @@ "maxFundingFactorPerSecond": "0x0c1d9fd3c9c50a89c1a9f638c8ca81cad9ab3e0b094576a832cd33a1221c1dc7", "maxPnlFactorForTradersLong": "0xdf7b799c6368840f9eb69ef578c730d0868eb5367482971d0f8e4c12ecade3cb", "maxPnlFactorForTradersShort": "0xcac3d1cff5f2b710556f161e0221ded9b79baebc8cfe756c1875a60a81f718af", - "positionFeeFactorForPositiveImpact": "0xfb5ca642475a8a07559ea34eb2e7508dcc8241dd8b15fa5b1ce641fc9cf5d8ae", - "positionFeeFactorForNegativeImpact": "0xe600126c35ea18326ca15275c87b293626591fc2d2822d335495103b1a54aa23", + "positionFeeFactorForBalanceWasImproved": "0xfb5ca642475a8a07559ea34eb2e7508dcc8241dd8b15fa5b1ce641fc9cf5d8ae", + "positionFeeFactorForBalanceWasNotImproved": "0xe600126c35ea18326ca15275c87b293626591fc2d2822d335495103b1a54aa23", "positionImpactFactorPositive": "0x86768527c93471ee2f003d29b69ea63c752e2deca3cd30a2fe30b16dd47afe5a", "positionImpactFactorNegative": "0xe270778f1652bbd204a0485aeaefdbe2ca55598731f059017eb014446a212340", "maxPositionImpactFactorPositive": "0xb9cf299657d322475fee346f7a388200f08e71a7158b47609ff2a80e9f5919dc", "maxPositionImpactFactorNegative": "0x1886b30d47e73aa3e34335375e0ca436a7eb6c87e554941ae6abcc3cfe0c3316", "maxPositionImpactFactorForLiquidations": "0xd6676820cc072bc0ae13225eae5bdc2a4f193c063fd64b4610cf65e8416d3c00", + "maxLendableImpactFactor": "0x96b20ee2310336fc91d3ae638e1aa0578534271ac496c0bf7f9f249880cbfe7f", + "maxLendableImpactFactorForWithdrawals": "0x735393a63607d60f6c069c503cc29efcb57db2a8af56011a97d78f3ee9a96727", + "maxLendableImpactUsd": "0x0ab6fb4bed20bf0e1ded571da67a009366693ea713a24cd8b71e6f3bf11c44f8", + "lentPositionImpactPoolAmount": "0xc7f3af484671f834f827b87322143ee35cb5cffbacfb4dc882cec4ca1657fca0", "minCollateralFactor": "0x7802fed0c1073c7720f43038c4ce47a87f131dde78167cd6911e57369ea2f276", + "minCollateralFactorForLiquidation": "0x65f68a9afdb78cf330f681dd96e9cea7d39629c5298b7a0f26259e82af911a15", "minCollateralFactorForOpenInterestLong": "0x4ec50614ebee32276c869866bc29cda2f0cd3b6a0fc081f99f69ee62d243e577", "minCollateralFactorForOpenInterestShort": "0xa50de0ea17ca06f721f8aee0270ba6d29ff8987b3fe48e2bc8202575ae5da998", "positionImpactExponentFactor": "0x35a3fc88d59ee55f461e3670e8bd83296076ef3453ec9ff6d2ec2250672413e9", - "swapFeeFactorForPositiveImpact": "0x2f63ac0203354e448324c4c48b6247b2ca26189fb244c7be4493adb4a519fa74", - "swapFeeFactorForNegativeImpact": "0x94f5bfca9defc2b97fa9c4af15ff2291ae956179af9176bfaeace643d1b9014e", + "swapFeeFactorForBalanceWasImproved": "0x2f63ac0203354e448324c4c48b6247b2ca26189fb244c7be4493adb4a519fa74", + "swapFeeFactorForBalanceWasNotImproved": "0x94f5bfca9defc2b97fa9c4af15ff2291ae956179af9176bfaeace643d1b9014e", "atomicSwapFeeFactor": "0x7145c82f6478f400a52394760ae7578902572c92402adfb4907050d831b263d7", "swapImpactFactorPositive": "0xb39cb4a6fec85abc09554145dddca153c0bdb62ea84c78a101cf865bb41600af", "swapImpactFactorNegative": "0x4f54d9254ed13421d3335dff4dc71be5e038becb36096c26cbe5ed106ddd29a1", @@ -4775,19 +5240,24 @@ "maxFundingFactorPerSecond": "0xee834c43c0cf755e67ffa6e7b768764b494a836bbdce12a1a4f097eb152dae95", "maxPnlFactorForTradersLong": "0x548318e5ca63f4ec2e4a6e9bbe28de40c637787b9a495812ffec99838e4630df", "maxPnlFactorForTradersShort": "0xaf1613e97d5f393e3ee604108a3788616475670f1f04197fad4abf4261ad1d1b", - "positionFeeFactorForPositiveImpact": "0xdeb4cf4c718552a7758a149c3fe2ce51bc1766094f05f58375a80a120db39c4a", - "positionFeeFactorForNegativeImpact": "0xff92969b970823a7e917ff8c7c341e98cf98ca743ccce1f7f22bc2f3bb32bfc4", + "positionFeeFactorForBalanceWasImproved": "0xdeb4cf4c718552a7758a149c3fe2ce51bc1766094f05f58375a80a120db39c4a", + "positionFeeFactorForBalanceWasNotImproved": "0xff92969b970823a7e917ff8c7c341e98cf98ca743ccce1f7f22bc2f3bb32bfc4", "positionImpactFactorPositive": "0xb7265148a953af3163464bb026391010b221ac00ea70c76e794db487e85fffc8", "positionImpactFactorNegative": "0xa54ea45edf9314474ec0afeb829af3239b1203876ffdb8e708386874e455604a", "maxPositionImpactFactorPositive": "0x8506da81af1e6ffae09575bd6579f6c9f2b36b78f9e469de3c117d7bc436554b", "maxPositionImpactFactorNegative": "0x0019da4ff4b882ad2992f2a68b37612355e53734211625d04179daf8ecd3484a", "maxPositionImpactFactorForLiquidations": "0xc8439eff03ba20bac9469b7399670162ffaa3c662e5794c5b84542efaa5a17c2", + "maxLendableImpactFactor": "0x1cd29cf18cb059adc0d26f7929c28b6dc1766caebe8b944c85cb663e640beafe", + "maxLendableImpactFactorForWithdrawals": "0x01e096f029bfb4ff702498771f8a1f317bc95104a3f49837d3b4da33db2be3a1", + "maxLendableImpactUsd": "0xc2f6645176282ea733a41d9f6d50ffcb8880edd3b7a176a966587ebf5d59cd8b", + "lentPositionImpactPoolAmount": "0x5cbe51b7302572a63d718c8349f8b5313fbccaf7212eb682bc1eacea91cb3cd0", "minCollateralFactor": "0xbc7fc702ef6aaf9068cc0ed4435b3176394694d6737540ec0a9c001b764bfeff", + "minCollateralFactorForLiquidation": "0xc1d54cd6c502588af1cf73aa199beff47eaef8600505908f837db32a8c3d7c65", "minCollateralFactorForOpenInterestLong": "0x0d6d3a35635ecae509baf03a4bb1d7cad458d3bfd2980159e523bea0d6ea36c4", "minCollateralFactorForOpenInterestShort": "0xf090c034ca785ab99c12d5ae9fbdc732314f990a1821df63431eda6c9df58a8d", "positionImpactExponentFactor": "0x6a7b0300adeb1279e72e90b8afd18a03b01d904a230a6116d1a3dce3bdda711c", - "swapFeeFactorForPositiveImpact": "0xb90a30595a23271996d72f1b7bc8f2b216242596bd1f66ee8e23c7a899460ff6", - "swapFeeFactorForNegativeImpact": "0xa7968fd876b4080577b846dbe984e4127995ca0e8bae0fd202ed896c64c7302f", + "swapFeeFactorForBalanceWasImproved": "0xb90a30595a23271996d72f1b7bc8f2b216242596bd1f66ee8e23c7a899460ff6", + "swapFeeFactorForBalanceWasNotImproved": "0xa7968fd876b4080577b846dbe984e4127995ca0e8bae0fd202ed896c64c7302f", "atomicSwapFeeFactor": "0x3684560ccb2c25d736f4092efa5f8dcd091fa6305a45791a05db22943ad479b0", "swapImpactFactorPositive": "0x92c1d29cd0ab89f325ad3b7e195fe5eaaa8f81e3f77e4e828a740710755ed9b4", "swapImpactFactorNegative": "0xda142786efd0995a5c792b7ab292fbe984014b7ff1b0c01b57c8702fbf092c70", @@ -4826,19 +5296,24 @@ "maxFundingFactorPerSecond": "0xfdf0c22ab02cda4cf7c42fba3a5de7f767c758e52240f1297711726d2f18b739", "maxPnlFactorForTradersLong": "0xfbee674b478748228fa397aa30d5c71d8f6d688f46ee1584b15a4f235955ced2", "maxPnlFactorForTradersShort": "0x44113a76580d3869dc3faa0b6ad857bc32792f066d8c5cb8f2ed85273c48ece6", - "positionFeeFactorForPositiveImpact": "0xacd9358063a2bce12a2ae1ec0ecf20b82638b59dacd1e1fd24fb7352115024d7", - "positionFeeFactorForNegativeImpact": "0xfca0b6d02a8c923ee01e52683e19ea1f828803f2ed40e66a85df06edf60ef740", + "positionFeeFactorForBalanceWasImproved": "0xacd9358063a2bce12a2ae1ec0ecf20b82638b59dacd1e1fd24fb7352115024d7", + "positionFeeFactorForBalanceWasNotImproved": "0xfca0b6d02a8c923ee01e52683e19ea1f828803f2ed40e66a85df06edf60ef740", "positionImpactFactorPositive": "0xb73aecc3e3478c17887d8b395f24784b99476d144784227e7228c114478dcb9c", "positionImpactFactorNegative": "0x1ce4c4434ca64823203dbb1664559d2963735fa2d2fcdb4126a643cfb86e41c8", "maxPositionImpactFactorPositive": "0x92d1e21a660fbb927c52c338215fbdfe97e318d74a74ebec791a69dcdea71cef", "maxPositionImpactFactorNegative": "0x75e7fce1e22e84792d01d6d425607e48763e53668a39386cf9b80a2680dc242e", "maxPositionImpactFactorForLiquidations": "0xa8437434446ebf51d1285f09fcf7ec0a49687004e3415ccd347067278d658dba", + "maxLendableImpactFactor": "0x27f9d6df70fc97a74e3b829720bb772fa03cc8c7c0ec8fac9425438d0149d17f", + "maxLendableImpactFactorForWithdrawals": "0x31a542b6e730c23b8228a3901af7fd0ea4098d91978966c87ab64d7945129979", + "maxLendableImpactUsd": "0x4d4cca6302a1214b790200799b0ca5e2b742f8320945db9435448e331814dbcc", + "lentPositionImpactPoolAmount": "0x2e769d68a09414ff7c40d8d63b70be3725d11c9da8548e2b26923350bf6fe2d3", "minCollateralFactor": "0xd2a3fc6200cad6ceefc89cd6fd11223bba1e5112b3c32822481d17e67c3a682a", + "minCollateralFactorForLiquidation": "0xb8ddca48aa09da174c6b9d743ad7800272dd601298b1cf8a20fcc7f02f3dc28f", "minCollateralFactorForOpenInterestLong": "0x16564792d825aa02be225fdbae443d22a6398e40a3239c1309b49af701177170", "minCollateralFactorForOpenInterestShort": "0x33becca3d21c448200bec2782b5d80c6058dda35e03d3605be114b02fad807c0", "positionImpactExponentFactor": "0xbd40da207468bcd57272e99e2ac4d6a751faedf9eb11202be9e8e674f25b9e6f", - "swapFeeFactorForPositiveImpact": "0xcc1dd20f7c01880a4c7c95ba6cf9de2d25011356abaa57f789a5100a60abbfd1", - "swapFeeFactorForNegativeImpact": "0x760a6cd2b15f3d09fe03ee5e0cc39c2b87ccac457a477faaf1b8c10000c21ad9", + "swapFeeFactorForBalanceWasImproved": "0xcc1dd20f7c01880a4c7c95ba6cf9de2d25011356abaa57f789a5100a60abbfd1", + "swapFeeFactorForBalanceWasNotImproved": "0x760a6cd2b15f3d09fe03ee5e0cc39c2b87ccac457a477faaf1b8c10000c21ad9", "atomicSwapFeeFactor": "0x7672749e148b6d7dea467b114e16c3b129fecad7cb77b516a132aab20c9942da", "swapImpactFactorPositive": "0x4e1859b022ac41a8c0bb4876ac60e5667736a43a39775b67e8c5899e394f23a1", "swapImpactFactorNegative": "0x5446dbb4b522361bc79d2469cfa8f1a99d2491ef4398814a4226a28f9d006d5a", @@ -4877,19 +5352,24 @@ "maxFundingFactorPerSecond": "0xddbaba7525d87c78ea72b05619c98c837332437cab54d76abc63fed6b9e5d992", "maxPnlFactorForTradersLong": "0x4fc4b7f879cccd213692433479c1170b0457f8ebae348a47ce26789067a979f3", "maxPnlFactorForTradersShort": "0xe654cd003327fab6cb2371ca02d4b6aa6cd9a656de3831078f28257e8201ee8e", - "positionFeeFactorForPositiveImpact": "0xc2fcf47d8a51c092883946b050b69e99115b0876a81c11bebdde55b9dc2eaf92", - "positionFeeFactorForNegativeImpact": "0xe35da348d32c0779ec042b1e5c0da2f3afd9abca092404df57b333d3f95011dd", + "positionFeeFactorForBalanceWasImproved": "0xc2fcf47d8a51c092883946b050b69e99115b0876a81c11bebdde55b9dc2eaf92", + "positionFeeFactorForBalanceWasNotImproved": "0xe35da348d32c0779ec042b1e5c0da2f3afd9abca092404df57b333d3f95011dd", "positionImpactFactorPositive": "0x5955b711dba2a7dd61632f63d9f65f1b66c40bb1da16a132888a09426f6d64e1", "positionImpactFactorNegative": "0x5497abbb63013c29a533403e1c5be0b5581c34c0dac3386eae2213e933bdd0f4", "maxPositionImpactFactorPositive": "0x4ae55a5fc79ee436df87560c979bee51973e66896b4eacf8cb35603736fb1851", "maxPositionImpactFactorNegative": "0x47a013d2b3cd5333ebc49aa286bdebd4b6811feb816b39eb86c1a7a373399755", "maxPositionImpactFactorForLiquidations": "0xd83dec73a7cc8d8e0e4bf3974bf6a5d2202d8ed5b90a1d513d85691b900e30b5", + "maxLendableImpactFactor": "0x451b64316edf792914e442c55deb12560e3c4dad668ff95ec7a54d6459a9a7ac", + "maxLendableImpactFactorForWithdrawals": "0x183c9a6ca36462aa94646ee6e14e022331d472b3f8cb806eef2a8bd0640a89c1", + "maxLendableImpactUsd": "0xa696760d7618dbc157257aa7e5d7c2b12cb3f5ee0dbe3a5fe02f7979f327e028", + "lentPositionImpactPoolAmount": "0x6fa08dba1f1d10143d59ca5ec6752871c3b19412c7235899b09dfcc00af60e9a", "minCollateralFactor": "0xf67fd77e9442ca54cf9851feec12819f4bd320e432f7ab1111cc775b9bddd543", + "minCollateralFactorForLiquidation": "0xf91cb8d735678f9b6455105a627fed7029da41c0ee1db64713ad218cc3fb4b73", "minCollateralFactorForOpenInterestLong": "0x76df1c8a6b2192aee31ce7da93f1801aa488f2cc6fafe8348bc7603d11b2bd54", "minCollateralFactorForOpenInterestShort": "0xbb137e83f8e614721bed724ef82250aad6525ff6fa83d9421c69e81a4572b75d", "positionImpactExponentFactor": "0x93ed1ff765c6467493cd699f6aa9c0ac23402e80c5b045be5fefbba77ec8c4fc", - "swapFeeFactorForPositiveImpact": "0x18a2d2a2a65816643f3f28661a0e8f9973f4bd6d0c80df41f4c683e75331aa9e", - "swapFeeFactorForNegativeImpact": "0xcf2315f65481f521af66a64d93e8dfc653d2616448c5fdda9dd6a1878caa6374", + "swapFeeFactorForBalanceWasImproved": "0x18a2d2a2a65816643f3f28661a0e8f9973f4bd6d0c80df41f4c683e75331aa9e", + "swapFeeFactorForBalanceWasNotImproved": "0xcf2315f65481f521af66a64d93e8dfc653d2616448c5fdda9dd6a1878caa6374", "atomicSwapFeeFactor": "0x83da1e3a9fb8be7e763b6f0c4a6cdeaad58b598ac5065b44b0a2c9b2244908a5", "swapImpactFactorPositive": "0x6524171a312035ff45f09f5ce5e8e72b493a0151fab50a7e3f7952fe870f855a", "swapImpactFactorNegative": "0xe35e936f9c891f0d8a39f444f436acd668d642d2fe6649bd198fa3152d081f59", @@ -4928,19 +5408,24 @@ "maxFundingFactorPerSecond": "0x3edce080c912c7159cc2af9be9b8d935c1e7da94d34f245e78fe45f547230aa1", "maxPnlFactorForTradersLong": "0x0f8733db56596bda2e7a935523fb8e2ab57238e87b16fc8808ceabf130bceb7d", "maxPnlFactorForTradersShort": "0x95cb2326f5d5f7cc3feabb0627300da352237384e54372d57ea4c02cd2973134", - "positionFeeFactorForPositiveImpact": "0x892bd9f05d3a31b47484ce9ac57301be8abc4e1dc63786a1ba89922b76c5a068", - "positionFeeFactorForNegativeImpact": "0x72e8e66dfa0b152d0d25abf49693232039bfe8380ea6f7231c7d2eccbe8ad3c0", + "positionFeeFactorForBalanceWasImproved": "0x892bd9f05d3a31b47484ce9ac57301be8abc4e1dc63786a1ba89922b76c5a068", + "positionFeeFactorForBalanceWasNotImproved": "0x72e8e66dfa0b152d0d25abf49693232039bfe8380ea6f7231c7d2eccbe8ad3c0", "positionImpactFactorPositive": "0x12f5976404087d471f16a033855bae40461ef2dc929e67aeed5e9a89b30bdac1", "positionImpactFactorNegative": "0x7b8d79a21965f2b3717cc43341c47aa71ee8dbbd3f50bf6e38c1afa0e080caea", "maxPositionImpactFactorPositive": "0xa31980d133a84f9bcf168fb28e47f09089949e08dcc38d4edf1edaa963c8518d", "maxPositionImpactFactorNegative": "0xaffa30444e90436e6bfbe272aace9d6acc910774643e6e44d1987d96679b9ff2", "maxPositionImpactFactorForLiquidations": "0x1cee7bb847cd721fdf49b3bed05d17e8cc1ecfb8199291c1a842f18c45762031", + "maxLendableImpactFactor": "0x0c3fe7038f76707787807a08f93c22dd14a490a2a204b9959435c8ec3442c51e", + "maxLendableImpactFactorForWithdrawals": "0x2188536e3974554bc6b3ee5f38d150fe9e7fc259e72e68b07e6bded472b39c40", + "maxLendableImpactUsd": "0xf0f6309864d086d2e0fb7da646adfe979619767ba4c3198c598c56b5ac051615", + "lentPositionImpactPoolAmount": "0x25c6b419467d06997d151a1721b1f20439723998c5aaba86c136bc5a2f6e4d2e", "minCollateralFactor": "0xcee0d4cd08657f94f4c538e07c7020de356cd64a601fd6e58c8da6896d0f15f1", + "minCollateralFactorForLiquidation": "0xd901a64e17c3b8de6009bb0664596c577794080f85649ff18e1c52c6496b1171", "minCollateralFactorForOpenInterestLong": "0xb20b211dbc8ddafec3527b5303e70d11d78510e03ad73616837e18b58dbcbe54", "minCollateralFactorForOpenInterestShort": "0x0d8002a33d3e210a6bb7edc11265d891b4054384165307478bb6692adfa413a7", "positionImpactExponentFactor": "0xdc269f2a393ac393db33d43b78286c52298d019d82450953e2597ad86d2cfeea", - "swapFeeFactorForPositiveImpact": "0xa5bf8672cdc8d80a7f7d173aed9e45cb655f8a7553d8748d54f7676d43b4e300", - "swapFeeFactorForNegativeImpact": "0x145d7a7b634ae4afa918af32435fdccf07cbc51975c337dd4a65153591172321", + "swapFeeFactorForBalanceWasImproved": "0xa5bf8672cdc8d80a7f7d173aed9e45cb655f8a7553d8748d54f7676d43b4e300", + "swapFeeFactorForBalanceWasNotImproved": "0x145d7a7b634ae4afa918af32435fdccf07cbc51975c337dd4a65153591172321", "atomicSwapFeeFactor": "0xf257b603234c802c7fc31101bc28f671a4d859c4c0c0f412d5c8efa81958b28e", "swapImpactFactorPositive": "0x04c5699d604ec5a80450d9d5d087144970d05fcead05c845b2d6559c131306fe", "swapImpactFactorNegative": "0x53260868c297fecd4de6a79d9bb2f0b4963724d73a2575a30a915b8e3de06aaf", @@ -4979,19 +5464,24 @@ "maxFundingFactorPerSecond": "0xe9f7a798f1e64760d998eff76c83497e6d3bae5076f10387ad3d25283e7f0756", "maxPnlFactorForTradersLong": "0x72bc2700738b014a9020ed163c657bf4be3e5dc90657a5445cfb4ce3b268b5b0", "maxPnlFactorForTradersShort": "0xfa55c015211801f65f30c1b310b88b26bd239bdcf195280d93549b435f9f2cd3", - "positionFeeFactorForPositiveImpact": "0x9352efb9ed4bb260d234be3cc930ca526a6a449f01b3ea5d90c4b3d280759162", - "positionFeeFactorForNegativeImpact": "0x641becad1584896609a18d89e20b68219c6b7be463eaf6174e148545c35ef443", + "positionFeeFactorForBalanceWasImproved": "0x9352efb9ed4bb260d234be3cc930ca526a6a449f01b3ea5d90c4b3d280759162", + "positionFeeFactorForBalanceWasNotImproved": "0x641becad1584896609a18d89e20b68219c6b7be463eaf6174e148545c35ef443", "positionImpactFactorPositive": "0x4ce50be0d27419784013eb08bc367baebaf542d94e0e35f3546b9dac0ce73766", "positionImpactFactorNegative": "0x2d7f9ea326be405dbafa7454545a09317540967ed652af75628dfa77f06933a7", "maxPositionImpactFactorPositive": "0x72466ae54a1f7c4298fcf5393d74a79fedc73944eeba90fdb7d1b5e3dcdea11b", "maxPositionImpactFactorNegative": "0x692f5b72683ecd6cc81b8e7b11d29f65f83bf0633e823ac97aa63c307c5aea90", "maxPositionImpactFactorForLiquidations": "0x08be8b867001c97bd4eb42be9b92ac20799bb0760f09cc3dc0bcc834220855e3", + "maxLendableImpactFactor": "0xa47b27d0059fbc137157c1c7296f6dec82ae86c2b057e44427bbbfbedb66c7f1", + "maxLendableImpactFactorForWithdrawals": "0x886c9117e996158f48cb22df0ff02ae4b5b435ec4278474d4cf7ed8607934a3d", + "maxLendableImpactUsd": "0x1c7655be4d65e05641cd067c7dcae99bc02e46f6ff9026a4340a709187b2950b", + "lentPositionImpactPoolAmount": "0xba2682d0b463938322cf1b2fc05e54d63a3bd942088aa3ced8c1e202a58fbbcf", "minCollateralFactor": "0x599cda8749b7b1a8291e1d4bd8da114ac14acf9f13ba7d2fcb8011b887469a1a", + "minCollateralFactorForLiquidation": "0x2a970205b1409ecd739d0efd67713aea8bfc8f7dfc531f8a378f31adc6d5d0fe", "minCollateralFactorForOpenInterestLong": "0x0ebd847abf1588de8f7a20e53835417c8f55b25f632784b243b921e83aa1db4c", "minCollateralFactorForOpenInterestShort": "0x2cf97b6e306aedd4f13e959cba0194e4d0551eb6b2aeabe2b44a77fc5544fed7", "positionImpactExponentFactor": "0x21e18b6ada76a9758f2c252f5f66feb66f15d029f30cfb06d6794080b05d1dcd", - "swapFeeFactorForPositiveImpact": "0xbc1df01093272c457bdf9d8b83e5f99c06ced2bf7c36bf56bb391a5854e7c7ee", - "swapFeeFactorForNegativeImpact": "0xe19b3f0fd99a2b31826d3d750a2c993975a9218c4605876820de37d1bf766dac", + "swapFeeFactorForBalanceWasImproved": "0xbc1df01093272c457bdf9d8b83e5f99c06ced2bf7c36bf56bb391a5854e7c7ee", + "swapFeeFactorForBalanceWasNotImproved": "0xe19b3f0fd99a2b31826d3d750a2c993975a9218c4605876820de37d1bf766dac", "atomicSwapFeeFactor": "0x6203d9af25c2f24724df74e18c6ff6084a5c14c68ed74dafaa89438e2287f6a6", "swapImpactFactorPositive": "0x856ad0ae542957677f61ef46a1f09c648c517e14d5aac391401a6fd84d512de1", "swapImpactFactorNegative": "0x958ab36c0743cc8b24487034dd1b67aeaf095178896263abdeb003ded0edebaa", @@ -5030,19 +5520,24 @@ "maxFundingFactorPerSecond": "0x8632b27e7def10dea4b07b59a8a81e684a74728bc5ea3299be98e021e82111d8", "maxPnlFactorForTradersLong": "0x175c3ddd30d95f2f62727fde459fab22222f3106b0831b38316cf7e858e44bb4", "maxPnlFactorForTradersShort": "0xc694945b20c2fd5a477e91a758c8c4d03fcc2cb9ac4e63ae8f8b444f4cdb8884", - "positionFeeFactorForPositiveImpact": "0x7aa25b2b9295464e79bdc2bf8edf99658f6ed9cc0070ad2ba6b184c2bc492a58", - "positionFeeFactorForNegativeImpact": "0xf84d8d4636f980c9e6695fd9833295798db2920e450ce319b515a3cd0b0d9a8c", + "positionFeeFactorForBalanceWasImproved": "0x7aa25b2b9295464e79bdc2bf8edf99658f6ed9cc0070ad2ba6b184c2bc492a58", + "positionFeeFactorForBalanceWasNotImproved": "0xf84d8d4636f980c9e6695fd9833295798db2920e450ce319b515a3cd0b0d9a8c", "positionImpactFactorPositive": "0x9b9a6cfafe1eb60f1b25b153cf1bb6cafbef9b030da6adb1a2063ac360f23662", "positionImpactFactorNegative": "0xf48b19207a3ccf2a6cf634e4ba37a6d3065ba6438e0ff10e57e722394d6a4d4f", "maxPositionImpactFactorPositive": "0xd804c0f6e6ec8e65a8017f96e7a50e795c0baf4c5cb9e748aa00efc78c41aab5", "maxPositionImpactFactorNegative": "0xf792b9c6c740721664f21eaebf5c6c1898594824ac2505d3c527c57bf59368d1", "maxPositionImpactFactorForLiquidations": "0xdcadd6faf113625d0fe7287ebeea383192234486e31204a612c6da64a577b720", + "maxLendableImpactFactor": "0xe1c3f5474838032fecfd72219fc38d0bb051223d18f286acb64ae091e864db6e", + "maxLendableImpactFactorForWithdrawals": "0x7db4c69e6602ed79fddfc3584d055c3eb77620dee379d8bc204bc4f016b16e33", + "maxLendableImpactUsd": "0x5eec370632915d936e214e635550ff1d8550bfd877b7dfc7009d6e63d6fde2f4", + "lentPositionImpactPoolAmount": "0x72ad21bbd2331b51ca89bf19af1ac0ee1368ffa9fb81324743ffd495c971628e", "minCollateralFactor": "0xeea5901e5e5e8363f56dd49d5edd7667799d757d62b1b44605e733fca56395b5", + "minCollateralFactorForLiquidation": "0xa6483f30e7f86a80add0ec0803bd63edc2a3cd4c80b696924e18b43428fafc54", "minCollateralFactorForOpenInterestLong": "0x098ac53af972242c2bf90966b71274b0503daa3d7415109382e89aec3f0d5fcc", "minCollateralFactorForOpenInterestShort": "0x272f94b4401da17e4b6780e7b3503e62844e308c94d18b08a79ef4400786e98d", "positionImpactExponentFactor": "0xfbf1fc3654cd4402abd21435b47f6f64defcd9c2a261d0ad6d5f73df6f861362", - "swapFeeFactorForPositiveImpact": "0x15386dbc11dd0bcb2e4b184a1139129f2e348a083c59042fb520d811bc6b67b7", - "swapFeeFactorForNegativeImpact": "0x69d548651306f8b9d0d7ded4c22928fe35c2075e9e71c54032a9063f0b71a6d2", + "swapFeeFactorForBalanceWasImproved": "0x15386dbc11dd0bcb2e4b184a1139129f2e348a083c59042fb520d811bc6b67b7", + "swapFeeFactorForBalanceWasNotImproved": "0x69d548651306f8b9d0d7ded4c22928fe35c2075e9e71c54032a9063f0b71a6d2", "atomicSwapFeeFactor": "0x1149ab7ad33a4bc7e61ac7ad65652409c54e67736fb94a97a61fdaaea746373d", "swapImpactFactorPositive": "0xf539169edc1b866f4a532d157e90d5c31ddc3671eb3bb994ab4d7df62cf8cecb", "swapImpactFactorNegative": "0xc67c8191ecee9d9ab2d8eed8f244939cef958b6a8429ca9924390e951785a5ac", @@ -5081,19 +5576,24 @@ "maxFundingFactorPerSecond": "0x20524a39c8d595c269542d849f64c3b01a930e37e69f4ea0bcc3a4493eaf9452", "maxPnlFactorForTradersLong": "0xdb830a2a09baf63007929541aad630b10fc49261a647722d474c78f655295d47", "maxPnlFactorForTradersShort": "0x1399d1f85da0ce3fd72c07f4af875870b6c8ab8c6112cb11547638a574a6a78e", - "positionFeeFactorForPositiveImpact": "0xf2c0c481d616dc6e2e9624308411f1242b08ea711f32e070961ddccc13eec8e8", - "positionFeeFactorForNegativeImpact": "0x512e54b494da1d43ac439edaf0bcfa40ed082eab6492f35975755ec6d7f63593", + "positionFeeFactorForBalanceWasImproved": "0xf2c0c481d616dc6e2e9624308411f1242b08ea711f32e070961ddccc13eec8e8", + "positionFeeFactorForBalanceWasNotImproved": "0x512e54b494da1d43ac439edaf0bcfa40ed082eab6492f35975755ec6d7f63593", "positionImpactFactorPositive": "0x7a469cb478f0dea58ef5170e64b2877172d6e8282e004fe4d80ad030d5fc46a4", "positionImpactFactorNegative": "0x8811ba3a2dd8e033d371a6e20ebd8768e85d7bbae2930f9a5a1ed0f98ac8157b", "maxPositionImpactFactorPositive": "0xbfcf411a0c483db3eecb460672671d3be8c4aabb54e8dfdb52169d0b5e1d9a78", "maxPositionImpactFactorNegative": "0xece579ffbd1bf9cc94eb71c1e636481a3114ae6547d92786ffe0be4ed3f77898", "maxPositionImpactFactorForLiquidations": "0x3ad1deb3f886d676008e3c1ca67fa6465e0a203c3c2694cc3dfaedd6eea3e709", + "maxLendableImpactFactor": "0x3afd6526cab711eb423fc6438587bfac0995909c8007185d7e808da93af7f049", + "maxLendableImpactFactorForWithdrawals": "0x12fc6f883558bce46b1fdf6efa258c9575e099359f89233922d54970ae60e6d1", + "maxLendableImpactUsd": "0x745fbee397dbd9e4a2aa9c6ef299f187ae70db0f9d8b51906824108e7fafdfbe", + "lentPositionImpactPoolAmount": "0x0fb07e631c78007ab0a1c0b6cebd2c5687790c60f7f6185a09c13ad748fa94cf", "minCollateralFactor": "0x197dc11afd89a4579335ecc3e2cdf3f42c666b348dbdfc39eb1389913b9e1f22", + "minCollateralFactorForLiquidation": "0x1944c38597cfa42fe45895448cd9c319a40de1226cfe211e755c95638673d78b", "minCollateralFactorForOpenInterestLong": "0x8849255dcc39c605b9264107f43f7f5249f9bfcf284097be0dfd8cdef4f1ad52", "minCollateralFactorForOpenInterestShort": "0xa1076d5f2603039a1ae1dbf4b47a94d472f445a9d6f273137e289338838c3333", "positionImpactExponentFactor": "0xf78baa451beb79ae8d00ad4d35e475d8e488198a940b291c8960820f62841473", - "swapFeeFactorForPositiveImpact": "0x920ada93ca7baf660918360668d5c77367a6adc35234bfac6f6f30eca47b1892", - "swapFeeFactorForNegativeImpact": "0xfb4196fe9108ed2af77777408949219b02d15307c2e59b8deff3d8899f7e753e", + "swapFeeFactorForBalanceWasImproved": "0x920ada93ca7baf660918360668d5c77367a6adc35234bfac6f6f30eca47b1892", + "swapFeeFactorForBalanceWasNotImproved": "0xfb4196fe9108ed2af77777408949219b02d15307c2e59b8deff3d8899f7e753e", "atomicSwapFeeFactor": "0x2611d915678c3ba3835d10a745d3b62133daf635b52273675675f0dd32ef5105", "swapImpactFactorPositive": "0xf50e95ce46085e5f5abc37698e61eb49a9cebdda3a633e376c7b3668c71f5066", "swapImpactFactorNegative": "0x75e480a70248780f710fbd00017aa698ae7ca38f06b5d16f213df891c2becd68", @@ -5132,19 +5632,24 @@ "maxFundingFactorPerSecond": "0x42b07943bbc0fee043cc3911936469143fefc43fd7faa6ac215da8128e05f7c6", "maxPnlFactorForTradersLong": "0xe417e27698ff4cade71e0acf114b55775b57998ee2499174fc50ecf2287b4934", "maxPnlFactorForTradersShort": "0xf1bd4d5f9a4c164f7664edbf84132833b0c44cb440d17fac0b2237059ab19cdd", - "positionFeeFactorForPositiveImpact": "0x847db1019a24ed30b3433cb4f148a23795a8554baf38686f0de4e67f35a7dc42", - "positionFeeFactorForNegativeImpact": "0xafd8be0cc8f262a4773ffc33a94686d627a641f25f658ab2178974fd694e5cb3", + "positionFeeFactorForBalanceWasImproved": "0x847db1019a24ed30b3433cb4f148a23795a8554baf38686f0de4e67f35a7dc42", + "positionFeeFactorForBalanceWasNotImproved": "0xafd8be0cc8f262a4773ffc33a94686d627a641f25f658ab2178974fd694e5cb3", "positionImpactFactorPositive": "0x8e3a8d36dedf177ea0c49ab3344eff549ac752100ea420b6028f98de5bae6274", "positionImpactFactorNegative": "0x823e24ece46ecf8af8e26399b4b258306ef66b2090e88e6750c24d5c93daa9f1", "maxPositionImpactFactorPositive": "0x1f7af453f36b2ae2eb7da0d04e4e1f167cd6a3456c2ab0986fc20ca4efe0ce9b", "maxPositionImpactFactorNegative": "0x4763ccb1a899511fa524032c5502e529852c0ff01cbe65414504a20b3af70f75", "maxPositionImpactFactorForLiquidations": "0x9aa3b6fcc12a7ff3e23d854dd6cebcd3dab2e2f109997c63adc5ee5f011aab23", + "maxLendableImpactFactor": "0xe99cfffc264b67c9ea5b47ba9a87de70077b44cda0d4a660a46ac809cae25b45", + "maxLendableImpactFactorForWithdrawals": "0x65e3df1d8b7b27cb8352ca11ccd1728167b3ed13dd2d1720c35fd5be840a1ca4", + "maxLendableImpactUsd": "0x03e381a03fe0e9c3d4575767815e736fc6a65cfb107aa3de361c74566f21f214", + "lentPositionImpactPoolAmount": "0xf8af95d9c90caf32d6c2d1a96738e2d2b54609bbcb95ed9b0c72a1dfad82d125", "minCollateralFactor": "0x1b290507ed4c18f8d153e6b8ea42d03ccaca41bd5840eaea855084ec1e3c6fb7", + "minCollateralFactorForLiquidation": "0x22792d6b6a7d400242edceedf07505e6d1b55ed62e2ea73558d2eb3975aa07b6", "minCollateralFactorForOpenInterestLong": "0x7a21b1bad18f2929d4abd3fae6e5292ba91b468230661c4a9153381bf4bde9f5", "minCollateralFactorForOpenInterestShort": "0xfaa2dfea02a378d3f445302ad4d018ebf25d2efc81a8f78f8b5c999126284f2a", "positionImpactExponentFactor": "0x45485db332baa33654279b12e959c160e8c490c950a66707ce6b0070d4a9beec", - "swapFeeFactorForPositiveImpact": "0x3ef7d02bc5b049e46654695f4d4cdcb0da8174292c1ccb2ae66bc547d084a35a", - "swapFeeFactorForNegativeImpact": "0x9f3aec9f5417900c61bc567fd4ab582ee286a16ea86b041e4e12eb810a70b1dd", + "swapFeeFactorForBalanceWasImproved": "0x3ef7d02bc5b049e46654695f4d4cdcb0da8174292c1ccb2ae66bc547d084a35a", + "swapFeeFactorForBalanceWasNotImproved": "0x9f3aec9f5417900c61bc567fd4ab582ee286a16ea86b041e4e12eb810a70b1dd", "atomicSwapFeeFactor": "0x980aafe9db4d75676c435b7a079a84808ba90ace4c733e396244dad89b4f8fe1", "swapImpactFactorPositive": "0x989a958fe693c45261754194c1c09e37a7d131e3caa329427de1e0635aa6ae06", "swapImpactFactorNegative": "0x729ebfba77820dc9ec925f21523d7ba5c66a36b235d071d93e2ff61f815e79b6", @@ -5183,19 +5688,24 @@ "maxFundingFactorPerSecond": "0xd0c63c0f5ae6632f857fc7e43450976ff2247aa6d082f470d7f6ff9271d45b63", "maxPnlFactorForTradersLong": "0xc19bc186179470fd38b60a0ddcb3abf05fc88228b09fb4087c4b58a2bb27bb57", "maxPnlFactorForTradersShort": "0x3d794a66e8d1eec14d853a48cb274d0b2c933e00686a66a64d8001d1e3e21053", - "positionFeeFactorForPositiveImpact": "0x432434d8e5381ba58e891683566e60d591c3c9dd4b2a41dcbac6daeed01f37ee", - "positionFeeFactorForNegativeImpact": "0x0b7ff30c6d3fd72bcefbca600d460c64e3c7ad8ab3e850b6de145dfa5927e027", + "positionFeeFactorForBalanceWasImproved": "0x432434d8e5381ba58e891683566e60d591c3c9dd4b2a41dcbac6daeed01f37ee", + "positionFeeFactorForBalanceWasNotImproved": "0x0b7ff30c6d3fd72bcefbca600d460c64e3c7ad8ab3e850b6de145dfa5927e027", "positionImpactFactorPositive": "0x35d3f9d839458d92f915fb9ebf041cdd3f291a7d62c75a73dec65c02994f8648", "positionImpactFactorNegative": "0xd67f5913a36a87caea58a6d9fb8359e9c05de645f929c178385ed6a622d15849", "maxPositionImpactFactorPositive": "0xbb6361a2148635ce7d9016d845bd99929be2679058b3c426ee6539b63a6c79c9", "maxPositionImpactFactorNegative": "0xf75f4eed74d924c5b010afcfeebc0a4199e464d9f20c0f688d37010cc68a242f", "maxPositionImpactFactorForLiquidations": "0xf62bb6f59876d0eeed6e3c0720e740993f5cb6cbf8be0b62a2284816dff67e6a", + "maxLendableImpactFactor": "0x0f650a0bc66775f82838a085118daf1edb2aa3874c20c3dd8451c30d84128f12", + "maxLendableImpactFactorForWithdrawals": "0x36de2316a484d963f1c9a7e6c24fe1e1a8f888d1c94581285c4d644b38284d11", + "maxLendableImpactUsd": "0x82ed11bbade9f2e229c7c4c760abac958134150d426b2a83ed375bf16d28b704", + "lentPositionImpactPoolAmount": "0x8228f43464765c8548833dab87d6ffc57e4d2a9a443142de6400582a225ef905", "minCollateralFactor": "0x5cce857e2742c8ca996e8b42fd3af61196fe33fa7385ddec3ceec5cc7f62ad24", + "minCollateralFactorForLiquidation": "0x300d7b83c28097683856f9e2686505916f1b5bfbc62a6fccd6ce5aabb8cf48b6", "minCollateralFactorForOpenInterestLong": "0x1d820cde050256acefd96c32ccb6be28d4d6109cb72dd08e2bfb56e7b6e9a73d", "minCollateralFactorForOpenInterestShort": "0xc553733dc3acb295f0e3b96bc2619537a3f2c1f932fa5d541a7168fbcd639fc3", "positionImpactExponentFactor": "0x3b96f8ee57d055df827e1af2670a7580089991fc0d51b7711af29b2252bbb4d3", - "swapFeeFactorForPositiveImpact": "0xce14b2aa2425696565c2d15d18113436079f9af6aa2ca16d7fd47af67077c876", - "swapFeeFactorForNegativeImpact": "0x24d93a752c4a3c3003fad0e2b9e57b7d23f02e9d6f5bf0d47f3cf0f339f2495a", + "swapFeeFactorForBalanceWasImproved": "0xce14b2aa2425696565c2d15d18113436079f9af6aa2ca16d7fd47af67077c876", + "swapFeeFactorForBalanceWasNotImproved": "0x24d93a752c4a3c3003fad0e2b9e57b7d23f02e9d6f5bf0d47f3cf0f339f2495a", "atomicSwapFeeFactor": "0x24f9d72f4f6789a454120a032ead4225d5b3b67363249abb09e9a17d361d6bc5", "swapImpactFactorPositive": "0x1ea2bab7e1f81014c954b3dce99e3748c6871441b6af46ec3b1b6c53f372360f", "swapImpactFactorNegative": "0x845e8b715731e873f696c86e30d4d66195e14cba387d692b8789e1ff74ca9ee8", @@ -5234,19 +5744,24 @@ "maxFundingFactorPerSecond": "0x3565d4c7d9d67a2ee10f18d17166a9c3d1da0073e64c67a43095a084173e1789", "maxPnlFactorForTradersLong": "0x996854ee2cf03cf2f36b4909ed88ca57c1c6fd8b131859970a7ab711b80dae13", "maxPnlFactorForTradersShort": "0xc5dd88327c6eb79d49cf3fae54bd442af1d7c2819842bb2aa83fcea9fd7b3757", - "positionFeeFactorForPositiveImpact": "0x0d7dfaa3a81d3f6bb5275985f8496f2ff5753e673d4223d149552eaf69f53987", - "positionFeeFactorForNegativeImpact": "0x67bd9caeedd682cd887a0f5e4f0794cfedd0f9e87d3e070e3ab7d12b102d0112", + "positionFeeFactorForBalanceWasImproved": "0x0d7dfaa3a81d3f6bb5275985f8496f2ff5753e673d4223d149552eaf69f53987", + "positionFeeFactorForBalanceWasNotImproved": "0x67bd9caeedd682cd887a0f5e4f0794cfedd0f9e87d3e070e3ab7d12b102d0112", "positionImpactFactorPositive": "0xee96af88af9c39f720eb03b78ee25460d7d64a8da8801e8a0175bf0e8595a607", "positionImpactFactorNegative": "0x4a0f697c9700f8f2db295e3263080ec671f40e3b8caba07af4c296b14dba5b1b", "maxPositionImpactFactorPositive": "0xc3b6473f36d612a66a9d2b16f54536e1337af2c4a100e2bb8faa02b210f1e43c", "maxPositionImpactFactorNegative": "0xfca7b27421c42baa94a4a3fa24a5cf3b8862432ff9c05380967a44c0ccb6b18b", "maxPositionImpactFactorForLiquidations": "0xa8db6f5afd96462572fee20549475d51537f7ceb0b600019a99142722c4154be", + "maxLendableImpactFactor": "0x2671b5d5029245a30dfddbe4905dbf2c37a9fd7d61e1835fc5cc19f19bb19dcc", + "maxLendableImpactFactorForWithdrawals": "0xe6e1dfbce6abd35d2f60ec331cc183fe59c76696fa34c881b7a06e3d8e0c7fe7", + "maxLendableImpactUsd": "0x567c74c47e4fb9204230b9876bf7b68763f046b66e30c25f55767e3f50dc644d", + "lentPositionImpactPoolAmount": "0xf2c1ece85f3f914cd8b04bc8a5685ba94cfbba25cd8536ba9e9d5985465951b6", "minCollateralFactor": "0xd4c3978725e4f0793124f79d7eab6b3ad60f4a14e9a2fa6be3f9ca3186138cea", + "minCollateralFactorForLiquidation": "0x9996a4847c6306981151e04717d3c51afec65f0392af29c7bd8abf9cd379d377", "minCollateralFactorForOpenInterestLong": "0x1b19830a06a6cc77730f7f0dab868f056fe82652f8ad897ca9e125880b1227d3", "minCollateralFactorForOpenInterestShort": "0x9dd9ae7475e697c7bfa823582595098c48def087170f650d11f98adbd2ed824e", "positionImpactExponentFactor": "0x69faa6d06a4fc137d20da6cac127b8d616687c86644538aba19f0e8c6f246455", - "swapFeeFactorForPositiveImpact": "0x2e1e66a02f233eb61899c3377e30c61a4d5a1337702823f1de9c26c12db1ca02", - "swapFeeFactorForNegativeImpact": "0xd0f878623266b2e9c002db7234bcb1e8f6b49aa7c70b5b1af084b41a9fad7cb5", + "swapFeeFactorForBalanceWasImproved": "0x2e1e66a02f233eb61899c3377e30c61a4d5a1337702823f1de9c26c12db1ca02", + "swapFeeFactorForBalanceWasNotImproved": "0xd0f878623266b2e9c002db7234bcb1e8f6b49aa7c70b5b1af084b41a9fad7cb5", "atomicSwapFeeFactor": "0xd9b869dff4dd1ad79061c7c1c40d4a1970ce47d8fef11de2e7f853d0c9b501b2", "swapImpactFactorPositive": "0xe21a52a0e2c6facc1b425c0f0a85e8054edc5c5555cc1d4ff25ca1bd6c6d4a84", "swapImpactFactorNegative": "0x773df7e7484d0513f3cbe4e22752c34474e5f9af372329af481ed87527c0a2be", @@ -5287,19 +5802,24 @@ "maxFundingFactorPerSecond": "0xd1fc06210a074798a3d8507eaf9f700de175c23098526798515da3d093ae3644", "maxPnlFactorForTradersLong": "0x36decf951766da747b2bb875b646c43c9f4548d1db9bd2983230b1cef12460b1", "maxPnlFactorForTradersShort": "0xad102f8399fa1b92ae45845f95f896d5bf61d8b53e3904b35d0bca50f2d16de9", - "positionFeeFactorForPositiveImpact": "0xebf23a62b9be6bd236fe83a4a7cdaf4a0f22063071a2045354032286b1d0c088", - "positionFeeFactorForNegativeImpact": "0xeb54a7af740d7a9353478e56d3482cd29b9c3afaae2669b1a47ccbc6ae975b96", + "positionFeeFactorForBalanceWasImproved": "0xebf23a62b9be6bd236fe83a4a7cdaf4a0f22063071a2045354032286b1d0c088", + "positionFeeFactorForBalanceWasNotImproved": "0xeb54a7af740d7a9353478e56d3482cd29b9c3afaae2669b1a47ccbc6ae975b96", "positionImpactFactorPositive": "0xddf60db455866355beb69621cc530e07d254c81adc27b15a564d05b388f5ee2f", "positionImpactFactorNegative": "0x456efec2eb744a5ec841bd0d4b515de7274f1ca8557472a4de5c42508c4efef2", "maxPositionImpactFactorPositive": "0x3be668a8c7be13b0a349732303c4b95a907bd0e9668a4bbec4dc3f1ed5e7c2bc", "maxPositionImpactFactorNegative": "0xd8d979478a3b8bceafa8a848b25784dd00b64bef081c4c1dc9dd60bff7cea798", "maxPositionImpactFactorForLiquidations": "0xbbfe96bfe46f446d24be78d7bd2edd34334294e89048f8882360bb743584cf7f", + "maxLendableImpactFactor": "0x9db704bec7ac071e0e90f7a93461809904f80664c78d05e69d231e9439dd5dfe", + "maxLendableImpactFactorForWithdrawals": "0xba0e0bf03d0c02aa72bc5fc17c3ebd655ee0636528247532b4e13226a1037ef3", + "maxLendableImpactUsd": "0x68cb741fa9d254bfcd5c73666794d3e6a3fbb6b6544049e7dffc7f04409ad248", + "lentPositionImpactPoolAmount": "0x30dfa4ec399ba1f32b162a7574da6d48c51bd0cbf10a878bed90528917e8b324", "minCollateralFactor": "0xe910b1cb7c36fa1e005d1ce213e744ebb8e19c07f0e934605fb998fb518ec4c0", + "minCollateralFactorForLiquidation": "0x363406d304aa67f7d3bbde74f80598186c221785469b490cb4927732ee1de679", "minCollateralFactorForOpenInterestLong": "0x3a15736cf99d0f99680260b5422bc87fd69925adbb1387bf7048191f19cab935", "minCollateralFactorForOpenInterestShort": "0xcf4ade53abb36ffbad4b0f4ae1379faa82afa998f3a47875c9986f82cedd274b", "positionImpactExponentFactor": "0x376b7203a91e73beffcee3efd325eb4e5f07101811d7f211fc36009ca3c95b91", - "swapFeeFactorForPositiveImpact": "0x0f8107aaf93b9fe210573d13194d9f77eaceb15b8771c42c821a0046b76f94d0", - "swapFeeFactorForNegativeImpact": "0xc6659dc00cc2d64bc22cd4217267efab7bd990328add0b4bc154feee535e0c6d", + "swapFeeFactorForBalanceWasImproved": "0x0f8107aaf93b9fe210573d13194d9f77eaceb15b8771c42c821a0046b76f94d0", + "swapFeeFactorForBalanceWasNotImproved": "0xc6659dc00cc2d64bc22cd4217267efab7bd990328add0b4bc154feee535e0c6d", "atomicSwapFeeFactor": "0x788e6796662b5dd7c35ce1b4ff0d9af55b38c49eca63a9d2560f226d15721a71", "swapImpactFactorPositive": "0x915a610544b2e035a83207d2f281b51c24cd0d652142267d6d4eb3690a449afe", "swapImpactFactorNegative": "0xf38fd5205d6308e37a289083eb9bf290becf831331de85ae14d6b8e2c0d9c839", @@ -5338,19 +5858,24 @@ "maxFundingFactorPerSecond": "0xb91853fc411f43eb24c1a9cb597ea51291798489477cf5983c01a385db812d62", "maxPnlFactorForTradersLong": "0x8d750459295a168d231d34ac38231e1d2ba6dfa008a6d164ff6a72509d095f4c", "maxPnlFactorForTradersShort": "0xdf531b55429ddeadb59af967cb730b299076d579cdb25bb1cf017a0326f4284e", - "positionFeeFactorForPositiveImpact": "0x0d325124b70072382ae96a7cd97da4d8a5a51f68468d67f742addfcf4a4f669a", - "positionFeeFactorForNegativeImpact": "0x6fa4e6c42336bf8f1d32bb48964ba1c24df421fd3d1072a63b1528b2a8a4b609", + "positionFeeFactorForBalanceWasImproved": "0x0d325124b70072382ae96a7cd97da4d8a5a51f68468d67f742addfcf4a4f669a", + "positionFeeFactorForBalanceWasNotImproved": "0x6fa4e6c42336bf8f1d32bb48964ba1c24df421fd3d1072a63b1528b2a8a4b609", "positionImpactFactorPositive": "0xc3112e11103bfb1a728062fd6fb789086df6e7819d99cadc56161673ec2f5747", "positionImpactFactorNegative": "0xbcaa544b510afd8e66299f43b2457e58d68d5ee44a0e71314a9c54ccda29166b", "maxPositionImpactFactorPositive": "0x885c542053b7fa77c9a4a2dc267dcb133edcfafd7c93d3e34b3aaaeb84d71e15", "maxPositionImpactFactorNegative": "0x6a5409f88cb735d2e2ff70cc0c5738c19422c5543034d1bfc997cb4e8e0ff913", "maxPositionImpactFactorForLiquidations": "0xb6f88dc723473750a0b961170270d31fba437679f22bfde4b267a55325fa5f57", + "maxLendableImpactFactor": "0x6905d1082b2762772ab4518370d5c5168d2c3877e2381e37393452d44fd74932", + "maxLendableImpactFactorForWithdrawals": "0x1922711cd16e88c089890bb41826689426a3ff93c3f9a56cc5afb69254caa92d", + "maxLendableImpactUsd": "0x80124f278e5d8cabb600bb5eab8b4bb250364ebcdfd43d6c301ce4f4deb5fbf6", + "lentPositionImpactPoolAmount": "0x684e8643977be0d44bab018cfe226692650c5fffe6a6a71595e8e68b6b57398a", "minCollateralFactor": "0x2bda0f19bd0a9c7a0bf9e89a4b1bcf0d06949d290d084f094d1f2daa73890e18", + "minCollateralFactorForLiquidation": "0x4675a79fa14651780daca8e35375904acbeb2958eb5414537ee4214241ee8dbb", "minCollateralFactorForOpenInterestLong": "0x6cf8feab7ea0d8a785b057c390baee97be69e93f87bd3b5ef1b32522ade977e0", "minCollateralFactorForOpenInterestShort": "0x0b5cf2a96425f12b6771217757ad7d3eef0e1a618e0d28884219088615a51649", "positionImpactExponentFactor": "0x54962ade4b4aac31514ded3d1b37063c949d3579f0ffb707be0d92b66cb3279b", - "swapFeeFactorForPositiveImpact": "0x620fd8da66402524c473af3d4496c67b9d787ee9a73d0b1ebc33c2ca501999c8", - "swapFeeFactorForNegativeImpact": "0x8b76d4be7c26e5330ccd659b7b84869b2521aee30ad02c0f64dde54d33ba740a", + "swapFeeFactorForBalanceWasImproved": "0x620fd8da66402524c473af3d4496c67b9d787ee9a73d0b1ebc33c2ca501999c8", + "swapFeeFactorForBalanceWasNotImproved": "0x8b76d4be7c26e5330ccd659b7b84869b2521aee30ad02c0f64dde54d33ba740a", "atomicSwapFeeFactor": "0xa9b44fdca74a0013f9f5a792e7c24b494f5f530b98830110e47b0d42c5fbc47c", "swapImpactFactorPositive": "0xa6ac9172d7f7529d6a77a02977721eee7008f596226749c98b3cd137f49b0309", "swapImpactFactorNegative": "0xcbd4c14cf1648fdf9f19d309a2d11d4ac497544d25f3a913d864cb326abcf08b", @@ -5389,19 +5914,24 @@ "maxFundingFactorPerSecond": "0x2830ae0739c9163de9cf708a6f6c32f662f2ad071c3499e9b12c675056298d40", "maxPnlFactorForTradersLong": "0x36fcc2dbb30808ebaad7f8c9a844eb1b4689f9a62d90e552adbbe4343dfebdf1", "maxPnlFactorForTradersShort": "0x3d08433ff57f425f4721425d4315941b31adf3f673530845a92056ba70004ace", - "positionFeeFactorForPositiveImpact": "0xac00be90a0f05763ef66e50ae8ca9e0ff056b82fac3f307ce8a14e91af0899c4", - "positionFeeFactorForNegativeImpact": "0x1a3121c3ff93d3120708ecebb47afb56c49c4c1363ea731e7b0bb8a2e228d1dd", + "positionFeeFactorForBalanceWasImproved": "0xac00be90a0f05763ef66e50ae8ca9e0ff056b82fac3f307ce8a14e91af0899c4", + "positionFeeFactorForBalanceWasNotImproved": "0x1a3121c3ff93d3120708ecebb47afb56c49c4c1363ea731e7b0bb8a2e228d1dd", "positionImpactFactorPositive": "0x850a0dee7de0bfcf04be51d47c2f3668bc4fdaab5e29e2d589984376b5dd86ff", "positionImpactFactorNegative": "0xb9e817b94ea5ac97ad5125913ad2807a275718730c2498740fc9c888d6b43a03", "maxPositionImpactFactorPositive": "0x06870bc32614718b265349bf6300294056628d60ca10f5d35c63998d55a41f8a", "maxPositionImpactFactorNegative": "0xe68bf971e0e02267b79e78933811a5fcbb67012ffb373f57d08e6053bf50d2eb", "maxPositionImpactFactorForLiquidations": "0xda655d82bdfac7f52574b69be3faba4684029b4f692b4d6e9a27e9ed0db5eb18", + "maxLendableImpactFactor": "0xfa593d54b5c34e98fec7dc8515a180443bfd9b30e100c68d75df4dfd70527401", + "maxLendableImpactFactorForWithdrawals": "0x184a90bdd9e17af13d4c8ff820c9331f157e6db5a2e18d6e5e51735e82734246", + "maxLendableImpactUsd": "0xa8b90dcf6d7893f3198c375cdd895ccc3d8497d9742cdd4877e2f876d9a33d8a", + "lentPositionImpactPoolAmount": "0x70eddaca6e85713493750fac03e971df8177bcfa9bb091ec0c121e2f0f968c86", "minCollateralFactor": "0x45d92c625d74a031ce8338d168d2ec1699f338ca8669ad7f210c98ef9461bc43", + "minCollateralFactorForLiquidation": "0xe92fa6b0415f90201edf5c668993487dbedb71de9bb489cc4bec41ecebb369cc", "minCollateralFactorForOpenInterestLong": "0xff9fe8e3365a18b999251316da505a550055626be033cf34378f1afd550a4f5b", "minCollateralFactorForOpenInterestShort": "0x770be0a07523fcc86290097d7261ec89c9c2e6b811a5abde348eec9b6afb5bf8", "positionImpactExponentFactor": "0xc64593f64cf0192c99b011e0843ca58075f1d4b6dbc285f91e812aef624b75f3", - "swapFeeFactorForPositiveImpact": "0x4ef7984fde2237fdd6c76d410cd45733e29a8208a1a444d416a4cf2c552455e2", - "swapFeeFactorForNegativeImpact": "0xe14d026478c114bfabffde611c4387b3c1ec943f2fc6b1304d98755239ac4946", + "swapFeeFactorForBalanceWasImproved": "0x4ef7984fde2237fdd6c76d410cd45733e29a8208a1a444d416a4cf2c552455e2", + "swapFeeFactorForBalanceWasNotImproved": "0xe14d026478c114bfabffde611c4387b3c1ec943f2fc6b1304d98755239ac4946", "atomicSwapFeeFactor": "0xc4d687e7509a762728b1ea111a0ce1183ee56281a43f6b3c16a44a935ed87041", "swapImpactFactorPositive": "0x4b1439a3ac79073d516183f0266a7545a2d55413d776d8837dbba0d3238f3744", "swapImpactFactorNegative": "0x15e3223c9f47dc35339b9fcc3a24b9984db33d7a74d7e949f62e3f082f005e20", @@ -5440,19 +5970,24 @@ "maxFundingFactorPerSecond": "0x2c064f54afa3c1d6d05b856843db27379f139cb7e88aa826aba60051b5a0c9bf", "maxPnlFactorForTradersLong": "0xa8005a0f060de7da9b23e9af19cfef87a6e232331d9f356a74ac63f8df764658", "maxPnlFactorForTradersShort": "0xc532b70d99e867d7eb5cb21b12c09a281e800f89ef7a7477438017caec63b4db", - "positionFeeFactorForPositiveImpact": "0xf44b4bd2efe1f90144b6e87f9f83928ff11876ba474225b551b9728f684be6d7", - "positionFeeFactorForNegativeImpact": "0x3f12c9cb349f4feec74d2fcbdfff7757fe630c8d65b95af0f23dd5a01cbf7f14", + "positionFeeFactorForBalanceWasImproved": "0xf44b4bd2efe1f90144b6e87f9f83928ff11876ba474225b551b9728f684be6d7", + "positionFeeFactorForBalanceWasNotImproved": "0x3f12c9cb349f4feec74d2fcbdfff7757fe630c8d65b95af0f23dd5a01cbf7f14", "positionImpactFactorPositive": "0xe7e37a77797c58eed5479a474355840c4b068f56e66f1fd356518754d41e8d71", "positionImpactFactorNegative": "0xaea38fd5a23fbdf8e436805ba7d16709b9587de0e613614a27e241159c532cc3", "maxPositionImpactFactorPositive": "0xe58eaeb5cb769661e5812ed30888816663d04e418a2a2294a60dc183998bc24d", "maxPositionImpactFactorNegative": "0xbdf2714c7cee0ba4bc78512846368491218658bf4506af2c0a5560c5d2ccb98b", "maxPositionImpactFactorForLiquidations": "0xb0ea1a8a442d94107fa9d601c8fe41c3071a4f6a212f6ee8cf5d2f3af03af9f3", + "maxLendableImpactFactor": "0xe2a4e43bde1878da29dae5a7787f199a8bb5e583957c3ddd566ee2d466af01c8", + "maxLendableImpactFactorForWithdrawals": "0xbf2805b8a8888767a4b59cf8ef33f341460051999a88a860f0d352014d579a12", + "maxLendableImpactUsd": "0x8fc9544d8899a2083f0091010b86542f2c88c79f9f46951724d8d8b039c94407", + "lentPositionImpactPoolAmount": "0xec44cf942c5f80c1aaa3001e30261cf0af83d55f473974a1c1c7af1e94f2c720", "minCollateralFactor": "0xbaaa90a41b92be436a5c13d02137ab4d1da57a1256942b29ff1122f4ae3910ee", + "minCollateralFactorForLiquidation": "0x87ff74340b078cfd33cae47ce1e3ddb268a2380d8badb47bb14ff760be63c9a8", "minCollateralFactorForOpenInterestLong": "0x8cbab030e059e5061c5844541de54fd884103976d5748b1afc27800eb6956781", "minCollateralFactorForOpenInterestShort": "0x964f5425e2d87724d0e98f792e7d202ad30cd08d5b28a305041ef1365fd64c24", "positionImpactExponentFactor": "0x1a4921b5ca5088e7e780e76a9b8c2cae1f8c46ad9238eecd0677d65eeb88c8a1", - "swapFeeFactorForPositiveImpact": "0x6f04144bb368e6acb012e2a47ebfe5802a7aeb1a89c990f21c1c805091c45e74", - "swapFeeFactorForNegativeImpact": "0x62632c19dc73e4144e7d5c11add032ee54ca6c78c5bf178800e5fc530e3f6c5a", + "swapFeeFactorForBalanceWasImproved": "0x6f04144bb368e6acb012e2a47ebfe5802a7aeb1a89c990f21c1c805091c45e74", + "swapFeeFactorForBalanceWasNotImproved": "0x62632c19dc73e4144e7d5c11add032ee54ca6c78c5bf178800e5fc530e3f6c5a", "atomicSwapFeeFactor": "0x40fedddf9a8da6ade587f270ef4508b82a4eaeff05567fc8fffe4a1e958b4d49", "swapImpactFactorPositive": "0x0b7287e535216c5171cff8248a990ebfd8cff085af5f7b8d599679ad5642795f", "swapImpactFactorNegative": "0x2a313049a3fcf67138a26bc513f4c9fdd1b9585276633b01dd5de9092ab96423", @@ -5491,19 +6026,24 @@ "maxFundingFactorPerSecond": "0x53278f7d22214bd9097904f84ff59ee91463aff495cdaf5e810dde8564083b73", "maxPnlFactorForTradersLong": "0xe5e10ecab6bc07b943b0913ee1f61ca27256d563b5375b5c695809a2b59d0fb4", "maxPnlFactorForTradersShort": "0x55ad52312b9a5bbcf07832826e1e59f7dd60ba801769b7e2b9b3e2278fa232df", - "positionFeeFactorForPositiveImpact": "0x571589e332241341cdf027492e3d4374b2a93ef06874b73075cb7947f93534d1", - "positionFeeFactorForNegativeImpact": "0xa5f763cab3d8762f2a7027c677bf7c9f5786542d01a7f59c96bedc648bb035ba", + "positionFeeFactorForBalanceWasImproved": "0x571589e332241341cdf027492e3d4374b2a93ef06874b73075cb7947f93534d1", + "positionFeeFactorForBalanceWasNotImproved": "0xa5f763cab3d8762f2a7027c677bf7c9f5786542d01a7f59c96bedc648bb035ba", "positionImpactFactorPositive": "0x9810f2d2e180503c8290af9f276347ca3ce4791e1479fd6532913e67a424ba69", "positionImpactFactorNegative": "0x95e072ed96f17673dc5ebc6fa2fdd7737b58d4200f69f9fe06451d81ede06b1b", "maxPositionImpactFactorPositive": "0x7bb5f084d55a70ddca3fd48f65cca1a09c0709f02816844610198577d9f41498", "maxPositionImpactFactorNegative": "0xb581b24a566d8407faf6b940b547885f670884caa28552f4c4267ed3e292f0e5", "maxPositionImpactFactorForLiquidations": "0x5ab50ee39c6a00792a7a8994d4881f8b946180b937ebdac34e2d199a9b884c6f", + "maxLendableImpactFactor": "0x1387afb6154c7cbf8daf4f65eaadbbeae179487de4bbee973f41a0729bc0b681", + "maxLendableImpactFactorForWithdrawals": "0xaa191090a6af58e3f09e9e41a5353a606d8e25033b4e863abfe15077aad8e928", + "maxLendableImpactUsd": "0x709de5010e9f8d311a65eeb69d9b8903728d7c6a78a49ab3f838d6123b345b54", + "lentPositionImpactPoolAmount": "0x95b9d0993679ca9c2649b9f826e54f2fde0d14b3e9dc6af3ac2b338a09834abe", "minCollateralFactor": "0xae80dde9ed11f8ffd789be3583df9e79a38f49ab1ba4dbe01fb87936545f600e", + "minCollateralFactorForLiquidation": "0xcbd111c1ddb157b7224dfa2eebc5b69b6666e02062258c016e027a45b66059d8", "minCollateralFactorForOpenInterestLong": "0x3ee6bddafa71cc4e83b9278ef2f015a79ffc105e946f4b46c521388432cd9939", "minCollateralFactorForOpenInterestShort": "0x02a996d1421fa2442a1f27ce3c7f58aee300fe3089fc26ec58f76f12d1faf28f", "positionImpactExponentFactor": "0x8ed469b25e2d0ab97824ae5523c62e7010f10d1777fefd34b5035c6cfc03a10d", - "swapFeeFactorForPositiveImpact": "0x4ca3b7aa799d579bba5612492862b5bbf5f22db53b16b6f664e01e2089fff96f", - "swapFeeFactorForNegativeImpact": "0x7892b0a32c16b5e6569488049b577a75dc35440887bd5ff698747b8e8b09e079", + "swapFeeFactorForBalanceWasImproved": "0x4ca3b7aa799d579bba5612492862b5bbf5f22db53b16b6f664e01e2089fff96f", + "swapFeeFactorForBalanceWasNotImproved": "0x7892b0a32c16b5e6569488049b577a75dc35440887bd5ff698747b8e8b09e079", "atomicSwapFeeFactor": "0x980e9ca063510ef3ccf46dbbcfad2ab7317123c8c17b73377123f2b751281a82", "swapImpactFactorPositive": "0x1feef3112a12fa7240eea516d9c5fc70ea06e89d908422e4232c8bbf77d9bf65", "swapImpactFactorNegative": "0x5159d374359947b125e79c43605b0fc3a99c2ce395723b046cea6101d0c2cc6b", @@ -5542,19 +6082,24 @@ "maxFundingFactorPerSecond": "0xa1d6b04d3383638cf84863ad9e37716f8c576f9000d419ef9909e4131ffb5fe5", "maxPnlFactorForTradersLong": "0xc84854c769b03060ed2982322c35b638313b98d6884e5485b4a55ec74c8767aa", "maxPnlFactorForTradersShort": "0x0f40ef579c4fbf10923b92970b0dd1ecbbaac182f90856a23bd4ae629f9941a0", - "positionFeeFactorForPositiveImpact": "0x7a63c5bf1f71d763ce6eeca7382fc999d1fb9cf639ee124990e6d6466e40f06c", - "positionFeeFactorForNegativeImpact": "0x36ca219c1c81bea677d62e2b2e5b22206cd385f69e1544fa978de4749b2f18fc", + "positionFeeFactorForBalanceWasImproved": "0x7a63c5bf1f71d763ce6eeca7382fc999d1fb9cf639ee124990e6d6466e40f06c", + "positionFeeFactorForBalanceWasNotImproved": "0x36ca219c1c81bea677d62e2b2e5b22206cd385f69e1544fa978de4749b2f18fc", "positionImpactFactorPositive": "0x851dde81ea8d4ee781c8694a717fe043ef8d687bef17d6f4ed67a0e4b068dc8c", "positionImpactFactorNegative": "0x5a4d44557ccbfc629001935ce839c93d7e73deecd01bd5d529c6c637e1d075b3", "maxPositionImpactFactorPositive": "0xda40b2f3412500cccbeb10fe49e074350c9332e85d7f2ac70b628198eb5cbe19", "maxPositionImpactFactorNegative": "0xcc72fedfb67e03fb6e89c35995b133c60e72ebf835ceda1ddcb11dfea7cfd9df", "maxPositionImpactFactorForLiquidations": "0x12e5eff138fee8a5165e1120e527f7fbedb647b60b8003214942ea80a27eb245", + "maxLendableImpactFactor": "0xa943d492ea8a8ee576462f5e20bb1329caa15626d3eecb3cd191c4a09030a172", + "maxLendableImpactFactorForWithdrawals": "0x092c6d65ead5d73190c48d23445cc8d833e1d57a9c858110967b1b396becf01a", + "maxLendableImpactUsd": "0xaf602d636576bf89bbbb45ed6340469fc1b1f314812b3ea2cc443e77a00ae9b8", + "lentPositionImpactPoolAmount": "0x385ee4d8d93ad8c682386b2f3b5ae4ca4418b1f0d3e139ee4f1d997f6b5f49dc", "minCollateralFactor": "0x458441692f08c6fd6bc9096d6c6a85c9b30df02b3f2956d04603b1d84b5823aa", + "minCollateralFactorForLiquidation": "0x2fa437b43c4b8978a735c50513a74e89c5cd7f0d2a35ab4f964c4910b9563771", "minCollateralFactorForOpenInterestLong": "0x2397923fc51dfa26d6dac95bec87e8d79e15cf9c934d9cfe3b26e3462bcc2145", "minCollateralFactorForOpenInterestShort": "0xcce46a44d5608dda488c9313a4ec985f8c2102f31fd7c96fb91156aae3911ca0", "positionImpactExponentFactor": "0x707aa723bf3a479a8300aafd64736f2425a181ce672a79718ad6af650ff87cf8", - "swapFeeFactorForPositiveImpact": "0xa90535e679944e8be6065b015c62d6a51632451ce684f9e398c1544929caa6d5", - "swapFeeFactorForNegativeImpact": "0x8cda7ab8513c5de3476aa7c0474266c014d1298074d525ca18f1f04002df6891", + "swapFeeFactorForBalanceWasImproved": "0xa90535e679944e8be6065b015c62d6a51632451ce684f9e398c1544929caa6d5", + "swapFeeFactorForBalanceWasNotImproved": "0x8cda7ab8513c5de3476aa7c0474266c014d1298074d525ca18f1f04002df6891", "atomicSwapFeeFactor": "0x40825caecd1cdc11f5c50fb7cbd67e8e4d02416e771c516e624c1b12ab6d8a2c", "swapImpactFactorPositive": "0x5ba4c56931ed525a5b04e368b7c85d09ef955a121f1a28906a13a6724b5d8cdc", "swapImpactFactorNegative": "0x45e04b88cc7e70f0735c51990a40628b581844ad76c1158d93ce57505753ce24", @@ -5593,19 +6138,24 @@ "maxFundingFactorPerSecond": "0x47105b65f791d1f40086a1d5a655bb4666efbc5229212cec0927bbabf56ade3e", "maxPnlFactorForTradersLong": "0x0b29dfb8a7685ae6f9cf9b6d3a2c914d24bc484bea6fbf87ab472447e77e2b26", "maxPnlFactorForTradersShort": "0xd5e520348bde318f79a2b259ab5c1dd90b414994393279c9a8e729faa3e20ae6", - "positionFeeFactorForPositiveImpact": "0xd0777dcb9da47555ce8b2b77dad364d19b48c036066ad3aea8237e599d73865d", - "positionFeeFactorForNegativeImpact": "0x88d8852e314bfc2cf80165d339483901a2cc40302b93d830ae9f5214bbed895f", + "positionFeeFactorForBalanceWasImproved": "0xd0777dcb9da47555ce8b2b77dad364d19b48c036066ad3aea8237e599d73865d", + "positionFeeFactorForBalanceWasNotImproved": "0x88d8852e314bfc2cf80165d339483901a2cc40302b93d830ae9f5214bbed895f", "positionImpactFactorPositive": "0x2991b8b03f8bbda42160bf02d03729611c46a37dc975195ca27fc317f24f5434", "positionImpactFactorNegative": "0xc38d57490f22112f54b2f4af3fc063982f98dde1580822c4491a4d068e2e2dce", "maxPositionImpactFactorPositive": "0x14edeb4f5ee66980440cdfd82bc36b526d86225c9d23444487094c41da526a25", "maxPositionImpactFactorNegative": "0x4d7a0c4c14200e8f4572eedcd3e0d0ecc5d86504661f9f1390478eb7a7c52108", "maxPositionImpactFactorForLiquidations": "0x5522503c2d885644e228ff626074c899a79689cdd05bb8d67790e462358751b5", + "maxLendableImpactFactor": "0xfb52c27fcefb2609956b29fac761b9eb9b098d57dfbbfa54a8bdffbb11ccddf7", + "maxLendableImpactFactorForWithdrawals": "0x0be5d9b16721e73e6e070dfe64d01b649b6d79ee2c263e63189e728a7a09b264", + "maxLendableImpactUsd": "0x8013378f3d03169032387578c5e109fb8db8941fe391a656ab3186122c360c3f", + "lentPositionImpactPoolAmount": "0xa4edccb84829e4c3e08bb988898e50993e8f78e5a47ab2fa82550677f4f7cd8b", "minCollateralFactor": "0x97ea28d35e02b8862fda306e39a8c77858b4b942901171d778184db29497531e", + "minCollateralFactorForLiquidation": "0x3144b9a5938b191d682d5b8efeed673dc9c06646f4e283817ed5269a4b6cd78f", "minCollateralFactorForOpenInterestLong": "0xdd677dfaf255e6feb915781df3a369173f1ba6a2fdeab9b5042ec3fe4f996930", "minCollateralFactorForOpenInterestShort": "0x54debf477ef3d09f2ef162dc9e624468c36c8e85f1e888837f6068c67b7aaf66", "positionImpactExponentFactor": "0x5133495a189f1db6dc1f6e752ad0ec22aa469f193c9333ba9bd2fcd99903f55b", - "swapFeeFactorForPositiveImpact": "0xf6498bb4fa2f2989961e3464a3947df93d9cac0bbce132a839479cdf8e09267b", - "swapFeeFactorForNegativeImpact": "0x142b92fa5d0cf4e4757c0eae3b63d0bb49d6845429c32cc3dbf57eafa62d388f", + "swapFeeFactorForBalanceWasImproved": "0xf6498bb4fa2f2989961e3464a3947df93d9cac0bbce132a839479cdf8e09267b", + "swapFeeFactorForBalanceWasNotImproved": "0x142b92fa5d0cf4e4757c0eae3b63d0bb49d6845429c32cc3dbf57eafa62d388f", "atomicSwapFeeFactor": "0x70bc5ab7094ea2c8739cfd003eccbe740c18d03242e18d4c23a943eea2fd5ab7", "swapImpactFactorPositive": "0x4c21de75900510998632752943bdaae846fb3cd120da605ec2704287c27dae45", "swapImpactFactorNegative": "0x97a9546d0e8771e3f65b56eb7a6faf815f6d257777ae8d7b03473eb0e1246ab2", @@ -5644,19 +6194,24 @@ "maxFundingFactorPerSecond": "0x5cf677b3b1836a5324b2a974c9db309322a2e9ac6335f3a82639b1915a4daeec", "maxPnlFactorForTradersLong": "0x1cf2cc01138a5b15358c77d1bb3bc7726748f718951ac707bbddb05d169d85ac", "maxPnlFactorForTradersShort": "0xeb9383656f42f363d792368765a94c2b9484ea2881c93bf05af173918d33c5fc", - "positionFeeFactorForPositiveImpact": "0x53f43ebe35bb75a4ee867704637ce5d443464239fcc35e163497e387be3ab150", - "positionFeeFactorForNegativeImpact": "0x50fc727f8f54290d02a7258554829d16dbfd870ae3e74e06ce8188f6186073cf", + "positionFeeFactorForBalanceWasImproved": "0x53f43ebe35bb75a4ee867704637ce5d443464239fcc35e163497e387be3ab150", + "positionFeeFactorForBalanceWasNotImproved": "0x50fc727f8f54290d02a7258554829d16dbfd870ae3e74e06ce8188f6186073cf", "positionImpactFactorPositive": "0x25e7d425bc1d7d56be537e4b15f50da3a4976eda1912e15a52e365447948b3d7", "positionImpactFactorNegative": "0x0881517f1b4fb63898040c1a3861d9ff6f924a0abc44917078dd8a38f9522e12", "maxPositionImpactFactorPositive": "0xc0e44af408c1c79ee19e0fef8f6b9c8307a67016336daee3621b3f615c652fe7", "maxPositionImpactFactorNegative": "0xd2ef5fd6cd84b151dc6b5328579738856c7d99d53c98fd5795aef56623c303af", "maxPositionImpactFactorForLiquidations": "0xcfded09cfb3bb784b53a06ed6b95c34d3ee29481a0e8166668fbeea50ab3286e", + "maxLendableImpactFactor": "0xf9897dcd773b1ba122ecc580128b3a20eb2e3929c268e59b038e498dd0d2e1d2", + "maxLendableImpactFactorForWithdrawals": "0x2b55d610f89fae16d27b55ee4da7f9351976d0cc50b6d855ad3627659e3f99b7", + "maxLendableImpactUsd": "0x755fea56f53ee53ce8149795f297794b064a2fb7ef5cef2ea858fa2c454ade6e", + "lentPositionImpactPoolAmount": "0x973f246bc300b23e97621a478ca0167dc414f08c0bb747b4095a23e33cf79103", "minCollateralFactor": "0xa9476f3721a3ace0e929e1ba274fc72c6d8db29cc1d9e2c0fc2bd49bec67b197", + "minCollateralFactorForLiquidation": "0xe0c8811ffba815d0fbb87b64a17f0f1bac3ea3b6613f79f8646289964d94fec7", "minCollateralFactorForOpenInterestLong": "0xfab6fae41bc596b1bfcfb94ae9584c0de545d379cd225cb9c25c487d0503e4f7", "minCollateralFactorForOpenInterestShort": "0x4c1326fc073e6b1d85be6a3d20e1c8ad4cbb9954a3705d9143e1c9245907cd85", "positionImpactExponentFactor": "0x01843a5efcc528e9c8ac7b8cd268b5bacd76a50ab8567b7642f774d15aaedd66", - "swapFeeFactorForPositiveImpact": "0x88018f8220a21b3917d43ad26912e52e3b8ca361da3d8174be35567b0e24af1d", - "swapFeeFactorForNegativeImpact": "0x548929a4495accb9b6cb141f314517f145ce7ea2b032738583b964b3c67b20c5", + "swapFeeFactorForBalanceWasImproved": "0x88018f8220a21b3917d43ad26912e52e3b8ca361da3d8174be35567b0e24af1d", + "swapFeeFactorForBalanceWasNotImproved": "0x548929a4495accb9b6cb141f314517f145ce7ea2b032738583b964b3c67b20c5", "atomicSwapFeeFactor": "0x21e2089d1f40e0a0778c1fe9629870e40fd58fdeeca822dde9b9354502d6fbdf", "swapImpactFactorPositive": "0xd4a7c4f352139efdc20b2198b165d123a241d6de0e2dd735b8acb612c061d0e2", "swapImpactFactorNegative": "0x7f18362928b7b6e3cfe488252656020e312b67e2ce13853c49295f2c527cb640", @@ -5695,19 +6250,24 @@ "maxFundingFactorPerSecond": "0x2f8ed037f4b86f410d55251a6e584e5118efd5645d4865848bc87ed7bdbaede5", "maxPnlFactorForTradersLong": "0x76b2fe888bb64d0008c3995d3a6e048f9a303bfae1767930b7fd0eea879ac4da", "maxPnlFactorForTradersShort": "0x923022b22940da2aa68b4cb6005d691ba6233e080c3623e941e43f2c430955ee", - "positionFeeFactorForPositiveImpact": "0x05831240f177dd0955fadc960829380bf92e1c712f1859a742e5ea2ad4d4c05b", - "positionFeeFactorForNegativeImpact": "0x69767d4f85a4b4005871a2809886deaf3f8b09d3276f87cb1791b2b54e520e3d", + "positionFeeFactorForBalanceWasImproved": "0x05831240f177dd0955fadc960829380bf92e1c712f1859a742e5ea2ad4d4c05b", + "positionFeeFactorForBalanceWasNotImproved": "0x69767d4f85a4b4005871a2809886deaf3f8b09d3276f87cb1791b2b54e520e3d", "positionImpactFactorPositive": "0x47b7d1855a247fd82c8eecf0d326e5ae988891305f3a710e6c4561d05baf35d9", "positionImpactFactorNegative": "0xc5c1a6f5484e0f94cc872be2da2b7cf82d5be7c99fd12ef686741b633eeae6db", "maxPositionImpactFactorPositive": "0xbb9a2a0e8df90d35b1ecbc9a6db7bd441a601352dbcd99cdcbea0056619d0f0b", "maxPositionImpactFactorNegative": "0xc6a7c94f56163dbe9158b0b91e27abaf66020e9938d9f8d0bf0daff073b208ec", "maxPositionImpactFactorForLiquidations": "0x56b55f2d38345ee5f7f194546671a92848327ddc4541fe1da6d8128892c85820", + "maxLendableImpactFactor": "0x11517d9f021a799d56cc05ffe023b8af3fa22e0179b9afc2ede623c1df2bcc0e", + "maxLendableImpactFactorForWithdrawals": "0xc3525088ea56688cdc3f32e3a992678fef8f0a73f5c1a94cbf812c49abf8694b", + "maxLendableImpactUsd": "0x26e49505583b0c4d0a766368396063d2fc26383e2ca88093f3547b043fdf6609", + "lentPositionImpactPoolAmount": "0x826b081eac25c9e00c2ec3d3d4da2f60365eb135db2d40ec280eea606945ded5", "minCollateralFactor": "0x33951e7ffe03288c836a45ddfaf69495b239d3c884d18c273d65d3293fd82492", + "minCollateralFactorForLiquidation": "0xb8b85be580514372ca4219fe34e89d7d0ff5cff5390ed948981ac4b39e138bdd", "minCollateralFactorForOpenInterestLong": "0xe7dd7bf273ece58779bb00ae9a2e4ab2d1f6e2f112ee752f0a84ba30faea843c", "minCollateralFactorForOpenInterestShort": "0x43b427a16d943f601dd6b7698573380c2a7a77ae99d8ef7cddfa8abdad16790f", "positionImpactExponentFactor": "0x77063961ee3e498fb05ab39858f824d05c58816f9e207fe4bf16657af84815e0", - "swapFeeFactorForPositiveImpact": "0x632b360e31d6b7c0caf0657bc4b336b0a87afd7750cfcc4f10d835b6874ccc13", - "swapFeeFactorForNegativeImpact": "0x56e3a25432533027ea1aea296261935fb42abbf8d7511bf774f09b39b1b6af92", + "swapFeeFactorForBalanceWasImproved": "0x632b360e31d6b7c0caf0657bc4b336b0a87afd7750cfcc4f10d835b6874ccc13", + "swapFeeFactorForBalanceWasNotImproved": "0x56e3a25432533027ea1aea296261935fb42abbf8d7511bf774f09b39b1b6af92", "atomicSwapFeeFactor": "0x4d154679eb20c8c9e3bc42655beb1e043cb33b0daf24b875b462ca85f3277609", "swapImpactFactorPositive": "0x2564b478c28569a694e8e1fb47b526f33680c4f7655cc4899f1db2f21620bf68", "swapImpactFactorNegative": "0xa57b6e86d1bd0290122b20c59ffec9cccc1f57d12b491a54bb852dcdaecc99ed", @@ -5746,19 +6306,24 @@ "maxFundingFactorPerSecond": "0xee840dbdd37dbab6e21bd9dcdbcfbfe5284ae1a501fdabc50ce4150a97dd5770", "maxPnlFactorForTradersLong": "0x5e6bd97d8b67a79878fb401aa439f382c2ce00faa792ff3bda9997bdf9f49b83", "maxPnlFactorForTradersShort": "0xff4d30a24922db985d3abe365f9ffe5089d4bf1e0a0e28281658864067e11c9c", - "positionFeeFactorForPositiveImpact": "0x003f9bfe07251be94e44da647dfc5ac14b546d29c05120ec71d8b78bfa305bb4", - "positionFeeFactorForNegativeImpact": "0x7cb977b054e40ab743916d35fcc4f033211b0cdb90e910e4d092f141fc80d168", + "positionFeeFactorForBalanceWasImproved": "0x003f9bfe07251be94e44da647dfc5ac14b546d29c05120ec71d8b78bfa305bb4", + "positionFeeFactorForBalanceWasNotImproved": "0x7cb977b054e40ab743916d35fcc4f033211b0cdb90e910e4d092f141fc80d168", "positionImpactFactorPositive": "0x0278a85160a96126d4130fd831ff4c5a9a5836e4fe2d3d568929efb9f3d40d32", "positionImpactFactorNegative": "0x529d29bf23dcde0de61a3835c8b66c977a5e2bf880979c2865b6ea725424e99a", "maxPositionImpactFactorPositive": "0x483000e66191fc8c744699dddee741439f87f05f61b1b3b300355642fde81ed3", "maxPositionImpactFactorNegative": "0xd86f1bc409f50d72733d15fd7c61943af6eab714ee4299f2c00269bdf58debd4", "maxPositionImpactFactorForLiquidations": "0x08d87760292cca5a5f69a8b95583423ad1be6acc521c68f8b152ccd1283ffdd1", + "maxLendableImpactFactor": "0xf86cc4e80ed83486a203d9ff30f38623d0ff5306e16750251f5da994f3edaf6a", + "maxLendableImpactFactorForWithdrawals": "0xd371f71f87885ebd4068cf3bd59048947f6fcf6722997d0b7cf4a9dfae5abea7", + "maxLendableImpactUsd": "0x6aaf08ea12a86b4684eb7a367795aa8ef1a12c8ed55801045e5614108c512e6d", + "lentPositionImpactPoolAmount": "0x7fb815659dc4e7e09f0fecefae2f2c327f47ba2fdc04bcf45f5dd8c0aad2fac4", "minCollateralFactor": "0x9486c729d2726d090319334bf0c997eb6d988e6503abfc033835f3d21e5369da", + "minCollateralFactorForLiquidation": "0x62d319d61a973cf3d78242c86aaff68636bcfb93ee41be3b9060305db4ea1129", "minCollateralFactorForOpenInterestLong": "0xd7fbf50ca354ff2b3f6828cd7e94d4ed7aa174e32264de0c0aabd07a70d52335", "minCollateralFactorForOpenInterestShort": "0x895bbd377e9a108c1b204b937d4a844252362e5be220248efe30bc9b8935381c", "positionImpactExponentFactor": "0x28d3ce9203477c09d7c98c67792a73495a0073c0d280ff8ec79e13fe5054e79e", - "swapFeeFactorForPositiveImpact": "0x52e150ad8d5dc548a6fb24c385f9a05225f9bd42eafa9af93b25572a445156b1", - "swapFeeFactorForNegativeImpact": "0xb4c438e9e70648650f3498d02748bb64d17e2b4f7231db82ff4649ad5289e8f2", + "swapFeeFactorForBalanceWasImproved": "0x52e150ad8d5dc548a6fb24c385f9a05225f9bd42eafa9af93b25572a445156b1", + "swapFeeFactorForBalanceWasNotImproved": "0xb4c438e9e70648650f3498d02748bb64d17e2b4f7231db82ff4649ad5289e8f2", "atomicSwapFeeFactor": "0x8474deeea21e6229bd4dfae50c5540804ed3a90a2dc43c65d48a15d6bab32d3c", "swapImpactFactorPositive": "0x7ff382731e8dfa0db35f01ee8463833b919a2b6b67c270a7a120b70271e46f39", "swapImpactFactorNegative": "0x32a66fa15048d75d0970f64a82100bf289c0de735a0e68eb6d26d2f4732a4013", @@ -5797,19 +6362,24 @@ "maxFundingFactorPerSecond": "0xf5611db4775347e39747ed1c456b96e740dbcba6d01ce0979b9cfc4b5b80780d", "maxPnlFactorForTradersLong": "0xf80fbd5a69a030c28a382e7651f4fb41c03f68d90aa1de4cacba5b2859b41682", "maxPnlFactorForTradersShort": "0x270f5d9379748c17627fe9488d62cc5da2408ec415db81d38decac01627f4464", - "positionFeeFactorForPositiveImpact": "0x570d2910c810c94dfa7f44eccaa32dca9b9f8171f3cf3c503b5da5918d780611", - "positionFeeFactorForNegativeImpact": "0xf94d71fba5341183b697cdf3d1d488cebb016b48961b01f37bd045a5fadfe955", + "positionFeeFactorForBalanceWasImproved": "0x570d2910c810c94dfa7f44eccaa32dca9b9f8171f3cf3c503b5da5918d780611", + "positionFeeFactorForBalanceWasNotImproved": "0xf94d71fba5341183b697cdf3d1d488cebb016b48961b01f37bd045a5fadfe955", "positionImpactFactorPositive": "0x9a1ba3f8a56c233e194a6da5424ed1fac6faf15b32579933605ed26debab95ab", "positionImpactFactorNegative": "0x2670b9b3cf284a0eced68cce887acbe4ccdb7d12b689a5bbea55e9b035daf01b", "maxPositionImpactFactorPositive": "0x41fbf5bebd182b215d84d8a6cfcd739da1f102035358c8e37161c10bb23bb5e9", "maxPositionImpactFactorNegative": "0x133b02ce85d0279230305871c5ed18f9a1a995cf1a08c58d84da047224e911b7", "maxPositionImpactFactorForLiquidations": "0x4bf31804c08ca6629d17e8f51e28fb15a7ae9748960415407accdd4b886bb1ac", + "maxLendableImpactFactor": "0xbc4271dc645cdb7a59c16379ebdd343b6d1ada38f01cecd54e9761ed0d574ef1", + "maxLendableImpactFactorForWithdrawals": "0x91b91a16da46e40742b38969282b0297214b8a36f5e60638301643bde203c3a0", + "maxLendableImpactUsd": "0xe85cd1244e603122d8d3b0419264586117d4da110d1357e8f0812a3e4f9f90d6", + "lentPositionImpactPoolAmount": "0xe3788d964dad2d90bd7275f010f379846528012f5dc7e5fbbb2b9acf46c08c72", "minCollateralFactor": "0xa5212835c9f726f03f4cc8e303e120a1f7cada099661ad2c42cc57dd28a7e3c1", + "minCollateralFactorForLiquidation": "0x8585b33652b828809ca030664ee0d9ea5e3bf9a37b335e934cb4127331d0ed7b", "minCollateralFactorForOpenInterestLong": "0x7d50ef920428f507294cd36c1782f6d973a2fe06024c91df3cde7689c79fed96", "minCollateralFactorForOpenInterestShort": "0x11f7e8e55c8b9b9dd122a4b43e86c521b1c348c5f813cc016f22cdfd50f834c3", "positionImpactExponentFactor": "0x815c6fefb00b14bbddc0e03e7c0f220de918f46c3dd67b8fd755edeabae8ecc4", - "swapFeeFactorForPositiveImpact": "0xd87f563eee35ff644bbcbc81c285b4b9ba3c76774d5a1529bd482c790240b52d", - "swapFeeFactorForNegativeImpact": "0x10af337efb0891fdc93cfc3f957b35e6e8b478cd80dc1dfe84fab10aafedc81e", + "swapFeeFactorForBalanceWasImproved": "0xd87f563eee35ff644bbcbc81c285b4b9ba3c76774d5a1529bd482c790240b52d", + "swapFeeFactorForBalanceWasNotImproved": "0x10af337efb0891fdc93cfc3f957b35e6e8b478cd80dc1dfe84fab10aafedc81e", "atomicSwapFeeFactor": "0x862667862206eb72e1989351e89dcbc22cb14ba73b6b531c6d53ea7f7c8cd932", "swapImpactFactorPositive": "0xc0cb03d2db382d5e9290eece3432fd194293e21ef1f83ad1a08567da811114cf", "swapImpactFactorNegative": "0xd04dc2dc10cd11ac26ed96f19c2994147a753b9dd0645404de4d4f3ec46342fc", @@ -5848,19 +6418,24 @@ "maxFundingFactorPerSecond": "0xb720d8c81a84ac462d6ad8ea0a9ccc2523ff17b5e0c0f15a8aafaf55cd6c53b6", "maxPnlFactorForTradersLong": "0x4cf830df61af03df6e23af106054f616cb9a7ce443aba0fbd0e816de8b7d7f37", "maxPnlFactorForTradersShort": "0x36314aac4793617375d3c0f447920154a9e0677c0a73deb623acb486bc5971ae", - "positionFeeFactorForPositiveImpact": "0x3c6f2ca5835a333de5eeebc176cb9b6f23bd82af006ee38e94d499e3aac81d15", - "positionFeeFactorForNegativeImpact": "0xca27165c5c39f5ccd9e46ccb45f6c09e7a534d3a375800993d3ca026f9c97bbc", + "positionFeeFactorForBalanceWasImproved": "0x3c6f2ca5835a333de5eeebc176cb9b6f23bd82af006ee38e94d499e3aac81d15", + "positionFeeFactorForBalanceWasNotImproved": "0xca27165c5c39f5ccd9e46ccb45f6c09e7a534d3a375800993d3ca026f9c97bbc", "positionImpactFactorPositive": "0x81715340e5d4867f20c0e71ba4030c88632d88ebfaf0326c105e9389501597ca", "positionImpactFactorNegative": "0xf3642a309bc16d8b2f0543b7719a7814ad020625035d830a111faca0a5cd5d73", "maxPositionImpactFactorPositive": "0x810d342c12f39497d4bdaca55af877dbd05f964e4a6d626792683c2bb37ea46f", "maxPositionImpactFactorNegative": "0x38aee17eb1d3a3866869b91987c0516326292ccec2a7a87dad70b74fd8ce82ee", "maxPositionImpactFactorForLiquidations": "0x1383bc6b5727ae22703084ef3665da3c3000c20a53f6e6ab16dd9c1435f2e30f", + "maxLendableImpactFactor": "0x87eb71dea79f9e9147e18c50874b625378b9d2dd15db5a290a1da097820d69eb", + "maxLendableImpactFactorForWithdrawals": "0x5aebbf4c3422790268750ed775f292618e011ffbd1919d380104ec446620cd4e", + "maxLendableImpactUsd": "0x7735b5def38a0561a96a26df53592dc337b7ed02afa7e6232454b7285bdbc391", + "lentPositionImpactPoolAmount": "0x669be26aec44a803a0bf0bc1d8325beb60e5bbfbd3e9e691b71f0dcde116da30", "minCollateralFactor": "0xee85c017db292f5a8eb09973adcde4bc15ebfd93d8fed7acc24ab19ebd74b07c", + "minCollateralFactorForLiquidation": "0x33b00fb914ce7903aa886f91080c2351c74dab96ad8d7ddffbb6bef6d8d652a6", "minCollateralFactorForOpenInterestLong": "0x5ae759fed69d3b0c091d183c77af7e0a17e8e28bf134058733d7e4f6c65a9803", "minCollateralFactorForOpenInterestShort": "0x6b3ee35f5d240926128b2cd6d6e06959f849b8be18b92b74cccf3092dc4f17ea", "positionImpactExponentFactor": "0xe567e59cfea800eb361efb60841f05c69cb32e748be6262247a2a421f040c9cc", - "swapFeeFactorForPositiveImpact": "0x47ffe2b682a8bf31cf63778aad5f0eb07789da2a14cc68b4b2d225150807fbc4", - "swapFeeFactorForNegativeImpact": "0xcc012787e83c0b903b1eb1aee64607e237da7ad41657778ff1cfafe6e680b371", + "swapFeeFactorForBalanceWasImproved": "0x47ffe2b682a8bf31cf63778aad5f0eb07789da2a14cc68b4b2d225150807fbc4", + "swapFeeFactorForBalanceWasNotImproved": "0xcc012787e83c0b903b1eb1aee64607e237da7ad41657778ff1cfafe6e680b371", "atomicSwapFeeFactor": "0x1df5c00e70e1661c59e1d86e3fe88018b64b65e3f65a756a4b5103507ed3d495", "swapImpactFactorPositive": "0x46909c5fad97c43653f9d5f3368abd6fbebc393ed3e03cac4b1e929beca08746", "swapImpactFactorNegative": "0x09a07f2403de8c394c33d6b5a4546bd1c717e0b5b73b7a4093e0d8de38068017", @@ -5899,19 +6474,24 @@ "maxFundingFactorPerSecond": "0x6549b6f8d7b08064cb0485409e72f4eb7a42fd9ed8e2fd25cb26ffe0d98dd323", "maxPnlFactorForTradersLong": "0xbc279e968e78308cb4557b820b21e00749855574d8379d85706f1306e896f2de", "maxPnlFactorForTradersShort": "0x7456fdb6d19e2d4c7d61b6c7293cb3b71b9e8e26eac6d1a6b44f6ab0537e768b", - "positionFeeFactorForPositiveImpact": "0xa1835230a8d851762c1c01d2f7e523fdf1f5b85f8f0affb93b0feabbfcdbe56a", - "positionFeeFactorForNegativeImpact": "0x4a50364bddba2784ddc1aab575088f8f740d30343b8e0b6eaca6fd68bc6cdbd7", + "positionFeeFactorForBalanceWasImproved": "0xa1835230a8d851762c1c01d2f7e523fdf1f5b85f8f0affb93b0feabbfcdbe56a", + "positionFeeFactorForBalanceWasNotImproved": "0x4a50364bddba2784ddc1aab575088f8f740d30343b8e0b6eaca6fd68bc6cdbd7", "positionImpactFactorPositive": "0x9873a18090b7c56c11578568a8d0b49769743ad165bdff83f1f8aec8241a0736", "positionImpactFactorNegative": "0x7160368f4494684e7a4d5086f623cb1cc84b4b05f87c2382e9d5110187041096", "maxPositionImpactFactorPositive": "0xae1808bb11b54e6d0fe2b85630feb3c2ded4eb5fc8ac820c5178e8038b90ff71", "maxPositionImpactFactorNegative": "0xeaebc7a49d460ddf770f6014464e36e8b242cba8e657fc32a4a68717108b7309", "maxPositionImpactFactorForLiquidations": "0x4dbc4b65a887e96a0525c0ed58fe21806d349f7f596ec1d1c66d1020abb11cce", + "maxLendableImpactFactor": "0x43f787538d78a2982ef11e17adbd6055fbc1cbe7d7f3321bb713082f2b61add7", + "maxLendableImpactFactorForWithdrawals": "0xc2c1928a2bceb51e93a1c8de408430612601e80a44f1f531a216c1f4250bfc01", + "maxLendableImpactUsd": "0x81cf9f95385a790d1db64b27d3e85b6e83cf27e8a1efb5e386d329be83f31100", + "lentPositionImpactPoolAmount": "0xfaef63d717438bfd78f4e1ad3bc2189c3fef771b7a624d0e229faf3a4bf9061e", "minCollateralFactor": "0x0f3ac78bcef32cacef7f434288d1dc395406249bac71ffd1f153ddf1aff1cb18", + "minCollateralFactorForLiquidation": "0x6b71547189b8a846f015a1f2343da687dedcadc907ab4ce46d1b5940de3dfc45", "minCollateralFactorForOpenInterestLong": "0x45eedbc7142301fe4c59155e6ebd1653a9ff0c9a978099ccb2e9d707967adbca", "minCollateralFactorForOpenInterestShort": "0x2903f6e84538e5373d1f54d464ba5df3df4b3588d0d14741fece1716eb35f9a2", "positionImpactExponentFactor": "0x8844c8b03bd3eaef0764ca1ba1b1d78473ea2cec2d9e6a21b41b938f1af0bae2", - "swapFeeFactorForPositiveImpact": "0x2b6b19422df17ba8c28fced3c7d789005d1a0356b44c1c4c4c0164cc39331e71", - "swapFeeFactorForNegativeImpact": "0xbc5189d59edc722196387581523527cb1d98b00ea7da4f20aac7c20e08b72a3b", + "swapFeeFactorForBalanceWasImproved": "0x2b6b19422df17ba8c28fced3c7d789005d1a0356b44c1c4c4c0164cc39331e71", + "swapFeeFactorForBalanceWasNotImproved": "0xbc5189d59edc722196387581523527cb1d98b00ea7da4f20aac7c20e08b72a3b", "atomicSwapFeeFactor": "0xe173a809ced2500304a23dfa344ca6b3e827719804bd77f8acb525af28d6569c", "swapImpactFactorPositive": "0xc37e7182e1a56e126c4733aecc60d53d29e2b3f102dcfca70d3a86ca928e8814", "swapImpactFactorNegative": "0xc26f85c9450226223a1d4af07280496abe35a15674106503cf26c2c1b7757ff7", @@ -5950,19 +6530,24 @@ "maxFundingFactorPerSecond": "0xd542499df9e7d24699d8ecc8f75aa401549a3b0ae9e80d5c6fbe14864ce032af", "maxPnlFactorForTradersLong": "0x986987a2297981d099e91af2872dbe813e25706c4a933026830723cbd2bf48db", "maxPnlFactorForTradersShort": "0x113f7f83548aaff453d477911793de665a501f3a279fc4dba114df9d1a14d422", - "positionFeeFactorForPositiveImpact": "0x83a5a35f6638777558e5ce07e52e0ffdb233fbb2be93bd388cad801e523b53ba", - "positionFeeFactorForNegativeImpact": "0x592d834e78e74865f3eca09aa13a218982d8f685c5efeb92cb33847c99851438", + "positionFeeFactorForBalanceWasImproved": "0x83a5a35f6638777558e5ce07e52e0ffdb233fbb2be93bd388cad801e523b53ba", + "positionFeeFactorForBalanceWasNotImproved": "0x592d834e78e74865f3eca09aa13a218982d8f685c5efeb92cb33847c99851438", "positionImpactFactorPositive": "0xab8a73b8fe33ad230ba513a905a375d42d0a091419bb26f2652dbef04f62f039", "positionImpactFactorNegative": "0x0c08812385bf9ddb26fa10c909560b93bd3b346dcc7bfc0552d34c8bca9e73de", "maxPositionImpactFactorPositive": "0xe22c34e3ff7ef7fcb54504b4c66044899d1a384b96d04624c1dc5dabeb6e24a2", "maxPositionImpactFactorNegative": "0xdb06d0ebe3729da81037c1999fb1b027ed37550201bd6f4075ff5e2d6f56e550", "maxPositionImpactFactorForLiquidations": "0xabce0e14b6bed5cfb566df3ae082320a41e649005e3fc70da278c9f5569ccee9", + "maxLendableImpactFactor": "0x645e69af1d93a9c831437acf36d0470c8cee9cc3aa9a8bf7341a8346a5a5fd40", + "maxLendableImpactFactorForWithdrawals": "0xec453c03edf0091beb32aa8f62f9f626ba440ea571d6ff6429f8895d2cd90f2d", + "maxLendableImpactUsd": "0x0354f66f3a07b5322458c2d5a07f228c988a01e772550a43b547be2f110dfbde", + "lentPositionImpactPoolAmount": "0xdfd6ce9b1aa654201b8b2de147da83c9e17e3523ce8aea92feff2bebb671d7dc", "minCollateralFactor": "0xd0e0e53e9fcc4b8aef885995a8c93e42395bc1bde27f72958c9ba5ceaa17b797", + "minCollateralFactorForLiquidation": "0x1b75189827254a93f7a53377e63f17e1b8e28a9e760227a07cab05b17a8c6e8c", "minCollateralFactorForOpenInterestLong": "0x29db49c2d35032fbaa6998ba219c6b02284f74bfd0acc163ee051df95ed68ca3", "minCollateralFactorForOpenInterestShort": "0xa40cad44d05c973096a2efad341a66060c01fff6f46ea68b91b0b2bf3fba6c08", "positionImpactExponentFactor": "0x756f45fc0ceffe9e5d95fa382724d0f2e89ef58b1420ec60110167e98b8eab13", - "swapFeeFactorForPositiveImpact": "0x65de51630b94a759ff7b7fd83e2592f29f091279d19914ccdf27614d77d6bdc4", - "swapFeeFactorForNegativeImpact": "0xee0edaec66c781a5fbc4bc1a3309d734eb0f66eea1a501f5db8b418e4fcddb53", + "swapFeeFactorForBalanceWasImproved": "0x65de51630b94a759ff7b7fd83e2592f29f091279d19914ccdf27614d77d6bdc4", + "swapFeeFactorForBalanceWasNotImproved": "0xee0edaec66c781a5fbc4bc1a3309d734eb0f66eea1a501f5db8b418e4fcddb53", "atomicSwapFeeFactor": "0x5a0d29797f44932d02b08bc879eacb1bcb68e88d6abb2ad4ce3ed486b716738b", "swapImpactFactorPositive": "0x84849cdedb39593852cf43252cd82e46a876f305e4ce1d974ee08fc8ec59d9f7", "swapImpactFactorNegative": "0x09ecd5127f93d7213f6c1fcaf8804ee66808221cf2bf57983e1953fc99bcf9f3", @@ -6001,19 +6586,24 @@ "maxFundingFactorPerSecond": "0x55d695443c4b50290b2c35ab4ae3670a19023d27d4c7588e6838c3b254970f70", "maxPnlFactorForTradersLong": "0xa79de625f455941562c64463d65e8ccde24b967c7891abcf10a84ca42f8768e2", "maxPnlFactorForTradersShort": "0x6411fd75d22e56aa0f990c53a99acaa487bf7a7260c253aecda50eb063d3cc96", - "positionFeeFactorForPositiveImpact": "0x480caa020e0fe99251b3c9ab63ec9c6300cc5f1bdfbcc7893ea0b68d47aba2ac", - "positionFeeFactorForNegativeImpact": "0xadc6faa886ee5047e61292441d823e4e0473167e7d00c08187cd3fff2d470328", + "positionFeeFactorForBalanceWasImproved": "0x480caa020e0fe99251b3c9ab63ec9c6300cc5f1bdfbcc7893ea0b68d47aba2ac", + "positionFeeFactorForBalanceWasNotImproved": "0xadc6faa886ee5047e61292441d823e4e0473167e7d00c08187cd3fff2d470328", "positionImpactFactorPositive": "0xd0558f405ea9df084ccb4faa357f969f7ccc3f1a5681fef8022ad1fe8f331079", "positionImpactFactorNegative": "0xbd84cae6ed3696ea71d13a21fcc8382099cd628f1cb5cdf2590b86018f9bd8cf", "maxPositionImpactFactorPositive": "0x0555a94ebd0aca297889436c37ca360b21d9a1867d3413495097a4271eca412a", "maxPositionImpactFactorNegative": "0xe2865315d05144575e7ba076bda6b3e6f1d6a62cfc85b71e54d9656b6806510a", "maxPositionImpactFactorForLiquidations": "0x8b55985ffe6a807094924998522579cd88bb81f293c1c18cc9ebdd31c0f673c2", + "maxLendableImpactFactor": "0xe5721d6e94d288c9654430be4987fa3d783dc1430dd883024130228daf783939", + "maxLendableImpactFactorForWithdrawals": "0x967a68e49df22c2a02894afba3eca0e6453e773fa086acf7daaea0df5432eb45", + "maxLendableImpactUsd": "0x3f2eed2086112d3b3b1f2a58fa5372070a78a0875ffea86305c4c441763edd92", + "lentPositionImpactPoolAmount": "0x42380fd5cf401a3161284b137691c1c76ee02238b15bfb0e8d0eb9bae653310a", "minCollateralFactor": "0x40dde6825fead3925144ef7d7985c7eabc5f1c3989c554c16f0a6750ce8d661b", + "minCollateralFactorForLiquidation": "0x86ec7dea0767afca2e51da7c95db51654f3f0663312019e5e6cc4b0d1ba41843", "minCollateralFactorForOpenInterestLong": "0x8f3f572e97c9d9c670333b644f13a2d0f6e539e9c061ee0a857cd9792672d22e", "minCollateralFactorForOpenInterestShort": "0x34f3aabf9a0899301758ec60b458136eedccf8190f866a24fb5752b22f439232", "positionImpactExponentFactor": "0xb2ce75652d03556e0bc3788493523ca7fdebc934c6e54c6c632e181236ffddd9", - "swapFeeFactorForPositiveImpact": "0x0589c40a90c42a9ebfc1efeb4b92aade95b9b797d8aa1d5a3157bf122b7d4c51", - "swapFeeFactorForNegativeImpact": "0x1a598b463e1879679db300d3d2984300793cbf7707c66a39bbdd2d35d13f732a", + "swapFeeFactorForBalanceWasImproved": "0x0589c40a90c42a9ebfc1efeb4b92aade95b9b797d8aa1d5a3157bf122b7d4c51", + "swapFeeFactorForBalanceWasNotImproved": "0x1a598b463e1879679db300d3d2984300793cbf7707c66a39bbdd2d35d13f732a", "atomicSwapFeeFactor": "0xe41d968c3b6e3f6edf6a01941130301b746bab7671905eb80ba9d50d65bb3aaf", "swapImpactFactorPositive": "0xd1e65efb757541f80edfff9551b4826043c8e145abe10ae3ef3541fb538f07d1", "swapImpactFactorNegative": "0x7cf01dde2b8fa10b9187d30fd71c411dcdeec784c219d8650622215ee0595300", @@ -6052,19 +6642,24 @@ "maxFundingFactorPerSecond": "0x89da6ffa766e2bb3ff8a903aeb5e5317b11be4f883d2cb321a1d86d04dc167f2", "maxPnlFactorForTradersLong": "0xcfc8c3f8c13b2c4398d6120c557c104931e11c73a21992df116452c5d2523914", "maxPnlFactorForTradersShort": "0x66f86df6730745dd50e417a44bac9675a815fd2b0cff011e7d4e49d0f8f61f8e", - "positionFeeFactorForPositiveImpact": "0x09ef3e68667ac1932aa3da09c082f3521ca03280960d931ab17c5fc2b610bd94", - "positionFeeFactorForNegativeImpact": "0x8d2011dd8f0c59f59b6d50bfa9ee5e8128c82d9b0906177241687ed9b76ff0e0", + "positionFeeFactorForBalanceWasImproved": "0x09ef3e68667ac1932aa3da09c082f3521ca03280960d931ab17c5fc2b610bd94", + "positionFeeFactorForBalanceWasNotImproved": "0x8d2011dd8f0c59f59b6d50bfa9ee5e8128c82d9b0906177241687ed9b76ff0e0", "positionImpactFactorPositive": "0xa762537645af98f083f258eea26bb39c97b5d6e2b7eeb7d008838577587a2416", "positionImpactFactorNegative": "0x7af4efee5f0f9f89b838201e77ea1a99c065a8c3aeb2857c9dd06453fd16118c", "maxPositionImpactFactorPositive": "0xc46b18667cb5e79692a544765cbf3b008b009c084a840f0716f07e49ffd33a82", "maxPositionImpactFactorNegative": "0xb374e022a3912b6738b5afb8398914723c91acf6fbd33f1375c0a62d1def494c", "maxPositionImpactFactorForLiquidations": "0x04560594fff18fe74dd94ec976fe48da33f3ccd2fb5522b10afba7ba587d69e3", + "maxLendableImpactFactor": "0x97d1f7d41c638437b98777c03b3388b74eb4980c40c7dca97fba9217ae29c6ed", + "maxLendableImpactFactorForWithdrawals": "0xc99f2609161c72997d9c62c49fcf6db65bb39723458bbce2528451f563683e61", + "maxLendableImpactUsd": "0x1ceab2cb317724a5fc0354768c165e6dd92822dd5c5390e9d819900036be174d", + "lentPositionImpactPoolAmount": "0x030bf10049a914dbbe618dce6f66bfa15642ffcb560c9e2a1c7d49658bd90832", "minCollateralFactor": "0xceb66e48992ccf002db99c948b87853fe88fb25d3d2f5639955fda193c33ca22", + "minCollateralFactorForLiquidation": "0xc181dcf243c0f2329ea8f867834c56e7922d6087c6f367ed5c51e860bb1751a2", "minCollateralFactorForOpenInterestLong": "0x583df5e6f1edfb745d316e7bcd94e72ca9b5ca746577c020be7c18dd7dd4fe06", "minCollateralFactorForOpenInterestShort": "0x36351baa910c7a93b9275819cd9a2692a2cd3a2e6ba054c08ee6b21a35de4d33", "positionImpactExponentFactor": "0x7ce20313f86d1399be6c8e5a879b0f8444aadf143db8d96c0acb06d082131e5c", - "swapFeeFactorForPositiveImpact": "0xa23ea26f349b7feb83ddc8a2a9fecd42486e44e6fc12a1801d13effd3586b489", - "swapFeeFactorForNegativeImpact": "0x6426e51a54739e518248dcb47aa6a5ef9663cd0c4882d6e49f2c4a9e4e13fac1", + "swapFeeFactorForBalanceWasImproved": "0xa23ea26f349b7feb83ddc8a2a9fecd42486e44e6fc12a1801d13effd3586b489", + "swapFeeFactorForBalanceWasNotImproved": "0x6426e51a54739e518248dcb47aa6a5ef9663cd0c4882d6e49f2c4a9e4e13fac1", "atomicSwapFeeFactor": "0x37af8cd2427637879560e4b804999bbc1df9abd6e4d2550024f191a228196de3", "swapImpactFactorPositive": "0xccdda93d693c2b04ac36cdd1fcb740da6b9a9b761375c4315e1ce1b8474ce507", "swapImpactFactorNegative": "0xa2277bc26726f7bfa667b90d37019e338cd90877358ef57a93296d388daf3b67", @@ -6103,19 +6698,24 @@ "maxFundingFactorPerSecond": "0x80005808724cc96e2a097ee4c2a7f82e47d1a320388b4dc63476035d8973d9d6", "maxPnlFactorForTradersLong": "0x8f32f5ad7e284bdbfeeeb70ebe1ef991953f55095e79351d35ca3d9497976253", "maxPnlFactorForTradersShort": "0x274a6b8ec92a0bc3ba50a90e9f19dc2252961f33485ade4ce0f822cd5bc1b0cb", - "positionFeeFactorForPositiveImpact": "0x81bd544cd8ceb46ea99b4bd10d6e56ed02222dcbed27f28ad372cbdc124a1cf9", - "positionFeeFactorForNegativeImpact": "0x2d8a55901ecd0092c6089b9d517ed1667d3e1847c1694ed8f29c7ace94df16a8", + "positionFeeFactorForBalanceWasImproved": "0x81bd544cd8ceb46ea99b4bd10d6e56ed02222dcbed27f28ad372cbdc124a1cf9", + "positionFeeFactorForBalanceWasNotImproved": "0x2d8a55901ecd0092c6089b9d517ed1667d3e1847c1694ed8f29c7ace94df16a8", "positionImpactFactorPositive": "0x5a05266478f4928dd9cde3872bd527fa16309411dffc0471ebbe70c025c0aa4d", "positionImpactFactorNegative": "0xe1eae2c4d281cdee0d161a428cda3065b406412fd953c1f82db82b2691a9a9d2", "maxPositionImpactFactorPositive": "0xf99eaaaab16734840b8d4300ca590da487556dcc8db34a9268d847536510b97f", "maxPositionImpactFactorNegative": "0x6535c04d5a63e538f6f562f433d7c993b32f3bcfe19cfc4d3da90a725fdf88ff", "maxPositionImpactFactorForLiquidations": "0xbc6a63fc5880d67cb592c33676d51dd81ea8b5f48ffc5113afc459ae7186280d", + "maxLendableImpactFactor": "0x9d986995d89682b9dcf24e1ae5b7e017a9d4d97cc808212fd610df60e5dc3a33", + "maxLendableImpactFactorForWithdrawals": "0xead7c06076b339077d22cf69bfcc2e275509ab440c3ef83eeb4384862155a903", + "maxLendableImpactUsd": "0x3500e247bbf32363b84ac11c7d6bf7ebce25e5fda330143d45e10188c796a34d", + "lentPositionImpactPoolAmount": "0x968aab8cc872fc87527ad5a54e806bcf3b29b92aec3c89ad595940bfbe10992b", "minCollateralFactor": "0xa46adf9b6edb48c1ef2b4bbb2aca842015364a5f80ef06c351663fbf426c409f", + "minCollateralFactorForLiquidation": "0xf72fdbe7a9a4fa1a18392a24aac135b2854ad6702857dcb7a02b0396689742df", "minCollateralFactorForOpenInterestLong": "0x818e5181980953fa609b761f0ae96c7ca154f7f0646efb32703b8b00f9066681", "minCollateralFactorForOpenInterestShort": "0x5755b8f70ab34aa48a6f09e98b3f0ea7d53f481a51bf3c43ea8eb29e944c99c8", "positionImpactExponentFactor": "0x3b971039415093ccc226058fec1bbf78b3120fcce1cc233615f3e18b5360ebf3", - "swapFeeFactorForPositiveImpact": "0xb843072f0f5a7464d8d1f7396c97cb7da8af935cae8e33176c8d5f175cc9a55c", - "swapFeeFactorForNegativeImpact": "0xbdb97358626fd42e2914f666f839a6f60265e9ec51dccd6175f3c83aa463977d", + "swapFeeFactorForBalanceWasImproved": "0xb843072f0f5a7464d8d1f7396c97cb7da8af935cae8e33176c8d5f175cc9a55c", + "swapFeeFactorForBalanceWasNotImproved": "0xbdb97358626fd42e2914f666f839a6f60265e9ec51dccd6175f3c83aa463977d", "atomicSwapFeeFactor": "0x9532ae7cbc6108a2afb6bc4567e4a7a60decca5cc940dde150db06998e8af445", "swapImpactFactorPositive": "0x901b3d05b703f3c40f99b34c4ff2cba75269582be15a402353f187ed49ff5165", "swapImpactFactorNegative": "0xa0e259f65f79fca5bec4d5341eaf9470dba0fc4d48ba1defd29a7572fd125ebc", @@ -6154,19 +6754,24 @@ "maxFundingFactorPerSecond": "0x2f9dd902a53addb43038e9d24efe34c486a2911e7f672bb79365aa927e257c78", "maxPnlFactorForTradersLong": "0x47c6b942963abe1930bcb6cea0d32323d424e1b4981f35c33c5bd81acd296b8c", "maxPnlFactorForTradersShort": "0x0790c0bd1a893408eabd1ea57630663590c62ec1d13a4858c77460a7fafd2ec5", - "positionFeeFactorForPositiveImpact": "0x633594b09c0e8b31be3792e4ff37f2252f8cc94b768efee52d747044f9a55dfb", - "positionFeeFactorForNegativeImpact": "0x2bcf6671743d299f81ef6291530ecce27d3429a6fb61494a9ca8944a5b34c582", + "positionFeeFactorForBalanceWasImproved": "0x633594b09c0e8b31be3792e4ff37f2252f8cc94b768efee52d747044f9a55dfb", + "positionFeeFactorForBalanceWasNotImproved": "0x2bcf6671743d299f81ef6291530ecce27d3429a6fb61494a9ca8944a5b34c582", "positionImpactFactorPositive": "0x221221e7b50c289b02ea5905c1f2379370338250693b13b8fd1087ac9e901b5b", "positionImpactFactorNegative": "0x0954d88366713719281605b30c385e1b10b87ca6ef69733491e7e22dc4cea296", "maxPositionImpactFactorPositive": "0x53277309fab06bd5cf4cd915cecab1990fbd08f2cfcdbbe96de2eaca6d3795d6", "maxPositionImpactFactorNegative": "0x8d19baf07e1b3da292b4f4b001bce49c60d0372a4fc49f934c5ca3c9414dbb24", "maxPositionImpactFactorForLiquidations": "0x041392716702b20c5a401b7fb483b82cce6c4f4b59876f8f36ffb3c32aa1db80", + "maxLendableImpactFactor": "0x2af1c47f779a27a18253d53f6443de1cdffc94a6192e21b639da78604ad9f505", + "maxLendableImpactFactorForWithdrawals": "0xb691e2d75e4a37455e4f38a7b8b9b4fde166307d87ba85df806b12ffa2bdc8b7", + "maxLendableImpactUsd": "0xf349ba50793ac7f79b1850b03ec2cc01301d6e631b630d11cebbf9154b66ea6f", + "lentPositionImpactPoolAmount": "0xdc5bff4aaf558f8e46fe9ee42999c64cecc23edd86204ad1a3b8962c4ae25569", "minCollateralFactor": "0x660d36995d7842d65142957335204b2f5a47ee4ef14e45e808cd2a558ee1d64f", + "minCollateralFactorForLiquidation": "0x49ae2627469cbefb68666adbbbeb744cf29a4400c48e0e21c31cc84e0f34670e", "minCollateralFactorForOpenInterestLong": "0x27e803ec18d5fa51715be719542a289f7423ac9ba9b20f576973d66b2551bf5d", "minCollateralFactorForOpenInterestShort": "0x5258e3c070aaebb888fd398d917ecf80832a6656f40d50a745b124f8ccb7e254", "positionImpactExponentFactor": "0xc51909a330c2401736876b71a8cfd7c96f42890319cdb371a3b9dec9ecd409ce", - "swapFeeFactorForPositiveImpact": "0x9102f6ad4161a08f0849b3c43c223e364bd4aff8f481d198a4eebeae069553f7", - "swapFeeFactorForNegativeImpact": "0x67ecf17e7395492331fb10f81e89dea078a77a9e46f2fceda54099cc9797a959", + "swapFeeFactorForBalanceWasImproved": "0x9102f6ad4161a08f0849b3c43c223e364bd4aff8f481d198a4eebeae069553f7", + "swapFeeFactorForBalanceWasNotImproved": "0x67ecf17e7395492331fb10f81e89dea078a77a9e46f2fceda54099cc9797a959", "atomicSwapFeeFactor": "0xe16a19c405ac3aff97f370f32424f0cd347870c1e04c55a2359c3be144d17f7a", "swapImpactFactorPositive": "0x1e345ec4f6a863e7ebe4e075da4fcf31672a9182dcb21cd591068f690f2262fc", "swapImpactFactorNegative": "0x4a493f0dc59ec102f37040fb63e5125680bdd15a0fcb2ff76badbcdf3db3fa86", @@ -6205,19 +6810,24 @@ "maxFundingFactorPerSecond": "0x6cd221f1fe702a065c3d5d488eb64b15023dbd5ead70c58a0e8b1a7558e5b16e", "maxPnlFactorForTradersLong": "0x164ea8b6a97c0ffc267213ba294b3058ee4387ecc19b87e31ffd5700554ee028", "maxPnlFactorForTradersShort": "0xee0486fca5c436f99d4772832e3457cbfd2afa0eb06e079f5df49b1c68a287f3", - "positionFeeFactorForPositiveImpact": "0x645a45b8c2066831a700ed199d13dc8dea613b7154569b827cd1c384062ee908", - "positionFeeFactorForNegativeImpact": "0x1e7a0738deae0fdb87f558226e5bbafed021fc35d1e8a3cc8bb5f41227fa5fb5", + "positionFeeFactorForBalanceWasImproved": "0x645a45b8c2066831a700ed199d13dc8dea613b7154569b827cd1c384062ee908", + "positionFeeFactorForBalanceWasNotImproved": "0x1e7a0738deae0fdb87f558226e5bbafed021fc35d1e8a3cc8bb5f41227fa5fb5", "positionImpactFactorPositive": "0x4ab1412183e3cdf2bc0183be8ce586927a7514a7c59547650caaec2deac8a23e", "positionImpactFactorNegative": "0x7dd1eeecae673aa27159de19e7f7dc5dad8733c52b5f2d223e2baefde25790fc", "maxPositionImpactFactorPositive": "0x0c431c9f06de832473be0ce2b10621da8568de58d41a129cf8dee1cad68e2d31", "maxPositionImpactFactorNegative": "0x70801029438f48a6f9e93c6c346b4662b7237c7f8956c67f6ed0d6f078a36766", "maxPositionImpactFactorForLiquidations": "0xf3f9f58a52a4fc1c974c701e5465340061095f605b37e589d1762386d409d1e6", + "maxLendableImpactFactor": "0x6c1d98f22fff91d60a00b7c05b1b230a046b90a706418c2316a6c3d04e1d1617", + "maxLendableImpactFactorForWithdrawals": "0xa744777827f361636e1ad96588f20e344c7763d253a17cf9b8c5f3cb0eaf3f03", + "maxLendableImpactUsd": "0x9946ea3fbd797b9c1613a06aec4c30f015cdb56fa0ec67235106eee841cadcf2", + "lentPositionImpactPoolAmount": "0x88e6f8f4a655e6486c463837cd2547e678b291002d988d8e41cad234301d4f35", "minCollateralFactor": "0x47c761a326bc43721df008dbd681a56a95f967c8782f6c5627c44b0ee1e28d09", + "minCollateralFactorForLiquidation": "0x5d8b1de57e1489bee6417db642bdc78295466e0b17ac7cf4f3a4b6cbaf500513", "minCollateralFactorForOpenInterestLong": "0x8e08f3f7be11c7cf1e417bad78b67816cc018466d09dbc178cbf14e775ec84fb", "minCollateralFactorForOpenInterestShort": "0xbdceb26bf2f98e5cc12acaa3f849b8d4b55bdda9afeb7ccf0290238518f1db47", "positionImpactExponentFactor": "0xff24652bb0828da1596a0f12cb00abede91225f771ad892955193da803cbdf7a", - "swapFeeFactorForPositiveImpact": "0x31e3930b9996b14fe6f38568e44639ccc50e56787240e19e98310ddcd4a92fda", - "swapFeeFactorForNegativeImpact": "0x79ffe210749a415402ab9be45d30efda2ecb18e6812b20adb226da48d4ca5f02", + "swapFeeFactorForBalanceWasImproved": "0x31e3930b9996b14fe6f38568e44639ccc50e56787240e19e98310ddcd4a92fda", + "swapFeeFactorForBalanceWasNotImproved": "0x79ffe210749a415402ab9be45d30efda2ecb18e6812b20adb226da48d4ca5f02", "atomicSwapFeeFactor": "0x032774c61cbf297fedbbf78bb87559d207fee070f6f33e2d7f5704a2821e886e", "swapImpactFactorPositive": "0x2cab7d169dfb0076ae18bbbcc61065aee049442b6a4625d90829f74f1d431f17", "swapImpactFactorNegative": "0xf62851c1a6f64e7d365044132259a31dd64a680ebb18db650df5aafbff986aa3", @@ -6256,19 +6866,24 @@ "maxFundingFactorPerSecond": "0x5f65898b6df057aaff1a80e1fe7b4459c8bdbb538e96f4952cba9f5c29c547dd", "maxPnlFactorForTradersLong": "0xc5618ce541d1aeea5346d6164351ee7f983bbcce8eecc05f8bfba0c314e57cfa", "maxPnlFactorForTradersShort": "0x9750d780280359bf0a2069730d38874a1fd839050a59255fa453aa8515935bf4", - "positionFeeFactorForPositiveImpact": "0xb6245117418c14e0b4c75a17449ff7390ff57f8a6b0afef0084679dfac296fb5", - "positionFeeFactorForNegativeImpact": "0x4a7b08d27f8e7a95ea2a14564163d6f42a663ea247c9f297a278fd26b35514c8", + "positionFeeFactorForBalanceWasImproved": "0xb6245117418c14e0b4c75a17449ff7390ff57f8a6b0afef0084679dfac296fb5", + "positionFeeFactorForBalanceWasNotImproved": "0x4a7b08d27f8e7a95ea2a14564163d6f42a663ea247c9f297a278fd26b35514c8", "positionImpactFactorPositive": "0x58529c64a00bf54d5a13ded16f36034aaa7dda5530f74cf23d46aac19acbbff7", "positionImpactFactorNegative": "0x078d064d98101201466c1c551b0ca6a8a305140a5696dc99ff74821392d97c8f", "maxPositionImpactFactorPositive": "0x6a348a258a1098bae9ec5b403d66b4e0b14d27f5ce1fb2b13767d6655c4ea428", "maxPositionImpactFactorNegative": "0x3119b21aa76ac0e07b2df9300c392b6156a893a2bf6c75c785dd67b8e3dcc8a1", "maxPositionImpactFactorForLiquidations": "0x74f32194510fe6d7b037bc0fc902159ad98ec50b06317ca50726ee5695ed5920", + "maxLendableImpactFactor": "0x7b03b41e9a35c9255a36f3a2ea41f5d8c94ca90a8e56658957a4c47b14a6711b", + "maxLendableImpactFactorForWithdrawals": "0xddaf6fa2c5ac46d8f95e4f366bb5e4b0f86f4fcace6d44d2f09b9be4db3e5887", + "maxLendableImpactUsd": "0x4916e8e20539620254fe26d080e1c680d02dae6a51ba6739263bf33d778775ba", + "lentPositionImpactPoolAmount": "0x79fcfdb4c739ab33a96f51e01469d88d5008f6ee60d0547e63391256b2969de8", "minCollateralFactor": "0x70d8296fff44280d8f08d21c4827e88e576995b4ba5abe74057005597a25366f", + "minCollateralFactorForLiquidation": "0x9ea6294cb72900e32d374e281f6bf719a9a65fd530ecfb43f4fd2dccd7d267b1", "minCollateralFactorForOpenInterestLong": "0x1ad4a9c2b4ce935ef436514c8854eedb430a2d63208a46b5b4c1a539c33e3d09", "minCollateralFactorForOpenInterestShort": "0x9e8636270bb17fe8d5dee385bf6abb8ecc53da1f4a98c52ccef3b75eaf4895b4", "positionImpactExponentFactor": "0xb6d3bd408c744959ffd59a568819258af55102649edb14de3f8c525ed02f5568", - "swapFeeFactorForPositiveImpact": "0x9be51f5179ba5927f3ec2509daf80d5ccb06af86cac7f814d62123fdcd41cdd3", - "swapFeeFactorForNegativeImpact": "0x8a9fe3c474ef4ef9d9693f2e0fbc6765169ed2b19284ae93a0ce93eb09b6e2fe", + "swapFeeFactorForBalanceWasImproved": "0x9be51f5179ba5927f3ec2509daf80d5ccb06af86cac7f814d62123fdcd41cdd3", + "swapFeeFactorForBalanceWasNotImproved": "0x8a9fe3c474ef4ef9d9693f2e0fbc6765169ed2b19284ae93a0ce93eb09b6e2fe", "atomicSwapFeeFactor": "0x3f814b1990fcc2590ee1e6f34b76b7aa9820a7cbcfec9ebbf1eb526848ac6707", "swapImpactFactorPositive": "0xab8e032738aa576a838476c84eb601e7e2f2a8b34e5dc5c536aa6f1b9264bb00", "swapImpactFactorNegative": "0x89dd570058416dd9eabb37b9b0572fe09e54d9096bd0805a622035cd5858e426", @@ -6309,19 +6924,24 @@ "maxFundingFactorPerSecond": "0xfbca942b223f41bd0fe94b280cf01a8646913b11864a69ce11b17538e7129cc6", "maxPnlFactorForTradersLong": "0xcca14cbe5461dd8604717dd723e8fcb2511a1c803ef6b99d5fc49368a88f8a22", "maxPnlFactorForTradersShort": "0x66ad3a6552e212142e97a1ca0e9f38be81f997c7c15016254f1e805c59387874", - "positionFeeFactorForPositiveImpact": "0x3f73aa8aa2902b49a18adc8fcfc80f673b7fc9234a14b2206dc5076920fc3fee", - "positionFeeFactorForNegativeImpact": "0xeee66d741c66a82695578446740ad96569e35f6d461874a00d2699d9e5e6b133", + "positionFeeFactorForBalanceWasImproved": "0x3f73aa8aa2902b49a18adc8fcfc80f673b7fc9234a14b2206dc5076920fc3fee", + "positionFeeFactorForBalanceWasNotImproved": "0xeee66d741c66a82695578446740ad96569e35f6d461874a00d2699d9e5e6b133", "positionImpactFactorPositive": "0xfa4c51cba11d6919e4e3d3d0afdfd0f1d395c556e064f8d3d4a57e0ab392ab35", "positionImpactFactorNegative": "0x9bd82d60d6308707faab3f5a82e1a88387143aa9dad017bc8895f6d7e675065f", "maxPositionImpactFactorPositive": "0xc6e8ff82b7067dd8ba4d505f65921fa7ef232a09369691b1bccb4f36a5fc478c", "maxPositionImpactFactorNegative": "0x505752b0d40ffae647798a4bd22d80761466d2a05ccd57c64c55c65e96c46beb", "maxPositionImpactFactorForLiquidations": "0x2ed4cb8dc5a833446a21721d3415cc0338c637436b0d9dd5800b6493fb998b36", + "maxLendableImpactFactor": "0xede02bf5b44840e30969babd4f118cc6b7e1417a8c9679dba4e4343d1849cfdb", + "maxLendableImpactFactorForWithdrawals": "0x47f9d09cd9c1e56b7433edbf033d908ee9e2516e3063f470d46d5de26a0866e4", + "maxLendableImpactUsd": "0x575358386936c0620890f124f6d19141fd53c5745167a1a23d8a461a5e3aae29", + "lentPositionImpactPoolAmount": "0x8a9fbab28ccd7a5d1247cf6f98262b8705b2861e0549b6a65929a7b72f05caf0", "minCollateralFactor": "0x79c16947dbddcd32e966cec7dab3ba71dfdcc0024ae40d2207d271067d727681", + "minCollateralFactorForLiquidation": "0xb8e50c3357c9b0687230c6323576d8c4ee3945c335963d1b140edeaacb2d4266", "minCollateralFactorForOpenInterestLong": "0xa4bfbf6c0ee876da9dcbfee32442a86b0f70ea215d40f50d6136531dde67e999", "minCollateralFactorForOpenInterestShort": "0x1155b83e2cfe76f46bd264febe8e7e2cba6781f6ae11885ebbce9ddfc94c3d50", "positionImpactExponentFactor": "0xf7ac92d06cfc6e497db204105052083fb5fbfb4ca5eae120a960a9a3ee379273", - "swapFeeFactorForPositiveImpact": "0x9ff68505a5a6a99d8fcfaa7feffaf3845707beef48ea8496c9938dcc1c8cd659", - "swapFeeFactorForNegativeImpact": "0xc122e6184657495f1328c62b42c211b809ac9f91bae19dcbfa431ea1ba12345f", + "swapFeeFactorForBalanceWasImproved": "0x9ff68505a5a6a99d8fcfaa7feffaf3845707beef48ea8496c9938dcc1c8cd659", + "swapFeeFactorForBalanceWasNotImproved": "0xc122e6184657495f1328c62b42c211b809ac9f91bae19dcbfa431ea1ba12345f", "atomicSwapFeeFactor": "0xe28fd3f8caddb693b7f72402386369bf85b84285eaf07d50a09950d9240aa883", "swapImpactFactorPositive": "0x76e9a37967d0130ab2ef994e9eb21736904cb97869b42ea63c2ecfb00b01f743", "swapImpactFactorNegative": "0x782fdd24d86e31774c77cbb4cb2ccb0841cb0ccc392d2863a9ee28a52fa8dac8", @@ -6360,19 +6980,24 @@ "maxFundingFactorPerSecond": "0xcc699ede2997c9256b1197a6b45fec1044e2a5f5cf19b6c5b0c1f6fa998cf188", "maxPnlFactorForTradersLong": "0xc723c6695a9b5598af4de3e27a64e8bfb5c1079334ae20b2ac01a5dbf3fda13b", "maxPnlFactorForTradersShort": "0x5bc9090529cd94bcbdfb42182bf165d6024d177072db492cec78c05bab9b00e9", - "positionFeeFactorForPositiveImpact": "0xebe11e396eb1f9b2104202c8d05d730f6138cccc95a5a7cf183b235de07df730", - "positionFeeFactorForNegativeImpact": "0xb0db1387c147d7aead4388becf2c94d3f2fa2e6f8960908338a21fbab5d12eb5", + "positionFeeFactorForBalanceWasImproved": "0xebe11e396eb1f9b2104202c8d05d730f6138cccc95a5a7cf183b235de07df730", + "positionFeeFactorForBalanceWasNotImproved": "0xb0db1387c147d7aead4388becf2c94d3f2fa2e6f8960908338a21fbab5d12eb5", "positionImpactFactorPositive": "0x1eaff5142fbc691c04970ca9b0a261acfbbc76e2f052ad3b534055a8726b61aa", "positionImpactFactorNegative": "0x80b4b7fdc25c6bc930765f247486bf3ca062f8b15113fbab0d41e05f1c13af98", "maxPositionImpactFactorPositive": "0x30e99c791acc5aee7b6dc78ac7375ce3f9edf7745062239ee1b6fa54793ec829", "maxPositionImpactFactorNegative": "0x2eda01c71a69850c6bc77ec241f94fa7dd2b3a5663a8e91c7d881a9b376c8dc8", "maxPositionImpactFactorForLiquidations": "0xc3f4605a72bee84cf508210e7cc38fb8ec214af45a27fb5896bed941b4295358", + "maxLendableImpactFactor": "0xa4b4dcc843bd519c25c8f9e70d0ba37cfd2ff83d416261138e059c2e430a1f00", + "maxLendableImpactFactorForWithdrawals": "0x8146f601db0a6724c0490b88a7d1131ffdc58dd2c4bda1b2cb89acbe5db00572", + "maxLendableImpactUsd": "0xf4d256872fdefbcf6f9b74b35ef660550377eaf74d9d13f26c70df2f30c9cf66", + "lentPositionImpactPoolAmount": "0x41ffa61b8497a2d31d80c90b5aa91a5d20d6abc145edb9e99c25ffc358920dc7", "minCollateralFactor": "0xc2edb3063d48246267159dc0decbc6ad303c34d2ca3dfccd5f22ca671ba417a6", + "minCollateralFactorForLiquidation": "0x13c9ef205907f266e10818c057548e059c57d5a0b0fca29f21341a3a34a5f3c8", "minCollateralFactorForOpenInterestLong": "0x21af53e3b857539d49a91f80cd682c8386a7536bacee74a1e3694fcd304a8e46", "minCollateralFactorForOpenInterestShort": "0x49e09964b342ebf117d63182ee4a5d8dfd68db919bc3246e63d6efe220a8936b", "positionImpactExponentFactor": "0xfeab5aa4b409a9a9a3ac990b76057d6bc1959f9ee2fded5fcf41f952766de901", - "swapFeeFactorForPositiveImpact": "0xff7943d5848e1ae0a03982cfab38f79b5e09eab5e5f62e140ecc2c6a2f85f271", - "swapFeeFactorForNegativeImpact": "0x5a429e1ede60115ef530a2ca58fc82631d68c05947a67ca99fcc7620b9f5ac99", + "swapFeeFactorForBalanceWasImproved": "0xff7943d5848e1ae0a03982cfab38f79b5e09eab5e5f62e140ecc2c6a2f85f271", + "swapFeeFactorForBalanceWasNotImproved": "0x5a429e1ede60115ef530a2ca58fc82631d68c05947a67ca99fcc7620b9f5ac99", "atomicSwapFeeFactor": "0x23378dcb748980f5601979fa6eca9aede2470a803a8fdafd86daef60715c771c", "swapImpactFactorPositive": "0xc0cfe1a7954d25ec07bce3d66dab98e0e6f267790c569760cebf1bbab2261402", "swapImpactFactorNegative": "0xfaeadc81caa528d9ef2ad32fae0acfde6fcd2b7caecb02a1636dd457cfbf8a6e", @@ -6411,19 +7036,24 @@ "maxFundingFactorPerSecond": "0x339531b45d58d8d4022581103de344aa555609a986dee2271d571fdc908f4e33", "maxPnlFactorForTradersLong": "0x503ad4b2fad7874abfbdc32026d94268af5857b707d8ccd6cdf5fa832772675e", "maxPnlFactorForTradersShort": "0x2efd3f2a4ec3819cbf55352c533036ca3d65488c891c79372dadf02092df0fe7", - "positionFeeFactorForPositiveImpact": "0xd0e35efb814d9ca4f45fdc44baf063dbcac15b6908cad3ee66c1cb92db7bd080", - "positionFeeFactorForNegativeImpact": "0x03c3809639c69d28aa9ed9966d12d8b3fd8f6d025724c3493932916bfe67f32f", + "positionFeeFactorForBalanceWasImproved": "0xd0e35efb814d9ca4f45fdc44baf063dbcac15b6908cad3ee66c1cb92db7bd080", + "positionFeeFactorForBalanceWasNotImproved": "0x03c3809639c69d28aa9ed9966d12d8b3fd8f6d025724c3493932916bfe67f32f", "positionImpactFactorPositive": "0xc344ccb8fdb0aa469744b8475e04e2635b7c780d96ed1e179192285000262875", "positionImpactFactorNegative": "0x718de37c3d799a6004ef0742bd5d880f70abc00efce52e69a73701299d42b272", "maxPositionImpactFactorPositive": "0x87906bb7a0d357d25f8ed21eabd489b025c321b2916e03f8694f319053bf1361", "maxPositionImpactFactorNegative": "0x127276fbb55e276a0f1b3be9f0ca36b656d46b87215b98180bfa14e78471dbb2", "maxPositionImpactFactorForLiquidations": "0xbacbc40e853def28c8e96ed81e0d395d1a9aa1e654a6e35b590a66b26cd16b15", + "maxLendableImpactFactor": "0x0c1c501bad7caa28ce0cda92c9d13c41e1bdc27420c262dc86801600ce4e0300", + "maxLendableImpactFactorForWithdrawals": "0x82672a03ee0b97e8fba5febf62e25e2af569f1d84ea5b3ab8e0f29d64baa0745", + "maxLendableImpactUsd": "0x5ad0e04cd5e93778c30d1d0c96b2c22a8d5824733cdf0723ea91310a87c888f4", + "lentPositionImpactPoolAmount": "0x5d767b7eb39d6309ad824615d743711cb9f4a5f9533ff3b152042c8b040349cb", "minCollateralFactor": "0x44602657c72e1dbb7ac480657ba83e69528e0b3d1cdcf2232dc8f37156fc4d71", + "minCollateralFactorForLiquidation": "0x096a65eaa096404bd43912fab0518b62149c2bf39f85d1848fd4d78c40f8dedd", "minCollateralFactorForOpenInterestLong": "0xcf807ed6fdcc8664b593225fc63bb816add4008d891a840fc6af82bb00f9bf3c", "minCollateralFactorForOpenInterestShort": "0xd1aaec1d623b1045cdfb9e5e91e9ee1667fc872a64bab967a18ed039fbaf1c97", "positionImpactExponentFactor": "0xe50ebe93dd21ce63048f6b6fc748a98f88786e0b798aa7bf3f8c594b729e06b2", - "swapFeeFactorForPositiveImpact": "0x4bfc0ff68b6a51da4cd8b290dbdca223e00ed95be57f4ec4d0387d80893f6042", - "swapFeeFactorForNegativeImpact": "0xd1f0eb18d1b70fd022efbaa081a9d9d49f5a66041f12a9ddd7d542b91dda9500", + "swapFeeFactorForBalanceWasImproved": "0x4bfc0ff68b6a51da4cd8b290dbdca223e00ed95be57f4ec4d0387d80893f6042", + "swapFeeFactorForBalanceWasNotImproved": "0xd1f0eb18d1b70fd022efbaa081a9d9d49f5a66041f12a9ddd7d542b91dda9500", "atomicSwapFeeFactor": "0x348129bb3c99c81479947c66771ea7a63bc37b52fa6038a498dc9cd885ee1573", "swapImpactFactorPositive": "0x419f18d9a5b531da198a09ba7ef2476b5eeae9c3a16e5c3d739aeac467d6a30f", "swapImpactFactorNegative": "0x0959316b70af2ad02e67588267776e3771423d4755a6eec179108a4455b6703d", @@ -6462,19 +7092,24 @@ "maxFundingFactorPerSecond": "0x4363b648ca091537e2c5408897e3c34bb6380b0c8870eb250431ddd4d9cf0fe5", "maxPnlFactorForTradersLong": "0x3657770ac232bd911685198e77896550ac98ea07bd3be93000066572dd1fd8cc", "maxPnlFactorForTradersShort": "0x2b6639dc74e8755ba6784ae540104e3b1c785ad41deb8ef4acc35eac48946a9f", - "positionFeeFactorForPositiveImpact": "0xd08ce0583fe23ac92c70660cefeac56bbefd6b54b303dd1cb722c3fcabb538f9", - "positionFeeFactorForNegativeImpact": "0xbe8cf5d2f567f1e7d9660088308c5a52b20c8068dbd2fe57c168ebed0d2f415c", + "positionFeeFactorForBalanceWasImproved": "0xd08ce0583fe23ac92c70660cefeac56bbefd6b54b303dd1cb722c3fcabb538f9", + "positionFeeFactorForBalanceWasNotImproved": "0xbe8cf5d2f567f1e7d9660088308c5a52b20c8068dbd2fe57c168ebed0d2f415c", "positionImpactFactorPositive": "0x50bf2b50d5afe0943511cfe7e7f889efa38cc054fb783ba2e8c6672921681c81", "positionImpactFactorNegative": "0x19533b0de3f3027fdb5f002bdaa315c9dd4cbf24b6a5fe39bc1754c1066141d3", "maxPositionImpactFactorPositive": "0x2482cb95ad826a33a01a649439805f9295b2bffe6efe7b22a5b720cf7dfb7adb", "maxPositionImpactFactorNegative": "0x40f507260eac6d8ef3148a83c4bbb9f3027b8dd0705c25cb0d87fee8f7f2f23d", "maxPositionImpactFactorForLiquidations": "0x65f16fd2b957f2ebbe014e43740b694eceba4c8f42c90ace60fe4757d7585b0d", + "maxLendableImpactFactor": "0x52a172fe78507a9b9add733f90452d0a34ceb3816b9767276b98d85811835206", + "maxLendableImpactFactorForWithdrawals": "0x752da6cd6aa8253a60ca57985add1d8ffee67545335af24e4366b8ddc91abce6", + "maxLendableImpactUsd": "0xf95b2bd88f276a228ae665c88208504a71e3bfea2e410f081042f071f52bf1fa", + "lentPositionImpactPoolAmount": "0xd24943d88bab006242167704656591770eb1c997b369d82c72fec93e6746476a", "minCollateralFactor": "0x03257da2786063bfdd152d461897826eaf6dc4b2694b0b10710a6537e478ccdb", + "minCollateralFactorForLiquidation": "0x71a102ce47f7a87ab0db19e35ee9bd0490ab45b2b21733cd96c946728333c56e", "minCollateralFactorForOpenInterestLong": "0x958a0b1e22336db2aa2a005c0f60bec36679d2f78effd8393d8faa699cb6f401", "minCollateralFactorForOpenInterestShort": "0x6ec70b5f9ac71a65136fe6ef68e9cccd1641597d35bb772801bffd12156232f0", "positionImpactExponentFactor": "0x2067b76344d2ef6c31a16da6d9c602f6f0b6c6083b623dc415b7c54e9227b51e", - "swapFeeFactorForPositiveImpact": "0xf90922ccdbdf7bf5da782f778623194f62c4e1a1bf2feecd9c5d65cc21a052a4", - "swapFeeFactorForNegativeImpact": "0x19b9bf256fd0b1fd3cb363b592c1a5f6fce3898af1562c22259551a5325fa8ad", + "swapFeeFactorForBalanceWasImproved": "0xf90922ccdbdf7bf5da782f778623194f62c4e1a1bf2feecd9c5d65cc21a052a4", + "swapFeeFactorForBalanceWasNotImproved": "0x19b9bf256fd0b1fd3cb363b592c1a5f6fce3898af1562c22259551a5325fa8ad", "atomicSwapFeeFactor": "0x7c6db4ecbc64f7d30f081d2bd25be2c58442d77ab91b8d0afc618978d26d0722", "swapImpactFactorPositive": "0xf5aaedb45293401a80c2272b02d76b9e9aaa280cd4b02ea183b8e8e8dd1ecdc1", "swapImpactFactorNegative": "0xcac9b44754232c7262bb194373f9b73d63a1d935f0fbb466fac538af440f8ac2", @@ -6513,19 +7148,24 @@ "maxFundingFactorPerSecond": "0xc60cb8ec9c7a2ddc7592215b67a9910c4a5e809a0a941acec4dbac6c84a710f0", "maxPnlFactorForTradersLong": "0x4004e4cb4f7de39fad349b0ccfed00751e05dfb34548abbcd5315e41f829d125", "maxPnlFactorForTradersShort": "0x387cb59e244352f770fa55d46004fd6f25bfa7184a60c4c0bf8d1fd120968064", - "positionFeeFactorForPositiveImpact": "0x007d917567b487df00776907fbf3909e6e58e8bf6af6c915a571971d74fea386", - "positionFeeFactorForNegativeImpact": "0x2a9bf82d99539da12193636e2446af64b47b5c20d7277629a281dfef45ad8efc", + "positionFeeFactorForBalanceWasImproved": "0x007d917567b487df00776907fbf3909e6e58e8bf6af6c915a571971d74fea386", + "positionFeeFactorForBalanceWasNotImproved": "0x2a9bf82d99539da12193636e2446af64b47b5c20d7277629a281dfef45ad8efc", "positionImpactFactorPositive": "0xac6ea7f431089b9b98dc614c7fdd3090046b6c7d38d70e6f824e6d62fc09d18c", "positionImpactFactorNegative": "0xc520bbf5ba1eb0f504168529d37814d8b0f495e3d27ab587043c8901c206642f", "maxPositionImpactFactorPositive": "0x48932c41a37bb5d92ced58448a95e809e96961bd3f7832a7911e3041246e1be7", "maxPositionImpactFactorNegative": "0x191b0a45795e7aaed845f26d2f8773c8257d42e64cea8af9fda6503f523441c0", "maxPositionImpactFactorForLiquidations": "0xf36d46d20e0c1d149236595d78dd3ddd30347332890a251c867d61ec30100141", + "maxLendableImpactFactor": "0xc15d25d475f4aa50f9a5259cbe7a305a9847cdf6c045b230a6afbc1cd5f18531", + "maxLendableImpactFactorForWithdrawals": "0x5d91aa603ca8ea2d4acb5cfdcab217ab180813ca23ff7670b30b9b4607e2b708", + "maxLendableImpactUsd": "0xb1de43a4aafe1524432c9c4db804da4f7367fc8bd9cc0ae46e9e466c04d6283d", + "lentPositionImpactPoolAmount": "0x692b86231bae04b5cfb515b5ba1649dbb2ee9790b3dbe504e80e4265ea73ae54", "minCollateralFactor": "0x03ecbc69da5ac390ea111fe758b31fa45985710c5a9c25586abb760798bbbf9c", + "minCollateralFactorForLiquidation": "0xd920b7294e62802604fada6c7c980ebb231a9aa0696622422269bdda53254fd5", "minCollateralFactorForOpenInterestLong": "0x5f9b7158e11769003f8be017ed1bf645a37c93d2c7f1a07fbcef8ec7f04cbb6a", "minCollateralFactorForOpenInterestShort": "0x1de376a03ba431c6f254a42ac66ba838045ae552f87f4894d0ab5c0854f94ff1", "positionImpactExponentFactor": "0xe4d2b50abb09343c53a1dfa74b24cbb4c5aad66c8e94cae1da7a611c0e637eba", - "swapFeeFactorForPositiveImpact": "0x1e5f4c350cf2fbeb7312594b741013cab6f982ba880e400fb00a410cb3abad5f", - "swapFeeFactorForNegativeImpact": "0x56c6c93fd5ef836406270f67fb0be7246f7414db276316b34265d269283dcf0c", + "swapFeeFactorForBalanceWasImproved": "0x1e5f4c350cf2fbeb7312594b741013cab6f982ba880e400fb00a410cb3abad5f", + "swapFeeFactorForBalanceWasNotImproved": "0x56c6c93fd5ef836406270f67fb0be7246f7414db276316b34265d269283dcf0c", "atomicSwapFeeFactor": "0x1d242793f220d0a818aadfde2c9fe8c1a13017f1ddd5ef560b7b7628d73e23ca", "swapImpactFactorPositive": "0xccc77f870ba42d778057d944e6c80fb332320084fea7acffec3838cc2c4b84e6", "swapImpactFactorNegative": "0x581d1441b56c1e2c8de4ef60d65ab0f3ee119350688aa8214bc1f3f19f629eea", @@ -6564,19 +7204,24 @@ "maxFundingFactorPerSecond": "0xe583c28fd1a56971b89b5ebafef4b397c75a891ecd2f3597eda555c9babc451d", "maxPnlFactorForTradersLong": "0x260b5157f577177177d6e74a07933ed6d32ffd849c45791a0d8538ad1babb03b", "maxPnlFactorForTradersShort": "0x43283c63738dfddde878706561d7fa7f4bb18ec01f2d9308279b83d303f0e4c7", - "positionFeeFactorForPositiveImpact": "0x7ec81b3e05aff0463fc38a88e0778c5e06266089c1c1c9ff80375db1c09d0ad6", - "positionFeeFactorForNegativeImpact": "0x5de7369530849ca490d75f556ffda8ccd56ba55bced76157c3810980600f0339", + "positionFeeFactorForBalanceWasImproved": "0x7ec81b3e05aff0463fc38a88e0778c5e06266089c1c1c9ff80375db1c09d0ad6", + "positionFeeFactorForBalanceWasNotImproved": "0x5de7369530849ca490d75f556ffda8ccd56ba55bced76157c3810980600f0339", "positionImpactFactorPositive": "0xc2527ce6d7f8c869e87302ca90c44863224f17dd52e949cec5034fe7d6d1b506", "positionImpactFactorNegative": "0x3f918c6ec9c1980cebaf33b83d31c052e45c7ee570447898dedf2860a7da2bfa", "maxPositionImpactFactorPositive": "0x44883af09d61a5b41c7deb568c97737dc232031443215f6042ab1fa0054e99ce", "maxPositionImpactFactorNegative": "0x8d3d65312060d4e8c2e1ef88e1b12303fbb03e94b4067d2568a696aec00deacb", "maxPositionImpactFactorForLiquidations": "0xff0330b70a4077634b40ca74c3933d6d7815a91a542082add3fc1ebe41273d50", + "maxLendableImpactFactor": "0xafb174ffaf8c22d2186ede3633386a2679c5ed9dffe2ba2ab2cf2d56467e6d92", + "maxLendableImpactFactorForWithdrawals": "0xf600423e844ceebbe6fbae6cd7555a99b428eb86905f6115658fb17146d07eeb", + "maxLendableImpactUsd": "0x5fc6ba3bfef635a161b780169896828c41dc9166a4430883ccd793f8c6c74542", + "lentPositionImpactPoolAmount": "0x93214cec9c92ce9615bafdb3d0a74acc28e91c14b848066260b9661b049c5b47", "minCollateralFactor": "0x27aae14bd281c4cad2e25eb7dddf2056cf33fe30c92334b6c1908e33603a594a", + "minCollateralFactorForLiquidation": "0x4d36cb411e16178e83604c194f3384eea3dfc987123fd9cc25ef8f78dd043ee1", "minCollateralFactorForOpenInterestLong": "0x35b24de0a1a1af62333ba0be24b03cf0639b0e1395d94c4cedec839ca221b0e7", "minCollateralFactorForOpenInterestShort": "0x7a3010bd5329103b10512f4947b9d5ac36e6bc5677729ec4f8f68f35924f787c", "positionImpactExponentFactor": "0x337e63e32187ff3fc173f5011397d5eabbdc507646d2393fd8fbeb287fc4b868", - "swapFeeFactorForPositiveImpact": "0x1d62b36458b3597ca93c501028c3de5017918bd9aca0ee3acd919329b2ff8ae2", - "swapFeeFactorForNegativeImpact": "0x5cd08eeaa4133f740cfe2c8d7f4ac62db55fbf503024a0c08b306fd39b48c935", + "swapFeeFactorForBalanceWasImproved": "0x1d62b36458b3597ca93c501028c3de5017918bd9aca0ee3acd919329b2ff8ae2", + "swapFeeFactorForBalanceWasNotImproved": "0x5cd08eeaa4133f740cfe2c8d7f4ac62db55fbf503024a0c08b306fd39b48c935", "atomicSwapFeeFactor": "0x9c34e983234a66a6e55681e0829a7d27ab358f9897eb04561eed25f40afcb787", "swapImpactFactorPositive": "0xfb399f4414b807428dd2340b923793f8e3e223c3758d217c66c320265786db6c", "swapImpactFactorNegative": "0xa7583e74286befd226ba820f162caca16ce41291b51dcf4210b99a53bf8d713a", @@ -6615,19 +7260,24 @@ "maxFundingFactorPerSecond": "0x9c399ce61641bb1f0de20944b462410a44f2d09642ccf0a04c6d0f5d066aa031", "maxPnlFactorForTradersLong": "0x4bfbce99eb77139d55e6df621e0cf75763a4593d151d8150bb501c048935acd1", "maxPnlFactorForTradersShort": "0x242cc33a4317819d85f507e8d122cbaefed1ae2eac046c9dcd77511b6a3d023e", - "positionFeeFactorForPositiveImpact": "0x72816d892a8d960262b4fe693b71a6b9de0ac694a154cd31dcd7284bf516cdb2", - "positionFeeFactorForNegativeImpact": "0x6ba910a9a74e758085688e794fcbb3b0915c9b0cc0b288dff018b306dcad09e2", + "positionFeeFactorForBalanceWasImproved": "0x72816d892a8d960262b4fe693b71a6b9de0ac694a154cd31dcd7284bf516cdb2", + "positionFeeFactorForBalanceWasNotImproved": "0x6ba910a9a74e758085688e794fcbb3b0915c9b0cc0b288dff018b306dcad09e2", "positionImpactFactorPositive": "0xb2c83f915182511fcb38344c11c91765c4152fe820e172cd68400029c8b937c0", "positionImpactFactorNegative": "0xe6d1b89ac6f2ce52f9e9071a251b08d41ad0d7cb998360a09141c49b6bea4156", "maxPositionImpactFactorPositive": "0x9a594d5ba6384739325febf4bddd5b6cca6fb616edfd9088afbee47fb41ff533", "maxPositionImpactFactorNegative": "0x1fe2b6e82973868d11b609eaabb2aaad17824947cf596b31285207b6a783a402", "maxPositionImpactFactorForLiquidations": "0xacd16f5d1fc4dbfe6e4d7ea04482a833154d53ee9158fd4bcf814a3c152c7968", + "maxLendableImpactFactor": "0x218dfb2f3fa7191c4314e14e2e8ba2945227027b451a23eea586f505242377fa", + "maxLendableImpactFactorForWithdrawals": "0xb260aecb10c9f454588ec8744bd33fe7996e449f70f197bff29b8f9d4ec9a3d5", + "maxLendableImpactUsd": "0x726bf4307a78ca4571ac740aaa9b8b643ce70e00fd2875843a363eb07bbf971e", + "lentPositionImpactPoolAmount": "0x6aabcfc53d8a865968fc2c45d4bb3b69753a7ef87ce5ee9516d112d14189ec80", "minCollateralFactor": "0x698b96cd3a094ea412a7628c971920e715fe06bd06e200035b367b3dc046f745", + "minCollateralFactorForLiquidation": "0x00a26c33e84c34d7464b8b5e05c899812831d9c82e964ca0f6f73e84eb5a7c1e", "minCollateralFactorForOpenInterestLong": "0x58330b893e1565ce7732e4b4d3255dc018500d7aefd5d58946144d3067508cc0", "minCollateralFactorForOpenInterestShort": "0x2d6e8b614741229e997e7f625533433018db60bb050980a288071b2228df61b8", "positionImpactExponentFactor": "0xbcd5e535b6b2461dd01c0915177b85bdf2ca0974c38402810a2dc5ca974cb8ed", - "swapFeeFactorForPositiveImpact": "0xa3ba4d614e29505bac315dee9664716cfa96cadb6207c8ead416299ebab8b69f", - "swapFeeFactorForNegativeImpact": "0x8b990fd6ef7a24250b629c7fa3d3e965f2ee10c1b17c15d9b072aaf0d75d11b0", + "swapFeeFactorForBalanceWasImproved": "0xa3ba4d614e29505bac315dee9664716cfa96cadb6207c8ead416299ebab8b69f", + "swapFeeFactorForBalanceWasNotImproved": "0x8b990fd6ef7a24250b629c7fa3d3e965f2ee10c1b17c15d9b072aaf0d75d11b0", "atomicSwapFeeFactor": "0x65cef630b6bd35dafd0d12f900765be7171b761240e6caaf01c21d18f5f78ee0", "swapImpactFactorPositive": "0xdb794233f573199e11b2568c3c92f38a3744dece73525f013a685e528bdc6e00", "swapImpactFactorNegative": "0xd579ac5d1571cd61c69c378ebd76a71638e7312306b99fbdfeece3fa47ada36d", @@ -6666,19 +7316,24 @@ "maxFundingFactorPerSecond": "0xe7e734e4c1ee8b93b86880b6848f5b207f5b234caf98b8bc386b7e79ab7912b2", "maxPnlFactorForTradersLong": "0x8f7a05cdbf1b297c4fcea4c609f84320afac0ebf972c4f616e17c44655115971", "maxPnlFactorForTradersShort": "0x2a71f9cf361d204760610fd760b56d5b35a843c78755085077c75a48b6df8e1b", - "positionFeeFactorForPositiveImpact": "0x3ff5c2fda86cb6ac7357de79b9bca5e1ef107ddab75f57c0e867404f228a60d2", - "positionFeeFactorForNegativeImpact": "0x9cd7ddbb8e1b8f130805f1cffd550815ce4a4c2d07b961c3051da5f11f0669f7", + "positionFeeFactorForBalanceWasImproved": "0x3ff5c2fda86cb6ac7357de79b9bca5e1ef107ddab75f57c0e867404f228a60d2", + "positionFeeFactorForBalanceWasNotImproved": "0x9cd7ddbb8e1b8f130805f1cffd550815ce4a4c2d07b961c3051da5f11f0669f7", "positionImpactFactorPositive": "0x5c0251c56debcff9b65ee9d854dbf08d1c881deddfbe7ef48d37e8d18fa17989", "positionImpactFactorNegative": "0x5840e8072ec9ea74977c498a91feed3c815d61b5f3062818f45df2b9d7b363fd", "maxPositionImpactFactorPositive": "0x030f83905621bfd3cd25bbfe083e31bcb71db9826b067f346ee05170950136dd", "maxPositionImpactFactorNegative": "0x1926d782940abb168cdd50e7c4a4db14fb213dab129751ff6b6cfdda7a1153e3", "maxPositionImpactFactorForLiquidations": "0x72bbd2b2d9d41e43f87c725279a503454cf2ee59430cdde4b5c8efc5d07f0aea", + "maxLendableImpactFactor": "0x0def8c8ea46384cb92a739eb0740b85aa9501a27c1e0b83de960af9c67343e4f", + "maxLendableImpactFactorForWithdrawals": "0xae42fa5e213f98535331eb37f6d70d88b1b1244713d7dccf1b585ab06436b7f7", + "maxLendableImpactUsd": "0x06ca1a93a5dc53cbe9ad35ae34186d6f863555074a5b712728d36d3e8c1aa27e", + "lentPositionImpactPoolAmount": "0xa74a87486b3920fd1739353f9da119fb9946409f1881627f55a1d20fb5cc99f7", "minCollateralFactor": "0x3c8e9a2263e7b3aaed77f397cbb78c154d7df45c8fd9f3293610e7a9499f3bd6", + "minCollateralFactorForLiquidation": "0x8e64049c3c2981df32bed046c45d8b9a264df191d293b069d02d0e790add562c", "minCollateralFactorForOpenInterestLong": "0x68db012f561515480190c5a28c8b7c8bff8bcfefa9f2329aa4ebb00a64dfb027", "minCollateralFactorForOpenInterestShort": "0x3e66b9a84db4568cb7137ffa35aae284f2ee5221724165a49f4fab30490c337c", "positionImpactExponentFactor": "0x71f13bfb0b47f4087378469ece6811760e36e271d52c8b788af0871595bdb4b5", - "swapFeeFactorForPositiveImpact": "0x82120bfaf43c7c864880c85bea94c8aed5961dce6c788d1b372783676253b5c4", - "swapFeeFactorForNegativeImpact": "0x9d43fe0c42b447782429e2c237376e87968a70de628212c5900a269da92a6c55", + "swapFeeFactorForBalanceWasImproved": "0x82120bfaf43c7c864880c85bea94c8aed5961dce6c788d1b372783676253b5c4", + "swapFeeFactorForBalanceWasNotImproved": "0x9d43fe0c42b447782429e2c237376e87968a70de628212c5900a269da92a6c55", "atomicSwapFeeFactor": "0x4d523175da4643979f545e13545036af4f14cdec8da5cdadd33ef6ff363b0521", "swapImpactFactorPositive": "0x5ac0772f7d1d01adeca5890fd7a12efb194b042a949ff9676956a1b18a6684d8", "swapImpactFactorNegative": "0x1fda8752104b3cec09d2f3deae9a845297c27bf555787375a5095da13b00a0a0", @@ -6717,19 +7372,24 @@ "maxFundingFactorPerSecond": "0xf4a6e146dbba3de83c2a8aabcf4b4534960ef8f3dc3d3a65280175e9fee6ab1f", "maxPnlFactorForTradersLong": "0x9273a00d6ed482033b858572f916738237adaabfde3490be6d0b711a5dfcf512", "maxPnlFactorForTradersShort": "0x5a4471cae0c0e536aae769ddd3bbb923858fbc28cf44b3f334d627fde16722bf", - "positionFeeFactorForPositiveImpact": "0x6a49a1b6a150b462c7840424e50779181c431198c05864aa79c2c0297d288f36", - "positionFeeFactorForNegativeImpact": "0x34c8eee3a2807ea0c00ffd49ca20197cdbae2767ebb1b4bf906f6e4ee05b62c7", + "positionFeeFactorForBalanceWasImproved": "0x6a49a1b6a150b462c7840424e50779181c431198c05864aa79c2c0297d288f36", + "positionFeeFactorForBalanceWasNotImproved": "0x34c8eee3a2807ea0c00ffd49ca20197cdbae2767ebb1b4bf906f6e4ee05b62c7", "positionImpactFactorPositive": "0x72390a7575ebd481acb4a269886445b8b8f18624dd31366204ea5f052a5e0249", "positionImpactFactorNegative": "0x1dc71efbb909b75009ef1ecd28f125af6248efb7cce08016373e95750fb1a492", "maxPositionImpactFactorPositive": "0xefc0e6f13b3331a365027b599cb8bceaaa44eba98e35841da10f95042ce2ffc0", "maxPositionImpactFactorNegative": "0x3f0f9566fb6f301b104bbcdab7775e865df1cffc16a345bb33f8807b947431ee", "maxPositionImpactFactorForLiquidations": "0x75ecfa326eed4ad5245c1e4bfdda62bd8cf3edf7460afad031192c187071cf70", + "maxLendableImpactFactor": "0x22eba806cb5e0c3009a64cbd36dfe0c17608afd15fd51fe16ce47227e3a6dcc2", + "maxLendableImpactFactorForWithdrawals": "0x54c88b5d971110d4696941f23633e7580df99a0bb0554d81075f1e7690981907", + "maxLendableImpactUsd": "0x5c0c70fd4d948fc0eb766512928cc611648c1c3defc6875b5fa542a4dcfee832", + "lentPositionImpactPoolAmount": "0x3b40905ffd2685035d5d06ff218c8a48e780e73c7cceef85ca19fbb7fec01e62", "minCollateralFactor": "0x2c1b564020448b09588e27ce484dac4ed1e5788851545539ed25326726fa047d", + "minCollateralFactorForLiquidation": "0x9793b322d406bd3ab07bab9bfeba55d733658a1866fcd18806a2ea761138e9ec", "minCollateralFactorForOpenInterestLong": "0x764b0b370f16745c38880c82893b0b0272f2631f1298984dce74474631a139fd", "minCollateralFactorForOpenInterestShort": "0x0341fd2b324b8ef1cf6e9c3df7335e1ea580bf8a0dbeb293d36f45ccb4e7cd76", "positionImpactExponentFactor": "0x6ee59d63c0332b05fdfd3c9c24565b31a667e9634f594ec3454331863bb0bec7", - "swapFeeFactorForPositiveImpact": "0x2b53b9fd42b44447585ad140436a690598b97e3a3ac95e23f5fb572474e47b91", - "swapFeeFactorForNegativeImpact": "0x3768b6cc037ee07054b27d75caca82f3c4fed7ad75cbb2cf6309c3bb6b558a1d", + "swapFeeFactorForBalanceWasImproved": "0x2b53b9fd42b44447585ad140436a690598b97e3a3ac95e23f5fb572474e47b91", + "swapFeeFactorForBalanceWasNotImproved": "0x3768b6cc037ee07054b27d75caca82f3c4fed7ad75cbb2cf6309c3bb6b558a1d", "atomicSwapFeeFactor": "0xe25421b86db3537779e58211d2533e3a76b716d49a68233219f571797714db0b", "swapImpactFactorPositive": "0x4d2ba8b5784292dddf36d28528876fe8c70b2c1a23eba9b543e83fe6ce4fde58", "swapImpactFactorNegative": "0x98753b02e57caff21ef4bdd4d67181248ece31553487ccb8d253684f83680156", @@ -6768,19 +7428,24 @@ "maxFundingFactorPerSecond": "0x4f793acfb9cb975268489ed8551b3f2f46d2d0f8a3cd7a43491cbf8acfc364a9", "maxPnlFactorForTradersLong": "0xe5ce7dabbd210f062e994ea004dd7f12c8ea4a7050eaed2faf3fb9c82e210576", "maxPnlFactorForTradersShort": "0x8b3ce0762bdf8219d617fbff36144b7969b899768039a47a4a8acd6fa666a696", - "positionFeeFactorForPositiveImpact": "0xeb9630d085c018891245c6e5b7ae66ce78e43855b5d70fa82f19b150d6f85846", - "positionFeeFactorForNegativeImpact": "0x4511e3199a94aecfb03cf6734ee8dee591ee9f2a524325eb49e6c28d63292314", + "positionFeeFactorForBalanceWasImproved": "0xeb9630d085c018891245c6e5b7ae66ce78e43855b5d70fa82f19b150d6f85846", + "positionFeeFactorForBalanceWasNotImproved": "0x4511e3199a94aecfb03cf6734ee8dee591ee9f2a524325eb49e6c28d63292314", "positionImpactFactorPositive": "0xf995c6a210011bc0300d3d784ceba4deaac6ece23aff73df2e74273d16483e3e", "positionImpactFactorNegative": "0xa351ffcfb63dab651a9502901937d3e0c389398b5201794bc8150b8ff163ea6b", "maxPositionImpactFactorPositive": "0xe94e46b223077a3dfcfed3014349de0924dbcafa5d5e12436a179b1148578c09", "maxPositionImpactFactorNegative": "0x1240bf4cd804c59b4d70c5f53273a26a1f66d6a2a3b041c7eef81b64b2e64e7f", "maxPositionImpactFactorForLiquidations": "0x69b5edc246570d7a59c97b4b024398d7872e5e809881f97e17c7edee0d084877", + "maxLendableImpactFactor": "0x80ca26367a53b7bb69eb63378896b856d9c56873e514539df9fd1f8cbe0f5fcb", + "maxLendableImpactFactorForWithdrawals": "0x6946ea1947e9f712789712f745d5501523f92ddc69ee681186e7215cf7f6c325", + "maxLendableImpactUsd": "0x389a546d02e4ac6d3d52cfeafe5bd1a34a3a1419974e040e4f8cfee3a6a9b22b", + "lentPositionImpactPoolAmount": "0x1473b20c05aadac00091df90bb3acf3f7a408bf29d27d7a82fcb147690cf6125", "minCollateralFactor": "0x8c07e19be90a3b67ead909350737c6f60ec7994cf1284b8de1374a905df4782b", + "minCollateralFactorForLiquidation": "0x47485a33abc979478e8344f4f7d339fe712240f96bba4b1b86e87d5e787073b5", "minCollateralFactorForOpenInterestLong": "0xe1a895360341ff2c180e3c4243d98086f42adfb2b9d2e5081ac3a5f955d63d07", "minCollateralFactorForOpenInterestShort": "0xc71812a119761c33f9b4103ee133e3ccc0d55fadf484bdbabb43cd21eb503207", "positionImpactExponentFactor": "0x9431bd8b3347a4230288b4bdb918b609eb1a647bc3c10c3db5e795b420ebdef1", - "swapFeeFactorForPositiveImpact": "0xa8d9f9cff183b65b7dca088651a8baed5af77625298af1a905ae91969311ec55", - "swapFeeFactorForNegativeImpact": "0x93427d77b84c63793a2d92dfa0d1f2129b49307b109fdf789f92d4dfc3eba264", + "swapFeeFactorForBalanceWasImproved": "0xa8d9f9cff183b65b7dca088651a8baed5af77625298af1a905ae91969311ec55", + "swapFeeFactorForBalanceWasNotImproved": "0x93427d77b84c63793a2d92dfa0d1f2129b49307b109fdf789f92d4dfc3eba264", "atomicSwapFeeFactor": "0x59e74a1d6a0fe01c168273b218979ba368fcbead6edd6248f4062f1ae77e128e", "swapImpactFactorPositive": "0xd4d4fec3dac5d648af883c5241e322bb47dcd508044fcdd52b3676e7a8609cba", "swapImpactFactorNegative": "0xf7d514343cd53634029821b1b23419bffd04823ee244f6403632a85290c4fc68", @@ -6819,19 +7484,24 @@ "maxFundingFactorPerSecond": "0x87cda574200426b085d0a9ac4bf0126dfc9c003d1b5e856664fb881d2d2e31af", "maxPnlFactorForTradersLong": "0x5547985ce54c37c2d55099fa306cb53b663eeefec986166283ffc78a99ddb3f2", "maxPnlFactorForTradersShort": "0x30bbab14c6e9a74e4f0a9c331552123b1a1ed09050d7049e45a068cff9e3945b", - "positionFeeFactorForPositiveImpact": "0x52f75e2b52a2be4cf30bbe37ac74de800099d99c85ab644ecaf2769dcaeab408", - "positionFeeFactorForNegativeImpact": "0xeec77ebd209895b9b469d59875df04a8166aff79665dfa4815544afd8d7eeaa1", + "positionFeeFactorForBalanceWasImproved": "0x52f75e2b52a2be4cf30bbe37ac74de800099d99c85ab644ecaf2769dcaeab408", + "positionFeeFactorForBalanceWasNotImproved": "0xeec77ebd209895b9b469d59875df04a8166aff79665dfa4815544afd8d7eeaa1", "positionImpactFactorPositive": "0xe7488d5212884b2cd7c31a9d55af9caa7298e6bf97a817fa559aaa4ef9933438", "positionImpactFactorNegative": "0xc4f2ae062f8c381b7c2c2ee80c24f8f49553e36fb19ba199947bca94109f3eb2", "maxPositionImpactFactorPositive": "0x56f3bd4b6832379e513140b9c350ab03da7cc63005fd55651e65d0feb9784906", "maxPositionImpactFactorNegative": "0x26ccc2913b07c97f219cfb9a1f1f5ed65318c3504404e547bde20c6c7d816310", "maxPositionImpactFactorForLiquidations": "0xcb6ad3df6f86f0480c0f46ecf12b617607347bc774faf8840d30565f0006fd78", + "maxLendableImpactFactor": "0x2951dbec739b96f6c80548203cac5b59883a33f7d8169c7bbe6a6bf99be780bc", + "maxLendableImpactFactorForWithdrawals": "0x233d6a215085716798e78c682a74257be7d51f245b2786c4bfe337dc3bbadcb1", + "maxLendableImpactUsd": "0xf69e318de5ae2ff85065f2f5240e7f849c3d7e07bdb9004742b1a1e9c0f025a1", + "lentPositionImpactPoolAmount": "0x1a601b98de6e741f33523dde850eee355272cdbc616c1ae7da182c065d0a7862", "minCollateralFactor": "0x6e0deb754cc255b60e296d94475feb89ecb013d88a5091c3d9784547a2cd00ea", + "minCollateralFactorForLiquidation": "0xbf4106a36b751df8edfb0c97be58049aa60a9535d83945c1e856f91aac3fbe2e", "minCollateralFactorForOpenInterestLong": "0x39019addfc2617caa7a3c788332ec013a656af5eeb2726791dd869e978b6f0b5", "minCollateralFactorForOpenInterestShort": "0x39fb129d3f05dd00fe0eaf0d95008439a0067785fd383e421191678b13db471a", "positionImpactExponentFactor": "0xa7b30afea3af30a71b26148e633e26ce9280e6a9b0585f0bb857a52208354a90", - "swapFeeFactorForPositiveImpact": "0x4f4d5219acbebf609e4d3f6dfab866ab875b7493b5ac846a466dd651bd2c238e", - "swapFeeFactorForNegativeImpact": "0x78661a123a93d91d906d41c15c007b19ab8687ce43ae33bed9698de1fd05e9ed", + "swapFeeFactorForBalanceWasImproved": "0x4f4d5219acbebf609e4d3f6dfab866ab875b7493b5ac846a466dd651bd2c238e", + "swapFeeFactorForBalanceWasNotImproved": "0x78661a123a93d91d906d41c15c007b19ab8687ce43ae33bed9698de1fd05e9ed", "atomicSwapFeeFactor": "0x1079426947df79faf42bbbfd1ee6735ad7dc60b72e13f804901d8eb426ab5b70", "swapImpactFactorPositive": "0x9b3474784c1a93dc2d0f8f721f7efefb15a584887583dfa3e303ce08249ae5bb", "swapImpactFactorNegative": "0x8fd022a687a7b4da97ceb03d51c39824c1f0669ab078f69b9e27d1f044192986", @@ -6870,19 +7540,24 @@ "maxFundingFactorPerSecond": "0x004e278e7702bb56eea4b7bfa829e24caf2f518450986ad173e546530d2e0b62", "maxPnlFactorForTradersLong": "0xc5e37a7383f04094590554537fd623f3f5e2dfb0c1ed990e050d311dec0b4db4", "maxPnlFactorForTradersShort": "0xee9e62068284a18ed2aa3b418994b275c3bdcec92ceaf9df9e5424cce221f64b", - "positionFeeFactorForPositiveImpact": "0xadcac867fbe2a8921851835e116067be9c8cb80a25e3f9dc8605f42936c0a6d5", - "positionFeeFactorForNegativeImpact": "0x77dfa60716036f7a00a2b0fc133c1fbf8a019ab698205223897a482a4285000b", + "positionFeeFactorForBalanceWasImproved": "0xadcac867fbe2a8921851835e116067be9c8cb80a25e3f9dc8605f42936c0a6d5", + "positionFeeFactorForBalanceWasNotImproved": "0x77dfa60716036f7a00a2b0fc133c1fbf8a019ab698205223897a482a4285000b", "positionImpactFactorPositive": "0x7a07316499b40f0073431796eece11c8912bfd12dfe2996258ff15f97531c120", "positionImpactFactorNegative": "0xc20c88d27b7d859c64ca0ebedb1966de23dc1f690724efe32accfe87c5a6861b", "maxPositionImpactFactorPositive": "0xe9bbed667ae52cbcc22d8903f5f3c889e17cc0b4a6fc995a26385ef189bb8c68", "maxPositionImpactFactorNegative": "0x3c09dbea3b5ac087cac8f9c8f775aeddbdadcb2be2d04ec6e7353bdab8da7635", "maxPositionImpactFactorForLiquidations": "0x8e295cf7af601901120e22edd2c3ae17b6fa8e0fcf16c1744f374054ae457b1c", + "maxLendableImpactFactor": "0x8d16f5c15f018ef27f8fffe83d845516d72374453112ad3c58f6ba9c4854278a", + "maxLendableImpactFactorForWithdrawals": "0x71fd88f3e3d94c6b3027b0b13b0c6fcaf00118b551fb1290aae4c362d2959e9b", + "maxLendableImpactUsd": "0xbd4ef1fd1114165f56db57865f029ec14b70c5137ab2100cb2f51c263d0701fe", + "lentPositionImpactPoolAmount": "0x37dbc28688043222222ca65d6034c3457c780155d9da89fa92cfda496573c08e", "minCollateralFactor": "0xd2a56837fd65e7a57ec1b4df363df080248a402cdf8e4e10d32205f1299315c9", + "minCollateralFactorForLiquidation": "0xfbd2218164ffb156dd63428496d0a3038351db6817aa610b8a3d9c01b6da48d6", "minCollateralFactorForOpenInterestLong": "0xf7423212c3b818bdb9261de36121cde34561293943f7645be9b61f0c35d8a996", "minCollateralFactorForOpenInterestShort": "0x4940911a4ea682a30fc360ef3c5e02a757e3602a50c2abe4c13542699a19566c", "positionImpactExponentFactor": "0x795f98ee94796448bf3c91698960e4f41eda771cc887322c8157f4ab66fdadf0", - "swapFeeFactorForPositiveImpact": "0x8051fea8c9ec4de78eb316a8f6d57c8d0b9d3dac08c8a31160bdb0338a464696", - "swapFeeFactorForNegativeImpact": "0xd4a1049e6ea909adb6b8b5053de089ae6d2daa94063b181bde473d202ffdd8e6", + "swapFeeFactorForBalanceWasImproved": "0x8051fea8c9ec4de78eb316a8f6d57c8d0b9d3dac08c8a31160bdb0338a464696", + "swapFeeFactorForBalanceWasNotImproved": "0xd4a1049e6ea909adb6b8b5053de089ae6d2daa94063b181bde473d202ffdd8e6", "atomicSwapFeeFactor": "0xe62f0e0365e746421c58914761a9d357d610cb48872ab926c581ce083d18f243", "swapImpactFactorPositive": "0x22637b36db12b76a57e8d2282175608a9516baec885472a076edde09e43cc8c4", "swapImpactFactorNegative": "0x61bc53940189842d15da4f36e1a347872fbeeaf835344cfcdd930d6a2a9f7d69", @@ -6921,19 +7596,24 @@ "maxFundingFactorPerSecond": "0x5e9c13af5bd51073d690fcf1d92ce4fbc5a18fe616d0753b9b8089f080d46d2f", "maxPnlFactorForTradersLong": "0x111c54fa8fa9b8f89c04ea2006627602fd015c62512f1c5e61d432c1fe942968", "maxPnlFactorForTradersShort": "0x5cb4e4a6d83ca3d2868a466198d3173d458c899f7555f78541290b9f644f23f8", - "positionFeeFactorForPositiveImpact": "0xd7d0c01acab1ea6cc465b2701c6b5e5c5292c6ee342c478556ca16265a760d0d", - "positionFeeFactorForNegativeImpact": "0x00b6dbe9a37a2707f1be21a552e2463cfbd8db4a5e35ccd714b5c0bb29e97eb5", + "positionFeeFactorForBalanceWasImproved": "0xd7d0c01acab1ea6cc465b2701c6b5e5c5292c6ee342c478556ca16265a760d0d", + "positionFeeFactorForBalanceWasNotImproved": "0x00b6dbe9a37a2707f1be21a552e2463cfbd8db4a5e35ccd714b5c0bb29e97eb5", "positionImpactFactorPositive": "0x6f94cce3663de546a3528f8755407b57f03730094ba6f211b0e42a6a70f8eedb", "positionImpactFactorNegative": "0xee2c38b11e133a53650fbfa980cb4bc36122945f2602992ef66fde5e64eb72c9", "maxPositionImpactFactorPositive": "0x5bf9efed9d033d8b3d82ac1ba1702bf49d60d7777d313cfbb63d8526acacde52", "maxPositionImpactFactorNegative": "0xa072463b5208c63f61e70635833da9e17f4c8b309731674dadd4b5ed2aa2d6b1", "maxPositionImpactFactorForLiquidations": "0x4c6abc8a7e55f93dbe98925db44f441c8a6d58ae4c30f1c292d2de9be2bacc8d", + "maxLendableImpactFactor": "0xc6273fcfdf59cd91deb9fb9686994494903d24a668dd4ad0960048cc817a4723", + "maxLendableImpactFactorForWithdrawals": "0x6213a0c14104706f4387d058b9cdb7582e400d89a03dc291fd9340077744d57a", + "maxLendableImpactUsd": "0xd790b6460a2b4c13213d3a699653358bc4d22d0e5324cb36d2ea96b7082a2fc2", + "lentPositionImpactPoolAmount": "0x90f402d88b7e250c0375c0cd9913c020c63395778aa45a0262d28e8b77d7e6f2", "minCollateralFactor": "0x2f63aa6789d2240d4a5aad10ba4b0c0db02e4972c9dd4ab57f67efec5028c9fe", + "minCollateralFactorForLiquidation": "0x0665b1af9c69fea970edc0f3ec2b5c6e6319e90749f8f70c60460cd7bde7230f", "minCollateralFactorForOpenInterestLong": "0x8854c35c045fa4645e96d74bbd69b2e0bc8404a342aa528d70cdc0c015026ca9", "minCollateralFactorForOpenInterestShort": "0xb0c72eb9d2d10ce537aad4e5cd5d143f5b5c48dd97242bbf412e9389771dcb22", "positionImpactExponentFactor": "0x64355c2777d71979de9e4cdfbad1d22d2f3c0162f675b37da17c3f912c43d52d", - "swapFeeFactorForPositiveImpact": "0xa84ba5835f870711f5395ff91353a8b6cad4f3c91c427a56d5320d1a1e73df7d", - "swapFeeFactorForNegativeImpact": "0xd2ef95e30885f11501ff5474333b4ddab4a7c3348404023f250f4b4cc35868c5", + "swapFeeFactorForBalanceWasImproved": "0xa84ba5835f870711f5395ff91353a8b6cad4f3c91c427a56d5320d1a1e73df7d", + "swapFeeFactorForBalanceWasNotImproved": "0xd2ef95e30885f11501ff5474333b4ddab4a7c3348404023f250f4b4cc35868c5", "atomicSwapFeeFactor": "0x6bce913f581100dedec439ca6a6eaf80d0df49d846242f6f00b0bff1c2a4d493", "swapImpactFactorPositive": "0xbcf53b75dc064d05b8bbae7a8a9024400149ad81b3ccfb631fdcda0458c165f4", "swapImpactFactorNegative": "0x3dcb45d69a8bf6040e48ce2cbb0331be6eee579fa2332e638f0399c4b36e059b", @@ -6972,19 +7652,24 @@ "maxFundingFactorPerSecond": "0xd1c75d99d1e0d55fed811ab7109f61d2a5fc5dc753395161e0a250bb568f1eb7", "maxPnlFactorForTradersLong": "0x5178c9558eb7f0e67cb317eb0f0db1bd5dc31e9af20d0431221c62cebd6c0f43", "maxPnlFactorForTradersShort": "0xb9d62f806f60de1776cc1a1441f3166ff0f040f1290e9f1edeba9e884fc29b3c", - "positionFeeFactorForPositiveImpact": "0x85da364e330c83367e0ff53a8201bc1233422ba6defc548390d2fb6a93fe02b3", - "positionFeeFactorForNegativeImpact": "0xb8a86fe041a22eaf0cebba2f98c6dd1a531187f598e901dd6789bac6b2ea7e77", + "positionFeeFactorForBalanceWasImproved": "0x85da364e330c83367e0ff53a8201bc1233422ba6defc548390d2fb6a93fe02b3", + "positionFeeFactorForBalanceWasNotImproved": "0xb8a86fe041a22eaf0cebba2f98c6dd1a531187f598e901dd6789bac6b2ea7e77", "positionImpactFactorPositive": "0x64d7622ed8e794198faf8ca31ceb147ece9c26b6893932e57df76a33c36fcbd3", "positionImpactFactorNegative": "0x0fca63fa41ce47cda279cb680774b4933f5ac163bd047f18e91981cc047f107b", "maxPositionImpactFactorPositive": "0x3f0459921f4e5e61cb8d446dd272e0bfd9f48cdb07d56369dbbc483b2722412d", "maxPositionImpactFactorNegative": "0x0a70f20878f3ebcb0412780dd074651d29dd4e33564801af749ec1b219e3ce86", "maxPositionImpactFactorForLiquidations": "0x0c38e8b8f845b3cc6c44e36ddf308aead734dee480d32f423c9e7e77f9b0c20d", + "maxLendableImpactFactor": "0x5b88cb66dee6cb5dd91dadb3901d8750fcd4ef4958d904cee1c86a554127e19e", + "maxLendableImpactFactorForWithdrawals": "0x2ad2552fb14cf42643c0cd8d117266d5f9306cf7973c8e606b419b86fa432eb2", + "maxLendableImpactUsd": "0x223f7aa968e4d0cfa0719b43405e29ecedbc98585b16e36703fb433f3a5c0d90", + "lentPositionImpactPoolAmount": "0xfb1d20c5fa708d5d80f340dd72df24d3b3a657a382d8d53b8927da368c88f2c7", "minCollateralFactor": "0xd38d20369d10ff1ed3db4eac4f163d02310aedcd18a1d8ffd0e6e3ebb41d3907", + "minCollateralFactorForLiquidation": "0xb09c34890fe5881ad70910d4f2f6ea1ad50ef8990deedb4f6bd2a67212024656", "minCollateralFactorForOpenInterestLong": "0x09d4ab823430791729510b7468eaaabcb5e8c00f90ecaa1c0fdcffec4c8aaa0a", "minCollateralFactorForOpenInterestShort": "0x579b51b3578168574b5541908b2b4d2a82f61c2e826c25afabf9d443e128d5ad", "positionImpactExponentFactor": "0x35d0a868df28094966b90e68e435ce14766666913cd4ac19de3d2f6e17f350d3", - "swapFeeFactorForPositiveImpact": "0x33a28ad90937883abb9dbc045d6711064d05be93dc5f2805878a0fc4c3847fca", - "swapFeeFactorForNegativeImpact": "0x671f1f5b7f0621951ea9fe875c9f5d648343b4f77ed6ade840a32b4caf223378", + "swapFeeFactorForBalanceWasImproved": "0x33a28ad90937883abb9dbc045d6711064d05be93dc5f2805878a0fc4c3847fca", + "swapFeeFactorForBalanceWasNotImproved": "0x671f1f5b7f0621951ea9fe875c9f5d648343b4f77ed6ade840a32b4caf223378", "atomicSwapFeeFactor": "0x1e07a30854257a03f15d64a12ba476fc3f11822584607c73ec8cf159ebc9684b", "swapImpactFactorPositive": "0x780903830a9905f560d95f984e56ca7a535833e0bc89c7c2de42ffcbb432b0c2", "swapImpactFactorNegative": "0xdbe58f613a7e4a83dd8f4f2ba745c6bc2a0c8f5d5558b611dbc0d06a12f8d934", @@ -7023,19 +7708,24 @@ "maxFundingFactorPerSecond": "0xff6698495092f6f156e88af5173fb3d86e5c4f0a72e74984b560766b186e2c1b", "maxPnlFactorForTradersLong": "0x5c1093d84b01a746d4b8c95544831ac2638da23ddf64e962929c4bfc6ffc7e29", "maxPnlFactorForTradersShort": "0x1bc4eddcf3728b1855ea78bebc5b067fbf0de2f3fb75cd873d2e248535dabb99", - "positionFeeFactorForPositiveImpact": "0x38dd2ccc17adc9a4c4b524f6bb1a4dcda13fee1268a662f46e935fcb59675902", - "positionFeeFactorForNegativeImpact": "0xdd10c7fd407c5f9532e0f265c2c62c58b473945b96144bce0a6a7bdca076532f", + "positionFeeFactorForBalanceWasImproved": "0x38dd2ccc17adc9a4c4b524f6bb1a4dcda13fee1268a662f46e935fcb59675902", + "positionFeeFactorForBalanceWasNotImproved": "0xdd10c7fd407c5f9532e0f265c2c62c58b473945b96144bce0a6a7bdca076532f", "positionImpactFactorPositive": "0xbacca2d52482098f69dbbd12e34d1dd2e74acbc5110dc2a9683cd6cc3daffc4c", "positionImpactFactorNegative": "0x9733b0f659b3c23d37f2e2ed58d0bdf22b880057ccefdc4db9c7183bfacebdac", "maxPositionImpactFactorPositive": "0xf89e8a9d7805cfff27c4f5ca38fa2661cd2173227d018b822c254d982665680e", "maxPositionImpactFactorNegative": "0x43e3fef6d75c28ee36b8f8df12f375aaee95018a1bb6525b40c440a85e40a724", "maxPositionImpactFactorForLiquidations": "0xa20e5a211dac98b89ee7dd23830d4fef0b911bc430588d4e4a3ffbb443ef888e", + "maxLendableImpactFactor": "0x60ea3fb8c0541347b44a27c9adf58e1d7977c75a12da3231c1f5d99177670b91", + "maxLendableImpactFactorForWithdrawals": "0xae7bf691e11f1ada5a403209414a428140d869b9f15bf32c4d8abffb7b4f37b4", + "maxLendableImpactUsd": "0x7cca29147821282e9cd61ddbbc45b2989d9a4fab470d277e19af5d91c49df52b", + "lentPositionImpactPoolAmount": "0xd18d949138e1a7b7fd3bbd5e09e89ba26ec06904f7a2b1936242b3cdd2c7ab13", "minCollateralFactor": "0x28b8c6de3b16af893d3062b3c6dd997355b0571f574d9d3614932a2aee60c2bc", + "minCollateralFactorForLiquidation": "0xdf248c72ad94002750220a12ba36fc086656e26676a6700755ba2e70eb3bd3a7", "minCollateralFactorForOpenInterestLong": "0xdfad34850b6f15e9790e144784adf3e0dbe917690bb3f58260b5e578ff17e8c6", "minCollateralFactorForOpenInterestShort": "0x94ec591967c0c2e8b041b2a28bdefa3b898eaa8cd7752278ac568543a7d600e0", "positionImpactExponentFactor": "0xc412266eb7c2ad47ed8f8e8466b3f28a9cbbb8c1a1366f702a948ef7de625198", - "swapFeeFactorForPositiveImpact": "0x0e1fd9b3a95146e9c5fa9bf8f76c80ba91f3ddc271c5cb43a2b574fb4150c557", - "swapFeeFactorForNegativeImpact": "0x6b9f269680991ffdd1f95773dab02b0962549ff15150976518a739e333c551dd", + "swapFeeFactorForBalanceWasImproved": "0x0e1fd9b3a95146e9c5fa9bf8f76c80ba91f3ddc271c5cb43a2b574fb4150c557", + "swapFeeFactorForBalanceWasNotImproved": "0x6b9f269680991ffdd1f95773dab02b0962549ff15150976518a739e333c551dd", "atomicSwapFeeFactor": "0xe6ab96eb56a8cf140d345d6f681e1ad4ee5897159a1f571c4b7d81273301acae", "swapImpactFactorPositive": "0x59346f9a4a1b766c626faf5a262d7c4682290eafde924edaccf4793b5aaf9ff8", "swapImpactFactorNegative": "0x7abecb50f1f40514c8910dfdbe2c77053ce52f786284e6cfbb103935052858bc", @@ -7074,19 +7764,24 @@ "maxFundingFactorPerSecond": "0xcb59ee5ef3be4bb3dcd75afcf8cfbb66dfae23d6e9f836ac3da808d3fb18afd6", "maxPnlFactorForTradersLong": "0x35cf80c1d6ca70828ffd5850a8470b83ed4be705cd4c53d5e31c7a71c13acd5f", "maxPnlFactorForTradersShort": "0xb3de355071ca623883ad8e9625132c0af60f04bc5d015b6222463bce1b564dfe", - "positionFeeFactorForPositiveImpact": "0x6b96cff86524d5625bd57c852413391a7e705a4c7f4f4510ae95963142243b1d", - "positionFeeFactorForNegativeImpact": "0x16ac8268f70816ce91541a0cce16bde38ea509432b182bd8925799d34f35479b", + "positionFeeFactorForBalanceWasImproved": "0x6b96cff86524d5625bd57c852413391a7e705a4c7f4f4510ae95963142243b1d", + "positionFeeFactorForBalanceWasNotImproved": "0x16ac8268f70816ce91541a0cce16bde38ea509432b182bd8925799d34f35479b", "positionImpactFactorPositive": "0x7d619479b2efd31138f8d97c5b621b759c6c66181d9957b2308864289d1d5a3a", "positionImpactFactorNegative": "0x525cf3807a5f51ee9eb90b96c15535155064117ca8b01820ac02a7ba105a48c5", "maxPositionImpactFactorPositive": "0xfa7f7b8a323dfc202971fc487699fe4182f7bea1e938000a0ac5cdf2e3e4d08c", "maxPositionImpactFactorNegative": "0x0f8d93bbcd3913979a10b97c5c35c0ac9422be88b98c33f2a2ac7883626c8c46", "maxPositionImpactFactorForLiquidations": "0x631c0c8acda0aa7818ad99ee375e50d8c4275aa073e6b3dc0861797d835ab103", + "maxLendableImpactFactor": "0x2a06ec84a62ccb33f287dd45185f7bf53cc99a1f93569c347a3235b9c7627ae6", + "maxLendableImpactFactorForWithdrawals": "0x2fbf71e0d4fe56729305f96cabf0114d94bb0f0b6084c580588b4b44a9d492e5", + "maxLendableImpactUsd": "0xbd9c23f98d94e6649cb6abe4422a6332e3860e2c52306a711662240d466fd90a", + "lentPositionImpactPoolAmount": "0x7e0650a0ea46877b830195e52bead93bf0a89cd861fc5fcea632beb980abcec3", "minCollateralFactor": "0x31ff077a89a32edefaa4d80de3855e73eaf6a40cc50f32ebe71560a577c4afba", + "minCollateralFactorForLiquidation": "0x5d282deab53e4da440e31d2f5627a9596a180d66855aa39e8afb0fb887459757", "minCollateralFactorForOpenInterestLong": "0x5adf64aba368af76710a5ace26141cbcc2d482564ff50ff73428a666445593c1", "minCollateralFactorForOpenInterestShort": "0xd44120b8a84afe8d59f0398a652e9af48d30ce0d68ed753e577d4ee474ec59a5", "positionImpactExponentFactor": "0xea5bbc31f9ad83ef0b26dc676f4badba0dd7967b8c2fdfaf5fcd6e378541d5b9", - "swapFeeFactorForPositiveImpact": "0x3528ea3c107c290c0787944fcffb8dcab5c79eb99749ef137cb4251321c05bea", - "swapFeeFactorForNegativeImpact": "0x7f2d20dd6425fb3deefa3d5e2fb1421b98021539f97c248ec897a051737b71a9", + "swapFeeFactorForBalanceWasImproved": "0x3528ea3c107c290c0787944fcffb8dcab5c79eb99749ef137cb4251321c05bea", + "swapFeeFactorForBalanceWasNotImproved": "0x7f2d20dd6425fb3deefa3d5e2fb1421b98021539f97c248ec897a051737b71a9", "atomicSwapFeeFactor": "0xb385bfac626209fd528bf5ac05da0bca75944b6079274d8edf7de200d6b709b0", "swapImpactFactorPositive": "0x7994d0769514a0f8458062cc3ec7ac46e35e61a41837ef95de31499b096f6afa", "swapImpactFactorNegative": "0x51498d6010ec706431bb43497559c424d46d5a4732ae654c0f8010ada52e32a6", @@ -7125,19 +7820,24 @@ "maxFundingFactorPerSecond": "0x3d879373a6dbc474117188678af6b54c7b754d7349a778a272952be0055cd801", "maxPnlFactorForTradersLong": "0x1d4b3905266555bf208c7e91f0df10c6e90f04866f4c12524c458ddb8e46e544", "maxPnlFactorForTradersShort": "0x8800492fed366a35684b184acff0e9017122a2f1f170d0c02b8687f895deede7", - "positionFeeFactorForPositiveImpact": "0xa50c13baccb97ab048c4ead7cd94dfe2695883e1d3a197cf448032ea3c93a375", - "positionFeeFactorForNegativeImpact": "0xe4f900a5f09daf553661a9bd0fdae509b97500b0866865182ade55accc608e68", + "positionFeeFactorForBalanceWasImproved": "0xa50c13baccb97ab048c4ead7cd94dfe2695883e1d3a197cf448032ea3c93a375", + "positionFeeFactorForBalanceWasNotImproved": "0xe4f900a5f09daf553661a9bd0fdae509b97500b0866865182ade55accc608e68", "positionImpactFactorPositive": "0xa6e9f0c5c0b0d06ae6c7277beb6df5fb688e0f4283e201acd07822cf2af06ceb", "positionImpactFactorNegative": "0x52b0b5ca35497485a83e29a44f88bf5c84e307f6279e296af1a81f24d5a108c3", "maxPositionImpactFactorPositive": "0x5d467c9f907e36c18b5409da7f1644855e816266fdc8a8d4a2675737253055b0", "maxPositionImpactFactorNegative": "0x682266750b3120e1ef54690fb33594543a790242cf65f4fa4acb058416de4e08", "maxPositionImpactFactorForLiquidations": "0x6b484552e98fb266ce6eadc47c4f48f3749cd5d2624591a4c6815c55e6d8121e", + "maxLendableImpactFactor": "0xa456c783748d386471539dabbf506b9f523aca38e0cd40409d8d9463ba4ab882", + "maxLendableImpactFactorForWithdrawals": "0x154c58896af81cac2a2ae567841141398833a5ea9bb6efd0215d0b64087b4234", + "maxLendableImpactUsd": "0x310ee4e0657f8fc1c015e019261f7cfaaba724ab6a864d5ccb6789fdde5c5bf7", + "lentPositionImpactPoolAmount": "0x05c0ba1e67d6a269ca3e77cee12b3a57df58fc601ecb22b3ca1311187ab37f70", "minCollateralFactor": "0x1adace9e32dddc011e401ada4d5ee58e76ceb2fac5990dac9ff8d1c8d1666049", + "minCollateralFactorForLiquidation": "0x013a678abe6ed4cd220abe15c07141f42893af0f2e47ff3b029c01b50819b3fd", "minCollateralFactorForOpenInterestLong": "0x522166a0e6ac5a421bc8346f41d2ffbeace0d26930dbd211138e25646df6b4f0", "minCollateralFactorForOpenInterestShort": "0x7ddb336108bda726fb332947360b0a11f8c33b983801dbbdddd318a9ab55f11d", "positionImpactExponentFactor": "0xad96faefa227e00036c010d351a3ebbcb3ec721b49800ef99607f862b21c281f", - "swapFeeFactorForPositiveImpact": "0xf1433913b0de4e70f155241c318905ddf54f866c643995a74fc783abba5b5b0c", - "swapFeeFactorForNegativeImpact": "0x072e62bab56c7ea4e91c5ecf1e66732e65b6a95d193631133a001763b30943c8", + "swapFeeFactorForBalanceWasImproved": "0xf1433913b0de4e70f155241c318905ddf54f866c643995a74fc783abba5b5b0c", + "swapFeeFactorForBalanceWasNotImproved": "0x072e62bab56c7ea4e91c5ecf1e66732e65b6a95d193631133a001763b30943c8", "atomicSwapFeeFactor": "0xd44cce6933c88884874d99321734dd2823da1495a6bea0020272a18028cf4b9e", "swapImpactFactorPositive": "0xa9bdf476dc12be080747e58c4aa34606357476853c4dc0e1d805569a12fb9bc0", "swapImpactFactorNegative": "0xe62da899f3cd8b0bb237665e81fa32f29cf80a4952c3756a33a3b8fe15c27023", @@ -7146,5 +7846,287 @@ "virtualLongTokenId": "0xe7ad78f733831866f62141bd25f6d75da98498ad5783721686716dce5043e520", "virtualShortTokenId": "0xb315f0a55a09b93c77ef9d370a2278b19027c88ccc7afd8b899b98bb033ffed6" } + }, + "421614": { + "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF": { + "isDisabled": "0xce6c0c2ecb98c1d352f3d852f960de84f48fe3867311b66232f955f673daf585", + "maxLongPoolAmount": "0x89492e9183bb65131fe32ce8973237cc253240e3060139aaacf9acc66925862b", + "maxShortPoolAmount": "0x73e597a69c0dec119e8916093d87e7b56b82ac29ab3667e27826914aaac30e05", + "maxLongPoolUsdForDeposit": "0x23edccb6911ee20b6d0c59789f3d5d26ff32d25ab07cf85caef8771a97967e11", + "maxShortPoolUsdForDeposit": "0xbf814f0e5300854973f384039fd287bd514ffa3b9ad15b34dbb4055bbb723d44", + "longPoolAmountAdjustment": "0x6e636a8f0e2c668d0c375828110389a372d135cf5506a1da74711575022ccacf", + "shortPoolAmountAdjustment": "0x73661373813516e3c79a1efa7ce587a977bcaef5431403dcfa8cf8bac85ce6a2", + "reserveFactorLong": "0xc03afcc033db8b33bd7107271906b4e39162e08e1d23d18b2aa6279c6b221e1a", + "reserveFactorShort": "0x1e584881c18b1459848bd91c6d6a36e54ef1a5a3c7226108bef84ed92d677643", + "openInterestReserveFactorLong": "0x158bba94013f63393566db1ea024c4720b90490c3a5740d4cbc504fac98e7bbf", + "openInterestReserveFactorShort": "0xc3f27a9edcb2e8b48b7bf88d85c2fa8f9da26558b6093b64adf5bc14c6c08408", + "maxOpenInterestLong": "0x943e889bc8173f5167778e26ae6eb80919379f909bea0a6d493b60789ff6bc88", + "maxOpenInterestShort": "0xca567f7e9b277f4b2ed73a47d3bfd9da23e95e2b0d37a09ac569818549155384", + "minPositionImpactPoolAmount": "0x8cc53d99aed3a213348d20feba316a35eb9d75efce7e3ae404a67436e579807e", + "positionImpactPoolDistributionRate": "0x4a56e82278b786ff671b2d5807e93e80279b21d3dc7ba76580f02987491fa84d", + "borrowingFactorLong": "0x2ea60a18c06414c07b6868f255344cd7af7cfda122efbcbc5e53c1d7fc35ea86", + "borrowingFactorShort": "0xd10f6aa6241a18645103b03f01ce6f7f622049d8419492055aa2a54d007ab877", + "borrowingExponentFactorLong": "0x58510b24e1be2d1be14c874e3c4f90672f8b2ba0b6cdf01d31f74805c7b686d0", + "borrowingExponentFactorShort": "0xf518ed27048895476ad4c1739a4b4288fbacbe291befc9bbda662828db1d7d77", + "fundingFactor": "0x449c0b68dea79628b772625526bf9ad7612d7bda5ee9f1151b93963aeea27221", + "fundingExponentFactor": "0x31e83d07a65d45c1f7b0de4c4a1edf381b234e12877789a8b2a06807896c2ac0", + "fundingIncreaseFactorPerSecond": "0x7ef9fb923e8d5a0ebaad6bd6b382643fa9bcc2a2d209ef40400e6d60f384f6f2", + "fundingDecreaseFactorPerSecond": "0x63b7ed3470036ab1f94ee0d411eb6be5be422f45ab93d60900e38d4934f026c9", + "thresholdForStableFunding": "0x8f737a9a7b2ca376fd6210689f39567605ce3bb3a84e545c73d954309be7df59", + "thresholdForDecreaseFunding": "0x258e7b0d5ed47dcd083c082cf1538b6fc6d986d7809b0e6d508aaafc51e0e370", + "minFundingFactorPerSecond": "0x51cd017d8401cf5dff31636de9d78fa0135ec22804086c2709f27ada08ab479c", + "maxFundingFactorPerSecond": "0x0819314a7a0ccad3addec63a8f871db40c19a9b95e1f63615a8bba140630f8a0", + "maxPnlFactorForTradersLong": "0x9d4b0bc82a0b1b09075ff804cad8c941e6ace3bb074724d30bba974ef8cfc11f", + "maxPnlFactorForTradersShort": "0x9574252828683f00a80ad5ae60eabbc8df2d88e20b58052c1b1fa376af11c838", + "positionFeeFactorForBalanceWasImproved": "0xb78c4d36b9d748c770c1f5d4dc131819a12adefe3d8f9473dfecc038d5b28eae", + "positionFeeFactorForBalanceWasNotImproved": "0xf7858fc955e73874ac18c2d1a0a4171a522f70de0d21d96cc55cbbb4ac31846b", + "positionImpactFactorPositive": "0x679f24874d8b50cd1b92b812fcbcfd224c6c8e817c7e0beb59ba85b90b2b07e2", + "positionImpactFactorNegative": "0xc97668cd423c1910439b16141588f37f5300f570dcfea5e8d18b72c9ae91a2ba", + "maxPositionImpactFactorPositive": "0x195d5103e0b678fe18962202af5e0f7d23f006ff5d6f4251507fdc33b0904322", + "maxPositionImpactFactorNegative": "0x2d7f0f5d04c19fd9d7f353e8f51112370c9797b3cf3e47df3cf405a8f984a6af", + "maxPositionImpactFactorForLiquidations": "0x0f49be714a6c0867808bd206252d6923e950915118468a8abe497acb9d266093", + "maxLendableImpactFactor": "0x022ad3811d7b7d91bc080bd3301809fcf2f2d81a8038cc01dd3055b8eb688620", + "maxLendableImpactFactorForWithdrawals": "0x19d6b24c84ef3046336297552cb5a0d5d7bb5b7b7d08fbaa16f0891be5cf1209", + "maxLendableImpactUsd": "0x99b21d3e9498dee8d5ac721b3ee663996f73b5c396afff9e8d85a398cafed053", + "lentPositionImpactPoolAmount": "0xf989959db1a04a0704266024f6d994121f3e33842c9e7d51dda04dce3617b029", + "minCollateralFactor": "0xc8ac65a0133369e799e6bf3c2643209fc8999c2bcff00259d9627e16ab94df40", + "minCollateralFactorForLiquidation": "0x5f1772e6791b6c0a69b330be106779748f3a9f8d283357a42308bcd741f65989", + "minCollateralFactorForOpenInterestLong": "0xce4c8aa0201126eed98457458fc4d149dcf4493dd67f019fba0201d31699ef29", + "minCollateralFactorForOpenInterestShort": "0xec53e2b4c748d71f93a22d19be42e483fb467de3da64e08345bfe07b46cf458d", + "positionImpactExponentFactor": "0x86e444a2a7d73b6e45ce3d479c088bcff698e43838ad15450330c9c9eabd8529", + "swapFeeFactorForBalanceWasImproved": "0x582396506dac5a19c1f0d1830190c86cb1806ffa2f7fe28ecc2fe43355a322db", + "swapFeeFactorForBalanceWasNotImproved": "0xf591bff2380073f41efc2642b062009ea4f5a8cdcefbaed5d8fe46b94b228acb", + "atomicSwapFeeFactor": "0xa3e865258a0c6c558a839986f79a58c226474df4d8361461925154417547351d", + "swapImpactFactorPositive": "0x4ba7599baa40e9165e69982d1a27dcce324f52f09654b8e59a50aad15bff499d", + "swapImpactFactorNegative": "0x7f4945cb90820690df92a26203f54d6dec3444276801e77b49ad6ebcd60792ed", + "swapImpactExponentFactor": "0x2cf00a0393c53a8d1adf7cb3a553d29a0d8e951cdb793e24e891264f37a252da", + "virtualMarketId": "0x1c5f558f016365f8662333fd181132c33c50ee0bf4947fa83fa9e776133da025", + "virtualLongTokenId": "0xbeb8096910fd4d4b3ade12aad31c27a0e5f047fce87d1279b0c71579a8c4ef5b", + "virtualShortTokenId": "0x14f396b003aeaa96ad78845dcb7d6d9789c777a23d4ea1e14a7dc58704a595b3" + }, + "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D": { + "isDisabled": "0xe1e304a1d3f1b7aed5d7643887746b17682425b7b06073c08a2054e8b5721b9b", + "maxLongPoolAmount": "0xd695cb6384004da9658032d6fd69874a10da52bb13a19813f816a0d14b0f719e", + "maxShortPoolAmount": "0x4f0f32930b9a140ba510ffe0ce2d85cd60848909bfd7efe19b1aafefabc6838d", + "maxLongPoolUsdForDeposit": "0xf1d19ed404ec9744adb4ecaa5940d32a5d44635ac1089b2aefb9aa7f95453c6c", + "maxShortPoolUsdForDeposit": "0x440eab273a4684158d163843799a346464e5ef680ff01e5b43b04bf399a97f53", + "longPoolAmountAdjustment": "0x053bfc751b03d34819fd9d82af904b2b15ed4cc1bd2e82f6c3e822c26adc8b1f", + "shortPoolAmountAdjustment": "0xe85e5d6ddf933f1b269729cb69eb92b0f5485426b304ed17f434f00c6156d2ca", + "reserveFactorLong": "0xf865e3c8dfebcb3953792a6f4a52185334b12bfe1208957f13a13476c6c3c549", + "reserveFactorShort": "0x3a491ad6e5b0c5bf1147255d18a85301f651c2fc798765cf7eb593631637a867", + "openInterestReserveFactorLong": "0x757d9ede69fb1f95303e4885b813c08dc5ee4a0bd34f724dcbd4f09d3c06be38", + "openInterestReserveFactorShort": "0xf79421e69bda7c2e7dff57266b63a20c15c96bdaed1756b2d87d74d1fcbda7dc", + "maxOpenInterestLong": "0xc7a7406ac715c249cc6016b5ac35f34c9f143e496cde8fc7c78a415ad75ef307", + "maxOpenInterestShort": "0x1c454e6ab21509639ba236901f551b98222da30388556533873707431ead0316", + "minPositionImpactPoolAmount": "0x564e14b2100c4184ee92a21091b1434c3cb8447cf8d721fa7b1fefa59fcfdfba", + "positionImpactPoolDistributionRate": "0x9a93fa9f6c680c28dbe9c02e2a479caa6444c905efcdc178aa14be5cd057956a", + "borrowingFactorLong": "0x93a3842e312fddb0563ca982845cc0a738286f9a983c0b7cc9b3d00b4d2f20f6", + "borrowingFactorShort": "0x32556229ced23871d8328779aeecd80e1aa21dfcdbf9d1d9335c69784547a861", + "borrowingExponentFactorLong": "0x8aaf9fab3ed2dd70aa8dc71bf8325444c61d5917a07a9493ab268496b6dc5218", + "borrowingExponentFactorShort": "0x76c8c2f2169f8feccada373c91fed5951fd4ff52b103cd6df0417d1d3e1d5ac4", + "fundingFactor": "0xdf254aacf81fd1ad398184e3d31cb69698b081e03bf71648523266ee6f99f3ee", + "fundingExponentFactor": "0xa1903f654de2aefabb3301853f73cdc88b1de1a50b4fb5bef2b1e129bd62c9c2", + "fundingIncreaseFactorPerSecond": "0xe704c715f69ff2f8a5c5f6767ff32133e0aa5dc28485fe338684e2f0d85c5ec9", + "fundingDecreaseFactorPerSecond": "0x864dce8a9dbe818c77ce0d6a17d237888ce66e92f4538b69d53158782f78d90b", + "thresholdForStableFunding": "0x8df13680577c7e74b9754f433fe72dfe0cfd9913bcd887646868c6f4aadb0d44", + "thresholdForDecreaseFunding": "0x503de8950935dbc45b470350b5f7a0889c597228c0deb43e95c15f23d40106c1", + "minFundingFactorPerSecond": "0x8c86c3a2ee160ec9bdbcddf59f26c11376125ab8051fdc0ecb633d41bb848ae6", + "maxFundingFactorPerSecond": "0xce11facf77fb82e1a1d1845d38e100ade11aa7ad61a90c9920dbfb43b527986b", + "maxPnlFactorForTradersLong": "0x791e3a1f749906ac461b79c011bdf0ff8b232095ccd3223f8ea223de91a24464", + "maxPnlFactorForTradersShort": "0x3f33bb1ca09d93e827e72241e157a0ffe823c79f199160c3f904b044a4fa20a0", + "positionFeeFactorForBalanceWasImproved": "0x08438db6daa87a913feda631f68759dc6ac09b740d7a98ce4c49c9a1538dc1f5", + "positionFeeFactorForBalanceWasNotImproved": "0x613d88324299f23d8454f412a02f35cd3dc73e707a7eafe7cd59c01f11b73536", + "positionImpactFactorPositive": "0xe5d4228737565bb87aec9a167b07ca264620d828db9ef79990c54ffa971af118", + "positionImpactFactorNegative": "0x8734f73a31d38410fb1ad685c661c108f81088edc5eb4b5d2bb5c80f5a2fe662", + "maxPositionImpactFactorPositive": "0xc0298da5a9e2deaa3cb58fef159a83d6acd73199e529486e390d8954d805d54e", + "maxPositionImpactFactorNegative": "0xc0adebdf41a6f30c0a33e801dfe4441bd35a183f3a78a7799831c978f222fd42", + "maxPositionImpactFactorForLiquidations": "0x71d401a3103b3ad15f7b3bd545bff45fd3e911b15a372869c7da887e570b2ca7", + "maxLendableImpactFactor": "0x7b6fddaaab7639f429fe405d397616696bb906c4be231cfb1c4d7e236562c50b", + "maxLendableImpactFactorForWithdrawals": "0xe556b79a93716a37cb4b0a756f9742dcdadef058d74a812d65ae62ae59a89e54", + "maxLendableImpactUsd": "0x9cfe20df3a4b61875138447ee723fe49dbeb3527295e022c21c020256c16ed3c", + "lentPositionImpactPoolAmount": "0xc4308a48266b27dbd2e69834596e4a81c95624603602246bc55fb30d0eee0b0b", + "minCollateralFactor": "0xc71123704a2c87e18f41f95e892d2e27ce8da0b6018544ae460f48f8f2144ea4", + "minCollateralFactorForLiquidation": "0x7992b22e42f8e8f71ab230265b54505134806d370ae23ea1846b52cadd750028", + "minCollateralFactorForOpenInterestLong": "0x06dae7e677152cf439b23a94671cfe2f632bae0a0eb85f52610742b73280818d", + "minCollateralFactorForOpenInterestShort": "0xd2576f0cd21f4f8b4aad0b77571a8f5288935a3a461fd9531f47b73aa3bff01e", + "positionImpactExponentFactor": "0xf44a08bc5690d4fd32f6b9bfe2deabee95b4ab4d36c368b22e428736451d5786", + "swapFeeFactorForBalanceWasImproved": "0x334cc9b895850a332fe44e9e2215e5112afe286f0299655afae72b50c7eba86c", + "swapFeeFactorForBalanceWasNotImproved": "0x6fb4f892d73acfa2c61cd7ff401e7cfb10eaa3de07ef7c585307b232ca95a17e", + "atomicSwapFeeFactor": "0xb41252535f4ea1933db20a160f99b2b369e7a3e96ed58e8fc69fd023555b859e", + "swapImpactFactorPositive": "0x8c6991810b91663028e92da492838890535b045f4f6315753142a6587d3ea2aa", + "swapImpactFactorNegative": "0xd61daf7708276f38ea49e14d3a708747b70aae2748be4082f230782a1bc144cb", + "swapImpactExponentFactor": "0x73e3ff3cce5475da6d435335f98d7ebe12eb4516f82fd00d562baadf4ebda69c", + "virtualMarketId": "0xff3e25d5b26afce16c7292fd6816d955cd0a6a9742ad9ebbf9ead33b13cba441", + "virtualLongTokenId": "0xa05108a58d25332e075fca49149dbb671f4b30a226a3325bb46f83000c50ff11", + "virtualShortTokenId": "0x14f396b003aeaa96ad78845dcb7d6d9789c777a23d4ea1e14a7dc58704a595b3" + }, + "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc": { + "isDisabled": "0xdaa260175fc3f2932edb37457d62afbba94e495ae740be393a2569cc8670c4a3", + "maxLongPoolAmount": "0x029c5ecbfd780378e675cafc59b47fd5e3ef6630ff03c439636ca8790d93c4bc", + "maxShortPoolAmount": "0x7bae869049b373441b706e5d0b2a33a9b2d4e0184979a351eca28b60619b4f91", + "maxLongPoolUsdForDeposit": "0xc305af46daf38d80f9127a6def8abaf570059221067bf503a8809584120a2efe", + "maxShortPoolUsdForDeposit": "0x7b2ab53e2abd85166f2b560c2be6a436f3729b08287ffb5c56c2a5f2ba94ce73", + "longPoolAmountAdjustment": "0xf418c257ae268296149111ce163e06e66945126255cd037f59cd5d6dddb6e089", + "shortPoolAmountAdjustment": "0x20bc0492e7b97586507d1a3108a78b318f93f77030adbc5c6f1d216b0eb222d2", + "reserveFactorLong": "0x3d83ecea80d42860f999b5e3501e112306785a87eeb79980e53c5215e9001d5a", + "reserveFactorShort": "0x1e3cf27d5f83c080630f18638b39fa7c678deb87255a369cff61ea2d36cdda9a", + "openInterestReserveFactorLong": "0x791344e59f964cd52f723720d8adf00734c78d1c800b9fde2cd914aef015fccc", + "openInterestReserveFactorShort": "0xa5f56aca5e27195eb038fafad73fa921826a18fa420a871de46b11ceb8696f69", + "maxOpenInterestLong": "0xb262f616cd0572f778cf40bb4f0e11e6bf6fba3e9300926e2447af1aec2b9bb9", + "maxOpenInterestShort": "0x0176e54af2e994b745420ba7fa25ab45f50ba2d8c305e7190428f3033d18b070", + "minPositionImpactPoolAmount": "0xcc2a1b60113f0e4a71402867f8208b3e82ded6bdf8acc6adedb615719d60389a", + "positionImpactPoolDistributionRate": "0x1a13050d1468415f41e69de49acbc2d0275b1ee850f7f758a6e6da60d2a424a0", + "borrowingFactorLong": "0x684ec359bbb20b38cc68c14764059e247d10e57bf8f811aa07764a76822a9c73", + "borrowingFactorShort": "0xcba31ef808fb8aec781dac12ebeac89b87f89150a61344ec1075600a2d27d009", + "borrowingExponentFactorLong": "0xf9560f411ad15f579e9dc0d6ec2050ec2f1a11403d18150da26a9a9db48f5a36", + "borrowingExponentFactorShort": "0x9d5e175fefb1ce684b2cbbcbc4842964653e1470b2d4adfed5f1f2e9dc80e0e7", + "fundingFactor": "0xf28f1e92a1bd7d5222de7498f0a8669398873379f41cdf7d5eae1516d11b15c3", + "fundingExponentFactor": "0xb0e50976650b897579520a624f9cab363dd9e83f5c266edab538a04446788b45", + "fundingIncreaseFactorPerSecond": "0xd40ad820903d0163f728e33f551f31987fc76b3df0359c85815ab7d6fa01a408", + "fundingDecreaseFactorPerSecond": "0x47ede55ce51489b89afc372137a61c2f2a15a4836a5dbfe046aa25a133fec5dc", + "thresholdForStableFunding": "0xd86bdc92e1db208733dc5d54e3e04f9019cacbba1f5ef05003b73f47e1a65ec8", + "thresholdForDecreaseFunding": "0x973e02f4734aeadfdefc4835d5cbe77ef8d89d6d8984e7003f60584c6fde8869", + "minFundingFactorPerSecond": "0xa8590be469f5c8837d446b480606146ed14a04b899b248a02283b65c9abd736b", + "maxFundingFactorPerSecond": "0x644713dc4b6f15531dc82bd8fa0c2b336d9716e8349f7db4701a4830249d42a7", + "maxPnlFactorForTradersLong": "0x639651a76cb1ad07aa38a5ec8812acb51a72e9248b16c9be0bac98d77bb28d6c", + "maxPnlFactorForTradersShort": "0x09b5b7da1228e5261a6568813661c1900086468b3e91ee6432ab559494632358", + "positionFeeFactorForBalanceWasImproved": "0x643470e54ea2759137d583e66023c76b481580c1ccfec2b0dd4865bb25fe74e4", + "positionFeeFactorForBalanceWasNotImproved": "0x6ff5e45b14ecbb02605d082c9e60e11d651d67d98a81cd36decb594652756325", + "positionImpactFactorPositive": "0x45adb3e26ef4f16dd148363c8e7bc917a28eb43db6f3a5116a8ea47ab67ec82c", + "positionImpactFactorNegative": "0x1f1874577913939d4f58e13c84f59296ca4a74a0dcd7e768292435ea7d1c020b", + "maxPositionImpactFactorPositive": "0x8bf288bd429a21ec0e505a4b76fc46ad8599a7cdd7acf412e703e05cba852e15", + "maxPositionImpactFactorNegative": "0xee5014c8e6b0d317afa6dbf3ad0512046c5352ebfbc9e2c5bb8b194b9584a2df", + "maxPositionImpactFactorForLiquidations": "0x5fc79117f4e9b35419d2f5cd17f558be6f5c080156f3f80ccc26bbca8d57f574", + "maxLendableImpactFactor": "0x9200212f010b5dd1abeb243eb2ac086d9bbcd93551d90e20804aea6cab322b56", + "maxLendableImpactFactorForWithdrawals": "0x7300e17fa70454eb385939bf4ec80163beddeaf3f354790ef94aed9dc4c13d10", + "maxLendableImpactUsd": "0x280ea380e16eb78606095ca2ddfc82434fbec454e9779085a9d7163e8d951f8e", + "lentPositionImpactPoolAmount": "0xf71e037f8855a3cc202629a9ae07d8b408ccfd58492c038acea574a2905c18a0", + "minCollateralFactor": "0xf7acb321f5990dbd2bf54ddab8e7426f8c045dd4be514bb56b519748395f3cb5", + "minCollateralFactorForLiquidation": "0x9a87fa7bb6705fede532152e983195af8bf8b86ed9b80c87ea22dea75b961c3b", + "minCollateralFactorForOpenInterestLong": "0x6ed33823024e228a1e472abbb2b3101ade60d23a6a6039ce31db1558d0954430", + "minCollateralFactorForOpenInterestShort": "0xfdc98985190bf92f5a5f4972db27fb5b49fc365e3ec3c65a608cce7ff01a0528", + "positionImpactExponentFactor": "0xf540790997b084333a82f882ae86123e74b7d3ca7f5100a87caf8c87b00cd336", + "swapFeeFactorForBalanceWasImproved": "0x6acb142cb77be26541af1bf784495cd07034fe9371c95a45888cac47bfa4dec9", + "swapFeeFactorForBalanceWasNotImproved": "0x7993bf7ee942df132ca439a415dc24b3a0d37f9d966e7fed424621f22e08aff0", + "atomicSwapFeeFactor": "0xc46dff7dcd179b6c69db86df5ffc8eaf8ae18c2a8aa86f51a930178d6a1f63b9", + "swapImpactFactorPositive": "0xc837e4fd08a4075186e2247915ec7e2af6fcbe68d971d312379a2ede79efc8bb", + "swapImpactFactorNegative": "0x5784a907a885c68e0ded4e2c68ae06e3ab0072a0718afcaf89a77d08b1a4bf80", + "swapImpactExponentFactor": "0xaa5fed51d9e41d58b45b18df3f2d05b427613e1b04f4875164ae6612d4dedd71", + "virtualMarketId": "0xa3ef6bfad330ae40521f70558f2fcadca93725b8acccd3105366e422b829692a", + "virtualLongTokenId": "0xbeb8096910fd4d4b3ade12aad31c27a0e5f047fce87d1279b0c71579a8c4ef5b", + "virtualShortTokenId": "0xc4ab6a4bf31c6daf14b4280e1dca54edfcb90a85aff3598cfb550dbec25f7786" + }, + "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf": { + "isDisabled": "0x3e73e8e5da5a2c49d99343e753feced56b56dec5149a80c9d12bfd6b6b14c179", + "maxLongPoolAmount": "0x6e8305d27641f00d5ee2dcd51756cffc715f0c070b569df60f9d37748e557f7e", + "maxShortPoolAmount": "0x47bfc249d865ba3e7fa37ddb8c08894ef35219d700e48f5e50dda68c648415f2", + "maxLongPoolUsdForDeposit": "0xf88824613fd584bedde59cdd654ee7ddfcfbd6fca9fc0301262bc7fe5b02f212", + "maxShortPoolUsdForDeposit": "0x077b2bb0dc1a1b11668dd4fd319ea2f662a90d349bcb5c47dd98ba0b3b784e92", + "longPoolAmountAdjustment": "0xecbb2f82fe5330278cf6047f74ed37a560d524d55f17c7b01916dd7420049f00", + "shortPoolAmountAdjustment": "0x2cf60c9035291dae87a44b7598e8d283e74ca470aed7cefeabefbb8049445e71", + "reserveFactorLong": "0x843f706dc60d4a87c883780887a33f606ded5c8fce7058881a2cc704e7e8effb", + "reserveFactorShort": "0x263cfefa4032f24002e72993f01a3fb1b7592736a134b4b5d327e1d21851f76c", + "openInterestReserveFactorLong": "0x8fe56ff8982100fae8af035ecb1a498280a226ae31c54ae592bc4384b419cc7e", + "openInterestReserveFactorShort": "0x603e0389e13d90a2cc02adcc05203a9c93591dc2a90b46bff1cf78ee49e89e09", + "maxOpenInterestLong": "0x910b3e02f956c0624cac4721096937943150eb3512905b1ee754589deef81fcf", + "maxOpenInterestShort": "0x0cacdae8dff30a5cb15b383f56de30f3a225199e2a2f3f1b3f8347aa4a6a1c82", + "minPositionImpactPoolAmount": "0xdc8a798526f8870f7e57be73d7d9679477cf3119b89eb8ea8d896282dc5cf19e", + "positionImpactPoolDistributionRate": "0xbcfe325cf09ff7143fcf5e2dcfede756a2a31fee57fb4c79b66dadbba530c0b7", + "borrowingFactorLong": "0x51f37a2a6b08dfcd3d82505d843daad2cd48df5caf98873ab5d697d93045cbfd", + "borrowingFactorShort": "0xdfca0deaffe28de3c7198c2129d890b4fd418e918de0b8c095a286187f1b1ba5", + "borrowingExponentFactorLong": "0x2bcd94993965710c5e67ad2c6810fda6b6c18d418c0cd55224a03c245b28db82", + "borrowingExponentFactorShort": "0xe0925fffb531e814ce9a6ec91a8f9fafa4af268405d71521dfaa37dd37283d34", + "fundingFactor": "0xd36c8aaa5616db3752d2d7ae6d4cdd543747665d03d8ae727235758f6bc3ec40", + "fundingExponentFactor": "0x0b01c0360bb65f92b5740b42e337ef102d510dada7f692ddcd51950765e29692", + "fundingIncreaseFactorPerSecond": "0x624306c52aa3589ced9e85dc2ca1bebe0bf7215e3c53c60ad232ae6572147a34", + "fundingDecreaseFactorPerSecond": "0xe8bd1fcac3682f51cf71497d314fe0308ba55805db055e486878ef705893e33b", + "thresholdForStableFunding": "0x40251ed05d1608f97e27a88a320ef1c69cb26b9a00f0bc5366b0bb30ce154e53", + "thresholdForDecreaseFunding": "0xb222322ab00353dfbfb62a6c43267503532a1275993b8aac92ab4b9bb6fa25cb", + "minFundingFactorPerSecond": "0x5a950930e022aee63fd5d8937bb3b8f75dd87847b72a293ebe3f65ecb33e8f8b", + "maxFundingFactorPerSecond": "0x36ce5651dc4050cff509a4ae5851ef6c46c8809c148242ce599926a1cae18c44", + "maxPnlFactorForTradersLong": "0xaaac151fe4483f6784b1463cd475862ebe13d73608ff674aaa1f0bea2439b530", + "maxPnlFactorForTradersShort": "0x2c315562881c0fc9e5d2f9af924de34c634f941dbc58d939007fc353829f4562", + "positionFeeFactorForBalanceWasImproved": "0xc8c6177c5fedb2073ca588c81ae6161c1f1fb2fdc4403213217dd0b8de721fd6", + "positionFeeFactorForBalanceWasNotImproved": "0x7e5b09f11124a2ccb387d6b35ca15cd880758b3648feb3a364f4d6f792611620", + "positionImpactFactorPositive": "0x42a911e221ae0820a3aa336a98732d26b6f2ea0188f36ef456a85b6fb8fc4281", + "positionImpactFactorNegative": "0x08170fe7c7ae44f7244a6b26525f7b9949f90590f828fb923c0443324476cb4f", + "maxPositionImpactFactorPositive": "0x5aaf6678ea33ed3d589fc87b7805bbb094492c3ae15e56ae493dd9f14fb7eb15", + "maxPositionImpactFactorNegative": "0xff1c5cc44fb9debaf827b86c2caa20763dc9a3af29f0190b8ca7f0e023803f45", + "maxPositionImpactFactorForLiquidations": "0x3f2252f85c1256f07b5f8d3653ba0d151275399bd78c9c150d2d5fdd793dff1c", + "maxLendableImpactFactor": "0x2eb81ca2db52707f192ab9632661f0e1132cdfc0694ad18bee397a254f222731", + "maxLendableImpactFactorForWithdrawals": "0x6a89295107925cc7889dd59bbb7105ac3c9584561e8c96004478d45814e912a2", + "maxLendableImpactUsd": "0x3988b771b9d14b205a91822bd00ca86670b27988546645d5be212e6249b58312", + "lentPositionImpactPoolAmount": "0xcbdd8337c03f23f45a4523c3806217336ba930b7a98c4077c269a09c60c8e901", + "minCollateralFactor": "0x0ea5c12870d31f5d56509a8d6f937d6d265bb0835b1633663c78d3b55ad2cbc6", + "minCollateralFactorForLiquidation": "0x4dc8fa882d20557c438d4b989132dffcdec3a2eaba1089cef51b90436232479e", + "minCollateralFactorForOpenInterestLong": "0x638947e41e3db0abc6f46332e4c0312c0f771ed78912b88148a27aa777c9b3f6", + "minCollateralFactorForOpenInterestShort": "0x7c8769a5a124b433fded94e525223a96e7bbd8896e3f732a186cb3cb7b2aba0f", + "positionImpactExponentFactor": "0x931cfbe7dea65d7aff1a7a9d5ad2deb94a8425d54956ba10da61b16c6afb9b2e", + "swapFeeFactorForBalanceWasImproved": "0xde99941e4f2591ef17e7e67bc6cfd36f554cb1ce2d7ca5c1e72da99597eba076", + "swapFeeFactorForBalanceWasNotImproved": "0xc84b8858b02972a3e3317df608a8c071096fee1a877c70587e6e03f136be8b3f", + "atomicSwapFeeFactor": "0xa79caaa8f613f973bfa9f2169a68ef604f5609c375fb2a8f1fb26bdfd0c1c634", + "swapImpactFactorPositive": "0x074a3442b4dae7be586549047b6a5a6a20ca259ca5a3d41ec54a5a8863efd116", + "swapImpactFactorNegative": "0xbf15c04624ef8978f119e3622f8ecee78ac7dda7045062f7e52fe444da1b70f2", + "swapImpactExponentFactor": "0x4cafea763650e7b8f0c8520a3bb775cf805cc589bf41624dfa2832d90f9941e1", + "virtualMarketId": "0xcffa9b917dfc97b3f9003d4b7b97c67f28bf90b1ede4e09739a87cb2a196f95a", + "virtualLongTokenId": "0xa05108a58d25332e075fca49149dbb671f4b30a226a3325bb46f83000c50ff11", + "virtualShortTokenId": "0xc4ab6a4bf31c6daf14b4280e1dca54edfcb90a85aff3598cfb550dbec25f7786" + }, + "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c": { + "isDisabled": "0x9adf70a19045dd6236ea8afec4450be4f995f9b9e21824b1e0f982d564c377f2", + "maxLongPoolAmount": "0xa494b0ed2c322518e756e2f0c4c011a3539c7468a5e96bb17ae3aa8fd469372e", + "maxShortPoolAmount": "0xb8bc819bf494e11fe7a55d68af1da8a3fa6a42b065e37f39ee351c375815e280", + "maxLongPoolUsdForDeposit": "0xf31d10e6b0fdca7a2a1221e1aef71a01637a24b41f1071e52ba32c9e23002a23", + "maxShortPoolUsdForDeposit": "0x9cd5fc54b24566a5041bde16ee93911ebff949b113d87c40935c5b0cdfe61762", + "longPoolAmountAdjustment": "0x24ec886fdee4040e95b783b161a0641874ff0ad61bac238b26216ac3ab184a37", + "shortPoolAmountAdjustment": "0x7ee15ba70ea0db723f2dcfad06b4e03f51708c0fab8e63ceaaad04a8a5d23ba7", + "reserveFactorLong": "0xaa7f10f290bfdb4f26a9fb241fb0b5eaff79108061e9a1a241def8f62237af2f", + "reserveFactorShort": "0x2c0b0c4131bb7003b86a3a2808499e4b359243f803a447c18384f8442aeca164", + "openInterestReserveFactorLong": "0x9cda8a7ee4adf4348828dc1a822d32ff3d456605ae512275be3644e4b6ba8f5e", + "openInterestReserveFactorShort": "0xfc84b5205c5e8ef5a611889c5b5679da16495ffb8aeb03036cb4dc0c73250fdd", + "maxOpenInterestLong": "0x61ae6419291bb6853ec66aaeecbc977a50bfcc49f120a0666e0d9a4b8f992026", + "maxOpenInterestShort": "0xfc48b4a05400912b9a9c3805cfc3422cd72fae7b0a4f6241a984e6b46f447cf6", + "minPositionImpactPoolAmount": "0x713be7f821633701e59656eafd705a6956045ef1a3c571534774a5bac37d40e1", + "positionImpactPoolDistributionRate": "0x1f527fa7bae33f81103a0fee03dd250ca1761b7b6784854214bcb95fbe5402fd", + "borrowingFactorLong": "0xdeea8e242831c4eb5b13679b80abc309ca896927f5eb3d65aacbfc07480d09c5", + "borrowingFactorShort": "0xe3ad1094a1a43eab9e1feb5b508bc34c0acd5bbb64b2c7af6cf75314a1aba7da", + "borrowingExponentFactorLong": "0x42b191c584e1f7da0722b69ff00fd497596010de616c1a4b1963873baa4e9821", + "borrowingExponentFactorShort": "0xd3e85f7bd025600c969e0c6297ed0866234c4af37910d5dd90aa98c3540fd2c8", + "fundingFactor": "0x7482ea5b5159440926b266b873b386a00fb308a358c9ee00ce02e0a64200bbdf", + "fundingExponentFactor": "0xc9309c003dc7c2ea5a686c4a66b8b74bccd0f073a233255dc37eb7a588087249", + "fundingIncreaseFactorPerSecond": "0xfff1619b1f12d404d66ac296fbc07ebf1efc6e81db1ef757b06ba8a319c923c4", + "fundingDecreaseFactorPerSecond": "0x4b0f378266e9006f27d08c3bd4aeab079a7de5d0e3d548823eb523aaf6ce6457", + "thresholdForStableFunding": "0xfb25a58b6f1a1f931e8fcdf74f69ffaf0e763d174ae512037bfeef36fd3a3e44", + "thresholdForDecreaseFunding": "0xdcad7496c528d355930e72e9a1ee24a70905a742fa4baaf4fae8d035451c5773", + "minFundingFactorPerSecond": "0xe694771765746f4985641aae2b6dc2945e2a516abf649cd90032804992c8f1b9", + "maxFundingFactorPerSecond": "0x8786e0c1bac43a9b370c8bc9b4a85442c53fa187df0e0e09d6d2251cc24b8f8c", + "maxPnlFactorForTradersLong": "0xab77cc8036047e02324260261733ef57be9918e1bf199781e51941813168a7d6", + "maxPnlFactorForTradersShort": "0xff1233dae75cfb95a1e20060a3bcfcaa4e28adc91fa29a77ae424c95c5841af8", + "positionFeeFactorForBalanceWasImproved": "0x6da940b55096a35d47e458287ce3c798b91e6b1110aaf6623fa517ece76a3ad1", + "positionFeeFactorForBalanceWasNotImproved": "0xbef2aab9b9c4dcb732be4f0e64bb8e977ab9e96e6fb957cd59cc11c1c4e4269d", + "positionImpactFactorPositive": "0x49d1389250c712b139306aef87658a1efd8f7bec2652d80651ed4bfc1567fb58", + "positionImpactFactorNegative": "0xc64532c373c21ad3424f3d67c93beced2b0f95056eafcfebe79f8f0dcaf7a8ca", + "maxPositionImpactFactorPositive": "0x8ed5cf785b7bbf911434a93877ef8ff62ee004e6a316d584a14e5cf694267435", + "maxPositionImpactFactorNegative": "0x89a8e7d6a7a53617847d3c7101d1e9b637eacb8f614cef2148dcbc1753cc860e", + "maxPositionImpactFactorForLiquidations": "0x8d5706ffa347c8e3730dbb1ca3c5d280c77059ff6f2a8fe4ef0968d71d46a3dd", + "maxLendableImpactFactor": "0xf708b5ec47885aabb16b2d447bf2cd5c1402a3bdcf70b3a5e109371f1369a98c", + "maxLendableImpactFactorForWithdrawals": "0x28de0a3bba927558d52feec34658ddc40cbc5ba8dc1b93a4375d92657bd287e6", + "maxLendableImpactUsd": "0x2eca434623f8709dc1cfe29b4c8ee81075194579976131913f1b79cce84dd375", + "lentPositionImpactPoolAmount": "0x9c1c07244a02b8aaa14935b64b49922544464cc6d1f2d1656ef3c6288f167971", + "minCollateralFactor": "0xe90b7b04eb6f259d072fd69ed1f54345da2f08de8fc9a0dcc299a87c8bf98244", + "minCollateralFactorForLiquidation": "0x97c9697f9c54bee1d7aa87aafb951e9271ee448039c033ee1b07f82f6bd393c6", + "minCollateralFactorForOpenInterestLong": "0xa671eebbbbf69e5fdc8ba09cd259de013c3efedf731d39a16b2aacfcb0897650", + "minCollateralFactorForOpenInterestShort": "0x6e1e0c0d41c794387409f63a8d15cc4185ddab61cc6d53f4b5a097e054db2112", + "positionImpactExponentFactor": "0x2447adae280fd431e18cb993e9f552f9346101d4218b0996a3fd1d6509478a0a", + "swapFeeFactorForBalanceWasImproved": "0xfd5c18e7555f9acba6ea862d6e14a04932754012def735e239b47582799926f0", + "swapFeeFactorForBalanceWasNotImproved": "0x12b575bf244e9c972168fd84385a4ca7a59f21fbe87aa00290549e16edfa98ca", + "atomicSwapFeeFactor": "0x38bcb40bde3296ddd8d48f7105becfc841bb32812c3dad279cd07aebb8245b24", + "swapImpactFactorPositive": "0xf8e3ab382a889a5076ee8a8fdad1001719fadd0a46cc58a5dbf1acdb2015cdb4", + "swapImpactFactorNegative": "0x3926196acc50053643fa4c3c067d2927c88d7baeeb09455c2398c1d3f51cb680", + "swapImpactExponentFactor": "0xf3207408fe2e68e65822649ad5a0519eea88f25d7536f2bf260bbe23833764b3", + "virtualMarketId": "0x1508cc8b108cc92247ff1a8f212cdac883536956cf50ab8b3eaf42ae5d37b7ec", + "virtualLongTokenId": "0xbeb8096910fd4d4b3ade12aad31c27a0e5f047fce87d1279b0c71579a8c4ef5b", + "virtualShortTokenId": "0xc4ab6a4bf31c6daf14b4280e1dca54edfcb90a85aff3598cfb550dbec25f7786" + } } -} +} \ No newline at end of file diff --git a/sdk/src/prebuilt/hashedMarketValuesKeys.json b/sdk/src/prebuilt/hashedMarketValuesKeys.json index 9289a3f9a4..3652490238 100644 --- a/sdk/src/prebuilt/hashedMarketValuesKeys.json +++ b/sdk/src/prebuilt/hashedMarketValuesKeys.json @@ -2106,5 +2106,82 @@ "shortInterestInTokensUsingLongToken": "0xe4a0a086a57e5ebf93c02996173518a25df8280b48bfaab22ddad851d5d5f279", "shortInterestInTokensUsingShortToken": "0x459afc07ae83faa216fe9bcbbb75a032a0557d866842476547540f230077ab76" } + }, + "421614": { + "0x482Df3D320C964808579b585a8AC7Dd5D144eFaF": { + "longPoolAmount": "0x1ec0396d749853b2fbba67bf4a9b63ee6c10acc4d2f436febe09f1d1f22b0c5e", + "shortPoolAmount": "0x966ce6d85e013c191a28ae5d018091e0977856d1e46c38f400d171c0f167c61b", + "positionImpactPoolAmount": "0x59846886db6aea850e805c57f34fb2e011dc0ef1e7adb646d2658abc07f0bf63", + "swapImpactPoolAmountLong": "0x57ab3e5d4bf6949f6a528441273a53ab9cd656f343e5d061998cc53065caaabd", + "swapImpactPoolAmountShort": "0x6a381d4f3adda0215422faf57cdfc1b16d416a29aa2ff331b4bffc91cd2d0eed", + "longInterestUsingLongToken": "0xacda5af0a8de33f1e16ed19c34f899475e2fedff3c74d823744e5dd827e438f5", + "longInterestUsingShortToken": "0x4cfb492a8112307cbada8ea447a0ce6a4c11ff2bfade59018ce0ce5c15db6a9b", + "shortInterestUsingLongToken": "0x21bbed12abc8ea55003797eea6889821b5edaab8a7797e6bc32a3bf049fe1735", + "shortInterestUsingShortToken": "0x817a1463ac1219c0e9b4a0d860e8930a6d46db91ce0d8fabb16500f5f84abb3e", + "longInterestInTokensUsingLongToken": "0x100d64c96e9cac0c854f64f9e0df2ef84e0f9345953235c46550f90c0c6b5687", + "longInterestInTokensUsingShortToken": "0x189399d250ad271f1a21e2c2f65a9f35cf1ab0f1c43ed0801362c29b65db6e10", + "shortInterestInTokensUsingLongToken": "0x9c1e5c3cd21ef1109f76ec647ab04d40fb29f66b5d5f297fcfa8e83c8905ba15", + "shortInterestInTokensUsingShortToken": "0xac1c8c21f4f015b06b1f3a276029a141d3c18d6023c2eea7e202f0551ef6b014" + }, + "0xBb532Ab4923C23c2bfA455151B14fec177a34C0D": { + "longPoolAmount": "0xf8f5984b5f6823422477171a767c309ef3e66bb03fd9250c2338c923b3f826cd", + "shortPoolAmount": "0x17fe969fc101cde65c93cdea179927ea235c4dd02cf6fc4393c2f87c804bf155", + "positionImpactPoolAmount": "0x9126d9e193e88aa45b54fbc6cd8065097741e70da912e43ddff7b31a3e1b604a", + "swapImpactPoolAmountLong": "0x9d47d3c9bfe2bdc467ff67de884bfad5d4de00e1ca466c99be1a1092a7af2141", + "swapImpactPoolAmountShort": "0x5c43473b1082f43b6f9aa5249b7eaab0c4ff65a516bc4fb261b32ff93bd8174f", + "longInterestUsingLongToken": "0x169e6b04a9e8678b2b9f7946ece753dade93057f3e9843349f0fe5a7005da237", + "longInterestUsingShortToken": "0x3e70f2ab88230fd47e9404a701ef9424e4f20b387eeb9de44c0bb86eaf94a2b2", + "shortInterestUsingLongToken": "0x2916e4265d709d2ef21afe08b5ab9f1561d7f26987208b0a8cbfacdc5dadd8bc", + "shortInterestUsingShortToken": "0x91a2fce531bf3417c5b52a2a5339e04ee0e1ded24d2d861577c21c988645e0cd", + "longInterestInTokensUsingLongToken": "0x66ba10da6bc8084a3a5cc0852a07b2672ff1c5b5c95e63de444f085af32532a2", + "longInterestInTokensUsingShortToken": "0xc1180ae0f4a1033944ec547d3b0ef99e10049c319db9d3a46258dfd6badb8ea4", + "shortInterestInTokensUsingLongToken": "0xe17033f35824563158cc320f75d6c5555cc82b4e2042604c4cdb4830ef3c9881", + "shortInterestInTokensUsingShortToken": "0x58e77d188c1a5575aade08d268601c46aec9fa6947a7f5c834bc2c00d02510b2" + }, + "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc": { + "longPoolAmount": "0x5181afcd124d09ecf3cc0183366419590e613f89f0baeb6f2a254b864d1ded10", + "shortPoolAmount": "0x343aa8429e73bd4ea04046b08e044979ef44e502b642f8d1ac4205d3a16cdba1", + "positionImpactPoolAmount": "0xa4a2162d0d1924d188b6da3e89cc4666698d0673a3ce0d117ac4060d971bd40a", + "swapImpactPoolAmountLong": "0x07f51927e52071245c00905daeb9a3f626b50f5d7a776c594476ce5cf2fe8194", + "swapImpactPoolAmountShort": "0xd3c393266534b2c089d9a134566dc3808e40936c9b429f6be41f3828397d9cd3", + "longInterestUsingLongToken": "0xc85cc31027778d0ea13196668b57ceb45c1ea78917381d411d06fe8a62ab8073", + "longInterestUsingShortToken": "0x8b5a79f28c17506e7caf37ae1e02516067eb1f42a1562a2bc9f3799fd7b159c8", + "shortInterestUsingLongToken": "0xe2a3d5cb489f8168c7fb25429bd5bc3864cff0081f5bed90f87a0928a4d6a2ae", + "shortInterestUsingShortToken": "0xc15572223fa93a63c1306166390d39186b2e13b66203bb8da04f48c05239083e", + "longInterestInTokensUsingLongToken": "0x7c8cce0e9bfec8d13e6feff6341af5931b3732a9a55a7f25473a88ca4bbbfacf", + "longInterestInTokensUsingShortToken": "0x0b1320cb3d7324a5c2e8e18bb798f8ccfa1acc8e56604c57c1bf4155c73f7079", + "shortInterestInTokensUsingLongToken": "0x6be2375335308fffff2d8e9ff62b96acde6d1cffb4ddb1813ebff64cda059f7d", + "shortInterestInTokensUsingShortToken": "0x6189501bde268b7f87ea49dc02723f702c95061a6e339774b74bef3341ade66e" + }, + "0x3A83246bDDD60c4e71c91c10D9A66Fd64399bBCf": { + "longPoolAmount": "0xa2075faf68c9726bb08bb027b98fcecd4f0f380983553b6aed4a7bf993d02ea2", + "shortPoolAmount": "0x414c60762f70eea230bcd80009a752335b653c02037cd66deb7c36dbf3498b81", + "positionImpactPoolAmount": "0xe084c2f70684f43aa96742d584cfb131021f8128e5828c29b7b3845423ccbdad", + "swapImpactPoolAmountLong": "0x7fb1713aaf6cb5808aff7a90a6af51774c89f8b65f52236d5c9fa0b1d53c66ca", + "swapImpactPoolAmountShort": "0x14b77dc07e765ab968065f1a550ad0a5aeec121d1fc90812ae88079db53883b5", + "longInterestUsingLongToken": "0x5b3ff89f6dc478e77a3ebecd74a52b7f110bf3f31913ffb4b738e010405ff256", + "longInterestUsingShortToken": "0xddad805de02d7bbc3f074197f1c0f8a28ac3452b129d3ccfb977044433ca1407", + "shortInterestUsingLongToken": "0x79c7f949bed9c76895450148d13cbd2943e77e7eaa5319a13813eae044a06c17", + "shortInterestUsingShortToken": "0x2755569cb50b991dde964096fa69cba032d8b7585f3a08b96682f1802b1b290d", + "longInterestInTokensUsingLongToken": "0x8e57e5f724ac170095bdbd8ba1578908e9889266226882bcef5829bc6d2b6c6c", + "longInterestInTokensUsingShortToken": "0x71bb78048905f09a82839779926db8aff078392c82b239b5b1551d323e7a50bf", + "shortInterestInTokensUsingLongToken": "0x2dad3d52c3bfd9b175fd4422536a36576d5a7b719800cf33f82c2891345fc168", + "shortInterestInTokensUsingShortToken": "0x2102a3bee36639520696b3d223cd869c7b21925f61e77331cf32335c4dae4362" + }, + "0xAde9D177B9E060D2064ee9F798125e6539fDaA1c": { + "longPoolAmount": "0x50d0f68f6a4fecbc901e4a8082d9317f682e4b2f5a87c11e368abf51c37ae5a6", + "shortPoolAmount": "0xfacfa0c2d3c3056986b1c7ef2727d911129f7d4169bf668f9570e8998bd2ad08", + "positionImpactPoolAmount": "0xa28e40173205226b450ee3f66e740ac1e123b81eed4198899746b45993480b0b", + "swapImpactPoolAmountLong": "0xe80d5b6847cd87925fc341da9e3982e056ef5308ee6735242877c46b36630f33", + "swapImpactPoolAmountShort": "0xe0f8ac8f75912883b35bd29b9ccdc044d9b58db259776e40024578264ba5e245", + "longInterestUsingLongToken": "0xaead92698f3316bb52e70fd394f1944f87bf576e5ffb2b4a4a1d0c7fdcf8f8b6", + "longInterestUsingShortToken": "0x99a8e43d4a6c016b51f0562ca4ff9e5b1fe08e7027c4dd4683ced9ae2f0a4470", + "shortInterestUsingLongToken": "0xc81070e2b6a9277ea42887805edb202fdbd227668ea67024d66f69439358c671", + "shortInterestUsingShortToken": "0xa0980940eb86bfbe3a5a9a1c03c397b15064c09dba8e4cff7d6add6671f9ce51", + "longInterestInTokensUsingLongToken": "0x4087fbc85522f334dc81f3fb0c97490d2bf309131eb503ea550960057037dc3a", + "longInterestInTokensUsingShortToken": "0xf61da26292dbce9b746fcc8438f02fab8e8a28a0d610791c191d64038ece27fc", + "shortInterestInTokensUsingLongToken": "0x4e9ca5ca185f24d2f633d7bc31c3203b976717299efa1596032b0ffab3e8ff32", + "shortInterestInTokensUsingShortToken": "0xfa0bb36ec3ca4732de1401392424dff4ce738063ac80315a014d3fffc4f7bd60" + } } -} +} \ No newline at end of file diff --git a/sdk/src/test/mock.ts b/sdk/src/test/mock.ts index 172f43b482..37ec08ac22 100644 --- a/sdk/src/test/mock.ts +++ b/sdk/src/test/mock.ts @@ -216,17 +216,21 @@ export function mockMarketsInfoData( swapImpactPoolAmountLong: usdToToken(1000, longToken), swapImpactPoolAmountShort: usdToToken(1000, shortToken), - positionFeeFactorForPositiveImpact: expandDecimals(5, 26), - positionFeeFactorForNegativeImpact: expandDecimals(5, 26), + positionFeeFactorForBalanceWasImproved: expandDecimals(5, 26), + positionFeeFactorForBalanceWasNotImproved: expandDecimals(5, 26), positionImpactFactorPositive: expandDecimals(2, 23), positionImpactFactorNegative: expandDecimals(1, 23), maxPositionImpactFactorPositive: expandDecimals(2, 23), maxPositionImpactFactorNegative: expandDecimals(1, 23), maxPositionImpactFactorForLiquidations: expandDecimals(1, 23), + maxLendableImpactFactor: expandDecimals(1, 23), + maxLendableImpactFactorForWithdrawals: expandDecimals(1, 23), + maxLendableImpactUsd: expandDecimals(1, 23), + lentPositionImpactPoolAmount: expandDecimals(1, 23), positionImpactExponentFactor: expandDecimals(2, 30), - swapFeeFactorForPositiveImpact: expandDecimals(2, 27), - swapFeeFactorForNegativeImpact: expandDecimals(2, 27), + swapFeeFactorForBalanceWasImproved: expandDecimals(2, 27), + swapFeeFactorForBalanceWasNotImproved: expandDecimals(2, 27), atomicSwapFeeFactor: expandDecimals(2, 27), @@ -251,6 +255,7 @@ export function mockMarketsInfoData( totalBorrowingFees: 0n, minCollateralFactor: 0n, + minCollateralFactorForLiquidation: 0n, minCollateralFactorForOpenInterestLong: 0n, minCollateralFactorForOpenInterestShort: 0n, diff --git a/sdk/src/types/fees.ts b/sdk/src/types/fees.ts index 265e8e571a..e68b2789e5 100644 --- a/sdk/src/types/fees.ts +++ b/sdk/src/types/fees.ts @@ -48,6 +48,7 @@ export type GasLimitsConfig = { updateOrderGasLimit: bigint; cancelOrderGasLimit: bigint; tokenPermitGasLimit: bigint; + gmxAccountCollateralGasLimit: bigint; }; export type L1ExpressOrderGasReference = { diff --git a/sdk/src/types/markets.ts b/sdk/src/types/markets.ts index e956fcd2be..6e9acd87b6 100644 --- a/sdk/src/types/markets.ts +++ b/sdk/src/types/markets.ts @@ -1,4 +1,4 @@ -import { TokenData } from "./tokens"; +import type { TokenData } from "./tokens"; export type PnlFactorType = "FOR_DEPOSITS" | "FOR_WITHDRAWALS" | "FOR_TRADERS"; @@ -75,6 +75,7 @@ export type MarketInfo = Market & positionImpactPoolDistributionRate: bigint; minCollateralFactor: bigint; + minCollateralFactorForLiquidation: bigint; minCollateralFactorForOpenInterestLong: bigint; minCollateralFactorForOpenInterestShort: bigint; @@ -92,17 +93,21 @@ export type MarketInfo = Market & longInterestInTokens: bigint; shortInterestInTokens: bigint; - positionFeeFactorForPositiveImpact: bigint; - positionFeeFactorForNegativeImpact: bigint; + positionFeeFactorForBalanceWasImproved: bigint; + positionFeeFactorForBalanceWasNotImproved: bigint; positionImpactFactorPositive: bigint; positionImpactFactorNegative: bigint; maxPositionImpactFactorPositive: bigint; maxPositionImpactFactorNegative: bigint; maxPositionImpactFactorForLiquidations: bigint; + maxLendableImpactFactor: bigint; + maxLendableImpactFactorForWithdrawals: bigint; + maxLendableImpactUsd: bigint; + lentPositionImpactPoolAmount: bigint; positionImpactExponentFactor: bigint; - swapFeeFactorForPositiveImpact: bigint; - swapFeeFactorForNegativeImpact: bigint; + swapFeeFactorForBalanceWasImproved: bigint; + swapFeeFactorForBalanceWasNotImproved: bigint; atomicSwapFeeFactor: bigint; swapImpactFactorPositive: bigint; swapImpactFactorNegative: bigint; diff --git a/sdk/src/types/orders.ts b/sdk/src/types/orders.ts index 2b6259b3ec..b0b77df59b 100644 --- a/sdk/src/types/orders.ts +++ b/sdk/src/types/orders.ts @@ -63,7 +63,7 @@ export type Order = { orderType: OrderType; shouldUnwrapNativeToken: boolean; autoCancel: boolean; - data: string; + data: string[]; uiFeeReceiver: string; validFromTime: bigint; title?: string; diff --git a/sdk/src/types/positions.ts b/sdk/src/types/positions.ts index 80e2b294be..5df8a9b0f0 100644 --- a/sdk/src/types/positions.ts +++ b/sdk/src/types/positions.ts @@ -1,5 +1,5 @@ -import { Market, MarketInfo } from "./markets"; -import { TokenData } from "./tokens"; +import type { Market, MarketInfo } from "./markets"; +import type { TokenData } from "./tokens"; export type Position = { key: string; @@ -22,6 +22,23 @@ export type Position = { positionFeeAmount: bigint; traderDiscountAmount: bigint; uiFeeAmount: bigint; + pendingImpactAmount: bigint; + /** + * Not implemented in parsing + */ + borrowingFactor?: bigint; + /** + * Not implemented in parsing + */ + fundingFeeAmountPerSize?: bigint; + /** + * Not implemented in parsing + */ + longTokenClaimableFundingAmountPerSize?: bigint; + /** + * Not implemented in parsing + */ + shortTokenClaimableFundingAmountPerSize?: bigint; data: string; }; @@ -46,6 +63,8 @@ export type PositionInfo = Position & { pnlPercentage: bigint; pnlAfterFees: bigint; pnlAfterFeesPercentage: bigint; + netPriceImapctDeltaUsd: bigint; + priceImpactDiffUsd: bigint; leverage: bigint | undefined; leverageWithPnl: bigint | undefined; netValue: bigint; @@ -55,6 +74,8 @@ export type PositionInfo = Position & { pendingClaimableFundingFeesUsd: bigint; }; +export type PositionInfoLoaded = PositionInfo & { marketInfo: MarketInfo }; + export type PositionsData = { [positionKey: string]: Position; }; diff --git a/sdk/src/types/sdk.ts b/sdk/src/types/sdk.ts index df1e433693..7b77f88948 100644 --- a/sdk/src/types/sdk.ts +++ b/sdk/src/types/sdk.ts @@ -1,13 +1,13 @@ import type { PublicClient, WalletClient } from "viem"; -import { UiContractsChain } from "configs/chains"; +import type { ContractsChainId } from "configs/chains"; import type { MarketSdkConfig } from "./markets"; import type { Token } from "./tokens"; export interface GmxSdkConfig { /** Chain ID */ - chainId: UiContractsChain; + chainId: ContractsChainId; /** Account's address */ account?: string; /** GMX Oracle URL */ diff --git a/sdk/src/types/subsquid.ts b/sdk/src/types/subsquid.ts index a29132332e..5f51563f70 100644 --- a/sdk/src/types/subsquid.ts +++ b/sdk/src/types/subsquid.ts @@ -325,6 +325,13 @@ export interface AccountStatsConnection { totalCount: Scalars["Int"]["output"]; } +export interface AnnualizedPerformanceObject { + __typename?: "AnnualizedPerformanceObject"; + address: Scalars["String"]["output"]; + entity: Scalars["String"]["output"]; + performance: Scalars["BigInt"]["output"]; +} + export interface AnnualizedPerformanceObject { __typename?: "AnnualizedPerformanceObject"; address: Scalars["String"]["output"]; @@ -844,6 +851,406 @@ export interface ClaimRefsConnection { totalCount: Scalars["Int"]["output"]; } +export interface ClaimableCollateral { + __typename?: "ClaimableCollateral"; + account: Scalars["String"]["output"]; + claimed: Scalars["Boolean"]["output"]; + factor: Scalars["BigInt"]["output"]; + factorByTime: Scalars["BigInt"]["output"]; + group: ClaimableCollateralGroup; + id: Scalars["String"]["output"]; + marketAddress: Scalars["String"]["output"]; + reductionFactor: Scalars["BigInt"]["output"]; + timeKey: Scalars["String"]["output"]; + tokenAddress: Scalars["String"]["output"]; + value: Scalars["BigInt"]["output"]; +} + +export interface ClaimableCollateralEdge { + __typename?: "ClaimableCollateralEdge"; + cursor: Scalars["String"]["output"]; + node: ClaimableCollateral; +} + +export interface ClaimableCollateralGroup { + __typename?: "ClaimableCollateralGroup"; + claimables: Array; + factor: Scalars["BigInt"]["output"]; + id: Scalars["String"]["output"]; + marketAddress: Scalars["String"]["output"]; + timeKey: Scalars["String"]["output"]; + tokenAddress: Scalars["String"]["output"]; +} + +export interface ClaimableCollateralGroupclaimablesArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface ClaimableCollateralGroupEdge { + __typename?: "ClaimableCollateralGroupEdge"; + cursor: Scalars["String"]["output"]; + node: ClaimableCollateralGroup; +} + +export enum ClaimableCollateralGroupOrderByInput { + factor_ASC = "factor_ASC", + factor_ASC_NULLS_FIRST = "factor_ASC_NULLS_FIRST", + factor_ASC_NULLS_LAST = "factor_ASC_NULLS_LAST", + factor_DESC = "factor_DESC", + factor_DESC_NULLS_FIRST = "factor_DESC_NULLS_FIRST", + factor_DESC_NULLS_LAST = "factor_DESC_NULLS_LAST", + id_ASC = "id_ASC", + id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST", + id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST", + id_DESC = "id_DESC", + id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST", + id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST", + marketAddress_ASC = "marketAddress_ASC", + marketAddress_ASC_NULLS_FIRST = "marketAddress_ASC_NULLS_FIRST", + marketAddress_ASC_NULLS_LAST = "marketAddress_ASC_NULLS_LAST", + marketAddress_DESC = "marketAddress_DESC", + marketAddress_DESC_NULLS_FIRST = "marketAddress_DESC_NULLS_FIRST", + marketAddress_DESC_NULLS_LAST = "marketAddress_DESC_NULLS_LAST", + timeKey_ASC = "timeKey_ASC", + timeKey_ASC_NULLS_FIRST = "timeKey_ASC_NULLS_FIRST", + timeKey_ASC_NULLS_LAST = "timeKey_ASC_NULLS_LAST", + timeKey_DESC = "timeKey_DESC", + timeKey_DESC_NULLS_FIRST = "timeKey_DESC_NULLS_FIRST", + timeKey_DESC_NULLS_LAST = "timeKey_DESC_NULLS_LAST", + tokenAddress_ASC = "tokenAddress_ASC", + tokenAddress_ASC_NULLS_FIRST = "tokenAddress_ASC_NULLS_FIRST", + tokenAddress_ASC_NULLS_LAST = "tokenAddress_ASC_NULLS_LAST", + tokenAddress_DESC = "tokenAddress_DESC", + tokenAddress_DESC_NULLS_FIRST = "tokenAddress_DESC_NULLS_FIRST", + tokenAddress_DESC_NULLS_LAST = "tokenAddress_DESC_NULLS_LAST", +} + +export interface ClaimableCollateralGroupWhereInput { + AND?: InputMaybe>; + OR?: InputMaybe>; + claimables_every?: InputMaybe; + claimables_none?: InputMaybe; + claimables_some?: InputMaybe; + factor_eq?: InputMaybe; + factor_gt?: InputMaybe; + factor_gte?: InputMaybe; + factor_in?: InputMaybe>; + factor_isNull?: InputMaybe; + factor_lt?: InputMaybe; + factor_lte?: InputMaybe; + factor_not_eq?: InputMaybe; + factor_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + marketAddress_contains?: InputMaybe; + marketAddress_containsInsensitive?: InputMaybe; + marketAddress_endsWith?: InputMaybe; + marketAddress_eq?: InputMaybe; + marketAddress_gt?: InputMaybe; + marketAddress_gte?: InputMaybe; + marketAddress_in?: InputMaybe>; + marketAddress_isNull?: InputMaybe; + marketAddress_lt?: InputMaybe; + marketAddress_lte?: InputMaybe; + marketAddress_not_contains?: InputMaybe; + marketAddress_not_containsInsensitive?: InputMaybe; + marketAddress_not_endsWith?: InputMaybe; + marketAddress_not_eq?: InputMaybe; + marketAddress_not_in?: InputMaybe>; + marketAddress_not_startsWith?: InputMaybe; + marketAddress_startsWith?: InputMaybe; + timeKey_contains?: InputMaybe; + timeKey_containsInsensitive?: InputMaybe; + timeKey_endsWith?: InputMaybe; + timeKey_eq?: InputMaybe; + timeKey_gt?: InputMaybe; + timeKey_gte?: InputMaybe; + timeKey_in?: InputMaybe>; + timeKey_isNull?: InputMaybe; + timeKey_lt?: InputMaybe; + timeKey_lte?: InputMaybe; + timeKey_not_contains?: InputMaybe; + timeKey_not_containsInsensitive?: InputMaybe; + timeKey_not_endsWith?: InputMaybe; + timeKey_not_eq?: InputMaybe; + timeKey_not_in?: InputMaybe>; + timeKey_not_startsWith?: InputMaybe; + timeKey_startsWith?: InputMaybe; + tokenAddress_contains?: InputMaybe; + tokenAddress_containsInsensitive?: InputMaybe; + tokenAddress_endsWith?: InputMaybe; + tokenAddress_eq?: InputMaybe; + tokenAddress_gt?: InputMaybe; + tokenAddress_gte?: InputMaybe; + tokenAddress_in?: InputMaybe>; + tokenAddress_isNull?: InputMaybe; + tokenAddress_lt?: InputMaybe; + tokenAddress_lte?: InputMaybe; + tokenAddress_not_contains?: InputMaybe; + tokenAddress_not_containsInsensitive?: InputMaybe; + tokenAddress_not_endsWith?: InputMaybe; + tokenAddress_not_eq?: InputMaybe; + tokenAddress_not_in?: InputMaybe>; + tokenAddress_not_startsWith?: InputMaybe; + tokenAddress_startsWith?: InputMaybe; +} + +export interface ClaimableCollateralGroupsConnection { + __typename?: "ClaimableCollateralGroupsConnection"; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars["Int"]["output"]; +} + +export enum ClaimableCollateralOrderByInput { + account_ASC = "account_ASC", + account_ASC_NULLS_FIRST = "account_ASC_NULLS_FIRST", + account_ASC_NULLS_LAST = "account_ASC_NULLS_LAST", + account_DESC = "account_DESC", + account_DESC_NULLS_FIRST = "account_DESC_NULLS_FIRST", + account_DESC_NULLS_LAST = "account_DESC_NULLS_LAST", + claimed_ASC = "claimed_ASC", + claimed_ASC_NULLS_FIRST = "claimed_ASC_NULLS_FIRST", + claimed_ASC_NULLS_LAST = "claimed_ASC_NULLS_LAST", + claimed_DESC = "claimed_DESC", + claimed_DESC_NULLS_FIRST = "claimed_DESC_NULLS_FIRST", + claimed_DESC_NULLS_LAST = "claimed_DESC_NULLS_LAST", + factorByTime_ASC = "factorByTime_ASC", + factorByTime_ASC_NULLS_FIRST = "factorByTime_ASC_NULLS_FIRST", + factorByTime_ASC_NULLS_LAST = "factorByTime_ASC_NULLS_LAST", + factorByTime_DESC = "factorByTime_DESC", + factorByTime_DESC_NULLS_FIRST = "factorByTime_DESC_NULLS_FIRST", + factorByTime_DESC_NULLS_LAST = "factorByTime_DESC_NULLS_LAST", + factor_ASC = "factor_ASC", + factor_ASC_NULLS_FIRST = "factor_ASC_NULLS_FIRST", + factor_ASC_NULLS_LAST = "factor_ASC_NULLS_LAST", + factor_DESC = "factor_DESC", + factor_DESC_NULLS_FIRST = "factor_DESC_NULLS_FIRST", + factor_DESC_NULLS_LAST = "factor_DESC_NULLS_LAST", + group_factor_ASC = "group_factor_ASC", + group_factor_ASC_NULLS_FIRST = "group_factor_ASC_NULLS_FIRST", + group_factor_ASC_NULLS_LAST = "group_factor_ASC_NULLS_LAST", + group_factor_DESC = "group_factor_DESC", + group_factor_DESC_NULLS_FIRST = "group_factor_DESC_NULLS_FIRST", + group_factor_DESC_NULLS_LAST = "group_factor_DESC_NULLS_LAST", + group_id_ASC = "group_id_ASC", + group_id_ASC_NULLS_FIRST = "group_id_ASC_NULLS_FIRST", + group_id_ASC_NULLS_LAST = "group_id_ASC_NULLS_LAST", + group_id_DESC = "group_id_DESC", + group_id_DESC_NULLS_FIRST = "group_id_DESC_NULLS_FIRST", + group_id_DESC_NULLS_LAST = "group_id_DESC_NULLS_LAST", + group_marketAddress_ASC = "group_marketAddress_ASC", + group_marketAddress_ASC_NULLS_FIRST = "group_marketAddress_ASC_NULLS_FIRST", + group_marketAddress_ASC_NULLS_LAST = "group_marketAddress_ASC_NULLS_LAST", + group_marketAddress_DESC = "group_marketAddress_DESC", + group_marketAddress_DESC_NULLS_FIRST = "group_marketAddress_DESC_NULLS_FIRST", + group_marketAddress_DESC_NULLS_LAST = "group_marketAddress_DESC_NULLS_LAST", + group_timeKey_ASC = "group_timeKey_ASC", + group_timeKey_ASC_NULLS_FIRST = "group_timeKey_ASC_NULLS_FIRST", + group_timeKey_ASC_NULLS_LAST = "group_timeKey_ASC_NULLS_LAST", + group_timeKey_DESC = "group_timeKey_DESC", + group_timeKey_DESC_NULLS_FIRST = "group_timeKey_DESC_NULLS_FIRST", + group_timeKey_DESC_NULLS_LAST = "group_timeKey_DESC_NULLS_LAST", + group_tokenAddress_ASC = "group_tokenAddress_ASC", + group_tokenAddress_ASC_NULLS_FIRST = "group_tokenAddress_ASC_NULLS_FIRST", + group_tokenAddress_ASC_NULLS_LAST = "group_tokenAddress_ASC_NULLS_LAST", + group_tokenAddress_DESC = "group_tokenAddress_DESC", + group_tokenAddress_DESC_NULLS_FIRST = "group_tokenAddress_DESC_NULLS_FIRST", + group_tokenAddress_DESC_NULLS_LAST = "group_tokenAddress_DESC_NULLS_LAST", + id_ASC = "id_ASC", + id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST", + id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST", + id_DESC = "id_DESC", + id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST", + id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST", + marketAddress_ASC = "marketAddress_ASC", + marketAddress_ASC_NULLS_FIRST = "marketAddress_ASC_NULLS_FIRST", + marketAddress_ASC_NULLS_LAST = "marketAddress_ASC_NULLS_LAST", + marketAddress_DESC = "marketAddress_DESC", + marketAddress_DESC_NULLS_FIRST = "marketAddress_DESC_NULLS_FIRST", + marketAddress_DESC_NULLS_LAST = "marketAddress_DESC_NULLS_LAST", + reductionFactor_ASC = "reductionFactor_ASC", + reductionFactor_ASC_NULLS_FIRST = "reductionFactor_ASC_NULLS_FIRST", + reductionFactor_ASC_NULLS_LAST = "reductionFactor_ASC_NULLS_LAST", + reductionFactor_DESC = "reductionFactor_DESC", + reductionFactor_DESC_NULLS_FIRST = "reductionFactor_DESC_NULLS_FIRST", + reductionFactor_DESC_NULLS_LAST = "reductionFactor_DESC_NULLS_LAST", + timeKey_ASC = "timeKey_ASC", + timeKey_ASC_NULLS_FIRST = "timeKey_ASC_NULLS_FIRST", + timeKey_ASC_NULLS_LAST = "timeKey_ASC_NULLS_LAST", + timeKey_DESC = "timeKey_DESC", + timeKey_DESC_NULLS_FIRST = "timeKey_DESC_NULLS_FIRST", + timeKey_DESC_NULLS_LAST = "timeKey_DESC_NULLS_LAST", + tokenAddress_ASC = "tokenAddress_ASC", + tokenAddress_ASC_NULLS_FIRST = "tokenAddress_ASC_NULLS_FIRST", + tokenAddress_ASC_NULLS_LAST = "tokenAddress_ASC_NULLS_LAST", + tokenAddress_DESC = "tokenAddress_DESC", + tokenAddress_DESC_NULLS_FIRST = "tokenAddress_DESC_NULLS_FIRST", + tokenAddress_DESC_NULLS_LAST = "tokenAddress_DESC_NULLS_LAST", + value_ASC = "value_ASC", + value_ASC_NULLS_FIRST = "value_ASC_NULLS_FIRST", + value_ASC_NULLS_LAST = "value_ASC_NULLS_LAST", + value_DESC = "value_DESC", + value_DESC_NULLS_FIRST = "value_DESC_NULLS_FIRST", + value_DESC_NULLS_LAST = "value_DESC_NULLS_LAST", +} + +export interface ClaimableCollateralWhereInput { + AND?: InputMaybe>; + OR?: InputMaybe>; + account_contains?: InputMaybe; + account_containsInsensitive?: InputMaybe; + account_endsWith?: InputMaybe; + account_eq?: InputMaybe; + account_gt?: InputMaybe; + account_gte?: InputMaybe; + account_in?: InputMaybe>; + account_isNull?: InputMaybe; + account_lt?: InputMaybe; + account_lte?: InputMaybe; + account_not_contains?: InputMaybe; + account_not_containsInsensitive?: InputMaybe; + account_not_endsWith?: InputMaybe; + account_not_eq?: InputMaybe; + account_not_in?: InputMaybe>; + account_not_startsWith?: InputMaybe; + account_startsWith?: InputMaybe; + claimed_eq?: InputMaybe; + claimed_isNull?: InputMaybe; + claimed_not_eq?: InputMaybe; + factorByTime_eq?: InputMaybe; + factorByTime_gt?: InputMaybe; + factorByTime_gte?: InputMaybe; + factorByTime_in?: InputMaybe>; + factorByTime_isNull?: InputMaybe; + factorByTime_lt?: InputMaybe; + factorByTime_lte?: InputMaybe; + factorByTime_not_eq?: InputMaybe; + factorByTime_not_in?: InputMaybe>; + factor_eq?: InputMaybe; + factor_gt?: InputMaybe; + factor_gte?: InputMaybe; + factor_in?: InputMaybe>; + factor_isNull?: InputMaybe; + factor_lt?: InputMaybe; + factor_lte?: InputMaybe; + factor_not_eq?: InputMaybe; + factor_not_in?: InputMaybe>; + group?: InputMaybe; + group_isNull?: InputMaybe; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + marketAddress_contains?: InputMaybe; + marketAddress_containsInsensitive?: InputMaybe; + marketAddress_endsWith?: InputMaybe; + marketAddress_eq?: InputMaybe; + marketAddress_gt?: InputMaybe; + marketAddress_gte?: InputMaybe; + marketAddress_in?: InputMaybe>; + marketAddress_isNull?: InputMaybe; + marketAddress_lt?: InputMaybe; + marketAddress_lte?: InputMaybe; + marketAddress_not_contains?: InputMaybe; + marketAddress_not_containsInsensitive?: InputMaybe; + marketAddress_not_endsWith?: InputMaybe; + marketAddress_not_eq?: InputMaybe; + marketAddress_not_in?: InputMaybe>; + marketAddress_not_startsWith?: InputMaybe; + marketAddress_startsWith?: InputMaybe; + reductionFactor_eq?: InputMaybe; + reductionFactor_gt?: InputMaybe; + reductionFactor_gte?: InputMaybe; + reductionFactor_in?: InputMaybe>; + reductionFactor_isNull?: InputMaybe; + reductionFactor_lt?: InputMaybe; + reductionFactor_lte?: InputMaybe; + reductionFactor_not_eq?: InputMaybe; + reductionFactor_not_in?: InputMaybe>; + timeKey_contains?: InputMaybe; + timeKey_containsInsensitive?: InputMaybe; + timeKey_endsWith?: InputMaybe; + timeKey_eq?: InputMaybe; + timeKey_gt?: InputMaybe; + timeKey_gte?: InputMaybe; + timeKey_in?: InputMaybe>; + timeKey_isNull?: InputMaybe; + timeKey_lt?: InputMaybe; + timeKey_lte?: InputMaybe; + timeKey_not_contains?: InputMaybe; + timeKey_not_containsInsensitive?: InputMaybe; + timeKey_not_endsWith?: InputMaybe; + timeKey_not_eq?: InputMaybe; + timeKey_not_in?: InputMaybe>; + timeKey_not_startsWith?: InputMaybe; + timeKey_startsWith?: InputMaybe; + tokenAddress_contains?: InputMaybe; + tokenAddress_containsInsensitive?: InputMaybe; + tokenAddress_endsWith?: InputMaybe; + tokenAddress_eq?: InputMaybe; + tokenAddress_gt?: InputMaybe; + tokenAddress_gte?: InputMaybe; + tokenAddress_in?: InputMaybe>; + tokenAddress_isNull?: InputMaybe; + tokenAddress_lt?: InputMaybe; + tokenAddress_lte?: InputMaybe; + tokenAddress_not_contains?: InputMaybe; + tokenAddress_not_containsInsensitive?: InputMaybe; + tokenAddress_not_endsWith?: InputMaybe; + tokenAddress_not_eq?: InputMaybe; + tokenAddress_not_in?: InputMaybe>; + tokenAddress_not_startsWith?: InputMaybe; + tokenAddress_startsWith?: InputMaybe; + value_eq?: InputMaybe; + value_gt?: InputMaybe; + value_gte?: InputMaybe; + value_in?: InputMaybe>; + value_isNull?: InputMaybe; + value_lt?: InputMaybe; + value_lte?: InputMaybe; + value_not_eq?: InputMaybe; + value_not_in?: InputMaybe>; +} + +export interface ClaimableCollateralsConnection { + __typename?: "ClaimableCollateralsConnection"; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars["Int"]["output"]; +} + export interface ClaimableFundingFeeInfo { __typename?: "ClaimableFundingFeeInfo"; amounts: Array; @@ -1905,6 +2312,7 @@ export interface MarketInfo { __typename?: "MarketInfo"; aboveOptimalUsageBorrowingFactorLong: Scalars["BigInt"]["output"]; aboveOptimalUsageBorrowingFactorShort: Scalars["BigInt"]["output"]; + atomicSwapFeeFactor: Scalars["BigInt"]["output"]; baseBorrowingFactorLong: Scalars["BigInt"]["output"]; baseBorrowingFactorShort: Scalars["BigInt"]["output"]; borrowingExponentFactorLong: Scalars["BigInt"]["output"]; @@ -1921,6 +2329,7 @@ export interface MarketInfo { id: Scalars["String"]["output"]; indexTokenAddress: Scalars["String"]["output"]; isDisabled: Scalars["Boolean"]["output"]; + lentPositionImpactPoolAmount: Scalars["BigInt"]["output"]; longOpenInterestInTokens: Scalars["BigInt"]["output"]; longOpenInterestInTokensUsingLongToken: Scalars["BigInt"]["output"]; longOpenInterestInTokensUsingShortToken: Scalars["BigInt"]["output"]; @@ -1934,6 +2343,9 @@ export interface MarketInfo { marketTokenAddress: Scalars["String"]["output"]; marketTokenSupply: Scalars["BigInt"]["output"]; maxFundingFactorPerSecond: Scalars["BigInt"]["output"]; + maxLendableImpactFactor: Scalars["BigInt"]["output"]; + maxLendableImpactFactorForWithdrawals: Scalars["BigInt"]["output"]; + maxLendableImpactUsd: Scalars["BigInt"]["output"]; maxLongPoolAmount: Scalars["BigInt"]["output"]; maxLongPoolUsdForDeposit: Scalars["BigInt"]["output"]; maxOpenInterestLong: Scalars["BigInt"]["output"]; @@ -2013,6 +2425,12 @@ export enum MarketInfoOrderByInput { aboveOptimalUsageBorrowingFactorShort_DESC = "aboveOptimalUsageBorrowingFactorShort_DESC", aboveOptimalUsageBorrowingFactorShort_DESC_NULLS_FIRST = "aboveOptimalUsageBorrowingFactorShort_DESC_NULLS_FIRST", aboveOptimalUsageBorrowingFactorShort_DESC_NULLS_LAST = "aboveOptimalUsageBorrowingFactorShort_DESC_NULLS_LAST", + atomicSwapFeeFactor_ASC = "atomicSwapFeeFactor_ASC", + atomicSwapFeeFactor_ASC_NULLS_FIRST = "atomicSwapFeeFactor_ASC_NULLS_FIRST", + atomicSwapFeeFactor_ASC_NULLS_LAST = "atomicSwapFeeFactor_ASC_NULLS_LAST", + atomicSwapFeeFactor_DESC = "atomicSwapFeeFactor_DESC", + atomicSwapFeeFactor_DESC_NULLS_FIRST = "atomicSwapFeeFactor_DESC_NULLS_FIRST", + atomicSwapFeeFactor_DESC_NULLS_LAST = "atomicSwapFeeFactor_DESC_NULLS_LAST", baseBorrowingFactorLong_ASC = "baseBorrowingFactorLong_ASC", baseBorrowingFactorLong_ASC_NULLS_FIRST = "baseBorrowingFactorLong_ASC_NULLS_FIRST", baseBorrowingFactorLong_ASC_NULLS_LAST = "baseBorrowingFactorLong_ASC_NULLS_LAST", @@ -2109,6 +2527,12 @@ export enum MarketInfoOrderByInput { isDisabled_DESC = "isDisabled_DESC", isDisabled_DESC_NULLS_FIRST = "isDisabled_DESC_NULLS_FIRST", isDisabled_DESC_NULLS_LAST = "isDisabled_DESC_NULLS_LAST", + lentPositionImpactPoolAmount_ASC = "lentPositionImpactPoolAmount_ASC", + lentPositionImpactPoolAmount_ASC_NULLS_FIRST = "lentPositionImpactPoolAmount_ASC_NULLS_FIRST", + lentPositionImpactPoolAmount_ASC_NULLS_LAST = "lentPositionImpactPoolAmount_ASC_NULLS_LAST", + lentPositionImpactPoolAmount_DESC = "lentPositionImpactPoolAmount_DESC", + lentPositionImpactPoolAmount_DESC_NULLS_FIRST = "lentPositionImpactPoolAmount_DESC_NULLS_FIRST", + lentPositionImpactPoolAmount_DESC_NULLS_LAST = "lentPositionImpactPoolAmount_DESC_NULLS_LAST", longOpenInterestInTokensUsingLongToken_ASC = "longOpenInterestInTokensUsingLongToken_ASC", longOpenInterestInTokensUsingLongToken_ASC_NULLS_FIRST = "longOpenInterestInTokensUsingLongToken_ASC_NULLS_FIRST", longOpenInterestInTokensUsingLongToken_ASC_NULLS_LAST = "longOpenInterestInTokensUsingLongToken_ASC_NULLS_LAST", @@ -2187,6 +2611,24 @@ export enum MarketInfoOrderByInput { maxFundingFactorPerSecond_DESC = "maxFundingFactorPerSecond_DESC", maxFundingFactorPerSecond_DESC_NULLS_FIRST = "maxFundingFactorPerSecond_DESC_NULLS_FIRST", maxFundingFactorPerSecond_DESC_NULLS_LAST = "maxFundingFactorPerSecond_DESC_NULLS_LAST", + maxLendableImpactFactorForWithdrawals_ASC = "maxLendableImpactFactorForWithdrawals_ASC", + maxLendableImpactFactorForWithdrawals_ASC_NULLS_FIRST = "maxLendableImpactFactorForWithdrawals_ASC_NULLS_FIRST", + maxLendableImpactFactorForWithdrawals_ASC_NULLS_LAST = "maxLendableImpactFactorForWithdrawals_ASC_NULLS_LAST", + maxLendableImpactFactorForWithdrawals_DESC = "maxLendableImpactFactorForWithdrawals_DESC", + maxLendableImpactFactorForWithdrawals_DESC_NULLS_FIRST = "maxLendableImpactFactorForWithdrawals_DESC_NULLS_FIRST", + maxLendableImpactFactorForWithdrawals_DESC_NULLS_LAST = "maxLendableImpactFactorForWithdrawals_DESC_NULLS_LAST", + maxLendableImpactFactor_ASC = "maxLendableImpactFactor_ASC", + maxLendableImpactFactor_ASC_NULLS_FIRST = "maxLendableImpactFactor_ASC_NULLS_FIRST", + maxLendableImpactFactor_ASC_NULLS_LAST = "maxLendableImpactFactor_ASC_NULLS_LAST", + maxLendableImpactFactor_DESC = "maxLendableImpactFactor_DESC", + maxLendableImpactFactor_DESC_NULLS_FIRST = "maxLendableImpactFactor_DESC_NULLS_FIRST", + maxLendableImpactFactor_DESC_NULLS_LAST = "maxLendableImpactFactor_DESC_NULLS_LAST", + maxLendableImpactUsd_ASC = "maxLendableImpactUsd_ASC", + maxLendableImpactUsd_ASC_NULLS_FIRST = "maxLendableImpactUsd_ASC_NULLS_FIRST", + maxLendableImpactUsd_ASC_NULLS_LAST = "maxLendableImpactUsd_ASC_NULLS_LAST", + maxLendableImpactUsd_DESC = "maxLendableImpactUsd_DESC", + maxLendableImpactUsd_DESC_NULLS_FIRST = "maxLendableImpactUsd_DESC_NULLS_FIRST", + maxLendableImpactUsd_DESC_NULLS_LAST = "maxLendableImpactUsd_DESC_NULLS_LAST", maxLongPoolAmount_ASC = "maxLongPoolAmount_ASC", maxLongPoolAmount_ASC_NULLS_FIRST = "maxLongPoolAmount_ASC_NULLS_FIRST", maxLongPoolAmount_ASC_NULLS_LAST = "maxLongPoolAmount_ASC_NULLS_LAST", @@ -2558,6 +3000,15 @@ export interface MarketInfoWhereInput { aboveOptimalUsageBorrowingFactorShort_lte?: InputMaybe; aboveOptimalUsageBorrowingFactorShort_not_eq?: InputMaybe; aboveOptimalUsageBorrowingFactorShort_not_in?: InputMaybe>; + atomicSwapFeeFactor_eq?: InputMaybe; + atomicSwapFeeFactor_gt?: InputMaybe; + atomicSwapFeeFactor_gte?: InputMaybe; + atomicSwapFeeFactor_in?: InputMaybe>; + atomicSwapFeeFactor_isNull?: InputMaybe; + atomicSwapFeeFactor_lt?: InputMaybe; + atomicSwapFeeFactor_lte?: InputMaybe; + atomicSwapFeeFactor_not_eq?: InputMaybe; + atomicSwapFeeFactor_not_in?: InputMaybe>; baseBorrowingFactorLong_eq?: InputMaybe; baseBorrowingFactorLong_gt?: InputMaybe; baseBorrowingFactorLong_gte?: InputMaybe; @@ -2712,6 +3163,15 @@ export interface MarketInfoWhereInput { isDisabled_eq?: InputMaybe; isDisabled_isNull?: InputMaybe; isDisabled_not_eq?: InputMaybe; + lentPositionImpactPoolAmount_eq?: InputMaybe; + lentPositionImpactPoolAmount_gt?: InputMaybe; + lentPositionImpactPoolAmount_gte?: InputMaybe; + lentPositionImpactPoolAmount_in?: InputMaybe>; + lentPositionImpactPoolAmount_isNull?: InputMaybe; + lentPositionImpactPoolAmount_lt?: InputMaybe; + lentPositionImpactPoolAmount_lte?: InputMaybe; + lentPositionImpactPoolAmount_not_eq?: InputMaybe; + lentPositionImpactPoolAmount_not_in?: InputMaybe>; longOpenInterestInTokensUsingLongToken_eq?: InputMaybe; longOpenInterestInTokensUsingLongToken_gt?: InputMaybe; longOpenInterestInTokensUsingLongToken_gte?: InputMaybe; @@ -2839,6 +3299,33 @@ export interface MarketInfoWhereInput { maxFundingFactorPerSecond_lte?: InputMaybe; maxFundingFactorPerSecond_not_eq?: InputMaybe; maxFundingFactorPerSecond_not_in?: InputMaybe>; + maxLendableImpactFactorForWithdrawals_eq?: InputMaybe; + maxLendableImpactFactorForWithdrawals_gt?: InputMaybe; + maxLendableImpactFactorForWithdrawals_gte?: InputMaybe; + maxLendableImpactFactorForWithdrawals_in?: InputMaybe>; + maxLendableImpactFactorForWithdrawals_isNull?: InputMaybe; + maxLendableImpactFactorForWithdrawals_lt?: InputMaybe; + maxLendableImpactFactorForWithdrawals_lte?: InputMaybe; + maxLendableImpactFactorForWithdrawals_not_eq?: InputMaybe; + maxLendableImpactFactorForWithdrawals_not_in?: InputMaybe>; + maxLendableImpactFactor_eq?: InputMaybe; + maxLendableImpactFactor_gt?: InputMaybe; + maxLendableImpactFactor_gte?: InputMaybe; + maxLendableImpactFactor_in?: InputMaybe>; + maxLendableImpactFactor_isNull?: InputMaybe; + maxLendableImpactFactor_lt?: InputMaybe; + maxLendableImpactFactor_lte?: InputMaybe; + maxLendableImpactFactor_not_eq?: InputMaybe; + maxLendableImpactFactor_not_in?: InputMaybe>; + maxLendableImpactUsd_eq?: InputMaybe; + maxLendableImpactUsd_gt?: InputMaybe; + maxLendableImpactUsd_gte?: InputMaybe; + maxLendableImpactUsd_in?: InputMaybe>; + maxLendableImpactUsd_isNull?: InputMaybe; + maxLendableImpactUsd_lt?: InputMaybe; + maxLendableImpactUsd_lte?: InputMaybe; + maxLendableImpactUsd_not_eq?: InputMaybe; + maxLendableImpactUsd_not_in?: InputMaybe>; maxLongPoolAmount_eq?: InputMaybe; maxLongPoolAmount_gt?: InputMaybe; maxLongPoolAmount_gte?: InputMaybe; @@ -3534,6 +4021,524 @@ export interface MarketsConnection { totalCount: Scalars["Int"]["output"]; } +export interface MultichainFundingInfo { + __typename?: "MultichainFundingInfo"; + account: Scalars["String"]["output"]; + executedTimestamp?: Maybe; + executedTxn?: Maybe; + expectedReceivedAmount: Scalars["BigInt"]["output"]; + id: Scalars["String"]["output"]; + isExecutionError?: Maybe; + operation: Scalars["String"]["output"]; + receivedAmount?: Maybe; + receivedTimestamp?: Maybe; + receivedTxn?: Maybe; + sentAmount: Scalars["BigInt"]["output"]; + sentTimestamp: Scalars["Float"]["output"]; + sentTxn: Scalars["String"]["output"]; + settlementChainId: Scalars["Float"]["output"]; + sourceChainId: Scalars["Float"]["output"]; + step: Scalars["String"]["output"]; + token: Scalars["String"]["output"]; +} + +export enum MultichainFundingOperation { + deposit = "deposit", + withdrawal = "withdrawal", +} + +export interface MultichainFundingReceiveEvents { + __typename?: "MultichainFundingReceiveEvents"; + deliveredTimestamp?: Maybe; + deliveredTxn?: Maybe; + id: Scalars["String"]["output"]; + isDeliveryError?: Maybe; + isUncertain: Scalars["Boolean"]["output"]; + operation: MultichainFundingOperation; + receivedAmount: Scalars["BigInt"]["output"]; + receivedTimestamp: Scalars["Int"]["output"]; + receivedTxn: Scalars["String"]["output"]; + sourceChainId: Scalars["Int"]["output"]; +} + +export interface MultichainFundingReceiveEventsConnection { + __typename?: "MultichainFundingReceiveEventsConnection"; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars["Int"]["output"]; +} + +export interface MultichainFundingReceiveEventsEdge { + __typename?: "MultichainFundingReceiveEventsEdge"; + cursor: Scalars["String"]["output"]; + node: MultichainFundingReceiveEvents; +} + +export enum MultichainFundingReceiveEventsOrderByInput { + deliveredTimestamp_ASC = "deliveredTimestamp_ASC", + deliveredTimestamp_ASC_NULLS_FIRST = "deliveredTimestamp_ASC_NULLS_FIRST", + deliveredTimestamp_ASC_NULLS_LAST = "deliveredTimestamp_ASC_NULLS_LAST", + deliveredTimestamp_DESC = "deliveredTimestamp_DESC", + deliveredTimestamp_DESC_NULLS_FIRST = "deliveredTimestamp_DESC_NULLS_FIRST", + deliveredTimestamp_DESC_NULLS_LAST = "deliveredTimestamp_DESC_NULLS_LAST", + deliveredTxn_ASC = "deliveredTxn_ASC", + deliveredTxn_ASC_NULLS_FIRST = "deliveredTxn_ASC_NULLS_FIRST", + deliveredTxn_ASC_NULLS_LAST = "deliveredTxn_ASC_NULLS_LAST", + deliveredTxn_DESC = "deliveredTxn_DESC", + deliveredTxn_DESC_NULLS_FIRST = "deliveredTxn_DESC_NULLS_FIRST", + deliveredTxn_DESC_NULLS_LAST = "deliveredTxn_DESC_NULLS_LAST", + id_ASC = "id_ASC", + id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST", + id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST", + id_DESC = "id_DESC", + id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST", + id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST", + isDeliveryError_ASC = "isDeliveryError_ASC", + isDeliveryError_ASC_NULLS_FIRST = "isDeliveryError_ASC_NULLS_FIRST", + isDeliveryError_ASC_NULLS_LAST = "isDeliveryError_ASC_NULLS_LAST", + isDeliveryError_DESC = "isDeliveryError_DESC", + isDeliveryError_DESC_NULLS_FIRST = "isDeliveryError_DESC_NULLS_FIRST", + isDeliveryError_DESC_NULLS_LAST = "isDeliveryError_DESC_NULLS_LAST", + isUncertain_ASC = "isUncertain_ASC", + isUncertain_ASC_NULLS_FIRST = "isUncertain_ASC_NULLS_FIRST", + isUncertain_ASC_NULLS_LAST = "isUncertain_ASC_NULLS_LAST", + isUncertain_DESC = "isUncertain_DESC", + isUncertain_DESC_NULLS_FIRST = "isUncertain_DESC_NULLS_FIRST", + isUncertain_DESC_NULLS_LAST = "isUncertain_DESC_NULLS_LAST", + operation_ASC = "operation_ASC", + operation_ASC_NULLS_FIRST = "operation_ASC_NULLS_FIRST", + operation_ASC_NULLS_LAST = "operation_ASC_NULLS_LAST", + operation_DESC = "operation_DESC", + operation_DESC_NULLS_FIRST = "operation_DESC_NULLS_FIRST", + operation_DESC_NULLS_LAST = "operation_DESC_NULLS_LAST", + receivedAmount_ASC = "receivedAmount_ASC", + receivedAmount_ASC_NULLS_FIRST = "receivedAmount_ASC_NULLS_FIRST", + receivedAmount_ASC_NULLS_LAST = "receivedAmount_ASC_NULLS_LAST", + receivedAmount_DESC = "receivedAmount_DESC", + receivedAmount_DESC_NULLS_FIRST = "receivedAmount_DESC_NULLS_FIRST", + receivedAmount_DESC_NULLS_LAST = "receivedAmount_DESC_NULLS_LAST", + receivedTimestamp_ASC = "receivedTimestamp_ASC", + receivedTimestamp_ASC_NULLS_FIRST = "receivedTimestamp_ASC_NULLS_FIRST", + receivedTimestamp_ASC_NULLS_LAST = "receivedTimestamp_ASC_NULLS_LAST", + receivedTimestamp_DESC = "receivedTimestamp_DESC", + receivedTimestamp_DESC_NULLS_FIRST = "receivedTimestamp_DESC_NULLS_FIRST", + receivedTimestamp_DESC_NULLS_LAST = "receivedTimestamp_DESC_NULLS_LAST", + receivedTxn_ASC = "receivedTxn_ASC", + receivedTxn_ASC_NULLS_FIRST = "receivedTxn_ASC_NULLS_FIRST", + receivedTxn_ASC_NULLS_LAST = "receivedTxn_ASC_NULLS_LAST", + receivedTxn_DESC = "receivedTxn_DESC", + receivedTxn_DESC_NULLS_FIRST = "receivedTxn_DESC_NULLS_FIRST", + receivedTxn_DESC_NULLS_LAST = "receivedTxn_DESC_NULLS_LAST", + sourceChainId_ASC = "sourceChainId_ASC", + sourceChainId_ASC_NULLS_FIRST = "sourceChainId_ASC_NULLS_FIRST", + sourceChainId_ASC_NULLS_LAST = "sourceChainId_ASC_NULLS_LAST", + sourceChainId_DESC = "sourceChainId_DESC", + sourceChainId_DESC_NULLS_FIRST = "sourceChainId_DESC_NULLS_FIRST", + sourceChainId_DESC_NULLS_LAST = "sourceChainId_DESC_NULLS_LAST", +} + +export interface MultichainFundingReceiveEventsWhereInput { + AND?: InputMaybe>; + OR?: InputMaybe>; + deliveredTimestamp_eq?: InputMaybe; + deliveredTimestamp_gt?: InputMaybe; + deliveredTimestamp_gte?: InputMaybe; + deliveredTimestamp_in?: InputMaybe>; + deliveredTimestamp_isNull?: InputMaybe; + deliveredTimestamp_lt?: InputMaybe; + deliveredTimestamp_lte?: InputMaybe; + deliveredTimestamp_not_eq?: InputMaybe; + deliveredTimestamp_not_in?: InputMaybe>; + deliveredTxn_contains?: InputMaybe; + deliveredTxn_containsInsensitive?: InputMaybe; + deliveredTxn_endsWith?: InputMaybe; + deliveredTxn_eq?: InputMaybe; + deliveredTxn_gt?: InputMaybe; + deliveredTxn_gte?: InputMaybe; + deliveredTxn_in?: InputMaybe>; + deliveredTxn_isNull?: InputMaybe; + deliveredTxn_lt?: InputMaybe; + deliveredTxn_lte?: InputMaybe; + deliveredTxn_not_contains?: InputMaybe; + deliveredTxn_not_containsInsensitive?: InputMaybe; + deliveredTxn_not_endsWith?: InputMaybe; + deliveredTxn_not_eq?: InputMaybe; + deliveredTxn_not_in?: InputMaybe>; + deliveredTxn_not_startsWith?: InputMaybe; + deliveredTxn_startsWith?: InputMaybe; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + isDeliveryError_eq?: InputMaybe; + isDeliveryError_isNull?: InputMaybe; + isDeliveryError_not_eq?: InputMaybe; + isUncertain_eq?: InputMaybe; + isUncertain_isNull?: InputMaybe; + isUncertain_not_eq?: InputMaybe; + operation_eq?: InputMaybe; + operation_in?: InputMaybe>; + operation_isNull?: InputMaybe; + operation_not_eq?: InputMaybe; + operation_not_in?: InputMaybe>; + receivedAmount_eq?: InputMaybe; + receivedAmount_gt?: InputMaybe; + receivedAmount_gte?: InputMaybe; + receivedAmount_in?: InputMaybe>; + receivedAmount_isNull?: InputMaybe; + receivedAmount_lt?: InputMaybe; + receivedAmount_lte?: InputMaybe; + receivedAmount_not_eq?: InputMaybe; + receivedAmount_not_in?: InputMaybe>; + receivedTimestamp_eq?: InputMaybe; + receivedTimestamp_gt?: InputMaybe; + receivedTimestamp_gte?: InputMaybe; + receivedTimestamp_in?: InputMaybe>; + receivedTimestamp_isNull?: InputMaybe; + receivedTimestamp_lt?: InputMaybe; + receivedTimestamp_lte?: InputMaybe; + receivedTimestamp_not_eq?: InputMaybe; + receivedTimestamp_not_in?: InputMaybe>; + receivedTxn_contains?: InputMaybe; + receivedTxn_containsInsensitive?: InputMaybe; + receivedTxn_endsWith?: InputMaybe; + receivedTxn_eq?: InputMaybe; + receivedTxn_gt?: InputMaybe; + receivedTxn_gte?: InputMaybe; + receivedTxn_in?: InputMaybe>; + receivedTxn_isNull?: InputMaybe; + receivedTxn_lt?: InputMaybe; + receivedTxn_lte?: InputMaybe; + receivedTxn_not_contains?: InputMaybe; + receivedTxn_not_containsInsensitive?: InputMaybe; + receivedTxn_not_endsWith?: InputMaybe; + receivedTxn_not_eq?: InputMaybe; + receivedTxn_not_in?: InputMaybe>; + receivedTxn_not_startsWith?: InputMaybe; + receivedTxn_startsWith?: InputMaybe; + sourceChainId_eq?: InputMaybe; + sourceChainId_gt?: InputMaybe; + sourceChainId_gte?: InputMaybe; + sourceChainId_in?: InputMaybe>; + sourceChainId_isNull?: InputMaybe; + sourceChainId_lt?: InputMaybe; + sourceChainId_lte?: InputMaybe; + sourceChainId_not_eq?: InputMaybe; + sourceChainId_not_in?: InputMaybe>; +} + +export interface MultichainFundingSendEvent { + __typename?: "MultichainFundingSendEvent"; + account: Scalars["String"]["output"]; + expectedReceivedAmount: Scalars["BigInt"]["output"]; + id: Scalars["String"]["output"]; + operation: MultichainFundingOperation; + sentAmount: Scalars["BigInt"]["output"]; + settlementChainId: Scalars["Int"]["output"]; + sourceChainId: Scalars["Int"]["output"]; + timestamp: Scalars["Int"]["output"]; + token: Scalars["String"]["output"]; + txn: Scalars["String"]["output"]; +} + +export interface MultichainFundingSendEventEdge { + __typename?: "MultichainFundingSendEventEdge"; + cursor: Scalars["String"]["output"]; + node: MultichainFundingSendEvent; +} + +export enum MultichainFundingSendEventOrderByInput { + account_ASC = "account_ASC", + account_ASC_NULLS_FIRST = "account_ASC_NULLS_FIRST", + account_ASC_NULLS_LAST = "account_ASC_NULLS_LAST", + account_DESC = "account_DESC", + account_DESC_NULLS_FIRST = "account_DESC_NULLS_FIRST", + account_DESC_NULLS_LAST = "account_DESC_NULLS_LAST", + expectedReceivedAmount_ASC = "expectedReceivedAmount_ASC", + expectedReceivedAmount_ASC_NULLS_FIRST = "expectedReceivedAmount_ASC_NULLS_FIRST", + expectedReceivedAmount_ASC_NULLS_LAST = "expectedReceivedAmount_ASC_NULLS_LAST", + expectedReceivedAmount_DESC = "expectedReceivedAmount_DESC", + expectedReceivedAmount_DESC_NULLS_FIRST = "expectedReceivedAmount_DESC_NULLS_FIRST", + expectedReceivedAmount_DESC_NULLS_LAST = "expectedReceivedAmount_DESC_NULLS_LAST", + id_ASC = "id_ASC", + id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST", + id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST", + id_DESC = "id_DESC", + id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST", + id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST", + operation_ASC = "operation_ASC", + operation_ASC_NULLS_FIRST = "operation_ASC_NULLS_FIRST", + operation_ASC_NULLS_LAST = "operation_ASC_NULLS_LAST", + operation_DESC = "operation_DESC", + operation_DESC_NULLS_FIRST = "operation_DESC_NULLS_FIRST", + operation_DESC_NULLS_LAST = "operation_DESC_NULLS_LAST", + sentAmount_ASC = "sentAmount_ASC", + sentAmount_ASC_NULLS_FIRST = "sentAmount_ASC_NULLS_FIRST", + sentAmount_ASC_NULLS_LAST = "sentAmount_ASC_NULLS_LAST", + sentAmount_DESC = "sentAmount_DESC", + sentAmount_DESC_NULLS_FIRST = "sentAmount_DESC_NULLS_FIRST", + sentAmount_DESC_NULLS_LAST = "sentAmount_DESC_NULLS_LAST", + settlementChainId_ASC = "settlementChainId_ASC", + settlementChainId_ASC_NULLS_FIRST = "settlementChainId_ASC_NULLS_FIRST", + settlementChainId_ASC_NULLS_LAST = "settlementChainId_ASC_NULLS_LAST", + settlementChainId_DESC = "settlementChainId_DESC", + settlementChainId_DESC_NULLS_FIRST = "settlementChainId_DESC_NULLS_FIRST", + settlementChainId_DESC_NULLS_LAST = "settlementChainId_DESC_NULLS_LAST", + sourceChainId_ASC = "sourceChainId_ASC", + sourceChainId_ASC_NULLS_FIRST = "sourceChainId_ASC_NULLS_FIRST", + sourceChainId_ASC_NULLS_LAST = "sourceChainId_ASC_NULLS_LAST", + sourceChainId_DESC = "sourceChainId_DESC", + sourceChainId_DESC_NULLS_FIRST = "sourceChainId_DESC_NULLS_FIRST", + sourceChainId_DESC_NULLS_LAST = "sourceChainId_DESC_NULLS_LAST", + timestamp_ASC = "timestamp_ASC", + timestamp_ASC_NULLS_FIRST = "timestamp_ASC_NULLS_FIRST", + timestamp_ASC_NULLS_LAST = "timestamp_ASC_NULLS_LAST", + timestamp_DESC = "timestamp_DESC", + timestamp_DESC_NULLS_FIRST = "timestamp_DESC_NULLS_FIRST", + timestamp_DESC_NULLS_LAST = "timestamp_DESC_NULLS_LAST", + token_ASC = "token_ASC", + token_ASC_NULLS_FIRST = "token_ASC_NULLS_FIRST", + token_ASC_NULLS_LAST = "token_ASC_NULLS_LAST", + token_DESC = "token_DESC", + token_DESC_NULLS_FIRST = "token_DESC_NULLS_FIRST", + token_DESC_NULLS_LAST = "token_DESC_NULLS_LAST", + txn_ASC = "txn_ASC", + txn_ASC_NULLS_FIRST = "txn_ASC_NULLS_FIRST", + txn_ASC_NULLS_LAST = "txn_ASC_NULLS_LAST", + txn_DESC = "txn_DESC", + txn_DESC_NULLS_FIRST = "txn_DESC_NULLS_FIRST", + txn_DESC_NULLS_LAST = "txn_DESC_NULLS_LAST", +} + +export interface MultichainFundingSendEventWhereInput { + AND?: InputMaybe>; + OR?: InputMaybe>; + account_contains?: InputMaybe; + account_containsInsensitive?: InputMaybe; + account_endsWith?: InputMaybe; + account_eq?: InputMaybe; + account_gt?: InputMaybe; + account_gte?: InputMaybe; + account_in?: InputMaybe>; + account_isNull?: InputMaybe; + account_lt?: InputMaybe; + account_lte?: InputMaybe; + account_not_contains?: InputMaybe; + account_not_containsInsensitive?: InputMaybe; + account_not_endsWith?: InputMaybe; + account_not_eq?: InputMaybe; + account_not_in?: InputMaybe>; + account_not_startsWith?: InputMaybe; + account_startsWith?: InputMaybe; + expectedReceivedAmount_eq?: InputMaybe; + expectedReceivedAmount_gt?: InputMaybe; + expectedReceivedAmount_gte?: InputMaybe; + expectedReceivedAmount_in?: InputMaybe>; + expectedReceivedAmount_isNull?: InputMaybe; + expectedReceivedAmount_lt?: InputMaybe; + expectedReceivedAmount_lte?: InputMaybe; + expectedReceivedAmount_not_eq?: InputMaybe; + expectedReceivedAmount_not_in?: InputMaybe>; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + operation_eq?: InputMaybe; + operation_in?: InputMaybe>; + operation_isNull?: InputMaybe; + operation_not_eq?: InputMaybe; + operation_not_in?: InputMaybe>; + sentAmount_eq?: InputMaybe; + sentAmount_gt?: InputMaybe; + sentAmount_gte?: InputMaybe; + sentAmount_in?: InputMaybe>; + sentAmount_isNull?: InputMaybe; + sentAmount_lt?: InputMaybe; + sentAmount_lte?: InputMaybe; + sentAmount_not_eq?: InputMaybe; + sentAmount_not_in?: InputMaybe>; + settlementChainId_eq?: InputMaybe; + settlementChainId_gt?: InputMaybe; + settlementChainId_gte?: InputMaybe; + settlementChainId_in?: InputMaybe>; + settlementChainId_isNull?: InputMaybe; + settlementChainId_lt?: InputMaybe; + settlementChainId_lte?: InputMaybe; + settlementChainId_not_eq?: InputMaybe; + settlementChainId_not_in?: InputMaybe>; + sourceChainId_eq?: InputMaybe; + sourceChainId_gt?: InputMaybe; + sourceChainId_gte?: InputMaybe; + sourceChainId_in?: InputMaybe>; + sourceChainId_isNull?: InputMaybe; + sourceChainId_lt?: InputMaybe; + sourceChainId_lte?: InputMaybe; + sourceChainId_not_eq?: InputMaybe; + sourceChainId_not_in?: InputMaybe>; + timestamp_eq?: InputMaybe; + timestamp_gt?: InputMaybe; + timestamp_gte?: InputMaybe; + timestamp_in?: InputMaybe>; + timestamp_isNull?: InputMaybe; + timestamp_lt?: InputMaybe; + timestamp_lte?: InputMaybe; + timestamp_not_eq?: InputMaybe; + timestamp_not_in?: InputMaybe>; + token_contains?: InputMaybe; + token_containsInsensitive?: InputMaybe; + token_endsWith?: InputMaybe; + token_eq?: InputMaybe; + token_gt?: InputMaybe; + token_gte?: InputMaybe; + token_in?: InputMaybe>; + token_isNull?: InputMaybe; + token_lt?: InputMaybe; + token_lte?: InputMaybe; + token_not_contains?: InputMaybe; + token_not_containsInsensitive?: InputMaybe; + token_not_endsWith?: InputMaybe; + token_not_eq?: InputMaybe; + token_not_in?: InputMaybe>; + token_not_startsWith?: InputMaybe; + token_startsWith?: InputMaybe; + txn_contains?: InputMaybe; + txn_containsInsensitive?: InputMaybe; + txn_endsWith?: InputMaybe; + txn_eq?: InputMaybe; + txn_gt?: InputMaybe; + txn_gte?: InputMaybe; + txn_in?: InputMaybe>; + txn_isNull?: InputMaybe; + txn_lt?: InputMaybe; + txn_lte?: InputMaybe; + txn_not_contains?: InputMaybe; + txn_not_containsInsensitive?: InputMaybe; + txn_not_endsWith?: InputMaybe; + txn_not_eq?: InputMaybe; + txn_not_in?: InputMaybe>; + txn_not_startsWith?: InputMaybe; + txn_startsWith?: InputMaybe; +} + +export interface MultichainFundingSendEventsConnection { + __typename?: "MultichainFundingSendEventsConnection"; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars["Int"]["output"]; +} + +export interface MultichainFundingWhereInput { + account?: InputMaybe; + id?: InputMaybe; +} + +export interface MultichainMetadata { + __typename?: "MultichainMetadata"; + id: Scalars["String"]["output"]; + lastBlockNumber: Scalars["Int"]["output"]; + lastBlockTimestamp: Scalars["Int"]["output"]; +} + +export interface MultichainMetadataConnection { + __typename?: "MultichainMetadataConnection"; + edges: Array; + pageInfo: PageInfo; + totalCount: Scalars["Int"]["output"]; +} + +export interface MultichainMetadataEdge { + __typename?: "MultichainMetadataEdge"; + cursor: Scalars["String"]["output"]; + node: MultichainMetadata; +} + +export enum MultichainMetadataOrderByInput { + id_ASC = "id_ASC", + id_ASC_NULLS_FIRST = "id_ASC_NULLS_FIRST", + id_ASC_NULLS_LAST = "id_ASC_NULLS_LAST", + id_DESC = "id_DESC", + id_DESC_NULLS_FIRST = "id_DESC_NULLS_FIRST", + id_DESC_NULLS_LAST = "id_DESC_NULLS_LAST", + lastBlockNumber_ASC = "lastBlockNumber_ASC", + lastBlockNumber_ASC_NULLS_FIRST = "lastBlockNumber_ASC_NULLS_FIRST", + lastBlockNumber_ASC_NULLS_LAST = "lastBlockNumber_ASC_NULLS_LAST", + lastBlockNumber_DESC = "lastBlockNumber_DESC", + lastBlockNumber_DESC_NULLS_FIRST = "lastBlockNumber_DESC_NULLS_FIRST", + lastBlockNumber_DESC_NULLS_LAST = "lastBlockNumber_DESC_NULLS_LAST", + lastBlockTimestamp_ASC = "lastBlockTimestamp_ASC", + lastBlockTimestamp_ASC_NULLS_FIRST = "lastBlockTimestamp_ASC_NULLS_FIRST", + lastBlockTimestamp_ASC_NULLS_LAST = "lastBlockTimestamp_ASC_NULLS_LAST", + lastBlockTimestamp_DESC = "lastBlockTimestamp_DESC", + lastBlockTimestamp_DESC_NULLS_FIRST = "lastBlockTimestamp_DESC_NULLS_FIRST", + lastBlockTimestamp_DESC_NULLS_LAST = "lastBlockTimestamp_DESC_NULLS_LAST", +} + +export interface MultichainMetadataWhereInput { + AND?: InputMaybe>; + OR?: InputMaybe>; + id_contains?: InputMaybe; + id_containsInsensitive?: InputMaybe; + id_endsWith?: InputMaybe; + id_eq?: InputMaybe; + id_gt?: InputMaybe; + id_gte?: InputMaybe; + id_in?: InputMaybe>; + id_isNull?: InputMaybe; + id_lt?: InputMaybe; + id_lte?: InputMaybe; + id_not_contains?: InputMaybe; + id_not_containsInsensitive?: InputMaybe; + id_not_endsWith?: InputMaybe; + id_not_eq?: InputMaybe; + id_not_in?: InputMaybe>; + id_not_startsWith?: InputMaybe; + id_startsWith?: InputMaybe; + lastBlockNumber_eq?: InputMaybe; + lastBlockNumber_gt?: InputMaybe; + lastBlockNumber_gte?: InputMaybe; + lastBlockNumber_in?: InputMaybe>; + lastBlockNumber_isNull?: InputMaybe; + lastBlockNumber_lt?: InputMaybe; + lastBlockNumber_lte?: InputMaybe; + lastBlockNumber_not_eq?: InputMaybe; + lastBlockNumber_not_in?: InputMaybe>; + lastBlockTimestamp_eq?: InputMaybe; + lastBlockTimestamp_gt?: InputMaybe; + lastBlockTimestamp_gte?: InputMaybe; + lastBlockTimestamp_in?: InputMaybe>; + lastBlockTimestamp_isNull?: InputMaybe; + lastBlockTimestamp_lt?: InputMaybe; + lastBlockTimestamp_lte?: InputMaybe; + lastBlockTimestamp_not_eq?: InputMaybe; + lastBlockTimestamp_not_in?: InputMaybe>; +} + export interface OnChainSetting { __typename?: "OnChainSetting"; id: Scalars["String"]["output"]; @@ -3675,6 +4680,7 @@ export interface Order { receiver: Scalars["String"]["output"]; shouldUnwrapNativeToken: Scalars["Boolean"]["output"]; sizeDeltaUsd: Scalars["BigInt"]["output"]; + srcChainId?: Maybe; status: OrderStatus; swapPath: Array; triggerPrice: Scalars["BigInt"]["output"]; @@ -3936,6 +4942,12 @@ export enum OrderOrderByInput { sizeDeltaUsd_DESC = "sizeDeltaUsd_DESC", sizeDeltaUsd_DESC_NULLS_FIRST = "sizeDeltaUsd_DESC_NULLS_FIRST", sizeDeltaUsd_DESC_NULLS_LAST = "sizeDeltaUsd_DESC_NULLS_LAST", + srcChainId_ASC = "srcChainId_ASC", + srcChainId_ASC_NULLS_FIRST = "srcChainId_ASC_NULLS_FIRST", + srcChainId_ASC_NULLS_LAST = "srcChainId_ASC_NULLS_LAST", + srcChainId_DESC = "srcChainId_DESC", + srcChainId_DESC_NULLS_FIRST = "srcChainId_DESC_NULLS_FIRST", + srcChainId_DESC_NULLS_LAST = "srcChainId_DESC_NULLS_LAST", status_ASC = "status_ASC", status_ASC_NULLS_FIRST = "status_ASC_NULLS_FIRST", status_ASC_NULLS_LAST = "status_ASC_NULLS_LAST", @@ -4232,6 +5244,15 @@ export interface OrderWhereInput { sizeDeltaUsd_lte?: InputMaybe; sizeDeltaUsd_not_eq?: InputMaybe; sizeDeltaUsd_not_in?: InputMaybe>; + srcChainId_eq?: InputMaybe; + srcChainId_gt?: InputMaybe; + srcChainId_gte?: InputMaybe; + srcChainId_in?: InputMaybe>; + srcChainId_isNull?: InputMaybe; + srcChainId_lt?: InputMaybe; + srcChainId_lte?: InputMaybe; + srcChainId_not_eq?: InputMaybe; + srcChainId_not_in?: InputMaybe>; status_eq?: InputMaybe; status_in?: InputMaybe>; status_isNull?: InputMaybe; @@ -4310,6 +5331,24 @@ export interface PageInfo { startCursor: Scalars["String"]["output"]; } +export interface PerformanceSnapshotObject { + __typename?: "PerformanceSnapshotObject"; + performance: Scalars["String"]["output"]; + snapshotTimestamp: Scalars["String"]["output"]; +} + +export interface PerformanceSnapshots { + __typename?: "PerformanceSnapshots"; + address: Scalars["String"]["output"]; + entity: Scalars["String"]["output"]; + snapshots: Array; +} + +export interface PerformanceWhereInput { + addresses?: InputMaybe>; + period: Scalars["String"]["input"]; +} + export interface PerformanceSnapshotObject { __typename?: "PerformanceSnapshotObject"; snapshotTimestamp: Scalars["String"]["output"]; @@ -4509,9 +5548,11 @@ export interface PositionChange { priceImpactAmount?: Maybe; priceImpactDiffUsd?: Maybe; priceImpactUsd: Scalars["BigInt"]["output"]; + proportionalPendingImpactUsd?: Maybe; sizeDeltaUsd: Scalars["BigInt"]["output"]; sizeInUsd: Scalars["BigInt"]["output"]; timestamp: Scalars["Int"]["output"]; + totalImpactUsd?: Maybe; type: PositionChangeType; } @@ -4624,6 +5665,12 @@ export enum PositionChangeOrderByInput { priceImpactUsd_DESC = "priceImpactUsd_DESC", priceImpactUsd_DESC_NULLS_FIRST = "priceImpactUsd_DESC_NULLS_FIRST", priceImpactUsd_DESC_NULLS_LAST = "priceImpactUsd_DESC_NULLS_LAST", + proportionalPendingImpactUsd_ASC = "proportionalPendingImpactUsd_ASC", + proportionalPendingImpactUsd_ASC_NULLS_FIRST = "proportionalPendingImpactUsd_ASC_NULLS_FIRST", + proportionalPendingImpactUsd_ASC_NULLS_LAST = "proportionalPendingImpactUsd_ASC_NULLS_LAST", + proportionalPendingImpactUsd_DESC = "proportionalPendingImpactUsd_DESC", + proportionalPendingImpactUsd_DESC_NULLS_FIRST = "proportionalPendingImpactUsd_DESC_NULLS_FIRST", + proportionalPendingImpactUsd_DESC_NULLS_LAST = "proportionalPendingImpactUsd_DESC_NULLS_LAST", sizeDeltaUsd_ASC = "sizeDeltaUsd_ASC", sizeDeltaUsd_ASC_NULLS_FIRST = "sizeDeltaUsd_ASC_NULLS_FIRST", sizeDeltaUsd_ASC_NULLS_LAST = "sizeDeltaUsd_ASC_NULLS_LAST", @@ -4642,6 +5689,12 @@ export enum PositionChangeOrderByInput { timestamp_DESC = "timestamp_DESC", timestamp_DESC_NULLS_FIRST = "timestamp_DESC_NULLS_FIRST", timestamp_DESC_NULLS_LAST = "timestamp_DESC_NULLS_LAST", + totalImpactUsd_ASC = "totalImpactUsd_ASC", + totalImpactUsd_ASC_NULLS_FIRST = "totalImpactUsd_ASC_NULLS_FIRST", + totalImpactUsd_ASC_NULLS_LAST = "totalImpactUsd_ASC_NULLS_LAST", + totalImpactUsd_DESC = "totalImpactUsd_DESC", + totalImpactUsd_DESC_NULLS_FIRST = "totalImpactUsd_DESC_NULLS_FIRST", + totalImpactUsd_DESC_NULLS_LAST = "totalImpactUsd_DESC_NULLS_LAST", type_ASC = "type_ASC", type_ASC_NULLS_FIRST = "type_ASC_NULLS_FIRST", type_ASC_NULLS_LAST = "type_ASC_NULLS_LAST", @@ -4831,6 +5884,15 @@ export interface PositionChangeWhereInput { priceImpactUsd_lte?: InputMaybe; priceImpactUsd_not_eq?: InputMaybe; priceImpactUsd_not_in?: InputMaybe>; + proportionalPendingImpactUsd_eq?: InputMaybe; + proportionalPendingImpactUsd_gt?: InputMaybe; + proportionalPendingImpactUsd_gte?: InputMaybe; + proportionalPendingImpactUsd_in?: InputMaybe>; + proportionalPendingImpactUsd_isNull?: InputMaybe; + proportionalPendingImpactUsd_lt?: InputMaybe; + proportionalPendingImpactUsd_lte?: InputMaybe; + proportionalPendingImpactUsd_not_eq?: InputMaybe; + proportionalPendingImpactUsd_not_in?: InputMaybe>; sizeDeltaUsd_eq?: InputMaybe; sizeDeltaUsd_gt?: InputMaybe; sizeDeltaUsd_gte?: InputMaybe; @@ -4858,6 +5920,15 @@ export interface PositionChangeWhereInput { timestamp_lte?: InputMaybe; timestamp_not_eq?: InputMaybe; timestamp_not_in?: InputMaybe>; + totalImpactUsd_eq?: InputMaybe; + totalImpactUsd_gt?: InputMaybe; + totalImpactUsd_gte?: InputMaybe; + totalImpactUsd_in?: InputMaybe>; + totalImpactUsd_isNull?: InputMaybe; + totalImpactUsd_lt?: InputMaybe; + totalImpactUsd_lte?: InputMaybe; + totalImpactUsd_not_eq?: InputMaybe; + totalImpactUsd_not_in?: InputMaybe>; type_eq?: InputMaybe; type_in?: InputMaybe>; type_isNull?: InputMaybe; @@ -6040,6 +7111,12 @@ export interface Query { claimRefById?: Maybe; claimRefs: Array; claimRefsConnection: ClaimRefsConnection; + claimableCollateralById?: Maybe; + claimableCollateralGroupById?: Maybe; + claimableCollateralGroups: Array; + claimableCollateralGroupsConnection: ClaimableCollateralGroupsConnection; + claimableCollaterals: Array; + claimableCollateralsConnection: ClaimableCollateralsConnection; claimableFundingFeeInfoById?: Maybe; claimableFundingFeeInfos: Array; claimableFundingFeeInfosConnection: ClaimableFundingFeeInfosConnection; @@ -6068,6 +7145,16 @@ export interface Query { marketsAprByPeriod: Array; marketsConnection: MarketsConnection; marketsPnlAprByPeriod: Array; + multichainFunding: Array; + multichainFundingReceiveEvents: Array; + multichainFundingReceiveEventsById?: Maybe; + multichainFundingReceiveEventsConnection: MultichainFundingReceiveEventsConnection; + multichainFundingSendEventById?: Maybe; + multichainFundingSendEvents: Array; + multichainFundingSendEventsConnection: MultichainFundingSendEventsConnection; + multichainMetadata: Array; + multichainMetadataById?: Maybe; + multichainMetadataConnection: MultichainMetadataConnection; onChainSettingById?: Maybe; onChainSettings: Array; onChainSettingsConnection: OnChainSettingsConnection; @@ -6213,6 +7300,42 @@ export interface QueryclaimRefsConnectionArgs { where?: InputMaybe; } +export interface QueryclaimableCollateralByIdArgs { + id: Scalars["String"]["input"]; +} + +export interface QueryclaimableCollateralGroupByIdArgs { + id: Scalars["String"]["input"]; +} + +export interface QueryclaimableCollateralGroupsArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface QueryclaimableCollateralGroupsConnectionArgs { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +} + +export interface QueryclaimableCollateralsArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface QueryclaimableCollateralsConnectionArgs { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +} + export interface QueryclaimableFundingFeeInfoByIdArgs { id: Scalars["String"]["input"]; } @@ -6373,6 +7496,64 @@ export interface QuerymarketsPnlAprByPeriodArgs { where?: InputMaybe; } +export interface QuerymultichainFundingArgs { + where?: InputMaybe; +} + +export interface QuerymultichainFundingReceiveEventsArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface QuerymultichainFundingReceiveEventsByIdArgs { + id: Scalars["String"]["input"]; +} + +export interface QuerymultichainFundingReceiveEventsConnectionArgs { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +} + +export interface QuerymultichainFundingSendEventByIdArgs { + id: Scalars["String"]["input"]; +} + +export interface QuerymultichainFundingSendEventsArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface QuerymultichainFundingSendEventsConnectionArgs { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +} + +export interface QuerymultichainMetadataArgs { + limit?: InputMaybe; + offset?: InputMaybe; + orderBy?: InputMaybe>; + where?: InputMaybe; +} + +export interface QuerymultichainMetadataByIdArgs { + id: Scalars["String"]["input"]; +} + +export interface QuerymultichainMetadataConnectionArgs { + after?: InputMaybe; + first?: InputMaybe; + orderBy: Array; + where?: InputMaybe; +} + export interface QueryonChainSettingByIdArgs { id: Scalars["String"]["input"]; } @@ -6945,12 +8126,15 @@ export interface TradeAction { priceImpactAmount?: Maybe; priceImpactDiffUsd?: Maybe; priceImpactUsd?: Maybe; + proportionalPendingImpactUsd?: Maybe; reason?: Maybe; reasonBytes?: Maybe; shouldUnwrapNativeToken?: Maybe; sizeDeltaUsd?: Maybe; + srcChainId?: Maybe; swapPath: Array; timestamp: Scalars["Int"]["output"]; + totalImpactUsd?: Maybe; transaction: Transaction; triggerPrice?: Maybe; twapGroupId?: Maybe; @@ -7132,6 +8316,12 @@ export enum TradeActionOrderByInput { priceImpactUsd_DESC = "priceImpactUsd_DESC", priceImpactUsd_DESC_NULLS_FIRST = "priceImpactUsd_DESC_NULLS_FIRST", priceImpactUsd_DESC_NULLS_LAST = "priceImpactUsd_DESC_NULLS_LAST", + proportionalPendingImpactUsd_ASC = "proportionalPendingImpactUsd_ASC", + proportionalPendingImpactUsd_ASC_NULLS_FIRST = "proportionalPendingImpactUsd_ASC_NULLS_FIRST", + proportionalPendingImpactUsd_ASC_NULLS_LAST = "proportionalPendingImpactUsd_ASC_NULLS_LAST", + proportionalPendingImpactUsd_DESC = "proportionalPendingImpactUsd_DESC", + proportionalPendingImpactUsd_DESC_NULLS_FIRST = "proportionalPendingImpactUsd_DESC_NULLS_FIRST", + proportionalPendingImpactUsd_DESC_NULLS_LAST = "proportionalPendingImpactUsd_DESC_NULLS_LAST", reasonBytes_ASC = "reasonBytes_ASC", reasonBytes_ASC_NULLS_FIRST = "reasonBytes_ASC_NULLS_FIRST", reasonBytes_ASC_NULLS_LAST = "reasonBytes_ASC_NULLS_LAST", @@ -7156,12 +8346,24 @@ export enum TradeActionOrderByInput { sizeDeltaUsd_DESC = "sizeDeltaUsd_DESC", sizeDeltaUsd_DESC_NULLS_FIRST = "sizeDeltaUsd_DESC_NULLS_FIRST", sizeDeltaUsd_DESC_NULLS_LAST = "sizeDeltaUsd_DESC_NULLS_LAST", + srcChainId_ASC = "srcChainId_ASC", + srcChainId_ASC_NULLS_FIRST = "srcChainId_ASC_NULLS_FIRST", + srcChainId_ASC_NULLS_LAST = "srcChainId_ASC_NULLS_LAST", + srcChainId_DESC = "srcChainId_DESC", + srcChainId_DESC_NULLS_FIRST = "srcChainId_DESC_NULLS_FIRST", + srcChainId_DESC_NULLS_LAST = "srcChainId_DESC_NULLS_LAST", timestamp_ASC = "timestamp_ASC", timestamp_ASC_NULLS_FIRST = "timestamp_ASC_NULLS_FIRST", timestamp_ASC_NULLS_LAST = "timestamp_ASC_NULLS_LAST", timestamp_DESC = "timestamp_DESC", timestamp_DESC_NULLS_FIRST = "timestamp_DESC_NULLS_FIRST", timestamp_DESC_NULLS_LAST = "timestamp_DESC_NULLS_LAST", + totalImpactUsd_ASC = "totalImpactUsd_ASC", + totalImpactUsd_ASC_NULLS_FIRST = "totalImpactUsd_ASC_NULLS_FIRST", + totalImpactUsd_ASC_NULLS_LAST = "totalImpactUsd_ASC_NULLS_LAST", + totalImpactUsd_DESC = "totalImpactUsd_DESC", + totalImpactUsd_DESC_NULLS_FIRST = "totalImpactUsd_DESC_NULLS_FIRST", + totalImpactUsd_DESC_NULLS_LAST = "totalImpactUsd_DESC_NULLS_LAST", transaction_blockNumber_ASC = "transaction_blockNumber_ASC", transaction_blockNumber_ASC_NULLS_FIRST = "transaction_blockNumber_ASC_NULLS_FIRST", transaction_blockNumber_ASC_NULLS_LAST = "transaction_blockNumber_ASC_NULLS_LAST", @@ -7521,6 +8723,15 @@ export interface TradeActionWhereInput { priceImpactUsd_lte?: InputMaybe; priceImpactUsd_not_eq?: InputMaybe; priceImpactUsd_not_in?: InputMaybe>; + proportionalPendingImpactUsd_eq?: InputMaybe; + proportionalPendingImpactUsd_gt?: InputMaybe; + proportionalPendingImpactUsd_gte?: InputMaybe; + proportionalPendingImpactUsd_in?: InputMaybe>; + proportionalPendingImpactUsd_isNull?: InputMaybe; + proportionalPendingImpactUsd_lt?: InputMaybe; + proportionalPendingImpactUsd_lte?: InputMaybe; + proportionalPendingImpactUsd_not_eq?: InputMaybe; + proportionalPendingImpactUsd_not_in?: InputMaybe>; reasonBytes_contains?: InputMaybe; reasonBytes_containsInsensitive?: InputMaybe; reasonBytes_endsWith?: InputMaybe; @@ -7567,6 +8778,15 @@ export interface TradeActionWhereInput { sizeDeltaUsd_lte?: InputMaybe; sizeDeltaUsd_not_eq?: InputMaybe; sizeDeltaUsd_not_in?: InputMaybe>; + srcChainId_eq?: InputMaybe; + srcChainId_gt?: InputMaybe; + srcChainId_gte?: InputMaybe; + srcChainId_in?: InputMaybe>; + srcChainId_isNull?: InputMaybe; + srcChainId_lt?: InputMaybe; + srcChainId_lte?: InputMaybe; + srcChainId_not_eq?: InputMaybe; + srcChainId_not_in?: InputMaybe>; swapPath_containsAll?: InputMaybe>; swapPath_containsAny?: InputMaybe>; swapPath_containsNone?: InputMaybe>; @@ -7580,6 +8800,15 @@ export interface TradeActionWhereInput { timestamp_lte?: InputMaybe; timestamp_not_eq?: InputMaybe; timestamp_not_in?: InputMaybe>; + totalImpactUsd_eq?: InputMaybe; + totalImpactUsd_gt?: InputMaybe; + totalImpactUsd_gte?: InputMaybe; + totalImpactUsd_in?: InputMaybe>; + totalImpactUsd_isNull?: InputMaybe; + totalImpactUsd_lt?: InputMaybe; + totalImpactUsd_lte?: InputMaybe; + totalImpactUsd_not_eq?: InputMaybe; + totalImpactUsd_not_in?: InputMaybe>; transaction?: InputMaybe; transaction_isNull?: InputMaybe; triggerPrice_eq?: InputMaybe; diff --git a/sdk/src/types/tokens.ts b/sdk/src/types/tokens.ts index 7009d8596f..3db9aa05d2 100644 --- a/sdk/src/types/tokens.ts +++ b/sdk/src/types/tokens.ts @@ -127,6 +127,13 @@ export type TokenPrices = { export type TokenData = Token & { prices: TokenPrices; + isGmxAccount?: boolean; + walletBalance?: bigint; + gmxAccountBalance?: bigint; + /** + * If isGmxAccount is true, then this is the gmx account balance + * If isGmxAccount is false, then this is the wallet balance + */ balance?: bigint; totalSupply?: bigint; hasPriceFeedProvider?: boolean; diff --git a/sdk/src/types/trade.ts b/sdk/src/types/trade.ts index b068fa127d..6e2732e4e5 100644 --- a/sdk/src/types/trade.ts +++ b/sdk/src/types/trade.ts @@ -110,8 +110,11 @@ export type DecreasePositionAmounts = { borrowingFeeUsd: bigint; fundingFeeUsd: bigint; swapProfitFeeUsd: bigint; - positionPriceImpactDeltaUsd: bigint; + proportionalPendingImpactDeltaUsd: bigint; + closePriceImpactDeltaUsd: bigint; + totalPendingImpactDeltaUsd: bigint; priceImpactDiffUsd: bigint; + balanceWasImproved: boolean; payedRemainingCollateralAmount: bigint; payedOutputUsd: bigint; @@ -314,9 +317,14 @@ export type TradeFees = { swapFees?: SwapFeeItem[]; positionFee?: FeeItem; swapPriceImpact?: FeeItem; - positionPriceImpact?: FeeItem; - priceImpactDiff?: FeeItem; positionCollateralPriceImpact?: FeeItem; + proportionalPendingImpact?: FeeItem; + increasePositionPriceImpact?: FeeItem; + decreasePositionPriceImpact?: FeeItem; + totalPendingImpact?: FeeItem; + priceImpactDiff?: FeeItem; + positionNetPriceImpact?: FeeItem; + collateralNetPriceImpact?: FeeItem; collateralPriceImpactDiff?: FeeItem; positionFeeFactor?: bigint; borrowFee?: FeeItem; diff --git a/sdk/src/types/tradeHistory.ts b/sdk/src/types/tradeHistory.ts index 617bc98acd..ab016a088c 100644 --- a/sdk/src/types/tradeHistory.ts +++ b/sdk/src/types/tradeHistory.ts @@ -12,6 +12,7 @@ export enum TradeActionType { export type PositionTradeAction = { id: string; + srcChainId?: number; eventName: TradeActionType; marketInfo: MarketInfo; marketAddress: string; @@ -44,6 +45,7 @@ export type PositionTradeAction = { reason?: string; reasonBytes?: string | Uint8Array; shouldUnwrapNativeToken: boolean; + totalImpactUsd?: bigint; liquidationFeeAmount?: bigint; twapParams: | { @@ -59,6 +61,7 @@ export type PositionTradeAction = { export type SwapTradeAction = { id: string; + srcChainId?: number; account: string; eventName: TradeActionType; initialCollateralTokenAddress: string; diff --git a/sdk/src/utils/LruCache.ts b/sdk/src/utils/LruCache.ts index c6010d3278..e6a1d66b00 100644 --- a/sdk/src/utils/LruCache.ts +++ b/sdk/src/utils/LruCache.ts @@ -45,6 +45,11 @@ export class LRUCache { } } + delete(key: string): void { + this.cache.delete(key); + this.recentKeys = this.recentKeys.filter((k) => k !== key); + } + private updateRecentKeys(key: string): void { // Move the key to the end (most recently used) of recentKeys this.recentKeys = this.recentKeys.filter((k) => k !== key); diff --git a/sdk/src/utils/__tests__/LruCache.spec.ts b/sdk/src/utils/__tests__/LruCache.spec.ts index 3d66885252..0aeb4a7a2a 100644 --- a/sdk/src/utils/__tests__/LruCache.spec.ts +++ b/sdk/src/utils/__tests__/LruCache.spec.ts @@ -47,4 +47,24 @@ describe("LruCache", () => { const cache = new LRUCache(2); expect(() => cache.set(123 as any, 1)).toThrow("Key must be a string"); }); + + it("should delete a key and remove it from recent keys", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + cache.set("b", 2); + cache.delete("a"); + expect(cache.has("a")).toBe(false); + expect(cache.get("a")).toBeUndefined(); + cache.set("c", 3); + expect(cache.has("b")).toBe(true); + expect(cache.has("c")).toBe(true); + }); + + it("should handle deletion of non-existent key", () => { + const cache = new LRUCache(2); + cache.set("a", 1); + cache.delete("x"); + expect(cache.has("a")).toBe(true); + expect(cache.get("a")).toBe(1); + }); }); diff --git a/sdk/src/utils/__tests__/orderTransactions/batchUtils.spec.ts b/sdk/src/utils/__tests__/orderTransactions/batchUtils.spec.ts index 737a0f8023..657d58c4f2 100644 --- a/sdk/src/utils/__tests__/orderTransactions/batchUtils.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/batchUtils.spec.ts @@ -16,6 +16,7 @@ import { getBatchTotalPayCollateralAmount, getIsEmptyBatch, getIsInvalidBatchReceiver, + IncreasePositionOrderParams, } from "utils/orderTransactions"; import { mockExternalSwap } from "../../../test/mock"; @@ -44,7 +45,6 @@ const commonMarketIncreaseParams = { collateralDeltaAmount: parseValue("1", WETH.decimals)!, swapPath: [WETH.address], externalSwapQuote: undefined as ExternalSwapQuote | undefined, - minOutputAmount: 0n, triggerPrice: undefined, referralCode: zeroHash, autoCancel: false, @@ -53,7 +53,7 @@ const commonMarketIncreaseParams = { validFromTime: 0n, orderType: OrderType.MarketIncrease as const, uiFeeReceiver: zeroAddress, -}; +} satisfies Partial; // Helper to build a batch with multiple increase orders function buildMultiIncreaseBatch(paramsList: (typeof commonMarketIncreaseParams)[]) { diff --git a/sdk/src/utils/__tests__/orderTransactions/decreaseOrders.spec.ts b/sdk/src/utils/__tests__/orderTransactions/decreaseOrders.spec.ts index 533ac91e7e..91ea0ca602 100644 --- a/sdk/src/utils/__tests__/orderTransactions/decreaseOrders.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/decreaseOrders.spec.ts @@ -6,11 +6,14 @@ import { getContract } from "configs/contracts"; import { MARKETS } from "configs/markets"; import { getTokenBySymbol, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "configs/tokens"; import { DecreasePositionSwapType, OrderType } from "types/orders"; +import { ContractPrice, ERC20Address } from "types/tokens"; import { MaxUint256, parseValue, USD_DECIMALS } from "utils/numbers"; import { buildDecreaseOrderPayload, buildTwapOrdersPayloads, CreateOrderPayload, + CreateOrderTxnParams, + DecreasePositionOrderParams, getIsTwapOrderPayload, } from "utils/orderTransactions"; import { decodeTwapUiFeeReceiver } from "utils/twap/uiFeeReceiver"; @@ -58,7 +61,7 @@ describe("Decrease Order Payloads", () => { triggerPrice: 0n, externalSwapQuote: undefined, minOutputUsd: 0n, - }; + } satisfies Partial; describe("buildDecreaseOrderPayload", () => { it("Market Decrease Long with Native Receive", () => { @@ -79,14 +82,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, - triggerPrice: 0n, - acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)!, // $1200 - 0.5% slippage + triggerPrice: 0n as ContractPrice, + acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)! as ContractPrice, // $1200 - 0.5% slippage executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -98,12 +101,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -119,7 +123,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Decrease Short with Native Receive", () => { @@ -140,14 +144,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, // $1200 + 0.5% slippage + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, // $1200 + 0.5% slippage executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -159,12 +163,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -180,7 +185,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Decrease with ERC20 Receive", () => { @@ -200,14 +205,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -219,12 +224,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -240,7 +246,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("TP/SL Long", () => { @@ -262,14 +268,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, - triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)!, - acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)!, + triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)! as ContractPrice, + acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -281,12 +287,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -302,7 +309,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Auto cancel TP/SL Short", () => { @@ -326,14 +333,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, - triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)!, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)! as ContractPrice, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -345,12 +352,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: true, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -366,7 +374,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("TWAP Decrease Long", () => { @@ -412,7 +420,7 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -431,6 +439,7 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params: { ...params, @@ -449,7 +458,7 @@ describe("Decrease Order Payloads", () => { tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: params.collateralDeltaAmount / 4n, tokenTransfers: [ { @@ -465,7 +474,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT / 4n, externalCalls: undefined, }, - }; + } satisfies CreateOrderTxnParams; }); expect(result).toEqual(expectedOrders); @@ -515,14 +524,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("250", USD_DECIMALS)!, // 1000/4 initialCollateralDeltaAmount: params.collateralDeltaAmount / 4n, // 1/4 - triggerPrice: MaxUint256, - acceptablePrice: MaxUint256, + triggerPrice: MaxUint256 as ContractPrice, + acceptablePrice: MaxUint256 as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT / 4n, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -534,6 +543,7 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params: { ...params, @@ -551,7 +561,7 @@ describe("Decrease Order Payloads", () => { tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: params.collateralDeltaAmount / 4n, tokenTransfers: [ { @@ -567,7 +577,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT / 4n, externalCalls: undefined, }, - }; + } satisfies CreateOrderTxnParams; }); expect(result).toEqual(expectedOrders); @@ -595,14 +605,14 @@ describe("Decrease Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: zeroAddress, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -614,12 +624,13 @@ describe("Decrease Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: zeroHash, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -635,7 +646,7 @@ describe("Decrease Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); }); }); diff --git a/sdk/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.ts b/sdk/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.ts index 778df3d6b4..1a4334e475 100644 --- a/sdk/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/exchangeRouterMulticall.spec.ts @@ -10,6 +10,8 @@ import { buildIncreaseOrderPayload, buildUpdateOrderPayload, getBatchOrderMulticallPayload, + IncreasePositionOrderParams, + UpdateOrderParams, } from "utils/orderTransactions"; import { MOCK_GAS_PRICE, mockExternalSwap } from "../../../test/mock"; @@ -55,7 +57,7 @@ describe("Exchange Router Multicall", () => { acceptablePrice: parseValue("1200", USD_DECIMALS)!, // $1200 base price triggerPrice: 0n, externalSwapQuote: undefined, - }; + } satisfies Partial; describe("getBatchOrderMulticallPayload", () => { it("Token transfers with native only payment", () => { @@ -86,12 +88,15 @@ describe("Exchange Router Multicall", () => { ]); expect(result.value).toBe(EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!); - expect(result.encodedMulticall).toEqual([ - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000de111a6b7de4000", - "0x6996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336", - ]); - expect(result.callData).toEqual( - "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000de111a6b7de40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003246996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000000000000000000000000000000000000" + expect(result.encodedMulticall).toMatchInlineSnapshot(` + [ + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000de111a6b7de4000", + "0xf59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000320000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee63360000000000000000000000000000000000000000000000000000000000000000", + ] + `); + + expect(result.callData).toMatchInlineSnapshot( + `"0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d50000000000000000000000000000000000000000000000000de111a6b7de4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000364f59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a000000000000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000320000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"` ); }); @@ -127,13 +132,15 @@ describe("Exchange Router Multicall", () => { ]); expect(result.value).toBe(EXECUTION_FEE_AMOUNT); - expect(result.encodedMulticall).toEqual([ - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", - "0xe6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d5000000000000000000000000000000000000000000000000000000003b9aca00", - "0x6996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a00000000000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336", - ]); - expect(result.callData).toEqual( - "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064e6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d5000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003246996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a00000000000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000000000000000000000000000000000000" + expect(result.encodedMulticall).toMatchInlineSnapshot(` + [ + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", + "0xe6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d5000000000000000000000000000000000000000000000000000000003b9aca00", + "0xf59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a00000000000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000320000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee63360000000000000000000000000000000000000000000000000000000000000000", + ] + `); + expect(result.callData).toMatchInlineSnapshot( + `"0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000018000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064e6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d5000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000364f59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a00000000000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000320000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"` ); }); @@ -152,7 +159,7 @@ describe("Exchange Router Multicall", () => { executionFeeTopUp: EXECUTION_FEE_AMOUNT, indexTokenAddress: WETH.address, validFromTime: 0n, - }; + } satisfies Partial; const updateOrderPayload = buildUpdateOrderPayload(updateParams); const batchParams = { @@ -183,12 +190,14 @@ describe("Exchange Router Multicall", () => { ]); expect(result.value).toBe(EXECUTION_FEE_AMOUNT); - expect(result.encodedMulticall).toEqual([ - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", - "0xdd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - ]); - expect(result.callData).toEqual( - "0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4dd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + expect(result.encodedMulticall).toMatchInlineSnapshot(` + [ + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", + "0xdd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + ] + `); + expect(result.callData).toMatchInlineSnapshot( + `"0xac9650d800000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4dd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"` ); }); @@ -238,7 +247,7 @@ describe("Exchange Router Multicall", () => { executionFeeTopUp: EXECUTION_FEE_AMOUNT, indexTokenAddress: WETH.address, validFromTime: 0n, - }; + } satisfies Partial; const updateOrderPayload = buildUpdateOrderPayload(updateParams); const createOrderPayload1 = buildIncreaseOrderPayload(params1); @@ -318,21 +327,23 @@ describe("Exchange Router Multicall", () => { ]); expect(result.value).toBe(EXECUTION_FEE_AMOUNT * 3n + parseValue("1", WETH.decimals)!); - expect(result.encodedMulticall).toEqual([ - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", - "0x7d39aaf1000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a50000000000000000000000000000000000000000000000000de0b6b3a7640000", - "0xd59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890", - "0x6996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000", - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", - "0xe6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a5000000000000000000000000000000000000000000000000000000003b9aca00", - "0xd59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e6400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890", - "0x6996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000000", - "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", - "0xdd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "0x7489ec231234567890123456789012345678901234567890123456789012345678901235", - ]); - expect(result.callData).toEqual( - "0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000004a000000000000000000000000000000000000000000000000000000000000007e0000000000000000000000000000000000000000000000000000000000000086000000000000000000000000000000000000000000000000000000000000009000000000000000000000000000000000000000000000000000000000000000b400000000000000000000000000000000000000000000000000000000000000e800000000000000000000000000000000000000000000000000000000000000f00000000000000000000000000000000000000000000000000000000000000102000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf1000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a50000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204d59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000000000002000000000000000000000000123456789012345678901234567890123456789000000000000000000000000012345678901234567890123456789012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003046996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064e6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a5000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204d59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e6400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab10000000000000000000000000000000000000000000000000000000000000002000000000000000000000000123456789012345678901234567890123456789000000000000000000000000012345678901234567890123456789012345678900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003046996807b000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e5000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4dd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247489ec23123456789012345678901234567890123456789012345678901234567890123500000000000000000000000000000000000000000000000000000000" + expect(result.encodedMulticall).toMatchInlineSnapshot(` + [ + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", + "0x7d39aaf1000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a50000000000000000000000000000000000000000000000000de0b6b3a7640000", + "0xd59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890", + "0xf59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000300000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", + "0xe6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a5000000000000000000000000000000000000000000000000000000003b9aca00", + "0xd59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e6400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890", + "0xf59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000300000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "0x7d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000", + "0xdd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "0x7489ec231234567890123456789012345678901234567890123456789012345678901235", + ] + `); + expect(result.callData).toMatchInlineSnapshot( + `"0xac9650d80000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000b000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000026000000000000000000000000000000000000000000000000000000000000004a0000000000000000000000000000000000000000000000000000000000000082000000000000000000000000000000000000000000000000000000000000008a000000000000000000000000000000000000000000000000000000000000009400000000000000000000000000000000000000000000000000000000000000b800000000000000000000000000000000000000000000000000000000000000f000000000000000000000000000000000000000000000000000000000000000f8000000000000000000000000000000000000000000000000000000000000010a000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf1000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a50000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204d59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e640000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344f59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000300000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee6336000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a4000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000064e6d66ac8000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e5831000000000000000000000000389cef541397e872dc04421f166b5bc2e0b374a5000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000204d59922b0000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006352a56caadc4f1e25cd6c75970fa768a3304e6400000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e583100000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab1000000000000000000000000000000000000000000000000000000000000000200000000000000000000000012345678901234567890123456789012345678900000000000000000000000001234567890123456789012345678901234567890000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344f59c48eb00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000448d9c199600000000000000000000000000000000000000000000000000000005af3107a400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f2742351cc0eca941ff90bf489789ee6169cbeacfdd38eba60012218fac1b7e50000000000000000000000000000000000000000000000000000000000000300000000000000000000000000123456789012345678901234567890123456789000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000098765432109876543210987654321098765432100000000000000000000000070d95587d40a2caf56bd97485ab3eec10bee633600000000000000000000000082af49447d8a07e3bd95bd0d56f35241523fbab100000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000447d39aaf100000000000000000000000031ef83a530fde1b38ee9a18093a333d8bbbc40d500000000000000000000000000000000000000000000000000005af3107a40000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e4dd5baad21234567890123456789012345678901234567890123456789012345678901234000000000000000000000000000000000000314dc6448d9338c15b0a0000000000000000000000000000000000000000000000000000000000043defc9dca00000000000000000000000000000000000000000000000000000044364c5bb00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000247489ec23123456789012345678901234567890123456789012345678901234567890123500000000000000000000000000000000000000000000000000000000"` ); }); }); diff --git a/sdk/src/utils/__tests__/orderTransactions/increaseOrders.spec.ts b/sdk/src/utils/__tests__/orderTransactions/increaseOrders.spec.ts index c1f922c314..d31e506558 100644 --- a/sdk/src/utils/__tests__/orderTransactions/increaseOrders.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/increaseOrders.spec.ts @@ -6,12 +6,15 @@ import { getContract } from "configs/contracts"; import { MARKETS } from "configs/markets"; import { getTokenBySymbol, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "configs/tokens"; import { DecreasePositionSwapType, OrderType } from "types/orders"; +import { ContractPrice, ERC20Address } from "types/tokens"; import { MaxUint256, parseValue, USD_DECIMALS } from "utils/numbers"; import { buildIncreaseOrderPayload, buildTwapOrdersPayloads, CreateOrderPayload, + CreateOrderTxnParams, getIsTwapOrderPayload, + IncreasePositionOrderParams, } from "utils/orderTransactions"; import { decodeTwapUiFeeReceiver } from "utils/twap/uiFeeReceiver"; @@ -58,7 +61,7 @@ describe("Increase Order Payloads", () => { acceptablePrice: parseValue("1200", USD_DECIMALS)!, // $1200 base price triggerPrice: 0n, externalSwapQuote: undefined, - }; + } satisfies Partial; describe("buildIncreaseOrderPayload", () => { it("Market Increase Long Pay with Native Token", () => { @@ -79,14 +82,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, // $1200 + 0.5% slippage + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, // $1200 + 0.5% slippage executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -98,12 +101,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -119,7 +123,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Increase Short Pay with Native Token", () => { @@ -140,14 +144,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)!, // $1200 - 0.5% slippage + acceptablePrice: parseValue("1194", USD_DECIMALS - WETH.decimals)! as ContractPrice, // $1200 - 0.5% slippage executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -159,12 +163,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -180,7 +185,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Increase Pay with ERC20", () => { @@ -200,14 +205,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -219,12 +224,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, tokenTransfers: [ { @@ -245,7 +251,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Increase with Internal Swap", () => { @@ -267,14 +273,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -286,12 +292,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, tokenTransfers: [ { @@ -312,7 +319,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Increase with External Swap, Pay With Native Token", () => { @@ -343,14 +350,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: 0n, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -362,12 +369,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: 0n, tokenTransfers: [ { @@ -392,10 +400,10 @@ describe("Increase Order Payloads", () => { refundReceivers: [RECEIVER, RECEIVER], refundTokens: [WETH.address, USDC.address], sendAmounts: [parseValue("1", WETH.decimals)!], - sendTokens: [WETH.address], + sendTokens: [WETH.address as ERC20Address], }, }, - }); + } satisfies CreateOrderTxnParams); }); it("Market Increase with External Swap, Pay With ERC20", () => { @@ -426,14 +434,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: 0n, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -445,12 +453,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: 0n, tokenTransfers: [ { @@ -476,10 +485,10 @@ describe("Increase Order Payloads", () => { refundReceivers: [RECEIVER, RECEIVER], refundTokens: [USDC.address, WETH.address], sendAmounts: [parseValue("1000", USDC.decimals)!], - sendTokens: [USDC.address], + sendTokens: [USDC.address as ERC20Address], }, }, - }); + } satisfies CreateOrderTxnParams); }); it("Limit Increase", () => { @@ -501,14 +510,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, - triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)!, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + triggerPrice: parseValue("1200", USD_DECIMALS - WETH.decimals)! as ContractPrice, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -520,12 +529,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -541,7 +551,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("TWAP Increase Long Pay with Native Token", () => { @@ -587,14 +597,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("250", USD_DECIMALS)!, // 1000/4 initialCollateralDeltaAmount: params.payTokenAmount / 4n, // 1/4 - triggerPrice: MaxUint256, - acceptablePrice: MaxUint256, + triggerPrice: MaxUint256 as ContractPrice, + acceptablePrice: MaxUint256 as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT / 4n, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -606,6 +616,7 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params: { ...params, @@ -624,7 +635,7 @@ describe("Increase Order Payloads", () => { tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("0.25", WETH.decimals)!, tokenTransfers: [ { @@ -640,7 +651,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT / 4n + parseValue("0.25", WETH.decimals)!, externalCalls: undefined, }, - }; + } satisfies CreateOrderTxnParams; }); expect(result).toEqual(expectedOrders); @@ -690,7 +701,7 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -709,6 +720,7 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params: { ...params, @@ -727,7 +739,7 @@ describe("Increase Order Payloads", () => { tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: params.payTokenAmount / 4n, tokenTransfers: [ { @@ -743,7 +755,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT / 4n + params.payTokenAmount / 4n, externalCalls: undefined, }, - }; + } satisfies CreateOrderTxnParams; }); expect(result).toEqual(expectedOrders); @@ -771,14 +783,14 @@ describe("Increase Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: zeroAddress, market: params.marketAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: parseValue("1000", USD_DECIMALS)!, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, triggerPrice: 0n, - acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)!, + acceptablePrice: parseValue("1206", USD_DECIMALS - WETH.decimals)! as ContractPrice, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, minOutputAmount: 0n, @@ -790,12 +802,13 @@ describe("Increase Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: zeroHash, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -811,7 +824,7 @@ describe("Increase Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); }); }); diff --git a/sdk/src/utils/__tests__/orderTransactions/swapOrders.spec.ts b/sdk/src/utils/__tests__/orderTransactions/swapOrders.spec.ts index 0aa0dbc2c4..a1856c8aca 100644 --- a/sdk/src/utils/__tests__/orderTransactions/swapOrders.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/swapOrders.spec.ts @@ -1,17 +1,20 @@ import { zeroAddress, zeroHash } from "viem"; -import { describe, expect, it, vi, beforeAll } from "vitest"; +import { beforeAll, describe, expect, it, vi } from "vitest"; import { ARBITRUM } from "configs/chains"; import { getContract } from "configs/contracts"; import { MARKETS } from "configs/markets"; import { getTokenBySymbol, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "configs/tokens"; import { DecreasePositionSwapType, OrderType } from "types/orders"; +import { ContractPrice, ERC20Address } from "types/tokens"; import { parseValue } from "utils/numbers"; import { buildSwapOrderPayload, buildTwapOrdersPayloads, CreateOrderPayload, + CreateOrderTxnParams, getIsTwapOrderPayload, + SwapOrderParams, } from "utils/orderTransactions"; import { decodeTwapUiFeeReceiver } from "utils/twap/uiFeeReceiver"; @@ -45,7 +48,7 @@ describe("Swap Order Payloads", () => { autoCancel: false, externalSwapQuote: undefined, triggerRatio: undefined, - }; + } satisfies Partial; const USDC = getTokenBySymbol(CHAIN_ID, "USDC"); const WETH = getWrappedToken(CHAIN_ID); @@ -53,7 +56,7 @@ describe("Swap Order Payloads", () => { describe("buildSwapOrderPayload", () => { it("Swap Native Token to ERC20", () => { - const params = { + const params: SwapOrderParams = { ...commonParams, payTokenAddress: NATIVE_TOKEN_ADDRESS, payTokenAmount: parseValue("1", WETH.decimals)!, // 1 ETH @@ -74,7 +77,7 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: zeroAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -93,12 +96,13 @@ describe("Swap Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -114,11 +118,11 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("Swap ERC20 to Native Token", () => { - const params = { + const params: SwapOrderParams = { ...commonParams, payTokenAddress: USDC.address, payTokenAmount: parseValue("1000", USDC.decimals)!, // 1000 USDC @@ -139,7 +143,7 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: zeroAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -158,12 +162,13 @@ describe("Swap Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: true, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, tokenTransfers: [ { @@ -184,7 +189,7 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("swap ERC20 to ERC20", () => { @@ -209,7 +214,7 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: zeroAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -228,12 +233,13 @@ describe("Swap Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, tokenTransfers: [ { @@ -254,7 +260,7 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("limit swap with trigger ratio", () => { @@ -280,13 +286,13 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: UI_FEE_RECEIVER, market: zeroAddress, - initialCollateralToken: USDC.address, + initialCollateralToken: USDC.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: 0n, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, - triggerPrice: parseValue("1", 30)!, + triggerPrice: parseValue("1", 30)! as ContractPrice, acceptablePrice: 0n, executionFee: EXECUTION_FEE_AMOUNT, callbackGasLimit: 0n, @@ -299,12 +305,13 @@ describe("Swap Order Payloads", () => { shouldUnwrapNativeToken: false, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params, tokenTransfersParams: { isNativePayment: false, isNativeReceive: false, - initialCollateralTokenAddress: USDC.address, + initialCollateralTokenAddress: USDC.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1000", USDC.decimals)!, tokenTransfers: [ { @@ -325,7 +332,7 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); it("TWAP Swap Native Token to ERC20", () => { @@ -377,13 +384,13 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver, market: zeroAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { sizeDeltaUsd: 0n, initialCollateralDeltaAmount: params.payTokenAmount / 4n, - triggerPrice: parseValue("1", 30)!, + triggerPrice: parseValue("1", 30)! as ContractPrice, acceptablePrice: 0n, executionFee: EXECUTION_FEE_AMOUNT / 4n, callbackGasLimit: 0n, @@ -396,6 +403,7 @@ describe("Swap Order Payloads", () => { shouldUnwrapNativeToken: true, autoCancel: false, referralCode: REFERRAL_CODE, + dataList: [], }, params: { ...params, @@ -410,7 +418,7 @@ describe("Swap Order Payloads", () => { tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: params.payTokenAmount / 4n, tokenTransfers: [ { @@ -426,7 +434,7 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT / 4n + params.payTokenAmount / 4n, externalCalls: undefined, }, - }; + } satisfies CreateOrderTxnParams; }); expect(result).toEqual(expectedOrders); @@ -458,7 +466,7 @@ describe("Swap Order Payloads", () => { callbackContract: zeroAddress, uiFeeReceiver: zeroAddress, market: zeroAddress, - initialCollateralToken: WETH.address, + initialCollateralToken: WETH.address as ERC20Address, swapPath: [ETH_MARKET.marketTokenAddress], }, numbers: { @@ -476,13 +484,14 @@ describe("Swap Order Payloads", () => { isLong: false, shouldUnwrapNativeToken: true, autoCancel: false, + dataList: [], referralCode: zeroHash, }, params, tokenTransfersParams: { isNativePayment: true, isNativeReceive: false, - initialCollateralTokenAddress: WETH.address, + initialCollateralTokenAddress: WETH.address as ERC20Address, initialCollateralDeltaAmount: parseValue("1", WETH.decimals)!, tokenTransfers: [ { @@ -498,7 +507,7 @@ describe("Swap Order Payloads", () => { value: EXECUTION_FEE_AMOUNT + parseValue("1", WETH.decimals)!, externalCalls: undefined, }, - }); + } satisfies CreateOrderTxnParams); }); }); }); diff --git a/sdk/src/utils/__tests__/orderTransactions/updateOrder.spec.ts b/sdk/src/utils/__tests__/orderTransactions/updateOrder.spec.ts index f195d408bd..256bc725f5 100644 --- a/sdk/src/utils/__tests__/orderTransactions/updateOrder.spec.ts +++ b/sdk/src/utils/__tests__/orderTransactions/updateOrder.spec.ts @@ -4,7 +4,7 @@ import { ARBITRUM } from "configs/chains"; import { getTokenBySymbol, getWrappedToken } from "configs/tokens"; import { OrderType } from "types/orders"; import { parseValue, USD_DECIMALS } from "utils/numbers"; -import { buildUpdateOrderPayload } from "utils/orderTransactions"; +import { buildUpdateOrderPayload, UpdateOrderParams } from "utils/orderTransactions"; import { MOCK_GAS_PRICE } from "../../../test/mock"; @@ -23,7 +23,7 @@ describe("Update Order Payloads", () => { describe("buildUpdateOrderPayload", () => { it("Update Limit Swap", () => { - const params = { + const params: UpdateOrderParams = { chainId: CHAIN_ID, orderKey: ORDER_KEY, orderType: OrderType.LimitSwap, @@ -55,7 +55,7 @@ describe("Update Order Payloads", () => { }); it("Update Limit Increase with Execution Fee Top Up", () => { - const params = { + const params: UpdateOrderParams = { chainId: CHAIN_ID, orderKey: ORDER_KEY, orderType: OrderType.LimitIncrease, diff --git a/sdk/src/utils/__tests__/positions.spec.ts b/sdk/src/utils/__tests__/positions.spec.ts index 9a9d51e43c..ce7319425d 100644 --- a/sdk/src/utils/__tests__/positions.spec.ts +++ b/sdk/src/utils/__tests__/positions.spec.ts @@ -2,6 +2,7 @@ import { describe, expect, it, vi, beforeEach, Mock } from "vitest"; import { MarketInfo } from "types/markets"; import { Token } from "types/tokens"; +import { expandDecimals, USD_DECIMALS } from "utils/numbers"; import { bigMath } from "../bigmath"; import { getPositionFee, getPriceImpactForPosition } from "../fees"; @@ -115,9 +116,11 @@ describe("getPositionNetValue", () => { closingFeeUsd: 5n, uiFeeUsd: 20n, pnl: 200n, + totalPendingImpactDeltaUsd: -100n, + priceImpactDiffUsd: 50n, }); - // netValue = 1000n - (10n+15n) -5n -20n + 200n = 1000n -25n -5n -20n +200n=1150n - expect(result).toBe(1150n); + // netValue = 1000n - (10n+15n) -5n -20n + 200n -100n + 50n = 1100n + expect(result).toBe(1100n); }); }); @@ -151,12 +154,17 @@ describe("getLeverage", () => { describe("getLiquidationPrice", () => { beforeEach(() => { (getPositionFee as Mock).mockReturnValue({ positionFeeUsd: 50n }); - (getPriceImpactForPosition as Mock).mockReturnValue(-100n); + (getPriceImpactForPosition as Mock).mockReturnValue({ priceImpactDeltaUsd: -100n, balanceWasImproved: false }); (getIsEquivalentTokens as Mock).mockReturnValue(false); }); it("returns undefined if sizeInUsd <= 0 or sizeInTokens <= 0", () => { - const marketInfo = { indexToken: { decimals: 18 } } as unknown as MarketInfo; + const marketInfo = { + indexToken: { + decimals: 18, + prices: { minPrice: expandDecimals(1, USD_DECIMALS), maxPrice: expandDecimals(1, USD_DECIMALS) }, + }, + } as unknown as MarketInfo; expect( getLiquidationPrice({ sizeInUsd: 0n, @@ -167,6 +175,7 @@ describe("getLiquidationPrice", () => { marketInfo, pendingFundingFeesUsd: 0n, pendingBorrowingFeesUsd: 0n, + pendingImpactAmount: 0n, minCollateralUsd: 100n, isLong: true, userReferralInfo: undefined, @@ -182,6 +191,7 @@ describe("getLiquidationPrice", () => { marketInfo, pendingFundingFeesUsd: 0n, pendingBorrowingFeesUsd: 0n, + pendingImpactAmount: 0n, minCollateralUsd: 100n, isLong: true, userReferralInfo: undefined, @@ -191,10 +201,16 @@ describe("getLiquidationPrice", () => { it("computes liquidation price for non-equivalent tokens and isLong=true", () => { (getIsEquivalentTokens as Mock).mockReturnValue(false); + (convertToUsd as Mock).mockReturnValue(1000n); const marketInfo = { - indexToken: { decimals: 8 }, - minCollateralFactor: 1000n, // 0.001 + indexToken: { + decimals: 8, + prices: { minPrice: expandDecimals(1, USD_DECIMALS), maxPrice: expandDecimals(1, USD_DECIMALS) }, + }, + minCollateralFactorForLiquidation: 1000n, // 0.001 maxPositionImpactFactorForLiquidations: 500n, // 0.005 + maxPositionImpactFactorPositive: 1000n, // 0.01 + maxPositionImpactFactorNegative: 1000n, // 0.01 } as unknown as MarketInfo; const result = getLiquidationPrice({ @@ -206,6 +222,7 @@ describe("getLiquidationPrice", () => { marketInfo, pendingFundingFeesUsd: 0n, pendingBorrowingFeesUsd: 0n, + pendingImpactAmount: 0n, minCollateralUsd: 200n, isLong: true, userReferralInfo: undefined, diff --git a/sdk/src/utils/bigmath.ts b/sdk/src/utils/bigmath.ts index 2bb5552d9b..bdf60def6a 100644 --- a/sdk/src/utils/bigmath.ts +++ b/sdk/src/utils/bigmath.ts @@ -2,8 +2,14 @@ export const bigMath = { abs(x: bigint) { return x < 0n ? -x : x; }, - mulDiv(x: bigint, y: bigint, z: bigint) { - return (x * y) / z; + mulDiv(x: bigint, y: bigint, z: bigint, roundUpMagnitude = false) { + const result = (x * y) / z; + + if (roundUpMagnitude && this.mullmod(x, y, z) > 0n) { + return result + 1n; + } + + return result; }, max(max: bigint, ...rest: bigint[]) { return rest.reduce((currentMax, val) => (currentMax < val ? val : currentMax), max); @@ -33,4 +39,7 @@ export const bigMath = { divRoundUp(x: bigint, y: bigint) { return (x + y - 1n) / y; }, + mullmod(x: bigint, y: bigint, m: bigint): bigint { + return (x * y) % m; + }, }; diff --git a/sdk/src/utils/errors/parseError.ts b/sdk/src/utils/errors/parseError.ts index 4f5d08760f..15b343e697 100644 --- a/sdk/src/utils/errors/parseError.ts +++ b/sdk/src/utils/errors/parseError.ts @@ -228,3 +228,44 @@ function hasStack(error: unknown): error is { stack: string } { function hasName(error: unknown): error is { name: string } { return !!error && typeof error === "object" && typeof (error as { name: string }).name === "string"; } + +export class CustomError extends Error { + isGmxCustomError = true; + args: any; + + constructor({ name, message, args }: { name: string; message: string; args: any }) { + super(message); + this.name = name; + this.args = args; + } +} + +export function isCustomError(error: Error | undefined): error is CustomError { + return (error as CustomError)?.isGmxCustomError === true; +} + +export function getCustomError(error: Error): CustomError | Error { + const data = (error as any)?.info?.error?.data ?? (error as any)?.data; + + let prettyErrorName = error.name; + let prettyErrorMessage = error.message; + let prettyErrorArgs: any = undefined; + + try { + const parsedError = decodeErrorResult({ + abi: abis.CustomErrors, + data: data, + }); + + prettyErrorArgs = parsedError.args; + + prettyErrorName = parsedError.errorName; + prettyErrorMessage = JSON.stringify(parsedError, null, 2); + } catch (decodeError) { + return error; + } + + const prettyError = new CustomError({ name: prettyErrorName, message: prettyErrorMessage, args: prettyErrorArgs }); + + return prettyError; +} diff --git a/sdk/src/utils/fees/executionFee.ts b/sdk/src/utils/fees/executionFee.ts index b8c60f5c07..312ffee183 100644 --- a/sdk/src/utils/fees/executionFee.ts +++ b/sdk/src/utils/fees/executionFee.ts @@ -1,4 +1,4 @@ -import { getExcessiveExecutionFee, getHighExecutionFee, MIN_EXECUTION_FEE_USD } from "configs/chains"; +import { ContractsChainId, getExcessiveExecutionFee, getHighExecutionFee, MIN_EXECUTION_FEE_USD } from "configs/chains"; import { USD_DECIMALS } from "configs/factors"; import { NATIVE_TOKEN_ADDRESS } from "configs/tokens"; import { ExecutionFee, GasLimitsConfig, L1ExpressOrderGasReference } from "types/fees"; @@ -104,23 +104,29 @@ export function estimateBatchGasLimit({ updateOrdersCount, cancelOrdersCount, externalCallsGasLimit, + isGmxAccount, }: { gasLimits: GasLimitsConfig; createOrdersCount: number; updateOrdersCount: number; cancelOrdersCount: number; externalCallsGasLimit: bigint; + isGmxAccount: boolean; }) { const createOrdersGasLimit = gasLimits.createOrderGasLimit * BigInt(createOrdersCount); const updateOrdersGasLimit = gasLimits.updateOrderGasLimit * BigInt(updateOrdersCount); const cancelOrdersGasLimit = gasLimits.cancelOrderGasLimit * BigInt(cancelOrdersCount); + const gmxAccountOverhead = isGmxAccount ? gasLimits.gmxAccountCollateralGasLimit : 0n; - return createOrdersGasLimit + updateOrdersGasLimit + cancelOrdersGasLimit + externalCallsGasLimit; + return ( + createOrdersGasLimit + updateOrdersGasLimit + cancelOrdersGasLimit + externalCallsGasLimit + gmxAccountOverhead + ); } export function estimateBatchMinGasPaymentTokenAmount({ chainId, gasPaymentToken, + isGmxAccount, relayFeeToken, gasPrice, gasLimits, @@ -131,7 +137,8 @@ export function estimateBatchMinGasPaymentTokenAmount({ cancelOrdersCount = 0, executionFeeAmount, }: { - chainId: number; + chainId: ContractsChainId; + isGmxAccount: boolean; gasLimits: GasLimitsConfig; gasPaymentToken: TokenData; relayFeeToken: TokenData; @@ -149,6 +156,7 @@ export function estimateBatchMinGasPaymentTokenAmount({ updateOrdersCount, cancelOrdersCount, externalCallsGasLimit: 0n, + isGmxAccount, }); const relayerGasLimit = estimateRelayerGasLimit({ diff --git a/sdk/src/utils/fees/index.ts b/sdk/src/utils/fees/index.ts index 7db0559759..cd917362a6 100644 --- a/sdk/src/utils/fees/index.ts +++ b/sdk/src/utils/fees/index.ts @@ -12,7 +12,7 @@ export * from "./priceImpact"; export function getSwapFee( marketInfo: MarketInfo, swapAmount: bigint, - forPositiveImpact: boolean, + balanceWasImproved: boolean, isAtomicSwap: boolean ) { let factor: bigint; @@ -20,7 +20,9 @@ export function getSwapFee( if (isAtomicSwap) { factor = marketInfo.atomicSwapFeeFactor; } else { - factor = forPositiveImpact ? marketInfo.swapFeeFactorForPositiveImpact : marketInfo.swapFeeFactorForNegativeImpact; + factor = balanceWasImproved + ? marketInfo.swapFeeFactorForBalanceWasImproved + : marketInfo.swapFeeFactorForBalanceWasNotImproved; } return applyFactor(swapAmount, factor); @@ -29,13 +31,13 @@ export function getSwapFee( export function getPositionFee( marketInfo: MarketInfo, sizeDeltaUsd: bigint, - forPositiveImpact: boolean, + balanceWasImproved: boolean, referralInfo: { totalRebateFactor: bigint; discountFactor: bigint } | undefined, uiFeeFactor?: bigint ) { - const factor = forPositiveImpact - ? marketInfo.positionFeeFactorForPositiveImpact - : marketInfo.positionFeeFactorForNegativeImpact; + const factor = balanceWasImproved + ? marketInfo.positionFeeFactorForBalanceWasImproved + : marketInfo.positionFeeFactorForBalanceWasNotImproved; let positionFeeUsd = applyFactor(sizeDeltaUsd, factor); const uiFeeUsd = applyFactor(sizeDeltaUsd, uiFeeFactor ?? 0n); diff --git a/sdk/src/utils/fees/priceImpact.ts b/sdk/src/utils/fees/priceImpact.ts index 5ea8d7d575..00d403825a 100644 --- a/sdk/src/utils/fees/priceImpact.ts +++ b/sdk/src/utils/fees/priceImpact.ts @@ -69,38 +69,72 @@ export function getCappedPositionImpactUsd( marketInfo: MarketInfo, sizeDeltaUsd: bigint, isLong: boolean, - opts: { fallbackToZero?: boolean } = {} + isIncrease: boolean, + opts: { fallbackToZero?: boolean; shouldCapNegativeImpact?: boolean } = {} ) { - const priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, sizeDeltaUsd, isLong, opts); + sizeDeltaUsd = isIncrease ? sizeDeltaUsd : sizeDeltaUsd * -1n; + + const { priceImpactDeltaUsd, balanceWasImproved } = getPriceImpactForPosition(marketInfo, sizeDeltaUsd, isLong, opts); - if (priceImpactDeltaUsd < 0) { - return priceImpactDeltaUsd; + if (priceImpactDeltaUsd < 0 && !opts.shouldCapNegativeImpact) { + return { priceImpactDeltaUsd, balanceWasImproved }; } - const { indexToken } = marketInfo; + const cappedImpactUsd = capPositionImpactUsdByMaxPriceImpactFactor(marketInfo, sizeDeltaUsd, priceImpactDeltaUsd); + + return { + priceImpactDeltaUsd: cappedImpactUsd, + balanceWasImproved, + }; +} - const impactPoolAmount = marketInfo?.positionImpactPoolAmount; +export function capPositionImpactUsdByMaxImpactPool(marketInfo: MarketInfo, positionImpactDeltaUsd: bigint) { + if (positionImpactDeltaUsd < 0) { + return positionImpactDeltaUsd; + } + const { indexToken } = marketInfo; + const impactPoolAmount = marketInfo.positionImpactPoolAmount; const maxPriceImpactUsdBasedOnImpactPool = convertToUsd( impactPoolAmount, indexToken.decimals, indexToken.prices.minPrice )!; - let cappedImpactUsd = priceImpactDeltaUsd; + if (positionImpactDeltaUsd > maxPriceImpactUsdBasedOnImpactPool) { + positionImpactDeltaUsd = maxPriceImpactUsdBasedOnImpactPool; + } - if (cappedImpactUsd > maxPriceImpactUsdBasedOnImpactPool) { - cappedImpactUsd = maxPriceImpactUsdBasedOnImpactPool; + return positionImpactDeltaUsd; +} + +export function capPositionImpactUsdByMaxPriceImpactFactor( + marketInfo: MarketInfo, + sizeDeltaUsd: bigint, + positionImpactDeltaUsd: bigint +) { + const { maxPositiveImpactFactor, maxNegativeImpactFactor } = getMaxPositionImpactFactors(marketInfo); + + const maxPriceImapctFactor = positionImpactDeltaUsd > 0 ? maxPositiveImpactFactor : maxNegativeImpactFactor; + + const maxPriceImpactUsdBasedOnMaxPriceImpactFactor = applyFactor(bigMath.abs(sizeDeltaUsd), maxPriceImapctFactor); + + if (bigMath.abs(positionImpactDeltaUsd) > maxPriceImpactUsdBasedOnMaxPriceImpactFactor) { + positionImpactDeltaUsd = maxPriceImpactUsdBasedOnMaxPriceImpactFactor * (positionImpactDeltaUsd > 0 ? 1n : -1n); } - const maxPriceImpactFactor = marketInfo.maxPositionImpactFactorPositive; - const maxPriceImpactUsdBasedOnMaxPriceImpactFactor = applyFactor(bigMath.abs(sizeDeltaUsd), maxPriceImpactFactor); + return positionImpactDeltaUsd; +} - if (cappedImpactUsd > maxPriceImpactUsdBasedOnMaxPriceImpactFactor) { - cappedImpactUsd = maxPriceImpactUsdBasedOnMaxPriceImpactFactor; +export function getMaxPositionImpactFactors(marketInfo: MarketInfo) { + let maxPositiveImpactFactor = marketInfo.maxPositionImpactFactorPositive; + const maxNegativeImpactFactor = marketInfo.maxPositionImpactFactorNegative; + + if (maxPositiveImpactFactor > maxNegativeImpactFactor) { + maxPositiveImpactFactor = maxNegativeImpactFactor; } - return cappedImpactUsd; + return { maxPositiveImpactFactor, maxNegativeImpactFactor }; } export function getPriceImpactForPosition( @@ -118,7 +152,7 @@ export function getPriceImpactForPosition( isLong: isLong!, }); - const priceImpactUsd = getPriceImpactUsd({ + const { priceImpactDeltaUsd, balanceWasImproved } = getPriceImpactUsd({ currentLongUsd, currentShortUsd, nextLongUsd, @@ -129,12 +163,18 @@ export function getPriceImpactForPosition( fallbackToZero: opts.fallbackToZero, }); - if (priceImpactUsd > 0) { - return priceImpactUsd; + if (priceImpactDeltaUsd > 0) { + return { + priceImpactDeltaUsd, + balanceWasImproved, + }; } if (bigMath.abs(marketInfo.virtualInventoryForPositions) <= 0) { - return priceImpactUsd; + return { + priceImpactDeltaUsd, + balanceWasImproved, + }; } const virtualInventoryParams = getNextOpenInterestForVirtualInventory({ @@ -143,7 +183,7 @@ export function getPriceImpactForPosition( isLong: isLong!, }); - const priceImpactUsdForVirtualInventory = getPriceImpactUsd({ + const { priceImpactDeltaUsd: priceImpactUsdForVirtualInventory } = getPriceImpactUsd({ currentLongUsd: virtualInventoryParams.currentLongUsd, currentShortUsd: virtualInventoryParams.currentShortUsd, nextLongUsd: virtualInventoryParams.nextLongUsd, @@ -154,7 +194,38 @@ export function getPriceImpactForPosition( fallbackToZero: opts.fallbackToZero, }); - return priceImpactUsdForVirtualInventory < priceImpactUsd! ? priceImpactUsdForVirtualInventory : priceImpactUsd; + return { + priceImpactDeltaUsd: + priceImpactUsdForVirtualInventory < priceImpactDeltaUsd! + ? priceImpactUsdForVirtualInventory + : priceImpactDeltaUsd!, + balanceWasImproved, + }; +} + +export function getProportionalPendingImpactValues({ + sizeInUsd, + pendingImpactAmount, + sizeDeltaUsd, + indexToken, +}: { + sizeInUsd: bigint; + pendingImpactAmount: bigint; + sizeDeltaUsd: bigint; + indexToken: TokenData; +}) { + const proportionalPendingImpactDeltaAmount = + sizeDeltaUsd !== 0n && sizeInUsd !== 0n + ? bigMath.mulDiv(pendingImpactAmount, sizeDeltaUsd, sizeInUsd, pendingImpactAmount < 0n) + : 0n; + + const proportionalPendingImpactDeltaUsd = convertToUsd( + proportionalPendingImpactDeltaAmount, + indexToken.decimals, + proportionalPendingImpactDeltaAmount > 0 ? indexToken.prices.minPrice : indexToken.prices.maxPrice + )!; + + return { proportionalPendingImpactDeltaAmount, proportionalPendingImpactDeltaUsd }; } export function getPriceImpactForSwap( @@ -190,7 +261,7 @@ export function getPriceImpactForSwap( shortDeltaUsd, }); - const priceImpactUsd = getPriceImpactUsd({ + const { priceImpactDeltaUsd, balanceWasImproved } = getPriceImpactUsd({ currentLongUsd: longPoolUsd, currentShortUsd: shortPoolUsd, nextLongUsd: nextLongPoolUsd, @@ -201,15 +272,21 @@ export function getPriceImpactForSwap( fallbackToZero: opts.fallbackToZero, }); - if (priceImpactUsd > 0) { - return priceImpactUsd; + if (priceImpactDeltaUsd > 0) { + return { + priceImpactDeltaUsd, + balanceWasImproved, + }; } const virtualInventoryLong = marketInfo.virtualPoolAmountForLongToken; const virtualInventoryShort = marketInfo.virtualPoolAmountForShortToken; if (virtualInventoryLong <= 0 || virtualInventoryShort <= 0) { - return priceImpactUsd; + return { + priceImpactDeltaUsd, + balanceWasImproved, + }; } const virtualInventoryParams = getNextPoolAmountsParams({ @@ -222,7 +299,7 @@ export function getPriceImpactForSwap( shortDeltaUsd, }); - const priceImpactUsdForVirtualInventory = getPriceImpactUsd({ + const { priceImpactDeltaUsd: priceImpactUsdForVirtualInventory } = getPriceImpactUsd({ currentLongUsd: virtualInventoryParams.longPoolUsd, currentShortUsd: virtualInventoryParams.shortPoolUsd, nextLongUsd: virtualInventoryParams.nextLongPoolUsd, @@ -233,7 +310,13 @@ export function getPriceImpactForSwap( fallbackToZero: opts.fallbackToZero, }); - return priceImpactUsdForVirtualInventory < priceImpactUsd! ? priceImpactUsdForVirtualInventory : priceImpactUsd; + return { + priceImpactDeltaUsd: + priceImpactUsdForVirtualInventory < priceImpactDeltaUsd! + ? priceImpactUsdForVirtualInventory + : priceImpactDeltaUsd!, + balanceWasImproved, + }; } function getNextOpenInterestForVirtualInventory(p: { virtualInventory: bigint; usdDelta: bigint; isLong: boolean }) { @@ -335,7 +418,10 @@ export function getPriceImpactUsd(p: { if (nextLongUsd < 0 || nextShortUsd < 0) { if (p.fallbackToZero) { - return 0n; + return { + priceImpactDeltaUsd: 0n, + balanceWasImproved: false, + }; } else { throw new Error("Negative pool amount"); } @@ -346,13 +432,14 @@ export function getPriceImpactUsd(p: { const isSameSideRebalance = p.currentLongUsd < p.currentShortUsd === nextLongUsd < nextShortUsd; - let impactUsd: bigint; + let priceImpactDeltaUsd: bigint; + const balanceWasImproved = nextDiff < currentDiff; if (isSameSideRebalance) { const hasPositiveImpact = nextDiff < currentDiff; const factor = hasPositiveImpact ? p.factorPositive : p.factorNegative; - impactUsd = calculateImpactForSameSideRebalance({ + priceImpactDeltaUsd = calculateImpactForSameSideRebalance({ currentDiff, nextDiff, hasPositiveImpact, @@ -360,7 +447,7 @@ export function getPriceImpactUsd(p: { exponentFactor: p.exponentFactor, }); } else { - impactUsd = calculateImpactForCrossoverRebalance({ + priceImpactDeltaUsd = calculateImpactForCrossoverRebalance({ currentDiff, nextDiff, factorPositive: p.factorPositive, @@ -369,7 +456,10 @@ export function getPriceImpactUsd(p: { }); } - return impactUsd; + return { + priceImpactDeltaUsd, + balanceWasImproved, + }; } /** diff --git a/sdk/src/utils/gelatoRelay.ts b/sdk/src/utils/gelatoRelay.ts index 510b299e33..aecc33bb35 100644 --- a/sdk/src/utils/gelatoRelay.ts +++ b/sdk/src/utils/gelatoRelay.ts @@ -1,3 +1,5 @@ import { GelatoRelay } from "@gelatonetwork/relay-sdk"; +import noop from "lodash/noop"; export const gelatoRelay = new GelatoRelay(); +gelatoRelay.onError(noop); diff --git a/sdk/src/utils/marketKeysAndConfigs.ts b/sdk/src/utils/marketKeysAndConfigs.ts index 3aa58fd7ae..ab6d9f6c11 100644 --- a/sdk/src/utils/marketKeysAndConfigs.ts +++ b/sdk/src/utils/marketKeysAndConfigs.ts @@ -7,7 +7,11 @@ import { FUNDING_FACTOR_KEY, FUNDING_INCREASE_FACTOR_PER_SECOND, IS_MARKET_DISABLED_KEY, + LENT_POSITION_IMPACT_POOL_AMOUNT_KEY, MAX_FUNDING_FACTOR_PER_SECOND, + MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY, + MAX_LENDABLE_IMPACT_FACTOR_KEY, + MAX_LENDABLE_IMPACT_USD_KEY, MAX_OPEN_INTEREST_KEY, MAX_PNL_FACTOR_FOR_TRADERS_KEY, MAX_PNL_FACTOR_KEY, @@ -15,6 +19,7 @@ import { MAX_POOL_USD_FOR_DEPOSIT_KEY, MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY, MAX_POSITION_IMPACT_FACTOR_KEY, + MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY, MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, MIN_COLLATERAL_FACTOR_KEY, MIN_FUNDING_FACTOR_PER_SECOND, @@ -161,11 +166,11 @@ export function hashMarketConfigKeys(market: MarketConfig) { ["bytes32", "bytes32", "address", "bool"], [MAX_PNL_FACTOR_KEY, MAX_PNL_FACTOR_FOR_TRADERS_KEY, marketAddress, false], ], - positionFeeFactorForPositiveImpact: [ + positionFeeFactorForBalanceWasImproved: [ ["bytes32", "address", "bool"], [POSITION_FEE_FACTOR_KEY, marketAddress, true], ], - positionFeeFactorForNegativeImpact: [ + positionFeeFactorForBalanceWasNotImproved: [ ["bytes32", "address", "bool"], [POSITION_FEE_FACTOR_KEY, marketAddress, false], ], @@ -189,10 +194,30 @@ export function hashMarketConfigKeys(market: MarketConfig) { ["bytes32", "address"], [MAX_POSITION_IMPACT_FACTOR_FOR_LIQUIDATIONS_KEY, marketAddress], ], + maxLendableImpactFactor: [ + ["bytes32", "address"], + [MAX_LENDABLE_IMPACT_FACTOR_KEY, marketAddress], + ], + maxLendableImpactFactorForWithdrawals: [ + ["bytes32", "address"], + [MAX_LENDABLE_IMPACT_FACTOR_FOR_WITHDRAWALS_KEY, marketAddress], + ], + maxLendableImpactUsd: [ + ["bytes32", "address"], + [MAX_LENDABLE_IMPACT_USD_KEY, marketAddress], + ], + lentPositionImpactPoolAmount: [ + ["bytes32", "address"], + [LENT_POSITION_IMPACT_POOL_AMOUNT_KEY, marketAddress], + ], minCollateralFactor: [ ["bytes32", "address"], [MIN_COLLATERAL_FACTOR_KEY, marketAddress], ], + minCollateralFactorForLiquidation: [ + ["bytes32", "address"], + [MIN_COLLATERAL_FACTOR_FOR_LIQUIDATION_KEY, marketAddress], + ], minCollateralFactorForOpenInterestLong: [ ["bytes32", "address", "bool"], [MIN_COLLATERAL_FACTOR_FOR_OPEN_INTEREST_MULTIPLIER_KEY, marketAddress, true], @@ -205,11 +230,11 @@ export function hashMarketConfigKeys(market: MarketConfig) { ["bytes32", "address"], [POSITION_IMPACT_EXPONENT_FACTOR_KEY, marketAddress], ], - swapFeeFactorForPositiveImpact: [ + swapFeeFactorForBalanceWasImproved: [ ["bytes32", "address", "bool"], [SWAP_FEE_FACTOR_KEY, marketAddress, true], ], - swapFeeFactorForNegativeImpact: [ + swapFeeFactorForBalanceWasNotImproved: [ ["bytes32", "address", "bool"], [SWAP_FEE_FACTOR_KEY, marketAddress, false], ], diff --git a/sdk/src/utils/orderTransactions.ts b/sdk/src/utils/orderTransactions.ts index 42299723c5..8c2febd5f3 100644 --- a/sdk/src/utils/orderTransactions.ts +++ b/sdk/src/utils/orderTransactions.ts @@ -2,8 +2,9 @@ import uniq from "lodash/uniq"; import { encodeFunctionData, zeroAddress, zeroHash } from "viem"; import ExchangeRouterAbi from "abis/ExchangeRouter.json"; +import { abis } from "abis/index"; import ERC20ABI from "abis/Token.json"; -import { getExcessiveExecutionFee, getHighExecutionFee } from "configs/chains"; +import { ContractsChainId, getExcessiveExecutionFee, getHighExecutionFee } from "configs/chains"; import { getContract } from "configs/contracts"; import { convertTokenAddress, getToken, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "configs/tokens"; import { ExecutionFee } from "types/fees"; @@ -78,10 +79,11 @@ export type CreateOrderPayload = { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: string; + dataList: string[]; }; export type UpdateOrderParams = { - chainId: number; + chainId: ContractsChainId; indexTokenAddress: string; orderKey: string; orderType: OrderType; @@ -139,7 +141,7 @@ export type ExternalCallsPayload = { }; export type CommonOrderParams = { - chainId: number; + chainId: ContractsChainId; receiver: string; executionFeeAmount: bigint; executionGasLimit: bigint; @@ -231,6 +233,7 @@ export function buildSwapOrderPayload(p: SwapOrderParams): CreateOrderTxnParams< shouldUnwrapNativeToken: tokenTransfersParams.isNativePayment || tokenTransfersParams.isNativeReceive, autoCancel: p.autoCancel, referralCode: p.referralCode ?? zeroHash, + dataList: [], }; return { @@ -294,6 +297,7 @@ export function buildIncreaseOrderPayload( shouldUnwrapNativeToken: tokenTransfersParams.isNativePayment, autoCancel: p.autoCancel, referralCode: p.referralCode ?? zeroHash, + dataList: [], }; return { @@ -352,6 +356,7 @@ export function buildDecreaseOrderPayload( shouldUnwrapNativeToken: p.receiveTokenAddress === NATIVE_TOKEN_ADDRESS, autoCancel: p.autoCancel, referralCode: p.referralCode ?? zeroHash, + dataList: [], }; return { @@ -566,7 +571,7 @@ export function buildTokenTransfersParamsForDecrease({ minOutputUsd, receiveTokenAddress, }: { - chainId: number; + chainId: ContractsChainId; executionFeeAmount: bigint; collateralTokenAddress: string; collateralDeltaAmount: bigint; @@ -610,7 +615,7 @@ export function buildTokenTransfersParamsForIncreaseOrSwap({ minOutputAmount, swapPath, }: { - chainId: number; + chainId: ContractsChainId; receiver: string; payTokenAddress: string; payTokenAmount: bigint; @@ -903,7 +908,7 @@ export function buildCancelOrderMulticall({ params }: { params: CancelOrderTxnPa export function encodeExchangeRouterMulticall(multicall: ExchangeRouterCall[]) { const encodedMulticall = multicall.map((call) => encodeFunctionData({ - abi: ExchangeRouterAbi.abi, + abi: abis.ExchangeRouter, functionName: call.method, args: call.params, }) diff --git a/sdk/src/utils/positions.ts b/sdk/src/utils/positions.ts index 0ac672232d..92f3d4976d 100644 --- a/sdk/src/utils/positions.ts +++ b/sdk/src/utils/positions.ts @@ -1,12 +1,20 @@ import { BASIS_POINTS_DIVISOR_BIGINT } from "configs/factors"; import { MarketInfo } from "types/markets"; +import { PositionInfoLoaded } from "types/positions"; import { UserReferralInfo } from "types/referrals"; import { Token, TokenData } from "types/tokens"; import { bigMath } from "./bigmath"; -import { getPositionFee, getPriceImpactForPosition } from "./fees"; -import { getCappedPoolPnl, getMarketPnl, getPoolUsdWithoutPnl } from "./markets"; -import { applyFactor, expandDecimals } from "./numbers"; +import { + capPositionImpactUsdByMaxImpactPool, + capPositionImpactUsdByMaxPriceImpactFactor, + getMaxPositionImpactFactors, + getPositionFee, + getPriceImpactForPosition, + getProportionalPendingImpactValues, +} from "./fees"; +import { getCappedPoolPnl, getMarketPnl, getOpenInterestUsd, getPoolUsdWithoutPnl } from "./markets"; +import { applyFactor, expandDecimals, PRECISION } from "./numbers"; import { convertToUsd, getIsEquivalentTokens } from "./tokens"; export function getPositionKey(account: string, marketAddress: string, collateralAddress: string, isLong: boolean) { @@ -78,6 +86,8 @@ export function getPositionPendingFeesUsd(p: { pendingFundingFeesUsd: bigint; pe } export function getPositionNetValue(p: { + totalPendingImpactDeltaUsd: bigint; + priceImpactDiffUsd: bigint; collateralUsd: bigint; pendingFundingFeesUsd: bigint; pendingBorrowingFeesUsd: bigint; @@ -85,11 +95,42 @@ export function getPositionNetValue(p: { closingFeeUsd: bigint; uiFeeUsd: bigint; }) { - const { pnl, closingFeeUsd, collateralUsd, uiFeeUsd } = p; + const { pnl, closingFeeUsd, collateralUsd, uiFeeUsd, totalPendingImpactDeltaUsd, priceImpactDiffUsd } = p; const pendingFeesUsd = getPositionPendingFeesUsd(p); - return collateralUsd - pendingFeesUsd - closingFeeUsd - uiFeeUsd + pnl; + return ( + collateralUsd - pendingFeesUsd - closingFeeUsd - uiFeeUsd + pnl + totalPendingImpactDeltaUsd + priceImpactDiffUsd + ); +} + +export function getPositionPnlAfterFees({ + pnl, + pendingBorrowingFeesUsd, + pendingFundingFeesUsd, + closingFeeUsd, + uiFeeUsd, + totalPendingImpactDeltaUsd, + priceImpactDiffUsd, +}: { + pnl: bigint; + pendingBorrowingFeesUsd: bigint; + pendingFundingFeesUsd: bigint; + closingFeeUsd: bigint; + uiFeeUsd: bigint; + totalPendingImpactDeltaUsd: bigint; + priceImpactDiffUsd: bigint; +}) { + const pnlAfterFees = + pnl - + pendingBorrowingFeesUsd - + pendingFundingFeesUsd - + closingFeeUsd - + uiFeeUsd + + totalPendingImpactDeltaUsd + + priceImpactDiffUsd; + + return pnlAfterFees; } export function getLeverage(p: { @@ -121,6 +162,7 @@ export function getLiquidationPrice(p: { marketInfo: MarketInfo; pendingFundingFeesUsd: bigint; pendingBorrowingFeesUsd: bigint; + pendingImpactAmount: bigint; minCollateralUsd: bigint; isLong: boolean; useMaxPriceImpact?: boolean; @@ -135,6 +177,7 @@ export function getLiquidationPrice(p: { collateralToken, pendingFundingFeesUsd, pendingBorrowingFeesUsd, + pendingImpactAmount, minCollateralUsd, isLong, userReferralInfo, @@ -158,19 +201,29 @@ export function getLiquidationPrice(p: { if (useMaxPriceImpact) { priceImpactDeltaUsd = maxNegativePriceImpactUsd; } else { - priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { fallbackToZero: true }); + const priceImapctForPosition = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { fallbackToZero: true }); + priceImpactDeltaUsd = priceImapctForPosition.priceImpactDeltaUsd; - if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { - priceImpactDeltaUsd = maxNegativePriceImpactUsd; + if (priceImpactDeltaUsd > 0) { + priceImpactDeltaUsd = capPositionImpactUsdByMaxPriceImpactFactor(marketInfo, sizeInUsd, priceImpactDeltaUsd); } - // Ignore positive price impact + const pendingImpactUsd = convertToUsd( + pendingImpactAmount, + marketInfo.indexToken.decimals, + pendingImpactAmount > 0 ? marketInfo.indexToken.prices.minPrice : marketInfo.indexToken.prices.maxPrice + )!; + + priceImpactDeltaUsd = priceImpactDeltaUsd + pendingImpactUsd; + if (priceImpactDeltaUsd > 0) { priceImpactDeltaUsd = 0n; + } else if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { + priceImpactDeltaUsd = maxNegativePriceImpactUsd; } } - let liquidationCollateralUsd = applyFactor(sizeInUsd, marketInfo.minCollateralFactor); + let liquidationCollateralUsd = applyFactor(sizeInUsd, marketInfo.minCollateralFactorForLiquidation); if (liquidationCollateralUsd < minCollateralUsd) { liquidationCollateralUsd = minCollateralUsd; } @@ -223,3 +276,67 @@ export function getLiquidationPrice(p: { return liquidationPrice; } + +export function getNetPriceImpactDeltaUsdForDecrease({ + marketInfo, + sizeInUsd, + pendingImpactAmount, + priceImpactDeltaUsd, + sizeDeltaUsd, +}: { + marketInfo: MarketInfo; + sizeInUsd: bigint; + pendingImpactAmount: bigint; + sizeDeltaUsd: bigint; + priceImpactDeltaUsd: bigint; +}) { + const { proportionalPendingImpactDeltaUsd } = getProportionalPendingImpactValues({ + sizeInUsd, + sizeDeltaUsd, + pendingImpactAmount, + indexToken: marketInfo.indexToken, + }); + + let totalImpactDeltaUsd = priceImpactDeltaUsd + proportionalPendingImpactDeltaUsd; + let priceImpactDiffUsd = 0n; + + if (totalImpactDeltaUsd < 0) { + const { maxNegativeImpactFactor } = getMaxPositionImpactFactors(marketInfo); + + const maxNegativeImpactUsd = -applyFactor(sizeDeltaUsd, maxNegativeImpactFactor); + + if (totalImpactDeltaUsd < maxNegativeImpactUsd) { + priceImpactDiffUsd = maxNegativeImpactUsd - totalImpactDeltaUsd; + } + } + + if (totalImpactDeltaUsd > 0) { + totalImpactDeltaUsd = capPositionImpactUsdByMaxPriceImpactFactor(marketInfo, sizeDeltaUsd, totalImpactDeltaUsd); + } + + totalImpactDeltaUsd = capPositionImpactUsdByMaxImpactPool(marketInfo, totalImpactDeltaUsd); + + return { + totalImpactDeltaUsd, + proportionalPendingImpactDeltaUsd, + priceImpactDiffUsd, + }; +} + +export function getMinCollateralFactorForPosition(position: PositionInfoLoaded, openInterestDelta: bigint) { + const marketInfo = position.marketInfo; + + const isLong = position.isLong; + const openInterest = getOpenInterestUsd(marketInfo, isLong) + openInterestDelta; + const minCollateralFactorMultiplier = isLong + ? marketInfo.minCollateralFactorForOpenInterestLong + : marketInfo.minCollateralFactorForOpenInterestShort; + let minCollateralFactor = bigMath.mulDiv(openInterest, minCollateralFactorMultiplier, PRECISION); + const minCollateralFactorForMarket = marketInfo.minCollateralFactor; + + if (minCollateralFactorForMarket > minCollateralFactor) { + minCollateralFactor = minCollateralFactorForMarket; + } + + return minCollateralFactor; +} diff --git a/sdk/src/utils/prices.ts b/sdk/src/utils/prices.ts index 22e1801a39..d3841b84ac 100644 --- a/sdk/src/utils/prices.ts +++ b/sdk/src/utils/prices.ts @@ -9,7 +9,6 @@ import { getPriceImpactByAcceptablePrice } from "./fees"; import { getCappedPositionImpactUsd } from "./fees"; import { expandDecimals, getBasisPoints } from "./numbers"; import { roundUpMagnitudeDivision } from "./numbers"; -import { applyFactor } from "./numbers"; import { convertToTokenAmount } from "./tokens"; export function getMarkPrice(p: { prices: TokenPrices; isIncrease: boolean; isLong: boolean }) { @@ -51,20 +50,24 @@ export function getOrderThresholdType(orderType: OrderType, isLong: boolean) { export function getAcceptablePriceInfo(p: { marketInfo: MarketInfo; isIncrease: boolean; + isLimit: boolean; isLong: boolean; indexPrice: bigint; sizeDeltaUsd: bigint; maxNegativePriceImpactBps?: bigint; }) { - const { marketInfo, isIncrease, isLong, indexPrice, sizeDeltaUsd, maxNegativePriceImpactBps } = p; + const { marketInfo, isIncrease, isLong, isLimit, indexPrice, sizeDeltaUsd, maxNegativePriceImpactBps } = p; const { indexToken } = marketInfo; const values = { acceptablePrice: 0n, acceptablePriceDeltaBps: 0n, + cappedPriceImpactDeltaUsd: 0n, + cappedPriceImpactDeltaAmount: 0n, priceImpactDeltaAmount: 0n, priceImpactDeltaUsd: 0n, priceImpactDiffUsd: 0n, + balanceWasImproved: false, }; if (sizeDeltaUsd <= 0 || indexPrice == 0n) { @@ -95,23 +98,24 @@ export function getAcceptablePriceInfo(p: { return values; } - values.priceImpactDeltaUsd = getCappedPositionImpactUsd( + const { priceImpactDeltaUsd, balanceWasImproved } = getCappedPositionImpactUsd( marketInfo, - isIncrease ? sizeDeltaUsd : sizeDeltaUsd * -1n, + sizeDeltaUsd, isLong, + isIncrease, { fallbackToZero: !isIncrease, + shouldCapNegativeImpact: isIncrease && !isLimit, } ); - if (!isIncrease && values.priceImpactDeltaUsd < 0) { - const minPriceImpactUsd = applyFactor(sizeDeltaUsd, marketInfo.maxPositionImpactFactorNegative) * -1n; - - if (values.priceImpactDeltaUsd < minPriceImpactUsd) { - values.priceImpactDiffUsd = minPriceImpactUsd - values.priceImpactDeltaUsd; - values.priceImpactDeltaUsd = minPriceImpactUsd; - } - } + /** + * We display this value as price impact on action (increase or decrease) + * But for acceptable price calculation uncapped price impact is used + * Also on decrease action we calculate totalImpactUsd which will be deducted from the collateral + */ + values.priceImpactDeltaUsd = priceImpactDeltaUsd; + values.balanceWasImproved = balanceWasImproved; if (values.priceImpactDeltaUsd > 0) { values.priceImpactDeltaAmount = convertToTokenAmount( @@ -126,12 +130,24 @@ export function getAcceptablePriceInfo(p: { ); } + // Use uncapped price impact for the acceptable price calculation + const { priceImpactDeltaUsd: priceImpactDeltaUsdForAcceptablePrice } = getCappedPositionImpactUsd( + marketInfo, + sizeDeltaUsd, + isLong, + isIncrease, + { + fallbackToZero: !isIncrease, + shouldCapNegativeImpact: false, + } + ); + const acceptablePriceValues = getAcceptablePriceByPriceImpact({ isIncrease, isLong, indexPrice, sizeDeltaUsd, - priceImpactDeltaUsd: values.priceImpactDeltaUsd, + priceImpactDeltaUsd: priceImpactDeltaUsdForAcceptablePrice, }); values.acceptablePrice = acceptablePriceValues.acceptablePrice; diff --git a/sdk/src/utils/swap/__tests__/mockRouting.spec.ts b/sdk/src/utils/swap/__tests__/mockRouting.spec.ts index 4b72361564..0b737fba90 100644 --- a/sdk/src/utils/swap/__tests__/mockRouting.spec.ts +++ b/sdk/src/utils/swap/__tests__/mockRouting.spec.ts @@ -56,6 +56,7 @@ const baseGasLimits: GasLimitsConfig = { cancelOrderGasLimit: 1000000n, gelatoRelayFeeMultiplierFactor: 1000000000000000000000000000000n, tokenPermitGasLimit: 1000000n, + gmxAccountCollateralGasLimit: 0n, }; const baseGasPrice = 1650000002n; diff --git a/sdk/src/utils/swap/swapStats.ts b/sdk/src/utils/swap/swapStats.ts index c9f1612dea..f4af1c987d 100644 --- a/sdk/src/utils/swap/swapStats.ts +++ b/sdk/src/utils/swap/swapStats.ts @@ -230,9 +230,12 @@ export function getSwapStats(p: { const amountIn = convertToTokenAmount(usdIn, tokenIn.decimals, priceIn)!; let priceImpactDeltaUsd: bigint; + let balanceWasImproved: boolean; try { - priceImpactDeltaUsd = getPriceImpactForSwap(marketInfo, tokenIn, tokenOut, usdIn, usdIn * -1n); + const priceImpactValues = getPriceImpactForSwap(marketInfo, tokenIn, tokenOut, usdIn, usdIn * -1n); + priceImpactDeltaUsd = priceImpactValues.priceImpactDeltaUsd; + balanceWasImproved = priceImpactValues.balanceWasImproved; } catch (e) { // Approximate if the market would be out of capacity const capacityUsd = getSwapCapacityUsd(marketInfo, getTokenPoolType(marketInfo, tokenInAddress) === "long"); @@ -259,8 +262,8 @@ export function getSwapStats(p: { }; } - const swapFeeAmount = getSwapFee(marketInfo, amountIn, priceImpactDeltaUsd > 0, isAtomicSwap); - const swapFeeUsd = getSwapFee(marketInfo, usdIn, priceImpactDeltaUsd > 0, isAtomicSwap); + const swapFeeAmount = getSwapFee(marketInfo, amountIn, balanceWasImproved, isAtomicSwap); + const swapFeeUsd = getSwapFee(marketInfo, usdIn, balanceWasImproved, isAtomicSwap); const amountInAfterFees = amountIn - swapFeeAmount; const usdInAfterFees = usdIn - swapFeeUsd; diff --git a/src/domain/synthetics/trade/utils/decrease.ts b/sdk/src/utils/trade/decrease.ts similarity index 81% rename from src/domain/synthetics/trade/utils/decrease.ts rename to sdk/src/utils/trade/decrease.ts index 72370859f0..308cb967e5 100644 --- a/src/domain/synthetics/trade/utils/decrease.ts +++ b/sdk/src/utils/trade/decrease.ts @@ -1,32 +1,36 @@ -import { ethers } from "ethers"; - -import { BASIS_POINTS_DIVISOR_BIGINT, DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER } from "config/factors"; -import { UserReferralInfo } from "domain/referrals"; -import { getPositionFee } from "domain/synthetics/fees"; -import { MarketInfo } from "domain/synthetics/markets"; -import { DecreasePositionSwapType, OrderType } from "domain/synthetics/orders"; +import { DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER } from "configs/factors"; +import { MarketInfo } from "types/markets"; +import { DecreasePositionSwapType, OrderType } from "types/orders"; +import { PositionInfo, PositionInfoLoaded } from "types/positions"; +import { UserReferralInfo } from "types/referrals"; +import { TokenData } from "types/tokens"; +import { DecreasePositionAmounts, NextPositionValues } from "types/trade"; +import { bigMath } from "utils/bigmath"; +import { getPositionFee } from "utils/fees"; +import { + applyFactor, + BASIS_POINTS_DIVISOR_BIGINT, + expandDecimals, + getBasisPoints, + roundUpDivision, + USD_DECIMALS, + MaxUint256, +} from "utils/numbers"; import { - PositionInfo, - PositionInfoLoaded, getLeverage, getLiquidationPrice, getMinCollateralFactorForPosition, + getNetPriceImpactDeltaUsdForDecrease, getPositionPnlUsd, -} from "domain/synthetics/positions"; -import { TokenData, convertToTokenAmount, convertToUsd } from "domain/synthetics/tokens"; -import { DUST_USD } from "lib/legacy"; -import { applyFactor, getBasisPoints, roundUpDivision } from "lib/numbers"; -import { DecreasePositionAmounts, NextPositionValues } from "sdk/types/trade"; -import { bigMath } from "sdk/utils/bigmath"; -import { getSwapStats } from "sdk/utils/swap/swapStats"; -import { getIsEquivalentTokens } from "sdk/utils/tokens"; - +} from "utils/positions"; import { getAcceptablePriceInfo, getDefaultAcceptablePriceImpactBps, getMarkPrice, getOrderThresholdType, -} from "./prices"; +} from "utils/prices"; +import { getSwapStats } from "utils/swap"; +import { convertToTokenAmount, convertToUsd, getIsEquivalentTokens } from "utils/tokens"; export function getDecreasePositionAmounts(p: { marketInfo: MarketInfo; @@ -81,8 +85,11 @@ export function getDecreasePositionAmounts(p: { triggerPrice: 0n, acceptablePrice: 0n, - positionPriceImpactDeltaUsd: 0n, + proportionalPendingImpactDeltaUsd: 0n, + closePriceImpactDeltaUsd: 0n, + totalPendingImpactDeltaUsd: 0n, priceImpactDiffUsd: 0n, + balanceWasImproved: false, acceptablePriceDeltaBps: 0n, recommendedAcceptablePriceDeltaBps: 0n, @@ -139,6 +146,7 @@ export function getDecreasePositionAmounts(p: { if (!position || position.sizeInUsd <= 0 || position.sizeInTokens <= 0) { applyAcceptablePrice({ + position, marketInfo, isLong, isTrigger, @@ -150,7 +158,7 @@ export function getDecreasePositionAmounts(p: { const positionFeeInfo = getPositionFee( marketInfo, values.sizeDeltaUsd, - values.positionPriceImpactDeltaUsd > 0, + values.balanceWasImproved, userReferralInfo ); @@ -158,11 +166,16 @@ export function getDecreasePositionAmounts(p: { values.feeDiscountUsd = positionFeeInfo.discountUsd; values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); - const totalFeesUsd = - 0n + - values.positionFeeUsd + - values.uiFeeUsd + - (values.positionPriceImpactDeltaUsd < 0 ? values.positionPriceImpactDeltaUsd : 0n); + const totalFeesUsd = getTotalFeesUsdForDecrease({ + positionFeeUsd: values.positionFeeUsd, + borrowingFeeUsd: 0n, + fundingFeeUsd: 0n, + swapProfitFeeUsd: 0n, + swapUiFeeUsd: 0n, + uiFeeUsd: values.uiFeeUsd, + pnlUsd: 0n, + totalPendingImpactDeltaUsd: values.totalPendingImpactDeltaUsd, + }); values.payedOutputUsd = totalFeesUsd; @@ -217,6 +230,7 @@ export function getDecreasePositionAmounts(p: { estimatedCollateralUsd !== 0n ? getBasisPoints(values.estimatedPnl, estimatedCollateralUsd) : 0n; applyAcceptablePrice({ + position, marketInfo, isLong, isTrigger, @@ -230,18 +244,13 @@ export function getDecreasePositionAmounts(p: { if (values.realizedPnl > 0) { profitUsd = profitUsd + values.realizedPnl; } - if (values.positionPriceImpactDeltaUsd > 0) { - profitUsd = profitUsd + values.positionPriceImpactDeltaUsd; + if (values.totalPendingImpactDeltaUsd > 0) { + profitUsd = profitUsd + values.totalPendingImpactDeltaUsd; } const profitAmount = convertToTokenAmount(profitUsd, collateralToken.decimals, values.collateralPrice)!; // Fees - const positionFeeInfo = getPositionFee( - marketInfo, - values.sizeDeltaUsd, - values.positionPriceImpactDeltaUsd > 0, - userReferralInfo - ); + const positionFeeInfo = getPositionFee(marketInfo, values.sizeDeltaUsd, values.balanceWasImproved, userReferralInfo); const estimatedPositionFeeCost = estimateCollateralCost( positionFeeInfo.positionFeeUsd, collateralToken, @@ -289,21 +298,16 @@ export function getDecreasePositionAmounts(p: { values.swapProfitFeeUsd = 0n; } - const negativePnlUsd = values.realizedPnl < 0 ? bigMath.abs(values.realizedPnl) : 0n; - const negativePriceImpactUsd = - values.positionPriceImpactDeltaUsd < 0 ? bigMath.abs(values.positionPriceImpactDeltaUsd) : 0n; - const priceImpactDiffUsd = values.priceImpactDiffUsd > 0 ? values.priceImpactDiffUsd : 0n; - - const totalFeesUsd = - values.positionFeeUsd + - values.borrowingFeeUsd + - values.fundingFeeUsd + - values.swapProfitFeeUsd + - values.swapUiFeeUsd + - values.uiFeeUsd + - negativePnlUsd + - negativePriceImpactUsd + - priceImpactDiffUsd; + const totalFeesUsd = getTotalFeesUsdForDecrease({ + positionFeeUsd: values.positionFeeUsd, + borrowingFeeUsd: values.borrowingFeeUsd, + fundingFeeUsd: values.fundingFeeUsd, + swapProfitFeeUsd: values.swapProfitFeeUsd, + swapUiFeeUsd: values.swapUiFeeUsd, + uiFeeUsd: values.uiFeeUsd, + pnlUsd: values.realizedPnl, + totalPendingImpactDeltaUsd: values.totalPendingImpactDeltaUsd, + }); const payedInfo = payForCollateralCost({ initialCostUsd: totalFeesUsd, @@ -321,8 +325,6 @@ export function getDecreasePositionAmounts(p: { values.collateralPrice )!; - values.receiveTokenAmount = payedInfo.outputAmount; - // Collateral delta if (values.isFullClose) { values.collateralDeltaUsd = estimatedCollateralUsd; @@ -384,7 +386,7 @@ export function getIsFullClose(p: { const { position, sizeDeltaUsd, indexPrice, remainingCollateralUsd, minCollateralUsd, minPositionSizeUsd } = p; const { marketInfo, isLong } = position; - if (position.sizeInUsd - sizeDeltaUsd < DUST_USD) { + if (position.sizeInUsd - sizeDeltaUsd < expandDecimals(1, USD_DECIMALS)) { return true; } @@ -486,6 +488,7 @@ export function payForCollateralCost(p: { } function applyAcceptablePrice(p: { + position: PositionInfoLoaded | undefined; marketInfo: MarketInfo; isLong: boolean; isTrigger: boolean; @@ -493,27 +496,48 @@ function applyAcceptablePrice(p: { acceptablePriceImpactBuffer?: number; values: DecreasePositionAmounts; }) { - const { marketInfo, isLong, values, isTrigger, fixedAcceptablePriceImpactBps, acceptablePriceImpactBuffer } = p; + const { + position, + marketInfo, + isLong, + values, + isTrigger, + fixedAcceptablePriceImpactBps, + acceptablePriceImpactBuffer, + } = p; const acceptablePriceInfo = getAcceptablePriceInfo({ marketInfo, isIncrease: false, + isLimit: false, isLong, indexPrice: values.indexPrice, sizeDeltaUsd: values.sizeDeltaUsd, }); - values.positionPriceImpactDeltaUsd = acceptablePriceInfo.priceImpactDeltaUsd; values.acceptablePrice = acceptablePriceInfo.acceptablePrice; values.acceptablePriceDeltaBps = acceptablePriceInfo.acceptablePriceDeltaBps; - values.priceImpactDiffUsd = acceptablePriceInfo.priceImpactDiffUsd; + values.balanceWasImproved = acceptablePriceInfo.balanceWasImproved; + + const totalImpactValues = getNetPriceImpactDeltaUsdForDecrease({ + marketInfo, + sizeInUsd: position?.sizeInUsd ?? 0n, + pendingImpactAmount: position?.pendingImpactAmount ?? 0n, + sizeDeltaUsd: values.sizeDeltaUsd, + priceImpactDeltaUsd: acceptablePriceInfo.priceImpactDeltaUsd, + }); + + values.closePriceImpactDeltaUsd = acceptablePriceInfo.priceImpactDeltaUsd; + values.totalPendingImpactDeltaUsd = totalImpactValues.totalImpactDeltaUsd; + values.proportionalPendingImpactDeltaUsd = totalImpactValues.proportionalPendingImpactDeltaUsd; + values.priceImpactDiffUsd = totalImpactValues.priceImpactDiffUsd; if (isTrigger) { if (values.triggerOrderType === OrderType.StopLossDecrease) { if (isLong) { values.acceptablePrice = 0n; } else { - values.acceptablePrice = ethers.MaxUint256; + values.acceptablePrice = MaxUint256; } } else { let maxNegativePriceImpactBps = fixedAcceptablePriceImpactBps; @@ -522,7 +546,7 @@ function applyAcceptablePrice(p: { isLong, indexPrice: values.indexPrice, sizeDeltaUsd: values.sizeDeltaUsd, - priceImpactDeltaUsd: values.positionPriceImpactDeltaUsd, + priceImpactDeltaUsd: values.closePriceImpactDeltaUsd, acceptablePriceImapctBuffer: acceptablePriceImpactBuffer || DEFAULT_ACCEPTABLE_PRICE_IMPACT_BUFFER, }); @@ -533,6 +557,7 @@ function applyAcceptablePrice(p: { const triggerAcceptablePriceInfo = getAcceptablePriceInfo({ marketInfo, isIncrease: false, + isLimit: false, isLong, indexPrice: values.indexPrice, sizeDeltaUsd: values.sizeDeltaUsd, @@ -557,6 +582,41 @@ export function estimateCollateralCost(baseUsd: bigint, collateralToken: TokenDa }; } +export function getTotalFeesUsdForDecrease({ + positionFeeUsd, + borrowingFeeUsd, + fundingFeeUsd, + swapProfitFeeUsd, + swapUiFeeUsd, + uiFeeUsd, + pnlUsd, + totalPendingImpactDeltaUsd, +}: { + positionFeeUsd: bigint; + borrowingFeeUsd: bigint; + fundingFeeUsd: bigint; + swapProfitFeeUsd: bigint; + swapUiFeeUsd: bigint; + uiFeeUsd: bigint; + pnlUsd: bigint; + totalPendingImpactDeltaUsd: bigint; +}) { + const negativePriceImpactUsd = totalPendingImpactDeltaUsd < 0 ? bigMath.abs(totalPendingImpactDeltaUsd) : 0n; + const negativePnlUsd = pnlUsd < 0 ? bigMath.abs(pnlUsd) : 0n; + + const totalFeesUsd = + positionFeeUsd + + borrowingFeeUsd + + fundingFeeUsd + + swapProfitFeeUsd + + swapUiFeeUsd + + uiFeeUsd + + negativePnlUsd + + negativePriceImpactUsd; + + return totalFeesUsd; +} + export function getNextPositionValuesForDecreaseTrade(p: { existingPosition?: PositionInfo; marketInfo: MarketInfo; @@ -632,6 +692,7 @@ export function getNextPositionValuesForDecreaseTrade(p: { collateralAmount: nextCollateralAmount, minCollateralUsd, userReferralInfo, + pendingImpactAmount: existingPosition?.pendingImpactAmount ?? 0n, pendingBorrowingFeesUsd: 0n, // deducted on order pendingFundingFeesUsd: 0n, // deducted on order isLong: isLong, diff --git a/sdk/src/utils/trade/amounts.ts b/sdk/src/utils/trade/increase.ts similarity index 82% rename from sdk/src/utils/trade/amounts.ts rename to sdk/src/utils/trade/increase.ts index d229536301..b48b9ef99a 100644 --- a/sdk/src/utils/trade/amounts.ts +++ b/sdk/src/utils/trade/increase.ts @@ -12,13 +12,14 @@ import { ExternalSwapQuoteParams, FindSwapPath, IncreasePositionAmounts, + NextPositionValues, SwapOptimizationOrderArray, TriggerThresholdType, } from "types/trade"; import { bigMath } from "utils/bigmath"; import { getPositionFee, getPriceImpactForPosition, getTotalSwapVolumeFromSwapStats } from "utils/fees"; import { applyFactor } from "utils/numbers"; -import { getLeverage } from "utils/positions"; +import { getEntryPrice, getLeverage, getLiquidationPrice, getPositionPnlUsd } from "utils/positions"; import { getAcceptablePriceInfo, getDefaultAcceptablePriceImpactBps, @@ -196,13 +197,8 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP const swapAmountOut = values.swapStrategy.amountOut; const baseCollateralUsd = convertToUsd(swapAmountOut, collateralToken.decimals, values.collateralPrice)!; const baseSizeDeltaUsd = bigMath.mulDiv(baseCollateralUsd, leverage, BASIS_POINTS_DIVISOR_BIGINT); - const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, baseSizeDeltaUsd, isLong); - const basePositionFeeInfo = getPositionFee( - marketInfo, - baseSizeDeltaUsd, - basePriceImpactDeltaUsd > 0, - userReferralInfo - ); + const { balanceWasImproved } = getPriceImpactForPosition(marketInfo, baseSizeDeltaUsd, isLong); + const basePositionFeeInfo = getPositionFee(marketInfo, baseSizeDeltaUsd, balanceWasImproved, userReferralInfo); const baseUiFeeUsd = applyFactor(baseSizeDeltaUsd, uiFeeFactor); const totalSwapVolumeUsd = getTotalSwapVolumeFromSwapStats(values.swapStrategy.swapPathStats?.swapSteps); values.swapUiFeeUsd = applyFactor(totalSwapVolumeUsd, uiFeeFactor); @@ -215,12 +211,7 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP values.indexTokenAmount = convertToTokenAmount(values.sizeDeltaUsd, indexToken.decimals, values.indexPrice)!; - const positionFeeInfo = getPositionFee( - marketInfo, - values.sizeDeltaUsd, - basePriceImpactDeltaUsd > 0, - userReferralInfo - ); + const positionFeeInfo = getPositionFee(marketInfo, values.sizeDeltaUsd, balanceWasImproved, userReferralInfo); values.positionFeeUsd = positionFeeInfo.positionFeeUsd; values.feeDiscountUsd = positionFeeInfo.discountUsd; values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); @@ -248,14 +239,9 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP values.indexTokenAmount = indexTokenAmount; values.sizeDeltaUsd = convertToUsd(indexTokenAmount, indexToken.decimals, values.indexPrice)!; - const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); + const { balanceWasImproved } = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); - const positionFeeInfo = getPositionFee( - marketInfo, - values.sizeDeltaUsd, - basePriceImpactDeltaUsd > 0, - userReferralInfo - ); + const positionFeeInfo = getPositionFee(marketInfo, values.sizeDeltaUsd, balanceWasImproved, userReferralInfo); values.positionFeeUsd = positionFeeInfo.positionFeeUsd; values.feeDiscountUsd = positionFeeInfo.discountUsd; @@ -314,14 +300,9 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP values.indexTokenAmount = indexTokenAmount; values.sizeDeltaUsd = convertToUsd(indexTokenAmount, indexToken.decimals, values.indexPrice)!; - const basePriceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); + const { balanceWasImproved } = getPriceImpactForPosition(marketInfo, values.sizeDeltaUsd, isLong); - const positionFeeInfo = getPositionFee( - marketInfo, - values.sizeDeltaUsd, - basePriceImpactDeltaUsd > 0, - userReferralInfo - ); + const positionFeeInfo = getPositionFee(marketInfo, values.sizeDeltaUsd, balanceWasImproved, userReferralInfo); values.positionFeeUsd = positionFeeInfo.positionFeeUsd; values.feeDiscountUsd = positionFeeInfo.discountUsd; values.uiFeeUsd = applyFactor(values.sizeDeltaUsd, uiFeeFactor); @@ -394,12 +375,14 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP const acceptablePriceInfo = getAcceptablePriceInfo({ marketInfo, isIncrease: true, + isLimit, isLong, indexPrice: values.indexPrice, sizeDeltaUsd: values.sizeDeltaUsd, }); values.positionPriceImpactDeltaUsd = acceptablePriceInfo.priceImpactDeltaUsd; + values.acceptablePrice = acceptablePriceInfo.acceptablePrice; values.acceptablePriceDeltaBps = acceptablePriceInfo.acceptablePriceDeltaBps; @@ -426,6 +409,7 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP const limitAcceptablePriceInfo = getAcceptablePriceInfo({ marketInfo, isIncrease: true, + isLimit, isLong, indexPrice: values.indexPrice, sizeDeltaUsd: values.sizeDeltaUsd, @@ -437,24 +421,8 @@ export function getIncreasePositionAmounts(p: IncreasePositionParams): IncreaseP } } - let priceImpactAmount = 0n; - - if (values.positionPriceImpactDeltaUsd > 0) { - const price = triggerPrice !== undefined && triggerPrice > 0 ? triggerPrice : indexToken.prices.maxPrice; - priceImpactAmount = convertToTokenAmount(values.positionPriceImpactDeltaUsd, indexToken.decimals, price)!; - } else { - const price = triggerPrice !== undefined && triggerPrice > 0 ? triggerPrice : indexToken.prices.minPrice; - priceImpactAmount = convertToTokenAmount(values.positionPriceImpactDeltaUsd, indexToken.decimals, price)!; - } - values.sizeDeltaInTokens = convertToTokenAmount(values.sizeDeltaUsd, indexToken.decimals, values.indexPrice)!; - if (isLong) { - values.sizeDeltaInTokens = values.sizeDeltaInTokens + priceImpactAmount; - } else { - values.sizeDeltaInTokens = values.sizeDeltaInTokens - priceImpactAmount; - } - return values; } @@ -579,3 +547,90 @@ export function getIncreasePositionPrices({ triggerPrice, }; } + +export function getNextPositionValuesForIncreaseTrade(p: { + existingPosition?: PositionInfo; + marketInfo: MarketInfo; + collateralToken: TokenData; + sizeDeltaUsd: bigint; + sizeDeltaInTokens: bigint; + collateralDeltaUsd: bigint; + collateralDeltaAmount: bigint; + indexPrice: bigint; + isLong: boolean; + showPnlInLeverage: boolean; + minCollateralUsd: bigint; + userReferralInfo: UserReferralInfo | undefined; +}): NextPositionValues { + const { + existingPosition, + marketInfo, + collateralToken, + sizeDeltaUsd, + sizeDeltaInTokens, + collateralDeltaUsd, + collateralDeltaAmount, + indexPrice, + isLong, + showPnlInLeverage, + minCollateralUsd, + userReferralInfo, + } = p; + + const nextCollateralUsd = existingPosition ? existingPosition.collateralUsd + collateralDeltaUsd : collateralDeltaUsd; + + const nextCollateralAmount = existingPosition + ? existingPosition.collateralAmount + collateralDeltaAmount + : collateralDeltaAmount; + + const nextSizeUsd = existingPosition ? existingPosition.sizeInUsd + sizeDeltaUsd : sizeDeltaUsd; + const nextSizeInTokens = existingPosition ? existingPosition.sizeInTokens + sizeDeltaInTokens : sizeDeltaInTokens; + + const nextEntryPrice = + getEntryPrice({ + sizeInUsd: nextSizeUsd, + sizeInTokens: nextSizeInTokens, + indexToken: marketInfo.indexToken, + }) ?? indexPrice; + + const nextPnl = existingPosition + ? getPositionPnlUsd({ + marketInfo, + sizeInUsd: nextSizeUsd, + sizeInTokens: nextSizeInTokens, + markPrice: indexPrice, + isLong, + }) + : undefined; + + const nextLeverage = getLeverage({ + sizeInUsd: nextSizeUsd, + collateralUsd: nextCollateralUsd, + pnl: showPnlInLeverage ? nextPnl : undefined, + pendingBorrowingFeesUsd: 0n, // deducted on order + pendingFundingFeesUsd: 0n, // deducted on order + }); + + const nextLiqPrice = getLiquidationPrice({ + marketInfo, + collateralToken, + sizeInUsd: nextSizeUsd, + sizeInTokens: nextSizeInTokens, + collateralUsd: nextCollateralUsd, + collateralAmount: nextCollateralAmount, + minCollateralUsd, + pendingBorrowingFeesUsd: 0n, // deducted on order + pendingFundingFeesUsd: 0n, // deducted on order + pendingImpactAmount: existingPosition?.pendingImpactAmount ?? 0n, + isLong: isLong, + userReferralInfo, + }); + + return { + nextSizeUsd, + nextCollateralUsd, + nextEntryPrice, + nextLeverage, + nextLiqPrice, + }; +} diff --git a/sdk/src/utils/tradeHistory.ts b/sdk/src/utils/tradeHistory.ts index 517339dfcb..adf88ce0ea 100644 --- a/sdk/src/utils/tradeHistory.ts +++ b/sdk/src/utils/tradeHistory.ts @@ -46,6 +46,7 @@ export function createRawTradeActionTransformer( const tradeAction: SwapTradeAction = { id: rawAction.id, + srcChainId: rawAction.srcChainId ? Number(rawAction.srcChainId) : undefined, eventName: rawAction.eventName as TradeActionType, account: rawAction.account, swapPath, @@ -99,6 +100,7 @@ export function createRawTradeActionTransformer( account: rawAction.account, marketAddress, marketInfo, + srcChainId: rawAction.srcChainId ? Number(rawAction.srcChainId) : undefined, indexToken, swapPath, initialCollateralTokenAddress, @@ -138,6 +140,7 @@ export function createRawTradeActionTransformer( priceImpactDiffUsd: rawAction.priceImpactDiffUsd ? BigInt(rawAction.priceImpactDiffUsd) : undefined, priceImpactUsd: rawAction.priceImpactUsd ? BigInt(rawAction.priceImpactUsd) : undefined, + totalImpactUsd: rawAction.totalImpactUsd ? BigInt(rawAction.totalImpactUsd) : undefined, positionFeeAmount: rawAction.positionFeeAmount ? BigInt(rawAction.positionFeeAmount) : undefined, borrowingFeeAmount: rawAction.borrowingFeeAmount ? BigInt(rawAction.borrowingFeeAmount) : undefined, fundingFeeAmount: rawAction.fundingFeeAmount ? BigInt(rawAction.fundingFeeAmount) : undefined, diff --git a/sdk/subsquid-codegen.ts b/sdk/subsquid-codegen.ts index fa5fac52e0..ac53c12271 100644 --- a/sdk/subsquid-codegen.ts +++ b/sdk/subsquid-codegen.ts @@ -1,7 +1,7 @@ import { CodegenConfig } from "@graphql-codegen/cli"; const config: CodegenConfig = { - schema: "https://gmx.squids.live/gmx-synthetics-arbitrum:prod/api/graphql", + schema: "https://gmx-test.squids.live/v22-arbitrum2@kd7hzy/api/graphql", overwrite: true, debug: true, generates: { diff --git a/sdk/yarn.lock b/sdk/yarn.lock index 7a17714c44..9e03c47fbb 100644 --- a/sdk/yarn.lock +++ b/sdk/yarn.lock @@ -12,7 +12,7 @@ __metadata: languageName: node linkType: hard -"@adraffy/ens-normalize@npm:^1.10.1": +"@adraffy/ens-normalize@npm:^1.11.0": version: 1.11.0 resolution: "@adraffy/ens-normalize@npm:1.11.0" checksum: b2911269e3e0ec6396a2e5433a99e0e1f9726befc6c167994448cd0e53dbdd0be22b4835b4f619558b568ed9aa7312426b8fa6557a13999463489daa88169ee5 @@ -857,7 +857,7 @@ __metadata: typescript: 5.4.2 typescript-transform-paths: 3.5.1 universal-perf-hooks: 1.0.1 - viem: ^2.7.20 + viem: ^2.26.2 vitest: 3.0.4 languageName: unknown linkType: soft @@ -1540,12 +1540,19 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.8.1, @noble/curves@npm:^1.6.0, @noble/curves@npm:~1.8.1": - version: 1.8.1 - resolution: "@noble/curves@npm:1.8.1" +"@noble/ciphers@npm:^1.3.0": + version: 1.3.0 + resolution: "@noble/ciphers@npm:1.3.0" + checksum: 19722c35475df9bc78db60d261d0b5ef8a6d722561efc2135453f943eaa421b492195dc666e3e4df2b755bca3739e04f04b9c660198559f5dd05d3cfbf1b9e92 + languageName: node + linkType: hard + +"@noble/curves@npm:1.9.2, @noble/curves@npm:^1.9.1, @noble/curves@npm:~1.9.0": + version: 1.9.2 + resolution: "@noble/curves@npm:1.9.2" dependencies: - "@noble/hashes": 1.7.1 - checksum: 4143f1248ed57c1ae46dfef5c692a91383e5830420b9c72d3ff1061aa9ebbf8999297da6d2aed8a9716fef8e6b1f5a45737feeab02abf55ca2a4f514bf9339ec + "@noble/hashes": 1.8.0 + checksum: bac582aefe951032cb04ed7627f139c3351ddfefd2625a25fe7f7a8043e7d781be4fad320d4ae75e31fa5d7e05ba643f16139877375130fd3cff86d81512e0f2 languageName: node linkType: hard @@ -1556,10 +1563,10 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.7.1, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:~1.7.1": - version: 1.7.1 - resolution: "@noble/hashes@npm:1.7.1" - checksum: 4f1b56428a10323feef17e4f437c9093556cb18db06f94d254043fadb69c3da8475f96eb3f8322d41e8670117d7486475a8875e68265c2839f60fd03edd6a616 +"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.8.0, @noble/hashes@npm:~1.8.0": + version: 1.8.0 + resolution: "@noble/hashes@npm:1.8.0" + checksum: c94e98b941963676feaba62475b1ccfa8341e3f572adbb3b684ee38b658df44100187fa0ef4220da580b13f8d27e87d5492623c8a02ecc61f23fb9960c7918f5 languageName: node linkType: hard @@ -1766,31 +1773,31 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:~1.2.2, @scure/base@npm:~1.2.4": - version: 1.2.4 - resolution: "@scure/base@npm:1.2.4" - checksum: db554eb550a1bd17684af9282e1ad751050a13d4add0e83ad61cc496680d7d1c1c1120ca780e72935a293bb59721c20a006a53a5eec6f6b5bdcd702cf27c8cae +"@scure/base@npm:~1.2.5": + version: 1.2.6 + resolution: "@scure/base@npm:1.2.6" + checksum: 1058cb26d5e4c1c46c9cc0ae0b67cc66d306733baf35d6ebdd8ddaba242b80c3807b726e3b48cb0411bb95ec10d37764969063ea62188f86ae9315df8ea6b325 languageName: node linkType: hard -"@scure/bip32@npm:1.6.2, @scure/bip32@npm:^1.5.0": - version: 1.6.2 - resolution: "@scure/bip32@npm:1.6.2" +"@scure/bip32@npm:1.7.0, @scure/bip32@npm:^1.7.0": + version: 1.7.0 + resolution: "@scure/bip32@npm:1.7.0" dependencies: - "@noble/curves": ~1.8.1 - "@noble/hashes": ~1.7.1 - "@scure/base": ~1.2.2 - checksum: e7586619f8a669e522267ce71a90b2d00c3a91da658f1f50e54072cf9f432ba26d2bb4d3d91a5d06932ab96612b8bd038bc31d885bbc048cebfb6509c4a790fc + "@noble/curves": ~1.9.0 + "@noble/hashes": ~1.8.0 + "@scure/base": ~1.2.5 + checksum: c83adca5a74ec5c4ded8ba93900d0065e4767c4759cf24c2674923aef01d45ba56f171574e3519f2341be99f53a333f01b674eb6cfeb6fa8379607c6d1bc90b5 languageName: node linkType: hard -"@scure/bip39@npm:1.5.4, @scure/bip39@npm:^1.4.0": - version: 1.5.4 - resolution: "@scure/bip39@npm:1.5.4" +"@scure/bip39@npm:1.6.0, @scure/bip39@npm:^1.6.0": + version: 1.6.0 + resolution: "@scure/bip39@npm:1.6.0" dependencies: - "@noble/hashes": ~1.7.1 - "@scure/base": ~1.2.4 - checksum: 744f302559ad05ee6ea4928572ac8f0b5443e8068fd53234c9c2e158814e910a043c54f0688d05546decadd2ff66e0d0c76355d10e103a28cb8f44efe140857a + "@noble/hashes": ~1.8.0 + "@scure/base": ~1.2.5 + checksum: 96d46420780473d6c6c9700254a0eceec60302f61d7f9d7f29024e90c7acff3e8e40a5ee52dfaf104db539a10462e531996aaf9e69f082b8540b0a25870545fc languageName: node linkType: hard @@ -1983,7 +1990,7 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.8, abitype@npm:^1.0.6": +"abitype@npm:1.0.8, abitype@npm:^1.0.8": version: 1.0.8 resolution: "abitype@npm:1.0.8" peerDependencies: @@ -3857,12 +3864,12 @@ __metadata: languageName: node linkType: hard -"isows@npm:1.0.6": - version: 1.0.6 - resolution: "isows@npm:1.0.6" +"isows@npm:1.0.7": + version: 1.0.7 + resolution: "isows@npm:1.0.7" peerDependencies: ws: "*" - checksum: ab9e85b50bcc3d70aa5ec875aa2746c5daf9321cb376ed4e5434d3c2643c5d62b1f466d93a05cd2ad0ead5297224922748c31707cb4fbd68f5d05d0479dce99c + checksum: 044b949b369872882af07b60b613b5801ae01b01a23b5b72b78af80c8103bbeed38352c3e8ceff13a7834bc91fd2eb41cf91ec01d59a041d8705680e6b0ec546 languageName: node linkType: hard @@ -4524,23 +4531,24 @@ __metadata: languageName: node linkType: hard -"ox@npm:0.6.7": - version: 0.6.7 - resolution: "ox@npm:0.6.7" +"ox@npm:0.8.1": + version: 0.8.1 + resolution: "ox@npm:0.8.1" dependencies: - "@adraffy/ens-normalize": ^1.10.1 - "@noble/curves": ^1.6.0 - "@noble/hashes": ^1.5.0 - "@scure/bip32": ^1.5.0 - "@scure/bip39": ^1.4.0 - abitype: ^1.0.6 + "@adraffy/ens-normalize": ^1.11.0 + "@noble/ciphers": ^1.3.0 + "@noble/curves": ^1.9.1 + "@noble/hashes": ^1.8.0 + "@scure/bip32": ^1.7.0 + "@scure/bip39": ^1.6.0 + abitype: ^1.0.8 eventemitter3: 5.0.1 peerDependencies: typescript: ">=5.4.0" peerDependenciesMeta: typescript: optional: true - checksum: 99acb683ff1cf78749f2b4230d3c208b8cdea0b3bf2bff0db564207917ae6833093b203cb7b9853fc8ec642ca0c8c87cd70a50eab9ff9944c55bf990436112b5 + checksum: 0c8c3210c173f44f617055cfca34630dd74752f21f7f244d25095403aaebb748d53197f78ba24a830024dc4f7d8f2c7175230d2a7d95ae5826509571791a1763 languageName: node linkType: hard @@ -5669,24 +5677,24 @@ __metadata: languageName: node linkType: hard -"viem@npm:^2.7.20": - version: 2.22.22 - resolution: "viem@npm:2.22.22" +"viem@npm:^2.26.2": + version: 2.31.2 + resolution: "viem@npm:2.31.2" dependencies: - "@noble/curves": 1.8.1 - "@noble/hashes": 1.7.1 - "@scure/bip32": 1.6.2 - "@scure/bip39": 1.5.4 + "@noble/curves": 1.9.2 + "@noble/hashes": 1.8.0 + "@scure/bip32": 1.7.0 + "@scure/bip39": 1.6.0 abitype: 1.0.8 - isows: 1.0.6 - ox: 0.6.7 - ws: 8.18.0 + isows: 1.0.7 + ox: 0.8.1 + ws: 8.18.2 peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: 666821316de073a32322390d23614327d85f34a699280f0c2bda3329640ac011091a7e75f290ccc8e904359379600096c956a6064b854d2ffb0b391932a438b8 + checksum: 81f2513f2659a90959d7959d6b637f93342c06feaf2d05a30ae7aae79daeeeb626d77b4c7fc409be770922144709365cb1cf489586eaf138bfd0d25d9a9a4595 languageName: node linkType: hard @@ -5928,9 +5936,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.18.0": - version: 8.18.0 - resolution: "ws@npm:8.18.0" +"ws@npm:8.18.2, ws@npm:^8.17.1, ws@npm:^8.18.0": + version: 8.18.2 + resolution: "ws@npm:8.18.2" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -5939,7 +5947,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 + checksum: e38beae19ba4d68577ec24eb34fbfab376333fedd10f99b07511a8e842e22dbc102de39adac333a18e4c58868d0703cd5f239b04b345e22402d0ed8c34ea0aa0 languageName: node linkType: hard @@ -5958,21 +5966,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.17.1, ws@npm:^8.18.0": - version: 8.18.2 - resolution: "ws@npm:8.18.2" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: e38beae19ba4d68577ec24eb34fbfab376333fedd10f99b07511a8e842e22dbc102de39adac333a18e4c58868d0703cd5f239b04b345e22402d0ed8c34ea0aa0 - languageName: node - linkType: hard - "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8" diff --git a/src/App/App.scss b/src/App/App.scss index 117317f1ce..11241d53d3 100644 --- a/src/App/App.scss +++ b/src/App/App.scss @@ -187,16 +187,6 @@ $app-card-padding: 1.5rem; margin-right: 0.8rem; } -.App-header-user-address { - border: 0.5px solid var(--color-slate-600); - height: 3.6rem; - border-radius: 0.4rem; - display: inline-flex; - align-items: center; - color: var(--color-typography-primary); - position: relative; -} - .mobile-menu-divider { height: 1px; background: var(--color-slate-100); @@ -680,11 +670,6 @@ button.App-button-option:disabled { cursor: not-allowed; } -.App-header-container-right { - display: flex; - align-items: center; -} - .App-header-user { display: flex; align-items: center; @@ -1015,9 +1000,6 @@ button.App-button { .long-connect-btn { display: none !important; } - .App-header-user-address { - padding: 0 0px; - } .short-connect-btn { display: flex !important; @@ -1040,11 +1022,6 @@ button.App-button { padding-bottom: 0; } - .App-header-container-right { - display: flex; - align-items: center; - } - .App-header-link-desktop { display: none; } diff --git a/src/App/App.tsx b/src/App/App.tsx index c6453c13cd..40309477e5 100644 --- a/src/App/App.tsx +++ b/src/App/App.tsx @@ -14,8 +14,9 @@ import "styles/recharts.css"; import "./App.scss"; import { LANGUAGE_LOCALSTORAGE_KEY } from "config/localStorage"; -import { ExpressNoncesContextProvider } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; +import { ChainContextProvider } from "context/ChainContext/ChainContext"; import { GlobalStateProvider } from "context/GlobalContext/GlobalContextProvider"; +import { GmxAccountContextProvider } from "context/GmxAccountContext/GmxAccountContext"; import { PendingTxnsContextProvider } from "context/PendingTxnsContext/PendingTxnsContext"; import { SettingsContextProvider } from "context/SettingsContext/SettingsContextProvider"; import { SorterContextProvider } from "context/SorterContext/SorterContextProvider"; @@ -41,9 +42,16 @@ if (window?.ethereum?.autoRefreshOnNetworkChange) { window.ethereum.autoRefreshOnNetworkChange = false; } -function App() { +function SWRConfigWithKey({ children }: { children: React.ReactNode }) { const { chainId } = useChainId(); + return ( + + {children} + + ); +} +function App() { useEffect(() => { const defaultLanguage = localStorage.getItem(LANGUAGE_LOCALSTORAGE_KEY) || defaultLocale; dynamicActivate(defaultLanguage); @@ -53,7 +61,6 @@ function App() { app = {app}; app = {app}; app = {app}; - app = {app}; app = {app}; app = {app}; app = {app}; @@ -62,13 +69,11 @@ function App() { app = {app}; app = {app}; app = {app}; + app = {app}; app = {app}; - app = ( - - {app} - - ); app = {app}; + app = {app}; + app = {app}; app = {app}; app = {app}; diff --git a/src/App/AppRoutes.tsx b/src/App/AppRoutes.tsx index 60402663e2..ad74af3587 100644 --- a/src/App/AppRoutes.tsx +++ b/src/App/AppRoutes.tsx @@ -1,21 +1,17 @@ import { ethers } from "ethers"; import { useCallback, useEffect, useState } from "react"; import { useHistory, useLocation } from "react-router-dom"; -import { ToastContainer, cssTransition } from "react-toastify"; +import { cssTransition, ToastContainer } from "react-toastify"; import { Hash } from "viem"; -import { useDisconnect } from "wagmi"; - -import { SUPPORTED_CHAIN_IDS, UiContractsChain } from "config/chains"; -import { - CURRENT_PROVIDER_LOCALSTORAGE_KEY, - REFERRAL_CODE_KEY, - SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY, -} from "config/localStorage"; + +import { ContractsChainId, CONTRACTS_CHAIN_IDS } from "config/chains"; +import { REFERRAL_CODE_KEY } from "config/localStorage"; import { TOAST_AUTO_CLOSE_TIME } from "config/ui"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useTheme } from "context/ThemeContext/ThemeContext"; +import { useMultichainFundingToast } from "domain/multichain/useMultichainFundingToast"; import { useRealChainIdWarning } from "lib/chains/useRealChainIdWarning"; -import { REFERRAL_CODE_QUERY_PARAM, getAppBaseUrl, isHomeSite } from "lib/legacy"; +import { getAppBaseUrl, isHomeSite, REFERRAL_CODE_QUERY_PARAM } from "lib/legacy"; import { useAccountInitedMetric, useOpenAppMetric } from "lib/metrics"; import { useConfigureMetrics } from "lib/metrics/useConfigureMetrics"; import { useHashQueryParams } from "lib/useHashQueryParams"; @@ -35,6 +31,7 @@ import { Header } from "components/Header/Header"; import { RedirectPopupModal } from "components/ModalViews/RedirectModal"; import { NotifyModal } from "components/NotifyModal/NotifyModal"; import { SettingsModal } from "components/SettingsModal/SettingsModal"; +import { GmxAccountModal } from "components/Synthetics/GmxAccountModal/GmxAccountModal"; import { HomeRoutes } from "./HomeRoutes"; import { MainRoutes } from "./MainRoutes"; @@ -48,7 +45,6 @@ const Zoom = cssTransition({ }); export function AppRoutes() { - const { disconnect } = useDisconnect(); const { theme } = useTheme(); const isHome = isHomeSite(); const location = useLocation(); @@ -60,6 +56,7 @@ export function AppRoutes() { useOpenAppMetric(); useAccountInitedMetric(); useWalletConnectedUserAnalyticsEvent(); + useMultichainFundingToast(); useHashQueryParams(); const query = useRouteQuery(); @@ -86,13 +83,6 @@ export function AppRoutes() { } }, [query, history, location]); - const disconnectAccountAndCloseSettings = () => { - disconnect(); - localStorage.removeItem(SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY); - localStorage.removeItem(CURRENT_PROVIDER_LOCALSTORAGE_KEY); - setIsSettingsVisible(false); - }; - const [redirectModalVisible, setRedirectModalVisible] = useState(false); const [shouldHideRedirectModal, setShouldHideRedirectModal] = useState(false); @@ -128,7 +118,7 @@ export function AppRoutes() { useEffect(() => { const chainId = urlParams.chainId; - if (chainId && SUPPORTED_CHAIN_IDS.includes(Number(chainId) as UiContractsChain)) { + if (chainId && CONTRACTS_CHAIN_IDS.includes(Number(chainId) as ContractsChainId)) { switchNetwork(Number(chainId), true).then(() => { const searchParams = new URLSearchParams(history.location.search); searchParams.delete("chainId"); @@ -147,11 +137,7 @@ export function AppRoutes() {
{isHome ? (
-
+
) : ( @@ -180,6 +166,7 @@ export function AppRoutes() { setShouldHideRedirectModal={setShouldHideRedirectModal} shouldHideRedirectModal={shouldHideRedirectModal} /> + diff --git a/src/App/MainRoutes.tsx b/src/App/MainRoutes.tsx index 7cb9ca644e..c2022374e5 100644 --- a/src/App/MainRoutes.tsx +++ b/src/App/MainRoutes.tsx @@ -48,7 +48,11 @@ import { abis } from "sdk/abis"; import { RedirectWithQuery } from "components/RedirectWithQuery/RedirectWithQuery"; const LazyUiPage = lazy(() => import("pages/UiPage/UiPage")); -export const UiPage = () => Loading...}>{}; +export const UiPage = () => ( + Loading...}> + + +); export function MainRoutes({ openSettings }: { openSettings: () => void }) { const exchangeRef = useRef(); diff --git a/src/App/swrConfig.tsx b/src/App/swrConfig.tsx index 5851fb5d89..ba4cf745de 100644 --- a/src/App/swrConfig.tsx +++ b/src/App/swrConfig.tsx @@ -1,9 +1,10 @@ import type { Cache, SWRConfiguration } from "swr"; +import { cache } from "swr/_internal"; import { swrGCMiddleware } from "lib/swrMiddlewares"; import { FREQUENT_UPDATE_INTERVAL } from "lib/timeConstants"; -export let swrCache: Cache = new Map(); +export let swrCache: Cache = cache; export const SWRConfigProp: SWRConfiguration = { refreshInterval: FREQUENT_UPDATE_INTERVAL, @@ -11,8 +12,4 @@ export const SWRConfigProp: SWRConfiguration = { refreshWhenOffline: false, // @ts-ignore use: [swrGCMiddleware], - provider: () => { - swrCache = new Map(); - return swrCache; - }, }; diff --git a/src/components/AddressDropdown/AddressDropdown.tsx b/src/components/AddressDropdown/AddressDropdown.tsx index f04a5f43e2..576692075c 100644 --- a/src/components/AddressDropdown/AddressDropdown.tsx +++ b/src/components/AddressDropdown/AddressDropdown.tsx @@ -1,136 +1,19 @@ -import { Menu } from "@headlessui/react"; -import { Trans, t } from "@lingui/macro"; -import cx from "classnames"; -import { FiChevronDown } from "react-icons/fi"; -import { Link } from "react-router-dom"; -import { useCopyToClipboard } from "react-use"; -import type { Address } from "viem"; - -import { BOTANIX } from "config/chains"; -import { useBreakpoints } from "lib/breakpoints"; +import { isSettlementChain } from "config/multichain"; import { useChainId } from "lib/chains"; -import { helperToast } from "lib/helperToast"; -import { useENS } from "lib/legacy"; -import { useNotifyModalState } from "lib/useNotifyModalState"; -import { userAnalytics } from "lib/userAnalytics"; -import { DisconnectWalletEvent } from "lib/userAnalytics/types"; -import { shortenAddressOrEns } from "lib/wallets"; -import { buildAccountDashboardUrl } from "pages/AccountDashboard/buildAccountDashboardUrl"; - -import { Avatar } from "components/Avatar/Avatar"; -import Button from "components/Button/Button"; -import ExternalLink from "components/ExternalLink/ExternalLink"; -import BellIcon from "img/bell.svg?react"; -import CopyIcon from "img/ic_copy_20.svg?react"; -import ExternalLinkIcon from "img/ic_new_link_20.svg?react"; -import PnlAnalysisIcon from "img/ic_pnl_analysis_20.svg?react"; -import DisconnectIcon from "img/ic_sign_out_20.svg?react"; - -import "./AddressDropdown.scss"; +import { AddressDropdownWithMultichain } from "./AddressDropdownWithMultichain"; +import { AddressDropdownWithoutMultichain } from "./AddressDropdownWithoutMultichain"; type Props = { account: string; - accountUrl: string; - disconnectAccountAndCloseSettings: () => void; }; -function AddressDropdown({ account, accountUrl, disconnectAccountAndCloseSettings }: Props) { - const [, copyToClipboard] = useCopyToClipboard(); - const { openNotifyModal } = useNotifyModalState(); - const { ensName } = useENS(account); - const { isMobile } = useBreakpoints(); - - const displayAddressLength = isMobile ? 9 : 13; - +export function AddressDropdown({ account }: Props) { const { chainId } = useChainId(); - const isBotanix = chainId === BOTANIX; - - return ( -
- - {({ open }) => ( - <> - - - -
- - -
{ - copyToClipboard(account); - helperToast.success(t`Address copied to your clipboard.`); - }} - > - -

- Copy Address -

-
-
- - - -

- PnL Analysis -

- -
- - - -

- View in Explorer -

-
-
- {!isBotanix ? ( - -
- -

- Alerts -

-
-
- ) : null} - -
{ - userAnalytics.pushEvent({ - event: "ConnectWalletAction", - data: { - action: "Disconnect", - }, - }); - - disconnectAccountAndCloseSettings(); - }} - > - -

- Disconnect -

-
-
-
-
- - )} -
-
- ); + return ; } - -export default AddressDropdown; diff --git a/src/components/AddressDropdown/AddressDropdownWithMultichain.tsx b/src/components/AddressDropdown/AddressDropdownWithMultichain.tsx new file mode 100644 index 0000000000..89a46799fb --- /dev/null +++ b/src/components/AddressDropdown/AddressDropdownWithMultichain.tsx @@ -0,0 +1,85 @@ +import { Trans } from "@lingui/macro"; +import cx from "classnames"; +import { useCallback } from "react"; +import Skeleton from "react-loading-skeleton"; +import { createBreakpoint } from "react-use"; + +import { useGmxAccountModalOpen } from "context/GmxAccountContext/hooks"; +import { useGmxAccountShowDepositButton } from "domain/multichain/useGmxAccountShowDepositButton"; +import { useChainId } from "lib/chains"; +import { useENS } from "lib/legacy"; +import { formatUsd } from "lib/numbers"; +import { shortenAddressOrEns } from "lib/wallets"; + +import { Avatar } from "components/Avatar/Avatar"; +import { useAvailableToTradeAssetSettlementChain } from "components/Synthetics/GmxAccountModal/hooks"; + +type Props = { + account: string; +}; + +const useBreakpoint = createBreakpoint({ L: 450, S: 0 }) as () => "L" | "S"; + +export function AddressDropdownWithMultichain({ account }: Props) { + const { srcChainId } = useChainId(); + const { ensName } = useENS(account); + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); + const { totalUsd, gmxAccountUsd, isGmxAccountLoading } = useAvailableToTradeAssetSettlementChain(); + const { shouldShowDepositButton } = useGmxAccountShowDepositButton(); + + const breakpoint = useBreakpoint(); + const isSmallScreen = breakpoint === "S"; + + const displayAddressLength = isSmallScreen ? 9 : 13; + + const handleOpenGmxAccountModal = useCallback(() => { + setGmxAccountModalOpen(true); + }, [setGmxAccountModalOpen]); + + const handleOpenDeposit = useCallback(() => { + setGmxAccountModalOpen("deposit"); + }, [setGmxAccountModalOpen]); + + const showSideButton = srcChainId !== undefined || (gmxAccountUsd !== undefined && gmxAccountUsd > 0n); + + return ( +
+ {!(isSmallScreen && showSideButton) && ( + + )} + {showSideButton && ( + + )} +
+ ); +} diff --git a/src/components/AddressDropdown/AddressDropdown.scss b/src/components/AddressDropdown/AddressDropdownWithoutMultichain.scss similarity index 68% rename from src/components/AddressDropdown/AddressDropdown.scss rename to src/components/AddressDropdown/AddressDropdownWithoutMultichain.scss index 8f72fe26d0..d6dd296931 100644 --- a/src/components/AddressDropdown/AddressDropdown.scss +++ b/src/components/AddressDropdown/AddressDropdownWithoutMultichain.scss @@ -2,28 +2,6 @@ border: 1px solid #262638; } -.address-btn { - display: inline-flex; - align-items: center; - justify-content: center; - color: white !important; -} - -.user-address { - margin-left: 1rem; - margin-right: 1rem; -} - -.App-header-user-address { - &:hover { - background: #808aff14; - } - - &:active { - background: var(--dark-blue-active); - } -} - .menu-items { position: absolute; right: 0; @@ -68,15 +46,6 @@ } @media screen and (max-width: 370px) { - .user-address { - margin-left: 0; - } - - .address-btn { - display: flex; - justify-content: space-between; - } - .user-avatar { display: none; } diff --git a/src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx b/src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx new file mode 100644 index 0000000000..b78bcb1493 --- /dev/null +++ b/src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx @@ -0,0 +1,115 @@ +import { Menu } from "@headlessui/react"; +import { t, Trans } from "@lingui/macro"; +import cx from "classnames"; +import { FiChevronDown } from "react-icons/fi"; +import { Link } from "react-router-dom"; +import { useCopyToClipboard } from "react-use"; +import { Address } from "viem"; + +import { BOTANIX } from "config/chains"; +import { useDisconnectAndClose } from "domain/multichain/useDisconnectAndClose"; +import { useBreakpoints } from "lib/breakpoints"; +import { useChainId } from "lib/chains"; +import { helperToast } from "lib/helperToast"; +import { getAccountUrl, useENS } from "lib/legacy"; +import { useNotifyModalState } from "lib/useNotifyModalState"; +import { shortenAddressOrEns } from "lib/wallets"; +import { buildAccountDashboardUrl } from "pages/AccountDashboard/buildAccountDashboardUrl"; + +import { Avatar } from "components/Avatar/Avatar"; +import Button from "components/Button/Button"; +import ExternalLink from "components/ExternalLink/ExternalLink"; + +import BellIcon from "img/bell.svg?react"; +import CopyIcon from "img/ic_copy_20.svg?react"; +import ExternalLinkIcon from "img/ic_new_link_20.svg?react"; +import PnlAnalysisIcon from "img/ic_pnl_analysis_20.svg?react"; +import DisconnectIcon from "img/ic_sign_out_20.svg?react"; + +import "./AddressDropdownWithoutMultichain.scss"; + +export function AddressDropdownWithoutMultichain({ account }: { account: string }) { + const [, copyToClipboard] = useCopyToClipboard(); + const { openNotifyModal } = useNotifyModalState(); + const { ensName } = useENS(account); + const { isMobile } = useBreakpoints(); + const displayAddressLength = isMobile ? 9 : 13; + + const { chainId } = useChainId(); + const isBotanix = chainId === BOTANIX; + + const accountUrl = getAccountUrl(chainId, account); + const handleDisconnect = useDisconnectAndClose(); + + return ( + + {({ open }) => ( + <> + + + +
+ + +
{ + copyToClipboard(account); + helperToast.success(t`Address copied to your clipboard.`); + }} + > + +

+ Copy Address +

+
+
+ + + +

+ PnL Analysis +

+ +
+ + + +

+ View in Explorer +

+
+
+ {!isBotanix ? ( + +
+ +

+ Alerts +

+
+
+ ) : null} + +
+ +

+ Disconnect +

+
+
+
+
+ + )} +
+ ); +} diff --git a/src/components/AlertInfo/AlertInfoCard.tsx b/src/components/AlertInfo/AlertInfoCard.tsx index 48a6713942..bd1c654971 100644 --- a/src/components/AlertInfo/AlertInfoCard.tsx +++ b/src/components/AlertInfo/AlertInfoCard.tsx @@ -9,7 +9,7 @@ type Props = { /** * @default "info" */ - type?: "warning" | "info"; + type?: "warning" | "info" | "error"; children: ReactNode; className?: string; onClose?: () => void; @@ -31,7 +31,12 @@ export function AlertInfoCard({ children, type = "info", onClose, className }: P } return ( - + {children} ); diff --git a/src/components/AppHeader/AppHeader.tsx b/src/components/AppHeader/AppHeader.tsx index c06c38f042..d4d3fbaaf1 100644 --- a/src/components/AppHeader/AppHeader.tsx +++ b/src/components/AppHeader/AppHeader.tsx @@ -1,7 +1,3 @@ -import { useDisconnect } from "wagmi"; - -import { CURRENT_PROVIDER_LOCALSTORAGE_KEY } from "config/localStorage"; -import { SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY } from "config/localStorage"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { MobileSideNav } from "components/SideNav/MobileSideNav"; @@ -14,16 +10,8 @@ type Props = { }; export function AppHeader({ leftContent }: Props) { - const { disconnect } = useDisconnect(); const { setIsSettingsVisible } = useSettings(); - const disconnectAccountAndCloseSettings = () => { - disconnect(); - localStorage.removeItem(SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY); - localStorage.removeItem(CURRENT_PROVIDER_LOCALSTORAGE_KEY); - setIsSettingsVisible(false); - }; - const openSettings = () => { setIsSettingsVisible(true); }; @@ -37,7 +25,6 @@ export function AppHeader({ leftContent }: Props) {
diff --git a/src/components/AppHeader/AppHeaderUser.tsx b/src/components/AppHeader/AppHeaderUser.tsx index 221139df1c..7af5450e38 100644 --- a/src/components/AppHeader/AppHeaderUser.tsx +++ b/src/components/AppHeader/AppHeaderUser.tsx @@ -1,56 +1,28 @@ import { Trans } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, getChainName } from "config/chains"; -import { isDevelopment } from "config/env"; -import { getIcon } from "config/icons"; import { useChainId } from "lib/chains"; -import { getAccountUrl } from "lib/legacy"; import { sendUserAnalyticsConnectWalletClickEvent } from "lib/userAnalytics"; import useWallet from "lib/wallets/useWallet"; +import { NETWORK_OPTIONS } from "components/Header/AppHeaderChainAndSettings"; import { OneClickButton } from "components/OneClickButton/OneClickButton"; -import AddressDropdown from "../AddressDropdown/AddressDropdown"; +import { AddressDropdown } from "../AddressDropdown/AddressDropdown"; import ConnectWalletButton from "../Common/ConnectWalletButton"; import NetworkDropdown from "../NetworkDropdown/NetworkDropdown"; type Props = { openSettings: () => void; - disconnectAccountAndCloseSettings: () => void; menuToggle?: React.ReactNode; }; -const NETWORK_OPTIONS = [ - { - label: getChainName(ARBITRUM), - value: ARBITRUM, - icon: getIcon(ARBITRUM, "network"), - color: "#264f79", - }, - { - label: getChainName(AVALANCHE), - value: AVALANCHE, - icon: getIcon(AVALANCHE, "network"), - color: "#E841424D", - }, -]; - -if (isDevelopment()) { - NETWORK_OPTIONS.push({ - label: getChainName(AVALANCHE_FUJI), - value: AVALANCHE_FUJI, - icon: getIcon(AVALANCHE_FUJI, "network"), - color: "#E841424D", - }); -} - -export function AppHeaderUser({ openSettings, disconnectAccountAndCloseSettings, menuToggle }: Props) { - const { chainId } = useChainId(); +export function AppHeaderUser({ openSettings, menuToggle }: Props) { + const { chainId: settlementChainId, srcChainId } = useChainId(); const { active, account } = useWallet(); const { openConnectModal } = useConnectModal(); - const selectorLabel = getChainName(chainId); + const visualChainId = srcChainId ?? settlementChainId; if (!active || !account) { return ( @@ -66,11 +38,7 @@ export function AppHeaderUser({ openSettings, disconnectAccountAndCloseSettings, Connect Wallet - + {menuToggle ? menuToggle : null} ) : null} @@ -78,19 +46,13 @@ export function AppHeaderUser({ openSettings, disconnectAccountAndCloseSettings, ); } - const accountUrl = getAccountUrl(chainId, account); - return (
- +
- + {menuToggle ? menuToggle : null}
); diff --git a/src/components/BuyInputSection/BuyInputSection.tsx b/src/components/BuyInputSection/BuyInputSection.tsx index 30d9dc1553..32c63a1d11 100644 --- a/src/components/BuyInputSection/BuyInputSection.tsx +++ b/src/components/BuyInputSection/BuyInputSection.tsx @@ -15,7 +15,7 @@ type Props = { bottomRightValue?: string; onClickBottomRightLabel?: () => void; topRightLabel?: string; - topRightValue?: string; + topRightValue?: ReactNode; onClickTopRightLabel?: () => void; inputValue?: number | string; onInputValueChange?: (e: ChangeEvent) => void; diff --git a/src/components/DepthChart/DepthChart.tsx b/src/components/DepthChart/DepthChart.tsx index d311b8f364..8b250d34b7 100644 --- a/src/components/DepthChart/DepthChart.tsx +++ b/src/components/DepthChart/DepthChart.tsx @@ -795,7 +795,9 @@ function useDepthChartPricesData( const leftInc = (leftMax - DOLLAR) / SIDE_POINTS_COUNT; // from left to center for (let positionSize = leftMax; positionSize >= DOLLAR; positionSize -= leftInc) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, positionSize, false, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, positionSize, false, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, @@ -824,9 +826,10 @@ function useDepthChartPricesData( }); if (positionSize - leftInc < leftMin && positionSize > leftMin && leftMin > DOLLAR) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, leftMin, false, { + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, leftMin, false, { fallbackToZero: true, }); + const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, isLong: false, @@ -858,7 +861,9 @@ function useDepthChartPricesData( } if (positionSize - leftInc < DOLLAR && positionSize > DOLLAR) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, DOLLAR, false, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, DOLLAR, false, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, @@ -895,7 +900,9 @@ function useDepthChartPricesData( // from right max to center for (let positionSize = rightMax; positionSize >= DOLLAR; positionSize -= rightInc) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, positionSize, true, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, positionSize, true, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, @@ -924,7 +931,7 @@ function useDepthChartPricesData( }); if (positionSize - rightInc < rightMin && positionSize > rightMin && rightMin > DOLLAR) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, rightMin, true, { + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, rightMin, true, { fallbackToZero: true, }); @@ -959,7 +966,9 @@ function useDepthChartPricesData( } if (positionSize - rightInc < DOLLAR && positionSize > DOLLAR) { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, DOLLAR, true, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, DOLLAR, true, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, @@ -1131,7 +1140,9 @@ function useEdgePoints( let rightMaxExecutionPrice = 0n; { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, rightMax, true, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, rightMax, true, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, @@ -1146,7 +1157,9 @@ function useEdgePoints( } { - const priceImpactUsd = getPriceImpactForPosition(marketInfo, leftMax, false, { fallbackToZero: true }); + const { priceImpactDeltaUsd: priceImpactUsd } = getPriceImpactForPosition(marketInfo, leftMax, false, { + fallbackToZero: true, + }); const executionPrice = getDepthChartExecutionPrice({ isIncrease: true, diff --git a/src/components/DropdownSelector/DropdownSelector.tsx b/src/components/DropdownSelector/DropdownSelector.tsx new file mode 100644 index 0000000000..ba8004140f --- /dev/null +++ b/src/components/DropdownSelector/DropdownSelector.tsx @@ -0,0 +1,71 @@ +import { Listbox } from "@headlessui/react"; +import cx from "classnames"; +import { BiChevronDown } from "react-icons/bi"; + +type Primitive = string | number; +type WithConditionalItemKey = Id extends Primitive + ? { itemKey?: (option: Option) => Id } + : { itemKey: (option: Option) => Id }; + +export const DropdownSelector = ({ + value, + onChange, + button, + options, + item: Item, + itemKey, + placeholder, + slim = false, + elevated = false, +}: { + value: Id | undefined; + onChange: (value: Id) => void; + button: React.JSX.Element | undefined; + options: Option[]; + item: ({ option }: { option: Option }) => React.JSX.Element; + placeholder?: string; + slim?: boolean; + elevated?: boolean; +} & WithConditionalItemKey) => { + return ( + +
+ + {value === undefined ?
{placeholder}
: button} + +
+ + {options.map((option) => ( + + cx( + "cursor-pointer", + slim ? "text-body-medium p-4" : "text-body-large px-14 py-8", + (active || selected) && (elevated ? "bg-cold-blue-500" : "bg-slate-600") + ) + } + > + + + ))} + +
+
+ ); +}; diff --git a/src/components/Errors/errorToasts.tsx b/src/components/Errors/errorToasts.tsx index e1677cb12a..42328bbe6f 100644 --- a/src/components/Errors/errorToasts.tsx +++ b/src/components/Errors/errorToasts.tsx @@ -27,7 +27,7 @@ export type AdditionalErrorParams = { defaultMessage?: ReactNode; isInternalSwapFallback?: boolean; isPermitIssue?: boolean; - setIsSettingsVisible: (isVisible: boolean) => void; + setIsSettingsVisible?: (isVisible: boolean) => void; }; export function getTxnErrorToast( @@ -156,7 +156,7 @@ export function getTxnErrorToast(

Please enable{" "} - {" "} under settings, which should offer a better experience. diff --git a/src/components/EventToast/useEventToast.tsx b/src/components/EventToast/useEventToast.tsx index 89bac84931..f6d12000cf 100644 --- a/src/components/EventToast/useEventToast.tsx +++ b/src/components/EventToast/useEventToast.tsx @@ -7,6 +7,7 @@ import { ARBITRUM } from "config/chains"; import { appEventsData, homeEventsData } from "config/events"; import useIncentiveStats from "domain/synthetics/common/useIncentiveStats"; import { useMarketsInfoRequest } from "domain/synthetics/markets"; +import { useTokensDataRequest } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; import { isHomeSite } from "lib/legacy"; @@ -15,8 +16,9 @@ import EventToast from "./EventToast"; function useEventToast() { const isHome = isHomeSite(); const [visited, setVisited] = useLocalStorage("visited-announcements", []); - const { chainId } = useChainId(); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const arbIncentiveStats = useIncentiveStats(ARBITRUM); const isAdaptiveFundingActiveSomeMarkets = useMemo(() => { diff --git a/src/components/ExpressTradingEnabledBanner/ExpressTradingEnabledBanner.tsx b/src/components/ExpressTradingEnabledBanner/ExpressTradingEnabledBanner.tsx index c13f23d2bf..55aa858fc8 100644 --- a/src/components/ExpressTradingEnabledBanner/ExpressTradingEnabledBanner.tsx +++ b/src/components/ExpressTradingEnabledBanner/ExpressTradingEnabledBanner.tsx @@ -20,11 +20,7 @@ export function ExpressTradingEnabledBanner() { } return ( - setIsExpressTradingBannerDismissed(true)} - > + setIsExpressTradingBannerDismissed(true)}> Express Trading is enabled. Enjoy smoother, more reliable trades! ); diff --git a/src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx b/src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx index 4318f367f5..77c4473b81 100644 --- a/src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +++ b/src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx @@ -2,9 +2,10 @@ import { Trans } from "@lingui/macro"; import { useCallback, useMemo } from "react"; import { useHistory } from "react-router-dom"; +import { useGmxAccountModalOpen } from "context/GmxAccountContext/hooks"; import { useChainId } from "lib/chains"; import { getGasPaymentTokens } from "sdk/configs/express"; -import { getToken } from "sdk/configs/tokens"; +import { getNativeToken, getToken } from "sdk/configs/tokens"; import { ColorfulBanner, ColorfulButtonLink } from "components/ColorfulBanner/ColorfulBanner"; @@ -35,23 +36,45 @@ export function useGasPaymentTokensText(chainId: number) { } export function ExpressTradingOutOfGasBanner({ onClose }: { onClose: () => void }) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const history = useHistory(); - + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); const { gasPaymentTokensText, gasPaymentTokenSymbols } = useGasPaymentTokensText(chainId); - const onClick = useCallback(() => { + const onBuyClick = useCallback(() => { history.push(`/trade/swap?to=${gasPaymentTokenSymbols[0]}`); onClose(); }, [history, onClose, gasPaymentTokenSymbols]); + const onDepositClick = useCallback(() => { + setGmxAccountModalOpen("deposit"); + onClose(); + }, [onClose, setGmxAccountModalOpen]); + + const hasEth = getNativeToken(chainId).symbol === "ETH"; return ( - Express and One-Click Trading are unavailable due to insufficient gas balance. -
- - Buy {gasPaymentTokensText} - + {srcChainId !== undefined ? ( + <> + {hasEth ? ( + Insufficient gas balance, please deposit more ETH or USDC. + ) : ( + Insufficient gas balance, please deposit more USDC. + )} +
+ + {hasEth ? Deposit USDC or ETH : Deposit USDC} + + + ) : ( + <> + Express and One-Click Trading are unavailable due to insufficient gas balance. +
+ + Buy {gasPaymentTokensText} + + + )}
); } diff --git a/src/components/GasPaymentTokenSelector/GasPaymentTokenSelector.tsx b/src/components/GasPaymentTokenSelector/GasPaymentTokenSelector.tsx index d38bc36cb1..bec84f441c 100644 --- a/src/components/GasPaymentTokenSelector/GasPaymentTokenSelector.tsx +++ b/src/components/GasPaymentTokenSelector/GasPaymentTokenSelector.tsx @@ -12,16 +12,17 @@ import { SelectorBase, useSelectorClose } from "components/Synthetics/SelectorBa import TokenIcon from "components/TokenIcon/TokenIcon"; type Props = { - curentTokenAddress: string; + currentTokenAddress: string | undefined; onSelectToken: (address: string) => void; }; -export function GasPaymentTokenSelector({ curentTokenAddress, onSelectToken }: Props) { - const { chainId } = useChainId(); - const { tokensData } = useTokensDataRequest(chainId); +export function GasPaymentTokenSelector({ currentTokenAddress, onSelectToken }: Props) { + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const gasPaymentTokens = getGasPaymentTokens(chainId); - const currentToken = getByKey(tokensData, curentTokenAddress); + const currentToken = getByKey(tokensData, currentTokenAddress); const onSelectFactory = useCallback( (tokenAddress: string) => () => { @@ -42,7 +43,7 @@ export function GasPaymentTokenSelector({ curentTokenAddress, onSelectToken }: P {currentToken && (
- + {formatTokenAmount(currentToken.balance, currentToken.decimals, undefined, { isStable: currentToken.isStable, })} @@ -85,9 +86,7 @@ function GasTokenOption({ token, onClick }: { token?: TokenData; onClick: () => >
- - {formatTokenAmount(token.balance, token.decimals)} - + {formatTokenAmount(token.balance, token.decimals)} {token.symbol}
{formatUsd(balanceUsd)}
diff --git a/src/components/Header/AppHeaderUser.tsx b/src/components/Header/AppHeaderChainAndSettings.tsx similarity index 63% rename from src/components/Header/AppHeaderUser.tsx rename to src/components/Header/AppHeaderChainAndSettings.tsx index 47b3735c28..d5cf08e758 100644 --- a/src/components/Header/AppHeaderUser.tsx +++ b/src/components/Header/AppHeaderChainAndSettings.tsx @@ -2,11 +2,22 @@ import { Trans } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { useCallback } from "react"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, getChainName } from "config/chains"; +import { + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, + getChainName, +} from "config/chains"; import { isDevelopment } from "config/env"; -import { getIcon } from "config/icons"; +import { getChainIcon, getIcon } from "config/icons"; +import { IS_SOURCE_BASE_ALLOWED } from "config/multichain"; import { useChainId } from "lib/chains"; -import { getAccountUrl, isHomeSite, shouldShowRedirectModal } from "lib/legacy"; +import { isHomeSite, shouldShowRedirectModal } from "lib/legacy"; import { sendUserAnalyticsConnectWalletClickEvent, userAnalytics } from "lib/userAnalytics"; import { LandingPageLaunchAppEvent } from "lib/userAnalytics/types"; import { useRedirectPopupTimestamp } from "lib/useRedirectPopupTimestamp"; @@ -16,7 +27,7 @@ import useWallet from "lib/wallets/useWallet"; import { OneClickButton } from "components/OneClickButton/OneClickButton"; import { HeaderLink } from "./HeaderLink"; -import AddressDropdown from "../AddressDropdown/AddressDropdown"; +import { AddressDropdown } from "../AddressDropdown/AddressDropdown"; import ConnectWalletButton from "../Common/ConnectWalletButton"; import LanguagePopupHome from "../NetworkDropdown/LanguagePopupHome"; import NetworkDropdown from "../NetworkDropdown/NetworkDropdown"; @@ -25,23 +36,28 @@ import "./Header.scss"; type Props = { openSettings: () => void; - small?: boolean; - disconnectAccountAndCloseSettings: () => void; showRedirectModal: (to: string) => void; menuToggle?: React.ReactNode; }; -const NETWORK_OPTIONS = [ +export type NetworkOption = { + label: string; + value: number; + icon: string; + color: string; +}; + +export const NETWORK_OPTIONS: NetworkOption[] = [ { label: getChainName(ARBITRUM), value: ARBITRUM, - icon: getIcon(ARBITRUM, "network"), + icon: getChainIcon(ARBITRUM), color: "#264f79", }, { label: getChainName(AVALANCHE), value: AVALANCHE, - icon: getIcon(AVALANCHE, "network"), + icon: getChainIcon(AVALANCHE), color: "#E841424D", }, { @@ -52,23 +68,47 @@ const NETWORK_OPTIONS = [ }, ]; -if (isDevelopment()) { +if (IS_SOURCE_BASE_ALLOWED) { NETWORK_OPTIONS.push({ - label: getChainName(AVALANCHE_FUJI), - value: AVALANCHE_FUJI, - icon: getIcon(AVALANCHE_FUJI, "network"), - color: "#E841424D", + label: getChainName(SOURCE_BASE_MAINNET), + value: SOURCE_BASE_MAINNET, + icon: getChainIcon(SOURCE_BASE_MAINNET), + color: "#0052ff", }); } -export function AppHeaderUser({ - small, - menuToggle, - openSettings, - disconnectAccountAndCloseSettings, - showRedirectModal, -}: Props) { - const { chainId } = useChainId(); +if (isDevelopment()) { + NETWORK_OPTIONS.push( + { + label: getChainName(AVALANCHE_FUJI), + value: AVALANCHE_FUJI, + icon: getChainIcon(AVALANCHE_FUJI), + color: "#E841424D", + }, + { + label: getChainName(ARBITRUM_SEPOLIA), + value: ARBITRUM_SEPOLIA, + icon: getChainIcon(ARBITRUM_SEPOLIA), + color: "#0052ff", + }, + { + label: getChainName(SOURCE_OPTIMISM_SEPOLIA), + value: SOURCE_OPTIMISM_SEPOLIA, + icon: getChainIcon(SOURCE_OPTIMISM_SEPOLIA), + color: "#ff0420", + }, + { + label: getChainName(SOURCE_SEPOLIA), + value: SOURCE_SEPOLIA, + icon: getChainIcon(SOURCE_SEPOLIA), + color: "#aa00ff", + } + ); +} + +export function AppHeaderChainAndSettings({ menuToggle, openSettings, showRedirectModal }: Props) { + const { chainId: settlementChainId, srcChainId } = useChainId(); + const { active, account } = useWallet(); const { openConnectModal } = useConnectModal(); const showConnectionOptions = !isHomeSite(); @@ -77,7 +117,7 @@ export function AppHeaderUser({ const tradeLink = tradePageVersion === 2 ? "/trade" : "/v1"; - const selectorLabel = getChainName(chainId); + const visualChainId = srcChainId ?? settlementChainId; const trackLaunchApp = useCallback(() => { userAnalytics.pushEvent( @@ -117,15 +157,10 @@ export function AppHeaderUser({ openConnectModal(); }} > - {small ? Connect : Connect Wallet} + Connect Wallet - {!small && } - + + ) : ( @@ -135,8 +170,6 @@ export function AppHeaderUser({ ); } - const accountUrl = getAccountUrl(chainId, account); - return (
{isHomeSite() ? ( @@ -154,20 +187,9 @@ export function AppHeaderUser({ {showConnectionOptions ? ( <> -
- -
- {!small && } - + + + ) : ( diff --git a/src/components/Header/Header.scss b/src/components/Header/Header.scss index b910ee97bd..4c5f7f2446 100644 --- a/src/components/Header/Header.scss +++ b/src/components/Header/Header.scss @@ -183,11 +183,6 @@ color: var(--color-typography-primary); } -.App-header-container-right { - display: flex; - align-items: center; -} - .App-header-user { display: flex; align-items: center; @@ -197,21 +192,7 @@ margin-right: 2.4rem; } -.App-header-user-address { - border: 0.5px solid var(--color-slate-600); - height: 3.6rem; - border-radius: 0.4rem; - display: inline-flex; - align-items: center; - color: var(--color-typography-primary); - position: relative; -} - @media (max-width: 1335px) { - .App-header-user-address { - padding: 0 0px; - } - .App-header-user-link { margin-right: 1.6rem; } @@ -224,11 +205,6 @@ padding-bottom: 0; } - .App-header-container-right { - display: flex; - align-items: center; - } - .App-header-link-desktop { display: none; } diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 2d68c3f630..cb08682b38 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -14,8 +14,8 @@ import { OneClickPromoBanner } from "components/OneClickPromoBanner/OneClickProm import logoImg from "img/logo_GMX.svg"; import logoSmallImg from "img/logo_GMX_small.svg"; +import { AppHeaderChainAndSettings } from "./AppHeaderChainAndSettings"; import { AppHeaderLinks } from "./AppHeaderLinks"; -import { AppHeaderUser } from "./AppHeaderUser"; import { HeaderLink } from "./HeaderLink"; import { HomeHeaderLinks } from "./HomeHeaderLinks"; @@ -39,12 +39,11 @@ const SLIDE_VARIANTS = { const TRANSITION = { duration: 0.2 }; type Props = { - disconnectAccountAndCloseSettings: () => void; openSettings: () => void; showRedirectModal: (to: string) => void; }; -export function Header({ disconnectAccountAndCloseSettings, openSettings, showRedirectModal }: Props) { +export function Header({ openSettings, showRedirectModal }: Props) { const isMobile = useMedia("(max-width: 1335px)"); const shouldHide1CTBanner = useMedia("(max-width: 1024px)"); @@ -116,18 +115,14 @@ export function Header({ disconnectAccountAndCloseSettings, openSettings, showRe )}
-
+
{!isHomeSite() ? ( -
+
) : null} - +
)} @@ -144,21 +139,17 @@ export function Header({ disconnectAccountAndCloseSettings, openSettings, showRe GMX Logo
-
+
{!shouldHide1CTBanner && } -
- - -
- } - /> -
+ + +
+ } + />
diff --git a/src/components/Modal/Modal.css b/src/components/Modal/Modal.css index 9005475088..558829c5cc 100644 --- a/src/components/Modal/Modal.css +++ b/src/components/Modal/Modal.css @@ -1,6 +1,10 @@ +:root { + --modal-z-index: 1001; +} + .Modal { position: fixed; - z-index: 1001; + z-index: var(--modal-z-index); top: 0; left: 0; right: 0; diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index e35a827d99..282b5667e5 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -35,6 +35,7 @@ export type ModalProps = PropsWithChildren<{ contentPadding?: boolean; qa?: string; contentClassName?: string; + disableOverflowHandling?: boolean; }>; export default function Modal({ @@ -50,6 +51,7 @@ export default function Modal({ setIsVisible, qa, contentClassName, + disableOverflowHandling = false, }: ModalProps) { const modalRef = useRef(null); @@ -122,9 +124,13 @@ export default function Modal({ {headerContent} -
-
{children}
-
+ {disableOverflowHandling ? ( + children + ) : ( +
+
{children}
+
+ )} {footerContent && ( <>
{footerContent}
diff --git a/src/components/Modal/SlideModal.tsx b/src/components/Modal/SlideModal.tsx index b591a80a39..a92428a315 100644 --- a/src/components/Modal/SlideModal.tsx +++ b/src/components/Modal/SlideModal.tsx @@ -279,7 +279,7 @@ function MobileSlideModal({
) { const isMobile = useMedia("(max-width: 700px)", false); @@ -356,6 +358,7 @@ export function SlideModal({ footerContent={footerContent} className={className} contentClassName={desktopContentClassName} + disableOverflowHandling={disableOverflowHandling} > {children} diff --git a/src/components/NetworkDropdown/LanguagePopupHome.tsx b/src/components/NetworkDropdown/LanguagePopupHome.tsx index 57cd4fe22c..f45997133b 100644 --- a/src/components/NetworkDropdown/LanguagePopupHome.tsx +++ b/src/components/NetworkDropdown/LanguagePopupHome.tsx @@ -9,7 +9,8 @@ import language24Icon from "img/ic_language24.svg"; import LanguageModalContent from "./LanguageModalContent"; import ModalWithPortal from "../Modal/ModalWithPortal"; -import "./NetworkDropdown.css"; + +import "./NetworkDropdown.scss"; export default function LanguagePopupHome() { const currentLanguage = useLingui().i18n.locale; diff --git a/src/components/NetworkDropdown/NetworkDropdown.css b/src/components/NetworkDropdown/NetworkDropdown.scss similarity index 76% rename from src/components/NetworkDropdown/NetworkDropdown.css rename to src/components/NetworkDropdown/NetworkDropdown.scss index b632b67b3a..f4c780ce6e 100644 --- a/src/components/NetworkDropdown/NetworkDropdown.css +++ b/src/components/NetworkDropdown/NetworkDropdown.scss @@ -137,15 +137,7 @@ height: 0.8rem; border-radius: 50%; } -.active-dot.Arbitrum { - background-color: #4275a8; -} -.active-dot.Avalanche { - background-color: #e84142; -} -.active-dot.Botanix { - background-color: #f7931a; -} + .network-dropdown-label { font-size: 1.25rem; margin-bottom: 0.8rem; @@ -166,3 +158,51 @@ padding: 0 0.8rem; } } + +.menu-items:focus-visible { + border: 1px solid #262638; +} + +.menu-items { + position: absolute; + right: 0; + top: 4.3rem; + min-width: 17rem; + width: 100%; + transform-origin: top right; + border-radius: 0.4rem; + overflow: hidden; + background: var(--color-slate-800); + border: 1px solid var(--color-stroke-primary); + list-style: none; + cursor: pointer; + outline: none; + z-index: 1000; + + .menu-item { + display: flex !important; + align-items: center; + color: var(--color-slate-100); + padding-bottom: 1.5rem; + font-size: var(--font-size-body-medium); + padding: 0.85rem 0.8rem; + border-radius: 0.4rem; + + &:hover { + background: #808aff14 !important; + border-radius: 0.4rem; + opacity: 1; + color: var(--color-gray-50); + } + + > p { + margin: 0px; + padding-left: 1rem; + white-space: nowrap; + } + + > a { + display: inline-flex; + } + } +} diff --git a/src/components/NetworkDropdown/NetworkDropdown.tsx b/src/components/NetworkDropdown/NetworkDropdown.tsx index 7f2604d7e6..870e712fa7 100644 --- a/src/components/NetworkDropdown/NetworkDropdown.tsx +++ b/src/components/NetworkDropdown/NetworkDropdown.tsx @@ -2,15 +2,16 @@ import { Menu } from "@headlessui/react"; import { t, Trans } from "@lingui/macro"; import cx from "classnames"; import noop from "lodash/noop"; -import { useState } from "react"; +import { useMemo, useState } from "react"; import { FiChevronDown } from "react-icons/fi"; +import { useAccount } from "wagmi"; -import { getIcon } from "config/icons"; -import { useChainId } from "lib/chains"; +import { getChainIcon } from "config/icons"; import { switchNetwork } from "lib/wallets"; -import useWallet from "lib/wallets/useWallet"; +import { getChainName } from "sdk/configs/chains"; import Button from "components/Button/Button"; +import type { NetworkOption } from "components/Header/AppHeaderChainAndSettings"; import type { ModalProps } from "components/Modal/Modal"; import SettingsIcon from "img/ic_settings.svg?react"; @@ -18,11 +19,15 @@ import SettingsIcon from "img/ic_settings.svg?react"; import SolanaNetworkItem from "./SolanaNetworkItem"; import ModalWithPortal from "../Modal/ModalWithPortal"; -import "./NetworkDropdown.css"; +import "./NetworkDropdown.scss"; const NETWORK_MODAL_KEY = "NETWORK"; -export default function NetworkDropdown(props) { +export default function NetworkDropdown(props: { + chainId: number; + networkOptions: NetworkOption[]; + openSettings: () => void; +}) { const [activeModal, setActiveModal] = useState(null); function getModalContent(modalName) { @@ -32,7 +37,7 @@ export default function NetworkDropdown(props) { ); @@ -64,20 +69,28 @@ export default function NetworkDropdown(props) { ); } -function NavIcons({ selectorLabel, open }) { - const { chainId } = useChainId(); - const icon = getIcon(chainId, "network"); +function NavIcons({ chainId, open }) { + const icon = getChainIcon(chainId); + const chainName = getChainName(chainId); return ( <> - {selectorLabel} + {chainName} ); } -function DesktopDropdown({ selectorLabel, networkOptions, openSettings }) { +function DesktopDropdown({ + chainId, + networkOptions, + openSettings, +}: { + chainId: number; + networkOptions: NetworkOption[]; + openSettings: () => void; +}) { return (
@@ -85,7 +98,7 @@ function DesktopDropdown({ selectorLabel, networkOptions, openSettings }) { <> @@ -93,7 +106,7 @@ function DesktopDropdown({ selectorLabel, networkOptions, openSettings }) { Network
- +
@@ -120,37 +133,10 @@ function DesktopDropdown({ selectorLabel, networkOptions, openSettings }) { ); } -function NetworkMenuItems({ networkOptions, selectorLabel }) { - const { active } = useWallet(); +function NetworkMenuItems({ networkOptions, chainId }: { networkOptions: NetworkOption[]; chainId: number }) { return networkOptions .map((network) => { - return ( - -
switchNetwork(network.value, active)} - > -
-
- {network.label} -
- - {network.label} - -
-
- {selectorLabel === network.label && ( -
- )} -
-
- - ); + return ; }) .concat( @@ -159,8 +145,49 @@ function NetworkMenuItems({ networkOptions, selectorLabel }) { ); } -function NetworkModalContent({ networkOptions, selectorLabel, setActiveModal, openSettings }) { - const { active } = useWallet(); +function NetworkMenuItem({ network, chainId }: { network: NetworkOption; chainId: number }) { + const { isConnected } = useAccount(); + + return ( + +
switchNetwork(network.value, isConnected)} + > +
+
+ {network.label} +
+ + {network.label} + +
+
+ {chainId === network.value && ( +
+ )} +
+
+ + ); +} + +function NetworkModalContent({ + networkOptions, + chainId, + setActiveModal, + openSettings, +}: { + networkOptions: NetworkOption[]; + chainId: number; + setActiveModal: (modal: string | null) => void; + openSettings: () => void; +}) { return (
@@ -169,15 +196,7 @@ function NetworkModalContent({ networkOptions, selectorLabel, setActiveModal, op {networkOptions.map((network) => { - return ( -
switchNetwork(network.value, active)} key={network.value}> -
- {network.label} - {network.label} -
-
-
- ); + return ; })} More Options @@ -201,3 +220,21 @@ function NetworkModalContent({ networkOptions, selectorLabel, setActiveModal, op
); } + +function NetworkModalOption({ network, chainId }: { network: NetworkOption; chainId: number }) { + const { isConnected } = useAccount(); + + const dotStyle = useMemo(() => { + return { backgroundColor: network.value === chainId ? network.color : undefined }; + }, [chainId, network.color, network.value]); + + return ( +
switchNetwork(network.value, isConnected)} key={network.value}> +
+ {network.label} + {network.label} +
+
+
+ ); +} diff --git a/src/components/NotifyModal/NotifyModal.tsx b/src/components/NotifyModal/NotifyModal.tsx index e0e600cd6c..6c63a20fd6 100644 --- a/src/components/NotifyModal/NotifyModal.tsx +++ b/src/components/NotifyModal/NotifyModal.tsx @@ -4,13 +4,13 @@ import { memo } from "react"; import { useNotifyModalState } from "lib/useNotifyModalState"; import ExternalLink from "components/ExternalLink/ExternalLink"; +import ModalWithPortal from "components/Modal/ModalWithPortal"; import ArrowBulletIcon from "img/arrow-bullet.svg?react"; import ExternalLinkIcon from "img/external-link.svg?react"; import NotifiLogoIcon from "img/notifi-logo.svg?react"; import Button from "../Button/Button"; -import Modal from "../Modal/Modal"; import "./NotifyModal.scss"; @@ -18,7 +18,7 @@ export function NotifyModal() { const { notifyModalOpen, setNotifyModalOpen } = useNotifyModalState(); return ( - +

@@ -52,7 +52,7 @@ export function NotifyModal() {

- + ); } diff --git a/src/components/Referrals/AddAffiliateCode.jsx b/src/components/Referrals/AddAffiliateCode.tsx similarity index 56% rename from src/components/Referrals/AddAffiliateCode.jsx rename to src/components/Referrals/AddAffiliateCode.tsx index ce5399f4a2..27cad108d7 100644 --- a/src/components/Referrals/AddAffiliateCode.jsx +++ b/src/components/Referrals/AddAffiliateCode.tsx @@ -1,13 +1,18 @@ import { Trans, t } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import cx from "classnames"; +import type { TransactionResponse } from "ethers"; import { useEffect, useRef, useState } from "react"; +import { useAccount } from "wagmi"; -import { ARBITRUM } from "config/chains"; +import { getChainName } from "config/chains"; +import type { ReferralCodeStats } from "domain/referrals/types"; +import { useChainId } from "lib/chains"; +import { useDebounce } from "lib/debounce/useDebounce"; import { helperToast } from "lib/helperToast"; -import { useDebounce } from "lib/useDebounce"; -import useWallet from "lib/wallets/useWallet"; +import { switchNetwork } from "lib/wallets"; +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; import Button from "components/Button/Button"; import { getCodeError, getReferralCodeTakenStatus, getSampleReferrarStat } from "./referralsHelper"; @@ -46,16 +51,23 @@ export function AffiliateCodeForm({ recentlyAddedCodes, setRecentlyAddedCodes, callAfterSuccess, +}: { + handleCreateReferralCode: (code: string) => Promise; + recentlyAddedCodes: ReferralCodeStats[] | undefined; + setRecentlyAddedCodes: (code: ReferralCodeStats[]) => void; + callAfterSuccess?: () => void; }) { const [referralCode, setReferralCode] = useState(""); const [isProcessing, setIsProcessing] = useState(false); const [error, setError] = useState(""); - const inputRef = useRef(""); + const inputRef = useRef(null); const [referralCodeCheckStatus, setReferralCodeCheckStatus] = useState("ok"); const debouncedReferralCode = useDebounce(referralCode, 300); - const { account, chainId } = useWallet(); + const { chainId, srcChainId } = useChainId(); + const { address: account, isConnected } = useAccount(); + useEffect(() => { - inputRef.current.focus(); + inputRef.current?.focus(); }, []); useEffect(() => { @@ -65,7 +77,7 @@ export function AffiliateCodeForm({ setReferralCodeCheckStatus("ok"); return; } - const { status: takenStatus } = await getReferralCodeTakenStatus(account, debouncedReferralCode, chainId); + const { takenStatus: takenStatus } = await getReferralCodeTakenStatus(account, debouncedReferralCode, chainId); // ignore the result if the referral code to check has changed if (cancelled) { return; @@ -83,65 +95,32 @@ export function AffiliateCodeForm({ }; }, [account, debouncedReferralCode, error, chainId]); - function getButtonError() { - if (!debouncedReferralCode) { - return t`Enter a code`; - } - if (referralCodeCheckStatus === "taken") { - return t`Code already taken`; - } - if (referralCodeCheckStatus === "checking") { - return t`Checking code`; - } - - return false; - } - - const buttonError = getButtonError(); - - function getPrimaryText() { - if (buttonError) { - return buttonError; - } - - if (isProcessing) { - return t`Creating`; - } - - return t`Create`; - } - function isPrimaryEnabled() { - if (buttonError) { - return false; - } - if (error || isProcessing) { - return false; - } - return true; - } - - async function handleSubmit(event) { + async function handleSubmit(event: React.FormEvent) { event.preventDefault(); setIsProcessing(true); + const trimmedCode = referralCode.trim(); - const { status: takenStatus, info: takenInfo } = await getReferralCodeTakenStatus(account, trimmedCode, chainId); + const { takenStatus, info: takenInfo } = await getReferralCodeTakenStatus(account, trimmedCode, chainId); if (["all", "current", "other"].includes(takenStatus)) { setIsProcessing(false); } if (takenStatus === "none" || takenStatus === "other") { - const ownerOnOtherNetwork = takenInfo[chainId === ARBITRUM ? "ownerAvax" : "ownerArbitrum"]; try { - const tx = await handleCreateReferralCode(trimmedCode); + const tx = (await handleCreateReferralCode(trimmedCode)) as TransactionResponse; + if (callAfterSuccess) { callAfterSuccess(); } + const receipt = await tx.wait(); - if (receipt.status === 1) { - recentlyAddedCodes.push(getSampleReferrarStat(trimmedCode, ownerOnOtherNetwork, account)); + if (receipt?.status === 1) { + if (recentlyAddedCodes) { + recentlyAddedCodes.push(getSampleReferrarStat({ code: trimmedCode, takenInfo, account })); + setRecentlyAddedCodes(recentlyAddedCodes); + } helperToast.success(t`Referral code created.`); - setRecentlyAddedCodes(recentlyAddedCodes); setReferralCode(""); } } catch (err) { @@ -153,8 +132,55 @@ export function AffiliateCodeForm({ } } + let buttonState: { + text: string; + disabled?: boolean; + onSubmit?: (event: React.FormEvent) => void; + } = { + text: "", + disabled: false, + onSubmit: undefined, + }; + + if (srcChainId !== undefined) { + buttonState = { + text: t`Switch to ${getChainName(chainId)}`, + disabled: false, + onSubmit: (event: React.FormEvent) => { + event.preventDefault(); + switchNetwork(chainId, isConnected); + }, + }; + } else if (!debouncedReferralCode) { + buttonState = { + text: t`Enter a code`, + disabled: true, + }; + } else if (referralCodeCheckStatus === "taken") { + buttonState = { + text: t`Code already taken`, + disabled: true, + }; + } else if (referralCodeCheckStatus === "checking") { + buttonState = { + text: t`Checking code`, + disabled: true, + }; + } else if (isProcessing) { + buttonState = { + text: t`Creating`, + disabled: true, + }; + } else { + buttonState = { + text: t`Create`, + disabled: false, + onSubmit: handleSubmit, + }; + } + return ( -
+ {error &&

{error}

} -
); diff --git a/src/components/Referrals/AffiliatesStats.tsx b/src/components/Referrals/AffiliatesStats.tsx index 1a2ea53683..3d6ef8f9a0 100644 --- a/src/components/Referrals/AffiliatesStats.tsx +++ b/src/components/Referrals/AffiliatesStats.tsx @@ -5,12 +5,13 @@ import { FiPlus, FiTwitter } from "react-icons/fi"; import { IoWarningOutline } from "react-icons/io5"; import { useCopyToClipboard } from "react-use"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, getExplorerUrl } from "config/chains"; +import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, ContractsChainId, getExplorerUrl, SourceChainId } from "config/chains"; import { isDevelopment } from "config/env"; import { RebateDistributionType, ReferralCodeStats, TotalReferralsStats, useTiers } from "domain/referrals"; import { useMarketsInfoRequest } from "domain/synthetics/markets"; import { useAffiliateRewards } from "domain/synthetics/referrals/useAffiliateRewards"; import { getTotalClaimableAffiliateRewardsUsd } from "domain/synthetics/referrals/utils"; +import { useTokensDataRequest } from "domain/synthetics/tokens"; import { formatDate } from "lib/dates"; import { helperToast } from "lib/helperToast"; import { shortenAddress } from "lib/legacy"; @@ -30,8 +31,6 @@ import Tooltip from "components/Tooltip/Tooltip"; import { TrackingLink } from "components/TrackingLink/TrackingLink"; import { AffiliateCodeForm } from "./AddAffiliateCode"; -import Card from "../Common/Card"; -import Modal from "../Modal/Modal"; import { ClaimAffiliatesModal } from "./ClaimAffiliatesModal/ClaimAffiliatesModal"; import EmptyMessage from "./EmptyMessage"; import { ReferralCodeWarnings } from "./ReferralCodeWarnings"; @@ -45,18 +44,23 @@ import { isRecentReferralCodeNotExpired, } from "./referralsHelper"; import usePagination, { DEFAULT_PAGE_SIZE } from "./usePagination"; +import Card from "../Common/Card"; +import Modal from "../Modal/Modal"; + import "./AffiliatesStats.scss"; type Props = { - chainId: number; + chainId: ContractsChainId; + srcChainId: SourceChainId | undefined; referralsData?: TotalReferralsStats; - handleCreateReferralCode: (code: string) => void; + handleCreateReferralCode: (code: string) => Promise; setRecentlyAddedCodes: (codes: ReferralCodeStats[]) => void; recentlyAddedCodes?: ReferralCodeStats[]; }; function AffiliatesStats({ chainId, + srcChainId, referralsData, recentlyAddedCodes, handleCreateReferralCode, @@ -66,7 +70,8 @@ function AffiliatesStats({ const [isAddReferralCodeModalOpen, setIsAddReferralCodeModalOpen] = useState(false); const addNewModalRef = useRef(null); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const { affiliateRewardsData } = useAffiliateRewards(chainId); const esGmxAddress = getTokenBySymbol(chainId, "esGMX").address; diff --git a/src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx b/src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx index a3029c076f..79d1df5d0d 100644 --- a/src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx +++ b/src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx @@ -6,7 +6,7 @@ import { claimAffiliateRewardsTxn } from "domain/synthetics/referrals/claimAffil import { AffiliateReward } from "domain/synthetics/referrals/types"; import { useAffiliateRewards } from "domain/synthetics/referrals/useAffiliateRewards"; import { getTotalClaimableAffiliateRewardsUsd } from "domain/synthetics/referrals/utils"; -import { convertToUsd } from "domain/synthetics/tokens"; +import { convertToUsd, useTokensDataRequest } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; import { formatTokenAmount, formatUsd } from "lib/numbers"; import { getByKey } from "lib/objects"; @@ -27,9 +27,10 @@ type Props = { export function ClaimAffiliatesModal(p: Props) { const { onClose, setPendingTxns = () => null } = p; const { account, signer } = useWallet(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const { affiliateRewardsData } = useAffiliateRewards(chainId); const [isSubmitting, setIsSubmitting] = useState(false); diff --git a/src/components/Referrals/JoinReferralCode.tsx b/src/components/Referrals/JoinReferralCode.tsx index 645800afc2..70bce1b5a3 100644 --- a/src/components/Referrals/JoinReferralCode.tsx +++ b/src/components/Referrals/JoinReferralCode.tsx @@ -1,13 +1,42 @@ -import { Trans, t } from "@lingui/macro"; +import { t, Trans } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; -import { useEffect, useRef, useState } from "react"; +import { Contract, Wallet } from "ethers"; +import { useEffect, useMemo, useRef, useState } from "react"; +import { ImSpinner2 } from "react-icons/im"; +import { encodeFunctionData, zeroAddress } from "viem"; +import { usePublicClient } from "wagmi"; +import { CHAIN_ID_PREFERRED_DEPOSIT_TOKEN, getMappedTokenId, isSettlementChain, IStargateAbi } from "config/multichain"; import { usePendingTxns } from "context/PendingTxnsContext/PendingTxnsContext"; +import { selectExpressGlobalParams } from "context/SyntheticsStateContext/selectors/expressSelectors"; +import { SyntheticsStateContextProvider } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { type MultichainAction, MultichainActionType } from "domain/multichain/codecs/CodecUiHelper"; +import { getMultichainTransferSendParams } from "domain/multichain/getSendParams"; +import { estimateMultichainDepositNetworkComposeGas } from "domain/multichain/useMultichainDepositNetworkComposeGas"; import { setTraderReferralCodeByUser, validateReferralCodeExists } from "domain/referrals/hooks"; -import { useDebounce } from "lib/useDebounce"; +import { getRawRelayerParams, RawRelayParamsPayload, RelayParamsPayload } from "domain/synthetics/express"; +import { signSetTraderReferralCode } from "domain/synthetics/express/expressOrderUtils"; +import { convertToUsd, getMidPrice } from "domain/tokens"; +import { useChainId } from "lib/chains"; +import { useDebounce } from "lib/debounce/useDebounce"; +import { helperToast } from "lib/helperToast"; +import { formatUsd, numberToBigint } from "lib/numbers"; +import { useJsonRpcProvider } from "lib/rpc"; +import { sendWalletTransaction } from "lib/transactions"; +import { useThrottledAsync } from "lib/useThrottledAsync"; import useWallet from "lib/wallets/useWallet"; +import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; +import { getEmptyExternalCallsPayload } from "sdk/utils/orderTransactions"; +import { encodeReferralCode } from "sdk/utils/referrals"; +import { nowInSeconds } from "sdk/utils/time"; +import type { IStargate } from "typechain-types-stargate"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; import Button from "components/Button/Button"; +import { useMultichainTokensRequest } from "components/Synthetics/GmxAccountModal/hooks"; +import { toastCustomOrStargateError } from "components/Synthetics/GmxAccountModal/toastCustomOrStargateError"; +import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; import { REFERRAL_CODE_REGEX } from "./referralsHelper"; @@ -16,14 +45,14 @@ function JoinReferralCode({ active }: { active: boolean }) { return (

- Enter Referral Code + Enter referral code

Please input a referral code to benefit from fee discounts.

{active ? ( - + ) : ( ); } + +function ReferralCodeFormMultichain({ + userReferralCodeString = "", + type = "join", + callAfterSuccess, +}: { + callAfterSuccess?: () => void; + userReferralCodeString?: string; + type?: string; +}) { + const { chainId, srcChainId } = useChainId(); + const { account, signer } = useWallet(); + const { provider } = useJsonRpcProvider(chainId); + const [referralCode, setReferralCode] = useState(""); + const inputRef = useRef(null); + const [isValidating, setIsValidating] = useState(false); + const [isSubmitting, setIsSubmitting] = useState(false); + const [referralCodeExists, setReferralCodeExists] = useState(true); + const debouncedReferralCode = useDebounce(referralCode, 300); + const settlementChainPublicClient = usePublicClient({ chainId }); + const { tokenChainDataArray: multichainTokens } = useMultichainTokensRequest(); + + const simulationSigner = useMemo(() => { + if (!signer?.provider) { + return; + } + + return new Wallet("0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", signer?.provider); + }, [signer?.provider]); + + const globalExpressParams = useSelector(selectExpressGlobalParams); + + const referralCodeHex = useMemo(() => encodeReferralCode(referralCode), [referralCode]); + + const depositTokenAddress = useMemo(() => { + const tokens = multichainTokens.filter( + (token) => + token.sourceChainId === srcChainId && token.sourceChainBalance !== undefined && token.sourceChainBalance > 0n + ); + + if (tokens.length === 0) { + return; + } + + const preferredToken = tokens.find((token) => token.address === CHAIN_ID_PREFERRED_DEPOSIT_TOKEN[chainId]); + + if (preferredToken) { + return preferredToken.address; + } + + return tokens[0].address; + }, [chainId, multichainTokens, srcChainId]); + + const sourceChainTokenId = useMemo(() => { + if (depositTokenAddress === undefined || srcChainId === undefined || !isSettlementChain(chainId)) { + return; + } + + return getMappedTokenId(chainId, depositTokenAddress, srcChainId); + }, [chainId, depositTokenAddress, srcChainId]); + + const result = useThrottledAsync( + async ({ params: p }) => { + if (p.sourceChainTokenId === undefined) { + throw new Error("sourceChainTokenId is undefined"); + } + + const rawRelayParamsPayload = getRawRelayerParams({ + chainId: p.chainId, + gasPaymentTokenAddress: p.globalExpressParams.gasPaymentTokenAddress, + relayerFeeTokenAddress: p.globalExpressParams.relayerFeeTokenAddress, + feeParams: { + feeToken: p.globalExpressParams.relayerFeeTokenAddress, + feeAmount: 0n, + feeSwapPath: [], + }, + externalCalls: getEmptyExternalCallsPayload(), + tokenPermits: [], + marketsInfoData: p.globalExpressParams.marketsInfoData, + }) as RawRelayParamsPayload; + + const relayParams: RelayParamsPayload = { + ...rawRelayParamsPayload, + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }; + + const signature = await signSetTraderReferralCode({ + chainId: p.chainId, + srcChainId: p.srcChainId, + signer: p.simulationSigner, + relayParams, + referralCode: p.referralCodeHex, + }); + + const action: MultichainAction = { + actionType: MultichainActionType.SetTraderReferralCode, + actionData: { + relayParams, + signature, + referralCode: p.referralCodeHex, + }, + }; + + const composeGas = await estimateMultichainDepositNetworkComposeGas({ + action, + chainId: p.chainId, + account: p.simulationSigner.address, + srcChainId: p.srcChainId, + tokenAddress: p.depositTokenAddress, + settlementChainPublicClient: p.settlementChainPublicClient, + }); + + const sourceChainStargateAddress = p.sourceChainTokenId.stargate; + + const iStargateInstance = new Contract(sourceChainStargateAddress, IStargateAbi, signer) as unknown as IStargate; + + const tokenAmount = numberToBigint(0.02, p.sourceChainTokenId.decimals); + + const sendParamsWithRoughAmount = getMultichainTransferSendParams({ + isDeposit: true, + dstChainId: p.chainId, + account: p.simulationSigner.address, + inputAmount: tokenAmount, + srcChainId: p.srcChainId, + composeGas, + action, + }); + + const [limit, oftFeeDetails] = await iStargateInstance.quoteOFT(sendParamsWithRoughAmount); + + let negativeFee = 0n; + for (const oftFeeDetail of oftFeeDetails) { + negativeFee += oftFeeDetail[0]; + } + + const minAmount = limit.minAmountLD === 0n ? 1n : limit.minAmountLD; + + let amountBeforeFee = minAmount - negativeFee; + amountBeforeFee = (amountBeforeFee * 15n) / 10n; + + const sendParamsWithMinimumAmount: SendParamStruct = { + ...sendParamsWithRoughAmount, + + amountLD: amountBeforeFee, + minAmountLD: 0, + }; + + const quoteSend = await iStargateInstance.quoteSend(sendParamsWithMinimumAmount, false); + + return { + nativeFee: quoteSend.nativeFee, + amount: amountBeforeFee, + composeGas, + }; + }, + { + throttleMs: 1000, + params: + provider !== undefined && + srcChainId !== undefined && + settlementChainPublicClient !== undefined && + globalExpressParams !== undefined && + simulationSigner !== undefined && + referralCodeHex !== undefined && + account !== undefined && + sourceChainTokenId !== undefined && + depositTokenAddress !== undefined + ? { + provider, + chainId, + srcChainId, + settlementChainPublicClient, + globalExpressParams, + simulationSigner, + referralCodeHex, + account, + sourceChainTokenId, + depositTokenAddress, + } + : undefined, + } + ); + + const networkFeeUsd = useMemo(() => { + if (result.data === undefined || globalExpressParams?.tokensData[zeroAddress].prices === undefined) { + return; + } + + return convertToUsd(result.data.nativeFee, 18, getMidPrice(globalExpressParams?.tokensData[zeroAddress].prices)); + }, [globalExpressParams?.tokensData, result.data]); + + async function handleSubmit(event: React.FormEvent) { + event.preventDefault(); + + if (!account || srcChainId === undefined) { + return; + } + + setIsSubmitting(true); + + try { + if ( + sourceChainTokenId === undefined || + provider === undefined || + globalExpressParams === undefined || + signer === undefined || + result.data === undefined + ) { + throw new Error("Missing required parameters"); + } + + const rawRelayParamsPayload = getRawRelayerParams({ + chainId: chainId, + gasPaymentTokenAddress: globalExpressParams.gasPaymentTokenAddress, + relayerFeeTokenAddress: globalExpressParams.relayerFeeTokenAddress, + feeParams: { + feeToken: globalExpressParams.relayerFeeTokenAddress, + feeAmount: 0n, + feeSwapPath: [], + }, + externalCalls: getEmptyExternalCallsPayload(), + tokenPermits: [], + marketsInfoData: globalExpressParams.marketsInfoData, + }); + + const relayParamsPayload: RelayParamsPayload = { + ...rawRelayParamsPayload, + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }; + + const signature = await signSetTraderReferralCode({ + chainId, + srcChainId, + signer, + relayParams: relayParamsPayload, + referralCode: referralCodeHex, + }); + + const action: MultichainAction = { + actionType: MultichainActionType.SetTraderReferralCode, + actionData: { + relayParams: relayParamsPayload, + signature, + referralCode: referralCodeHex, + }, + }; + + const sendParams: SendParamStruct = getMultichainTransferSendParams({ + dstChainId: chainId, + account, + srcChainId, + inputAmount: result.data.amount, + composeGas: result.data.composeGas, + isDeposit: true, + action, + }); + + const sourceChainStargateAddress = sourceChainTokenId.stargate; + + const txnResult = await sendWalletTransaction({ + chainId: srcChainId, + to: sourceChainStargateAddress, + signer: signer, + callData: encodeFunctionData({ + abi: IStargateAbi, + functionName: "sendToken", + args: [sendParams, { nativeFee: result.data.nativeFee, lzTokenFee: 0n }, account], + }), + value: result.data.nativeFee as bigint, + msg: t`Sent referral code transaction`, + }); + + const receipt = await txnResult.wait(); + + if (callAfterSuccess) { + callAfterSuccess(); + } + + if (receipt.status === "success") { + setReferralCode(""); + } + + helperToast.success( + <> + Referral code added! +
+
+ It will take a couple of minutes to be reflected. Please check back later. + + ); + } catch (error) { + toastCustomOrStargateError(chainId, error); + } finally { + setIsSubmitting(false); + setIsValidating(false); + } + } + + let buttonState: { + text: React.ReactNode; + disabled?: boolean; + onSubmit?: (event: React.FormEvent) => void; + } = { + text: "", + }; + const isEdit = type === "edit"; + + if (isEdit && debouncedReferralCode === userReferralCodeString) { + buttonState = { + text: t`Same as current active code`, + disabled: true, + }; + } else if (isEdit && isSubmitting) { + buttonState = { + text: t`Updating`, + disabled: true, + }; + } else if (isSubmitting) { + buttonState = { + text: t`Adding`, + disabled: true, + }; + } else if (debouncedReferralCode === "") { + buttonState = { + text: t`Enter referral code`, + disabled: true, + }; + } else if (isValidating) { + buttonState = { + text: t`Checking code`, + disabled: true, + }; + } else if (!referralCodeExists) { + buttonState = { + text: t`Referral code does not exist`, + disabled: true, + }; + } else if (result.isLoading || !result.data) { + buttonState = { + text: ( + <> + Loading + + + ), + disabled: true, + }; + } else if (isEdit) { + buttonState = { + text: t`Update`, + disabled: false, + onSubmit: handleSubmit, + }; + } else { + buttonState = { + text: t`Submit`, + disabled: false, + onSubmit: handleSubmit, + }; + } + + useEffect(() => { + let cancelled = false; + async function checkReferralCode() { + if (debouncedReferralCode === "" || !REFERRAL_CODE_REGEX.test(debouncedReferralCode)) { + setIsValidating(false); + setReferralCodeExists(false); + return; + } + + setIsValidating(true); + const codeExists = await validateReferralCodeExists(debouncedReferralCode, chainId); + if (!cancelled) { + setReferralCodeExists(codeExists); + setIsValidating(false); + } + } + checkReferralCode(); + return () => { + cancelled = true; + }; + }, [debouncedReferralCode, chainId]); + + useEffect(() => { + inputRef.current?.focus(); + }, []); + + return ( +
+ { + const { value } = target; + setReferralCode(value); + }} + /> + {srcChainId && ( + + )} + + + + ); +} + +export function ReferralCodeEditFormContainer({ + callAfterSuccess = undefined, + userReferralCodeString = "", + type = "join", +}: { + callAfterSuccess?: () => void; + userReferralCodeString?: string; + type?: string; +}) { + const { srcChainId } = useChainId(); + + if (srcChainId === undefined) { + return ( + + ); + } + + return ( + + + + ); +} + export default JoinReferralCode; diff --git a/src/components/Referrals/TradersStats.tsx b/src/components/Referrals/TradersStats.tsx index 1dbd2917f6..90e8c3fc48 100644 --- a/src/components/Referrals/TradersStats.tsx +++ b/src/components/Referrals/TradersStats.tsx @@ -1,9 +1,9 @@ -import { Trans, t } from "@lingui/macro"; +import { t, Trans } from "@lingui/macro"; import { useRef, useState } from "react"; import { BiEditAlt } from "react-icons/bi"; import { IoWarningOutline } from "react-icons/io5"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, getExplorerUrl } from "config/chains"; +import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, getExplorerUrl, ContractsChainId } from "config/chains"; import { isDevelopment } from "config/env"; import { TotalReferralsStats, useTiers } from "domain/referrals"; import { formatDate } from "lib/dates"; @@ -19,7 +19,7 @@ import { TableTd, TableTh, TableTheadTr, TableTr } from "components/Table/Table" import { TableScrollFadeContainer } from "components/TableScrollFade/TableScrollFade"; import EmptyMessage from "./EmptyMessage"; -import { ReferralCodeForm } from "./JoinReferralCode"; +import { ReferralCodeEditFormContainer } from "./JoinReferralCode"; import ReferralInfoCard from "./ReferralInfoCard"; import { getSharePercentage, getTierIdDisplay, getUSDValue, tierDiscountInfo } from "./referralsHelper"; import usePagination, { DEFAULT_PAGE_SIZE } from "./usePagination"; @@ -32,7 +32,7 @@ import "./TradersStats.scss"; type Props = { referralsData?: TotalReferralsStats; traderTier?: number; - chainId: number; + chainId: ContractsChainId; userReferralCodeString?: string; discountShare: bigint | undefined; }; @@ -195,7 +195,7 @@ function TradersStats({ referralsData, traderTier, chainId, userReferralCodeStri onAfterOpen={() => editModalRef.current?.focus()} >
- setIsEditModalOpen(false)} diff --git a/src/components/Referrals/referralsHelper.js b/src/components/Referrals/referralsHelper.js deleted file mode 100644 index f5a4f6cc4f..0000000000 --- a/src/components/Referrals/referralsHelper.js +++ /dev/null @@ -1,159 +0,0 @@ -import { t } from "@lingui/macro"; - -import { ARBITRUM, AVALANCHE } from "config/chains"; -import { BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; -import { getReferralCodeOwner } from "domain/referrals"; -import { MAX_REFERRAL_CODE_LENGTH, REFERRAL_CODE_QUERY_PARAM, getTwitterIntentURL, isAddressZero } from "lib/legacy"; -import { deserializeBigIntsInObject, formatAmount, removeTrailingZeros } from "lib/numbers"; -import { getRootUrl } from "lib/url"; -import { bigMath } from "sdk/utils/bigmath"; -import { encodeReferralCode } from "sdk/utils/referrals"; - -export const REFERRAL_CODE_REGEX = /^\w+$/; // only number, string and underscore is allowed -export const REGEX_VERIFY_BYTES32 = /^0x[0-9a-f]{64}$/; - -export function isRecentReferralCodeNotExpired(referralCodeInfo) { - const REFERRAL_DATA_MAX_TIME = 60000 * 5; // 5 minutes - if (referralCodeInfo.time) { - return referralCodeInfo.time + REFERRAL_DATA_MAX_TIME > Date.now(); - } -} - -export async function getReferralCodeTakenStatus(account, referralCode, chainId) { - const referralCodeBytes32 = encodeReferralCode(referralCode); - const [ownerArbitrum, ownerAvax] = await Promise.all([ - getReferralCodeOwner(ARBITRUM, referralCodeBytes32), - getReferralCodeOwner(AVALANCHE, referralCodeBytes32), - ]); - - const takenOnArb = - !isAddressZero(ownerArbitrum) && (ownerArbitrum !== account || (ownerArbitrum === account && chainId === ARBITRUM)); - const takenOnAvax = - !isAddressZero(ownerAvax) && (ownerAvax !== account || (ownerAvax === account && chainId === AVALANCHE)); - - const referralCodeTakenInfo = { - [ARBITRUM]: takenOnArb, - [AVALANCHE]: takenOnAvax, - both: takenOnArb && takenOnAvax, - ownerArbitrum, - ownerAvax, - }; - - if (referralCodeTakenInfo.both) { - return { status: "all", info: referralCodeTakenInfo }; - } - if (referralCodeTakenInfo[chainId]) { - return { status: "current", info: referralCodeTakenInfo }; - } - if (chainId === AVALANCHE ? referralCodeTakenInfo[ARBITRUM] : referralCodeTakenInfo[AVALANCHE]) { - return { status: "other", info: referralCodeTakenInfo }; - } - return { status: "none", info: referralCodeTakenInfo }; -} - -export function getTierIdDisplay(tierId) { - return Number(tierId) + 1; -} - -export const tierRebateInfo = { - 0: 5, - 1: 10, - 2: 15, -}; - -export const tierDiscountInfo = { - 0: 5, - 1: 10, - 2: 10, -}; - -export function getSharePercentage(tierId, discountShare, totalRebate, isRebate) { - if (tierId === undefined || totalRebate === undefined) return; - if (discountShare === undefined || discountShare === 0n) - return isRebate ? tierRebateInfo[tierId] : tierDiscountInfo[tierId]; - const decimals = 4; - - const discount = bigMath.mulDiv( - totalRebate * (isRebate ? BASIS_POINTS_DIVISOR_BIGINT - discountShare : discountShare), - BigInt(Math.pow(10, decimals)), - BASIS_POINTS_DIVISOR_BIGINT - ); - - const discountPercentage = discount / 100n; - return removeTrailingZeros(formatAmount(discountPercentage, decimals, 3, true)); -} - -function areObjectsWithSameKeys(obj1, obj2) { - return Object.keys(obj1).every((key) => key in obj2); -} - -export function deserializeSampleStats(input) { - const parsedData = JSON.parse(input); - if (!Array.isArray(parsedData)) return []; - return parsedData - .map((data) => { - if (!areObjectsWithSameKeys(getSampleReferrarStat(), data)) return null; - return deserializeBigIntsInObject(data); - }) - .filter(Boolean); -} - -export const getSampleReferrarStat = (code = "", ownerOnOtherNetwork = "", account = "") => { - return { - discountUsd: 0n, - referralCode: code, - totalRebateUsd: 0n, - tradedReferralsCount: 0, - registeredReferralsCount: 0, - trades: 0, - volume: 0n, - time: Date.now(), - v1Data: { - volume: 0n, - totalRebateUsd: 0n, - discountUsd: 0n, - }, - v2Data: { - volume: 0n, - totalRebateUsd: 0n, - discountUsd: 0n, - }, - ownerOnOtherChain: { - code: encodeReferralCode(code), - codeString: code, - owner: undefined, - isTaken: !isAddressZero(ownerOnOtherNetwork), - isTakenByCurrentUser: - !isAddressZero(ownerOnOtherNetwork) && ownerOnOtherNetwork.toLowerCase() === account.toLowerCase(), - }, - }; -}; - -export function getUSDValue(value, decimals = 2) { - return formatAmount(value, USD_DECIMALS, decimals, true, "0.00"); -} - -export function getCodeError(value) { - const trimmedValue = value.trim(); - if (!trimmedValue) return ""; - - if (trimmedValue.length > MAX_REFERRAL_CODE_LENGTH) { - return t`The referral code can't be more than ${MAX_REFERRAL_CODE_LENGTH} characters.`; - } - - if (!REFERRAL_CODE_REGEX.test(trimmedValue)) { - return t`Only letters, numbers and underscores are allowed.`; - } - return ""; -} - -export function getReferralCodeTradeUrl(referralCode) { - return `${getRootUrl()}/#/trade/?${REFERRAL_CODE_QUERY_PARAM}=${referralCode}`; -} - -export function getTwitterShareUrl(referralCode) { - const message = ["Trying out trading on @GMX_IO, up to 100x leverage on $BTC, $ETH 📈", "For fee discounts use:"]; - const shareURL = getReferralCodeTradeUrl(referralCode); - - return getTwitterIntentURL(message, shareURL); -} diff --git a/src/components/Referrals/referralsHelper.ts b/src/components/Referrals/referralsHelper.ts new file mode 100644 index 0000000000..d7cb164162 --- /dev/null +++ b/src/components/Referrals/referralsHelper.ts @@ -0,0 +1,237 @@ +import { t } from "@lingui/macro"; +import identity from "lodash/identity"; +import { zeroAddress } from "viem"; + +import { CONTRACTS_CHAIN_IDS, ContractsChainId } from "config/chains"; +import { BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; +import { CodeOwnershipInfo, getReferralCodeOwner, ReferralCodeStats } from "domain/referrals"; +import { getTwitterIntentURL, isAddressZero, MAX_REFERRAL_CODE_LENGTH, REFERRAL_CODE_QUERY_PARAM } from "lib/legacy"; +import { deserializeBigIntsInObject, formatAmount, removeTrailingZeros } from "lib/numbers"; +import { getRootUrl } from "lib/url"; +import { bigMath } from "sdk/utils/bigmath"; +import { encodeReferralCode } from "sdk/utils/referrals"; + +export const REFERRAL_CODE_REGEX = /^\w+$/; // only number, string and underscore is allowed +export const REGEX_VERIFY_BYTES32 = /^0x[0-9a-f]{64}$/; + +export function isRecentReferralCodeNotExpired(referralCodeInfo) { + const REFERRAL_DATA_MAX_TIME = 60000 * 5; // 5 minutes + if (referralCodeInfo.time) { + return referralCodeInfo.time + REFERRAL_DATA_MAX_TIME > Date.now(); + } +} + +type TakenStatus = "all" | "current" | "other" | "none"; +type TakenInfo = Partial< + Record< + ContractsChainId, + { + taken: boolean; + owner: string; + } + > +> & { + all: boolean; +}; + +export async function getReferralCodeTakenStatus( + account: string | undefined, + referralCode: string, + chainId: ContractsChainId +): Promise<{ + takenStatus: TakenStatus; + info: TakenInfo; +}> { + const referralCodeBytes32 = encodeReferralCode(referralCode); + + const ownerMap: Partial> = {}; + + await Promise.all( + CONTRACTS_CHAIN_IDS.map(async (otherChainId) => { + const res = await getReferralCodeOwner(otherChainId, referralCodeBytes32); + ownerMap[otherChainId] = res; + }) + ); + + const takenMap: Partial> = {}; + + for (const otherChainId of CONTRACTS_CHAIN_IDS) { + // const takenOnArb = + // !isAddressZero(ownerArbitrum) && (ownerArbitrum !== account || (ownerArbitrum === account && chainId === ARBITRUM)); + const owner = ownerMap[otherChainId]; + const takenOnOtherChain = + !isAddressZero(owner) && (owner !== account || (owner === account && chainId === otherChainId)); + + takenMap[otherChainId] = takenOnOtherChain; + } + + const allTaken = Object.values(takenMap).every(identity); + const someTaken = Object.values(takenMap).some(identity); + + const referralCodeTakenInfo: TakenInfo = { + all: allTaken, + }; + + for (const otherChainId of CONTRACTS_CHAIN_IDS) { + referralCodeTakenInfo[otherChainId] = { + taken: takenMap[otherChainId] ?? false, + owner: ownerMap[otherChainId] ?? zeroAddress, + }; + } + + if (referralCodeTakenInfo.all) { + return { takenStatus: "all", info: referralCodeTakenInfo }; + } + if (referralCodeTakenInfo[chainId]?.taken) { + return { takenStatus: "current", info: referralCodeTakenInfo }; + } + + if (!referralCodeTakenInfo[chainId]?.taken && someTaken) { + return { takenStatus: "other", info: referralCodeTakenInfo }; + } + + return { takenStatus: "none", info: referralCodeTakenInfo }; +} + +export function getTierIdDisplay(tierId) { + return Number(tierId) + 1; +} + +export const tierRebateInfo = { + 0: 5, + 1: 10, + 2: 15, +}; + +export const tierDiscountInfo = { + 0: 5, + 1: 10, + 2: 10, +}; + +export function getSharePercentage( + tierId: number | undefined, + discountShare: bigint | undefined, + totalRebate: bigint, + isRebate?: boolean +) { + if (tierId === undefined || totalRebate === undefined) return; + if (discountShare === undefined || discountShare === 0n) + return isRebate ? tierRebateInfo[tierId] : tierDiscountInfo[tierId]; + const decimals = 4; + + const discount = bigMath.mulDiv( + totalRebate * (isRebate ? BASIS_POINTS_DIVISOR_BIGINT - discountShare : discountShare), + BigInt(Math.pow(10, decimals)), + BASIS_POINTS_DIVISOR_BIGINT + ); + + const discountPercentage = discount / 100n; + return removeTrailingZeros(formatAmount(discountPercentage, decimals, 3, true)); +} + +function areObjectsWithSameKeys(obj1, obj2) { + return Object.keys(obj1).every((key) => key in obj2); +} + +export function deserializeSampleStats(input) { + const parsedData = JSON.parse(input); + if (!Array.isArray(parsedData)) return []; + return parsedData + .map((data) => { + if (!areObjectsWithSameKeys(getSampleReferrarStat(), data)) return null; + return deserializeBigIntsInObject(data); + }) + .filter(Boolean); +} + +export const getSampleReferrarStat = ({ + code = "", + account = "", + takenInfo, +}: { + code?: string; + takenInfo?: TakenInfo; + account?: string; +} = {}): ReferralCodeStats => { + return { + discountUsd: 0n, + referralCode: code, + totalRebateUsd: 0n, + tradedReferralsCount: 0, + registeredReferralsCount: 0, + trades: 0, + volume: 0n, + // time: Date.now(), + + v1Data: { + volume: 0n, + totalRebateUsd: 0n, + discountUsd: 0n, + affiliateRebateUsd: 0n, + }, + v2Data: { + volume: 0n, + totalRebateUsd: 0n, + discountUsd: 0n, + affiliateRebateUsd: 0n, + }, + // ownerOnOtherChain: { + // code: encodeReferralCode(code), + // codeString: code, + // owner: undefined, + // isTaken: !isAddressZero(ownerOnOtherNetwork), + // isTakenByCurrentUser: + // !isAddressZero(ownerOnOtherNetwork) && ownerOnOtherNetwork.toLowerCase() === account.toLowerCase(), + // }, + affiliateRebateUsd: 0n, + allOwnersOnOtherChains: takenInfo + ? Object.fromEntries( + CONTRACTS_CHAIN_IDS.map((chainId): [ContractsChainId, CodeOwnershipInfo] | undefined => { + const taken = takenInfo[chainId]; + if (!taken) return undefined; + + return [ + chainId, + { + code: encodeReferralCode(code), + codeString: code, + owner: taken.owner, + isTaken: taken.taken, + isTakenByCurrentUser: taken.owner.toLowerCase() === account.toLowerCase(), + }, + ]; + }).filter(Boolean) as [ContractsChainId, CodeOwnershipInfo][] + ) + : undefined, + }; +}; + +export function getUSDValue(value, decimals = 2) { + return formatAmount(value, USD_DECIMALS, decimals, true, "0.00"); +} + +export function getCodeError(value) { + const trimmedValue = value.trim(); + if (!trimmedValue) return ""; + + if (trimmedValue.length > MAX_REFERRAL_CODE_LENGTH) { + return t`The referral code can't be more than ${MAX_REFERRAL_CODE_LENGTH} characters.`; + } + + if (!REFERRAL_CODE_REGEX.test(trimmedValue)) { + return t`Only letters, numbers and underscores are allowed.`; + } + return ""; +} + +export function getReferralCodeTradeUrl(referralCode) { + return `${getRootUrl()}/#/trade/?${REFERRAL_CODE_QUERY_PARAM}=${referralCode}`; +} + +export function getTwitterShareUrl(referralCode) { + const message = ["Trying out trading on @GMX_IO, up to 100x leverage on $BTC, $ETH 📈", "For fee discounts use:"]; + const shareURL = getReferralCodeTradeUrl(referralCode); + + return getTwitterIntentURL(message, shareURL); +} diff --git a/src/components/SearchInput/SearchInput.tsx b/src/components/SearchInput/SearchInput.tsx index 5416fa06bb..42fc6963d1 100644 --- a/src/components/SearchInput/SearchInput.tsx +++ b/src/components/SearchInput/SearchInput.tsx @@ -22,6 +22,7 @@ type Props = { */ autoFocus?: boolean; qa?: string; + noBorder?: boolean; }; export default function SearchInput({ @@ -33,6 +34,7 @@ export default function SearchInput({ autoFocus, size = "m", qa = "token-search-input", + noBorder, }: Props) { const isSmallerScreen = useMedia("(max-width: 700px)"); const inputRef = React.useRef(null); @@ -88,10 +90,11 @@ export default function SearchInput({ onFocus={handleFocus} autoFocus={autoFocus ?? !isSmallerScreen} className={cx( - "block w-full rounded-8 border bg-slate-800 leading-1 placeholder-slate-100 hover:bg-fill-surfaceElevatedHover", + "block w-full rounded-8 bg-slate-800 leading-1 placeholder-slate-100 hover:bg-fill-surfaceElevatedHover", { - "border-blue-300": isFocused, - "border-slate-800": !isFocused, + border: !noBorder, + "border-blue-300": isFocused && !noBorder, + "border-slate-800": !isFocused && !noBorder, "p-8 pl-32 text-[13px]": size === "m", "py-[8.5px] pl-34 pr-30 text-14 ": size === "s", } diff --git a/src/components/SettingsModal/SettingsModal.tsx b/src/components/SettingsModal/SettingsModal.tsx index ced20dbf6b..110c85378d 100644 --- a/src/components/SettingsModal/SettingsModal.tsx +++ b/src/components/SettingsModal/SettingsModal.tsx @@ -4,6 +4,7 @@ import { useCallback, useEffect, useMemo, useState } from "react"; import { isDevelopment } from "config/env"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useSubaccountContext } from "context/SubaccountContext/SubaccountContextProvider"; +import { useChainId } from "lib/chains"; import { helperToast } from "lib/helperToast"; import { useLocalizedMap } from "lib/i18n"; import { roundToTwoDecimals } from "lib/numbers"; @@ -40,6 +41,8 @@ export function SettingsModal({ isSettingsVisible: boolean; setIsSettingsVisible: (value: boolean) => void; }) { + const { srcChainId } = useChainId(); + const settings = useSettings(); const subaccountState = useSubaccountContext(); @@ -140,6 +143,13 @@ export function SettingsModal({ switch (mode) { case TradingMode.Classic: { + if (srcChainId) { + // eslint-disable-next-line no-console + console.error("Express trading can not be disabled for multichain"); + setTradingMode(prevMode); + setIsTradingModeChanging(false); + return; + } if (subaccountState.subaccount) { const isSubaccountDeactivated = await subaccountState.tryDisableSubaccount(); @@ -188,7 +198,7 @@ export function SettingsModal({ } } }, - [settings, subaccountState, tradingMode] + [settings, srcChainId, subaccountState, tradingMode] ); useEffect( diff --git a/src/components/SettingsModal/TradingSettings.tsx b/src/components/SettingsModal/TradingSettings.tsx index d512c22ed1..77b7b88282 100644 --- a/src/components/SettingsModal/TradingSettings.tsx +++ b/src/components/SettingsModal/TradingSettings.tsx @@ -1,11 +1,15 @@ import { Trans } from "@lingui/macro"; -import { BOTANIX } from "config/chains"; +import { BOTANIX, getChainName } from "config/chains"; import { DEFAULT_SLIPPAGE_AMOUNT } from "config/factors"; import { getIsExpressSupported } from "config/features"; +import { CHAIN_ID_TO_NETWORK_ICON } from "config/icons"; +import { MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING } from "config/multichain"; import { DEFAULT_TIME_WEIGHTED_NUMBER_OF_PARTS } from "config/twap"; +import { useGmxAccountSettlementChainId } from "context/GmxAccountContext/hooks"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useSubaccountContext } from "context/SubaccountContext/SubaccountContextProvider"; +import { SettlementChainWarningContainer } from "domain/multichain/SettlementChainWarningContainer"; import { useIsOutOfGasPaymentBalance } from "domain/synthetics/express/useIsOutOfGasPaymentBalance"; import { getIsSubaccountActive } from "domain/synthetics/subaccount"; import { useChainId } from "lib/chains"; @@ -13,6 +17,7 @@ import { EMPTY_ARRAY } from "lib/objects"; import { useIsGeminiWallet } from "lib/wallets/useIsGeminiWallet"; import { ColorfulBanner } from "components/ColorfulBanner/ColorfulBanner"; +import { DropdownSelector } from "components/DropdownSelector/DropdownSelector"; import { ExpressTradingOutOfGasBanner } from "components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner"; import ExternalLink from "components/ExternalLink/ExternalLink"; import { GasPaymentTokenSelector } from "components/GasPaymentTokenSelector/GasPaymentTokenSelector"; @@ -25,7 +30,7 @@ import ExpressIcon from "img/ic_express.svg?react"; import HourGlassIcon from "img/ic_hourglass.svg?react"; import OneClickIcon from "img/ic_one_click.svg?react"; -import { SettingsSection, InputSetting, SettingButton, Chip, TradingMode } from "./shared"; +import { Chip, InputSetting, SettingButton, SettingsSection, TradingMode } from "./shared"; interface TradingSettingsProps { tradingMode: TradingMode | undefined; @@ -48,12 +53,13 @@ export function TradingSettings({ numberOfParts, onClose, }: TradingSettingsProps) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const settings = useSettings(); const subaccountState = useSubaccountContext(); const isOutOfGasPaymentBalance = useIsOutOfGasPaymentBalance(); const isGeminiWallet = useIsGeminiWallet(); - const isExpressTradingDisabled = isOutOfGasPaymentBalance || isGeminiWallet; + const [settlementChainId, setSettlementChainId] = useGmxAccountSettlementChainId(); + const isExpressTradingDisabled = (isOutOfGasPaymentBalance && srcChainId === undefined) || isGeminiWallet; return (
@@ -63,23 +69,24 @@ export function TradingSettings({
Trading Mode
- - Classic} - description={On-chain signing for every transaction.} - info={ - - Your wallet, your keys. -
-
- You sign each transaction on-chain using your own RPC, typically provided by your wallet. Gas payments - in ETH. -
- } - icon={} - active={tradingMode === TradingMode.Classic} - onClick={() => handleTradingModeChange(TradingMode.Classic)} - /> + {!srcChainId && ( + Classic} + description={On-chain signing for every transaction.} + info={ + + Your wallet, your keys. +
+
+ You sign each transaction on-chain using your own RPC, typically provided by your wallet. Gas + payments in ETH. +
+ } + icon={} + active={tradingMode === TradingMode.Classic} + onClick={() => handleTradingModeChange(TradingMode.Classic)} + /> + )} Express} @@ -149,7 +156,7 @@ export function TradingSettings({
@@ -158,6 +165,41 @@ export function TradingSettings({ )} + {srcChainId && ( + +
+ Network for Cross-Chain Deposits and positions.} + handle={Settlement Chain} + /> + ( +
+ {getChainName(option)} + {getChainName(option)} +
+ )} + button={ +
+ {getChainName(settlementChainId)} + {getChainName(settlementChainId)} +
+ } + /> +
+ +
+ )} + Default Allowed Slippage} diff --git a/src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx b/src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx new file mode 100644 index 0000000000..56d533d0fd --- /dev/null +++ b/src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx @@ -0,0 +1,36 @@ +import { Trans } from "@lingui/macro"; +import { useAccount } from "wagmi"; + +import { getChainName } from "config/chains"; +import { MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING } from "config/multichain"; +import { switchNetwork } from "lib/wallets"; + +import Button from "components/Button/Button"; + +import { needSwitchToSettlementChain } from "./utils"; + +export function SwitchToSettlementChainButtons({ children }: { children: React.ReactNode }) { + const { chainId: walletChainId, isConnected } = useAccount(); + + if (!needSwitchToSettlementChain(walletChainId)) { + return children; + } + + return ( +
+ {MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[walletChainId].map((chainId) => ( + + ))} +
+ ); +} diff --git a/src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx b/src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx new file mode 100644 index 0000000000..331fe1baf8 --- /dev/null +++ b/src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx @@ -0,0 +1,66 @@ +import { Trans } from "@lingui/macro"; +import { useAccount } from "wagmi"; + +import { getChainName } from "config/chains"; +import { MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING } from "config/multichain"; + +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; + +import { needSwitchToSettlementChain } from "./utils"; + +export function SwitchToSettlementChainWarning({ topic }: { topic: "liquidity" | "staking" | "vesting" }) { + const { chainId: walletChainId } = useAccount(); + + if (!needSwitchToSettlementChain(walletChainId)) { + return null; + } + + const multipleChains = MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[walletChainId].length > 1; + const chainNames = multipleChains + ? MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[walletChainId].slice(0, -1).map(getChainName).join(", ") + : getChainName(MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[walletChainId][0]); + const lastChainName = getChainName(MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[walletChainId].slice(-1)[0]); + + let message: React.ReactNode = ""; + if (topic === "liquidity") { + message = multipleChains ? ( + + Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or{" "} + {lastChainName} to access earning opportunities. + + ) : ( + + Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning + opportunities. + + ); + } else if (topic === "staking") { + message = multipleChains ? ( + + Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName}{" "} + to access earning opportunities. + + ) : ( + + Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities. + + ); + } else if (topic === "vesting") { + message = multipleChains ? ( + + Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName}{" "} + to access earning opportunities. + + ) : ( + + Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities. + + ); + } + + return ( + + {message} + + ); +} diff --git a/src/components/SwitchToSettlementChain/utils.ts b/src/components/SwitchToSettlementChain/utils.ts new file mode 100644 index 0000000000..5961330b01 --- /dev/null +++ b/src/components/SwitchToSettlementChain/utils.ts @@ -0,0 +1,6 @@ +import { SourceChainId } from "config/chains"; +import { isSourceChain, isSettlementChain } from "config/multichain"; + +export function needSwitchToSettlementChain(walletChainId: number | undefined): walletChainId is SourceChainId { + return Boolean(walletChainId && isSourceChain(walletChainId) && !isSettlementChain(walletChainId)); +} diff --git a/src/components/Synthetics/ClaimModal/ClaimModal.tsx b/src/components/Synthetics/ClaimModal/ClaimModal.tsx index 7413ceacd9..64b7517fe3 100644 --- a/src/components/Synthetics/ClaimModal/ClaimModal.tsx +++ b/src/components/Synthetics/ClaimModal/ClaimModal.tsx @@ -1,18 +1,29 @@ import { Trans, t } from "@lingui/macro"; -import { useState } from "react"; +import { useCallback, useMemo, useState } from "react"; +import { ImSpinner2 } from "react-icons/im"; +import { toast } from "react-toastify"; +import { TOAST_AUTO_CLOSE_TIME } from "config/ui"; import { useMarketsInfoData } from "context/SyntheticsStateContext/hooks/globalsHooks"; +import { useArbitraryRelayParamsAndPayload } from "domain/multichain/arbitraryRelayParams"; +import { ExpressTransactionBuilder, RawRelayParamsPayload } from "domain/synthetics/express"; import { MarketInfo, getMarketIndexName, getMarketPoolName, getTotalClaimableFundingUsd, } from "domain/synthetics/markets"; -import { claimFundingFeesTxn } from "domain/synthetics/markets/claimFundingFeesTxn"; +import { buildAndSignClaimFundingFeesTxn, claimFundingFeesTxn } from "domain/synthetics/markets/claimFundingFeesTxn"; import { convertToUsd } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; +import { helperToast } from "lib/helperToast"; +import { metrics } from "lib/metrics"; import { formatDeltaUsd, formatTokenAmount } from "lib/numbers"; +import { useJsonRpcProvider } from "lib/rpc"; +import { sendExpressTransaction } from "lib/transactions"; import useWallet from "lib/wallets/useWallet"; +import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; +import { nowInSeconds } from "sdk/utils/time"; import Button from "components/Button/Button"; import Modal from "components/Modal/Modal"; @@ -27,6 +38,17 @@ type Props = { }; export function ClaimModal(p: Props) { + const { isVisible, onClose, setPendingTxns } = p; + const { srcChainId } = useChainId(); + + if (srcChainId === undefined) { + return ; + } else { + return ; + } +} + +export function ClaimModalSettlementChain(p: Props) { const { isVisible, onClose, setPendingTxns } = p; const { account, signer } = useWallet(); const { chainId } = useChainId(); @@ -34,6 +56,256 @@ export function ClaimModal(p: Props) { const [isSubmitting, setIsSubmitting] = useState(false); + const onSubmit = useCallback(() => { + if (!account || !signer) return; + + const fundingMarketAddresses: string[] = []; + const fundingTokenAddresses: string[] = []; + + const pairs = new Set(); + + function pushPair(marketAddress: string, tokenAddress: string) { + const key = `${marketAddress}-${tokenAddress}`; + if (pairs.has(key)) return; + pairs.add(key); + fundingMarketAddresses.push(marketAddress); + fundingTokenAddresses.push(tokenAddress); + } + + const markets = isVisible ? Object.values(marketsInfoData || {}) : []; + for (const market of markets) { + if (market.claimableFundingAmountLong !== undefined && market.claimableFundingAmountLong !== 0n) { + pushPair(market.marketTokenAddress, market.longTokenAddress); + } + + if (market.claimableFundingAmountShort !== undefined && market.claimableFundingAmountShort !== 0n) { + pushPair(market.marketTokenAddress, market.shortTokenAddress); + } + } + + setIsSubmitting(true); + + claimFundingFeesTxn(chainId, signer, { + account, + fundingFees: { + marketAddresses: fundingMarketAddresses, + tokenAddresses: fundingTokenAddresses, + }, + setPendingTxns, + }) + .then(onClose) + .finally(() => setIsSubmitting(false)); + }, [account, chainId, isVisible, marketsInfoData, onClose, setPendingTxns, signer]); + + const buttonState = useMemo(() => { + if (isSubmitting) { + return { + text: t`Claiming...`, + disabled: true, + }; + } else { + return { + text: t`Claim`, + onClick: onSubmit, + }; + } + }, [isSubmitting, onSubmit]); + + return ; +} + +export function ClaimModalMultichain(p: Props) { + const { isVisible, onClose } = p; + const { account, signer } = useWallet(); + const { chainId, srcChainId } = useChainId(); + const marketsInfoData = useMarketsInfoData(); + const { provider } = useJsonRpcProvider(chainId); + const [isSubmitting, setIsSubmitting] = useState(false); + + const { fundingMarketAddresses, fundingTokenAddresses } = useMemo(() => { + const fundingMarketAddresses: string[] = []; + const fundingTokenAddresses: string[] = []; + + const pairs = new Set(); + + function pushPair(marketAddress: string, tokenAddress: string) { + const key = `${marketAddress}-${tokenAddress}`; + if (pairs.has(key)) return; + pairs.add(key); + fundingMarketAddresses.push(marketAddress); + fundingTokenAddresses.push(tokenAddress); + } + + const markets = isVisible ? Object.values(marketsInfoData || {}) : []; + for (const market of markets) { + if (market.claimableFundingAmountLong !== undefined && market.claimableFundingAmountLong !== 0n) { + pushPair(market.marketTokenAddress, market.longTokenAddress); + } + + if (market.claimableFundingAmountShort !== undefined && market.claimableFundingAmountShort !== 0n) { + pushPair(market.marketTokenAddress, market.shortTokenAddress); + } + } + + return { + fundingMarketAddresses, + fundingTokenAddresses, + }; + }, [isVisible, marketsInfoData]); + + const expressTransactionBuilder: ExpressTransactionBuilder | undefined = useMemo(() => { + if (!account || !signer || !provider || fundingMarketAddresses.length === 0 || isSubmitting) { + return undefined; + } + + return async (params) => { + const txnData = await buildAndSignClaimFundingFeesTxn({ + chainId, + markets: fundingMarketAddresses, + tokens: fundingTokenAddresses, + receiver: account, + account, + signer, + relayParams: { + ...(params.relayParams as RawRelayParamsPayload), + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + relayerFeeAmount: params.gasPaymentParams.relayerFeeAmount, + relayerFeeTokenAddress: params.gasPaymentParams.relayerFeeTokenAddress, + emptySignature: true, + }); + + return { + txnData, + }; + }; + }, [account, chainId, fundingMarketAddresses, fundingTokenAddresses, isSubmitting, provider, signer]); + + const expressTxnParamsAsyncResult = useArbitraryRelayParamsAndPayload({ + expressTransactionBuilder, + isGmxAccount: srcChainId !== undefined, + }); + + const onSubmit = useCallback(() => { + const onMissingParams = () => { + helperToast.error(t`No necessary params to claim. Retry in a few seconds.`); + metrics.pushError(new Error("No necessary params to claim"), "expressClaimFundingFees"); + }; + + if (!account || !signer || !expressTxnParamsAsyncResult.promise || !provider) { + onMissingParams(); + return; + } + + setIsSubmitting(true); + + expressTxnParamsAsyncResult.promise + .then(async (expressTxnParams) => { + if (!expressTxnParams) { + onMissingParams(); + return; + } + + const txnData = await buildAndSignClaimFundingFeesTxn({ + chainId, + markets: fundingMarketAddresses, + tokens: fundingTokenAddresses, + receiver: account, + signer, + account, + relayParams: { + ...(expressTxnParams.relayParamsPayload as RawRelayParamsPayload), + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + relayerFeeAmount: expressTxnParams.gasPaymentParams.relayerFeeAmount, + relayerFeeTokenAddress: expressTxnParams.gasPaymentParams.relayerFeeTokenAddress, + }); + + const request = await sendExpressTransaction({ + chainId, + isSponsoredCall: expressTxnParams.isSponsoredCall, + txnData, + }); + + helperToast.success( +
+
+ Claiming funding fees +
+ +
, + { autoClose: false, toastId: "funding-claimed" } + ); + request.wait().then((res) => { + if (res.status === "success") { + toast.update("funding-claimed", { + render: t`Success claiming funding fees`, + type: "success", + autoClose: TOAST_AUTO_CLOSE_TIME, + }); + } else if (res.status === "failed") { + toast.update("funding-claimed", { + render: t`Claiming funding fees failed`, + type: "error", + autoClose: TOAST_AUTO_CLOSE_TIME, + }); + } + }); + + onClose(); + }) + .finally(() => { + setIsSubmitting(false); + }); + }, [ + account, + chainId, + expressTxnParamsAsyncResult.promise, + fundingMarketAddresses, + fundingTokenAddresses, + onClose, + provider, + signer, + ]); + + const buttonState = useMemo(() => { + if (isSubmitting) { + return { + text: t`Claiming...`, + disabled: true, + }; + } + + if (!expressTxnParamsAsyncResult.data) { + return { + text: ( + <> + Loading + + + ), + disabled: true, + }; + } + + return { + text: t`Claim`, + onClick: onSubmit, + }; + }, [expressTxnParamsAsyncResult.data, isSubmitting, onSubmit]); + + return ; +} + +function ClaimModalComponent(p: { + isVisible: boolean; + onClose: () => void; + buttonState: { text: React.ReactNode; onClick?: () => void; disabled?: boolean }; +}) { + const { isVisible, onClose, buttonState } = p; + + const marketsInfoData = useMarketsInfoData(); + const markets = isVisible ? Object.values(marketsInfoData || {}) : []; const totalClaimableFundingUsd = getTotalClaimableFundingUsd(markets); @@ -98,46 +370,6 @@ export function ClaimModal(p: Props) { ); } - function onSubmit() { - if (!account || !signer) return; - - const fundingMarketAddresses: string[] = []; - const fundingTokenAddresses: string[] = []; - - const pairs = new Set(); - - function pushPair(marketAddress: string, tokenAddress: string) { - const key = `${marketAddress}-${tokenAddress}`; - if (pairs.has(key)) return; - pairs.add(key); - fundingMarketAddresses.push(marketAddress); - fundingTokenAddresses.push(tokenAddress); - } - - for (const market of markets) { - if (market.claimableFundingAmountLong !== undefined && market.claimableFundingAmountLong !== 0n) { - pushPair(market.marketTokenAddress, market.longTokenAddress); - } - - if (market.claimableFundingAmountShort !== undefined && market.claimableFundingAmountShort !== 0n) { - pushPair(market.marketTokenAddress, market.shortTokenAddress); - } - } - - setIsSubmitting(true); - - claimFundingFeesTxn(chainId, signer, { - account, - fundingFees: { - marketAddresses: fundingMarketAddresses, - tokenAddresses: fundingTokenAddresses, - }, - setPendingTxns, - }) - .then(onClose) - .finally(() => setIsSubmitting(false)); - } - return (
{markets.map(renderMarketSection)}
- ); diff --git a/src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx b/src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx index 518e34f34c..133bb91cb4 100644 --- a/src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +++ b/src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx @@ -1,6 +1,9 @@ -import { Trans, t } from "@lingui/macro"; +import { t, Trans } from "@lingui/macro"; import { memo, useCallback, useMemo, useState } from "react"; +import { ImSpinner2 } from "react-icons/im"; +import { toast } from "react-toastify"; +import { TOAST_AUTO_CLOSE_TIME } from "config/ui"; import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { useMarketInfo } from "context/SyntheticsStateContext/hooks/marketHooks"; import { @@ -9,14 +12,26 @@ import { selectClaimsPriceImpactClaimableTotal, } from "context/SyntheticsStateContext/selectors/claimsSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; -import { createClaimCollateralTxn } from "domain/synthetics/claimHistory/claimPriceImpactRebate"; +import { useArbitraryRelayParamsAndPayload } from "domain/multichain/arbitraryRelayParams"; +import { + buildAndSignClaimPositionPriceImpactFeesTxn, + createClaimCollateralTxn, +} from "domain/synthetics/claimHistory/claimPriceImpactRebate"; +import { ExpressTransactionBuilder, RawRelayParamsPayload } from "domain/synthetics/express"; import { RebateInfoItem } from "domain/synthetics/fees/useRebatesInfo"; import { getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; import { getTokenData } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; +import { helperToast } from "lib/helperToast"; +import { metrics } from "lib/metrics"; import { expandDecimals, formatDeltaUsd, formatTokenAmount } from "lib/numbers"; +import { useJsonRpcProvider } from "lib/rpc"; +import { sendExpressTransaction } from "lib/transactions"; +import { switchNetwork } from "lib/wallets"; import useWallet from "lib/wallets/useWallet"; +import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; import { bigMath } from "sdk/utils/bigmath"; +import { nowInSeconds } from "sdk/utils/time"; import Button from "components/Button/Button"; import Modal from "components/Modal/Modal"; @@ -28,24 +43,37 @@ export function ClaimablePositionPriceImpactRebateModal({ }: { isVisible: boolean; onClose: () => void; +}) { + const { srcChainId } = useChainId(); + + return srcChainId !== undefined ? ( + + ) : ( + + ); +} + +function ClaimablePositionPriceImpactRebateModalSettlementChain({ + isVisible, + onClose, +}: { + isVisible: boolean; + onClose: () => void; }) { const [isSubmitting, setIsSubmitting] = useState(false); - const { chainId } = useChainId(); - const total = useSelector(selectClaimsPriceImpactClaimableTotal); - const totalUsd = useMemo(() => formatDeltaUsd(total), [total]); - const { signer, account } = useWallet(); - const groups = useSelector(selectClaimsGroupedPositionPriceImpactClaimableFees); + const { chainId, srcChainId } = useChainId(); + const { signer, account, active } = useWallet(); const claimablePositionPriceImpactFees = useSelector(selectClaimablePositionPriceImpactFees); - const [buttonText, buttonDisabled] = useMemo(() => { - if (isSubmitting) return [t`Claiming`, true]; - return [t`Claim`, false]; - }, [isSubmitting]); - const handleSubmit = useCallback(async () => { if (!signer) throw new Error("No signer"); if (!account) throw new Error("No account"); + if (srcChainId !== undefined) { + switchNetwork(chainId, active); + return; + } + setIsSubmitting(true); try { @@ -57,7 +85,197 @@ export function ClaimablePositionPriceImpactRebateModal({ } finally { setIsSubmitting(false); } - }, [account, chainId, claimablePositionPriceImpactFees, onClose, signer]); + }, [account, active, chainId, claimablePositionPriceImpactFees, onClose, signer, srcChainId]); + + const buttonState: { + text: string; + disabled?: boolean; + onSubmit?: () => void; + } = useMemo(() => { + if (isSubmitting) { + return { text: t`Claiming`, disabled: true }; + } + return { text: t`Claim`, disabled: false, onSubmit: handleSubmit }; + }, [handleSubmit, isSubmitting]); + + return ( + + ); +} + +function ClaimablePositionPriceImpactRebateModalMultichain({ + isVisible, + onClose, +}: { + isVisible: boolean; + onClose: () => void; +}) { + const [isSubmitting, setIsSubmitting] = useState(false); + const { chainId, srcChainId } = useChainId(); + const { signer, account } = useWallet(); + const claimablePositionPriceImpactFees = useSelector(selectClaimablePositionPriceImpactFees); + const { provider } = useJsonRpcProvider(chainId); + + const expressTransactionBuilder = useMemo((): ExpressTransactionBuilder | undefined => { + if ( + srcChainId === undefined || + account === undefined || + signer === undefined || + provider === undefined || + isSubmitting + ) { + return undefined; + } + + return async (params) => { + const txnData = await buildAndSignClaimPositionPriceImpactFeesTxn({ + signer, + relayParams: { + ...(params.relayParams as RawRelayParamsPayload), + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + account, + claimablePositionPriceImpactFees, + receiver: account, + chainId, + emptySignature: true, + relayerFeeTokenAddress: params.gasPaymentParams.relayerFeeTokenAddress, + relayerFeeAmount: params.gasPaymentParams.relayerFeeAmount, + }); + + return { + txnData, + }; + }; + }, [account, chainId, claimablePositionPriceImpactFees, isSubmitting, provider, signer, srcChainId]); + + const expressTxnParamsAsyncResult = useArbitraryRelayParamsAndPayload({ + expressTransactionBuilder, + isGmxAccount: srcChainId !== undefined, + }); + + const handleSubmit = useCallback(async () => { + const onMissingParams = () => { + helperToast.error(t`No necessary params to claim. Retry in a few seconds.`); + metrics.pushError(new Error("No necessary params to claim"), "expressClaimPositionPriceImpactFees"); + }; + + if (!expressTxnParamsAsyncResult.promise) { + onMissingParams(); + return; + } + + setIsSubmitting(true); + expressTxnParamsAsyncResult.promise + .then(async (params) => { + if (!params || !signer || !account || !provider) { + onMissingParams(); + return; + } + + const txnData = await buildAndSignClaimPositionPriceImpactFeesTxn({ + signer, + relayParams: { + ...(params.relayParamsPayload as RawRelayParamsPayload), + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + account, + claimablePositionPriceImpactFees, + receiver: account, + chainId, + relayerFeeTokenAddress: params.gasPaymentParams.relayerFeeTokenAddress, + relayerFeeAmount: params.gasPaymentParams.relayerFeeAmount, + }); + + const request = await sendExpressTransaction({ + chainId, + isSponsoredCall: params.isSponsoredCall, + txnData, + }); + + helperToast.success( +
+
+ Claiming position price impact fees +
+ +
, + { + autoClose: false, + toastId: "position-price-impact-fees", + } + ); + request.wait().then((res) => { + if (res.status === "success") { + toast.update("position-price-impact-fees", { + render: t`Success claiming position price impact fees`, + type: "success", + autoClose: TOAST_AUTO_CLOSE_TIME, + }); + } else if (res.status === "failed") { + toast.update("position-price-impact-fees", { + render: t`Claiming position price impact fees failed`, + type: "error", + autoClose: TOAST_AUTO_CLOSE_TIME, + }); + } + }); + + onClose(); + }) + .finally(() => { + setIsSubmitting(false); + }); + }, [ + account, + chainId, + claimablePositionPriceImpactFees, + expressTxnParamsAsyncResult.promise, + onClose, + provider, + signer, + ]); + + const buttonState: { + text: string; + disabled?: boolean; + onSubmit?: () => void; + } = useMemo(() => { + if (isSubmitting) { + return { text: t`Claiming`, disabled: true }; + } + return { text: t`Claim`, disabled: false, onSubmit: handleSubmit }; + }, [handleSubmit, isSubmitting]); + + return ( + + ); +} + +function ClaimablePositionPriceImpactRebateModalComponent({ + isVisible, + onClose, + buttonState, +}: { + isVisible: boolean; + onClose: () => void; + buttonState: { + text: string; + disabled?: boolean; + onSubmit?: () => void; + }; +}) { + const total = useSelector(selectClaimsPriceImpactClaimableTotal); + const totalUsd = useMemo(() => formatDeltaUsd(total), [total]); + const groups = useSelector(selectClaimsGroupedPositionPriceImpactClaimableFees); return (
- ); diff --git a/src/components/Synthetics/CollateralSelector/CollateralSelector.tsx b/src/components/Synthetics/CollateralSelector/CollateralSelector.tsx index 67139a8f0a..8fa0d3f5d3 100644 --- a/src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +++ b/src/components/Synthetics/CollateralSelector/CollateralSelector.tsx @@ -9,9 +9,7 @@ import { selectTradeboxTradeType, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; -import type { MarketInfo } from "domain/synthetics/markets"; import type { TokenData } from "domain/synthetics/tokens/types"; -import type { TradeType } from "domain/synthetics/trade"; import { helperToast } from "lib/helperToast"; import { TableTd } from "components/Table/Table"; @@ -37,7 +35,7 @@ type Props = { onSelect: (tokenAddress: string) => void; }; -export function CollateralSelector(props: Props & { marketInfo?: MarketInfo; tradeType: TradeType }) { +export function CollateralSelector(props: Props) { const isMobile = useMedia(`(max-width: ${SELECTOR_BASE_MOBILE_THRESHOLD}px)`); return ( diff --git a/src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx b/src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx new file mode 100644 index 0000000000..c1202ef562 --- /dev/null +++ b/src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx @@ -0,0 +1,216 @@ +import { t, Trans } from "@lingui/macro"; +import React, { useCallback, useEffect } from "react"; +import { TbArrowRight } from "react-icons/tb"; +import { toast } from "react-toastify"; +import { useMedia } from "react-use"; + +import { ContractsChainId, getChainName } from "config/chains"; +import { getChainIcon } from "config/icons"; +import type { TokenData } from "domain/synthetics/tokens/types"; +import { formatBalanceAmount } from "lib/numbers"; + +import { TableTd } from "components/Table/Table"; +import TokenIcon from "components/TokenIcon/TokenIcon"; + +import { + SELECTOR_BASE_MOBILE_THRESHOLD, + SelectorBase, + SelectorBaseDesktopRow, + SelectorBaseMobileButton, + SelectorBaseMobileList, + useSelectorClose, +} from "../SelectorBase/SelectorBase"; + +import "./CollateralSelector.scss"; + +type Props = { + chainId: ContractsChainId; + // eslint-disable-next-line react/no-unused-prop-types + selectedTokenSymbol?: string; + // eslint-disable-next-line react/no-unused-prop-types + isCollateralTokenFromGmxAccount: boolean; + options: TokenData[] | undefined; + onSelect: (tokenAddress: string, isGmxAccount: boolean) => void; + variant?: "balance" | "destination"; +}; + +export function PositionEditorCollateralSelector(props: Props) { + const isMobile = useMedia(`(max-width: ${SELECTOR_BASE_MOBILE_THRESHOLD}px)`); + + return ( + + + {props.selectedTokenSymbol} +
+ ) : ( + "..." + ) + } + modalLabel={t`Collateral In`} + qa="collateral-in-selector" + > + {isMobile ? : } + + ); +} + +function CollateralSelectorDesktop(props: Props) { + const close = useSelectorClose(); + + return ( + + + {props.options?.map((option) => ( + { + props.onSelect(option.address, Boolean(option.isGmxAccount)); + close(); + }} + chainId={props.chainId} + tokenData={option} + variant={props.variant} + /> + ))} + +
+ ); +} + +function CollateralListItemDesktop({ + variant, + chainId, + tokenData, + onSelect, +}: { + variant?: "balance" | "destination"; + chainId: ContractsChainId; + tokenData: TokenData; + onSelect: () => void; +}) { + const handleClick = useCallback( + (e: React.MouseEvent) => { + e.stopPropagation(); + e.preventDefault(); + + onSelect(); + }, + [onSelect] + ); + + return ( + + +
+
+ + {tokenData.symbol} +
+ + {variant === "destination" && ( + <> + +
+ {getChainName(tokenData.isGmxAccount + {tokenData.isGmxAccount ? GMX Balance : getChainName(chainId)} +
+ + )} +
+
+ {variant === "balance" && ( + + {tokenData.balance !== undefined + ? formatBalanceAmount(tokenData.balance, tokenData.decimals, undefined, { + isStable: tokenData.isStable, + }) + : "-"} + + )} +
+ ); +} + +function CollateralSelectorMobile(props: Props) { + const close = useSelectorClose(); + + return ( + + {props.options?.map((option) => ( + { + props.onSelect(option.address, Boolean(option.isGmxAccount)); + close(); + }} + chainId={props.chainId} + tokenData={option} + variant={props.variant} + /> + ))} + + ); +} + +function CollateralListItemMobile({ + variant, + chainId, + tokenData, + onSelect, +}: { + variant?: "balance" | "destination"; + chainId: ContractsChainId; + tokenData: TokenData; + onSelect: () => void; +}) { + const handleSelect = useCallback(() => { + onSelect(); + }, [onSelect]); + + useEffect(() => { + const symbol = tokenData.symbol; + return () => { + toast.dismiss(`error-collateral-${symbol}`); + }; + }, [tokenData.symbol]); + + return ( + +
+ +
{tokenData.symbol}
+
+ {variant === "balance" && + (tokenData.balance !== undefined + ? formatBalanceAmount(tokenData.balance, tokenData.decimals, undefined, { + isStable: tokenData.isStable, + }) + : "-")} +
+ ); +} diff --git a/src/components/Synthetics/ExecutionPriceRow.tsx b/src/components/Synthetics/ExecutionPriceRow.tsx deleted file mode 100644 index 626293c195..0000000000 --- a/src/components/Synthetics/ExecutionPriceRow.tsx +++ /dev/null @@ -1,226 +0,0 @@ -import { Trans, t } from "@lingui/macro"; -import { memo, useMemo } from "react"; - -import { OrderType } from "domain/synthetics/orders/types"; -import { formatAcceptablePrice } from "domain/synthetics/positions"; -import { TradeFees, TradeFlags, TriggerThresholdType } from "domain/synthetics/trade"; -import { getIsHighPositionImpact } from "domain/synthetics/trade/utils/warnings"; -import { formatDeltaUsd, formatPercentage, formatUsdPrice } from "lib/numbers"; -import { getPositiveOrNegativeClass } from "lib/utils"; -import { bigMath } from "sdk/utils/bigmath"; -import { isStopIncreaseOrderType } from "sdk/utils/orders"; - -import ExternalLink from "components/ExternalLink/ExternalLink"; -import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; -import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; - -import { SyntheticsInfoRow } from "./SyntheticsInfoRow"; - -interface Props { - tradeFlags: TradeFlags; - fees?: TradeFees; - executionPrice?: bigint; - acceptablePrice?: bigint; - visualMultiplier?: number; - triggerOrderType?: - | OrderType.LimitIncrease - | OrderType.StopIncrease - | OrderType.LimitDecrease - | OrderType.StopLossDecrease; -} - -export const ExecutionPriceRow = memo(function ExecutionPriceRow({ - fees, - executionPrice, - tradeFlags, - acceptablePrice, - triggerOrderType, - visualMultiplier, -}: Props) { - const { isLimit, isMarket, isIncrease, isLong, isTrigger } = tradeFlags; - - const triggerThresholdType = useMemo(() => { - if (isIncrease) { - return isLong ? TriggerThresholdType.Below : TriggerThresholdType.Above; - } else { - if (triggerOrderType === OrderType.LimitDecrease) { - return isLong ? TriggerThresholdType.Above : TriggerThresholdType.Below; - } - if (triggerOrderType === OrderType.StopLossDecrease) { - return isLong ? TriggerThresholdType.Below : TriggerThresholdType.Above; - } - } - }, [isIncrease, isLong, triggerOrderType]); - - const uncappedPositionPriceImpactPercentage = - fees?.positionPriceImpact?.precisePercentage !== undefined && fees?.priceImpactDiff?.precisePercentage !== undefined - ? fees.positionPriceImpact.precisePercentage - fees.priceImpactDiff.precisePercentage - : undefined; - - const uncappedPositionPriceImpactDeltaUsd = - fees?.positionPriceImpact?.deltaUsd !== undefined && fees?.priceImpactDiff?.deltaUsd !== undefined - ? fees.positionPriceImpact.deltaUsd - fees.priceImpactDiff.deltaUsd - : undefined; - - const acceptablePriceClarification = useMemo(() => { - if (isMarket) { - return t`The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed.`; - } - - if (isLimit) { - if (triggerOrderType && isStopIncreaseOrderType(triggerOrderType)) { - return t`Once the mark price hits the stop price, the order will attempt to execute.`; - } - - return ( - <> - {isLong ? ( - - Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable - price, which includes the set acceptable price impact. Note that if there is a negative price impact, the - mark price may need to be lower than the limit price. - - ) : ( - - Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable - price, which includes the set acceptable price impact. Note that if there is a negative price impact, the - mark price may need to be higher than the limit price. - - )} - - ); - } - - if (isTrigger) { - if (triggerOrderType === OrderType.LimitDecrease) { - return t`The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed.`; - } - - if (triggerOrderType === OrderType.StopLossDecrease) { - return t`Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact.`; - } - } - - return null; - }, [isMarket, isLimit, isTrigger, triggerOrderType, isLong]); - - const acceptablePriceFormatted = formatAcceptablePrice(acceptablePrice, { - visualMultiplier, - }); - - const handleClassName = useMemo(() => { - if (uncappedPositionPriceImpactDeltaUsd !== undefined && uncappedPositionPriceImpactDeltaUsd >= 0n) { - return "text-green-500 !decoration-green-500/50"; - } - - if (getIsHighPositionImpact(fees?.positionPriceImpact)) { - return "text-yellow-300 !decoration-yellow-300/50"; - } - - return ""; - }, [uncappedPositionPriceImpactDeltaUsd, fees?.positionPriceImpact]); - - return ( - - {executionPrice !== undefined ? ( - - {isLimit - ? triggerOrderType && isStopIncreaseOrderType(triggerOrderType) - ? t`Expected execution price for the order, including the current price impact, once the stop market order executes.` - : t`Expected execution price for the order, including the current price impact, once the limit order executes.` - : t`Expected execution price for the order, including the current price impact.`} -
-
- {uncappedPositionPriceImpactPercentage !== undefined && - uncappedPositionPriceImpactDeltaUsd !== undefined && ( - -
{t`Price Impact`}:
-
- ( - {formatPercentage(bigMath.abs(uncappedPositionPriceImpactPercentage), { - displayDecimals: 3, - bps: false, - })}{" "} - of position size) -
- - } - value={formatDeltaUsd(uncappedPositionPriceImpactDeltaUsd)} - showDollar={false} - /> - )} - {fees?.priceImpactDiff !== undefined && bigMath.abs(fees.priceImpactDiff.deltaUsd) > 0 && ( - -
{t`Price Impact Rebates`}:
-
- ( - {formatPercentage(bigMath.abs(fees.priceImpactDiff.precisePercentage), { - displayDecimals: 3, - bps: false, - })}{" "} - of position size) -
- - } - value={formatDeltaUsd(fees.priceImpactDiff.deltaUsd)} - showDollar={false} - /> - )} - {acceptablePriceFormatted !== undefined && ( - - {acceptablePriceFormatted !== "NA" && <>{triggerThresholdType} } - {acceptablePriceFormatted} - - } - showDollar={false} - /> - )} - {fees?.priceImpactDiff !== undefined && bigMath.abs(fees.priceImpactDiff.deltaUsd) > 0 && !isIncrease && ( - <> -
- - Price impact rebates for closing trades are claimable under the claims tab.{" "} - - Read more - - . - -
- - )} - {acceptablePriceClarification && ( - <> -
- {acceptablePriceClarification} -
- - )} -
- {t`Read more`}. - - } - /> - ) : ( - "-" - )} -
- ); -}); diff --git a/src/components/Synthetics/GmList/GlvList.tsx b/src/components/Synthetics/GmList/GlvList.tsx index 11eed6e519..e646b261f7 100644 --- a/src/components/Synthetics/GmList/GlvList.tsx +++ b/src/components/Synthetics/GmList/GlvList.tsx @@ -5,6 +5,7 @@ import { selectChainId, selectGlvInfo, selectGlvInfoLoading, + selectSrcChainId, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useMarketTokensData } from "domain/synthetics/markets"; @@ -36,10 +37,11 @@ export function GlvList({ gmPerformanceSnapshots, }: Props) { const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const marketsInfo = useSelector(selectGlvInfo); const glvsLoading = useSelector(selectGlvInfoLoading); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit, withGlv: true }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit, withGlv: true }); const isLoading = !marketsInfo || !marketTokensData || glvsLoading; diff --git a/src/components/Synthetics/GmList/GmList.tsx b/src/components/Synthetics/GmList/GmList.tsx index d4882892d8..fd0cfe981c 100644 --- a/src/components/Synthetics/GmList/GmList.tsx +++ b/src/components/Synthetics/GmList/GmList.tsx @@ -1,7 +1,11 @@ import { Trans, t } from "@lingui/macro"; import { useMemo, useState } from "react"; -import { selectChainId, selectMarketsInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { + selectChainId, + selectMarketsInfoData, + selectSrcChainId, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useTokensFavorites } from "context/TokensFavoritesContext/TokensFavoritesContextProvider"; import { MarketTokensAPRData, getTotalGmInfo, useMarketTokensData } from "domain/synthetics/markets"; @@ -56,11 +60,12 @@ export function GmList({ gmPerformanceSnapshots, }: Props) { const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const marketsInfo = useSelector(selectMarketsInfoData); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit, withGlv: false }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit, withGlv: false }); const { active } = useWallet(); - const userEarnings = useUserEarnings(chainId); + const userEarnings = useUserEarnings(chainId, srcChainId); const { orderBy, direction, getSorterProps } = useSorterHandlers("gm-list"); const [searchText, setSearchText] = useState(""); const { tab, favoriteTokens, toggleFavoriteToken } = useTokensFavorites("gm-list"); diff --git a/src/components/Synthetics/GmList/GmListItem.tsx b/src/components/Synthetics/GmList/GmListItem.tsx index d812009f20..1ad72e1a9b 100644 --- a/src/components/Synthetics/GmList/GmListItem.tsx +++ b/src/components/Synthetics/GmList/GmListItem.tsx @@ -6,7 +6,11 @@ import { Area, AreaChart } from "recharts"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { selectChainId, selectGlvAndMarketsInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { + selectChainId, + selectGlvAndMarketsInfoData, + selectSrcChainId, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { MarketTokensAPRData, @@ -70,9 +74,10 @@ export function GmListItem({ gmPerformanceSnapshots: PerformanceSnapshotsData | undefined; }) { const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const marketsInfoData = useSelector(selectGlvAndMarketsInfoData); const tokensData = useTokensData(); - const userEarnings = useUserEarnings(chainId); + const userEarnings = useUserEarnings(chainId, srcChainId); const daysConsidered = useDaysConsideredInMarketsApr(); const { showDebugValues } = useSettings(); diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx index be221d2d00..7ad17bb3bc 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx @@ -20,7 +20,7 @@ import { getMarketIndexName, getTokenPoolType, } from "domain/synthetics/markets/utils"; -import { TokenData, convertToUsd, getTokenData } from "domain/synthetics/tokens"; +import { convertToUsd, getTokenData, TokenData } from "domain/synthetics/tokens"; import { useAvailableTokenOptions } from "domain/synthetics/trade"; import useSortedPoolsWithIndexToken from "domain/synthetics/trade/useSortedPoolsWithIndexToken"; import { Token } from "domain/tokens"; @@ -32,24 +32,26 @@ import { NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; import { useBestGmPoolAddressForGlv } from "components/Synthetics/MarketStats/hooks/useBestGmPoolForGlv"; import TokenWithIcon from "components/TokenIcon/TokenWithIcon"; import TokenSelector from "components/TokenSelector/TokenSelector"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; +import type { GmSwapBoxProps } from "../GmSwapBox"; +import { GmSwapBoxPoolRow } from "../GmSwapBoxPoolRow"; +import { GmSwapWarningsRow } from "../GmSwapWarningsRow"; +import { SelectedPool } from "../SelectedPool"; +import { Mode, Operation } from "../types"; import { useGmWarningState } from "../useGmWarningState"; +import { InfoRows } from "./InfoRows"; import { useDepositWithdrawalAmounts } from "./useDepositWithdrawalAmounts"; import { useDepositWithdrawalFees } from "./useDepositWithdrawalFees"; import { useGmDepositWithdrawalBoxState } from "./useGmDepositWithdrawalBoxState"; import { useGmSwapSubmitState } from "./useGmSwapSubmitState"; import { useUpdateInputAmounts } from "./useUpdateInputAmounts"; import { useUpdateTokens } from "./useUpdateTokens"; -import type { GmSwapBoxProps } from "../GmSwapBox"; -import { Mode, Operation } from "../types"; -import { InfoRows } from "./InfoRows"; -import { GmSwapBoxPoolRow } from "../GmSwapBoxPoolRow"; -import { GmSwapWarningsRow } from "../GmSwapWarningsRow"; -import { SelectedPool } from "../SelectedPool"; export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { const { @@ -61,12 +63,14 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { onSelectedMarketForGlv, } = p; const { shouldDisableValidationForTesting } = useSettings(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const [isMarketForGlvSelectedManually, setIsMarketForGlvSelectedManually] = useState(false); // #region Requests - const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, { isDeposit: true }); - const { marketTokensData: withdrawalMarketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); + const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true }); + const { marketTokensData: withdrawalMarketTokensData } = useMarketTokensData(chainId, srcChainId, { + isDeposit: false, + }); const gasLimits = useGasLimits(chainId); const gasPrice = useGasPrice(chainId); const { uiFeeFactor } = useUiFeeFactorRequest(chainId); @@ -86,6 +90,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { marketsInfoData: glvAndMarketsInfoData, tokensData, marketTokens: isDeposit ? depositMarketTokensData : withdrawalMarketTokensData, + srcChainId, }); // #region State @@ -651,12 +656,7 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { // #region Render const submitButton = useMemo(() => { const btn = ( - ); @@ -697,9 +697,17 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { isDeposit ? marketToken?.prices?.maxPrice : marketToken?.prices?.minPrice )!; + const handleSubmit = useCallback( + (e: React.FormEvent) => { + e.preventDefault(); + submitState.onSubmit?.(); + }, + [submitState] + ); + return ( <> -
+
@@ -797,10 +805,15 @@ export function GmSwapBoxDepositWithdrawal(p: GmSwapBoxProps) { shouldShowWarningForPosition={shouldShowWarningForPosition} shouldShowWarningForExecutionFee={shouldShowWarningForExecutionFee} /> + +
-
{submitButton}
+
+ {submitButton} +
+ diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx index 3ec8dab538..e5d1d6c344 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useDepositWithdrawalTransactions.tsx @@ -157,6 +157,7 @@ export const useDepositWithdrawalTransactions = ({ tokensData, blockTimestampData, isMarketTokenDeposit: isMarketTokenDeposit ?? false, + isFirstDeposit: glvInfo.glvToken.totalSupply === 0n, setPendingTxns, setPendingDeposit, }) diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx index b1d54ee737..52c4f7b927 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx @@ -56,6 +56,16 @@ const processingTextMap = { [Operation.Shift]: (symbol: string) => t`Shifting ${symbol}...`, }; +type SubmitButtonState = { + text: React.ReactNode; + disabled?: boolean; + onSubmit?: () => void; + tokensToApprove?: string[]; + isAllowanceLoaded?: boolean; + isAllowanceLoading?: boolean; + errorDescription?: string; +}; + export const useGmSwapSubmitState = ({ isDeposit, routerAddress, @@ -80,7 +90,7 @@ export const useGmSwapSubmitState = ({ glvInfo, isMarketTokenDeposit, glvAndMarketsInfoData, -}: Props) => { +}: Props): SubmitButtonState => { const chainId = useSelector(selectChainId); const hasOutdatedUi = useHasOutdatedUi(); const { openConnectModal } = useConnectModal(); @@ -180,7 +190,7 @@ export const useGmSwapSubmitState = ({ } }, [isApproving, tokensToApprove]); - return useMemo(() => { + return useMemo((): SubmitButtonState => { if (!account) { return { text: t`Connect Wallet`, @@ -199,7 +209,10 @@ export const useGmSwapSubmitState = ({ return { text: error, disabled: !shouldDisableValidation, - onClick: onSubmit, + onSubmit: onSubmit, + tokensToApprove, + isAllowanceLoaded, + isAllowanceLoading, errorDescription: swapErrorDescription, }; } diff --git a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx index b1ad17dbb3..d50096f745 100644 --- a/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +++ b/src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx @@ -9,6 +9,7 @@ import { selectGasLimits, selectGasPrice, selectGlvAndMarketsInfoData, + selectSrcChainId, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectShiftAvailableMarkets } from "context/SyntheticsStateContext/selectors/shiftSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; @@ -23,9 +24,14 @@ import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import { PoolSelector } from "components/MarketSelector/PoolSelector"; import { MarketState } from "components/MarketSelector/types"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; import { ExpandableRow } from "components/Synthetics/ExpandableRow"; import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; +import { GmFees } from "../../GmFees/GmFees"; +import { GmSwapWarningsRow } from "../GmSwapWarningsRow"; +import { SelectedPool } from "../SelectedPool"; import { Operation } from "../types"; import { useDepositWithdrawalSetFirstTokenAddress } from "../useDepositWithdrawalSetFirstTokenAddress"; import { useGmWarningState } from "../useGmWarningState"; @@ -35,9 +41,6 @@ import { useShiftFees } from "./useShiftFees"; import { useShiftSubmitState } from "./useShiftSubmitState"; import { useUpdateMarkets } from "./useUpdateMarkets"; import { useUpdateTokens } from "./useUpdateTokens"; -import { GmFees } from "../../GmFees/GmFees"; -import { GmSwapWarningsRow } from "../GmSwapWarningsRow"; -import { SelectedPool } from "../SelectedPool"; export function GmShiftBox({ selectedGlvOrMarketAddress, @@ -61,7 +64,8 @@ export function GmShiftBox({ const gasPrice = useSelector(selectGasPrice); const glvAndMarketsInfoData = useSelector(selectGlvAndMarketsInfoData); const tokensData = useTokensData(); - const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, { isDeposit: true }); + const srcChainId = useSelector(selectSrcChainId); + const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true }); const { marketsInfo: sortedMarketsInfoByIndexToken } = useSortedPoolsWithIndexToken( glvAndMarketsInfoData, depositMarketTokensData @@ -304,12 +308,16 @@ export function GmShiftBox({ shouldShowWarningForPosition={shouldShowWarningForPosition} shouldShowWarningForExecutionFee={shouldShowWarningForExecutionFee} /> + +
- + + +
diff --git a/src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx b/src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx new file mode 100644 index 0000000000..52b8487dec --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx @@ -0,0 +1,193 @@ +import { MessageDescriptor } from "@lingui/core"; +import { msg } from "@lingui/macro"; +import cx from "classnames"; +import { useMemo, useState } from "react"; +import { useAccount } from "wagmi"; + +import { getChainName } from "config/chains"; +import { isSettlementChain } from "config/multichain"; +import { useTokensDataRequest } from "domain/synthetics/tokens"; +import { useChainId } from "lib/chains"; +import { useLocalizedMap } from "lib/i18n"; +import { formatBalanceAmount, formatUsd } from "lib/numbers"; +import { convertToUsd, getMidPrice } from "sdk/utils/tokens"; + +import Button from "components/Button/Button"; +import TokenIcon from "components/TokenIcon/TokenIcon"; + +type FilterType = "all" | "gmxAccount" | "wallet"; + +const FILTERS: FilterType[] = ["all", "gmxAccount", "wallet"]; + +const FILTER_TITLE_MAP: Record = { + all: msg`All`, + gmxAccount: msg`Gmx Account`, + wallet: msg`Wallet`, +}; + +type DisplayToken = { + chainId: number; + symbol: string; + isGmxAccount: boolean; + balance: bigint | undefined; + balanceUsd: bigint | undefined; + decimals: number; +}; + +const tokenSorter = (a: DisplayToken, b: DisplayToken): 1 | -1 | 0 => { + if (a.balanceUsd !== undefined && b.balanceUsd === undefined) { + return -1; + } + + if (a.balanceUsd === undefined && b.balanceUsd !== undefined) { + return 1; + } + + if (a.balanceUsd !== undefined && b.balanceUsd !== undefined) { + // sort by balanceUsd + return b.balanceUsd - a.balanceUsd > 0n ? 1 : -1; + } + + return 0; +}; + +const AssetsList = ({ tokens, noChainFilter }: { tokens: DisplayToken[]; noChainFilter?: boolean }) => { + const [searchQuery, setSearchQuery] = useState(""); + const [activeFilter, setActiveFilter] = useState("all"); + const titles = useLocalizedMap(FILTER_TITLE_MAP); + + const sortedFilteredTokens = useMemo(() => { + const filteredTokens = tokens.filter((token) => { + const matchesSearch = token.symbol.toLowerCase().includes(searchQuery.toLowerCase()); + + const matchesChainFilter = + noChainFilter || + activeFilter === "all" || + (activeFilter === "gmxAccount" && token.isGmxAccount) || + (activeFilter === "wallet" && !token.isGmxAccount); + + return matchesSearch && matchesChainFilter; + }); + + return filteredTokens; + }, [tokens, searchQuery, noChainFilter, activeFilter]); + + return ( +
+ {!noChainFilter && ( +
+ {FILTERS.map((filter) => ( + + ))} +
+ )} + +
+ setSearchQuery(e.target.value)} + className="w-full rounded-4 bg-slate-700 px-12 py-8 text-white placeholder:text-slate-100" + /> +
+ +
+ {sortedFilteredTokens.map((displayToken) => ( +
+
+ +
+
{displayToken.symbol}
+
{getChainName(displayToken.chainId)}
+
+
+
+
{formatBalanceAmount(displayToken.balance ?? 0n, displayToken.decimals, displayToken.symbol)}
+
{formatUsd(displayToken.balanceUsd)}
+
+
+ ))} +
+
+ ); +}; + +const AssetListMultichain = () => { + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + + const displayTokens = useMemo(() => { + return Object.values(tokensData || {}) + .filter((token) => !token.isNative && token.gmxAccountBalance !== 0n && token.gmxAccountBalance !== undefined) + .map( + (token): DisplayToken => ({ + chainId: 0, + symbol: token.symbol, + isGmxAccount: true, + balance: token.gmxAccountBalance, + balanceUsd: convertToUsd(token.gmxAccountBalance, token.decimals, getMidPrice(token.prices)), + decimals: token.decimals, + }) + ) + .sort(tokenSorter); + }, [tokensData]); + + return ; +}; + +const AssetListSettlementChain = () => { + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + + const displayTokens = useMemo(() => { + const displayTokens: DisplayToken[] = Object.values(tokensData || {}) + .flatMap((tokenData): DisplayToken[] => [ + { + ...tokenData, + isGmxAccount: true, + balance: tokenData.gmxAccountBalance, + balanceUsd: convertToUsd(tokenData.gmxAccountBalance, tokenData.decimals, getMidPrice(tokenData.prices)), + chainId: 0, + }, + { + ...tokenData, + isGmxAccount: false, + balance: tokenData.walletBalance, + balanceUsd: convertToUsd(tokenData.walletBalance, tokenData.decimals, getMidPrice(tokenData.prices)), + chainId: chainId, + }, + ]) + .filter((token) => token.balance !== undefined && token.balance > 0n) + .sort(tokenSorter); + + return displayTokens; + }, [chainId, tokensData]); + + return ; +}; + +export const AvailableToTradeAssetsView = () => { + const { chainId } = useAccount(); + + return isSettlementChain(chainId!) ? : ; +}; diff --git a/src/components/Synthetics/GmxAccountModal/DepositView.tsx b/src/components/Synthetics/GmxAccountModal/DepositView.tsx new file mode 100644 index 0000000000..7e56909a89 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/DepositView.tsx @@ -0,0 +1,876 @@ +import { Trans, t } from "@lingui/macro"; +import cx from "classnames"; +import noop from "lodash/noop"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { BiChevronRight } from "react-icons/bi"; +import { ImSpinner2 } from "react-icons/im"; +import Skeleton from "react-loading-skeleton"; +import { useLatest } from "react-use"; +import { Hex, decodeErrorResult, zeroAddress } from "viem"; +import { useAccount } from "wagmi"; + +import { AnyChainId, SettlementChainId, SourceChainId, getChainName } from "config/chains"; +import { getContract } from "config/contracts"; +import { getChainIcon } from "config/icons"; +import { + CHAIN_ID_PREFERRED_DEPOSIT_TOKEN, + DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT, + MULTICHAIN_FUNDING_SLIPPAGE_BPS, + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS, + StargateErrorsAbi, + getMappedTokenId, +} from "config/multichain"; +import { + useGmxAccountDepositViewChain, + useGmxAccountDepositViewTokenAddress, + useGmxAccountDepositViewTokenInputValue, + useGmxAccountModalOpen, + useGmxAccountSelector, +} from "context/GmxAccountContext/hooks"; +import { selectGmxAccountDepositViewTokenInputAmount } from "context/GmxAccountContext/selectors"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { useMultichainApprovalsActiveListener } from "context/SyntheticsEvents/useMultichainEvents"; +import { getMultichainTransferSendParams } from "domain/multichain/getSendParams"; +import { sendCrossChainDepositTxn } from "domain/multichain/sendCrossChainDepositTxn"; +import { sendSameChainDepositTxn } from "domain/multichain/sendSameChainDepositTxn"; +import { useGmxAccountFundingHistory } from "domain/multichain/useGmxAccountFundingHistory"; +import { useMultichainDepositNetworkComposeGas } from "domain/multichain/useMultichainDepositNetworkComposeGas"; +import { useMultichainQuoteFeeUsd } from "domain/multichain/useMultichainQuoteFeeUsd"; +import { useQuoteOft } from "domain/multichain/useQuoteOft"; +import { useQuoteOftLimits } from "domain/multichain/useQuoteOftLimits"; +import { useQuoteSend } from "domain/multichain/useQuoteSend"; +import { getNeedTokenApprove, useTokensAllowanceData, useTokensDataRequest } from "domain/synthetics/tokens"; +import { NativeTokenSupportedAddress, approveTokens } from "domain/tokens"; +import { useChainId } from "lib/chains"; +import { useLeadingDebounce } from "lib/debounce/useLeadingDebounde"; +import { helperToast } from "lib/helperToast"; +import { + OrderMetricId, + initMultichainDepositMetricData, + sendOrderSimulatedMetric, + sendOrderSubmittedMetric, + sendOrderTxnSubmittedMetric, + sendTxnErrorMetric, + sendTxnSentMetric, +} from "lib/metrics"; +import { USD_DECIMALS, formatAmountFree, formatBalanceAmount, formatUsd } from "lib/numbers"; +import { EMPTY_ARRAY, EMPTY_OBJECT, getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; +import { TxnCallback, TxnEventName, WalletTxnCtx } from "lib/transactions"; +import { useEthersSigner } from "lib/wallets/useEthersSigner"; +import { convertTokenAddress, getNativeToken, getToken } from "sdk/configs/tokens"; +import { bigMath } from "sdk/utils/bigmath"; +import { convertToTokenAmount, convertToUsd, getMidPrice } from "sdk/utils/tokens"; +import { applySlippageToMinOut } from "sdk/utils/trade"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; + +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; +import Button from "components/Button/Button"; +import { getTxnErrorToast } from "components/Errors/errorToasts"; +import NumberInput from "components/NumberInput/NumberInput"; +import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; +import TokenIcon from "components/TokenIcon/TokenIcon"; +import { ValueTransition } from "components/ValueTransition/ValueTransition"; + +import { useAvailableToTradeAssetMultichain, useMultichainTokensRequest } from "./hooks"; +import { wrapChainAction } from "./wrapChainAction"; + +const useIsFirstDeposit = () => { + const [enabled, setEnabled] = useState(true); + const [isFirstDeposit, setIsFirstDeposit] = useState(false); + const { fundingHistory, isLoading } = useGmxAccountFundingHistory({ enabled }); + + useEffect(() => { + if (isLoading) { + return; + } + + if (fundingHistory === undefined || fundingHistory.length !== 0) { + return; + } + + setEnabled(false); + const hasDeposit = fundingHistory.some((funding) => funding.operation === "deposit"); + if (!hasDeposit) { + setIsFirstDeposit(true); + } + }, [fundingHistory, isLoading]); + + return isFirstDeposit; +}; + +export const DepositView = () => { + const { chainId: settlementChainId, srcChainId } = useChainId(); + const { address: account, chainId: walletChainId } = useAccount(); + const [depositViewChain, setDepositViewChain] = useGmxAccountDepositViewChain(); + const walletSigner = useEthersSigner({ chainId: srcChainId }); + const { provider: sourceChainProvider } = useJsonRpcProvider(depositViewChain); + + const [isVisibleOrView, setIsVisibleOrView] = useGmxAccountModalOpen(); + + const [depositViewTokenAddress, setDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + const [inputValue, setInputValue] = useGmxAccountDepositViewTokenInputValue(); + const { + tokenChainDataArray: multichainTokens, + isPriceDataLoading, + isBalanceDataLoading, + } = useMultichainTokensRequest(); + const [isApproving, setIsApproving] = useState(false); + const [isSubmitting, setIsSubmitting] = useState(false); + const [shouldSendCrossChainDepositWhenLoaded, setShouldSendCrossChainDepositWhenLoaded] = useState(false); + + const { setMultichainSubmittedDeposit } = useSyntheticsEvents(); + + const selectedToken = + depositViewTokenAddress !== undefined ? getToken(settlementChainId, depositViewTokenAddress) : undefined; + + const { tokensData } = useTokensDataRequest(settlementChainId, depositViewChain); + const selectedTokenData = getByKey(tokensData, depositViewTokenAddress); + + const selectedTokenSourceChainTokenId = + depositViewTokenAddress !== undefined && depositViewChain !== undefined + ? getMappedTokenId(settlementChainId as SettlementChainId, depositViewTokenAddress, depositViewChain) + : undefined; + + const unwrappedSelectedTokenAddress = + depositViewTokenAddress !== undefined + ? convertTokenAddress(settlementChainId, depositViewTokenAddress, "native") + : undefined; + + const selectedTokenChainData = useMemo(() => { + if (selectedToken === undefined) return undefined; + return multichainTokens.find( + (token) => token.address === selectedToken.address && token.sourceChainId === depositViewChain + ); + }, [selectedToken, multichainTokens, depositViewChain]); + + const selectedTokenSourceChainBalance = selectedTokenChainData?.sourceChainBalance; + const nativeTokenSourceChainBalance = useMemo(() => { + if (multichainTokens === undefined) return undefined; + return multichainTokens.find((token) => token.address === zeroAddress)?.sourceChainBalance; + }, [multichainTokens]); + + const realInputAmount = useGmxAccountSelector(selectGmxAccountDepositViewTokenInputAmount); + + /** + * Debounced + */ + const inputAmount = useLeadingDebounce(realInputAmount); + const inputAmountUsd = selectedToken + ? convertToUsd(inputAmount, selectedToken.decimals, selectedTokenChainData?.sourceChainPrices?.maxPrice) + : undefined; + const latestInputAmountUsd = useLatest(inputAmountUsd); + + const handleMaxButtonClick = useCallback(() => { + if (selectedToken === undefined || selectedTokenSourceChainBalance === undefined) { + return; + } + + const isNative = unwrappedSelectedTokenAddress === zeroAddress; + if (isNative) { + const buffer = convertToTokenAmount( + 10n * 10n ** BigInt(USD_DECIMALS), + selectedToken.decimals, + getMidPrice(selectedTokenChainData?.sourceChainPrices ?? { minPrice: 0n, maxPrice: 0n }) + )!; + + const maxAmount = bigMath.max(selectedTokenSourceChainBalance - buffer, 0n); + + setInputValue(formatAmountFree(maxAmount, selectedToken.decimals)); + return; + } + + setInputValue(formatAmountFree(selectedTokenSourceChainBalance, selectedToken.decimals)); + }, [ + selectedToken, + selectedTokenChainData?.sourceChainPrices, + selectedTokenSourceChainBalance, + setInputValue, + unwrappedSelectedTokenAddress, + ]); + + const { gmxAccountUsd } = useAvailableToTradeAssetMultichain(); + + const { nextGmxAccountBalanceUsd, nextTokenGmxAccountBalance } = useMemo((): { + nextGmxAccountBalanceUsd?: bigint; + nextTokenGmxAccountBalance?: bigint; + } => { + if (inputAmount === undefined || inputAmountUsd === undefined) { + return EMPTY_OBJECT; + } + + const nextGmxAccountBalanceUsd = (gmxAccountUsd ?? 0n) + inputAmountUsd; + const nextTokenGmxAccountBalance = (selectedTokenData?.gmxAccountBalance ?? 0n) + inputAmount; + + return { + nextGmxAccountBalanceUsd, + nextTokenGmxAccountBalance, + }; + }, [gmxAccountUsd, inputAmount, inputAmountUsd, selectedTokenData?.gmxAccountBalance]); + + const spenderAddress = + // Only when DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT + (depositViewChain as AnyChainId) === settlementChainId + ? getContract(settlementChainId, "SyntheticsRouter") + : selectedTokenSourceChainTokenId?.stargate; + + useMultichainApprovalsActiveListener(depositViewChain, "multichain-deposit-view"); + + const tokensAllowanceResult = useTokensAllowanceData(depositViewChain, { + spenderAddress, + tokenAddresses: selectedTokenSourceChainTokenId ? [selectedTokenSourceChainTokenId.address] : [], + skip: depositViewChain === undefined, + }); + const tokensAllowanceData = depositViewChain !== undefined ? tokensAllowanceResult.tokensAllowanceData : undefined; + + const needTokenApprove = getNeedTokenApprove( + tokensAllowanceData, + depositViewTokenAddress === zeroAddress ? zeroAddress : selectedTokenSourceChainTokenId?.address, + inputAmount, + EMPTY_ARRAY + ); + + const handleApprove = useCallback(async () => { + if (!depositViewTokenAddress || inputAmount === undefined || !spenderAddress || !depositViewChain) { + helperToast.error("Approve failed"); + return; + } + + const isNative = depositViewTokenAddress === zeroAddress; + + if (isNative) { + helperToast.error("Native token cannot be approved"); + return; + } + + if (!selectedTokenSourceChainTokenId) { + helperToast.error("Approve failed"); + return; + } + + await wrapChainAction(depositViewChain, async (signer) => { + await approveTokens({ + chainId: depositViewChain, + tokenAddress: selectedTokenSourceChainTokenId.address, + signer: signer, + spender: spenderAddress, + onApproveSubmitted: () => setIsApproving(true), + setIsApproving: noop, + permitParams: undefined, + approveAmount: undefined, + }); + }); + }, [depositViewTokenAddress, inputAmount, spenderAddress, selectedTokenSourceChainTokenId, depositViewChain]); + + useEffect(() => { + if (!needTokenApprove && isApproving) { + setIsApproving(false); + } + }, [isApproving, needTokenApprove]); + + const isInputEmpty = inputAmount === undefined || inputAmount <= 0n; + + const { composeGas } = useMultichainDepositNetworkComposeGas({ + tokenAddress: depositViewTokenAddress, + }); + + const sendParamsWithoutSlippage: SendParamStruct | undefined = useMemo(() => { + if ( + !account || + inputAmount === undefined || + inputAmount <= 0n || + depositViewChain === undefined || + composeGas === undefined + ) { + return; + } + + return getMultichainTransferSendParams({ + account, + inputAmount, + srcChainId: depositViewChain, + composeGas, + dstChainId: settlementChainId, + isDeposit: true, + }); + }, [account, inputAmount, depositViewChain, composeGas, settlementChainId]); + + const quoteOft = useQuoteOft({ + sendParams: sendParamsWithoutSlippage, + fromStargateAddress: selectedTokenSourceChainTokenId?.stargate, + fromChainProvider: sourceChainProvider, + fromChainId: depositViewChain, + toChainId: settlementChainId, + }); + + const { isBelowLimit, lowerLimitFormatted, isAboveLimit, upperLimitFormatted } = useQuoteOftLimits({ + quoteOft, + inputAmount, + isStable: selectedToken?.isStable, + decimals: selectedTokenSourceChainTokenId?.decimals, + }); + + const sendParamsWithSlippage: SendParamStruct | undefined = useMemo(() => { + if (!quoteOft || !sendParamsWithoutSlippage) { + return undefined; + } + + const { receipt } = quoteOft; + + const minAmountLD = applySlippageToMinOut(MULTICHAIN_FUNDING_SLIPPAGE_BPS, receipt.amountReceivedLD as bigint); + + const newSendParams: SendParamStruct = { + ...sendParamsWithoutSlippage, + minAmountLD, + }; + + return newSendParams; + }, [sendParamsWithoutSlippage, quoteOft]); + + const quoteSend = useQuoteSend({ + sendParams: sendParamsWithSlippage, + fromStargateAddress: selectedTokenSourceChainTokenId?.stargate, + fromChainProvider: sourceChainProvider, + fromChainId: depositViewChain, + toChainId: settlementChainId, + composeGas, + }); + + const { networkFeeUsd, protocolFeeUsd } = useMultichainQuoteFeeUsd({ + quoteSend, + quoteOft, + unwrappedTokenAddress: unwrappedSelectedTokenAddress, + srcChainId: depositViewChain, + }); + + const isFirstDeposit = useIsFirstDeposit(); + const latestIsFirstDeposit = useLatest(isFirstDeposit); + + const sameChainCallback: TxnCallback = useCallback( + (txnEvent) => { + if (txnEvent.event === TxnEventName.Sent) { + helperToast.success("Deposit sent", { toastId: "same-chain-gmx-account-deposit" }); + setIsVisibleOrView("main"); + } else if (txnEvent.event === TxnEventName.Error) { + helperToast.error("Deposit failed", { toastId: "same-chain-gmx-account-deposit" }); + } + }, + [setIsVisibleOrView] + ); + + const handleSameChainDeposit = useCallback(async () => { + if (!account || !depositViewTokenAddress || inputAmount === undefined || !walletSigner) { + return; + } + + await sendSameChainDepositTxn({ + chainId: settlementChainId as SettlementChainId, + signer: walletSigner, + tokenAddress: depositViewTokenAddress, + amount: inputAmount, + account, + callback: sameChainCallback, + }); + }, [account, depositViewTokenAddress, inputAmount, sameChainCallback, settlementChainId, walletSigner]); + + const makeCrossChainCallback = useCallback( + (params: { + depositViewChain: SourceChainId; + metricId: OrderMetricId; + sendParams: SendParamStruct; + tokenAddress: string; + }): TxnCallback => + (txnEvent) => { + if (txnEvent.event === TxnEventName.Error) { + setIsSubmitting(false); + let prettyError = txnEvent.data.error; + const data = txnEvent.data.error.info?.error?.data as Hex | undefined; + + if (data) { + const error = decodeErrorResult({ + abi: StargateErrorsAbi, + data, + }); + + prettyError = new Error(JSON.stringify(error, null, 2)); + prettyError.name = error.errorName; + + const toastParams = getTxnErrorToast( + params.depositViewChain, + { + errorMessage: JSON.stringify(error, null, 2), + }, + { defaultMessage: t`Deposit failed` } + ); + + helperToast.error(toastParams.errorContent, { + autoClose: toastParams.autoCloseToast, + toastId: "gmx-account-deposit", + }); + } else { + const toastParams = getTxnErrorToast(params.depositViewChain, txnEvent.data.error, { + defaultMessage: t`Deposit failed`, + }); + + helperToast.error(toastParams.errorContent, { + autoClose: toastParams.autoCloseToast, + toastId: "gmx-account-deposit", + }); + } + + sendTxnErrorMetric(params.metricId, prettyError, "unknown"); + } else if (txnEvent.event === TxnEventName.Sent) { + setIsVisibleOrView("main"); + setIsSubmitting(false); + + sendTxnSentMetric(params.metricId); + + if (txnEvent.data.type === "wallet") { + setMultichainSubmittedDeposit({ + amount: params.sendParams.amountLD as bigint, + settlementChainId, + sourceChainId: params.depositViewChain, + tokenAddress: params.tokenAddress, + sentTxn: txnEvent.data.transactionHash, + }); + } + } else if (txnEvent.event === TxnEventName.Simulated) { + sendOrderSimulatedMetric(params.metricId); + } else if (txnEvent.event === TxnEventName.Sending) { + sendOrderTxnSubmittedMetric(params.metricId); + } + }, + [setIsVisibleOrView, setMultichainSubmittedDeposit, settlementChainId] + ); + + const canSendCrossChainDeposit = + depositViewTokenAddress && + account && + inputAmount !== undefined && + inputAmount > 0n && + depositViewChain && + quoteSend && + sendParamsWithSlippage && + selectedTokenSourceChainTokenId; + + const handleCrossChainDeposit = useCallback(async (): Promise => { + if (!canSendCrossChainDeposit) { + helperToast.error(t`Deposit failed`); + return false; + } + + setIsSubmitting(true); + + const metricData = initMultichainDepositMetricData({ + assetSymbol: selectedToken!.symbol, + sizeInUsd: latestInputAmountUsd.current!, + isFirstDeposit: latestIsFirstDeposit.current, + settlementChain: settlementChainId, + sourceChain: depositViewChain, + }); + + sendOrderSubmittedMetric(metricData.metricId); + await wrapChainAction(depositViewChain, async (signer) => { + await sendCrossChainDepositTxn({ + chainId: depositViewChain, + signer, + tokenAddress: selectedTokenSourceChainTokenId.address, + stargateAddress: selectedTokenSourceChainTokenId.stargate, + amount: inputAmount, + quoteSend, + sendParams: sendParamsWithSlippage, + account, + callback: makeCrossChainCallback({ + depositViewChain, + metricId: metricData.metricId, + sendParams: sendParamsWithSlippage, + tokenAddress: depositViewTokenAddress, + }), + }); + }); + + return true; + }, [ + account, + canSendCrossChainDeposit, + depositViewChain, + depositViewTokenAddress, + inputAmount, + latestInputAmountUsd, + latestIsFirstDeposit, + makeCrossChainCallback, + quoteSend, + selectedToken, + selectedTokenSourceChainTokenId?.address, + selectedTokenSourceChainTokenId?.stargate, + sendParamsWithSlippage, + settlementChainId, + ]); + + const handleDeposit = useCallback(async () => { + if (DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT && (walletChainId as SettlementChainId) === settlementChainId) { + await handleSameChainDeposit(); + } else { + setIsSubmitting(true); + setShouldSendCrossChainDepositWhenLoaded(true); + } + }, [walletChainId, settlementChainId, handleSameChainDeposit]); + + const isCrossChainDepositLoading = useRef(false); + useEffect(() => { + if (!shouldSendCrossChainDepositWhenLoaded || isCrossChainDepositLoading.current) { + return; + } + + if (!canSendCrossChainDeposit) { + return; + } + + setShouldSendCrossChainDepositWhenLoaded(false); + isCrossChainDepositLoading.current = true; + handleCrossChainDeposit().finally(() => { + isCrossChainDepositLoading.current = false; + }); + }, [canSendCrossChainDeposit, handleCrossChainDeposit, shouldSendCrossChainDepositWhenLoaded]); + + useEffect( + function fallbackDepositViewChain() { + if (depositViewChain !== undefined || isVisibleOrView === false) { + return; + } + + if (srcChainId !== undefined) { + setDepositViewChain(srcChainId); + } + }, + [depositViewChain, isVisibleOrView, setDepositViewChain, srcChainId, walletChainId] + ); + + useEffect( + function fallbackTokenOnSourceChain() { + if (isVisibleOrView === false) { + return; + } + + const isInvalidTokenAddress = + depositViewTokenAddress === undefined || + !MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[settlementChainId as SettlementChainId] + .map((token) => convertTokenAddress(settlementChainId, token, "native")) + .includes(depositViewTokenAddress as NativeTokenSupportedAddress); + + if ( + !isPriceDataLoading && + multichainTokens.length > 0 && + depositViewChain !== undefined && + isInvalidTokenAddress + ) { + const preferredToken = multichainTokens.find( + (sourceChainToken) => + sourceChainToken.sourceChainId === depositViewChain && + sourceChainToken.address === CHAIN_ID_PREFERRED_DEPOSIT_TOKEN[settlementChainId] + ); + + if ( + preferredToken && + preferredToken.sourceChainBalance !== undefined && + preferredToken.sourceChainBalance >= 0n + ) { + setDepositViewTokenAddress(preferredToken.address); + return; + } + + let maxBalanceTokenAddress: string | undefined = undefined; + let maxSourceChainBalanceUsd: bigint | undefined = undefined; + + for (const token of multichainTokens) { + if (token.sourceChainId !== depositViewChain) { + continue; + } + + const balanceUsd = token.sourceChainPrices + ? convertToUsd(token.sourceChainBalance, token.sourceChainDecimals, getMidPrice(token.sourceChainPrices)) + : 0n; + if ( + maxBalanceTokenAddress === undefined || + maxSourceChainBalanceUsd === undefined || + (balanceUsd !== undefined && balanceUsd > maxSourceChainBalanceUsd) + ) { + maxBalanceTokenAddress = token.address; + maxSourceChainBalanceUsd = balanceUsd; + } + } + + if (maxBalanceTokenAddress !== undefined) { + setDepositViewTokenAddress(maxBalanceTokenAddress); + return; + } + + if (preferredToken) { + setDepositViewTokenAddress(preferredToken.address); + } + } + }, + [ + depositViewTokenAddress, + isPriceDataLoading, + multichainTokens, + setDepositViewTokenAddress, + settlementChainId, + depositViewChain, + isVisibleOrView, + ] + ); + + const tokenSelectorDisabled = !isBalanceDataLoading && multichainTokens.length === 0; + + let buttonState: { + text: React.ReactNode; + disabled?: boolean; + onClick?: () => void; + } = { + text: t`Deposit`, + onClick: handleDeposit, + }; + + if (isApproving) { + buttonState = { + text: ( + <> + Approving + + + ), + disabled: true, + }; + } else if (tokenSelectorDisabled) { + buttonState = { + text: + depositViewChain !== undefined + ? t`No assets available for deposit on ${getChainName(depositViewChain)}` + : t`No assets available for deposit`, + disabled: true, + }; + } else if (needTokenApprove) { + buttonState = { + text: t`Allow ${selectedToken?.symbol} to be spent`, + onClick: handleApprove, + }; + } else if (isSubmitting) { + buttonState = { + text: ( + <> + Depositing + + + ), + disabled: true, + }; + } else if (isInputEmpty) { + buttonState = { + text: t`Enter deposit amount`, + disabled: true, + }; + } else if (selectedTokenSourceChainBalance !== undefined && inputAmount > selectedTokenSourceChainBalance) { + buttonState = { + text: t`Insufficient balance`, + disabled: true, + }; + } else if (nativeTokenSourceChainBalance !== undefined && quoteSend !== undefined) { + const isNative = unwrappedSelectedTokenAddress === zeroAddress; + const value = isNative ? inputAmount : 0n; + + if (quoteSend.nativeFee + value > nativeTokenSourceChainBalance) { + const nativeTokenSymbol = getNativeToken(settlementChainId)?.symbol; + buttonState = { + text: t`Insufficient ${nativeTokenSymbol} balance`, + disabled: true, + }; + } + } + + const onClick = buttonState.onClick; + const handleSubmit = useCallback( + (e: React.FormEvent) => { + e.preventDefault(); + onClick?.(); + }, + [onClick] + ); + + let placeholder = ""; + if ((inputValue === undefined || inputValue === "") && selectedToken?.symbol) { + placeholder = `0.0 ${selectedToken.symbol}`; + } else if (selectedToken?.symbol) { + placeholder = selectedToken.symbol; + } + + return ( +
+
+
+
+ Asset +
+ {!tokenSelectorDisabled ? ( +
{ + setIsVisibleOrView("selectAssetToDeposit"); + }} + className="flex items-center justify-between rounded-4 bg-cold-blue-900 px-14 py-12 active:bg-cold-blue-500 gmx-hover:bg-cold-blue-700" + > +
+ {selectedToken ? ( + <> + + {selectedToken.symbol} + + ) : depositViewChain !== undefined ? ( + <> + + + + ) : ( + + Pick an asset to deposit + + )} +
+ +
+ ) : ( +
+
+ + {depositViewChain !== undefined ? ( + No assets available for deposit on {getChainName(depositViewChain)} + ) : ( + No assets available for deposit + )} + +
+
+ )} +
+ {depositViewChain !== undefined && ( +
+
+ From Network +
+
+ {getChainName(depositViewChain)} + {getChainName(depositViewChain)} +
+
+ )} + +
+
+ Deposit + {selectedTokenSourceChainBalance !== undefined && selectedToken !== undefined && ( +
+ Available:{" "} + {formatBalanceAmount(selectedTokenSourceChainBalance, selectedToken.decimals, selectedToken.symbol, { + isStable: selectedToken.isStable, + })} +
+ )} +
+
+ setInputValue(e.target.value)} + className="text-body-large w-full rounded-4 bg-cold-blue-900 py-12 pl-14 pr-72" + /> +
+
+ {inputValue} + {inputValue === "" || inputValue === undefined ? "" : " "} +
+
{placeholder}
+
+ +
+
{formatUsd(inputAmountUsd ?? 0n)}
+
+
+ + {isAboveLimit && ( + + + The amount you are trying to deposit exceeds the limit. Please try an amount smaller than{" "} + {upperLimitFormatted}. + + + )} + {isBelowLimit && ( + + + The amount you are trying to deposit is below the limit. Please try an amount larger than{" "} + {lowerLimitFormatted}. + + + )} +
+ +
+ Network Fee} + value={networkFeeUsd !== undefined ? formatUsd(networkFeeUsd) : "..."} + /> + Deposit Fee} + value={protocolFeeUsd !== undefined ? formatUsd(protocolFeeUsd) : "..."} + /> + GMX Balance} + value={} + /> + Asset Balance} + value={ + + } + /> +
+ + + + ); +}; diff --git a/src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx b/src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx new file mode 100644 index 0000000000..ceff7b8ba4 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx @@ -0,0 +1,141 @@ +import { Trans } from "@lingui/macro"; +import { memo, useEffect } from "react"; +import { IoArrowBack } from "react-icons/io5"; +import { useAccount } from "wagmi"; + +import { GmxAccountModalView } from "context/GmxAccountContext/GmxAccountContext"; +import { useGmxAccountModalOpen } from "context/GmxAccountContext/hooks"; +import { SyntheticsStateContextProvider } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; +import { useChainId } from "lib/chains"; + +import { SlideModal } from "components/Modal/SlideModal"; + +import { AvailableToTradeAssetsView } from "./AvailableToTradeAssetsView"; +import { DepositView } from "./DepositView"; +import { MainView } from "./MainView"; +import { SelectAssetToDepositView } from "./SelectAssetToDepositView"; +import { TransferDetailsView } from "./TransferDetailsView"; +import { WithdrawalView } from "./WithdrawalView"; + +const AvailableToTradeAssetsTitle = () => { + const { srcChainId } = useChainId(); + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + + return ( +
+ setIsVisibleOrView("main")} + /> + {srcChainId !== undefined ? GMX Account Balance : Available to Trade Assets} +
+ ); +}; + +const TransferDetailsTitle = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + return ( +
+ setIsVisibleOrView("main")} + /> + Transfer Details +
+ ); +}; + +const DepositTitle = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + return ( +
+ setIsVisibleOrView("main")} + /> + Deposit +
+ ); +}; + +const SelectAssetToDepositTitle = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + return ( +
+ setIsVisibleOrView("deposit")} + /> + Select Asset to Deposit +
+ ); +}; + +const WithdrawTitle = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + return ( +
+ setIsVisibleOrView("main")} + /> + Withdraw +
+ ); +}; + +const VIEW_TITLE: Record = { + main: GMX Account, + availableToTradeAssets: , + transferDetails: , + deposit: , + selectAssetToDeposit: , + withdraw: , +}; + +export const GmxAccountModal = memo(() => { + const { address: account } = useAccount(); + const [isVisibleOrView, setIsVisibleOrView] = useGmxAccountModalOpen(); + + const isVisible = isVisibleOrView !== false && account !== undefined; + const view = typeof isVisibleOrView === "string" ? isVisibleOrView : "main"; + + useEffect(() => { + if (!account && Boolean(isVisibleOrView)) { + setIsVisibleOrView(false); + } + }, [account, isVisibleOrView, setIsVisibleOrView]); + + return ( + + {view === "main" && account && } + {view === "availableToTradeAssets" && } + {view === "transferDetails" && } + {view === "deposit" && } + {view === "selectAssetToDeposit" && } + {view === "withdraw" && ( + + + + )} + + ); +}); diff --git a/src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx b/src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx new file mode 100644 index 0000000000..2a40007799 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx @@ -0,0 +1,102 @@ +import { Trans } from "@lingui/macro"; +import { useHistory } from "react-router-dom"; +import { zeroAddress } from "viem"; + +import { useGmxAccountModalOpen, useGmxAccountDepositViewTokenAddress } from "context/GmxAccountContext/hooks"; +import { useChainId } from "lib/chains"; +import { formatAmount, formatUsd } from "lib/numbers"; +import { getWrappedToken, getNativeToken } from "sdk/configs/tokens"; + +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; +import Button from "components/Button/Button"; + +function SwapButton({ children }: { children: React.ReactNode }) { + const { chainId } = useChainId(); + const history = useHistory(); + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); + + const wrappedTokenSymbol = getWrappedToken(chainId).symbol; + + return ( + + ); +} +function DepositButton({ children }: { children: React.ReactNode }) { + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); + const [, setDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + + return ( + + ); +} +export function InsufficientWntBanner({ + neededAmount, + neededAmountUsd, +}: { + neededAmount: bigint | undefined; + neededAmountUsd: bigint | undefined; +}) { + const { chainId } = useChainId(); + + const nativeToken = getNativeToken(chainId); + const nativeTokenSymbol = nativeToken.symbol; + const nativeTokenDecimals = nativeToken.decimals; + + const hasEth = nativeTokenSymbol === "ETH"; + + let firstLine: React.ReactNode | undefined; + let secondLine: React.ReactNode | undefined; + + if (neededAmount !== undefined && neededAmountUsd !== undefined) { + const formattedAmount = formatAmount(neededAmount, nativeTokenDecimals); + const formattedUsd = formatUsd(neededAmountUsd); + + firstLine = ( + + You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds. + + ); + } else { + firstLine = You’ll need some {nativeTokenSymbol} in your account to withdraw funds.; + } + + if (hasEth) { + secondLine = ( + + Please deposit or swap to get {nativeTokenSymbol}. + + ); + } else { + secondLine = ( + + Please swap to get {nativeTokenSymbol}. + + ); + } + + return ( + + {firstLine} +
+ {secondLine} +
+ ); +} diff --git a/src/components/Synthetics/GmxAccountModal/MainView.tsx b/src/components/Synthetics/GmxAccountModal/MainView.tsx new file mode 100644 index 0000000000..4ab2c163d4 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/MainView.tsx @@ -0,0 +1,488 @@ +import { Trans, t } from "@lingui/macro"; +import cx from "classnames"; +import { useMemo, useState } from "react"; +import { IoArrowDown } from "react-icons/io5"; +import { TbLoader2 } from "react-icons/tb"; +import Skeleton from "react-loading-skeleton"; +import { useHistory } from "react-router-dom"; +import { useCopyToClipboard } from "react-use"; +import { useAccount } from "wagmi"; + +import { BOTANIX, getExplorerUrl } from "config/chains"; +import { isSettlementChain } from "config/multichain"; +import { useGmxAccountModalOpen, useGmxAccountSelectedTransferGuid } from "context/GmxAccountContext/hooks"; +import { useSettings } from "context/SettingsContext/SettingsContextProvider"; +import { isMultichainFundingItemLoading } from "domain/multichain/isMultichainFundingItemLoading"; +import type { MultichainFundingHistoryItem } from "domain/multichain/types"; +import { useDisconnectAndClose } from "domain/multichain/useDisconnectAndClose"; +import { useGmxAccountFundingHistory } from "domain/multichain/useGmxAccountFundingHistory"; +import { useChainId } from "lib/chains"; +import { formatRelativeDateWithComma } from "lib/dates"; +import { helperToast } from "lib/helperToast"; +import { useLocalizedMap } from "lib/i18n"; +import { useENS } from "lib/legacy"; +import { formatBalanceAmount, formatUsd } from "lib/numbers"; +import { useNotifyModalState } from "lib/useNotifyModalState"; +import { shortenAddressOrEns } from "lib/wallets"; +import { buildAccountDashboardUrl } from "pages/AccountDashboard/buildAccountDashboardUrl"; +import { getToken } from "sdk/configs/tokens"; +import { Token } from "sdk/types/tokens"; + +import { Avatar } from "components/Avatar/Avatar"; +import Button from "components/Button/Button"; +import ExternalLink from "components/ExternalLink/ExternalLink"; +import { VerticalScrollFadeContainer } from "components/TableScrollFade/VerticalScrollFade"; +import TokenIcon from "components/TokenIcon/TokenIcon"; +import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; + +import BellIcon from "img/bell.svg?react"; +import copy from "img/ic_copy_20.svg"; +import InfoIconComponent from "img/ic_info.svg?react"; +import externalLink from "img/ic_new_link_20.svg"; +import PnlAnalysisIcon from "img/ic_pnl_analysis_20.svg?react"; +import SettingsIcon from "img/ic_settings.svg?react"; +import disconnectIcon from "img/ic_sign_out_20.svg"; + +import { SyntheticsInfoRow } from "../SyntheticsInfoRow"; +import { + useAvailableToTradeAssetMultichain, + useAvailableToTradeAssetSettlementChain, + useAvailableToTradeAssetSymbolsMultichain, + useAvailableToTradeAssetSymbolsSettlementChain, +} from "./hooks"; +import { FUNDING_OPERATIONS_LABELS } from "./keys"; + +const TokenIcons = ({ tokens }: { tokens: string[] }) => { + const displayTokens = tokens.slice(0, 3); + const remainingCount = Math.max(0, tokens.length - 3); + + return ( +
+ {displayTokens.map((token, index) => ( +
0 && "-ml-8" + )} + > + +
+ ))} + {remainingCount > 0 && ( +
+ +{remainingCount} +
+ )} +
+ ); +}; + +function FundingHistoryItemLabel({ + step, + operation, + isExecutionError, +}: Pick) { + const labels = useLocalizedMap(FUNDING_OPERATIONS_LABELS); + + const isLoading = isMultichainFundingItemLoading({ operation, step, isExecutionError }); + + const key = `${operation}${isExecutionError ? "-failed" : ""}`; + let text = labels[key] ?? `${operation} ${isExecutionError ? " failed" : ""}`; + + if (isLoading) { + return ( +
+ + {text} +
+ ); + } else if (isExecutionError) { + return
{text}
; + } + + return
{text}
; +} + +const Toolbar = ({ account }: { account: string }) => { + const [, setIsVisible] = useGmxAccountModalOpen(); + const { chainId: settlementChainId, srcChainId } = useChainId(); + const history = useHistory(); + + const chainId = srcChainId ?? settlementChainId; + + const { openNotifyModal } = useNotifyModalState(); + const { setIsSettingsVisible } = useSettings(); + const { ensName } = useENS(account); + const [, copyToClipboard] = useCopyToClipboard(); + const handleDisconnect = useDisconnectAndClose(); + + const handleCopyAddress = () => { + if (account) { + copyToClipboard(account); + helperToast.success(t`Address copied to your clipboard`); + } + }; + + const accountUrl = useMemo(() => { + if (!account || !chainId) return ""; + return `${getExplorerUrl(chainId)}address/${account}`; + }, [account, chainId]); + + const handleNotificationsClick = () => { + openNotifyModal(); + setTimeout(() => { + setIsVisible(false); + }, 200); + }; + + const handlePnlAnalysisClick = () => { + if (!account || !chainId) return; + history.push(buildAccountDashboardUrl(account, chainId, 2)); + setIsVisible(false); + }; + + const handleSettingsClick = () => { + setIsSettingsVisible(true); + setTimeout(() => { + setIsVisible(false); + }, 200); + }; + + const showNotify = settlementChainId !== BOTANIX; + + return ( +
+ +
+ + + + + + External Link + + + {showNotify && ( + + + + )} + + + + + + + +
+
+ ); +}; + +function SettlementChainBalance() { + const { totalUsd, gmxAccountUsd, walletUsd } = useAvailableToTradeAssetSettlementChain(); + const availableToTradeAssetSymbols = useAvailableToTradeAssetSymbolsSettlementChain(); + + return ( +
+
+ Available to Trade +
+ +
+ + ) + } + /> + GMX Account Balance} + className="h-23 !items-start" + valueClassName="leading-[21px]" + value={ + gmxAccountUsd !== undefined ? ( + formatUsd(gmxAccountUsd) + ) : ( + + ) + } + /> +
+ ); +} + +function MultichainBalance() { + const { gmxAccountUsd } = useAvailableToTradeAssetMultichain(); + const availableToTradeAssetSymbols = useAvailableToTradeAssetSymbolsMultichain(); + + return ( +
+
+ Balance +
+ +
+ ); +} + +function Balance({ + usd, + availableToTradeAssetSymbols, +}: { + usd: bigint | undefined; + availableToTradeAssetSymbols: string[]; +}) { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + + const handleAvailableToTradeClick = () => { + setIsVisibleOrView("availableToTradeAssets"); + }; + + return ( +
+ {usd !== undefined ? ( +
{formatUsd(usd)}
+ ) : ( + + )} + {usd !== undefined && usd !== 0n && ( + + )} + {usd === undefined && ( + + )} +
+ ); +} + +const BalanceSection = () => { + const { chainId } = useAccount(); + + return isSettlementChain(chainId!) ? : ; +}; + +const ActionButtons = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + + const handleDepositClick = () => { + setIsVisibleOrView("deposit"); + }; + + const handleWithdrawClick = () => { + setIsVisibleOrView("withdraw"); + }; + + return ( +
+ + +
+ ); +}; + +type DisplayFundingHistoryItem = Omit & { + token: Token; +}; + +const FundingHistorySection = () => { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + const [searchQuery, setSearchQuery] = useState(""); + const [, setSelectedTransferGuid] = useGmxAccountSelectedTransferGuid(); + + const { fundingHistory, isLoading } = useGmxAccountFundingHistory(); + + const filteredFundingHistory: DisplayFundingHistoryItem[] | undefined = fundingHistory + ?.map((transfer): DisplayFundingHistoryItem | undefined => { + const token = getToken(transfer.settlementChainId, transfer.token); + + if (!token) { + return undefined; + } + + return { ...transfer, token }; + }) + .filter((transfer): transfer is DisplayFundingHistoryItem => { + if (!transfer) { + return false; + } + + const matchesSearch = transfer.token.symbol.toLowerCase().includes(searchQuery.toLowerCase()); + return matchesSearch; + }); + + const handleTransferClick = (transfer: DisplayFundingHistoryItem) => { + setSelectedTransferGuid(transfer.id); + setIsVisibleOrView("transferDetails"); + }; + + return ( +
+
+
+ Funding Activity +
+
+ {Boolean(fundingHistory?.length) && ( +
+ setSearchQuery(e.target.value)} + className="w-full rounded-4 bg-slate-700 px-12 py-8 text-white placeholder:text-slate-100" + /> +
+ )} + + {filteredFundingHistory?.map((transfer) => ( +
handleTransferClick(transfer)} + > +
+ +
+
{transfer.token.symbol}
+ +
+
+
+
+ {formatBalanceAmount(transfer.sentAmount, transfer.token.decimals, transfer.token.symbol, { + isStable: transfer.token.isStable, + })} +
+
+ {formatRelativeDateWithComma(transfer.sentTimestamp)} +
+
+
+ ))} + + {!isLoading && fundingHistory && fundingHistory.length === 0 && ( +
+ + No funding activity +
+ )} + {!isLoading && filteredFundingHistory?.length === 0 && fundingHistory && fundingHistory.length > 0 && ( +
+ + No funding activity matching your search +
+ )} + {isLoading && ( +
+ +
+ )} +
+
+ ); +}; + +export const MainView = ({ account }: { account: string }) => { + return ( +
+
+ + + +
+ +
+ ); +}; diff --git a/src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx b/src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx new file mode 100644 index 0000000000..3af0110350 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx @@ -0,0 +1,190 @@ +import { Trans } from "@lingui/macro"; +import cx from "classnames"; +import { useMemo, useState } from "react"; + +import { getChainName } from "config/chains"; +import { getChainIcon } from "config/icons"; +import { MULTICHAIN_TOKEN_MAPPING } from "config/multichain"; +import { + useGmxAccountDepositViewChain, + useGmxAccountDepositViewTokenAddress, + useGmxAccountModalOpen, +} from "context/GmxAccountContext/hooks"; +import { TokenChainData } from "domain/multichain/types"; +import { useChainId } from "lib/chains"; +import { formatBalanceAmount, formatUsd } from "lib/numbers"; +import { EMPTY_OBJECT } from "lib/objects"; +import { convertToUsd, getMidPrice } from "sdk/utils/tokens"; + +import Button from "components/Button/Button"; +import SearchInput from "components/SearchInput/SearchInput"; +import { useMultichainTokensRequest } from "components/Synthetics/GmxAccountModal/hooks"; +import { ButtonRowScrollFadeContainer } from "components/TableScrollFade/TableScrollFade"; +import TokenIcon from "components/TokenIcon/TokenIcon"; + +import InfoIconComponent from "img/ic_info.svg?react"; + +type TokenListItemProps = { + tokenChainData: DisplayTokenChainData; + onClick?: () => void; + className?: string; +}; + +const TokenListItem = ({ tokenChainData, onClick, className }: TokenListItemProps) => { + return ( +
+
+ +
+
{tokenChainData.symbol}
+
{getChainName(tokenChainData.sourceChainId)}
+
+
+
+
+ {formatBalanceAmount( + tokenChainData.sourceChainBalance ?? 0n, + tokenChainData.sourceChainDecimals, + tokenChainData.symbol, + { isStable: tokenChainData.isStable } + )} +
+
+ {tokenChainData.sourceChainBalanceUsd > 0n ? formatUsd(tokenChainData.sourceChainBalanceUsd) : "-"} +
+
+
+ ); +}; + +type DisplayTokenChainData = TokenChainData & { + sourceChainBalanceUsd: bigint; +}; + +export const SelectAssetToDepositView = () => { + const { chainId } = useChainId(); + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + const [, setDepositViewChain] = useGmxAccountDepositViewChain(); + const [, setDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + + const [selectedNetwork, setSelectedNetwork] = useState("all"); + const [searchQuery, setSearchQuery] = useState(""); + + const { tokenChainDataArray } = useMultichainTokensRequest(); + + const NETWORKS_FILTER = useMemo(() => { + const wildCard = { id: "all" as const, name: "All Networks" }; + + const chainFilters = Object.keys(MULTICHAIN_TOKEN_MAPPING[chainId] ?? EMPTY_OBJECT).map((sourceChainId) => ({ + id: parseInt(sourceChainId), + name: getChainName(parseInt(sourceChainId)), + })); + + return [wildCard, ...chainFilters]; + }, [chainId]); + + const filteredBalances: DisplayTokenChainData[] = useMemo(() => { + return tokenChainDataArray + .filter((tokenChainData) => { + const matchesSearch = tokenChainData.symbol.toLowerCase().includes(searchQuery.toLowerCase()); + const matchesNetwork = selectedNetwork === "all" || tokenChainData.sourceChainId === selectedNetwork; + return matchesSearch && matchesNetwork; + }) + .map((tokenChainData) => { + let balanceUsd = 0n; + + if (tokenChainData.sourceChainPrices) { + balanceUsd = + convertToUsd( + tokenChainData.sourceChainBalance, + tokenChainData.sourceChainDecimals, + getMidPrice(tokenChainData.sourceChainPrices) + ) ?? 0n; + } + + return { + ...tokenChainData, + sourceChainBalanceUsd: balanceUsd, + }; + }) + .sort((a, b) => { + if (a.sourceChainBalanceUsd === b.sourceChainBalanceUsd) { + return 0; + } + + return a.sourceChainBalanceUsd > b.sourceChainBalanceUsd ? -1 : 1; + }); + }, [tokenChainDataArray, searchQuery, selectedNetwork]); + + return ( +
+
+ setSearchQuery(value)} + className="rounded-4 bg-slate-700" + size="s" + noBorder + /> +
+ +
+ +
+ {NETWORKS_FILTER.map((network) => ( + + ))} +
+
+
+ +
+ {filteredBalances.map((tokenChainData) => ( + { + setDepositViewChain(tokenChainData.sourceChainId); + setDepositViewTokenAddress(tokenChainData.address); + setIsVisibleOrView("deposit"); + }} + /> + ))} + {filteredBalances.length === 0 && ( +
+ + {selectedNetwork === "all" ? ( + No assets are available for deposit + ) : ( + No assets available for deposit on {getChainName(selectedNetwork)} + )} +
+ )} +
+
+ ); +}; diff --git a/src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx b/src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx new file mode 100644 index 0000000000..194c523451 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx @@ -0,0 +1,225 @@ +import { Trans } from "@lingui/macro"; +import { useEffect, useState } from "react"; + +import { getChainName, SourceChainId } from "config/chains"; +import { CHAIN_ID_TO_NETWORK_ICON } from "config/icons"; +import { + useGmxAccountDepositViewChain, + useGmxAccountDepositViewTokenAddress, + useGmxAccountDepositViewTokenInputValue, + useGmxAccountModalOpen, + useGmxAccountSelectedTransferGuid, + useGmxAccountWithdrawalViewChain, + useGmxAccountWithdrawalViewTokenAddress, + useGmxAccountWithdrawalViewTokenInputValue, +} from "context/GmxAccountContext/hooks"; +import { useGmxAccountFundingHistoryItem } from "domain/multichain/useGmxAccountFundingHistory"; +import { useChainId } from "lib/chains"; +import { CHAIN_ID_TO_EXPLORER_NAME, CHAIN_ID_TO_TX_URL_BUILDER } from "lib/chains/blockExplorers"; +import { formatAmountFree, formatBalanceAmount } from "lib/numbers"; +import { shortenAddressOrEns } from "lib/wallets"; +import { getToken } from "sdk/configs/tokens"; + +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; +import Button from "components/Button/Button"; +import ExternalLink from "components/ExternalLink/ExternalLink"; + +import externalLink from "img/ic_new_link_20.svg"; + +import { SyntheticsInfoRow } from "../SyntheticsInfoRow"; +import { formatTradeActionTimestamp } from "../TradeHistory/TradeHistoryRow/utils/shared"; + +export const TransferDetailsView = () => { + const { chainId } = useChainId(); + + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); + const [, setGmxAccountDepositViewChain] = useGmxAccountDepositViewChain(); + const [, setGmxAccountWithdrawalViewChain] = useGmxAccountWithdrawalViewChain(); + const [, setGmxAccountDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + const [, setGmxAccountDepositViewTokenInputValue] = useGmxAccountDepositViewTokenInputValue(); + const [, setGmxAccountWithdrawalViewTokenAddress] = useGmxAccountWithdrawalViewTokenAddress(); + const [, setGmxAccountWithdrawalViewTokenInputValue] = useGmxAccountWithdrawalViewTokenInputValue(); + + const [selectedTransferGuid] = useGmxAccountSelectedTransferGuid(); + + const [isTransferPending, setIsTransferPending] = useState(false); + + const selectedTransfer = useGmxAccountFundingHistoryItem(selectedTransferGuid, { + refetch: isTransferPending, + }); + + useEffect(() => { + if (!selectedTransfer) { + return; + } + + if (selectedTransfer.operation === "deposit" && selectedTransfer.step !== "received") { + setIsTransferPending(true); + return; + } + + if (selectedTransfer.operation === "withdrawal" && selectedTransfer.step !== "executed") { + setIsTransferPending(true); + return; + } + }, [selectedTransfer]); + + const sourceChainName = selectedTransfer ? getChainName(selectedTransfer.sourceChainId) : undefined; + + const token = selectedTransfer ? getToken(chainId, selectedTransfer.token) : undefined; + + const handleRepeatTransaction = () => { + if (!selectedTransfer || !token) { + return; + } + + if (selectedTransfer.operation === "deposit") { + setGmxAccountDepositViewChain(selectedTransfer.sourceChainId as SourceChainId); + setGmxAccountDepositViewTokenAddress(selectedTransfer.token); + setGmxAccountDepositViewTokenInputValue(formatAmountFree(selectedTransfer.sentAmount, token.decimals)); + setGmxAccountModalOpen("deposit"); + return; + } + + if (selectedTransfer.operation === "withdrawal") { + setGmxAccountWithdrawalViewChain(selectedTransfer.sourceChainId as SourceChainId); + setGmxAccountWithdrawalViewTokenAddress(selectedTransfer.token); + setGmxAccountWithdrawalViewTokenInputValue(formatAmountFree(selectedTransfer.sentAmount, token.decimals)); + setGmxAccountModalOpen("withdraw"); + } + }; + + return ( +
+ {selectedTransfer?.isExecutionError ? ( + + Your deposit of from {sourceChainName} was not executed due to an error + + ) : null} + Date} + value={selectedTransfer ? formatTradeActionTimestamp(selectedTransfer.sentTimestamp) : undefined} + /> + Type} + value={ + selectedTransfer ? ( + selectedTransfer.operation === "deposit" ? ( + Deposit + ) : ( + Withdrawal + ) + ) : undefined + } + /> + Wallet} + value={ + selectedTransfer ? ( + selectedTransfer.operation === "deposit" ? ( + GMX Balance + ) : ( + shortenAddressOrEns(selectedTransfer.account, 13) + ) + ) : undefined + } + /> + Amount} + value={ + selectedTransfer && token + ? formatBalanceAmount(selectedTransfer.sentAmount, token.decimals, token.symbol, { + isStable: token.isStable, + }) + : undefined + } + /> + {selectedTransfer?.receivedAmount !== undefined && ( + <> + Fee} + value={ + selectedTransfer && token + ? formatBalanceAmount( + selectedTransfer.sentAmount - selectedTransfer.receivedAmount, + token.decimals, + token.symbol, + { + isStable: token.isStable, + } + ) + : undefined + } + /> + + )} + From Network + ) : ( + To Network + ) + ) : undefined + } + className="!items-center" + valueClassName="-my-5" + value={ + selectedTransfer && ( +
+ + {getChainName(selectedTransfer.sourceChainId)} +
+ ) + } + /> + From Wallet + ) : ( + To Wallet + ) + ) : undefined + } + value={selectedTransfer ? shortenAddressOrEns(selectedTransfer.account, 13) : undefined} + /> + {selectedTransfer?.sentTxn && ( + +
+ {shortenAddressOrEns(selectedTransfer.sentTxn, 13)} + External Link +
+ + } + /> + )} +
+ +
+ ); +}; diff --git a/src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx b/src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx new file mode 100644 index 0000000000..0aaf7c28bb --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx @@ -0,0 +1,1113 @@ +import { t, Trans } from "@lingui/macro"; +import { type Provider } from "ethers"; +import { useCallback, useEffect, useMemo, useState } from "react"; +import { ImSpinner2 } from "react-icons/im"; +import Skeleton from "react-loading-skeleton"; +import { useHistory } from "react-router-dom"; +import { Address, encodeAbiParameters, zeroAddress } from "viem"; +import { useAccount } from "wagmi"; + +import { ContractsChainId, getChainName, isContractsChain, SettlementChainId, SourceChainId } from "config/chains"; +import { CHAIN_ID_TO_NETWORK_ICON } from "config/icons"; +import { + CHAIN_ID_PREFERRED_DEPOSIT_TOKEN, + FAKE_INPUT_AMOUNT_MAP, + getLayerZeroEndpointId, + getMultichainTokenId, + getStargatePoolAddress, + isSettlementChain, + MULTICHAIN_FUNDING_SLIPPAGE_BPS, + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS, +} from "config/multichain"; +import { + useGmxAccountDepositViewTokenAddress, + useGmxAccountDepositViewTokenInputValue, + useGmxAccountModalOpen, + useGmxAccountWithdrawalViewChain, + useGmxAccountWithdrawalViewTokenAddress, + useGmxAccountWithdrawalViewTokenInputValue, +} from "context/GmxAccountContext/hooks"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { + selectExpressGlobalParams, + selectGasPaymentToken, +} from "context/SyntheticsStateContext/selectors/expressSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useArbitraryError, useArbitraryRelayParamsAndPayload } from "domain/multichain/arbitraryRelayParams"; +import { fallbackCustomError } from "domain/multichain/fallbackCustomError"; +import { getMultichainTransferSendParams } from "domain/multichain/getSendParams"; +import { BridgeOutParams } from "domain/multichain/types"; +import { useGmxAccountFundingHistory } from "domain/multichain/useGmxAccountFundingHistory"; +import { useMultichainQuoteFeeUsd } from "domain/multichain/useMultichainQuoteFeeUsd"; +import { useQuoteOft } from "domain/multichain/useQuoteOft"; +import { useQuoteOftLimits } from "domain/multichain/useQuoteOftLimits"; +import { useQuoteSend } from "domain/multichain/useQuoteSend"; +import { callRelayTransaction } from "domain/synthetics/express/callRelayTransaction"; +import { buildAndSignBridgeOutTxn } from "domain/synthetics/express/expressOrderUtils"; +import { ExpressTransactionBuilder, RawRelayParamsPayload } from "domain/synthetics/express/types"; +import { useSwitchGasPaymentTokenIfRequired } from "domain/synthetics/express/useSwitchGasPaymentTokenIfRequired"; +import { useTokensDataRequest } from "domain/synthetics/tokens"; +import { convertToUsd, TokenData } from "domain/tokens"; +import { useChainId } from "lib/chains"; +import { useLeadingDebounce } from "lib/debounce/useLeadingDebounde"; +import { helperToast } from "lib/helperToast"; +import { + initMultichainWithdrawalMetricData, + sendOrderSimulatedMetric, + sendOrderSubmittedMetric, + sendOrderTxnSubmittedMetric, + sendTxnErrorMetric, + sendTxnSentMetric, + sendTxnValidationErrorMetric, +} from "lib/metrics"; +import { + bigintToNumber, + expandDecimals, + formatAmountFree, + formatBalanceAmount, + formatUsd, + parseValue, + USD_DECIMALS, +} from "lib/numbers"; +import { EMPTY_ARRAY, getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; +import { ExpressTxnData, sendExpressTransaction } from "lib/transactions/sendExpressTransaction"; +import { WalletSigner } from "lib/wallets"; +import { getContract } from "sdk/configs/contracts"; +import { getGasPaymentTokens } from "sdk/configs/express"; +import { convertTokenAddress, getToken } from "sdk/configs/tokens"; +import { bigMath } from "sdk/utils/bigmath"; +import { convertToTokenAmount, getMidPrice } from "sdk/utils/tokens"; +import { applySlippageToMinOut } from "sdk/utils/trade"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; + +import { AlertInfoCard } from "components/AlertInfo/AlertInfoCard"; +import Button from "components/Button/Button"; +import { DropdownSelector } from "components/DropdownSelector/DropdownSelector"; +import NumberInput from "components/NumberInput/NumberInput"; +import { + useAvailableToTradeAssetMultichain, + useGmxAccountWithdrawNetworks, +} from "components/Synthetics/GmxAccountModal/hooks"; +import TokenIcon from "components/TokenIcon/TokenIcon"; +import { ValueTransition } from "components/ValueTransition/ValueTransition"; + +import { SyntheticsInfoRow } from "../SyntheticsInfoRow"; +import { InsufficientWntBanner } from "./InsufficientWntBanner"; +import { toastCustomOrStargateError } from "./toastCustomOrStargateError"; +import { wrapChainAction } from "./wrapChainAction"; + +const USD_GAS_TOKEN_BUFFER_MAINNET = expandDecimals(4, USD_DECIMALS); +const USD_GAS_TOKEN_WARNING_THRESHOLD_MAINNET = expandDecimals(3, USD_DECIMALS); +const USD_GAS_TOKEN_BUFFER_TESTNET = expandDecimals(10, USD_DECIMALS); +const USD_GAS_TOKEN_WARNING_THRESHOLD_TESTNET = expandDecimals(9, USD_DECIMALS); + +function useUsdGasTokenBuffer(): { + gasTokenBuffer: bigint; + gasTokenBufferWarningThreshold: bigint; +} { + const { chainId } = useChainId(); + const isMainnet = isContractsChain(chainId, false); + + if (!isMainnet) { + return { + gasTokenBuffer: USD_GAS_TOKEN_BUFFER_TESTNET, + gasTokenBufferWarningThreshold: USD_GAS_TOKEN_WARNING_THRESHOLD_TESTNET, + }; + } + + return { + gasTokenBuffer: USD_GAS_TOKEN_BUFFER_MAINNET, + gasTokenBufferWarningThreshold: USD_GAS_TOKEN_WARNING_THRESHOLD_MAINNET, + }; +} + +const useIsFirstWithdrawal = () => { + const [enabled, setEnabled] = useState(true); + const [isFirstWithdrawal, setIsFirstWithdrawal] = useState(false); + const { fundingHistory, isLoading } = useGmxAccountFundingHistory({ enabled }); + + useEffect(() => { + if (isLoading) { + return; + } + + if (fundingHistory === undefined || fundingHistory.length !== 0) { + return; + } + + setEnabled(false); + const hasWithdrawal = fundingHistory.some((funding) => funding.operation === "withdrawal"); + if (!hasWithdrawal) { + setIsFirstWithdrawal(true); + } + }, [fundingHistory, isLoading]); + + return isFirstWithdrawal; +}; + +export const WithdrawalView = () => { + const history = useHistory(); + const { chainId } = useChainId(); + const [withdrawalViewChain, setWithdrawalViewChain] = useGmxAccountWithdrawalViewChain(); + const { address: account } = useAccount(); + const [, setDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + const [, setDepositViewTokenInputValue] = useGmxAccountDepositViewTokenInputValue(); + const [isVisibleOrView, setIsVisibleOrView] = useGmxAccountModalOpen(); + const [inputValue, setInputValue] = useGmxAccountWithdrawalViewTokenInputValue(); + const [selectedTokenAddress, setSelectedTokenAddress] = useGmxAccountWithdrawalViewTokenAddress(); + const [isSubmitting, setIsSubmitting] = useState(false); + const isFirstWithdrawal = useIsFirstWithdrawal(); + const { setMultichainSubmittedWithdrawal, setMultichainWithdrawalSentTxnHash, setMultichainWithdrawalSentError } = + useSyntheticsEvents(); + + const { tokensData } = useTokensDataRequest(chainId, withdrawalViewChain); + const networks = useGmxAccountWithdrawNetworks(); + const globalExpressParams = useSelector(selectExpressGlobalParams); + const relayerFeeToken = getByKey(tokensData, globalExpressParams?.relayerFeeTokenAddress); + const { gasTokenBuffer, gasTokenBufferWarningThreshold } = useUsdGasTokenBuffer(); + + const { provider } = useJsonRpcProvider(chainId); + + const selectedToken = useMemo(() => { + return getByKey(tokensData, selectedTokenAddress); + }, [selectedTokenAddress, tokensData]); + + const unwrappedSelectedTokenAddress = + selectedTokenAddress !== undefined ? convertTokenAddress(chainId, selectedTokenAddress, "native") : undefined; + const unwrappedSelectedTokenSymbol = unwrappedSelectedTokenAddress + ? getToken(chainId, unwrappedSelectedTokenAddress).symbol + : undefined; + const wrappedNativeTokenAddress = getContract(chainId, "NATIVE_TOKEN"); + const wrappedNativeToken = getByKey(tokensData, wrappedNativeTokenAddress); + + const selectedTokenSettlementChainTokenId = unwrappedSelectedTokenAddress + ? getMultichainTokenId(chainId, unwrappedSelectedTokenAddress) + : undefined; + + const realInputAmount = + selectedToken && inputValue !== undefined ? parseValue(inputValue, selectedToken.decimals) : undefined; + const inputAmount = useLeadingDebounce(realInputAmount); + const inputAmountUsd = selectedToken + ? convertToUsd(inputAmount, selectedToken.decimals, selectedToken.prices.maxPrice) + : undefined; + + const options = useMemo(() => { + if (!isSettlementChain(chainId) || !tokensData) { + return EMPTY_ARRAY; + } + + return MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[chainId as SettlementChainId] + ?.map((tokenAddress) => tokensData[tokenAddress]) + .filter((token) => token.address !== zeroAddress) + .sort((a, b) => { + const aFloat = bigintToNumber(a.gmxAccountBalance ?? 0n, a.decimals); + const bFloat = bigintToNumber(b.gmxAccountBalance ?? 0n, b.decimals); + + return bFloat - aFloat; + }); + }, [chainId, tokensData]); + + const { gmxAccountUsd } = useAvailableToTradeAssetMultichain(); + + const { nextGmxAccountBalanceUsd, nextTokenGmxAccountBalance } = useMemo(() => { + if (selectedToken === undefined || inputAmount === undefined || inputAmountUsd === undefined) { + return { nextGmxAccountBalanceUsd: undefined, nextTokenGmxAccountBalance: undefined }; + } + + const nextGmxAccountBalanceUsd = (gmxAccountUsd ?? 0n) - inputAmountUsd; + const nextTokenGmxAccountBalance = (selectedToken.gmxAccountBalance ?? 0n) - inputAmount; + + return { nextGmxAccountBalanceUsd, nextTokenGmxAccountBalance }; + }, [selectedToken, inputAmount, inputAmountUsd, gmxAccountUsd]); + + const sendParamsWithoutSlippage: SendParamStruct | undefined = useMemo(() => { + if (!account || inputAmount === undefined || inputAmount <= 0n || withdrawalViewChain === undefined) { + return; + } + + return getMultichainTransferSendParams({ + dstChainId: withdrawalViewChain, + account, + inputAmount, + isDeposit: false, + }); + }, [account, inputAmount, withdrawalViewChain]); + + const quoteOft = useQuoteOft({ + sendParams: sendParamsWithoutSlippage, + fromStargateAddress: selectedTokenSettlementChainTokenId?.stargate, + fromChainProvider: provider, + fromChainId: chainId, + toChainId: withdrawalViewChain, + }); + + const { isBelowLimit, lowerLimitFormatted, isAboveLimit, upperLimitFormatted } = useQuoteOftLimits({ + quoteOft, + inputAmount, + isStable: selectedToken?.isStable, + decimals: selectedTokenSettlementChainTokenId?.decimals, + }); + + const sendParamsWithSlippage: SendParamStruct | undefined = useMemo(() => { + if (!quoteOft || !sendParamsWithoutSlippage) { + return undefined; + } + + const { receipt } = quoteOft; + + const minAmountLD = applySlippageToMinOut(MULTICHAIN_FUNDING_SLIPPAGE_BPS, receipt.amountReceivedLD as bigint); + + const newSendParams: SendParamStruct = { + ...sendParamsWithoutSlippage, + minAmountLD, + }; + + return newSendParams; + }, [sendParamsWithoutSlippage, quoteOft]); + + const quoteSend = useQuoteSend({ + sendParams: sendParamsWithSlippage, + fromStargateAddress: selectedTokenSettlementChainTokenId?.stargate, + fromChainProvider: provider, + fromChainId: chainId, + toChainId: withdrawalViewChain, + }); + + const baseSendParams = useMemo(() => { + if (!withdrawalViewChain || !account || !unwrappedSelectedTokenSymbol) { + return; + } + + const fakeInputAmount = FAKE_INPUT_AMOUNT_MAP[unwrappedSelectedTokenSymbol]; + + if (fakeInputAmount === undefined) { + return; + } + + return getMultichainTransferSendParams({ + dstChainId: withdrawalViewChain, + account, + inputAmount: fakeInputAmount, + isDeposit: false, + srcChainId: chainId, + }); + }, [account, chainId, unwrappedSelectedTokenSymbol, withdrawalViewChain]); + const isMaxButtonDisabled = useMemo(() => { + if (!baseSendParams) { + return true; + } + + return false; + }, [baseSendParams]); + + const baseQuoteSend = useQuoteSend({ + sendParams: baseSendParams, + fromStargateAddress: selectedTokenSettlementChainTokenId?.stargate, + fromChainProvider: provider, + fromChainId: chainId, + toChainId: withdrawalViewChain, + }); + + const { + networkFeeUsd: bridgeNetworkFeeUsd, + protocolFeeUsd, + networkFee: bridgeNetworkFee, + } = useMultichainQuoteFeeUsd({ + quoteSend, + quoteOft, + unwrappedTokenAddress: unwrappedSelectedTokenAddress, + srcChainId: withdrawalViewChain, + }); + + const bridgeOutParams: BridgeOutParams | undefined = useMemo(() => { + if ( + withdrawalViewChain === undefined || + selectedTokenAddress === undefined || + unwrappedSelectedTokenAddress === undefined || + inputAmount === undefined || + inputAmount <= 0n + ) { + return; + } + + const dstEid = getLayerZeroEndpointId(withdrawalViewChain); + const stargateAddress = getStargatePoolAddress(chainId, unwrappedSelectedTokenAddress); + + if (dstEid === undefined || stargateAddress === undefined) { + return; + } + + return { + token: selectedTokenAddress as Address, + amount: inputAmount, + minAmountOut: inputAmount, + data: encodeAbiParameters( + [ + { + type: "uint32", + name: "dstEid", + }, + ], + [dstEid] + ), + provider: stargateAddress, + }; + }, [withdrawalViewChain, selectedTokenAddress, unwrappedSelectedTokenAddress, inputAmount, chainId]); + + const expressTransactionBuilder: ExpressTransactionBuilder | undefined = useMemo(() => { + if ( + account === undefined || + bridgeOutParams === undefined || + provider === undefined || + withdrawalViewChain === undefined + ) { + return; + } + + const expressTransactionBuilder: ExpressTransactionBuilder = async ({ gasPaymentParams, relayParams }) => ({ + txnData: await buildAndSignBridgeOutTxn({ + chainId: chainId as SettlementChainId, + signer: undefined, + account, + relayParamsPayload: relayParams as RawRelayParamsPayload, + params: bridgeOutParams, + emptySignature: true, + relayerFeeTokenAddress: gasPaymentParams.relayerFeeTokenAddress, + relayerFeeAmount: gasPaymentParams.relayerFeeAmount, + srcChainId: withdrawalViewChain, + }), + }); + + return expressTransactionBuilder; + }, [account, bridgeOutParams, chainId, provider, withdrawalViewChain]); + + const expressTxnParamsAsyncResult = useArbitraryRelayParamsAndPayload({ + expressTransactionBuilder, + isGmxAccount: true, + }); + + const errors = useArbitraryError(expressTxnParamsAsyncResult.error); + + const isOutOfTokenErrorToken = useMemo(() => { + if (errors?.isOutOfTokenError?.tokenAddress) { + return getByKey(tokensData, errors?.isOutOfTokenError?.tokenAddress); + } + }, [errors, tokensData]); + + useSwitchGasPaymentTokenIfRequired({ + gasPaymentToken: globalExpressParams?.gasPaymentToken, + isOutGasTokenBalance: errors?.isOutOfTokenError?.isGasPaymentToken, + totalGasPaymentTokenAmount: errors?.isOutOfTokenError + ? errors.isOutOfTokenError.requiredAmount - errors.isOutOfTokenError.balance + : undefined, + isGmxAccount: true, + }); + + const relayFeeAmount = expressTxnParamsAsyncResult?.data?.gasPaymentParams.relayerFeeAmount; + const gasPaymentParams = expressTxnParamsAsyncResult?.data?.gasPaymentParams; + + const { networkFeeUsd, networkFee } = useMemo(() => { + if (relayFeeAmount === undefined || relayerFeeToken === undefined) { + return { networkFeeUsd: undefined, networkFee: undefined }; + } + + const relayFeeUsd = convertToUsd(relayFeeAmount, relayerFeeToken.decimals, getMidPrice(relayerFeeToken.prices)); + + if (relayFeeUsd === undefined || bridgeNetworkFeeUsd === undefined || bridgeNetworkFee === undefined) { + return { networkFeeUsd: undefined, networkFee: undefined }; + } + + return { + networkFeeUsd: relayFeeUsd + bridgeNetworkFeeUsd, + networkFee: + // We assume it is all in WNT + relayFeeAmount + bridgeNetworkFee, + }; + }, [bridgeNetworkFee, bridgeNetworkFeeUsd, relayFeeAmount, relayerFeeToken]); + + const [showWntWarning, setShowWntWarning] = useState(false); + const [lastValidNetworkFees, setLastValidNetworkFees] = useState({ + networkFee: networkFee, + networkFeeUsd: networkFeeUsd, + }); + useEffect(() => { + if (networkFee !== undefined && networkFeeUsd !== undefined) { + setLastValidNetworkFees({ + networkFee, + networkFeeUsd, + }); + } + }, [networkFee, networkFeeUsd]); + useEffect(() => { + if (wrappedNativeTokenAddress === zeroAddress) { + setShowWntWarning(false); + return; + } + + if (!wrappedNativeToken || wrappedNativeToken.gmxAccountBalance === undefined) { + return; + } + + if (wrappedNativeToken.gmxAccountBalance === 0n) { + setShowWntWarning(true); + return; + } + + const someNetworkFee = networkFee ?? lastValidNetworkFees.networkFee; + if (someNetworkFee === undefined) { + return; + } + + const value = (unwrappedSelectedTokenAddress === zeroAddress ? inputAmount : 0n) ?? 0n; + + setShowWntWarning(wrappedNativeToken.gmxAccountBalance - value < someNetworkFee); + }, [ + wrappedNativeToken, + networkFee, + unwrappedSelectedTokenAddress, + inputAmount, + lastValidNetworkFees.networkFee, + wrappedNativeTokenAddress, + ]); + + const handleWithdraw = async () => { + if (withdrawalViewChain === undefined || selectedToken === undefined || account === undefined) { + return; + } + + const metricData = initMultichainWithdrawalMetricData({ + settlementChain: chainId, + sourceChain: withdrawalViewChain, + assetSymbol: unwrappedSelectedTokenSymbol ?? selectedToken.symbol, + sizeInUsd: inputAmountUsd!, + isFirstWithdrawal, + }); + + sendOrderSubmittedMetric(metricData.metricId); + + if ( + gasPaymentParams === undefined || + bridgeOutParams === undefined || + expressTxnParamsAsyncResult.promise === undefined || + provider === undefined + ) { + helperToast.error("Missing required parameters"); + sendTxnValidationErrorMetric(metricData.metricId); + return; + } + + const expressTxnParams = await expressTxnParamsAsyncResult.promise; + + if (expressTxnParams === undefined) { + helperToast.error("Missing required parameters"); + sendTxnValidationErrorMetric(metricData.metricId); + return; + } + + setIsSubmitting(true); + try { + const relayParamsPayload = expressTxnParams.relayParamsPayload; + + await wrapChainAction(withdrawalViewChain, async (signer) => { + await simulateWithdraw({ + chainId: chainId as SettlementChainId, + relayerFeeTokenAddress: gasPaymentParams.relayerFeeTokenAddress, + relayerFeeAmount: gasPaymentParams.relayerFeeAmount, + relayParamsPayload: relayParamsPayload as RawRelayParamsPayload, + params: bridgeOutParams, + signer, + provider, + srcChainId: withdrawalViewChain, + }); + + sendOrderSimulatedMetric(metricData.metricId); + + const signedTxnData: ExpressTxnData = await buildAndSignBridgeOutTxn({ + chainId: chainId as SettlementChainId, + signer, + account, + relayParamsPayload: relayParamsPayload as RawRelayParamsPayload, + params: bridgeOutParams, + relayerFeeAmount: gasPaymentParams.relayerFeeAmount, + relayerFeeTokenAddress: gasPaymentParams.relayerFeeTokenAddress, + srcChainId: withdrawalViewChain, + }); + + const mockWithdrawalId = setMultichainSubmittedWithdrawal({ + amount: bridgeOutParams.amount, + settlementChainId: chainId, + sourceChainId: withdrawalViewChain, + tokenAddress: unwrappedSelectedTokenAddress ?? selectedToken.address, + }); + + const receipt = await sendExpressTransaction({ + chainId, + txnData: signedTxnData, + isSponsoredCall: expressTxnParams.isSponsoredCall, + }); + + sendOrderTxnSubmittedMetric(metricData.metricId); + + const txResult = await receipt.wait(); + + if (txResult.status === "success") { + sendTxnSentMetric(metricData.metricId); + if (txResult.transactionHash && mockWithdrawalId) { + setMultichainWithdrawalSentTxnHash(mockWithdrawalId, txResult.transactionHash); + } + setIsVisibleOrView("main"); + } else if (txResult.status === "failed" && mockWithdrawalId) { + setMultichainWithdrawalSentError(mockWithdrawalId); + } + }); + } catch (error) { + const prettyError = toastCustomOrStargateError(chainId, error); + sendTxnErrorMetric(metricData.metricId, prettyError, "unknown"); + } finally { + setIsSubmitting(false); + } + }; + + const gasPaymentToken = useSelector(selectGasPaymentToken); + + const handleMaxButtonClick = useCallback(async () => { + if ( + selectedToken === undefined || + selectedToken.gmxAccountBalance === undefined || + selectedToken.gmxAccountBalance === 0n || + withdrawalViewChain === undefined || + account === undefined + ) { + return; + } + + const canSelectedTokenBeUsedAsGasPaymentToken = getGasPaymentTokens(chainId).includes(selectedToken.address); + + let amount = selectedToken.gmxAccountBalance; + + if (!canSelectedTokenBeUsedAsGasPaymentToken || gasPaymentToken?.address !== selectedToken.address) { + amount = selectedToken.gmxAccountBalance; + } else { + const buffer = convertToTokenAmount( + gasTokenBuffer, + gasPaymentToken.decimals, + getMidPrice(gasPaymentToken.prices) + )!; + + const maxAmount = bigMath.max(selectedToken.gmxAccountBalance - buffer, 0n); + amount = maxAmount; + } + + const nativeFee = bridgeNetworkFee ?? baseQuoteSend?.nativeFee; + + if (unwrappedSelectedTokenAddress === zeroAddress && nativeFee !== undefined) { + amount = amount - (nativeFee * 11n) / 10n; + } + + amount = bigMath.max(amount, 0n); + + setInputValue(formatAmountFree(amount, selectedToken.decimals)); + }, [ + account, + baseQuoteSend?.nativeFee, + bridgeNetworkFee, + chainId, + gasPaymentToken?.address, + gasPaymentToken?.decimals, + gasPaymentToken?.prices, + gasTokenBuffer, + selectedToken, + setInputValue, + unwrappedSelectedTokenAddress, + withdrawalViewChain, + ]); + + const shouldShowMinRecommendedAmount = useMemo(() => { + if ( + selectedToken === undefined || + selectedToken.gmxAccountBalance === undefined || + selectedToken.gmxAccountBalance === 0n || + withdrawalViewChain === undefined || + account === undefined || + inputAmount === undefined || + inputAmount <= 0n + ) { + return false; + } + + const canSelectedTokenBeUsedAsGasPaymentToken = getGasPaymentTokens(chainId).includes(selectedToken.address); + + if (!canSelectedTokenBeUsedAsGasPaymentToken) { + return false; + } + + if (gasPaymentToken?.address !== selectedToken.address) { + return false; + } + + const buffer = convertToTokenAmount( + gasTokenBufferWarningThreshold, + gasPaymentToken.decimals, + getMidPrice(gasPaymentToken.prices) + )!; + + const maxAmount = bigMath.max(selectedToken.gmxAccountBalance - inputAmount - buffer, 0n); + + return maxAmount === 0n; + }, [ + account, + chainId, + gasPaymentToken?.address, + gasPaymentToken?.decimals, + gasPaymentToken?.prices, + gasTokenBufferWarningThreshold, + inputAmount, + selectedToken, + withdrawalViewChain, + ]); + + const isInputEmpty = inputAmount === undefined || inputAmount <= 0n; + + let buttonState: { + text: React.ReactNode; + disabled?: boolean; + onClick?: () => void; + } = { + text: t`Withdraw`, + onClick: handleWithdraw, + }; + + if (isSubmitting) { + buttonState = { + text: ( + <> + Withdrawing... + + + ), + disabled: true, + }; + } else if (isInputEmpty) { + buttonState = { + text: t`Enter withdrawal amount`, + disabled: true, + }; + } else if (selectedToken?.gmxAccountBalance !== undefined && inputAmount > selectedToken.gmxAccountBalance) { + buttonState = { + text: t`Insufficient balance`, + disabled: true, + }; + } else if ( + (expressTxnParamsAsyncResult.data?.gasPaymentValidations.isOutGasTokenBalance || + errors?.isOutOfTokenError?.isGasPaymentToken) && + !expressTxnParamsAsyncResult.isLoading + ) { + buttonState = { + text: t`Insufficient ${gasPaymentParams?.relayFeeToken.symbol} balance to pay for gas`, + disabled: true, + }; + } else if (errors?.isOutOfTokenError && !expressTxnParamsAsyncResult.isLoading) { + buttonState = { + text: t`Insufficient ${isOutOfTokenErrorToken?.symbol} balance`, + disabled: true, + }; + } else if (showWntWarning) { + buttonState = { + text: t`Insufficient ${wrappedNativeToken?.symbol} balance`, + disabled: true, + }; + } else if (expressTxnParamsAsyncResult.error && !expressTxnParamsAsyncResult.isLoading) { + buttonState = { + text: expressTxnParamsAsyncResult.error.name.slice(0, 32) ?? t`Error simulating withdrawal`, + disabled: true, + }; + } else if (!expressTxnParamsAsyncResult.data) { + buttonState = { + text: ( + <> + Loading... + + + ), + disabled: true, + }; + } + + const hasSelectedToken = selectedTokenAddress !== undefined; + useEffect( + function fallbackWithdrawTokens() { + if (hasSelectedToken || !withdrawalViewChain || !isSettlementChain(chainId) || isVisibleOrView === false) { + return; + } + + const settlementChainWrappedTokenAddresses = MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[chainId]; + if (!settlementChainWrappedTokenAddresses) { + return; + } + + const preferredToken = settlementChainWrappedTokenAddresses.find((tokenAddress) => { + const tokenData = tokensData?.[tokenAddress]; + return ( + tokenData?.address === CHAIN_ID_PREFERRED_DEPOSIT_TOKEN[chainId] && + tokenData?.gmxAccountBalance !== undefined && + tokenData.gmxAccountBalance > 0n + ); + }); + + if (preferredToken) { + setSelectedTokenAddress(preferredToken); + return; + } + + let maxGmxAccountBalanceUsd = 0n; + let maxBalanceSettlementChainTokenAddress: string | undefined = undefined; + + for (const tokenAddress of settlementChainWrappedTokenAddresses) { + const tokenData = tokensData?.[tokenAddress]; + if (tokenData === undefined) { + continue; + } + + const prices = tokenData.prices; + const balance = tokenData.gmxAccountBalance; + if (prices === undefined || balance === undefined) { + continue; + } + + const price = getMidPrice(prices); + const balanceUsd = convertToUsd(balance, tokenData.decimals, price)!; + if (balanceUsd > maxGmxAccountBalanceUsd) { + maxGmxAccountBalanceUsd = balanceUsd; + maxBalanceSettlementChainTokenAddress = tokenAddress; + } + } + + if (maxBalanceSettlementChainTokenAddress) { + setSelectedTokenAddress(maxBalanceSettlementChainTokenAddress); + } + }, + [chainId, hasSelectedToken, isVisibleOrView, setSelectedTokenAddress, tokensData, withdrawalViewChain] + ); + + return ( +
+
+
+
Asset
+ + + {selectedToken.symbol} +
+ ) : undefined + } + options={options} + item={WithdrawAssetItem} + itemKey={withdrawAssetItemKey} + /> +
+ +
+
+ To Network +
+ { + setWithdrawalViewChain(Number(value) as SourceChainId); + }} + placeholder={t`Select network`} + button={ +
+ {withdrawalViewChain !== undefined ? ( + <> + {getChainName(withdrawalViewChain)} + {getChainName(withdrawalViewChain)} + + ) : ( + <> + + + + )} +
+ } + options={networks} + item={NetworkItem} + itemKey={networkItemKey} + /> +
+ +
+
+ Withdraw + {selectedToken !== undefined && + selectedToken.gmxAccountBalance !== undefined && + selectedToken !== undefined && ( +
+ Available:{" "} + {formatBalanceAmount(selectedToken.gmxAccountBalance, selectedToken.decimals, selectedToken.symbol, { + isStable: selectedToken.isStable, + })} +
+ )} +
+
+ setInputValue(e.target.value)} + className="text-body-large w-full rounded-4 bg-cold-blue-900 py-12 pl-14 pr-72" + placeholder={`0.0 ${selectedToken?.symbol || ""}`} + /> + {inputValue !== "" && inputValue !== undefined && ( +
+
{inputValue}
+
{selectedToken?.symbol || ""}
+
+ )} + +
+
{formatUsd(inputAmountUsd ?? 0n)}
+
+
+ + {isAboveLimit && ( + + + The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than{" "} + {upperLimitFormatted}. + + + )} + {isBelowLimit && ( + + + The amount you are trying to withdraw is below the limit. Please try an amount larger than{" "} + {lowerLimitFormatted}. + + + )} + + {shouldShowMinRecommendedAmount && ( + + + You're withdrawing {selectedToken?.symbol}, your gas token. Gas is required for this withdrawal, so please + keep at least {formatUsd(gasTokenBuffer, { displayDecimals: 0 })} in {selectedToken?.symbol} or switch your + gas token in settings. + + + )} + + {errors?.isOutOfTokenError && + !errors.isOutOfTokenError.isGasPaymentToken && + isOutOfTokenErrorToken !== undefined && ( + + + Withdrawing requires{" "} + {formatBalanceAmount( + errors.isOutOfTokenError.requiredAmount, + isOutOfTokenErrorToken?.decimals, + isOutOfTokenErrorToken?.symbol, + { + isStable: isOutOfTokenErrorToken?.isStable, + } + )}{" "} + while you have{" "} + {formatBalanceAmount( + isOutOfTokenErrorToken.gmxAccountBalance ?? 0n, + isOutOfTokenErrorToken?.decimals, + isOutOfTokenErrorToken?.symbol, + { + isStable: isOutOfTokenErrorToken?.isStable, + } + )} + . Please{" "} + {" "} + or{" "} + {" "} + more {isOutOfTokenErrorToken?.symbol} to your GMX account. + + + )} + + {showWntWarning && ( + + )} + +
+ +
+ Network Fee} + value={networkFeeUsd !== undefined ? formatUsd(networkFeeUsd) : "..."} + /> + Withdraw Fee} + value={protocolFeeUsd !== undefined ? formatUsd(protocolFeeUsd) : "..."} + /> + GMX Balance} + value={} + /> + Asset Balance} + value={ + + } + /> +
+ + +
+ ); +}; + +function networkItemKey(option: { id: number; name: string }) { + return option.id; +} + +function NetworkItem({ option }: { option: { id: number; name: string } }) { + return ( +
+
+ {option.name} + {option.name} +
+
+ ); +} + +function WithdrawAssetItem({ option }: { option: TokenData }) { + return ( +
+
+ + + {option.symbol} {option.name} + +
+
+ {option.gmxAccountBalance !== undefined + ? formatBalanceAmount(option.gmxAccountBalance, option.decimals, undefined, { + isStable: option.isStable, + }) + : "-"} +
+
+ ); +} + +function withdrawAssetItemKey(option: TokenData) { + return option.address; +} + +async function simulateWithdraw({ + provider, + signer, + chainId, + srcChainId, + relayParamsPayload, + relayerFeeTokenAddress, + relayerFeeAmount, + params, +}: { + provider: Provider; + signer: WalletSigner; + chainId: SettlementChainId; + srcChainId: SourceChainId; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; + relayParamsPayload: RawRelayParamsPayload; + params: BridgeOutParams; +}): Promise { + if (!provider) { + throw new Error("Provider is required"); + } + + const { callData, feeAmount, feeToken, to } = await buildAndSignBridgeOutTxn({ + signer, + account: signer.address, + chainId, + srcChainId, + relayParamsPayload, + params, + emptySignature: true, + relayerFeeTokenAddress, + relayerFeeAmount: relayerFeeAmount, + }); + + await fallbackCustomError(async () => { + await callRelayTransaction({ + chainId: chainId as ContractsChainId, + calldata: callData, + provider, + gelatoRelayFeeAmount: feeAmount, + gelatoRelayFeeToken: feeToken, + relayRouterAddress: to as Address, + }); + }, "simulation"); +} diff --git a/src/components/Synthetics/GmxAccountModal/hooks.ts b/src/components/Synthetics/GmxAccountModal/hooks.ts new file mode 100644 index 0000000000..ac12b584b9 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/hooks.ts @@ -0,0 +1,272 @@ +import { useMemo } from "react"; +import useSWRSubscription, { SWRSubscription } from "swr/subscription"; +import { Address } from "viem"; +import { useAccount } from "wagmi"; + +import { ContractsChainId, SettlementChainId, SourceChainId, getChainName } from "config/chains"; +import { MULTICHAIN_TOKEN_MAPPING } from "config/multichain"; +import { fetchMultichainTokenBalances } from "domain/multichain/fetchMultichainTokenBalances"; +import type { TokenChainData } from "domain/multichain/types"; +import { convertToUsd, getMidPrice, useTokenRecentPricesRequest, useTokensDataRequest } from "domain/synthetics/tokens"; +import { TokensData } from "domain/tokens"; +import { useChainId } from "lib/chains"; +import { FREQUENT_UPDATE_INTERVAL } from "lib/timeConstants"; +import { getToken } from "sdk/configs/tokens"; +import { bigMath } from "sdk/utils/bigmath"; + +export function useAvailableToTradeAssetSymbolsSettlementChain(): string[] { + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + + const tokenSymbols = new Set(); + + for (const token of Object.values(tokensData ?? {})) { + if (token.walletBalance !== undefined && token.walletBalance > 0n) { + tokenSymbols.add(token.symbol); + } + if (token.gmxAccountBalance !== undefined && token.gmxAccountBalance > 0n) { + tokenSymbols.add(token.symbol); + } + } + + return Array.from(tokenSymbols); +} + +export function useAvailableToTradeAssetSymbolsMultichain(): string[] { + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + + const tokenSymbols = new Set(); + + for (const token of Object.values(tokensData ?? {})) { + if (token.gmxAccountBalance !== undefined && token.gmxAccountBalance > 0n) { + tokenSymbols.add(token.symbol); + } + } + + return Array.from(tokenSymbols); +} + +export function useAvailableToTradeAssetSettlementChain(): { + totalUsd: bigint | undefined; + gmxAccountUsd: bigint | undefined; + walletUsd: bigint | undefined; + + isGmxAccountLoading: boolean; + isWalletLoading: boolean; +} { + const { chainId, srcChainId } = useChainId(); + const { tokensData, isGmxAccountBalancesLoaded, isWalletBalancesLoaded } = useTokensDataRequest(chainId, srcChainId); + + let gmxAccountUsd = 0n; + let isGmxAccountUsdEmpty = true; + + for (const token of Object.values(tokensData || {})) { + if (token.gmxAccountBalance === undefined) { + continue; + } + isGmxAccountUsdEmpty = false; + gmxAccountUsd += convertToUsd(token.gmxAccountBalance, token.decimals, getMidPrice(token.prices))!; + } + + let walletUsd = 0n; + let isWalletUsdEmpty = true; + + for (const tokenData of Object.values(tokensData || {})) { + if (tokenData.walletBalance === undefined) { + continue; + } + + isWalletUsdEmpty = false; + walletUsd += convertToUsd(tokenData.walletBalance, tokenData.decimals, getMidPrice(tokenData.prices))!; + } + + const totalUsd = gmxAccountUsd + walletUsd; + + return { + totalUsd: isGmxAccountUsdEmpty || isWalletUsdEmpty ? undefined : totalUsd, + gmxAccountUsd: isGmxAccountUsdEmpty ? undefined : gmxAccountUsd, + walletUsd: isWalletUsdEmpty ? undefined : walletUsd, + + isGmxAccountLoading: !isGmxAccountBalancesLoaded, + isWalletLoading: !isWalletBalancesLoaded, + }; +} + +function getTotalGmxAccountUsdFromTokensData(tokensData: TokensData) { + let totalUsd = 0n; + for (const token of Object.values(tokensData)) { + if (token.gmxAccountBalance === undefined || token.gmxAccountBalance === 0n) { + continue; + } + + totalUsd += convertToUsd(token.gmxAccountBalance, token.decimals, getMidPrice(token.prices))!; + } + return totalUsd; +} + +export function useAvailableToTradeAssetMultichainRequest( + chainId: ContractsChainId, + srcChainId: SourceChainId | undefined +): { + gmxAccountUsd: bigint | undefined; +} { + const { tokensData, isGmxAccountBalancesLoaded } = useTokensDataRequest(chainId, srcChainId); + + if (!tokensData || !isGmxAccountBalancesLoaded) { + return { gmxAccountUsd: undefined }; + } + + const gmxAccountUsd = getTotalGmxAccountUsdFromTokensData(tokensData); + + return { gmxAccountUsd }; +} + +export function useAvailableToTradeAssetMultichain(): { + gmxAccountUsd: bigint | undefined; +} { + const { chainId, srcChainId } = useChainId(); + return useAvailableToTradeAssetMultichainRequest(chainId, srcChainId); +} + +const subscribeMultichainTokenBalances: SWRSubscription< + [name: string, chainId: ContractsChainId, account: Address], + { + tokenBalances: Record>; + isLoading: boolean; + } +> = (key, options) => { + const [, settlementChainId, account] = key as [string, SettlementChainId, string]; + + let tokenBalances: Record> | undefined; + let isLoaded = false; + const interval = window.setInterval(() => { + fetchMultichainTokenBalances(settlementChainId, account, (chainId, tokensChainData) => { + tokenBalances = { ...tokenBalances, [chainId]: tokensChainData }; + options.next(null, { tokenBalances, isLoading: isLoaded ? false : true }); + }).then((finalTokenBalances) => { + if (!isLoaded) { + isLoaded = true; + options.next(null, { tokenBalances: finalTokenBalances, isLoading: false }); + } + }); + }, FREQUENT_UPDATE_INTERVAL); + + return () => { + window.clearInterval(interval); + }; +}; + +export function useMultichainTokensRequest(): { + tokenChainDataArray: TokenChainData[]; + isPriceDataLoading: boolean; + isBalanceDataLoading: boolean; +} { + const { chainId } = useChainId(); + const { address: account } = useAccount(); + + const { pricesData, isPriceDataLoading } = useTokenRecentPricesRequest(chainId); + + const { data: balanceData } = useSWRSubscription( + account ? ["multichain-tokens", chainId, account] : null, + subscribeMultichainTokenBalances + ); + const tokenBalances = balanceData?.tokenBalances; + const isBalanceDataLoading = balanceData?.isLoading === undefined ? true : balanceData.isLoading; + + const tokenChainDataArray: TokenChainData[] = useMemo(() => { + const tokenChainDataArray: TokenChainData[] = []; + + if (!tokenBalances) { + return tokenChainDataArray; + } + + for (const sourceChainIdString in tokenBalances) { + const sourceChainId = parseInt(sourceChainIdString) as SourceChainId; + const tokensChainBalanceData = tokenBalances[sourceChainId]; + + for (const sourceChainTokenAddress in tokensChainBalanceData) { + const mapping = MULTICHAIN_TOKEN_MAPPING[chainId]?.[sourceChainId]?.[sourceChainTokenAddress]; + + if (!mapping) { + continue; + } + + const balance = tokensChainBalanceData[sourceChainTokenAddress]; + + if (balance === undefined || balance === 0n) { + continue; + } + + const settlementChainTokenAddress = mapping.settlementChainTokenAddress; + + const token = getToken(chainId, settlementChainTokenAddress); + + const tokenChainData: TokenChainData = { + ...token, + sourceChainId: sourceChainId, + sourceChainDecimals: mapping.sourceChainTokenDecimals, + sourceChainPrices: undefined, + sourceChainBalance: balance, + }; + + if (pricesData && settlementChainTokenAddress in pricesData) { + // convert prices from settlement chain decimals to source chain decimals if decimals are different + + const settlementChainTokenDecimals = token.decimals; + const sourceChainTokenDecimals = mapping.sourceChainTokenDecimals; + + let adjustedPrices = pricesData[settlementChainTokenAddress]; + + if (settlementChainTokenDecimals !== sourceChainTokenDecimals) { + // if current price is 1000 with 1 decimal (100_0) on settlement chain + // and source chain has 3 decimals + // then price should be 100_000 + // so, 1000 * 10 ** 3 / 10 ** 1 = 100_000 + adjustedPrices = { + minPrice: bigMath.mulDiv( + adjustedPrices.minPrice, + 10n ** BigInt(sourceChainTokenDecimals), + 10n ** BigInt(settlementChainTokenDecimals) + ), + maxPrice: bigMath.mulDiv( + adjustedPrices.maxPrice, + 10n ** BigInt(sourceChainTokenDecimals), + 10n ** BigInt(settlementChainTokenDecimals) + ), + }; + } + + tokenChainData.sourceChainPrices = adjustedPrices; + } + + tokenChainDataArray.push(tokenChainData); + } + } + + return tokenChainDataArray; + }, [tokenBalances, chainId, pricesData]); + + return { + tokenChainDataArray: tokenChainDataArray, + isPriceDataLoading, + isBalanceDataLoading, + }; +} + +export function useGmxAccountWithdrawNetworks() { + const { chainId } = useChainId(); + + const sourceChains = Object.keys(MULTICHAIN_TOKEN_MAPPING[chainId] || {}).map(Number); + + const networks = useMemo(() => { + return sourceChains.map((sourceChainId) => { + return { + id: sourceChainId, + name: getChainName(sourceChainId), + }; + }); + }, [sourceChains]); + + return networks; +} diff --git a/src/components/Synthetics/GmxAccountModal/keys.ts b/src/components/Synthetics/GmxAccountModal/keys.ts new file mode 100644 index 0000000000..dad7d515f2 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/keys.ts @@ -0,0 +1,8 @@ +import type { MessageDescriptor } from "@lingui/core"; +import { msg } from "@lingui/macro"; + +export const FUNDING_OPERATIONS_LABELS = { + deposit: msg`Deposit`, + "deposit-failed": msg`Deposit failed`, + withdrawal: msg`Withdrawal`, +} satisfies Partial>; diff --git a/src/components/Synthetics/GmxAccountModal/toastCustomOrStargateError.ts b/src/components/Synthetics/GmxAccountModal/toastCustomOrStargateError.ts new file mode 100644 index 0000000000..6713a69943 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/toastCustomOrStargateError.ts @@ -0,0 +1,47 @@ +import { decodeErrorResult } from "viem"; + +import type { AnyChainId } from "config/chains"; +import { StargateErrorsAbi } from "config/multichain"; +import { helperToast } from "lib/helperToast"; +import { abis } from "sdk/abis"; + +import { getTxnErrorToast } from "components/Errors/errorToasts"; + +export function toastCustomOrStargateError(chainId: AnyChainId, error: Error) { + let prettyErrorName = error.name; + let prettyErrorMessage = error.message; + + const data = (error as any)?.info?.error?.data ?? (error as any)?.data; + if (data) { + try { + const parsedError = decodeErrorResult({ + abi: abis.CustomErrors.concat(StargateErrorsAbi), + data, + }); + + prettyErrorName = parsedError.errorName; + prettyErrorMessage = JSON.stringify(parsedError, null, 2); + } catch (decodeError) { + // pass + } + } + + const toastContext = getTxnErrorToast( + chainId, + { + errorMessage: prettyErrorMessage, + }, + { + defaultMessage: prettyErrorName, + } + ); + + helperToast.error(toastContext.errorContent, { + autoClose: toastContext.autoCloseToast, + }); + + const prettyError = new Error(prettyErrorMessage); + prettyError.name = prettyErrorName; + + return prettyError; +} diff --git a/src/components/Synthetics/GmxAccountModal/wrapChainAction.ts b/src/components/Synthetics/GmxAccountModal/wrapChainAction.ts new file mode 100644 index 0000000000..59c87d1646 --- /dev/null +++ b/src/components/Synthetics/GmxAccountModal/wrapChainAction.ts @@ -0,0 +1,40 @@ +import { getAccount, getChainId, getWalletClient } from "@wagmi/core"; + +import type { AnyChainId } from "config/chains"; +import { switchNetwork, WalletSigner } from "lib/wallets"; +import { getRainbowKitConfig } from "lib/wallets/rainbowKitConfig"; +import { clientToSigner } from "lib/wallets/useEthersSigner"; + +export async function wrapChainAction( + chainId: AnyChainId, + action: (signer: WalletSigner) => Promise +): Promise { + const config = getRainbowKitConfig(); + + const currentChainId = getChainId(config); + const account = getAccount(config).address; + + if (!account) { + throw new Error("No account found"); + } + + if (currentChainId === chainId) { + const currentWalletClient = await getWalletClient(config); + const currentSigner = clientToSigner(currentWalletClient, account); + await action(currentSigner); + return; + } + + await switchNetwork(chainId, true); + + const walletClient = await getWalletClient(config); + const signer = clientToSigner(walletClient, account); + + try { + await action(signer); + } finally { + if (currentChainId !== chainId) { + await switchNetwork(currentChainId, true); + } + } +} diff --git a/src/components/Synthetics/MarketStats/MarketGraphs.tsx b/src/components/Synthetics/MarketStats/MarketGraphs.tsx index 66573c6d7b..736369d02d 100644 --- a/src/components/Synthetics/MarketStats/MarketGraphs.tsx +++ b/src/components/Synthetics/MarketStats/MarketGraphs.tsx @@ -86,13 +86,13 @@ export function MarketGraphs({ glvOrMarketInfo }: { glvOrMarketInfo: GlvOrMarket const address = isGlvInfo(glvOrMarketInfo) ? glvOrMarketInfo.glvTokenAddress : glvOrMarketInfo.marketTokenAddress; - const { chainId } = useChainId(); - const { tokensData } = useTokensDataRequest(chainId); - const { marketsInfoData: onlyGmMarketsInfoData } = useMarketsInfoRequest(chainId); + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData: onlyGmMarketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const enabledGlv = isGlvEnabled(chainId); const account = useSelector(selectAccount); - const { marketsTokensApyData, glvApyInfoData } = useGmMarketsApy(chainId, { period: timeRange }); + const { marketsTokensApyData, glvApyInfoData } = useGmMarketsApy(chainId, srcChainId, { period: timeRange }); const { glvData } = useGlvMarketsInfo(enabledGlv, { marketsInfoData: onlyGmMarketsInfoData, @@ -101,7 +101,7 @@ export function MarketGraphs({ glvOrMarketInfo }: { glvOrMarketInfo: GlvOrMarket account, }); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: true, withGlv: true }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true, withGlv: true }); const tokenAddresses = useMemo(() => { return [glvOrMarketInfo.longTokenAddress, glvOrMarketInfo.shortTokenAddress, address]; diff --git a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx index 3e82368928..e5bb1cd3a6 100644 --- a/src/components/Synthetics/MarketStats/components/CompositionTable.tsx +++ b/src/components/Synthetics/MarketStats/components/CompositionTable.tsx @@ -3,6 +3,7 @@ import { useMemo, useState } from "react"; import { FaChevronDown, FaChevronUp } from "react-icons/fa"; import { USD_DECIMALS } from "config/factors"; +import { getMarketIndexName } from "domain/synthetics/markets/utils"; import { formatAmountHuman } from "lib/numbers"; import { usePoolsIsMobilePage } from "pages/Pools/usePoolsIsMobilePage"; import { TOKEN_COLOR_MAP } from "sdk/configs/tokens"; @@ -10,7 +11,6 @@ import { TOKEN_COLOR_MAP } from "sdk/configs/tokens"; import { TableTd, TableTh, TableTheadTr, TableTr } from "components/Table/Table"; import TokenIcon from "components/TokenIcon/TokenIcon"; -import { getMarketIndexName } from "../../../../domain/synthetics/markets/utils"; import { CompositionItem, CompositionType, getCompositionPercentage } from "../hooks/useCompositionData"; interface Props { diff --git a/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts index 24183c528c..8e391ca514 100644 --- a/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts +++ b/src/components/Synthetics/MarketStats/hooks/useMarketGlvGmMarketsCompositions.ts @@ -12,8 +12,8 @@ import { useChainId } from "lib/chains"; import { bigintToNumber } from "lib/numbers"; export const useGlvGmMarketsWithComposition = (isDeposit: boolean, glvAddress?: string) => { - const { chainId } = useChainId(); - const { marketTokensData } = useMarketTokensData(chainId, { + const { chainId, srcChainId } = useChainId(); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit, }); diff --git a/src/components/Synthetics/OrderEditor/OrderEditor.tsx b/src/components/Synthetics/OrderEditor/OrderEditor.tsx index 929fcd90b0..21f684da45 100644 --- a/src/components/Synthetics/OrderEditor/OrderEditor.tsx +++ b/src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -13,11 +13,7 @@ import { useOrderEditorTriggerPriceInputValueState, useOrderEditorTriggerRatioInputValueState, } from "context/SyntheticsStateContext/hooks/orderEditorHooks"; -import { - selectExpressNoncesData, - selectMarketsInfoData, - selectTokensData, -} from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectMarketsInfoData, selectTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectOrderEditorAcceptablePrice, selectOrderEditorAcceptablePriceImpactBps, @@ -46,8 +42,7 @@ import { selectOrderEditorTriggerPrice, selectOrderEditorTriggerRatio, } from "context/SyntheticsStateContext/selectors/orderEditorSelectors"; -import { useCalcSelector } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; -import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useCalcSelector, useSelector } from "context/SyntheticsStateContext/utils"; import { getIsValidExpressParams } from "domain/synthetics/express/expressOrderUtils"; import { useExpressOrdersParams } from "domain/synthetics/express/useRelayerFeeHandler"; import useUiFeeFactorRequest from "domain/synthetics/fees/utils/useUiFeeFactor"; @@ -91,6 +86,7 @@ import { parseValue, } from "lib/numbers"; import { getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; import { sendEditOrderEvent } from "lib/userAnalytics"; import useWallet from "lib/wallets/useWallet"; import { bigMath } from "sdk/utils/bigmath"; @@ -117,8 +113,9 @@ type Props = { }; export function OrderEditor(p: Props) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const { signer } = useWallet(); + const { provider } = useJsonRpcProvider(chainId); const tokensData = useSelector(selectTokensData); const marketsInfoData = useSelector(selectMarketsInfoData); const { makeOrderTxnCallback } = useOrderTxnCallbacks(); @@ -143,7 +140,6 @@ export function OrderEditor(p: Props) { const indexToken = getTokenData(tokensData, market?.indexTokenAddress); const markPrice = p.order.isLong ? indexToken?.prices?.minPrice : indexToken?.prices?.maxPrice; const existingPosition = useSelector(selectOrderEditorExistingPosition); - const noncesData = useSelector(selectExpressNoncesData); const executionFee = useSelector(selectOrderEditorExecutionFee); @@ -347,6 +343,7 @@ export function OrderEditor(p: Props) { const { expressParams, expressParamsPromise } = useExpressOrdersParams({ orderParams: batchParams, label: "Order Editor", + isGmxAccount: srcChainId !== undefined, }); const networkFee = useMemo(() => { @@ -450,7 +447,7 @@ export function OrderEditor(p: Props) { } async function onSubmit() { - if (!batchParams || !signer || !tokensData || !marketsInfoData) { + if (!batchParams || !signer || !tokensData || !marketsInfoData || !provider) { return; } @@ -462,11 +459,12 @@ export function OrderEditor(p: Props) { chainId, signer, batchParams, - noncesData, expressParams: fulfilledExpressParams && getIsValidExpressParams(fulfilledExpressParams) ? fulfilledExpressParams : undefined, simulationParams: undefined, callback: makeOrderTxnCallback({}), + provider, + isGmxAccount: srcChainId !== undefined, }); if (expressParams?.subaccount) { @@ -670,7 +668,12 @@ export function OrderEditor(p: Props) {
{button} - + {(isLimitIncreaseOrderType(p.order.orderType) || isStopIncreaseOrderType(p.order.orderType)) && ( o.key) : [order.key]; setCancellingOrdersKeys((prev) => [...prev, ...orderKeys]); @@ -160,7 +170,9 @@ export function OrderList({ requireValidations: true, globalExpressParams, estimationMethod: "approximate", - provider: undefined, + provider, + isGmxAccount: srcChainId !== undefined, + subaccount, }); sendBatchOrderTxn({ @@ -168,9 +180,10 @@ export function OrderList({ signer, batchParams, expressParams, - noncesData: globalExpressParams?.noncesData, simulationParams: undefined, callback: makeOrderTxnCallback({}), + provider, + isGmxAccount: srcChainId !== undefined, }).finally(() => { setCancellingOrdersKeys((prev) => prev.filter((k) => !orderKeys.includes(k))); setSelectedOrderKeys?.(EMPTY_ARRAY); @@ -321,7 +334,7 @@ function useFilteredOrders({ marketsDirectionsFilter, orderTypesFilter, }: { - chainId: number; + chainId: ContractsChainId; account: string | undefined; marketsDirectionsFilter: MarketFilterLongShortItemData[]; orderTypesFilter: OrderTypeFilterValue[]; diff --git a/src/components/Synthetics/PositionEditor/PositionEditor.tsx b/src/components/Synthetics/PositionEditor/PositionEditor.tsx index f55317bb66..bb5acfb8fa 100644 --- a/src/components/Synthetics/PositionEditor/PositionEditor.tsx +++ b/src/components/Synthetics/PositionEditor/PositionEditor.tsx @@ -1,21 +1,29 @@ import { Trans, t } from "@lingui/macro"; +import pickBy from "lodash/pickBy"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; import { useKey } from "react-use"; import { Address } from "viem"; +import { isSettlementChain } from "config/multichain"; +import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { usePositionsConstants, useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { usePositionEditorCollateralInputValue, + usePositionEditorIsCollateralTokenFromGmxAccount, usePositionEditorPosition, usePositionEditorPositionState, usePositionEditorSelectedCollateralAddress, } from "context/SyntheticsStateContext/hooks/positionEditorHooks"; -import { selectPositionEditorCollateralInputAmountAndUsd } from "context/SyntheticsStateContext/selectors/positionEditorSelectors"; +import { + selectPositionEditorCollateralInputAmountAndUsd, + selectPositionEditorSelectedCollateralToken, +} from "context/SyntheticsStateContext/selectors/positionEditorSelectors"; import { makeSelectMarketPriceDecimals } from "context/SyntheticsStateContext/selectors/statsSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; +import { toastEnableExpress } from "domain/multichain/toastEnableExpress"; import { getMinResidualGasPaymentTokenAmount } from "domain/synthetics/express/expressOrderUtils"; import { formatLiquidationPrice, getIsPositionInfoLoaded } from "domain/synthetics/positions"; -import { adaptToV1InfoTokens, convertToTokenAmount } from "domain/synthetics/tokens"; +import { convertToTokenAmount } from "domain/synthetics/tokens"; import { getMinCollateralUsdForLeverage, getTradeFlagsForCollateralEdit } from "domain/synthetics/trade"; import { usePriceImpactWarningState } from "domain/synthetics/trade/usePriceImpactWarningState"; import { useMaxAvailableAmount } from "domain/tokens/useMaxAvailableAmount"; @@ -24,28 +32,35 @@ import { useLocalizedMap } from "lib/i18n"; import { absDiffBps, formatAmountFree, formatTokenAmount, formatTokenAmountWithUsd, formatUsd } from "lib/numbers"; import { getByKey } from "lib/objects"; import { usePrevious } from "lib/usePrevious"; -import { NATIVE_TOKEN_ADDRESS, getToken, getTokenVisualMultiplier } from "sdk/configs/tokens"; +import { + NATIVE_TOKEN_ADDRESS, + convertTokenAddress, + getTokenVisualMultiplier, + getWrappedToken, +} from "sdk/configs/tokens"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import Modal from "components/Modal/Modal"; import Tabs from "components/Tabs/Tabs"; -import TokenSelector from "components/TokenSelector/TokenSelector"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; import { ValueTransition } from "components/ValueTransition/ValueTransition"; +import { PositionEditorCollateralSelector } from "../CollateralSelector/PositionEditorCollateralSelector"; +import { HighPriceImpactOrFeesWarningCard } from "../HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard"; +import { SyntheticsInfoRow } from "../SyntheticsInfoRow"; +import { ExpressTradingWarningCard } from "../TradeBox/ExpressTradingWarningCard"; import { usePositionEditorData } from "./hooks/usePositionEditorData"; import { usePositionEditorFees } from "./hooks/usePositionEditorFees"; import { PositionEditorAdvancedRows } from "./PositionEditorAdvancedRows"; import { OPERATION_LABELS, Operation } from "./types"; import { usePositionEditorButtonState } from "./usePositionEditorButtonState"; -import { HighPriceImpactOrFeesWarningCard } from "../HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard"; -import { SyntheticsInfoRow } from "../SyntheticsInfoRow"; + import "./PositionEditor.scss"; -import { ExpressTradingWarningCard } from "../TradeBox/ExpressTradingWarningCard"; export function PositionEditor() { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); + const { expressOrdersEnabled, setExpressOrdersEnabled, setIsSettingsVisible } = useSettings(); const [, setEditingPositionKey] = usePositionEditorPositionState(); const tokensData = useTokensData(); const { minCollateralUsd } = usePositionsConstants(); @@ -59,25 +74,100 @@ export function PositionEditor() { const isVisible = Boolean(position); const prevIsVisible = usePrevious(isVisible); - const infoTokens = useMemo(() => { - if (!tokensData) { - return undefined; - } - return adaptToV1InfoTokens(tokensData); - }, [tokensData]); - const [operation, setOperation] = useState(Operation.Deposit); const isDeposit = operation === Operation.Deposit; const [selectedCollateralAddress, setSelectedCollateralAddress] = usePositionEditorSelectedCollateralAddress(); + const [isCollateralTokenFromGmxAccount, setIsCollateralTokenFromGmxAccount] = + usePositionEditorIsCollateralTokenFromGmxAccount(); + + const handleSetCollateralAddress = useCallback( + (tokenAddress: string, isGmxAccount?: boolean) => { + if (isGmxAccount && !expressOrdersEnabled) { + setExpressOrdersEnabled(true); + toastEnableExpress(() => setIsSettingsVisible(true)); + } + + setSelectedCollateralAddress(tokenAddress as Address); + if (isGmxAccount !== undefined) { + setIsCollateralTokenFromGmxAccount(isGmxAccount); + } + }, + [ + expressOrdersEnabled, + setSelectedCollateralAddress, + setExpressOrdersEnabled, + setIsSettingsVisible, + setIsCollateralTokenFromGmxAccount, + ] + ); + + const collateralToken = useSelector(selectPositionEditorSelectedCollateralToken); + + const filteredTokensData = useMemo(() => { + return pickBy( + tokensData, + (token) => + token.address === selectedCollateralAddress || + token.wrappedAddress === selectedCollateralAddress || + convertTokenAddress(chainId, token.address, "native") === selectedCollateralAddress + ); + }, [chainId, selectedCollateralAddress, tokensData]); + + const options = useMemo(() => { + return Object.values(filteredTokensData) + .flatMap((tokenData) => { + if (tokenData.isNative) { + return [ + { + ...tokenData, + isGmxAccount: false, + balance: tokenData.walletBalance, + }, + ]; + } + + return [ + { + ...tokenData, + isGmxAccount: true, + balance: tokenData.gmxAccountBalance, + }, + { + ...tokenData, + isGmxAccount: false, + balance: tokenData.balance, + }, + ]; + }) + .sort((a, b) => { + if (a.balance !== undefined && b.balance === undefined) { + return -1; + } + + if (a.balance === undefined && b.balance !== undefined) { + return 1; + } + + if (a.balance !== undefined && b.balance !== undefined) { + return b.balance - a.balance > 0n ? 1 : -1; + } + + return 0; + }); + }, [filteredTokensData]); - const collateralToken = getByKey(tokensData, selectedCollateralAddress); + const hasMultipleTokens = useMemo(() => { + if (srcChainId === undefined) { + if (selectedCollateralAddress === getWrappedToken(chainId)?.address) { + return true; + } + + return isSettlementChain(chainId); + } - const availableSwapTokens = useMemo(() => { - return position?.collateralToken.isWrapped - ? [getToken(chainId, position.collateralTokenAddress), getToken(chainId, NATIVE_TOKEN_ADDRESS)] - : undefined; - }, [chainId, position?.collateralToken.isWrapped, position?.collateralTokenAddress]); + return false; + }, [chainId, selectedCollateralAddress, srcChainId]); const onClose = useCallback(() => { setEditingPositionKey(undefined); @@ -118,8 +208,8 @@ export function PositionEditor() { }); const priceImpactWarningState = usePriceImpactWarningState({ - collateralImpact: fees?.positionCollateralPriceImpact, - positionImpact: fees?.positionPriceImpact, + collateralNetPriceImpact: fees?.collateralNetPriceImpact, + positionNetPriceImpact: fees?.positionNetPriceImpact, swapPriceImpact: fees?.swapPriceImpact, swapProfitFee: fees?.swapProfitFee, executionFeeUsd: executionFee?.feeUsd, @@ -152,14 +242,11 @@ export function PositionEditor() { return; } - if ( - !selectedCollateralAddress || - !availableSwapTokens?.find((token) => token.address === selectedCollateralAddress) - ) { - setSelectedCollateralAddress(position.collateralTokenAddress as Address); + if (!selectedCollateralAddress || !filteredTokensData[selectedCollateralAddress]) { + handleSetCollateralAddress(position.collateralTokenAddress as Address); } }, - [availableSwapTokens, position, selectedCollateralAddress, setSelectedCollateralAddress] + [filteredTokensData, handleSetCollateralAddress, position, selectedCollateralAddress, setSelectedCollateralAddress] ); useEffect( @@ -294,18 +381,14 @@ export function PositionEditor() { onClickMax={showMaxButton ? handleMaxButtonClick : undefined} qa="amount-input" > - {availableSwapTokens ? ( - setSelectedCollateralAddress(token.address as Address)} - tokens={availableSwapTokens} - infoTokens={infoTokens} - className="Edit-collateral-token-selector" - showSymbolImage={true} - showTokenImgInDropdown={true} - showBalances={false} + selectedTokenSymbol={collateralToken?.symbol} + isCollateralTokenFromGmxAccount={isCollateralTokenFromGmxAccount} + options={options} + onSelect={handleSetCollateralAddress} + variant={isDeposit ? "balance" : "destination"} /> ) : ( collateralToken?.symbol @@ -314,8 +397,7 @@ export function PositionEditor() {
{!isDeposit && ( diff --git a/src/components/Synthetics/PositionEditor/hooks/usePositionEditorData.tsx b/src/components/Synthetics/PositionEditor/hooks/usePositionEditorData.tsx index 3380ed8df3..e627da1c94 100644 --- a/src/components/Synthetics/PositionEditor/hooks/usePositionEditorData.tsx +++ b/src/components/Synthetics/PositionEditor/hooks/usePositionEditorData.tsx @@ -36,7 +36,7 @@ export function usePositionEditorData({ operation }: Options) { return useMemo(() => { if ( - !position || + !position?.marketInfo || collateralDeltaUsd === undefined || collateralDeltaUsd < 0 || minCollateralUsd === undefined || @@ -71,6 +71,7 @@ export function usePositionEditorData({ operation }: Options) { collateralAmount: nextCollateralAmount, collateralToken: position.collateralToken, marketInfo: position.marketInfo, + pendingImpactAmount: position.pendingImpactAmount, userReferralInfo, pendingFundingFeesUsd: 0n, pendingBorrowingFeesUsd: 0n, diff --git a/src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx b/src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx index 0ed141be06..9770128848 100644 --- a/src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx +++ b/src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx @@ -19,12 +19,12 @@ import { import { useSavedAllowedSlippage } from "context/SyntheticsStateContext/hooks/settingsHooks"; import { selectBlockTimestampData, - selectExpressNoncesData, selectGasPaymentTokenAllowance, selectMarketsInfoData, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectPositionEditorCollateralInputAmountAndUsd, + selectPositionEditorIsCollateralTokenFromGmxAccount, selectPositionEditorSelectedCollateralAddress, selectPositionEditorSelectedCollateralToken, selectPositionEditorSetCollateralInputValue, @@ -56,6 +56,7 @@ import { sendTxnValidationErrorMetric, } from "lib/metrics/utils"; import { expandDecimals, formatAmountFree } from "lib/numbers"; +import { useJsonRpcProvider } from "lib/rpc"; import { useHasOutdatedUi } from "lib/useHasOutdatedUi"; import useWallet from "lib/wallets/useWallet"; import { getToken } from "sdk/configs/tokens"; @@ -84,10 +85,11 @@ export function usePositionEditorButtonState(operation: Operation): { } { const [, setEditingPositionKey] = usePositionEditorPositionState(); const allowedSlippage = useSavedAllowedSlippage(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const { shouldDisableValidationForTesting } = useSettings(); const tokensData = useTokensData(); const { account, signer } = useWallet(); + const { provider } = useJsonRpcProvider(chainId); const { openConnectModal } = useConnectModal(); const routerAddress = getContract(chainId, "SyntheticsRouter"); const { minCollateralUsd } = usePositionsConstants(); @@ -97,12 +99,12 @@ export function usePositionEditorButtonState(operation: Operation): { const localizedOperationLabels = useLocalizedMap(OPERATION_LABELS); const blockTimestampData = useSelector(selectBlockTimestampData); const selectedCollateralAddress = useSelector(selectPositionEditorSelectedCollateralAddress); + const isCollateralTokenFromGmxAccount = useSelector(selectPositionEditorIsCollateralTokenFromGmxAccount); const selectedCollateralToken = useSelector(selectPositionEditorSelectedCollateralToken); const setCollateralInputValue = useSelector(selectPositionEditorSetCollateralInputValue); const { collateralDeltaAmount, collateralDeltaUsd } = useSelector(selectPositionEditorCollateralInputAmountAndUsd); const { makeOrderTxnCallback } = useOrderTxnCallbacks(); const marketsInfoData = useSelector(selectMarketsInfoData); - const noncesData = useSelector(selectExpressNoncesData); const collateralTokenAllowance = useTokensAllowanceData(chainId, { spenderAddress: routerAddress, @@ -240,10 +242,16 @@ export function usePositionEditorButtonState(operation: Operation): { asyncExpressParams, expressParamsPromise, } = useExpressOrdersParams({ + label: "Position Editor", orderParams: batchParams, + isGmxAccount: isCollateralTokenFromGmxAccount, }); const { tokensToApprove, isAllowanceLoaded } = useMemo(() => { + if (isCollateralTokenFromGmxAccount) { + return { tokensToApprove: [], isAllowanceLoaded: true }; + } + if (!selectedCollateralAddress || collateralDeltaAmount === undefined) { return { tokensToApprove: [], isAllowanceLoaded: false }; } @@ -271,6 +279,7 @@ export function usePositionEditorButtonState(operation: Operation): { return approvalRequirements; }, [ + isCollateralTokenFromGmxAccount, selectedCollateralAddress, collateralDeltaAmount, chainId, @@ -448,11 +457,13 @@ export function usePositionEditorButtonState(operation: Operation): { expressParams, asyncExpressParams, fastExpressParams, + chainId: srcChainId ?? chainId, + isCollateralFromMultichain: isCollateralTokenFromGmxAccount, }); sendOrderSubmittedMetric(metricData.metricId); - if (!batchParams || !tokensData || !signer) { + if (!batchParams || !tokensData || !signer || !provider) { helperToast.error(t`Error submitting order`); sendTxnValidationErrorMetric(metricData.metricId); return; @@ -463,10 +474,11 @@ export function usePositionEditorButtonState(operation: Operation): { const txnPromise = sendBatchOrderTxn({ chainId, signer, + provider, batchParams, expressParams: fulfilledExpressParams && getIsValidExpressParams(fulfilledExpressParams) ? fulfilledExpressParams : undefined, - noncesData, + isGmxAccount: isCollateralTokenFromGmxAccount, simulationParams: shouldDisableValidationForTesting ? undefined : { diff --git a/src/components/Synthetics/PositionItem/PositionItem.tsx b/src/components/Synthetics/PositionItem/PositionItem.tsx index f86999d1ba..5a3e19237c 100644 --- a/src/components/Synthetics/PositionItem/PositionItem.tsx +++ b/src/components/Synthetics/PositionItem/PositionItem.tsx @@ -85,9 +85,9 @@ export function PositionItem(p: Props) { position={p.isLarge ? "bottom-start" : "bottom-end"} renderContent={() => (
- {p.position.uiFeeUsd > 0 - ? t`Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee` - : t`Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee`} + + Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close. +

+ + + {p.position.priceImpactDiffUsd !== 0n && ( + + )} + { + if (srcChainId) { + return { tokensToApprove: [], isAllowanceLoaded: true }; + } + if (!batchParams) { return { tokensToApprove: [], isAllowanceLoaded: false }; } @@ -391,6 +399,7 @@ export function PositionSeller() { expressParams, gasPaymentTokenAllowance?.isLoaded, gasPaymentTokenAllowance?.tokensAllowanceData, + srcChainId, tokenPermits, ]); @@ -509,6 +518,8 @@ export function PositionSeller() { fastExpressParams, asyncExpressParams, expressParams, + chainId: srcChainId ?? chainId, + isCollateralFromMultichain: srcChainId !== undefined, }); sendOrderSubmittedMetric(metricData.metricId); @@ -522,7 +533,8 @@ export function PositionSeller() { !receiveToken?.address || receiveUsd === undefined || decreaseAmounts?.acceptablePrice === undefined || - !signer + !signer || + !provider ) { helperToast.error(t`Error submitting order`); sendTxnValidationErrorMetric(metricData.metricId); @@ -536,8 +548,9 @@ export function PositionSeller() { const txnPromise = sendBatchOrderTxn({ chainId, signer, + provider, batchParams, - noncesData, + isGmxAccount: srcChainId !== undefined, expressParams: fulfilledExpressParams && getIsValidExpressParams(fulfilledExpressParams) ? fulfilledExpressParams : undefined, simulationParams: shouldDisableValidationForTesting @@ -974,7 +987,7 @@ export function PositionSeller() { {!isTwap && ( @@ -1016,6 +1030,8 @@ export function PositionSeller() { )} + + ); @@ -95,48 +92,12 @@ export function PositionSellerAdvancedRows({ triggerPriceInputValue, slippageInp } } - const toToken = position?.indexToken; - - const executionPrice = useSelector(selectPositionSellerExecutionPrice); - - const executionPriceFlags = useMemo( - () => ({ - isLimit: false, - isMarket: orderOption === OrderOption.Market, - isIncrease: false, - isLong: !!position?.isLong, - isShort: !position?.isLong, - isSwap: false, - isPosition: true, - isTrigger: orderOption === OrderOption.Trigger, - isTwap: false, - }), - [position?.isLong, orderOption] - ); - if (!position) { return null; } - const shouldApplySlippage = orderOption === OrderOption.Market; - const acceptablePrice = - shouldApplySlippage && decreaseAmounts?.acceptablePrice && position - ? applySlippageToPrice(allowedSlippage, decreaseAmounts.acceptablePrice, false, position.isLong) - : decreaseAmounts?.acceptablePrice; - return ( - {!isTwap && ( - - )} - diff --git a/src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx b/src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx new file mode 100644 index 0000000000..b60e566800 --- /dev/null +++ b/src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx @@ -0,0 +1,89 @@ +import { t, Trans } from "@lingui/macro"; +import cx from "classnames"; +import { useMemo } from "react"; + +import { selectPositionSellerFees } from "context/SyntheticsStateContext/selectors/positionSellerSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { formatPercentage } from "lib/numbers"; + +import ExternalLink from "components/ExternalLink/ExternalLink"; +import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; +import Tooltip from "components/Tooltip/Tooltip"; + +export function PositionSellerPriceImpactFeesRow() { + const { fees } = useSelector(selectPositionSellerFees); + + const totalPriceImpactPercentage = + (fees?.totalPendingImpact?.precisePercentage ?? 0n) + (fees?.priceImpactDiff?.precisePercentage ?? 0n); + + const formattedPriceImpactPercentage = + totalPriceImpactPercentage === undefined + ? "..." + : formatPercentage(totalPriceImpactPercentage, { + bps: false, + signed: true, + displayDecimals: 3, + }); + + const isPriceImpactPositive = totalPriceImpactPercentage > 0; + + const feesPercentage = fees?.positionFee?.precisePercentage ?? 0n; + + const { formattedTotalFeePercentage, isTotalFeePositive } = useMemo(() => { + if (feesPercentage === undefined) { + return { + formattedTotalFeePercentage: "...", + isTotalFeePositive: false, + }; + } + + let adjustedFeesPercentage = feesPercentage; + + return { + formattedTotalFeePercentage: formatPercentage(adjustedFeesPercentage, { + bps: false, + signed: true, + displayDecimals: 3, + }), + isTotalFeePositive: adjustedFeesPercentage > 0, + }; + }, [feesPercentage]); + + return ( + + Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is + only settled on position decrease.{" "} + + Read more + + + } + /> + } + value={ + <> + + {formattedPriceImpactPercentage} + {" "} + /{" "} + + {formattedTotalFeePercentage} + + + } + /> + ); +} diff --git a/src/components/Synthetics/SelectorBase/SelectorBase.scss b/src/components/Synthetics/SelectorBase/SelectorBase.scss index e71cfc80a4..ab3054a06c 100644 --- a/src/components/Synthetics/SelectorBase/SelectorBase.scss +++ b/src/components/Synthetics/SelectorBase/SelectorBase.scss @@ -13,7 +13,7 @@ &-panel { position: relative; - z-index: 1000; + z-index: calc(var(--modal-z-index) + 1); font-size: var(--font-size-body-medium); diff --git a/src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx b/src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx index 135c770756..314b3fc670 100644 --- a/src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx +++ b/src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx @@ -7,8 +7,6 @@ import { useTokensData, useUserReferralInfo, } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { selectExpressNoncesData } from "context/SyntheticsStateContext/selectors/globalSelectors"; -import { useSelector } from "context/SyntheticsStateContext/utils"; import { useExpressOrdersParams } from "domain/synthetics/express/useRelayerFeeHandler"; import { estimateExecuteDecreaseOrderGasLimit, @@ -22,6 +20,7 @@ import { sendBatchOrderTxn } from "domain/synthetics/orders/sendBatchOrderTxn"; import { useOrderTxnCallbacks } from "domain/synthetics/orders/useOrderTxnCallbacks"; import { useChainId } from "lib/chains"; import { formatDeltaUsd, formatUsd } from "lib/numbers"; +import { useJsonRpcProvider } from "lib/rpc"; import useWallet from "lib/wallets/useWallet"; import { getExecutionFee } from "sdk/utils/fees/executionFee"; import { buildDecreaseOrderPayload } from "sdk/utils/orderTransactions"; @@ -45,13 +44,13 @@ type Props = { export function SettleAccruedFundingFeeModal({ allowedSlippage, isVisible, onClose }: Props) { const tokensData = useTokensData(); const { account, signer } = useWallet(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); + const { provider } = useJsonRpcProvider(chainId); const userReferralInfo = useUserReferralInfo(); const [isSubmitting, setIsSubmitting] = useState(false); const gasLimits = useGasLimits(chainId); const gasPrice = useGasPrice(chainId); const [isUntouched, setIsUntouched] = useState(true); - const noncesData = useSelector(selectExpressNoncesData); const { executionFee, gasLimit, feeUsd } = useMemo(() => { if (!gasLimits || !tokensData || gasPrice === undefined) return {}; @@ -142,6 +141,7 @@ export function SettleAccruedFundingFeeModal({ allowedSlippage, isVisible, onClo const { expressParams } = useExpressOrdersParams({ orderParams: batchParams, label: "Settle Funding Fee", + isGmxAccount: srcChainId !== undefined, }); const handleOnClose = useCallback(() => { @@ -173,7 +173,7 @@ export function SettleAccruedFundingFeeModal({ allowedSlippage, isVisible, onClo ); const onSubmit = useCallback(() => { - if (!account || !signer?.provider || !chainId || !batchParams) { + if (!account || !signer?.provider || !chainId || !batchParams || !provider) { return; } @@ -184,19 +184,20 @@ export function SettleAccruedFundingFeeModal({ allowedSlippage, isVisible, onClo signer, batchParams, expressParams, - noncesData, simulationParams: undefined, callback: makeOrderTxnCallback({ metricId: undefined, slippageInputId: undefined, isFundingFeeSettlement: true, }), + provider, + isGmxAccount: srcChainId !== undefined, }) .then(handleOnClose) .finally(() => { setIsSubmitting(false); }); - }, [account, batchParams, chainId, expressParams, handleOnClose, makeOrderTxnCallback, noncesData, signer]); + }, [account, batchParams, chainId, expressParams, handleOnClose, makeOrderTxnCallback, provider, signer, srcChainId]); const renderTooltipContent = useCallback( () => ( diff --git a/src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx b/src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx index e51ee4d9cc..82df71eaf5 100644 --- a/src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx +++ b/src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx @@ -2,7 +2,7 @@ import { t } from "@lingui/macro"; import { ReactNode, useCallback, useMemo } from "react"; import { useMarketsInfoData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectChainId, selectSrcChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useMarketTokensData } from "domain/synthetics/markets/useMarketTokensData"; import { getMarketIndexName, getGlvOrMarketAddress, getMarketPoolName } from "domain/synthetics/markets/utils"; @@ -39,7 +39,8 @@ export function MarketFilterBase({ }: MarketFilterBaseProps) { const marketsInfoData = useMarketsInfoData(); const chainId = useSelector(selectChainId); - const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, { + const srcChainId = useSelector(selectSrcChainId); + const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true, withGlv: false, }); diff --git a/src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx b/src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx index 8e3d2b016e..33fe8b908f 100644 --- a/src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx +++ b/src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx @@ -4,7 +4,11 @@ import { useCallback, useMemo } from "react"; import type { Address } from "viem"; import { useMarketsInfoData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { selectChainId, selectOrdersInfoData } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { + selectChainId, + selectOrdersInfoData, + selectSrcChainId, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectPositionsInfoDataSortedByMarket } from "context/SyntheticsStateContext/selectors/positionsSelectors"; import { createSelector, useSelector } from "context/SyntheticsStateContext/utils"; import { useMarketTokensData } from "domain/synthetics/markets/useMarketTokensData"; @@ -46,10 +50,11 @@ const selectPositionsWithOrders = createSelector((q) => { export function MarketFilterLongShort({ value, onChange, withPositions, asButton }: MarketFilterLongShortProps) { const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const marketsInfoData = useMarketsInfoData(); const allPositions = useSelector(selectPositionsInfoDataSortedByMarket); const filteredPositions = useSelector(selectPositionsWithOrders); - const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, { + const { marketTokensData: depositMarketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true, withGlv: false, }); diff --git a/src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx b/src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx index 8683933353..9b64629cde 100644 --- a/src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +++ b/src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx @@ -1,16 +1,18 @@ import { Trans } from "@lingui/macro"; -import { ReactNode, useCallback, useState } from "react"; +import { ReactNode, useCallback, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import { EXPRESS_TRADING_NATIVE_TOKEN_WARN_HIDDEN_KEY, EXPRESS_TRADING_WRAP_OR_UNWRAP_WARN_HIDDEN_KEY, } from "config/localStorage"; +import { useGmxAccountModalOpen } from "context/GmxAccountContext/hooks"; import { selectUpdateSubaccountSettings } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { ExpressTxnParams } from "domain/synthetics/express"; import { useChainId } from "lib/chains"; import { useLocalStorageSerializeKey } from "lib/localStorage"; +import { usePrevious } from "lib/usePrevious"; import { DEFAULT_SUBACCOUNT_EXPIRY_DURATION, DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT } from "sdk/configs/express"; import { getNativeToken, getWrappedToken } from "sdk/configs/tokens"; @@ -27,14 +29,19 @@ export function ExpressTradingWarningCard({ expressParams, payTokenAddress, isWrapOrUnwrap, + disabled, + isGmxAccount, }: { expressParams: ExpressTxnParams | undefined; payTokenAddress: string | undefined; isWrapOrUnwrap: boolean; + disabled?: boolean; + isGmxAccount: boolean; }) { const [isVisible, setIsVisible] = useState(true); const updateSubaccountSettings = useSelector(selectUpdateSubaccountSettings); const history = useHistory(); + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); const { chainId } = useChainId(); @@ -62,8 +69,10 @@ export function ExpressTradingWarningCard({ updateSubaccountSettings({ nextRemainigActions: BigInt(DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT), nextRemainingSeconds: BigInt(DEFAULT_SUBACCOUNT_EXPIRY_DURATION), - }).then(() => { - setIsVisible(false); + }).then((success) => { + if (success) { + setIsVisible(false); + } }); }, [updateSubaccountSettings]); @@ -74,7 +83,15 @@ export function ExpressTradingWarningCard({ shouldShowExpiredSubaccountWarning, shouldShowNonceExpiredWarning, shouldShowOutOfGasPaymentBalanceWarning, - } = useExpressTradingWarnings({ expressParams, payTokenAddress, isWrapOrUnwrap }); + shouldShowSubaccountApprovalInvalidWarning, + } = useExpressTradingWarnings({ expressParams, payTokenAddress, isWrapOrUnwrap, isGmxAccount }); + + const prevShouldShowSubaccountApprovalInvalidWarning = usePrevious(shouldShowSubaccountApprovalInvalidWarning); + useEffect(() => { + if (!prevShouldShowSubaccountApprovalInvalidWarning && shouldShowSubaccountApprovalInvalidWarning && !isVisible) { + setIsVisible(true); + } + }, [isVisible, prevShouldShowSubaccountApprovalInvalidWarning, shouldShowSubaccountApprovalInvalidWarning]); const { gasPaymentTokensText, gasPaymentTokenSymbols } = useGasPaymentTokensText(chainId); @@ -85,7 +102,7 @@ export function ExpressTradingWarningCard({ let onClick: undefined | (() => void) = undefined; - if (!isVisible) { + if (!isVisible || disabled) { return null; } else if (shouldShowWrapOrUnwrapWarning) { onCloseClick = handleCloseWrapOrUnwrapWarningClick; @@ -121,13 +138,38 @@ export function ExpressTradingWarningCard({ content = One-Click Trading is disabled. Time limit expired.; buttonText = Re-enable; } else if (shouldShowOutOfGasPaymentBalanceWarning) { - icon = ExpressIcon; - content = Express and One-Click Trading are unavailable due to insufficient gas balance.; - - buttonText = Buy {gasPaymentTokensText}; - onClick = () => { - history.push(`/trade/swap?to=${gasPaymentTokenSymbols[0]}`); - }; + if (isGmxAccount) { + icon = ExpressIcon; + + const hasEth = getNativeToken(chainId).symbol === "ETH"; + content = hasEth ? ( + Insufficient gas balance, please deposit more ETH or USDC. + ) : ( + Insufficient gas balance, please deposit more USDC. + ); + + buttonText = hasEth ? Deposit USDC or ETH : Deposit USDC; + onClick = () => { + setGmxAccountModalOpen("deposit"); + }; + } else { + icon = ExpressIcon; + content = Express and One-Click Trading are unavailable due to insufficient gas balance.; + buttonText = Buy {gasPaymentTokensText}; + onClick = () => { + history.push(`/trade/swap?to=${gasPaymentTokenSymbols[0]}`); + }; + } + } else if (shouldShowSubaccountApprovalInvalidWarning) { + icon = OneClickIcon; + content = ( + + One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please + sign a new approval to continue. + + ); + buttonText = Re-sign; + onClick = handleUpdateSubaccountSettings; } else { return null; } diff --git a/src/components/Synthetics/TradeBox/TradeBox.tsx b/src/components/Synthetics/TradeBox/TradeBox.tsx index a34ef29c12..227d4612f1 100644 --- a/src/components/Synthetics/TradeBox/TradeBox.tsx +++ b/src/components/Synthetics/TradeBox/TradeBox.tsx @@ -5,16 +5,20 @@ import { HiOutlineArrowDown } from "react-icons/hi"; import { useKey, useLatest, usePrevious } from "react-use"; import { BASIS_POINTS_DIVISOR, USD_DECIMALS } from "config/factors"; +import { isSettlementChain } from "config/multichain"; +import { useOpenMultichainDepositModal } from "context/GmxAccountContext/useOpenMultichainDepositModal"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { selectChartHeaderInfo } from "context/SyntheticsStateContext/selectors/chartSelectors"; import { selectChainId, selectMarketsInfoData, + selectSrcChainId, selectSubaccountState, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectExpressOrdersEnabled, + selectSetExpressOrdersEnabled, selectSettingsWarningDotVisible, selectShowDebugValues, } from "context/SyntheticsStateContext/selectors/settingsSelectors"; @@ -25,6 +29,7 @@ import { selectTradeboxDecreasePositionAmounts, selectTradeboxExecutionFee, selectTradeboxFees, + selectTradeboxFromToken, selectTradeboxIncreasePositionAmounts, selectTradeboxIsWrapOrUnwrap, selectTradeboxKeepLeverage, @@ -44,6 +49,8 @@ import { selectTradeboxTradeRatios, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; +import { toastEnableExpress } from "domain/multichain/toastEnableExpress"; +import { useGmxAccountShowDepositButton } from "domain/multichain/useGmxAccountShowDepositButton"; import { getMinResidualGasPaymentTokenAmount } from "domain/synthetics/express/expressOrderUtils"; import { MarketInfo, getMarketIndexName } from "domain/synthetics/markets"; import { formatLeverage, formatLiquidationPrice } from "domain/synthetics/positions"; @@ -85,6 +92,7 @@ import Tabs from "components/Tabs/Tabs"; import ToggleSwitch from "components/ToggleSwitch/ToggleSwitch"; import TokenIcon from "components/TokenIcon/TokenIcon"; import TokenWithIcon from "components/TokenIcon/TokenWithIcon"; +import { MultichainTokenSelector } from "components/TokenSelector/MultichainTokenSelector"; import TokenSelector from "components/TokenSelector/TokenSelector"; import Tooltip from "components/Tooltip/Tooltip"; import { ValueTransition } from "components/ValueTransition/ValueTransition"; @@ -93,6 +101,7 @@ import SettingsIcon from "img/ic_settings.svg?react"; import { useIsCurtainOpen } from "./Curtain"; import { ExpressTradingWarningCard } from "./ExpressTradingWarningCard"; +import { useMultichainTokensRequest } from "../GmxAccountModal/hooks"; import { HighPriceImpactOrFeesWarningCard } from "../HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard"; import TradeInfoIcon from "../TradeInfoIcon/TradeInfoIcon"; import TwapRows from "../TwapRows/TwapRows"; @@ -129,15 +138,20 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { const { swapTokens, infoTokens, sortedLongAndShortTokens, sortedAllMarkets } = availableTokenOptions; const tokensData = useTokensData(); + const { tokenChainDataArray: multichainTokens } = useMultichainTokensRequest(); const marketsInfoData = useSelector(selectMarketsInfoData); const tradeFlags = useSelector(selectTradeboxTradeFlags); const { isLong, isSwap, isIncrease, isPosition, isLimit, isTrigger, isMarket, isTwap } = tradeFlags; const isWrapOrUnwrap = useSelector(selectTradeboxIsWrapOrUnwrap); const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const { account } = useWallet(); + const { shouldDisableValidationForTesting: shouldDisableValidation } = useSettings(); + const onDepositTokenAddress = useOpenMultichainDepositModal(); + const nativeToken = getByKey(tokensData, NATIVE_TOKEN_ADDRESS); const [_, setExternalIsCurtainOpen] = useIsCurtainOpen(); @@ -149,6 +163,8 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { setToTokenInputValue: setToTokenInputValueRaw, setCollateralAddress: onSelectCollateralAddress, setFromTokenAddress: onSelectFromTokenAddress, + isFromTokenGmxAccount, + setIsFromTokenGmxAccount, setTradeMode: onSelectTradeMode, focusedInput, setFocusedInput, @@ -177,7 +193,7 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { setDuration, } = useSelector(selectTradeboxState); - const fromToken = getByKey(tokensData, fromTokenAddress); + const fromToken = useSelector(selectTradeboxFromToken); const toToken = getByKey(tokensData, toTokenAddress); const fromTokenAmount = fromToken ? parseValue(fromTokenInputValue || "0", fromToken.decimals)! : 0n; const fromTokenPrice = fromToken?.prices.minPrice; @@ -195,7 +211,10 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { const nextPositionValues = useSelector(selectTradeboxNextPositionValues); const fees = useSelector(selectTradeboxFees); const expressOrdersEnabled = useSelector(selectExpressOrdersEnabled); + const setExpressOrdersEnabled = useSelector(selectSetExpressOrdersEnabled); const { subaccount } = useSelector(selectSubaccountState); + const { shouldShowDepositButton } = useGmxAccountShowDepositButton(); + const { setIsSettingsVisible, isLeverageSliderEnabled } = useSettings(); const executionFee = useSelector(selectTradeboxExecutionFee); const { markRatio } = useSelector(selectTradeboxTradeRatios); @@ -208,8 +227,8 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { const decreaseOrdersThatWillBeExecuted = useDecreaseOrdersThatWillBeExecuted(); const priceImpactWarningState = usePriceImpactWarningState({ - collateralImpact: fees?.positionCollateralPriceImpact, - positionImpact: fees?.positionPriceImpact, + collateralNetPriceImpact: fees?.collateralNetPriceImpact, + positionNetPriceImpact: fees?.positionNetPriceImpact, swapPriceImpact: fees?.swapPriceImpact, swapProfitFee: fees?.swapProfitFee, executionFeeUsd: executionFee?.feeUsd, @@ -388,15 +407,15 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { if (isIncrease && increaseAmounts) { sizeDeltaUsd = increaseAmounts.sizeDeltaUsd; priceImpactDeltaUsd = increaseAmounts.positionPriceImpactDeltaUsd; - priceImpactPercentage = fees?.positionPriceImpact?.precisePercentage ?? 0n; + priceImpactPercentage = fees?.increasePositionPriceImpact?.precisePercentage ?? 0n; } else if (isSwap && swapAmounts) { amountUsd = swapAmounts.usdOut; priceImpactDeltaUsd = swapAmounts.swapStrategy.swapPathStats?.totalSwapPriceImpactDeltaUsd ?? 0n; priceImpactPercentage = fees?.swapPriceImpact?.precisePercentage ?? 0n; } else if (isTrigger && decreaseAmounts) { sizeDeltaUsd = decreaseAmounts.sizeDeltaUsd; - priceImpactDeltaUsd = decreaseAmounts.positionPriceImpactDeltaUsd; - priceImpactPercentage = fees?.positionPriceImpact?.precisePercentage ?? 0n; + priceImpactDeltaUsd = decreaseAmounts.totalPendingImpactDeltaUsd; + priceImpactPercentage = fees?.totalPendingImpact?.precisePercentage ?? 0n; } const openInterestPercent = isLong @@ -424,13 +443,17 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { } }, [ - chainId, - chartHeaderInfo, + chartHeaderInfo?.fundingRateLong, + chartHeaderInfo?.fundingRateShort, + chartHeaderInfo?.longOpenInterestPercentage, + chartHeaderInfo?.shortOpenInterestPercentage, decreaseAmounts, expressOrdersEnabled, - fees, + fees?.increasePositionPriceImpact?.precisePercentage, + fees?.totalPendingImpact?.precisePercentage, + fees?.swapPriceImpact?.precisePercentage, fromToken?.symbol, - fromTokenInputValue, + fromTokenInputValue.length, increaseAmounts, isIncrease, isLong, @@ -490,8 +513,23 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { [setFocusedInput, setToTokenInputValue] ); const handleSelectFromTokenAddress = useCallback( - (token: Token) => onSelectFromTokenAddress(token.address), - [onSelectFromTokenAddress] + (tokenAddress: string, isGmxAccount: boolean) => { + if (isGmxAccount && !expressOrdersEnabled) { + setExpressOrdersEnabled(true); + + toastEnableExpress(() => setIsSettingsVisible(true)); + } + + onSelectFromTokenAddress(tokenAddress); + setIsFromTokenGmxAccount(isGmxAccount); + }, + [ + expressOrdersEnabled, + onSelectFromTokenAddress, + setExpressOrdersEnabled, + setIsFromTokenGmxAccount, + setIsSettingsVisible, + ] ); const handleSelectToTokenAddress = useCallback( (token: Token) => onSelectToTokenAddress(token.address), @@ -610,21 +648,39 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { onClickMax={showClickMax ? onMaxClick : undefined} qa="pay" > - {fromTokenAddress && ( - - )} + {fromTokenAddress && + (!isSettlementChain(chainId) ? ( + { + handleSelectFromTokenAddress(token.address, false); + }} + tokens={swapTokens} + infoTokens={infoTokens} + showSymbolImage={true} + showTokenImgInDropdown={true} + missedCoinsPlace={MissedCoinsPlace.payToken} + extendedSortSequence={sortedLongAndShortTokens} + qa="collateral-selector" + /> + ) : ( + + ))} {isSwap && ( @@ -858,12 +914,11 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) { const setKeepLeverage = useSelector(selectTradeboxSetKeepLeverage); const settingsWarningDotVisible = useSelector(selectSettingsWarningDotVisible); - const { setIsSettingsVisible, isLeverageSliderEnabled } = useSettings(); - const { shouldShowWarning: shouldShowOneClickTradingWarning } = useExpressTradingWarnings({ expressParams: submitButtonState.expressParams, payTokenAddress: fromTokenAddress, isWrapOrUnwrap, + isGmxAccount: isFromTokenGmxAccount, }); const showSectionBetweenInputsAndButton = @@ -1012,7 +1067,7 @@ export function TradeBox({ isMobile }: { isMobile: boolean }) {
diff --git a/src/components/Synthetics/TradeBox/TradeBoxRows/AdvancedDisplayRows.tsx b/src/components/Synthetics/TradeBox/TradeBoxRows/AdvancedDisplayRows.tsx index f343bbf370..388967567d 100644 --- a/src/components/Synthetics/TradeBox/TradeBoxRows/AdvancedDisplayRows.tsx +++ b/src/components/Synthetics/TradeBox/TradeBoxRows/AdvancedDisplayRows.tsx @@ -3,11 +3,9 @@ import { ReactNode, useCallback, useMemo } from "react"; import { selectTradeboxAdvancedOptions, - selectTradeboxAllowedSlippage, selectTradeboxDecreasePositionAmounts, selectTradeboxDefaultAllowedSwapSlippageBps, selectTradeboxDefaultTriggerAcceptablePriceImpactBps, - selectTradeboxExecutionPrice, selectTradeboxFees, selectTradeboxIncreasePositionAmounts, selectTradeboxNextPositionValues, @@ -18,7 +16,6 @@ import { selectTradeboxSetSelectedAcceptablePriceImpactBps, selectTradeboxSetSelectedAllowedSwapSlippageBps, selectTradeboxTotalSwapImpactBps, - selectTradeboxToToken, selectTradeboxTradeFeesType, selectTradeboxTradeFlags, selectTradeboxTriggerPrice, @@ -33,11 +30,9 @@ import { formatLeverage } from "domain/synthetics/positions"; import { formatUsd } from "lib/numbers"; import { ExecutionFee } from "sdk/types/fees"; import { isStopIncreaseOrderType } from "sdk/utils/orders"; -import { applySlippageToPrice } from "sdk/utils/trade"; import { AcceptablePriceImpactInputRow } from "components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow"; import { AllowedSwapSlippageInputRow } from "components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl"; -import { ExecutionPriceRow } from "components/Synthetics/ExecutionPriceRow"; import { ExpandableRow } from "components/Synthetics/ExpandableRow"; import { NetworkFeeRow } from "components/Synthetics/NetworkFeeRow/NetworkFeeRow"; import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; @@ -135,58 +130,6 @@ function ExistingPositionInfoRows() { ); } -function IncreaseOrderRow() { - const tradeFlags = useSelector(selectTradeboxTradeFlags); - const { isMarket, isLong } = tradeFlags; - const increaseAmounts = useSelector(selectTradeboxIncreasePositionAmounts); - const allowedSlippage = useSelector(selectTradeboxAllowedSlippage); - const fees = useSelector(selectTradeboxFees); - const executionPrice = useSelector(selectTradeboxExecutionPrice); - const toToken = useSelector(selectTradeboxToToken); - - const acceptablePrice = - isMarket && increaseAmounts?.acceptablePrice - ? applySlippageToPrice(allowedSlippage, increaseAmounts.acceptablePrice, true, isLong) - : increaseAmounts?.acceptablePrice; - - return ( - - ); -} - -function DecreaseOrderRow() { - const tradeFlags = useSelector(selectTradeboxTradeFlags); - const { isMarket, isLong } = tradeFlags; - const decreaseAmounts = useSelector(selectTradeboxDecreasePositionAmounts); - const allowedSlippage = useSelector(selectTradeboxAllowedSlippage); - const fees = useSelector(selectTradeboxFees); - const executionPrice = useSelector(selectTradeboxExecutionPrice); - const toToken = useSelector(selectTradeboxToToken); - - const acceptablePrice = - isMarket && decreaseAmounts?.acceptablePrice - ? applySlippageToPrice(allowedSlippage, decreaseAmounts.acceptablePrice, true, isLong) - : decreaseAmounts?.acceptablePrice; - - return ( - - ); -} - export function TradeBoxAdvancedGroups({ slippageInputId, gasPaymentParams, @@ -199,7 +142,7 @@ export function TradeBoxAdvancedGroups({ const options = useSelector(selectTradeboxAdvancedOptions); const setOptions = useSelector(selectTradeboxSetAdvancedOptions); const tradeFlags = useSelector(selectTradeboxTradeFlags); - const { isSwap, isIncrease, isMarket, isLimit, isTrigger, isTwap } = tradeFlags; + const { isSwap, isMarket, isLimit, isTrigger, isTwap } = tradeFlags; const { isLiquidityRisk } = useSelector(selectTradeboxLiquidityInfo); @@ -279,14 +222,14 @@ export function TradeBoxAdvancedGroups({ } acceptablePriceImpactBps={selectedTriggerAcceptablePriceImpactBps} recommendedAcceptablePriceImpactBps={defaultTriggerAcceptablePriceImpactBps} - priceImpactFeeBps={fees?.positionPriceImpact?.bps} + priceImpactFeeBps={ + isTrigger ? fees?.decreasePositionPriceImpact?.bps : fees?.increasePositionPriceImpact?.bps + } setAcceptablePriceImpactBps={setSelectedTriggerAcceptablePriceImpactBps} /> )} - {isIncrease && !isTwap && } - {isTrigger && } diff --git a/src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx b/src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx index 2f47287594..eab1b149d9 100644 --- a/src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx +++ b/src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx @@ -7,11 +7,9 @@ import { selectTradeboxHasExistingLimitOrder, selectTradeboxHasExistingPosition, selectTradeboxMarketAddress, - selectTradeboxMarketInfo, selectTradeboxSelectedCollateralTokenSymbol, selectTradeboxSetCollateralAddress, selectTradeboxTradeFlags, - selectTradeboxTradeType, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { selectTradeboxAvailableAndDisabledTokensForCollateral } from "context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxAvailableAndDisabledTokensForCollateral"; import { useSelector } from "context/SyntheticsStateContext/utils"; @@ -38,8 +36,6 @@ export function CollateralSelectorRow(p: Props) { const warnings = useCollateralWarnings(); const collateralInTooltipContent = useCollateralInTooltipContent(); - const marketInfo = useSelector(selectTradeboxMarketInfo); - const tradeType = useSelector(selectTradeboxTradeType); return ( <> @@ -60,8 +56,6 @@ export function CollateralSelectorRow(p: Props) { options={availableTokens} disabledOptions={disabledTokens} selectedTokenSymbol={selectedTokenName} - marketInfo={marketInfo} - tradeType={tradeType} /> } /> diff --git a/src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx b/src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx index 3e5bd3dcc9..f113272325 100644 --- a/src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +++ b/src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx @@ -1,4 +1,4 @@ -import { t } from "@lingui/macro"; +import { t, Trans } from "@lingui/macro"; import cx from "classnames"; import { useMemo } from "react"; @@ -6,38 +6,44 @@ import { selectChainId, selectUserReferralInfo } from "context/SyntheticsStateCo import { selectTradeboxFees, selectTradeboxFeesPercentage, - selectTradeboxPriceImpactPercentage, selectTradeboxTradeFeesType, + selectTradeboxTradeFlags, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useTradingIncentives } from "domain/synthetics/common/useIncentiveStats"; -import { PRECISION, formatPercentage } from "lib/numbers"; +import { formatPercentage, PRECISION } from "lib/numbers"; import { BASIS_POINTS_DIVISOR_BIGINT } from "sdk/configs/factors"; import { bigMath } from "sdk/utils/bigmath"; +import ExternalLink from "components/ExternalLink/ExternalLink"; import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; +import Tooltip from "components/Tooltip/Tooltip"; export function PriceImpactFeesRow() { const chainId = useSelector(selectChainId); const fees = useSelector(selectTradeboxFees); - const priceImpactPercentage = useSelector(selectTradeboxPriceImpactPercentage); const feesPercentage = useSelector(selectTradeboxFeesPercentage); const userReferralInfo = useSelector(selectUserReferralInfo); const feesType = useSelector(selectTradeboxTradeFeesType); + const tradeFlags = useSelector(selectTradeboxTradeFlags); + const { isTrigger } = tradeFlags; const tradingIncentives = useTradingIncentives(chainId); const estimatedRebatesPercentage = tradingIncentives?.estimatedRebatePercent ?? 0n; - const isPriceImpactPositive = priceImpactPercentage !== undefined && priceImpactPercentage > 0; + const totalPriceImpactPercentage = + (fees?.totalPendingImpact?.precisePercentage ?? 0n) + (fees?.priceImpactDiff?.precisePercentage ?? 0n); const formattedPriceImpactPercentage = - priceImpactPercentage === undefined + totalPriceImpactPercentage === undefined ? "..." - : formatPercentage(priceImpactPercentage, { + : formatPercentage(totalPriceImpactPercentage, { bps: false, signed: true, displayDecimals: 3, }); + const isPriceImpactPositive = totalPriceImpactPercentage !== undefined && totalPriceImpactPercentage > 0; + const rebateIsApplicable = fees?.positionFee?.deltaUsd !== undefined && fees.positionFee.deltaUsd <= 0 && feesType !== "swap"; @@ -84,9 +90,49 @@ export function PriceImpactFeesRow() { }; }, [feesPercentage, feesType, userReferralInfo, rebateIsApplicable, estimatedRebatesPercentage]); + if (isTrigger) { + return ( + + Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is + only settled on position decrease.{" "} + + Read more + + + } + /> + } + value={ + <> + + {formattedPriceImpactPercentage} + {" "} + /{" "} + + {formattedTotalFeePercentage} + + + } + /> + ); + } + return ( = { +const IS_MAJOR_TOKEN_MAP: Record = { [ARBITRUM]: ["BTC", "ETH", "SOL"], [AVALANCHE]: ["AVAX", "ETH", "BTC"], [BOTANIX]: ["BTC"], + + [ARBITRUM_SEPOLIA]: ["ETH"], + [AVALANCHE_FUJI]: [], }; const WAIVE_DISMISSAL_PERIOD_MS = 24 * 60 * 60 * 1000; // 24 hours diff --git a/src/components/Synthetics/TradeBox/hooks/useShowOneClickTradingInfo.tsx b/src/components/Synthetics/TradeBox/hooks/useShowOneClickTradingInfo.tsx index 54bdc5e528..088fe4eb4f 100644 --- a/src/components/Synthetics/TradeBox/hooks/useShowOneClickTradingInfo.tsx +++ b/src/components/Synthetics/TradeBox/hooks/useShowOneClickTradingInfo.tsx @@ -3,12 +3,18 @@ import { EXPRESS_TRADING_WRAP_OR_UNWRAP_WARN_HIDDEN_KEY, } from "config/localStorage"; import { selectIsExpressTransactionAvailable } from "context/SyntheticsStateContext/selectors/expressSelectors"; -import { selectRawSubaccount } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { + selectChainId, + selectRawSubaccount, + selectSrcChainId, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectTradeboxTradeFlags } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { ExpressTxnParams } from "domain/synthetics/express"; +import { getOrderRelayRouterAddress } from "domain/synthetics/express/expressOrderUtils"; import { getIsSubaccountActionsExceeded, + getIsSubaccountApprovalInvalid, getIsSubaccountExpired, getIsSubaccountNonceExpired, } from "domain/synthetics/subaccount"; @@ -19,11 +25,15 @@ export function useExpressTradingWarnings({ isWrapOrUnwrap, expressParams, payTokenAddress, + isGmxAccount, }: { isWrapOrUnwrap: boolean; payTokenAddress: string | undefined; expressParams: ExpressTxnParams | undefined; + isGmxAccount: boolean; }) { + const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const tradeFlags = useSelector(selectTradeboxTradeFlags); const isExpressTransactionAvailable = useSelector(selectIsExpressTransactionAvailable); const rawSubaccount = useSelector(selectRawSubaccount); @@ -47,6 +57,16 @@ export function useExpressTradingWarnings({ shouldShowAllowedActionsWarning: isExpressTransactionAvailable && rawSubaccount && getIsSubaccountActionsExceeded(rawSubaccount, 1), shouldShowOutOfGasPaymentBalanceWarning: expressParams?.gasPaymentValidations.isOutGasTokenBalance, + shouldShowSubaccountApprovalInvalidWarning: + isExpressTransactionAvailable && + rawSubaccount && + getIsSubaccountApprovalInvalid({ + chainId, + signedApproval: rawSubaccount.signedApproval, + subaccountRouterAddress: getOrderRelayRouterAddress(chainId, true, isGmxAccount), + onchainData: rawSubaccount.onchainData, + signerChainId: srcChainId ?? chainId, + }), }; const shouldShowWarning = Object.values(conditions).some(Boolean); diff --git a/src/components/Synthetics/TradeBox/hooks/useSidecarOrderPayloads.ts b/src/components/Synthetics/TradeBox/hooks/useSidecarOrderPayloads.ts index 1259bbfc62..ea6399e758 100644 --- a/src/components/Synthetics/TradeBox/hooks/useSidecarOrderPayloads.ts +++ b/src/components/Synthetics/TradeBox/hooks/useSidecarOrderPayloads.ts @@ -8,7 +8,7 @@ import { selectTradeboxSelectedPosition, selectTradeboxTradeFlags, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; -import { useSyntheticsStateSelector as useSelector } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; +import { useSelector } from "context/SyntheticsStateContext/utils"; import { useMaxAutoCancelOrdersState } from "domain/synthetics/trade/useMaxAutoCancelOrdersState"; import { useChainId } from "lib/chains"; import { buildDecreaseOrderPayload, buildUpdateOrderPayload, CancelOrderTxnParams } from "sdk/utils/orderTransactions"; diff --git a/src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx b/src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx index d749cce6d0..8681d64079 100644 --- a/src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx +++ b/src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx @@ -4,9 +4,15 @@ import { ReactNode, useCallback, useEffect, useMemo, useState } from "react"; import { ImSpinner2 } from "react-icons/im"; import { getBridgingOptionsForToken } from "config/bridging"; -import { BOTANIX } from "config/chains"; +import { BOTANIX, SettlementChainId } from "config/chains"; import { BASIS_POINTS_DIVISOR } from "config/factors"; import { get1InchSwapUrlFromAddresses } from "config/links"; +import { MULTICHAIN_TRANSFER_SUPPORTED_TOKENS } from "config/multichain"; +import { + useGmxAccountDepositViewTokenAddress, + useGmxAccountDepositViewTokenInputValue, + useGmxAccountModalOpen, +} from "context/GmxAccountContext/hooks"; import { usePendingTxns } from "context/PendingTxnsContext/PendingTxnsContext"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { @@ -30,6 +36,7 @@ import { selectTradeboxFromToken, selectTradeboxFromTokenAmount, selectTradeboxIncreasePositionAmounts, + selectTradeboxIsFromTokenGmxAccount, selectTradeboxIsStakeOrUnstake, selectTradeboxIsWrapOrUnwrap, selectTradeboxMaxLeverage, @@ -45,15 +52,13 @@ import { import { selectTradeboxTradeTypeError } from "context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxTradeErrors"; import { selectExternalSwapQuoteParams } from "context/SyntheticsStateContext/selectors/tradeSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useGmxAccountShowDepositButton } from "domain/multichain/useGmxAccountShowDepositButton"; import { ExpressTxnParams } from "domain/synthetics/express"; import { getNameByOrderType, substractMaxLeverageSlippage } from "domain/synthetics/positions/utils"; import { useSidecarEntries } from "domain/synthetics/sidecarOrders/useSidecarEntries"; import { useSidecarOrders } from "domain/synthetics/sidecarOrders/useSidecarOrders"; import { getApprovalRequirements } from "domain/synthetics/tokens/utils"; -import { - getIncreasePositionAmounts, - getNextPositionValuesForIncreaseTrade, -} from "domain/synthetics/trade/utils/increase"; +import { getIncreasePositionAmounts } from "domain/synthetics/trade/utils/increase"; import { getCommonError, getExpressError, getIsMaxLeverageExceeded } from "domain/synthetics/trade/utils/validation"; import { useApproveToken } from "domain/tokens/useApproveTokens"; import { numericBinarySearch } from "lib/binarySearch"; @@ -64,12 +69,13 @@ import { sleep } from "lib/sleep"; import { mustNeverExist } from "lib/types"; import { useHasOutdatedUi } from "lib/useHasOutdatedUi"; import { sendUserAnalyticsConnectWalletClickEvent } from "lib/userAnalytics"; -import useWallet from "lib/wallets/useWallet"; -import { getToken, getTokenBySymbol, getTokenVisualMultiplier } from "sdk/configs/tokens"; +import { useEthersSigner } from "lib/wallets/useEthersSigner"; +import { convertTokenAddress, getToken, getTokenBySymbol, getTokenVisualMultiplier } from "sdk/configs/tokens"; import { ExecutionFee } from "sdk/types/fees"; import { TokenData } from "sdk/types/tokens"; import { TradeMode, TradeType } from "sdk/types/trade"; import { BatchOrderTxnParams } from "sdk/utils/orderTransactions"; +import { getNextPositionValuesForIncreaseTrade } from "sdk/utils/trade/increase"; import ExternalLink from "components/ExternalLink/ExternalLink"; import { BridgingInfo } from "components/Synthetics/BridgingInfo/BridgingInfo"; @@ -99,7 +105,7 @@ export function useTradeboxButtonState({ setToTokenInputValue, }: TradeboxButtonStateOptions): TradeboxButtonState { const chainId = useSelector(selectChainId); - const { signer } = useWallet(); + const signer = useEthersSigner(); const tradeFlags = useSelector(selectTradeboxTradeFlags); const { isSwap, isIncrease, isLimit, isMarket, isTwap } = tradeFlags; @@ -109,6 +115,10 @@ export function useTradeboxButtonState({ const localizedTradeTypeLabels = useLocalizedMap(tradeTypeLabels); const { stage, collateralToken, tradeType, setStage } = useSelector(selectTradeboxState); const { isLeverageSliderEnabled } = useSettings(); + const { shouldShowDepositButton } = useGmxAccountShowDepositButton(); + const [, setGmxAccountDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + const [, setGmxAccountDepositViewTokenInputValue] = useGmxAccountDepositViewTokenInputValue(); + const [, setGmxAccountModalOpen] = useGmxAccountModalOpen(); const fromToken = useSelector(selectTradeboxFromToken); const toToken = useSelector(selectTradeboxToToken); @@ -122,6 +132,7 @@ export function useTradeboxButtonState({ const payTokenAllowance = useSelector(selectTradeboxTokensAllowance); const gasPaymentTokenAllowance = useSelector(selectGasPaymentTokenAllowance); const tokenPermits = useSelector(selectTokenPermits); + const isFromTokenGmxAccount = useSelector(selectTradeboxIsFromTokenGmxAccount); const { setPendingTxns } = usePendingTxns(); const { openConnectModal } = useConnectModal(); @@ -144,6 +155,10 @@ export function useTradeboxButtonState({ }); const { tokensToApprove, isAllowanceLoaded } = useMemo(() => { + if (isFromTokenGmxAccount) { + return { tokensToApprove: [], isAllowanceLoaded: true }; + } + if ( !fromToken || payAmount === undefined || @@ -183,6 +198,7 @@ export function useTradeboxButtonState({ gasPaymentToken, gasPaymentTokenAllowance?.isLoaded, gasPaymentTokenAllowance?.tokensAllowanceData, + isFromTokenGmxAccount, payAmount, payTokenAllowance.isLoaded, payTokenAllowance.spenderAddress, @@ -279,7 +295,30 @@ export function useTradeboxButtonState({ return; } - if (isAllowanceLoaded && tokensToApprove.length) { + if (!signer) { + return; + } + + if (shouldShowDepositButton) { + if (fromToken) { + const wrappedAddress = convertTokenAddress(chainId, fromToken.address, "wrapped"); + const isSupportedToDeposit = + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[chainId as SettlementChainId].includes(wrappedAddress); + + if (isSupportedToDeposit) { + setGmxAccountDepositViewTokenAddress(fromToken.address); + if (payAmount !== undefined) { + setGmxAccountDepositViewTokenInputValue(formatAmountFree(payAmount, fromToken.decimals)); + } + } + } + + setGmxAccountModalOpen("deposit"); + + return; + } + + if (!isFromTokenGmxAccount && isAllowanceLoaded && tokensToApprove.length) { const tokenToApprove = tokensToApprove[0]; if (!chainId || isApproving || !tokenToApprove) return; @@ -327,24 +366,31 @@ export function useTradeboxButtonState({ }); }, [ account, - isAllowanceLoaded, - tokensToApprove, - setStage, - isStakeOrUnstake, - isWrapOrUnwrap, - isSwap, - isIncrease, - expressParams, - openConnectModal, approveToken, chainId, + expressParams, + fromToken, + isAllowanceLoaded, isApproving, - signer, + isFromTokenGmxAccount, + isIncrease, + isStakeOrUnstake, + isSwap, + isWrapOrUnwrap, + onSubmitDecreaseOrder, + onSubmitIncreaseOrder, onSubmitStakeOrUnstake, - onSubmitWrapOrUnwrap, onSubmitSwap, - onSubmitIncreaseOrder, - onSubmitDecreaseOrder, + onSubmitWrapOrUnwrap, + openConnectModal, + payAmount, + setGmxAccountDepositViewTokenAddress, + setGmxAccountDepositViewTokenInputValue, + setGmxAccountModalOpen, + setStage, + shouldShowDepositButton, + signer, + tokensToApprove, ]); useEffect(() => { @@ -372,6 +418,14 @@ export function useTradeboxButtonState({ }; } + if (shouldShowDepositButton) { + return { + ...commonState, + text: t`Deposit`, + disabled: false, + }; + } + if (buttonErrorText) { return { ...commonState, @@ -485,6 +539,7 @@ export function useTradeboxButtonState({ isExpressLoading, account, buttonErrorText, + shouldShowDepositButton, stopLoss.error?.percentage, takeProfit.error?.percentage, isApproving, diff --git a/src/components/Synthetics/TradeBox/hooks/useTradeboxTransactions.tsx b/src/components/Synthetics/TradeBox/hooks/useTradeboxTransactions.tsx index e71307064a..0aca5970ff 100644 --- a/src/components/Synthetics/TradeBox/hooks/useTradeboxTransactions.tsx +++ b/src/components/Synthetics/TradeBox/hooks/useTradeboxTransactions.tsx @@ -1,14 +1,11 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ import { t } from "@lingui/macro"; import { useCallback, useId, useMemo } from "react"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; -import { useShowDebugValues } from "context/SyntheticsStateContext/hooks/settingsHooks"; import { selectChartHeaderInfo } from "context/SyntheticsStateContext/selectors/chartSelectors"; import { selectBlockTimestampData, - selectExpressNoncesData, selectIsFirstOrder, selectMarketsInfoData, } from "context/SyntheticsStateContext/selectors/globalSelectors"; @@ -23,8 +20,9 @@ import { selectTradeboxDecreasePositionAmounts, selectTradeboxExecutionFee, selectTradeboxFees, - selectTradeboxFromTokenAddress, + selectTradeboxFromToken, selectTradeboxIncreasePositionAmounts, + selectTradeboxIsFromTokenGmxAccount, selectTradeboxMarketInfo, selectTradeboxPayTokenAllowance, selectTradeboxSelectedPosition, @@ -58,9 +56,9 @@ import { sendTxnValidationErrorMetric, } from "lib/metrics/utils"; import { getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; import { getTradeInteractionKey, sendUserAnalyticsOrderConfirmClickEvent, userAnalytics } from "lib/userAnalytics"; import useWallet from "lib/wallets/useWallet"; -import { BOTANIX } from "sdk/configs/chains"; import { BatchOrderTxnParams, getBatchTotalExecutionFee } from "sdk/utils/orderTransactions"; import { useSidecarOrderPayloads } from "./useSidecarOrderPayloads"; @@ -70,8 +68,9 @@ interface TradeboxTransactionsProps { } export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactionsProps) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const { signer, account } = useWallet(); + const { provider } = useJsonRpcProvider(chainId); const tokensData = useTokensData(); const { shouldDisableValidationForTesting } = useSettings(); @@ -83,7 +82,8 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions const increaseAmounts = useSelector(selectTradeboxIncreasePositionAmounts); const swapAmounts = useSelector(selectTradeboxSwapAmounts); const decreaseAmounts = useSelector(selectTradeboxDecreasePositionAmounts); - const fromTokenAddress = useSelector(selectTradeboxFromTokenAddress); + const fromToken = useSelector(selectTradeboxFromToken); + const isFromTokenGmxAccount = useSelector(selectTradeboxIsFromTokenGmxAccount); const toTokenAddress = useSelector(selectTradeboxToTokenAddress); const marketInfo = useSelector(selectTradeboxMarketInfo); const collateralToken = useSelector(selectTradeboxCollateralToken); @@ -97,7 +97,6 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions const executionFeeBufferBps = useSelector(selectExecutionFeeBufferBps); const duration = useSelector(selectTradeboxTwapDuration); const numberOfParts = useSelector(selectTradeboxTwapNumberOfParts); - const noncesData = useSelector(selectExpressNoncesData); const setShouldFallbackToInternalSwap = useSelector(selectSetShouldFallbackToInternalSwap); @@ -106,13 +105,13 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions const triggerPrice = useSelector(selectTradeboxTriggerPrice); const { referralCodeForTxn } = useUserReferralCode(signer, chainId, account); - const fromToken = getByKey(tokensData, fromTokenAddress); const toToken = getByKey(tokensData, toTokenAddress); const initialCollateralAllowance = useSelector(selectTradeboxPayTokenAllowance); const sidecarOrderPayloads = useSidecarOrderPayloads(); const primaryCreateOrderParams = useSelector(selectTradeBoxCreateOrderParams); + const slippageInputId = useId(); const batchParams: BatchOrderTxnParams = useMemo(() => { @@ -144,6 +143,7 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions } = useExpressOrdersParams({ orderParams: batchParams, label: "TradeBox", + isGmxAccount: isFromTokenGmxAccount, }); const initOrderMetricData = useCallback(() => { @@ -170,6 +170,8 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions expressParams, asyncExpressParams, fastExpressParams, + chainId: srcChainId ?? chainId, + isCollateralFromMultichain: isFromTokenGmxAccount, }); } @@ -202,7 +204,7 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions (entry) => entry.orderPayload.orderType === OrderType.LimitDecrease ).length, priceImpactDeltaUsd: increaseAmounts?.positionPriceImpactDeltaUsd, - priceImpactPercentage: fees?.positionPriceImpact?.precisePercentage, + priceImpactPercentage: fees?.increasePositionPriceImpact?.precisePercentage, netRate1h: isLong ? chartHeaderInfo?.fundingRateLong : chartHeaderInfo?.fundingRateShort, interactionId: marketInfo?.name ? userAnalytics.getInteractionId(getTradeInteractionKey(marketInfo.name)) @@ -213,6 +215,8 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions expressParams, asyncExpressParams, fastExpressParams, + chainId: srcChainId ?? chainId, + isCollateralFromMultichain: isFromTokenGmxAccount, }); } @@ -234,8 +238,8 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions isExpress: Boolean(expressParams), isTwap: tradeMode === TradeMode.Twap, interactionId: marketInfo?.name ? userAnalytics.getInteractionId(getTradeInteractionKey(marketInfo.name)) : "", - priceImpactDeltaUsd: decreaseAmounts?.positionPriceImpactDeltaUsd, - priceImpactPercentage: fees?.positionPriceImpact?.precisePercentage, + priceImpactDeltaUsd: decreaseAmounts?.totalPendingImpactDeltaUsd, + priceImpactPercentage: fees?.decreasePositionPriceImpact?.precisePercentage, netRate1h: isLong ? chartHeaderInfo?.fundingRateLong : chartHeaderInfo?.fundingRateShort, tradeMode, duration, @@ -243,10 +247,13 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions expressParams, asyncExpressParams, fastExpressParams, + chainId: srcChainId ?? chainId, + isCollateralFromMultichain: isFromTokenGmxAccount, }); }, [ allowedSlippage, asyncExpressParams, + chainId, chartHeaderInfo?.fundingRateLong, chartHeaderInfo?.fundingRateShort, collateralToken, @@ -256,11 +263,13 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions executionFeeBufferBps, expressParams, fastExpressParams, - fees?.positionPriceImpact?.precisePercentage, + fees?.decreasePositionPriceImpact?.precisePercentage, + fees?.increasePositionPriceImpact?.precisePercentage, fromToken, increaseAmounts, initialCollateralAllowance, isFirstOrder, + isFromTokenGmxAccount, isIncrease, isLeverageSliderEnabled, isLong, @@ -271,6 +280,7 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions referralCodeForTxn, selectedPosition, sidecarOrderPayloads?.createPayloads, + srcChainId, swapAmounts, toToken, tradeMode, @@ -284,7 +294,7 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions sendOrderSubmittedMetric(metricData.metricId); - if (!primaryCreateOrderParams || !signer || !tokensData || !account || !marketsInfoData) { + if (!primaryCreateOrderParams || !signer || !provider || !tokensData || !account || !marketsInfoData) { helperToast.error(t`Error submitting order`); sendTxnValidationErrorMetric(metricData.metricId); return Promise.reject(); @@ -295,8 +305,9 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions return sendBatchOrderTxn({ chainId, signer, + provider, batchParams, - noncesData, + isGmxAccount: isFromTokenGmxAccount, expressParams: fulfilledExpressParams && getIsValidExpressParams(fulfilledExpressParams) ? fulfilledExpressParams : undefined, simulationParams: shouldDisableValidationForTesting @@ -315,21 +326,22 @@ export function useTradeboxTransactions({ setPendingTxns }: TradeboxTransactions }), }); }, [ - expressParamsPromise, - initOrderMetricData, - primaryCreateOrderParams, - signer, - tokensData, account, - marketsInfoData, - chainId, batchParams, - noncesData, - shouldDisableValidationForTesting, blockTimestampData, + chainId, + expressParamsPromise, + initOrderMetricData, + isFromTokenGmxAccount, makeOrderTxnCallback, - slippageInputId, + marketsInfoData, + primaryCreateOrderParams, + provider, setShouldFallbackToInternalSwap, + shouldDisableValidationForTesting, + signer, + slippageInputId, + tokensData, ]); function onSubmitWrapOrUnwrap() { diff --git a/src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx b/src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx index 8391b15ff5..071b3962ce 100644 --- a/src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +++ b/src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx @@ -33,7 +33,9 @@ type Props = { swapProfitFee?: FeeItem; swapPriceImpact?: FeeItem; positionFee?: FeeItem; - positionPriceImpact?: FeeItem; + totalPendingImpact?: FeeItem; + proportionalPendingImpact?: FeeItem; + closePriceImpact?: FeeItem; priceImpactDiff?: FeeItem; borrowFee?: FeeItem; fundingFee?: FeeItem; @@ -291,6 +293,72 @@ export function TradeFeesRow(p: Props) { } : undefined; + const proportionalPendingImpactDeltaUsdRow = + showDebugValues && + (p.proportionalPendingImpact?.deltaUsd !== undefined && p.proportionalPendingImpact.deltaUsd !== 0n + ? { + id: "proportionalPendingImpactDeltaUsd", + label:
{`Proportional Pending Impact`}:
, + value: formatDeltaUsd(p.proportionalPendingImpact.deltaUsd), + className: getPositiveOrNegativeClass(p.proportionalPendingImpact.deltaUsd, "text-green-500"), + } + : undefined); + + const closePriceImpactDeltaUsdRow = + showDebugValues && + (p.closePriceImpact?.deltaUsd !== undefined && p.closePriceImpact.deltaUsd !== 0n + ? { + id: "closePriceImpactDeltaUsd", + label:
{`Close Price Impact`}:
, + value: formatDeltaUsd(p.closePriceImpact.deltaUsd), + className: getPositiveOrNegativeClass(p.closePriceImpact.deltaUsd, "text-green-500"), + } + : undefined); + + const netPriceImpactRow = + p.totalPendingImpact?.deltaUsd !== undefined && p.totalPendingImpact.deltaUsd !== 0n + ? { + id: "netPriceImpact", + label: ( + <> +
{t`Net Price Impact`}:
+
+ ( + {formatPercentage(bigMath.abs(p.totalPendingImpact.precisePercentage), { + displayDecimals: 3, + bps: false, + })}{" "} + of position size) +
+ + ), + value: formatDeltaUsd(p.totalPendingImpact.deltaUsd), + className: getPositiveOrNegativeClass(p.totalPendingImpact.deltaUsd, "text-green-500"), + } + : undefined; + + const priceImpactRebatesRow = + p.priceImpactDiff?.deltaUsd !== undefined && p.priceImpactDiff.deltaUsd !== 0n + ? { + id: "priceImpactDiff", + label: ( + <> +
{t`Price Impact Rebates`}:
+
+ ( + {formatPercentage(bigMath.abs(p.priceImpactDiff.precisePercentage), { + displayDecimals: 3, + bps: false, + })}{" "} + of position size) +
+ + ), + value: formatDeltaUsd(p.priceImpactDiff.deltaUsd), + className: getPositiveOrNegativeClass(p.priceImpactDiff.deltaUsd, "text-green-500"), + } + : undefined; + const rebateRow = tradingIncentives && rebateIsApplicable ? { @@ -341,6 +409,10 @@ export function TradeFeesRow(p: Props) { if (p.feesType === "decrease") { return [ + closePriceImpactDeltaUsdRow, + proportionalPendingImpactDeltaUsdRow, + netPriceImpactRow, + priceImpactRebatesRow, borrowFeeRow, fundingFeeRow, positionFeeRow, @@ -417,8 +489,26 @@ export function TradeFeesRow(p: Props) { ); }, [chainId, incentivesTokenTitle, rebateIsApplicable, tradingIncentives?.maxRebatePercent]); + const priceImpactRebatesInfo = useMemo(() => { + if (p.priceImpactDiff?.deltaUsd === undefined || p.priceImpactDiff.deltaUsd === 0n) { + return null; + } + + return ( + + Price impact rebates for closing trades are claimable under the claims tab.{" "} + + Read more + + + ); + }, [p.priceImpactDiff?.deltaUsd]); + const swapRouteMsg = useMemo(() => { - if (p.swapFees && p.swapFees.length <= 2) return; + if (p.swapFees && p.swapFees.length <= 2) { + return null; + } + return ( <>
@@ -462,15 +552,30 @@ export function TradeFeesRow(p: Props) { showDollar={false} /> ))} - {incentivesBottomText &&
} - {incentivesBottomText} - {swapRouteMsg} + {incentivesBottomText && ( +
+
+ {incentivesBottomText} +
+ )} + {priceImpactRebatesInfo && ( +
+
+ {priceImpactRebatesInfo} +
+ )} + {swapRouteMsg && ( +
+
+ {swapRouteMsg} +
+ )}
} /> ); } - }, [totalFeeUsd, feeRows, incentivesBottomText, shouldShowWarning, swapRouteMsg]); + }, [totalFeeUsd, feeRows, incentivesBottomText, shouldShowWarning, priceImpactRebatesInfo, swapRouteMsg]); return ; } diff --git a/src/components/Synthetics/TradeHistory/TradeHistory.tsx b/src/components/Synthetics/TradeHistory/TradeHistory.tsx index 8b1bd6947a..0434824663 100644 --- a/src/components/Synthetics/TradeHistory/TradeHistory.tsx +++ b/src/components/Synthetics/TradeHistory/TradeHistory.tsx @@ -59,9 +59,8 @@ export function TradeHistory(p: Props) { const [fromTxTimestamp, toTxTimestamp] = useNormalizeDateRange(startDate, endDate); - const { - positionsConstants: { minCollateralUsd }, - } = usePositionsConstantsRequest(chainId); + const { positionsConstants } = usePositionsConstantsRequest(chainId); + const { minCollateralUsd } = positionsConstants || {}; const { tradeActions, diff --git a/src/components/Synthetics/TradeHistory/TradeHistoryRow/mocks.ts b/src/components/Synthetics/TradeHistory/TradeHistoryRow/mocks.ts index 976632e9dd..cd2c691bcd 100644 --- a/src/components/Synthetics/TradeHistory/TradeHistoryRow/mocks.ts +++ b/src/components/Synthetics/TradeHistory/TradeHistoryRow/mocks.ts @@ -1,5 +1,16 @@ import { PositionTradeAction, SwapTradeAction } from "domain/synthetics/tradeHistory"; import { deserializeBigIntsInObject } from "lib/numbers"; +import { MarketInfo } from "sdk/types/markets"; + +type ToMock = { + [K in keyof T]: T[K] extends bigint | undefined + ? { type: "bigint"; hex: string } | { type: "bigint"; value: string } + : T[K] extends object + ? ToMock + : undefined extends T[K] + ? undefined | null | T[K] + : T[K]; +}; const prepare = (action: any): PositionTradeAction => { return deserializeBigIntsInObject(action) as PositionTradeAction; @@ -121,14 +132,6 @@ export const requestIncreasePosition = prepare({ type: "bigint", hex: "0x8dea649b", }, - maxLongPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, - maxShortPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, maxLongPoolAmount: { type: "bigint", hex: "0x033b2e3c9fd0803ce8000000", @@ -278,11 +281,11 @@ export const requestIncreasePosition = prepare({ type: "bigint", hex: "0x01d670", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -310,11 +313,11 @@ export const requestIncreasePosition = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -358,7 +361,39 @@ export const requestIncreasePosition = prepare({ virtualMarketId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualLongTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Avalanche", symbol: "AVAX", @@ -578,14 +613,6 @@ export const withdraw1Usd = prepare({ type: "bigint", hex: "0x8dea649b", }, - maxLongPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, - maxShortPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, maxLongPoolAmount: { type: "bigint", hex: "0x033b2e3c9fd0803ce8000000", @@ -734,11 +761,11 @@ export const withdraw1Usd = prepare({ type: "bigint", hex: "0x01d670", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -766,11 +793,11 @@ export const withdraw1Usd = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -814,7 +841,39 @@ export const withdraw1Usd = prepare({ virtualMarketId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualLongTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Avalanche", symbol: "AVAX", @@ -1030,14 +1089,6 @@ export const deposit1Usd = prepare({ type: "bigint", hex: "0x01dc2a3c6d", }, - maxLongPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, - maxShortPoolAmountForDeposit: { - type: "bigint", - hex: "0x033b2e3c9fd0803ce8000000", - }, maxLongPoolAmount: { type: "bigint", hex: "0x033b2e3c9fd0803ce8000000", @@ -1186,11 +1237,11 @@ export const deposit1Usd = prepare({ type: "bigint", hex: "0xa3aa", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -1218,11 +1269,11 @@ export const deposit1Usd = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -1266,7 +1317,39 @@ export const deposit1Usd = prepare({ virtualMarketId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualLongTokenId: "0x275d2a6e341e6a078d4eee59b08907d1e50825031c5481f9551284f4b7ee2fb9", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Dogecoin", symbol: "DOGE", @@ -1596,11 +1679,11 @@ export const createOrderDecreaseLong = prepare({ type: "bigint", hex: "0x0bbc20", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -1628,11 +1711,11 @@ export const createOrderDecreaseLong = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -1676,7 +1759,72 @@ export const createOrderDecreaseLong = prepare({ virtualMarketId: "0x11111137e2e8ae1c70c421e7a0dd36e023e0d6217198f889f9eb9c2a6727481f", virtualLongTokenId: "0x04533137e2e8ae1c11111111a0dd36e023e0d6217198f889f9eb9c2a6727481d", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Bitcoin", symbol: "BTC", @@ -1998,11 +2146,11 @@ export const cancelOrderIncreaseLong = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2030,11 +2178,11 @@ export const cancelOrderIncreaseLong = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2078,7 +2226,71 @@ export const cancelOrderIncreaseLong = prepare({ virtualMarketId: "0x04533437e2e8ae1c70c421e7a0dd36e023e0d6217198f889f9eb9c2a6727481d", virtualLongTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Ethereum", symbol: "ETH", @@ -2408,11 +2620,11 @@ export const createOrderIncreaseLong = prepare({ type: "bigint", hex: "0x0bbc20", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2440,11 +2652,11 @@ export const createOrderIncreaseLong = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2488,52 +2700,116 @@ export const createOrderIncreaseLong = prepare({ virtualMarketId: "0x11111137e2e8ae1c70c421e7a0dd36e023e0d6217198f889f9eb9c2a6727481f", virtualLongTokenId: "0x04533137e2e8ae1c11111111a0dd36e023e0d6217198f889f9eb9c2a6727481d", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, - indexToken: { - name: "Bitcoin", - symbol: "BTC", - decimals: 8, - address: "0xCcF73F4Dcbbb573296BFA656b754Fe94BB957d62", - isShortable: true, - imageUrl: "https://assets.coingecko.com/coins/images/7598/thumb/wrapped_bitcoin_wbtc.png?1548822744", - coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin", - explorerUrl: "https://goerli.arbiscan.io/address/0xCcF73F4Dcbbb573296BFA656b754Fe94BB957d62", - prices: { - minPrice: { - type: "bigint", - hex: "0x050eb9f19258bd72da095f10000000", - }, - maxPrice: { - type: "bigint", - hex: "0x050eb9f19258bd72da095f10000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", }, - balance: { + maxShortPoolUsdForDeposit: { type: "bigint", - hex: "0x04b571c0", + hex: "0x00", }, - }, - swapPath: ["0x1529876A9348D61C6c4a3EEe1fe6CbF1117Ca315"], - initialCollateralTokenAddress: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", - initialCollateralToken: { - name: "Wrapped Ethereum", - symbol: "WETH", - decimals: 18, - address: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", - isWrapped: true, - baseSymbol: "ETH", - imageUrl: "https://assets.coingecko.com/coins/images/2518/thumb/weth.png?1628852295", - coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", - explorerUrl: "https://goerli.arbiscan.io/address/0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", - prices: { - minPrice: { - type: "bigint", - hex: "0x4f995515b0834ce9b4c7e8000000", - }, - maxPrice: { - type: "bigint", - hex: "0x4f995515b0834ce9b4c7e8000000", - }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, + indexToken: { + name: "Bitcoin", + symbol: "BTC", + decimals: 8, + address: "0xCcF73F4Dcbbb573296BFA656b754Fe94BB957d62", + isShortable: true, + imageUrl: "https://assets.coingecko.com/coins/images/7598/thumb/wrapped_bitcoin_wbtc.png?1548822744", + coingeckoUrl: "https://www.coingecko.com/en/coins/bitcoin", + explorerUrl: "https://goerli.arbiscan.io/address/0xCcF73F4Dcbbb573296BFA656b754Fe94BB957d62", + prices: { + minPrice: { + type: "bigint", + hex: "0x050eb9f19258bd72da095f10000000", + }, + maxPrice: { + type: "bigint", + hex: "0x050eb9f19258bd72da095f10000000", + }, + }, + balance: { + type: "bigint", + hex: "0x04b571c0", + }, + }, + swapPath: ["0x1529876A9348D61C6c4a3EEe1fe6CbF1117Ca315"], + initialCollateralTokenAddress: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", + initialCollateralToken: { + name: "Wrapped Ethereum", + symbol: "WETH", + decimals: 18, + address: "0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", + isWrapped: true, + baseSymbol: "ETH", + imageUrl: "https://assets.coingecko.com/coins/images/2518/thumb/weth.png?1628852295", + coingeckoUrl: "https://www.coingecko.com/en/coins/ethereum", + explorerUrl: "https://goerli.arbiscan.io/address/0xe39Ab88f8A4777030A534146A9Ca3B52bd5D43A3", + prices: { + minPrice: { + type: "bigint", + hex: "0x4f995515b0834ce9b4c7e8000000", + }, + maxPrice: { + type: "bigint", + hex: "0x4f995515b0834ce9b4c7e8000000", + }, }, balance: { type: "bigint", @@ -2829,11 +3105,11 @@ export const executeOrderDecreaseShort = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2861,11 +3137,11 @@ export const executeOrderDecreaseShort = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -2909,7 +3185,71 @@ export const executeOrderDecreaseShort = prepare({ virtualMarketId: "0xac74a8ce840f9f11faaa15bd01a21a95ded2d6d1e2f3de883ef04c6f7e604ef4", virtualLongTokenId: "0xd6f594c665cfd695fe0f7241434c3e44f7d3b0e20145e97654d944d26203ddb8", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Uniswap", symbol: "UNI", @@ -3232,10 +3572,6 @@ export const executeOrderIncreaseLong = prepare({ type: "bigint", hex: "0x0c9f2c9cd04674edea40000000", }, - netPnlMin: { - type: "bigint", - hex: "0x05fc29ee41bb6ad1f713b0bb7da692", - }, maxPnlFactorForTradersLong: { type: "bigint", hex: "0x0a18f07d736b90be5500000000", @@ -3264,11 +3600,11 @@ export const executeOrderIncreaseLong = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -3296,11 +3632,11 @@ export const executeOrderIncreaseLong = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -3344,7 +3680,71 @@ export const executeOrderIncreaseLong = prepare({ virtualMarketId: "0x85248fe8b259d5a671c8ca8540127a7b9cb2534b1175b95d1df6391360841c7b", virtualLongTokenId: "0xab14694c1d031aa28aedaf394a1c4f0054ad43be42448259b8bc064efa1af97c", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Arbitrum", symbol: "ARB", @@ -3553,10 +3953,6 @@ export const frozenOrderIncreaseShort = prepare({ }, }, }, - priceImpactUsd: { - type: "bigint", - hex: "-0xd44fc1b1b9374c28a82ccd8f80", - }, longInterestUsd: { type: "bigint", hex: "0x0274ee6de80ffd23e60ec80022fd4000", @@ -3697,11 +4093,11 @@ export const frozenOrderIncreaseShort = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -3729,11 +4125,11 @@ export const frozenOrderIncreaseShort = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -3777,7 +4173,71 @@ export const frozenOrderIncreaseShort = prepare({ virtualMarketId: "0xba1ff14bf93fbb00b6f43d3ad403cc4c6496c1bb88489075c8b1bc709bde9ebb", virtualLongTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Bitcoin", symbol: "BTC", @@ -4102,11 +4562,11 @@ export const undefinedOrder = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -4134,11 +4594,11 @@ export const undefinedOrder = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -4182,7 +4642,79 @@ export const undefinedOrder = prepare({ virtualMarketId: "0x4cdf047af6bcf090983ce57032e6e50a0ce1adc3cc5c3a51621361a4591267e5", virtualLongTokenId: "0x3c48977e4fc47fa4616e13af7ceb68b0d545dce7b1fb9ec7b85bb6e00870a051", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxOpenInterestLong: { + type: "bigint", + hex: "0x00", + }, + maxOpenInterestShort: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "XRP", symbol: "XRP", @@ -4520,11 +5052,11 @@ export const liquidated = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -4552,11 +5084,11 @@ export const liquidated = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -4600,7 +5132,71 @@ export const liquidated = prepare({ virtualMarketId: "0xeed81816403077d40644cf5d67e0684a662b9e79f29112103f52bebee3ca78e2", virtualLongTokenId: "0xc31eff1feab296b571fe8131f0a4addc859c36445b90ea23edd116081d5eb0e8", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Chainlink", symbol: "LINK", @@ -5000,11 +5596,11 @@ export const increaseLongETH = prepare({ type: "bigint", hex: "0x00", }, - positionFeeFactorForPositiveImpact: { + positionFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - positionFeeFactorForNegativeImpact: { + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -5032,11 +5628,11 @@ export const increaseLongETH = prepare({ type: "bigint", hex: "0x193e5939a08ce9dbd480000000", }, - swapFeeFactorForPositiveImpact: { + swapFeeFactorForBalanceWasImproved: { type: "bigint", hex: "0x019d971e4fe8401e74000000", }, - swapFeeFactorForNegativeImpact: { + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", hex: "0x024306c4097859c43c000000", }, @@ -5080,7 +5676,71 @@ export const increaseLongETH = prepare({ virtualMarketId: "0x04533437e2e8ae1c70c421e7a0dd36e023e0d6217198f889f9eb9c2a6727481d", virtualLongTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", virtualShortTokenId: "0x0000000000000000000000000000000000000000000000000000000000000000", - }, + maxLongPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + maxShortPoolUsdForDeposit: { + type: "bigint", + hex: "0x00", + }, + fundingIncreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + fundingDecreaseFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + thresholdForStableFunding: { + type: "bigint", + hex: "0x00", + }, + thresholdForDecreaseFunding: { + type: "bigint", + hex: "0x00", + }, + minFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + maxFundingFactorPerSecond: { + type: "bigint", + hex: "0x00", + }, + minPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + positionImpactPoolDistributionRate: { + type: "bigint", + hex: "0x00", + }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Ethereum", symbol: "ETH", @@ -5555,16 +6215,16 @@ export const createOrderStopMarketLong = prepare({ minCollateralFactor: { type: "bigint", value: "5000000000000000000000000000" }, minCollateralFactorForOpenInterestLong: { type: "bigint", value: "60000000000000000000" }, minCollateralFactorForOpenInterestShort: { type: "bigint", value: "60000000000000000000" }, - positionFeeFactorForPositiveImpact: { type: "bigint", value: "400000000000000000000000000" }, - positionFeeFactorForNegativeImpact: { type: "bigint", value: "600000000000000000000000000" }, + positionFeeFactorForBalanceWasImproved: { type: "bigint", value: "400000000000000000000000000" }, + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", value: "600000000000000000000000000" }, positionImpactFactorPositive: { type: "bigint", value: "3360664378949365000000" }, positionImpactFactorNegative: { type: "bigint", value: "4032797254739238000000" }, maxPositionImpactFactorPositive: { type: "bigint", value: "5000000000000000000000000000" }, maxPositionImpactFactorNegative: { type: "bigint", value: "5000000000000000000000000000" }, maxPositionImpactFactorForLiquidations: { type: "bigint", value: "0" }, positionImpactExponentFactor: { type: "bigint", value: "1739944843614544000000000000000" }, - swapFeeFactorForPositiveImpact: { type: "bigint", value: "500000000000000000000000000" }, - swapFeeFactorForNegativeImpact: { type: "bigint", value: "700000000000000000000000000" }, + swapFeeFactorForBalanceWasImproved: { type: "bigint", value: "500000000000000000000000000" }, + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", value: "700000000000000000000000000" }, swapImpactFactorPositive: { type: "bigint", value: "200000000000000000000" }, swapImpactFactorNegative: { type: "bigint", value: "400000000000000000000" }, swapImpactExponentFactor: { type: "bigint", value: "2000000000000000000000000000000" }, @@ -5577,7 +6237,6 @@ export const createOrderStopMarketLong = prepare({ indexTokenAddress: "0x47904963fc8b2340414262125aF798B9655E58Cd", longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", - enabled: true, isSameCollaterals: false, isSpotOnly: false, name: "BTC/USD [BTC-USDC]", @@ -5631,7 +6290,31 @@ export const createOrderStopMarketLong = prepare({ maxPrice: { type: "bigint", value: "95699884797904795000000000000000000" }, }, }, - }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Bitcoin", symbol: "BTC", @@ -5697,7 +6380,6 @@ export const createOrderStopMarketLong = prepare({ timestamp: 1695040998, transaction: { hash: "0xdbbc158a679f0ead3ef31c84f348ebf86534d2de4deed255de0ee98f997d7bf3", - __typename: "Transaction", }, shouldUnwrapNativeToken: false, }); @@ -5759,16 +6441,16 @@ export const executeOrderStopMarketLong = prepare({ minCollateralFactor: { type: "bigint", value: "5000000000000000000000000000" }, minCollateralFactorForOpenInterestLong: { type: "bigint", value: "60000000000000000000" }, minCollateralFactorForOpenInterestShort: { type: "bigint", value: "60000000000000000000" }, - positionFeeFactorForPositiveImpact: { type: "bigint", value: "400000000000000000000000000" }, - positionFeeFactorForNegativeImpact: { type: "bigint", value: "600000000000000000000000000" }, + positionFeeFactorForBalanceWasImproved: { type: "bigint", value: "400000000000000000000000000" }, + positionFeeFactorForBalanceWasNotImproved: { type: "bigint", value: "600000000000000000000000000" }, positionImpactFactorPositive: { type: "bigint", value: "3360664378949365000000" }, positionImpactFactorNegative: { type: "bigint", value: "4032797254739238000000" }, maxPositionImpactFactorPositive: { type: "bigint", value: "5000000000000000000000000000" }, maxPositionImpactFactorNegative: { type: "bigint", value: "5000000000000000000000000000" }, maxPositionImpactFactorForLiquidations: { type: "bigint", value: "0" }, positionImpactExponentFactor: { type: "bigint", value: "1739944843614544000000000000000" }, - swapFeeFactorForPositiveImpact: { type: "bigint", value: "500000000000000000000000000" }, - swapFeeFactorForNegativeImpact: { type: "bigint", value: "700000000000000000000000000" }, + swapFeeFactorForBalanceWasImproved: { type: "bigint", value: "500000000000000000000000000" }, + swapFeeFactorForBalanceWasNotImproved: { type: "bigint", value: "700000000000000000000000000" }, swapImpactFactorPositive: { type: "bigint", value: "200000000000000000000" }, swapImpactFactorNegative: { type: "bigint", value: "400000000000000000000" }, swapImpactExponentFactor: { type: "bigint", value: "2000000000000000000000000000000" }, @@ -5781,7 +6463,6 @@ export const executeOrderStopMarketLong = prepare({ indexTokenAddress: "0x47904963fc8b2340414262125aF798B9655E58Cd", longTokenAddress: "0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f", shortTokenAddress: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", - enabled: true, isSameCollaterals: false, isSpotOnly: false, name: "BTC/USD [BTC-USDC]", @@ -5835,7 +6516,31 @@ export const executeOrderStopMarketLong = prepare({ maxPrice: { type: "bigint", value: "95424505866460967500000000000000000" }, }, }, - }, + minCollateralFactorForLiquidation: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactor: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactFactorForWithdrawals: { + type: "bigint", + hex: "0x00", + }, + maxLendableImpactUsd: { + type: "bigint", + hex: "0x00", + }, + lentPositionImpactPoolAmount: { + type: "bigint", + hex: "0x00", + }, + atomicSwapFeeFactor: { + type: "bigint", + hex: "0x00", + }, + } satisfies ToMock, indexToken: { name: "Bitcoin", symbol: "BTC", diff --git a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils.spec.ts b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils.spec.ts index e03e8782c3..00a530b2a7 100644 --- a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils.spec.ts +++ b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils.spec.ts @@ -190,44 +190,44 @@ describe("TradeHistoryRow helpers", () => { expect(formatPositionMessage(executeOrderIncreaseLong, minCollateralUsd)).toMatchInlineSnapshot(` { - "acceptablePrice": ">  $\u200a0.82764", + "acceptablePrice": ">  $ 0.82764", "action": "Execute Limit", - "executionPrice": "$\u200a0.83711", + "executionPrice": "$ 0.83711", "fullMarket": "ARB/USD [ARB-USDC]", "indexName": "ARB/USD", "indexTokenSymbol": "ARB", "isLong": false, "market": "Short ARB/USD", - "marketPrice": "< $\u200a0.00001", + "marketPrice": "< $ 0.00001", "poolName": "ARB-USDC", - "price": "< $\u200a0.00001", + "price": "< $ 0.00001", "priceComment": [ "Mark price for the order.", "", { "key": "Order Trigger Price", - "value": ">  $\u200a0.83600", + "value": ">  $ 0.83600", }, { "key": "Order Acceptable Price", - "value": ">  $\u200a0.82764", + "value": ">  $ 0.82764", }, { "key": "Order Execution Price", - "value": "$\u200a0.83711", + "value": "$ 0.83711", }, { "key": "Price Impact", "value": { "state": "error", - "text": "-$\u200a16.82", + "text": "-$ 16.82", }, }, "", "Order execution price takes into account price impact.", ], - "priceImpact": "-$\u200a16.82", - "size": "+$\u200a2,070.19", + "priceImpact": "-$ 16.82", + "size": "+$ 2,070.19", "timestamp": "18 Sep 2023, 16:43", "timestampISO": "2023-09-18T16:43:18+04:00", } @@ -235,7 +235,7 @@ describe("TradeHistoryRow helpers", () => { expect(formatPositionMessage(frozenOrderIncreaseShort, minCollateralUsd)).toMatchInlineSnapshot(` { - "acceptablePrice": ">  $\u200a26,937.90", + "acceptablePrice": ">  $ 26,937.90", "action": "Failed Limit", "actionComment": undefined, "executionPrice": undefined, @@ -253,16 +253,16 @@ describe("TradeHistoryRow helpers", () => { "", { "key": "Order Trigger Price", - "value": ">  $\u200a27,210.00", + "value": ">  $ 27,210.00", }, { "key": "Order Acceptable Price", - "value": ">  $\u200a26,937.90", + "value": ">  $ 26,937.90", }, undefined, ], - "priceImpact": "-$\u200a9,488.99", - "size": "+$\u200a1,348.83", + "priceImpact": "-$ 9,488.99", + "size": "+$ 1,348.83", "timestamp": "18 Sep 2023, 15:14", "timestampISO": "2023-09-18T15:14:09+04:00", } @@ -290,94 +290,94 @@ describe("TradeHistoryRow helpers", () => { expect(formatPositionMessage(liquidated, minCollateralUsd)).toMatchInlineSnapshot(` { "action": "Liquidated", - "executionPrice": "$\u200a6.1063", + "executionPrice": "$ 6.1063", "fullMarket": "LINK/USD [LINK-USDC]", "indexName": "LINK/USD", "indexTokenSymbol": "LINK", "isActionError": true, "isLong": false, "market": "Short LINK/USD", - "marketPrice": "$\u200a6.0907", - "pnl": "-$\u200a126.32", + "marketPrice": "$ 6.0907", + "pnl": "-$ 126.32", "pnlState": "error", "poolName": "LINK-USDC", - "price": "$\u200a6.0907", + "price": "$ 6.0907", "priceComment": [ "Mark price for the liquidation.", "", - "This position was liquidated as the max. leverage of 100.0x was exceeded when taking into account fees.", + "This position was liquidated as the max. leverage of 0.0x was exceeded when taking into account fees.", "", { "key": "Order Execution Price", - "value": "$\u200a6.1063", + "value": "$ 6.1063", }, "", "Order execution price takes into account price impact.", "", { "key": "Initial Collateral", - "value": "214.78 USDC ($\u200a214.78)", + "value": "214.78 USDC ($ 214.78)", }, { "key": "PnL", "value": { "state": "error", - "text": "-$\u200a126.32", + "text": "-$ 126.32", }, }, { "key": "Borrow Fee", "value": { "state": "error", - "text": "$\u200a0.00", + "text": "$ 0.00", }, }, { "key": "Funding Fee", "value": { "state": "error", - "text": "$\u200a0.00", + "text": "$ 0.00", }, }, { "key": "Close Fee", "value": { "state": "error", - "text": "-$\u200a4.51", + "text": "-$ 4.51", }, }, "", { "key": "Min. Required Collateral", - "value": "$\u200a64.42", + "value": "< $ 0.01", }, { "key": "Collateral at Liquidation", - "value": "$\u200a83.95", + "value": "$ 83.95", }, "", { "key": "Price Impact", "value": { "state": "error", - "text": "-$\u200a16.82", + "text": "-$ 16.82", }, }, { "key": "Liquidation Fee", "value": { "state": "error", - "text": "-$\u200a1.05", + "text": "-$ 1.05", }, }, "", { "key": "Returned Collateral", - "value": "$\u200a66.08", + "value": "$ 0.00", }, ], - "priceImpact": "-$\u200a16.82", - "size": "-$\u200a6,441.90", + "priceImpact": undefined, + "size": "-$ 6,441.90", "timestamp": "04 Sep 2023, 06:38", "timestampISO": "2023-09-04T06:38:49+04:00", } diff --git a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts index c1f6123780..43bdc7b94e 100644 --- a/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +++ b/src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3,7 +3,7 @@ import { t } from "@lingui/macro"; import { MaxInt256 } from "ethers"; import { getMarketFullName, getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; -import { OrderType, isIncreaseOrderType } from "domain/synthetics/orders"; +import { OrderType, isDecreaseOrderType, isIncreaseOrderType, isLiquidationOrderType } from "domain/synthetics/orders"; import { convertToUsd, parseContractPrice } from "domain/synthetics/tokens/utils"; import { getShouldUseMaxPrice } from "domain/synthetics/trade"; import { @@ -23,6 +23,7 @@ import { bigMath } from "sdk/utils/bigmath"; import { INEQUALITY_GT, INEQUALITY_LT, + Line, MakeOptional, RowDetails, formatTradeActionTimestamp, @@ -41,6 +42,8 @@ export const formatPositionMessage = ( relativeTimestamp = true ): RowDetails => { const collateralToken = tradeAction.initialCollateralToken; + const isV22Action = tradeAction.srcChainId !== undefined; + let sizeDeltaUsd = tradeAction.sizeDeltaUsd; if ( @@ -164,7 +167,15 @@ export const formatPositionMessage = ( displayDecimals: marketPriceDecimals, visualMultiplier: tradeAction.indexToken.visualMultiplier, }); - const formattedPriceImpact = formatDeltaUsd(tradeAction.priceImpactUsd); + + const priceImpactLines = getPriceImpactLines(tradeAction); + + let displayedPriceImpact: string | undefined = undefined; + if (isIncreaseOrderType(ot) && !isV22Action) { + displayedPriceImpact = formatDeltaUsd(tradeAction.priceImpactUsd); + } else if (isDecreaseOrderType(ot) && isV22Action && tradeAction.totalImpactUsd !== undefined) { + displayedPriceImpact = formatDeltaUsd(tradeAction.totalImpactUsd); + } let result: MakeOptional; @@ -185,6 +196,7 @@ export const formatPositionMessage = ( } else if (ot === OrderType.MarketIncrease && ev === TradeActionType.OrderExecuted) { const customAction = sizeDeltaUsd > 0 ? action : i18n._(actionTextMap["Deposit-OrderExecuted"]!); const customSize = sizeDeltaUsd > 0 ? sizeDeltaText : formattedCollateralDelta; + const priceComment = sizeDeltaUsd > 0 ? lines( @@ -192,12 +204,7 @@ export const formatPositionMessage = ( "", infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice), infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ) : lines(t`Mark price for the order.`); @@ -255,12 +262,7 @@ export const formatPositionMessage = ( ? infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice) : undefined, infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ), acceptablePrice: t`N/A`, pnl: formattedPnl, @@ -329,12 +331,7 @@ export const formatPositionMessage = ( ? infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice) : undefined, infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ), acceptablePrice: isAcceptablePriceUseful ? acceptablePriceInequality + formattedAcceptablePrice : undefined, }; @@ -432,12 +429,7 @@ export const formatPositionMessage = ( "", infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice), infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ), acceptablePrice: acceptablePriceInequality + formattedAcceptablePrice, pnl: formattedPnl, @@ -477,12 +469,7 @@ export const formatPositionMessage = ( infoRow(t`Order Trigger Price`, triggerPriceInequality + formattedTriggerPrice), infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice), infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ), acceptablePrice: acceptablePriceInequality + formattedAcceptablePrice, pnl: formattedPnl, @@ -558,12 +545,7 @@ export const formatPositionMessage = ( ? infoRow(t`Order Acceptable Price`, acceptablePriceInequality + formattedAcceptablePrice) : undefined, infoRow(t`Order Execution Price`, formattedExecutionPrice!), - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), - "", - t`Order execution price takes into account price impact.` + ...priceImpactLines ), pnl: formattedPnl, pnlState: numberToState(tradeAction.pnlUsd), @@ -601,7 +583,10 @@ export const formatPositionMessage = ( //#endregion StopLossDecrease //#region Liquidation } else if (ot === OrderType.Liquidation && ev === TradeActionType.OrderExecuted) { - const maxLeverage = PRECISION / tradeAction.marketInfo.minCollateralFactor; + const maxLeverage = + tradeAction.marketInfo.minCollateralFactorForLiquidation === 0n + ? 0n + : PRECISION / tradeAction.marketInfo.minCollateralFactorForLiquidation; const formattedMaxLeverage = Number(maxLeverage).toFixed(1) + "x"; const initialCollateralUsd = convertToUsd( @@ -649,16 +634,22 @@ export const formatPositionMessage = ( tradeAction.collateralTokenPriceMin ); const formattedPositionFee = formatUsd(positionFeeUsd === undefined ? undefined : -positionFeeUsd); + const totalImpactUsd = tradeAction.totalImpactUsd ?? 0n; - let liquidationCollateralUsd = applyFactor(sizeDeltaUsd, tradeAction.marketInfo.minCollateralFactor); + let liquidationCollateralUsd = applyFactor(sizeDeltaUsd, tradeAction.marketInfo.minCollateralFactorForLiquidation); if (liquidationCollateralUsd < minCollateralUsd) { liquidationCollateralUsd = minCollateralUsd; } - let leftoverCollateralUsd = + const leftoverCollateralUsd = initialCollateralUsd === undefined ? undefined - : initialCollateralUsd + tradeAction.basePnlUsd! - borrowingFeeUsd! - fundingFeeUsd! - positionFeeUsd!; + : initialCollateralUsd + + tradeAction.basePnlUsd! - + borrowingFeeUsd! - + fundingFeeUsd! - + positionFeeUsd! + + totalImpactUsd; const formattedLeftoverCollateral = formatUsd(leftoverCollateralUsd!); const formattedMinCollateral = formatUsd(liquidationCollateralUsd)!; @@ -681,7 +672,7 @@ export const formatPositionMessage = ( fundingFeeUsd !== undefined && positionFeeUsd !== undefined && liquidationFeeUsd !== undefined && - tradeAction.priceImpactUsd !== undefined + tradeAction.totalImpactUsd !== undefined ) { returnedCollateralUsd = bigMath.max( 0n, @@ -691,7 +682,7 @@ export const formatPositionMessage = ( fundingFeeUsd - positionFeeUsd - liquidationFeeUsd + - tradeAction.priceImpactUsd + tradeAction.totalImpactUsd ); } @@ -729,10 +720,7 @@ export const formatPositionMessage = ( infoRow(t`Min. Required Collateral`, formattedMinCollateral), infoRow(t`Collateral at Liquidation`, formattedLeftoverCollateral), "", - infoRow(t`Price Impact`, { - text: formattedPriceImpact!, - state: numberToState(tradeAction.priceImpactUsd!), - }), + ...priceImpactLines, infoRow(t`Liquidation Fee`, { text: formattedLiquidationFee, state: "error", @@ -759,13 +747,85 @@ export const formatPositionMessage = ( size: sizeDeltaText, marketPrice: formattedMarketPrice, executionPrice: formattedExecutionPrice, - priceImpact: formattedPriceImpact, + priceImpact: displayedPriceImpact, indexName, poolName, ...result!, }; }; +function getPriceImpactLines(tradeAction: PositionTradeAction) { + const isV22Action = tradeAction.srcChainId !== undefined; + const lines: Line[] = []; + + if (isLiquidationOrderType(tradeAction.orderType)) { + if (isV22Action && tradeAction.totalImpactUsd !== undefined) { + const formattedNetPriceImpact = formatDeltaUsd(tradeAction.totalImpactUsd); + + lines.push( + infoRow(t`Net Price Impact`, { + text: formattedNetPriceImpact!, + state: numberToState(tradeAction.totalImpactUsd!), + }) + ); + } else { + const formattedPriceImpact = formatDeltaUsd(tradeAction.priceImpactUsd); + + lines.push( + infoRow(t`Price Impact`, { + text: formattedPriceImpact!, + state: numberToState(tradeAction.priceImpactUsd!), + }) + ); + } + + return lines; + } + + if (isIncreaseOrderType(tradeAction.orderType)) { + if (isV22Action) { + return []; + } + + const formattedPriceImpact = formatDeltaUsd(tradeAction.priceImpactUsd); + + lines.push( + infoRow(t`Price Impact`, { + text: formattedPriceImpact!, + state: numberToState(tradeAction.priceImpactUsd!), + }) + ); + } + + if (isDecreaseOrderType(tradeAction.orderType)) { + if (isV22Action && tradeAction.totalImpactUsd !== undefined) { + const formattedNetPriceImpact = formatDeltaUsd(tradeAction.totalImpactUsd); + + lines.push( + infoRow(t`Net Price Impact`, { + text: formattedNetPriceImpact!, + state: numberToState(tradeAction.totalImpactUsd!), + }) + ); + } else { + const formattedPriceImpact = formatDeltaUsd(tradeAction.priceImpactUsd); + + lines.push( + infoRow(t`Price Impact`, { + text: formattedPriceImpact!, + state: numberToState(tradeAction.priceImpactUsd!), + }) + ); + } + } + + if (lines.length > 0) { + lines.push("", t`Order execution price takes into account price impact.`); + } + + return lines; +} + function getTokenPriceByTradeAction(tradeAction: PositionTradeAction) { return getShouldUseMaxPrice(isIncreaseOrderType(tradeAction.orderType), tradeAction.isLong) ? tradeAction.indexTokenPriceMax diff --git a/src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx b/src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx index d81cece2e5..bb47790bf6 100644 --- a/src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx +++ b/src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx @@ -96,7 +96,7 @@ export default function ClaimableAmounts() { claimableTokenTitles, callback: claimFundsTransactionCallback, }); - mutateClaimableAmounts(true); + mutateClaimableAmounts(); setClaimTermsAcceptedSignature(""); } finally { setIsClaiming(false); diff --git a/src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx b/src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx index 07ea96c4bb..059f7c5fbb 100644 --- a/src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx +++ b/src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx @@ -84,10 +84,10 @@ function getNormalizedIncentive( export default function UserIncentiveDistributionList() { const { account, active } = useWallet(); const { openConnectModal } = useConnectModal(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const tokens = getTokens(chainId); const gmMarkets = useSelector(selectGmMarkets); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: false }); const userIncentiveData = useUserIncentiveData(chainId, account); const normalizedIncentiveData: NormalizedIncentiveData[] = useMemo( diff --git a/src/components/TVChartContainer/DynamicLines.tsx b/src/components/TVChartContainer/DynamicLines.tsx index 55e1187616..899dba32f3 100644 --- a/src/components/TVChartContainer/DynamicLines.tsx +++ b/src/components/TVChartContainer/DynamicLines.tsx @@ -13,19 +13,21 @@ import { selectChainId, selectMarketsInfoData, selectOrdersInfoData, + selectSrcChainId, + selectSubaccountForChainAction, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { makeSelectOrderEditorPositionOrderError, selectOrderEditorSetTriggerPriceInputValue, } from "context/SyntheticsStateContext/selectors/orderEditorSelectors"; -import { useCalcSelector } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; -import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useCalcSelector, useSelector } from "context/SyntheticsStateContext/utils"; import { estimateBatchExpressParams } from "domain/synthetics/express/expressOrderUtils"; import { useMarkets } from "domain/synthetics/markets"; import { sendBatchOrderTxn } from "domain/synthetics/orders/sendBatchOrderTxn"; import { useOrderTxnCallbacks } from "domain/synthetics/orders/useOrderTxnCallbacks"; import { calculateDisplayDecimals, formatAmount, numberToBigint } from "lib/numbers"; import { getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; import useWallet from "lib/wallets/useWallet"; import { getToken } from "sdk/configs/tokens"; import { PositionOrderInfo } from "sdk/types/orders"; @@ -44,6 +46,8 @@ export function DynamicLines({ const dynamicChartLines = useSelector(selectChartDynamicLines); const { signer } = useWallet(); const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); + const { provider } = useJsonRpcProvider(chainId); const [, setCancellingOrdersKeys] = useCancellingOrdersKeysState(); const { makeOrderTxnCallback } = useOrderTxnCallbacks(); const [isSubmitting] = useOrderEditorIsSubmittingState(); @@ -53,10 +57,11 @@ export function DynamicLines({ const { marketsData } = useMarkets(chainId); const { pendingOrdersUpdates } = useSyntheticsEvents(); const globalExpressParams = useSelector(selectExpressGlobalParams); + const subaccount = useSelector(selectSubaccountForChainAction); const onCancelOrder = useCallback( async (key: string) => { - if (!signer) return; + if (!signer || !provider) return; const order = getByKey(ordersInfoData, key); if (!order) return; @@ -77,7 +82,9 @@ export function DynamicLines({ globalExpressParams, requireValidations: true, estimationMethod: "approximate", - provider: undefined, + provider, + isGmxAccount: srcChainId !== undefined, + subaccount, }); sendBatchOrderTxn({ @@ -85,14 +92,25 @@ export function DynamicLines({ signer, batchParams, expressParams, - noncesData: globalExpressParams?.noncesData, simulationParams: undefined, callback: makeOrderTxnCallback({}), + provider, + isGmxAccount: srcChainId !== undefined, }).finally(() => { setCancellingOrdersKeys((prev) => prev.filter((k) => k !== key)); }); }, - [chainId, globalExpressParams, makeOrderTxnCallback, ordersInfoData, setCancellingOrdersKeys, signer] + [ + chainId, + globalExpressParams, + makeOrderTxnCallback, + ordersInfoData, + provider, + setCancellingOrdersKeys, + signer, + srcChainId, + subaccount, + ] ); const calcSelector = useCalcSelector(); diff --git a/src/components/TVChartContainer/constants.ts b/src/components/TVChartContainer/constants.ts index da68416676..563b70c468 100644 --- a/src/components/TVChartContainer/constants.ts +++ b/src/components/TVChartContainer/constants.ts @@ -159,4 +159,10 @@ export const orderTypeToTitle: Partial(null); + + const [scrollTop, setScrollTop] = useState(0); + const [scrollBottom, setScrollBottom] = useState(0); + const [maxFadeArea, setMaxFadeArea] = useState(75); + + const setScrolls = useCallback(() => { + const scrollable = scrollableRef.current; + if (!scrollable) { + return; + } + + if (scrollable.scrollHeight > scrollable.clientHeight) { + setScrollTop(scrollable.scrollTop); + const bottom = scrollable.scrollHeight - scrollable.clientHeight - scrollable.scrollTop; + setScrollBottom(bottom < MIN_SCROLL_END_SPACE ? 0 : bottom); + setMaxFadeArea(scrollable.clientHeight / 10); + } else { + setScrollTop(0); + setScrollBottom(0); + } + }, []); + + const setScrollableRef = useCallback( + (node: HTMLDivElement | null) => { + scrollableRef.current = node; + if (node) { + setScrolls(); + } + }, + [setScrolls] + ); + + useEffectOnce(() => { + if (!scrollableRef.current) { + return; + } + + const resizeObserver = new ResizeObserver(setScrolls); + + resizeObserver.observe(scrollableRef.current); + window.addEventListener("resize", setScrolls); + scrollableRef.current?.addEventListener("scroll", setScrolls); + + return () => { + window.removeEventListener("resize", setScrolls); + scrollableRef.current?.removeEventListener("scroll", setScrolls); + resizeObserver.disconnect(); + }; + }); + + const topStyles = useMemo(() => { + return { + height: `${Math.max(MIN_FADE_AREA, Math.min(scrollTop + 8, maxFadeArea))}px`, + }; + }, [scrollTop, maxFadeArea]); + + const bottomStyles = useMemo(() => { + return { + height: `${Math.max(MIN_FADE_AREA, Math.min(scrollBottom + 8, maxFadeArea))}px`, + }; + }, [scrollBottom, maxFadeArea]); + + return { + scrollableRef, + setScrollableRef, + scrollTop, + scrollBottom, + topStyles, + bottomStyles, + }; +} + +function VerticalScrollFadeControls({ + scrollTop, + scrollBottom, + topStyles, + bottomStyles, +}: { + scrollTop: number; + scrollBottom: number; + topStyles: React.CSSProperties; + bottomStyles: React.CSSProperties; +}) { + return ( +
+
0, + })} + style={topStyles} + /> +
0, + })} + style={bottomStyles} + /> +
+ ); +} + +export function VerticalScrollFadeContainer({ children, className }: PropsWithChildren<{ className?: string }>) { + const scrollFade = useVerticalScrollFade(); + + return ( +
+ +
+ {children} +
+
+ ); +} diff --git a/src/components/TokenCard/TokenCard.tsx b/src/components/TokenCard/TokenCard.tsx index 142193e814..c6f74361af 100644 --- a/src/components/TokenCard/TokenCard.tsx +++ b/src/components/TokenCard/TokenCard.tsx @@ -213,13 +213,13 @@ export default function TokenCard({ showRedirectModal, showGlp = true }: Props) marketsTokensIncentiveAprData: arbIncentiveApr, glvTokensIncentiveAprData: arbGlvIncentiveApr, glvApyInfoData: arbGlvApy, - } = useGmMarketsApy(ARBITRUM, { period: PERIOD }); + } = useGmMarketsApy(ARBITRUM, undefined, { period: PERIOD }); const { marketsTokensApyData: avaxApy, marketsTokensIncentiveAprData: avaxIncentiveApr, glvTokensIncentiveAprData: avaxGlvIncentiveApr, glvApyInfoData: avaxGlvApy, - } = useGmMarketsApy(AVALANCHE, { period: PERIOD }); + } = useGmMarketsApy(AVALANCHE, undefined, { period: PERIOD }); const maxMarketApyText = useMemo(() => { if (!arbApy || !arbIncentiveApr || !avaxApy || !avaxIncentiveApr) diff --git a/src/components/TokenIcon/TokenIcon.tsx b/src/components/TokenIcon/TokenIcon.tsx index 7ead816a75..58d1c3401d 100644 --- a/src/components/TokenIcon/TokenIcon.tsx +++ b/src/components/TokenIcon/TokenIcon.tsx @@ -1,5 +1,6 @@ import cx from "classnames"; +import { CHAIN_ID_TO_NETWORK_ICON } from "config/icons"; import { importImage } from "lib/legacy"; import "./TokenIcon.scss"; @@ -16,26 +17,17 @@ type Props = { importSize?: 24 | 40; className?: string; badge?: string | readonly [topSymbol: string, bottomSymbol: string]; + chainIdBadge?: number; badgeClassName?: string; }; -function TokenIcon({ className, symbol, displaySize, importSize = 24, badge, badgeClassName }: Props) { +function TokenIcon({ className, symbol, displaySize, importSize = 24, badge, badgeClassName, chainIdBadge }: Props) { const iconPath = getIconUrlPath(symbol, importSize); const classNames = cx("Token-icon inline rounded-full", className); if (!iconPath) return <>; let sub; - const img = ( - {symbol} - ); if (badge) { if (typeof badge === "string") { @@ -74,14 +66,46 @@ function TokenIcon({ className, symbol, displaySize, importSize = 24, badge, bad ); } + } else if (chainIdBadge !== undefined) { + let size = 22; + let offset = "-bottom-1 -right-1"; + if (displaySize >= 40) { + size = 22; + offset = "-bottom-1 -right-1"; + } else if (displaySize === 20) { + size = 14; + offset = "-bottom-3 -right-3"; + } else { + size = displaySize / 2 + 2; + offset = "-bottom-3 -right-3"; + } + sub = ( + + ); } + const img = ( + {symbol} + ); + if (!sub) { return img; } return ( - + {img} {sub} diff --git a/src/components/TokenSelector/MultichainTokenSelector.tsx b/src/components/TokenSelector/MultichainTokenSelector.tsx new file mode 100644 index 0000000000..2a47bd114a --- /dev/null +++ b/src/components/TokenSelector/MultichainTokenSelector.tsx @@ -0,0 +1,501 @@ +import { Trans } from "@lingui/macro"; +import cx from "classnames"; +import { ReactNode, useEffect, useMemo, useState } from "react"; +import { BiChevronDown } from "react-icons/bi"; + +import type { ContractsChainId, SourceChainId } from "config/chains"; +import type { TokenChainData } from "domain/multichain/types"; +import { convertToUsd } from "domain/synthetics/tokens"; +import type { Token, TokenData, TokensData } from "domain/tokens"; +import { stripBlacklistedWords } from "domain/tokens/utils"; +import { formatAmount, formatBalanceAmount } from "lib/numbers"; +import { EMPTY_OBJECT } from "lib/objects"; +import { searchBy } from "lib/searchBy"; +import { USD_DECIMALS } from "sdk/configs/factors"; +import { getToken } from "sdk/configs/tokens"; + +import Button from "components/Button/Button"; +import { SlideModal } from "components/Modal/SlideModal"; +import SearchInput from "components/SearchInput/SearchInput"; +import TokenIcon from "components/TokenIcon/TokenIcon"; + +import "./TokenSelector.scss"; + +type Props = { + chainId: ContractsChainId; + srcChainId: SourceChainId | undefined; + + label?: string; + size?: "m" | "l"; + className?: string; + + tokenAddress: string; + isGmxAccount: boolean; + + tokensData: TokensData | undefined; + selectedTokenLabel?: ReactNode | string; + + onSelectTokenAddress: (tokenAddress: string, isGmxAccount: boolean) => void; + extendedSortSequence?: string[] | undefined; + + footerContent?: ReactNode; + qa?: string; + multichainTokens: TokenChainData[] | undefined; + + onDepositTokenAddress: (tokenAddress: string, chainId: SourceChainId) => void; +}; + +export function MultichainTokenSelector({ + chainId, + srcChainId, + tokensData, + selectedTokenLabel, + extendedSortSequence, + footerContent, + size = "m", + qa, + onSelectTokenAddress: propsOnSelectTokenAddress, + tokenAddress, + isGmxAccount, + className, + label, + multichainTokens, + onDepositTokenAddress: propsOnDepositTokenAddress, +}: Props) { + const [isModalVisible, setIsModalVisible] = useState(false); + const [searchKeyword, setSearchKeyword] = useState(""); + let token: Token | undefined = getToken(chainId, tokenAddress); + + const onSelectTokenAddress = (tokenAddress: string, isGmxAccount: boolean) => { + setIsModalVisible(false); + propsOnSelectTokenAddress(tokenAddress, isGmxAccount); + }; + + const onDepositTokenAddress = (tokenAddress: string, chainId: SourceChainId) => { + setIsModalVisible(false); + propsOnDepositTokenAddress(tokenAddress, chainId); + }; + + useEffect(() => { + if (isModalVisible) { + setSearchKeyword(""); + } + }, [isModalVisible]); + + // TODO implement + // const _handleKeyDown = (e) => { + // if (e.key === "Enter") { + // e.preventDefault(); + // e.stopPropagation(); + // if (filteredTokens.length > 0) { + // onSelectToken(filteredTokens[0]); + // } + // } + // }; + + const isGmxAccountEmpty = useMemo(() => { + if (!tokensData) return true; + + const allEmpty = Object.values(tokensData).every( + (token) => token.gmxAccountBalance === undefined || token.gmxAccountBalance === 0n + ); + + return allEmpty; + }, [tokensData]); + + const [activeFilter, setActiveFilter] = useState<"pay" | "deposit">("pay"); + + useEffect(() => { + if (isModalVisible) { + setSearchKeyword(""); + + if (srcChainId === undefined) { + setActiveFilter("pay"); + } else { + if (isGmxAccountEmpty) { + setActiveFilter("deposit"); + } else { + setActiveFilter("pay"); + } + } + } + }, [isGmxAccountEmpty, isModalVisible, setSearchKeyword, srcChainId]); + + if (!token) { + return null; + } + + return ( +
event.stopPropagation()} + > + + + {isGmxAccountEmpty && srcChainId !== undefined ? ( +
+ To begin trading on GMX deposit assets into GMX account +
+ ) : ( +
+ + +
+ )} + + } + contentPadding={false} + > + {activeFilter === "pay" && ( + + )} + {activeFilter === "deposit" && multichainTokens && ( + + )} +
+
setIsModalVisible(true)} + > + {selectedTokenLabel || ( + + + {token.symbol} + + )} + +
+
+ ); +} + +function AvailableToTradeTokenList({ + chainId, + srcChainId, + isModalVisible, + setSearchKeyword, + searchKeyword, + tokensData, + extendedSortSequence, + onSelectTokenAddress, +}: { + chainId: ContractsChainId; + srcChainId: SourceChainId | undefined; + isModalVisible: boolean; + setSearchKeyword: (searchKeyword: string) => void; + searchKeyword: string; + tokensData: TokensData | undefined; + extendedSortSequence?: string[]; + onSelectTokenAddress: (tokenAddress: string, isGmxAccount: boolean) => void; +}) { + useEffect(() => { + if (isModalVisible) { + setSearchKeyword(""); + } + }, [isModalVisible, setSearchKeyword]); + + const sortedFilteredTokens = useMemo(() => { + type DisplayToken = TokenData & { balance: bigint; balanceUsd: bigint; isGmxAccount: boolean }; + + const concatenatedTokens: DisplayToken[] = []; + + for (const token of Object.values(tokensData ?? (EMPTY_OBJECT as TokensData))) { + if (token.gmxAccountBalance !== undefined && (srcChainId !== undefined || token.gmxAccountBalance > 0n)) { + concatenatedTokens.push({ ...token, isGmxAccount: true, balance: token.gmxAccountBalance, balanceUsd: 0n }); + } + if (token.walletBalance !== undefined && srcChainId === undefined) { + concatenatedTokens.push({ ...token, isGmxAccount: false, balance: token.walletBalance, balanceUsd: 0n }); + } + } + + let filteredTokens: DisplayToken[]; + if (!searchKeyword.trim()) { + filteredTokens = concatenatedTokens; + } else { + filteredTokens = searchBy( + concatenatedTokens, + [ + (item) => { + let name = item.name; + + return stripBlacklistedWords(name); + }, + "symbol", + ], + searchKeyword + ); + } + + const tokensWithBalance: DisplayToken[] = []; + const tokensWithoutBalance: DisplayToken[] = []; + + for (const token of filteredTokens) { + const balance = token.isGmxAccount ? token.gmxAccountBalance : token.walletBalance; + + if (balance !== undefined && balance > 0n) { + const balanceUsd = convertToUsd(balance, token.decimals, token.prices.maxPrice) ?? 0n; + tokensWithBalance.push({ ...token, balanceUsd }); + } else { + tokensWithoutBalance.push({ ...token, balanceUsd: 0n }); + } + } + + const sortedTokensWithBalance: DisplayToken[] = tokensWithBalance.sort((a, b) => { + if (a.balanceUsd === b.balanceUsd) { + return 0; + } + return b.balanceUsd - a.balanceUsd > 0n ? 1 : -1; + }); + + const sortedTokensWithoutBalance: DisplayToken[] = tokensWithoutBalance.sort((a, b) => { + if (extendedSortSequence) { + // making sure to use the wrapped address if it exists in the extended sort sequence + const aAddress = + a.wrappedAddress && extendedSortSequence.includes(a.wrappedAddress) ? a.wrappedAddress : a.address; + + const bAddress = + b.wrappedAddress && extendedSortSequence.includes(b.wrappedAddress) ? b.wrappedAddress : b.address; + + return extendedSortSequence.indexOf(aAddress) - extendedSortSequence.indexOf(bAddress); + } + + return 0; + }); + + return [...sortedTokensWithBalance, ...sortedTokensWithoutBalance]; + }, [searchKeyword, tokensData, srcChainId, extendedSortSequence]); + + return ( +
+ {sortedFilteredTokens.map((token) => { + return ( +
onSelectTokenAddress(token.address, token.isGmxAccount)} + > +
+ + +
+
{token.symbol}
+ {token.name} +
+
+
+
+ {token.balance > 0n && + formatBalanceAmount(token.balance, token.decimals, undefined, { + isStable: token.isStable, + })} + {token.balance == 0n && "-"} +
+ + + {token.balanceUsd > 0n &&
${formatAmount(token.balanceUsd, USD_DECIMALS, 2, true)}
} +
+
+
+ ); + })} +
+ ); +} + +function MultichainTokenList({ + isModalVisible, + setSearchKeyword, + searchKeyword, + multichainTokens, + extendedSortSequence, + onDepositTokenAddress, +}: { + isModalVisible: boolean; + setSearchKeyword: (searchKeyword: string) => void; + searchKeyword: string; + multichainTokens: TokenChainData[]; + extendedSortSequence?: string[]; + onDepositTokenAddress: (tokenAddress: string, chainId: SourceChainId) => void; +}) { + useEffect(() => { + if (isModalVisible) { + setSearchKeyword(""); + } + }, [isModalVisible, setSearchKeyword]); + + const filteredTokens = useMemo(() => { + if (!searchKeyword.trim()) { + return multichainTokens; + } + + return searchBy( + multichainTokens, + [ + (item) => { + let name = item.name; + + return stripBlacklistedWords(name); + }, + "symbol", + ], + searchKeyword + ); + }, [searchKeyword, multichainTokens]); + + type DisplayToken = TokenChainData & { sourceChainBalanceUsd: bigint }; + + const sortedFilteredTokens: DisplayToken[] = useMemo((): DisplayToken[] => { + const tokensWithBalance: DisplayToken[] = []; + const tokensWithoutBalance: DisplayToken[] = []; + + for (const token of filteredTokens) { + const balance = token.sourceChainBalance; + + if (balance !== undefined && balance > 0n) { + const balanceUsd = convertToUsd(balance, token.sourceChainDecimals, token.sourceChainPrices?.maxPrice) ?? 0n; + tokensWithBalance.push({ ...token, sourceChainBalanceUsd: balanceUsd }); + } else { + tokensWithoutBalance.push({ ...token, sourceChainBalanceUsd: 0n }); + } + } + + const sortedTokensWithBalance = tokensWithBalance.sort((a, b) => { + return b.sourceChainBalanceUsd - a.sourceChainBalanceUsd > 0n ? 1 : -1; + }); + + const sortedTokensWithoutBalance = tokensWithoutBalance.sort((a, b) => { + if (extendedSortSequence) { + // making sure to use the wrapped address if it exists in the extended sort sequence + const aAddress = + a.wrappedAddress && extendedSortSequence.includes(a.wrappedAddress) ? a.wrappedAddress : a.address; + + const bAddress = + b.wrappedAddress && extendedSortSequence.includes(b.wrappedAddress) ? b.wrappedAddress : b.address; + + return extendedSortSequence.indexOf(aAddress) - extendedSortSequence.indexOf(bAddress); + } + + return 0; + }); + + return [...sortedTokensWithBalance, ...sortedTokensWithoutBalance]; + }, [filteredTokens, extendedSortSequence]); + + return ( +
+ {sortedFilteredTokens.map((token) => { + return ( +
onDepositTokenAddress(token.address, token.sourceChainId)} + > +
+ + +
+
{token.symbol}
+ {token.name} +
+
+
+ {(token.sourceChainBalance !== undefined && ( +
+ {token.sourceChainBalance > 0 && + formatBalanceAmount(token.sourceChainBalance, token.sourceChainDecimals, undefined, { + isStable: token.isStable, + })} + {token.sourceChainBalance == 0n && "-"} +
+ )) || + null} + + {token.sourceChainBalanceUsd !== undefined && token.sourceChainBalanceUsd > 0 && ( +
${formatAmount(token.sourceChainBalanceUsd, USD_DECIMALS, 2, true)}
+ )} +
+
+
+ Deposit +
+
+ ); + })} +
+ ); +} diff --git a/src/components/Tooltip/Tooltip.tsx b/src/components/Tooltip/Tooltip.tsx index 3721ba37a9..f1e279151e 100644 --- a/src/components/Tooltip/Tooltip.tsx +++ b/src/components/Tooltip/Tooltip.tsx @@ -70,6 +70,7 @@ type InnerTooltipProps = { as?: T; withPortal?: boolean; shouldStopPropagation?: boolean; + shouldPreventDefault?: boolean; fitHandleWidth?: boolean; closeOnDoubleClick?: boolean; @@ -98,6 +99,7 @@ export default function Tooltip({ as, withPortal, shouldStopPropagation, + shouldPreventDefault = true, fitHandleWidth, closeOnDoubleClick, variant = "underline", @@ -170,12 +172,14 @@ export default function Tooltip({ const preventClick = useCallback( (event: MouseEvent) => { - event.preventDefault(); + if (shouldPreventDefault) { + event.preventDefault(); + } if (shouldStopPropagation) { event.stopPropagation(); } }, - [shouldStopPropagation] + [shouldPreventDefault, shouldStopPropagation] ); useEffect( diff --git a/src/components/VersionSwitch/VersionSwitch.tsx b/src/components/VersionSwitch/VersionSwitch.tsx index f78c636835..918ba28c53 100644 --- a/src/components/VersionSwitch/VersionSwitch.tsx +++ b/src/components/VersionSwitch/VersionSwitch.tsx @@ -3,18 +3,15 @@ import cx from "classnames"; import { getIsV1Supported } from "config/features"; import { useChainId } from "lib/chains"; import { useTradePageVersion } from "lib/useTradePageVersion"; -import "./VersionSwitch.scss"; -type Props = { - className?: string; -}; +import "./VersionSwitch.scss"; -export function VersionSwitch({ className }: Props) { +export function VersionSwitch() { const { chainId } = useChainId(); const [currentVersion, setCurrentVersion] = useTradePageVersion(); return ( -
+
= { +export const IS_NETWORK_DISABLED: Record = { [ARBITRUM]: false, [AVALANCHE]: false, + [ARBITRUM_SEPOLIA]: false, [AVALANCHE_FUJI]: false, [BOTANIX]: false, }; @@ -82,6 +89,19 @@ const constants = { DECREASE_ORDER_EXECUTION_GAS_FEE: parseEther("0.0100001"), }, + [ARBITRUM_SEPOLIA]: { + nativeTokenSymbol: "ETH", + wrappedTokenSymbol: "WETH", + defaultCollateralSymbol: "USDC", + defaultFlagOrdersEnabled: true, + positionReaderPropsLength: 9, + v2: true, + + SWAP_ORDER_EXECUTION_GAS_FEE: parseEther("0.01"), + INCREASE_ORDER_EXECUTION_GAS_FEE: parseEther("0.01"), + // contract requires that execution fee be strictly greater than instead of gte + DECREASE_ORDER_EXECUTION_GAS_FEE: parseEther("0.0100001"), + }, [BOTANIX]: { nativeTokenSymbol: "BTC", wrappedTokenSymbol: "PBTC", @@ -95,18 +115,18 @@ const constants = { // contract requires that execution fee be strictly greater than instead of gte DECREASE_ORDER_EXECUTION_GAS_FEE: parseEther("0.0100001"), }, -}; +} satisfies Record>; const ALCHEMY_WHITELISTED_DOMAINS = ["gmx.io", "app.gmx.io"]; -export const RPC_PROVIDERS: Record = { +export const RPC_PROVIDERS: Record = { [ETH_MAINNET]: ["https://rpc.ankr.com/eth"], [ARBITRUM]: [ "https://arb1.arbitrum.io/rpc", "https://arbitrum-one-rpc.publicnode.com", // "https://1rpc.io/arb", has CORS issue "https://arbitrum-one.public.blastapi.io", - "https://arbitrum.drpc.org", + // "https://arbitrum.drpc.org", "https://rpc.ankr.com/arbitrum", ], [AVALANCHE]: [ @@ -120,6 +140,10 @@ export const RPC_PROVIDERS: Record = { +export const FALLBACK_PROVIDERS: Record = { [ARBITRUM]: ENV_ARBITRUM_RPC_URLS ? JSON.parse(ENV_ARBITRUM_RPC_URLS) : [getAlchemyArbitrumHttpUrl("fallback")], [AVALANCHE]: ENV_AVALANCHE_RPC_URLS ? JSON.parse(ENV_AVALANCHE_RPC_URLS) : [getAlchemyAvalancheHttpUrl("fallback")], [AVALANCHE_FUJI]: [ @@ -136,23 +160,34 @@ export const FALLBACK_PROVIDERS: Record = { "https://ava-testnet.public.blastapi.io/ext/bc/C/rpc", ], [BOTANIX]: ENV_BOTANIX_RPC_URLS ? JSON.parse(ENV_BOTANIX_RPC_URLS) : [getAlchemyBotanixHttpUrl("fallback")], + [ARBITRUM_SEPOLIA]: [getAlchemyArbitrumSepoliaHttpUrl("fallback")], + [SOURCE_BASE_MAINNET]: [getAlchemyBaseMainnetHttpUrl("fallback")], + [SOURCE_OPTIMISM_SEPOLIA]: [getAlchemyOptimismSepoliaHttpUrl("fallback")], + [SOURCE_SEPOLIA]: [getAlchemyBaseSepoliaHttpUrl("fallback")], }; -export const PRIVATE_RPC_PROVIDERS: Record = { +export const PRIVATE_RPC_PROVIDERS: Record = { [ARBITRUM]: [getAlchemyArbitrumHttpUrl("largeAccount")], [AVALANCHE]: [getAlchemyAvalancheHttpUrl("largeAccount")], [AVALANCHE_FUJI]: [], [BOTANIX]: [getAlchemyBotanixHttpUrl("largeAccount")], + [ARBITRUM_SEPOLIA]: [], }; -export const EXPRESS_RPC_PROVIDERS: Record = { +export const EXPRESS_RPC_PROVIDERS: Record = { [ARBITRUM]: [getAlchemyArbitrumHttpUrl("express")], [AVALANCHE]: [getAlchemyAvalancheHttpUrl("express")], [AVALANCHE_FUJI]: [], [BOTANIX]: [getAlchemyBotanixHttpUrl("express")], + [ARBITRUM_SEPOLIA]: [], }; -export const getConstant = (chainId: number, key: string) => { +type ConstantName = keyof (typeof constants)[ContractsChainId]; + +export const getConstant = ( + chainId: T, + key: K +): (typeof constants)[T][K] => { if (!constants[chainId]) { throw new Error(`Unsupported chainId ${chainId}`); } @@ -208,21 +243,61 @@ export function getAlchemyBotanixWsUrl(purpose: AlchemyKeyPurpose) { return `wss://botanix-mainnet.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; } -export function getExplorerUrl(chainId) { - if (chainId === 3) { - return "https://ropsten.etherscan.io/"; - } else if (chainId === 42) { - return "https://kovan.etherscan.io/"; - } else if (chainId === ARBITRUM) { - return "https://arbiscan.io/"; - } else if (chainId === AVALANCHE) { - return "https://snowtrace.io/"; - } else if (chainId === AVALANCHE_FUJI) { - return "https://testnet.snowtrace.io/"; - } else if (chainId === BOTANIX) { - return "https://botanixscan.io/"; +export function getAlchemyOptimismSepoliaHttpUrl(purpose: AlchemyKeyPurpose) { + return `https://opt-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyOptimismSepoliaWsUrl(purpose: AlchemyKeyPurpose) { + return `wss://opt-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyArbitrumSepoliaHttpUrl(purpose: AlchemyKeyPurpose) { + return `https://arb-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyArbitrumSepoliaWsUrl(purpose: AlchemyKeyPurpose) { + return `wss://arb-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyBaseMainnetHttpUrl(purpose: AlchemyKeyPurpose) { + return `https://base-mainnet.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyBaseMainnetWsUrl(purpose: AlchemyKeyPurpose) { + return `wss://base-mainnet.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemyBaseSepoliaHttpUrl(purpose: AlchemyKeyPurpose) { + return `https://base-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemySepoliaHttpUrl(purpose: AlchemyKeyPurpose) { + return `https://eth-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getAlchemySepoliaWsUrl(purpose: AlchemyKeyPurpose) { + return `wss://eth-sepolia.g.alchemy.com/v2/${getAlchemyKey(purpose)}`; +} + +export function getExplorerUrl(chainId: number): string { + switch (chainId as AnyChainId) { + case ARBITRUM: + return "https://arbiscan.io/"; + case AVALANCHE: + return "https://snowtrace.io/"; + case AVALANCHE_FUJI: + return "https://testnet.snowtrace.io/"; + case ARBITRUM_SEPOLIA: + return arbitrumSepolia.blockExplorers.default.url + "/"; + case SOURCE_OPTIMISM_SEPOLIA: + return "https://sepolia-optimism.etherscan.io/"; + case SOURCE_SEPOLIA: + return "https://sepolia.etherscan.io/"; + case BOTANIX: + return "https://botanixscan.io/"; + case SOURCE_BASE_MAINNET: + return "https://basescan.org/"; } - return "https://etherscan.io/"; } export function getTokenExplorerUrl(chainId: number, tokenAddress: string) { diff --git a/src/config/contracts.ts b/src/config/contracts.ts index 452e9de2cd..f85d04fad6 100644 --- a/src/config/contracts.ts +++ b/src/config/contracts.ts @@ -1,11 +1,14 @@ import { Contract, ContractRunner, ethers, InterfaceAbi } from "ethers"; +import type { Address } from "viem"; -import { getContract, CONTRACTS } from "sdk/configs/contracts"; +import { ContractName, getContract } from "sdk/configs/contracts"; import { GlvRouter__factory } from "typechain-types"; import { DataStore__factory } from "typechain-types/factories/DataStore__factory"; import { ExchangeRouter__factory } from "typechain-types/factories/ExchangeRouter__factory"; import { Multicall__factory } from "typechain-types/factories/Multicall__factory"; +import { ContractsChainId } from "./chains"; + const { ZeroAddress } = ethers; export { getContract } from "sdk/configs/contracts"; @@ -18,10 +21,10 @@ export const XGMT_EXCLUDED_ACCOUNTS = [ ]; function makeGetContract unknown }>( - name: string, + name: ContractName, factory: T ) { - return (chainId: number, provider?: ContractRunner) => + return (chainId: ContractsChainId, provider?: ContractRunner) => new Contract(getContract(chainId, name), factory.abi, provider) as unknown as ReturnType; } @@ -32,6 +35,10 @@ export const getGlvRouterContract = makeGetContract("GlvRouter", GlvRouter__fact export const getZeroAddressContract = (provider?: ContractRunner) => new Contract(ZeroAddress, [], provider); -export function tryGetContract(chainId: number, name: string): string | undefined { - return CONTRACTS[chainId]?.[name]; +export function tryGetContract(chainId: ContractsChainId, name: ContractName): Address | undefined { + try { + return getContract(chainId, name); + } catch (e) { + return undefined; + } } diff --git a/src/config/features.ts b/src/config/features.ts index 504a3e136d..40d9f1dbdb 100644 --- a/src/config/features.ts +++ b/src/config/features.ts @@ -1,9 +1,9 @@ -import { ARBITRUM, AVALANCHE, BOTANIX } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, BOTANIX } from "./chains"; export function getIsV1Supported(chainId: number) { return [AVALANCHE, ARBITRUM].includes(chainId); } export function getIsExpressSupported(chainId: number) { - return [AVALANCHE, ARBITRUM, BOTANIX].includes(chainId); + return [AVALANCHE, ARBITRUM, BOTANIX, ARBITRUM_SEPOLIA].includes(chainId); } diff --git a/src/config/icons.ts b/src/config/icons.ts index 2455b507b1..1f457478fa 100644 --- a/src/config/icons.ts +++ b/src/config/icons.ts @@ -1,9 +1,21 @@ -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "config/chains"; +import { + AnyChainId, + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, +} from "config/chains"; import gmIcon from "img/gm_icon.svg"; import arbitrum from "img/ic_arbitrum_24.svg"; +import arbitrumSepolia from "img/ic_arbitrum_sepolia_24.svg"; import avalanche from "img/ic_avalanche_24.svg"; import avalancheTestnet from "img/ic_avalanche_testnet_24.svg"; +import base from "img/ic_base_24.svg"; import botanix from "img/ic_botanix_24.svg"; import esGMXIcon from "img/ic_esgmx_40.svg"; import esGMXArbitrumIcon from "img/ic_esgmx_arbitrum.svg"; @@ -18,6 +30,8 @@ import gmxIcon from "img/ic_gmx_40.svg"; import gmxArbitrum from "img/ic_gmx_arbitrum.svg"; import gmxAvax from "img/ic_gmx_avax.svg"; import gmxOutlineIcon from "img/ic_gmxv1flat.svg"; +import optimismSepolia from "img/ic_op_24.svg"; +import sepolia from "img/ic_sepolia_24.svg"; type ChainIcons = { network?: string; @@ -37,6 +51,13 @@ const ICONS: Record = { esgmx: esGMXArbitrumIcon, gm: gmArbitrum, }, + [ARBITRUM_SEPOLIA]: { + network: arbitrumSepolia, + gmx: gmxArbitrum, + glp: glpArbitrum, + esgmx: esGMXArbitrumIcon, + gm: gmArbitrum, + }, [AVALANCHE]: { network: avalanche, gmx: gmxAvax, @@ -67,6 +88,21 @@ const ICONS: Record = { }, }; +export const CHAIN_ID_TO_NETWORK_ICON: Record = { + [ARBITRUM]: arbitrum, + [AVALANCHE]: avalanche, + 0: gmxIcon, + [SOURCE_BASE_MAINNET]: base, + [AVALANCHE_FUJI]: avalancheTestnet, + [ARBITRUM_SEPOLIA]: arbitrumSepolia, + [SOURCE_OPTIMISM_SEPOLIA]: optimismSepolia, + [SOURCE_SEPOLIA]: sepolia, + [BOTANIX]: botanix, +}; + +/** + * For chain icons use `getChainIcon` + */ export function getIcon(chainId: number | "common", label: keyof ChainIcons) { if (!chainId || !(chainId in ICONS)) { throw new Error(`No icons found for chain: ${chainId}`); @@ -74,6 +110,15 @@ export function getIcon(chainId: number | "common", label: keyof ChainIcons) { return ICONS[chainId][label]; } + +export function getChainIcon(chainId: number) { + if (!(chainId in CHAIN_ID_TO_NETWORK_ICON)) { + throw new Error(`No icon found for chain: ${chainId}`); + } + + return CHAIN_ID_TO_NETWORK_ICON[chainId]; +} + export function getIcons(chainId: number | "common") { if (!chainId || !(chainId in ICONS)) { throw new Error(`No icons found for chain: ${chainId}`); diff --git a/src/config/localStorage.ts b/src/config/localStorage.ts index 688352116a..814616e137 100644 --- a/src/config/localStorage.ts +++ b/src/config/localStorage.ts @@ -1,4 +1,5 @@ export const SELECTED_NETWORK_LOCAL_STORAGE_KEY = "SELECTED_NETWORK"; +export const SELECTED_SETTLEMENT_CHAIN_ID_KEY = "SELECTED_SETTLEMENT_CHAIN_ID"; export const WALLET_CONNECT_LOCALSTORAGE_KEY = "walletconnect"; export const WALLET_CONNECT_V2_LOCALSTORAGE_KEY = "walletconnect_v2"; export const WALLET_LINK_LOCALSTORAGE_PREFIX = "-walletlink"; @@ -37,16 +38,12 @@ export const SYNTHETICS_ACCEPTABLE_PRICE_IMPACT_BUFFER_KEY = "synthetics-accepta export const SYNTHETICS_DEPOSIT_INDEX_TOKEN_KEY = "synthetics-deposit-index-token"; export const SYNTHETICS_DEPOSIT_MARKET_KEY = "synthetics-market-deposit-market"; -export const SYNTHETICS_GLV_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-glv-market-deposit-token"; export const SYNTHETICS_MARKET_DEPOSIT_TOKEN_KEY = "synthetics-market-deposit-token"; -export const SYNTHETICS_COLLATERAL_DEPOSIT_TOKEN_KEY = "synthetics-collateral-deposit-token"; export const SYNTHETICS_LIST_SECTION_KEY = "synthetics-list-section"; export const ACCOUNT_DASHBOARD_TAB_KEY = "account-dashboard-tab"; -/** - * @deprecated - */ -export const SYNTHETICS_COLLATERAL_EDIT_TOKEN_KEY = "synthetics-collateral-edit-token"; export const SYNTHETICS_COLLATERAL_EDIT_TOKEN_MAP_KEY = "synthetics-collateral-edit-token-map"; +export const SYNTHETICS_COLLATERAL_EDIT_TOKEN_IS_FROM_GMX_ACCOUNT_KEY = + "synthetics-collateral-edit-token-is-from-gmx-account"; export const PRODUCTION_PREVIEW_KEY = "production-preview"; export const REQUIRED_UI_VERSION_KEY = "required-ui-version"; export const DEBUG_SWAP_SETTINGS_KEY = "debug-swap-settings"; @@ -76,6 +73,9 @@ export const AB_FLAG_STORAGE_KEY = "ab-flags"; export const RPC_PROVIDER_KEY = "rpc-provider"; export const IS_LARGE_ACCOUNT_KEY = "is-large-account"; +export const IS_SOURCE_BASE_ALLOWED_KEY = "is-source-base-allowed"; +export const IS_SOURCE_BASE_ALLOWED_NOTIFICATION_SHOWN_KEY = "is-source-base-allowed-notification-shown"; + /** * @deprecated */ @@ -128,17 +128,14 @@ export function getSyntheticsTradeOptionsKey(chainId: number) { return [chainId, SYNTHETICS_TRADE_OPTIONS]; } -/** - * @deprecated - */ -export function getSyntheticsCollateralEditAddressKey(chainId: number, positionCollateralAddress?: string) { - return [chainId, SYNTHETICS_COLLATERAL_EDIT_TOKEN_KEY, positionCollateralAddress]; -} - export function getSyntheticsCollateralEditAddressMapKey(chainId: number) { return [chainId, SYNTHETICS_COLLATERAL_EDIT_TOKEN_MAP_KEY]; } +export function getSyntheticsCollateralEditTokenIsFromGmxAccountMapKey(chainId: number) { + return [chainId, SYNTHETICS_COLLATERAL_EDIT_TOKEN_IS_FROM_GMX_ACCOUNT_KEY]; +} + export function getLeverageKey(chainId: number) { return [chainId, LEVERAGE_OPTION_KEY]; } @@ -214,6 +211,10 @@ export function getExpressTradingPromoHiddenKey(chainId: number) { return `${chainId}-${EXPRESS_TRADING_PROMO_HIDDEN_KEY}`; } +export function getFromTokenIsGmxAccountKey(chainId: number) { + return [chainId, "from-token-is-gmx-account"]; +} + export function getClaimTermsAcceptedKey( chainId: number, account: string | undefined, diff --git a/src/config/markets.ts b/src/config/markets.ts index ed572c96fa..df9d48732c 100644 --- a/src/config/markets.ts +++ b/src/config/markets.ts @@ -1,8 +1,9 @@ import mapValues from "lodash/mapValues"; import { isDevelopment } from "config/env"; +import { SETTLEMENT_CHAINS } from "config/multichain"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, SettlementChainId } from "./chains"; import { MARKETS } from "./static/markets"; export * from "./static/markets"; @@ -48,8 +49,34 @@ export const GLV_MARKETS: { shortening: "HC", }, }, + [ARBITRUM_SEPOLIA]: { + "0xAb3567e55c205c62B141967145F37b7695a9F854": { + name: "High Caps", + subtitle: "Core ETH Markets Vault", + shortening: "HC", + }, + }, }; export function getMarketUiConfig(chainId: number, marketAddress: string) { return MARKETS[chainId]?.[marketAddress]; } + +const SETTLEMENT_CHAIN_TRADABLE_ASSETS_MAP: Record = {} as any; + +for (const chainId of SETTLEMENT_CHAINS) { + const tradableTokenAddressesSet = new Set(); + + for (const marketAddress in MARKETS[chainId]) { + const marketConfig = MARKETS[chainId][marketAddress]; + + tradableTokenAddressesSet.add(marketConfig.longTokenAddress); + tradableTokenAddressesSet.add(marketConfig.shortTokenAddress); + } + + SETTLEMENT_CHAIN_TRADABLE_ASSETS_MAP[chainId] = Array.from(tradableTokenAddressesSet); +} + +export function getSettlementChainTradableTokenAddresses(chainId: SettlementChainId) { + return SETTLEMENT_CHAIN_TRADABLE_ASSETS_MAP[chainId]; +} diff --git a/src/config/multichain.ts b/src/config/multichain.ts new file mode 100644 index 0000000000..4e62aec480 --- /dev/null +++ b/src/config/multichain.ts @@ -0,0 +1,390 @@ +import { errors as _StargateErrorsAbi } from "@stargatefinance/stg-evm-sdk-v2"; +import { abi as IStargateAbi } from "@stargatefinance/stg-evm-sdk-v2/artifacts/src/interfaces/IStargate.sol/IStargate.json"; +import { address as ethPoolArbitrum } from "@stargatefinance/stg-evm-sdk-v2/deployments/arbitrum-mainnet/StargatePoolNative.json"; +import { address as usdcPoolArbitrum } from "@stargatefinance/stg-evm-sdk-v2/deployments/arbitrum-mainnet/StargatePoolUSDC.json"; +import { address as ethPoolArbitrumSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/arbsep-testnet/StargatePoolNative.json"; +import { address as usdcSgPoolArbitrumSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/arbsep-testnet/StargatePoolUSDC.json"; +import { address as usdcPoolAvalanche } from "@stargatefinance/stg-evm-sdk-v2/deployments/avalanche-mainnet/StargatePoolUSDC.json"; +import { address as ethPoolBase } from "@stargatefinance/stg-evm-sdk-v2/deployments/base-mainnet/StargatePoolNative.json"; +import { address as usdcPoolBase } from "@stargatefinance/stg-evm-sdk-v2/deployments/base-mainnet/StargatePoolUSDC.json"; +import { address as ethPoolOptimismSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/optsep-testnet/StargatePoolNative.json"; +import { address as usdcSgPoolOptimismSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/optsep-testnet/StargatePoolUSDC.json"; +import { address as ethPoolSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/sepolia-testnet/StargatePoolNative.json"; +import { address as usdcSgPoolSepolia } from "@stargatefinance/stg-evm-sdk-v2/deployments/sepolia-testnet/StargatePoolUSDC.json"; +import type { JsonFragment } from "ethers"; +import invert from "lodash/invert"; +import mapValues from "lodash/mapValues"; +import uniq from "lodash/uniq"; +import type { Abi } from "viem"; +import { Hex, zeroAddress } from "viem"; + +import { + AnyChainId, + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + SettlementChainId, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, + SourceChainId, +} from "config/chains"; +import { isDevelopment } from "config/env"; +import { LayerZeroEndpointId } from "domain/multichain/types"; +import { numberToBigint } from "lib/numbers"; +import { convertTokenAddress, getTokenBySymbol } from "sdk/configs/tokens"; + +import { IS_SOURCE_BASE_ALLOWED_KEY } from "./localStorage"; + +export { + ethPoolArbitrumSepolia, + ethPoolOptimismSepolia, + ethPoolSepolia, + IStargateAbi, + usdcSgPoolArbitrumSepolia, + usdcSgPoolOptimismSepolia, + usdcSgPoolSepolia, +}; + +type MultichainTokenMapping = Record< + // settlement chain id + SettlementChainId, + Record< + // source chain id + SourceChainId, + Record< + // source chain token address + string, + { + settlementChainTokenAddress: string; + + sourceChainTokenAddress: string; + sourceChainTokenDecimals: number; + } + > + > +>; + +type MultichainWithdrawSupportedTokens = Record< + // settlement chain id + SettlementChainId, + // settlement chain wrapped token address + string[] +>; + +type MultichainSourceToSettlementsMap = Record; + +export type MultichainTokenId = { + chainId: SettlementChainId | SourceChainId; + address: string; + decimals: number; + stargate: string; + symbol: string; + isTestnet?: boolean; +}; + +const TOKEN_GROUPS: Partial>>> = { + ["USDC"]: { + [ARBITRUM]: { + address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", + decimals: 6, + chainId: ARBITRUM, + stargate: usdcPoolArbitrum, + symbol: "USDC", + }, + [AVALANCHE]: { + address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", + decimals: 6, + chainId: AVALANCHE, + stargate: usdcPoolAvalanche, + symbol: "USDC", + }, + [SOURCE_BASE_MAINNET]: { + address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", + decimals: 6, + chainId: SOURCE_BASE_MAINNET, + stargate: usdcPoolBase, + symbol: "USDC", + }, + }, + ["ETH"]: { + [ARBITRUM]: { + address: zeroAddress, + decimals: 18, + chainId: ARBITRUM, + stargate: ethPoolArbitrum, + symbol: "ETH", + }, + [SOURCE_BASE_MAINNET]: { + address: zeroAddress, + decimals: 18, + chainId: SOURCE_BASE_MAINNET, + stargate: ethPoolBase, + symbol: "ETH", + }, + }, +}; + +if (isDevelopment()) { + TOKEN_GROUPS["USDC.SG"] = { + ...TOKEN_GROUPS["USDC.SG"], + [ARBITRUM_SEPOLIA]: { + address: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", + decimals: 6, + chainId: ARBITRUM_SEPOLIA, + stargate: usdcSgPoolArbitrumSepolia, + symbol: "USDC.SG", + isTestnet: true, + }, + [SOURCE_OPTIMISM_SEPOLIA]: { + address: "0x488327236B65C61A6c083e8d811a4E0D3d1D4268", + decimals: 6, + chainId: SOURCE_OPTIMISM_SEPOLIA, + stargate: usdcSgPoolOptimismSepolia, + symbol: "USDC.SG", + isTestnet: true, + }, + [SOURCE_SEPOLIA]: { + address: "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590", + decimals: 6, + chainId: SOURCE_SEPOLIA, + stargate: usdcSgPoolSepolia, + symbol: "USDC.SG", + isTestnet: true, + }, + }; + + TOKEN_GROUPS["ETH"] = { + ...TOKEN_GROUPS["ETH"], + [ARBITRUM_SEPOLIA]: { + address: zeroAddress, + decimals: 18, + chainId: ARBITRUM_SEPOLIA, + stargate: ethPoolArbitrumSepolia, + symbol: "ETH", + isTestnet: true, + }, + [SOURCE_OPTIMISM_SEPOLIA]: { + address: zeroAddress, + decimals: 18, + chainId: SOURCE_OPTIMISM_SEPOLIA, + stargate: ethPoolOptimismSepolia, + symbol: "ETH", + isTestnet: true, + }, + [SOURCE_SEPOLIA]: { + address: zeroAddress, + decimals: 18, + chainId: SOURCE_SEPOLIA, + stargate: ethPoolSepolia, + symbol: "ETH", + isTestnet: true, + }, + }; +} + +export const DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT = false; +export const IS_SOURCE_BASE_ALLOWED = + import.meta.env.NODE_ENV === "test" ? true : localStorage.getItem(IS_SOURCE_BASE_ALLOWED_KEY) === "1"; + +function ensureExhaustive(value: Record): T[] { + return Object.keys(value).map(Number) as T[]; +} + +export const SETTLEMENT_CHAINS: SettlementChainId[] = ensureExhaustive({ + [ARBITRUM_SEPOLIA]: true, + [ARBITRUM]: true, + [AVALANCHE]: true, +}); + +// TODO MLTCH remove this +// @ts-ignore +export const SOURCE_CHAINS: SourceChainId[] = ensureExhaustive({ + [SOURCE_OPTIMISM_SEPOLIA]: true, + [SOURCE_SEPOLIA]: true, + // [SOURCE_BASE_MAINNET]: true, +}); + +if (IS_SOURCE_BASE_ALLOWED) { + SOURCE_CHAINS.push(SOURCE_BASE_MAINNET); +} + +if (isDevelopment() && DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT) { + SOURCE_CHAINS.push(ARBITRUM_SEPOLIA as SourceChainId, ARBITRUM as SourceChainId, AVALANCHE as SourceChainId); +} + +export function isSettlementChain(chainId: number): chainId is SettlementChainId { + return SETTLEMENT_CHAINS.includes(chainId as SettlementChainId); +} + +export function isSourceChain(chainId: number | undefined): chainId is SourceChainId { + return SOURCE_CHAINS.includes(chainId as SourceChainId); +} + +export const MULTICHAIN_TOKEN_MAPPING = {} as MultichainTokenMapping; + +export const MULTICHAIN_TRANSFER_SUPPORTED_TOKENS = {} as MultichainWithdrawSupportedTokens; + +export const CHAIN_ID_TO_TOKEN_ID_MAP: Record< + SettlementChainId | SourceChainId, + Record +> = {} as any; + +export const MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING: MultichainSourceToSettlementsMap = {} as any; + +for (const tokenSymbol in TOKEN_GROUPS) { + for (const chainIdString in TOKEN_GROUPS[tokenSymbol]) { + const firstChainId = parseInt(chainIdString) as SettlementChainId | SourceChainId; + + const tokenId = TOKEN_GROUPS[tokenSymbol]![firstChainId]!; + if (tokenId) { + CHAIN_ID_TO_TOKEN_ID_MAP[firstChainId] = CHAIN_ID_TO_TOKEN_ID_MAP[firstChainId] || {}; + CHAIN_ID_TO_TOKEN_ID_MAP[firstChainId][tokenId.address] = tokenId; + } + + if (!isSettlementChain(firstChainId)) { + continue; + } + + const settlementChainId = firstChainId; + + let empty = true; + for (const sourceChainIdString in TOKEN_GROUPS[tokenSymbol]) { + const sourceChainId = parseInt(sourceChainIdString) as SettlementChainId | SourceChainId; + if (!isSourceChain(sourceChainId)) { + continue; + } + + if (!isDevelopment() && (settlementChainId as number) === (sourceChainId as number)) { + continue; + } + + const sourceChainToken = TOKEN_GROUPS[tokenSymbol]![sourceChainId]!; + + if (Boolean(tokenId?.isTestnet) !== Boolean(sourceChainToken?.isTestnet)) { + continue; + } + + empty = false; + + MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[sourceChainId] = + MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[sourceChainId] || []; + MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[sourceChainId] = uniq( + MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[sourceChainId].concat(settlementChainId) + ); + + MULTICHAIN_TOKEN_MAPPING[settlementChainId] = MULTICHAIN_TOKEN_MAPPING[settlementChainId] || {}; + MULTICHAIN_TOKEN_MAPPING[settlementChainId][sourceChainIdString] = + MULTICHAIN_TOKEN_MAPPING[settlementChainId][sourceChainIdString] || {}; + + MULTICHAIN_TOKEN_MAPPING[settlementChainId][sourceChainIdString][sourceChainToken.address] = { + settlementChainTokenAddress: tokenId.address, + sourceChainTokenAddress: sourceChainToken.address, + sourceChainTokenDecimals: sourceChainToken.decimals, + }; + } + + if (!empty) { + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[settlementChainId] = + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[settlementChainId] || []; + MULTICHAIN_TRANSFER_SUPPORTED_TOKENS[settlementChainId].push( + convertTokenAddress(settlementChainId, tokenId.address, "wrapped") + ); + } + } +} + +export const DEFAULT_SETTLEMENT_CHAIN_ID_MAP: Record = { + [ARBITRUM_SEPOLIA]: ARBITRUM_SEPOLIA, + [SOURCE_OPTIMISM_SEPOLIA]: ARBITRUM_SEPOLIA, + [SOURCE_SEPOLIA]: ARBITRUM_SEPOLIA, + [SOURCE_BASE_MAINNET]: ARBITRUM, + [BOTANIX]: ARBITRUM, + + // Stubs + [ARBITRUM]: ARBITRUM, // ARBITRUM, + [AVALANCHE]: ARBITRUM, // AVALANCHE, + [AVALANCHE_FUJI]: ARBITRUM_SEPOLIA, +}; + +export function getMultichainTokenId(chainId: number, tokenAddress: string): MultichainTokenId | undefined { + return CHAIN_ID_TO_TOKEN_ID_MAP[chainId]?.[tokenAddress]; +} + +export function getStargatePoolAddress(chainId: number, tokenAddress: string): string | undefined { + const tokenId = getMultichainTokenId(chainId, tokenAddress); + + if (!tokenId) return undefined; + + return tokenId.stargate; +} + +export function getLayerZeroEndpointId(chainId: number): LayerZeroEndpointId | undefined { + return CHAIN_ID_TO_ENDPOINT_ID[chainId]; +} + +export function getMappedTokenId( + fromChainId: SettlementChainId | SourceChainId, + fromChainTokenAddress: string, + toChainId: SettlementChainId | SourceChainId +): MultichainTokenId | undefined { + const tokenId = getMultichainTokenId(fromChainId, fromChainTokenAddress); + + if (!tokenId) return undefined; + + const symbol = tokenId.symbol; + + const mappedTokenId = TOKEN_GROUPS[symbol]?.[toChainId]; + + return mappedTokenId; +} + +export const MULTICALLS_MAP: Record = { + [SOURCE_OPTIMISM_SEPOLIA]: "0xca11bde05977b3631167028862be2a173976ca11", + [SOURCE_SEPOLIA]: "0xca11bde05977b3631167028862be2a173976ca11", + [SOURCE_BASE_MAINNET]: "0xca11bde05977b3631167028862be2a173976ca11", +}; + +if (isDevelopment() && DEBUG_MULTICHAIN_SAME_CHAIN_DEPOSIT) { + MULTICALLS_MAP[ARBITRUM_SEPOLIA as SourceChainId] = "0xca11bde05977b3631167028862be2a173976ca11"; + MULTICALLS_MAP[ARBITRUM as SourceChainId] = "0xca11bde05977b3631167028862be2a173976ca11"; +} + +/** + * Compiled bytecode for MockUnlimitedToken + * @see https://github.com/gmx-io/gmx-synthetics/blob/updates/contracts/mock/MockUnlimitedToken.sol + */ +export const OVERRIDE_ERC20_BYTECODE: Hex = + "0x608060405234801561001057600080fd5b50600436106100835760003560e01c806306fdde0314610088578063095ea7b3146100ca57806318160ddd146100ed57806323b872dd14610103578063313ce5671461011657806370a082311461012557806395d89b4114610138578063a9059cbb14610157578063dd62ed3e1461016a575b600080fd5b60408051808201909152601481527326b7b1b5902ab73634b6b4ba32b2102a37b5b2b760611b60208201525b6040516100c191906103ae565b60405180910390f35b6100dd6100d8366004610418565b61017d565b60405190151581526020016100c1565b6100f56101ea565b6040519081526020016100c1565b6100dd610111366004610442565b6101fe565b604051601281526020016100c1565b6100f561013336600461047e565b6102c6565b60408051808201909152600381526213555560ea1b60208201526100b4565b6100dd610165366004610418565b6102fa565b6100f5610178366004610499565b610374565b3360008181526001602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906101d89086815260200190565b60405180910390a35060015b92915050565b60006101f960026000196104e2565b905090565b60008161020b8533610374565b6102159190610504565b6001600160a01b038516600090815260016020908152604080832033845290915290205581610243856102c6565b61024d9190610504565b6001600160a01b03851660009081526020819052604090205581610270846102c6565b61027a9190610517565b6001600160a01b0384811660008181526020818152604091829020949094555185815290929187169160008051602061052b833981519152910160405180910390a35060019392505050565b6001600160a01b0381166000908152602081905260408120548082036101e4576102f360026000196104e2565b9392505050565b600081610306336102c6565b6103109190610504565b33600081815260208190526040902091909155829061032e906102c6565b6103389190610517565b6001600160a01b0384166000818152602081815260409182902093909355518481529091339160008051602061052b83398151915291016101d8565b6001600160a01b0380831660009081526001602090815260408083209385168352929052908120548082036102f3576000199150506101e4565b600060208083528351808285015260005b818110156103db578581018301518582016040015282016103bf565b506000604082860101526040601f19601f8301168501019250505092915050565b80356001600160a01b038116811461041357600080fd5b919050565b6000806040838503121561042b57600080fd5b610434836103fc565b946020939093013593505050565b60008060006060848603121561045757600080fd5b610460846103fc565b925061046e602085016103fc565b9150604084013590509250925092565b60006020828403121561049057600080fd5b6102f3826103fc565b600080604083850312156104ac57600080fd5b6104b5836103fc565b91506104c3602084016103fc565b90509250929050565b634e487b7160e01b600052601160045260246000fd5b6000826104ff57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156101e4576101e46104cc565b808201808211156101e4576101e46104cc56feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212207e80951b693900018ccbef67c898d93845d4dd2e0d8bee24a96e72ecb4b5a8bd64736f6c63430008140033"; + +export const CHAIN_ID_PREFERRED_DEPOSIT_TOKEN: Record = { + [ARBITRUM_SEPOLIA]: "0x3253a335E7bFfB4790Aa4C25C4250d206E9b9773", // USDC.SG + [ARBITRUM]: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831", // USDC + [AVALANCHE]: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E", // USDC +}; + +export const MULTICHAIN_FUNDING_SLIPPAGE_BPS = 50; + +export const StargateErrorsAbi = _StargateErrorsAbi as readonly (Abi[number] & JsonFragment)[]; + +export const CHAIN_ID_TO_ENDPOINT_ID: Record = { + [ARBITRUM_SEPOLIA]: 40231, + [SOURCE_SEPOLIA]: 40161, + [SOURCE_OPTIMISM_SEPOLIA]: 40232, + [ARBITRUM]: 30110, + [SOURCE_BASE_MAINNET]: 30184, + [AVALANCHE]: 30106, +}; + +export const ENDPOINT_ID_TO_CHAIN_ID: Partial> = + mapValues(invert(CHAIN_ID_TO_ENDPOINT_ID), (value) => parseInt(value)); + +export const FAKE_INPUT_AMOUNT_MAP: Record = { + "USDC.SG": numberToBigint(1, getTokenBySymbol(ARBITRUM_SEPOLIA, "USDC.SG").decimals), + ETH: numberToBigint(0.0015, getTokenBySymbol(ARBITRUM_SEPOLIA, "ETH").decimals), + USDC: numberToBigint(1, getTokenBySymbol(ARBITRUM, "USDC").decimals), +}; + +export const RANDOM_SLOT = "0x23995301f0ea59f7cace2ae906341fc4662f3f5d23f124431ee3520d1070148c"; diff --git a/src/config/static/markets.ts b/src/config/static/markets.ts index b81da6c070..9f7b08f3fe 100644 --- a/src/config/static/markets.ts +++ b/src/config/static/markets.ts @@ -6,7 +6,7 @@ */ import { MARKETS as SDK_MARKETS } from "sdk/configs/markets"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiContractsChain } from "./chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "./chains"; type MarketUiConfig = { enabled: boolean; @@ -16,7 +16,7 @@ type MarketUiConfig = { ATTENTION When adding new markets, please add them also to the end of the list in ./sortedMarkets.ts */ -const MARKETS_UI_CONFIGS: Record> = { +const MARKETS_UI_CONFIGS: Record> = { [ARBITRUM]: { // BTC/USD [WBTC.e-USDC] "0x47c031236e19d024b42f8AE6780E44A573170703": { @@ -571,6 +571,28 @@ const MARKETS_UI_CONFIGS: Record({ + chainId: initialChainId, + srcChainId: isSourceChain(realChainId) ? realChainId : undefined, + isConnectedToChainId: false, +}); + +export function ChainContextProvider({ children }: PropsWithChildren) { + const [gmxAccountSettlementChainId] = useGmxAccountSettlementChainId(); + + const { chainId, srcChainId, isConnectedToChainId } = useChainIdImpl(gmxAccountSettlementChainId); + + const value = useMemo( + () => ({ + chainId, + srcChainId, + isConnectedToChainId, + }), + [chainId, srcChainId, isConnectedToChainId] + ); + + return {children}; +} + +export const useChainContext = () => useContext(context); diff --git a/src/context/ExpressNoncesContext/ExpressNoncesContextProvider.tsx b/src/context/ExpressNoncesContext/ExpressNoncesContextProvider.tsx deleted file mode 100644 index 97e6eed451..0000000000 --- a/src/context/ExpressNoncesContext/ExpressNoncesContextProvider.tsx +++ /dev/null @@ -1,155 +0,0 @@ -import { createContext, useCallback, useContext, useMemo, useState } from "react"; - -import { useSubaccountContext } from "context/SubaccountContext/SubaccountContextProvider"; -import { getExpressContractAddress } from "domain/synthetics/express"; -import { useChainId } from "lib/chains"; -import { useMulticall } from "lib/multicall"; -import { FREQUENT_UPDATE_INTERVAL } from "lib/timeConstants"; -import useWallet from "lib/wallets/useWallet"; - -export type NoncesData = { - relayRouter: { - nonce: bigint; - lastEstimated: number; - }; - subaccountRelayRouter?: { - nonce: bigint; - lastEstimated: number; - }; -}; - -export type LocalActions = { - relayRouter: { - actions: bigint; - lastEstimated: number; - }; - subaccountRelayRouter: { - actions: bigint; - lastEstimated: number; - }; -}; - -const defaultLocalActions: LocalActions = { - relayRouter: { - actions: 0n, - lastEstimated: 0, - }, - subaccountRelayRouter: { - actions: 0n, - lastEstimated: 0, - }, -}; - -type ExpressNoncesContextType = { - noncesData?: NoncesData; - refreshNonces: () => void; - updateLocalAction: (action: keyof LocalActions, actions: bigint) => void; -}; - -const ExpressNoncesContext = createContext(undefined); - -export function ExpressNoncesContextProvider({ children }: { children: React.ReactNode }) { - const { chainId } = useChainId(); - const { account } = useWallet(); - const { subaccount } = useSubaccountContext(); - const [localActions, setLocalActions] = useState(defaultLocalActions); - - const { data: onChainData, mutate } = useMulticall(chainId, "expressNonces-context", { - refreshInterval: FREQUENT_UPDATE_INTERVAL, - key: account && [account, subaccount?.address], - request: { - relayRouter: { - contractAddress: getExpressContractAddress(chainId, { isSubaccount: false }), - abiId: "GelatoRelayRouter", - calls: { - nonce: { - methodName: "userNonces", - params: [account], - }, - }, - }, - subaccountRelayRouter: { - contractAddress: getExpressContractAddress(chainId, { isSubaccount: true }), - abiId: "SubaccountGelatoRelayRouter", - calls: { - nonce: subaccount?.address - ? { - methodName: "userNonces", - params: [subaccount?.address], - } - : undefined, - }, - }, - }, - - parseResponse: (result) => { - const relayRouterNonce = result.data.relayRouter.nonce.returnValues[0]; - const subaccountRelayRouterNonce = result.data.subaccountRelayRouter?.nonce?.returnValues[0]; - - const now = Date.now(); - - setLocalActions(defaultLocalActions); - - return { - relayRouter: { - nonce: relayRouterNonce, - lastEstimated: now, - }, - subaccountRelayRouter: subaccountRelayRouterNonce - ? { - nonce: subaccountRelayRouterNonce, - lastEstimated: now, - } - : undefined, - }; - }, - }); - - const updateLocalAction = useCallback((action: keyof LocalActions, actions: bigint) => { - setLocalActions((old) => ({ - ...old, - [action]: { - actions, - lastEstimated: Date.now(), - }, - })); - }, []); - - const value = useMemo(() => { - let result: NoncesData | undefined; - - if (onChainData) { - result = { ...onChainData }; - - if (localActions.relayRouter.lastEstimated > result.relayRouter.lastEstimated) { - result.relayRouter.nonce += localActions.relayRouter.actions; - result.relayRouter.lastEstimated = localActions.relayRouter.lastEstimated; - } - - if ( - result.subaccountRelayRouter && - localActions.subaccountRelayRouter.lastEstimated > result.subaccountRelayRouter.lastEstimated - ) { - result.subaccountRelayRouter.nonce += localActions.subaccountRelayRouter.actions; - result.subaccountRelayRouter.lastEstimated = localActions.subaccountRelayRouter.lastEstimated; - } - } - - return { - noncesData: result, - updateLocalAction, - refreshNonces: mutate, - }; - }, [localActions, mutate, onChainData, updateLocalAction]); - - return {children}; -} - -export function useExpressNonces() { - const context = useContext(ExpressNoncesContext); - - if (!context) { - throw new Error("useExpressNonces must be used within ExpressNoncesContextProvider"); - } - return context; -} diff --git a/src/context/GmxAccountContext/GmxAccountContext.tsx b/src/context/GmxAccountContext/GmxAccountContext.tsx new file mode 100644 index 0000000000..e9a37a2cd6 --- /dev/null +++ b/src/context/GmxAccountContext/GmxAccountContext.tsx @@ -0,0 +1,260 @@ +import { t } from "@lingui/macro"; +import { PropsWithChildren, useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useHistory, useLocation } from "react-router-dom"; +import { createContext } from "use-context-selector"; +import { useAccount } from "wagmi"; + +import { isDevelopment } from "config/env"; +import { + IS_SOURCE_BASE_ALLOWED_KEY, + IS_SOURCE_BASE_ALLOWED_NOTIFICATION_SHOWN_KEY, + SELECTED_NETWORK_LOCAL_STORAGE_KEY, + SELECTED_SETTLEMENT_CHAIN_ID_KEY, +} from "config/localStorage"; +import { + DEFAULT_SETTLEMENT_CHAIN_ID_MAP, + IS_SOURCE_BASE_ALLOWED, + MULTICHAIN_TOKEN_MAPPING, + isSettlementChain, + isSourceChain, +} from "config/multichain"; +import { helperToast } from "lib/helperToast"; +import { useLocalStorageSerializeKey } from "lib/localStorage"; +import { ARBITRUM, ARBITRUM_SEPOLIA, SettlementChainId, SourceChainId } from "sdk/configs/chains"; + +export type GmxAccountModalView = + | "main" + | "availableToTradeAssets" + | "transferDetails" + | "deposit" + | "selectAssetToDeposit" + | "withdraw"; + +export type GmxAccountContext = { + modalOpen: boolean | GmxAccountModalView; + setModalOpen: (v: boolean | GmxAccountModalView) => void; + + settlementChainId: SettlementChainId; + setSettlementChainId: (chainId: SettlementChainId) => void; + + // deposit view + + depositViewChain: SourceChainId | undefined; + setDepositViewChain: (chain: SourceChainId | undefined) => void; + + depositViewTokenAddress: string | undefined; + setDepositViewTokenAddress: (address: string | undefined) => void; + + depositViewTokenInputValue: string | undefined; + setDepositViewTokenInputValue: (value: string | undefined) => void; + + // withdraw view + + withdrawalViewChain: SourceChainId | undefined; + setWithdrawalViewChain: (chain: SourceChainId | undefined) => void; + + withdrawalViewTokenAddress: string | undefined; + setWithdrawalViewTokenAddress: (address: string | undefined) => void; + + withdrawalViewTokenInputValue: string | undefined; + setWithdrawalViewTokenInputValue: (value: string | undefined) => void; + + // funding history + + selectedTransferGuid: string | undefined; + setSelectedTransferGuid: React.Dispatch>; +}; + +export const context = createContext(null); + +const DEFAULT_SETTLEMENT_CHAIN_ID: SettlementChainId = isDevelopment() ? ARBITRUM_SEPOLIA : ARBITRUM; + +const getSettlementChainIdFromLocalStorage = () => { + const settlementChainIdFromLocalStorage = localStorage.getItem(SELECTED_SETTLEMENT_CHAIN_ID_KEY); + + if (settlementChainIdFromLocalStorage) { + const settlementChainId = parseInt(settlementChainIdFromLocalStorage); + if (isSettlementChain(settlementChainId)) { + return settlementChainId; + } + } + + const unsanitizedChainId = localStorage.getItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY); + + if (!unsanitizedChainId) { + return DEFAULT_SETTLEMENT_CHAIN_ID; + } + + const chainIdFromLocalStorage = parseInt(unsanitizedChainId); + + if (!isSettlementChain(chainIdFromLocalStorage)) { + return DEFAULT_SETTLEMENT_CHAIN_ID; + } + + return chainIdFromLocalStorage; +}; + +export function GmxAccountContextProvider({ children }: PropsWithChildren) { + const { chainId: walletChainId } = useAccount(); + useMultichainUrlEnabled(); + + const [modalOpen, setModalOpen] = useState(false); + + const [settlementChainId, setSettlementChainId] = useState( + getSettlementChainIdFromLocalStorage() + ); + + const handleSetSettlementChainId = useCallback((chainId: SettlementChainId) => { + setSettlementChainId(chainId); + localStorage.setItem(SELECTED_SETTLEMENT_CHAIN_ID_KEY, chainId.toString()); + }, []); + + const [depositViewChain, setDepositViewChain] = useState(undefined); + const [depositViewTokenAddress, setDepositViewTokenAddress] = + useState(undefined); + const [depositViewTokenInputValue, setDepositViewTokenInputValue] = + useState(undefined); + + const [withdrawalViewChain, setWithdrawalViewChain] = useState(undefined); + const [withdrawalViewTokenAddress, setWithdrawalViewTokenAddress] = + useState(undefined); + const [withdrawalViewTokenInputValue, setWithdrawalViewTokenInputValue] = + useState(undefined); + + const [selectedTransferGuid, setSelectedTransferGuid] = + useState(undefined); + + const handleSetModalOpen = useCallback((newModalOpen: boolean | GmxAccountModalView) => { + setModalOpen(newModalOpen); + + if (newModalOpen === false) { + setDepositViewChain(undefined); + setDepositViewTokenAddress(undefined); + setDepositViewTokenInputValue(undefined); + + setWithdrawalViewTokenAddress(undefined); + setWithdrawalViewTokenInputValue(undefined); + + setSelectedTransferGuid(undefined); + } + }, []); + + useEffect(() => { + let probableSourceChain: SourceChainId | undefined = walletChainId as SourceChainId | undefined; + if (walletChainId === undefined) { + const unsanitizedChainId = localStorage.getItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY); + if (!unsanitizedChainId) { + return; + } + + const chainIdFromLocalStorage = parseInt(unsanitizedChainId); + + if (!isSourceChain(chainIdFromLocalStorage)) { + return; + } + + probableSourceChain = chainIdFromLocalStorage; + } + + if (!isSourceChain(probableSourceChain)) { + return; + } + + const areChainsRelated = + Object.keys(MULTICHAIN_TOKEN_MAPPING[settlementChainId]?.[probableSourceChain] || {}).length > 0; + + if (settlementChainId === undefined || !areChainsRelated) { + handleSetSettlementChainId(DEFAULT_SETTLEMENT_CHAIN_ID_MAP[probableSourceChain] ?? DEFAULT_SETTLEMENT_CHAIN_ID); + } + }, [handleSetSettlementChainId, settlementChainId, walletChainId]); + + const value = useMemo( + () => ({ + modalOpen, + setModalOpen: handleSetModalOpen, + + settlementChainId, + setSettlementChainId: handleSetSettlementChainId, + + // deposit view + + depositViewChain, + setDepositViewChain, + depositViewTokenAddress, + setDepositViewTokenAddress, + depositViewTokenInputValue, + setDepositViewTokenInputValue, + + // withdraw view + + withdrawalViewChain, + setWithdrawalViewChain, + withdrawalViewTokenAddress, + setWithdrawalViewTokenAddress, + withdrawalViewTokenInputValue, + setWithdrawalViewTokenInputValue, + + // funding history + + selectedTransferGuid, + setSelectedTransferGuid, + }), + [ + modalOpen, + handleSetModalOpen, + settlementChainId, + handleSetSettlementChainId, + depositViewChain, + depositViewTokenAddress, + depositViewTokenInputValue, + withdrawalViewChain, + withdrawalViewTokenAddress, + withdrawalViewTokenInputValue, + selectedTransferGuid, + ] + ); + + return {children}; +} + +function useMultichainUrlEnabled() { + const history = useHistory(); + const location = useLocation(); + const isReloadingRef = useRef(false); + + const [isSourceBaseAllowedNotificationShown, setIsSourceBaseAllowedNotificationShown] = useLocalStorageSerializeKey( + IS_SOURCE_BASE_ALLOWED_NOTIFICATION_SHOWN_KEY, + false + ); + + useEffect(() => { + if (isReloadingRef.current) { + return; + } + + const query = new URLSearchParams(location.search); + + const param = query.get(IS_SOURCE_BASE_ALLOWED_KEY); + + if (param) { + query.delete(IS_SOURCE_BASE_ALLOWED_KEY); + history.replace({ search: query.toString() }); + if (param === "1" && !IS_SOURCE_BASE_ALLOWED) { + localStorage.setItem(IS_SOURCE_BASE_ALLOWED_KEY, "1"); + + isReloadingRef.current = true; + window.location.reload(); + } else if (param === "0" && IS_SOURCE_BASE_ALLOWED) { + localStorage.removeItem(IS_SOURCE_BASE_ALLOWED_KEY); + setIsSourceBaseAllowedNotificationShown(false); + isReloadingRef.current = true; + window.location.reload(); + } + } else if (IS_SOURCE_BASE_ALLOWED && !isSourceBaseAllowedNotificationShown) { + setIsSourceBaseAllowedNotificationShown(true); + setTimeout(() => { + helperToast.success(t`Source Base is now available on GMX`); + }, 2000); + } + }, [history, isSourceBaseAllowedNotificationShown, location.search, setIsSourceBaseAllowedNotificationShown]); +} diff --git a/src/context/GmxAccountContext/hooks.ts b/src/context/GmxAccountContext/hooks.ts new file mode 100644 index 0000000000..06cd009c9e --- /dev/null +++ b/src/context/GmxAccountContext/hooks.ts @@ -0,0 +1,93 @@ +import { Context, useContextSelector } from "use-context-selector"; + +import { GmxAccountContext, context } from "./GmxAccountContext"; +import { + selectGmxAccountDepositViewChain, + selectGmxAccountDepositViewTokenAddress, + selectGmxAccountDepositViewTokenInputValue, + selectGmxAccountModalOpen, + selectGmxAccountSelectedTransferGuid, + selectGmxAccountSetDepositViewChain, + selectGmxAccountSetDepositViewTokenAddress, + selectGmxAccountSetDepositViewTokenInputValue, + selectGmxAccountSetModalOpen, + selectGmxAccountSetSelectedTransferGuid, + selectGmxAccountSetSettlementChainId, + selectGmxAccountsetWithdrawalViewChain, + selectGmxAccountSetWithdrawalViewTokenAddress, + selectGmxAccountSetWithdrawalViewTokenInputValue, + selectGmxAccountSettlementChainId, + selectGmxAccountWithdrawalViewChain, + selectGmxAccountWithdrawalViewTokenAddress, + selectGmxAccountWithdrawalViewTokenInputValue, +} from "./selectors"; + +export function useGmxAccountSelector(selector: (s: GmxAccountContext) => Selected) { + return useContextSelector(context as Context, selector) as Selected; +} + +export function useGmxAccountModalOpen() { + return [ + useGmxAccountSelector(selectGmxAccountModalOpen), + useGmxAccountSelector(selectGmxAccountSetModalOpen), + ] as const; +} + +/** + * If you just need the settlement chain id and not updating it, use `useChainId` instead + */ +export function useGmxAccountSettlementChainId() { + return [ + useGmxAccountSelector(selectGmxAccountSettlementChainId), + useGmxAccountSelector(selectGmxAccountSetSettlementChainId), + ] as const; +} + +export function useGmxAccountDepositViewChain() { + return [ + useGmxAccountSelector(selectGmxAccountDepositViewChain), + useGmxAccountSelector(selectGmxAccountSetDepositViewChain), + ] as const; +} + +export function useGmxAccountDepositViewTokenAddress() { + return [ + useGmxAccountSelector(selectGmxAccountDepositViewTokenAddress), + useGmxAccountSelector(selectGmxAccountSetDepositViewTokenAddress), + ] as const; +} + +export function useGmxAccountDepositViewTokenInputValue() { + return [ + useGmxAccountSelector(selectGmxAccountDepositViewTokenInputValue), + useGmxAccountSelector(selectGmxAccountSetDepositViewTokenInputValue), + ] as const; +} + +export function useGmxAccountWithdrawalViewChain() { + return [ + useGmxAccountSelector(selectGmxAccountWithdrawalViewChain), + useGmxAccountSelector(selectGmxAccountsetWithdrawalViewChain), + ] as const; +} + +export function useGmxAccountWithdrawalViewTokenAddress() { + return [ + useGmxAccountSelector(selectGmxAccountWithdrawalViewTokenAddress), + useGmxAccountSelector(selectGmxAccountSetWithdrawalViewTokenAddress), + ] as const; +} + +export function useGmxAccountWithdrawalViewTokenInputValue() { + return [ + useGmxAccountSelector(selectGmxAccountWithdrawalViewTokenInputValue), + useGmxAccountSelector(selectGmxAccountSetWithdrawalViewTokenInputValue), + ] as const; +} + +export function useGmxAccountSelectedTransferGuid() { + return [ + useGmxAccountSelector(selectGmxAccountSelectedTransferGuid), + useGmxAccountSelector(selectGmxAccountSetSelectedTransferGuid), + ] as const; +} diff --git a/src/context/GmxAccountContext/selectors.ts b/src/context/GmxAccountContext/selectors.ts new file mode 100644 index 0000000000..dbb0f5535a --- /dev/null +++ b/src/context/GmxAccountContext/selectors.ts @@ -0,0 +1,61 @@ +import { createSelectionContext } from "@taskworld.com/rereselect"; + +import { getToken } from "sdk/configs/tokens"; +import { parseValue } from "sdk/utils/numbers"; + +import type { GmxAccountContext } from "./GmxAccountContext"; + +//#region Pure selectors + +export const selectGmxAccountModalOpen = (s: GmxAccountContext) => s.modalOpen; +export const selectGmxAccountSetModalOpen = (s: GmxAccountContext) => s.setModalOpen; + +export const selectGmxAccountSettlementChainId = (s: GmxAccountContext) => s.settlementChainId; +export const selectGmxAccountSetSettlementChainId = (s: GmxAccountContext) => s.setSettlementChainId; + +export const selectGmxAccountDepositViewChain = (s: GmxAccountContext) => s.depositViewChain; +export const selectGmxAccountSetDepositViewChain = (s: GmxAccountContext) => s.setDepositViewChain; +export const selectGmxAccountDepositViewTokenAddress = (s: GmxAccountContext) => s.depositViewTokenAddress; +export const selectGmxAccountSetDepositViewTokenAddress = (s: GmxAccountContext) => s.setDepositViewTokenAddress; +export const selectGmxAccountDepositViewTokenInputValue = (s: GmxAccountContext) => s.depositViewTokenInputValue; +export const selectGmxAccountSetDepositViewTokenInputValue = (s: GmxAccountContext) => s.setDepositViewTokenInputValue; + +export const selectGmxAccountWithdrawalViewChain = (s: GmxAccountContext) => s.withdrawalViewChain; +export const selectGmxAccountsetWithdrawalViewChain = (s: GmxAccountContext) => s.setWithdrawalViewChain; +export const selectGmxAccountWithdrawalViewTokenAddress = (s: GmxAccountContext) => s.withdrawalViewTokenAddress; +export const selectGmxAccountSetWithdrawalViewTokenAddress = (s: GmxAccountContext) => s.setWithdrawalViewTokenAddress; +export const selectGmxAccountWithdrawalViewTokenInputValue = (s: GmxAccountContext) => s.withdrawalViewTokenInputValue; +export const selectGmxAccountSetWithdrawalViewTokenInputValue = (s: GmxAccountContext) => + s.setWithdrawalViewTokenInputValue; + +export const selectGmxAccountSelectedTransferGuid = (s: GmxAccountContext) => s.selectedTransferGuid; +export const selectGmxAccountSetSelectedTransferGuid = (s: GmxAccountContext) => s.setSelectedTransferGuid; + +//#endregion Pure selectors + +//#region Derived selectors + +const selectionContext = createSelectionContext(); +const createSelector = selectionContext.makeSelector; + +export const selectGmxAccountDepositViewTokenInputAmount = createSelector((q) => { + const settlementChainId = q(selectGmxAccountSettlementChainId); + + const tokenAddress = q(selectGmxAccountDepositViewTokenAddress); + + if (tokenAddress === undefined) { + return undefined; + } + + const inputValue = q(selectGmxAccountDepositViewTokenInputValue); + + if (inputValue === undefined) { + return undefined; + } + + const token = getToken(settlementChainId, tokenAddress); + + return parseValue(inputValue, token.decimals); +}); + +//#endregion Derived selectors diff --git a/src/context/GmxAccountContext/useOpenMultichainDepositModal.tsx b/src/context/GmxAccountContext/useOpenMultichainDepositModal.tsx new file mode 100644 index 0000000000..3c90425a14 --- /dev/null +++ b/src/context/GmxAccountContext/useOpenMultichainDepositModal.tsx @@ -0,0 +1,25 @@ +import { useCallback } from "react"; + +import type { SourceChainId } from "config/chains"; +import { + useGmxAccountDepositViewChain, + useGmxAccountDepositViewTokenAddress, + useGmxAccountModalOpen, +} from "context/GmxAccountContext/hooks"; + +export function useOpenMultichainDepositModal(): (tokenAddress: string, chainId: SourceChainId) => void { + const [, setIsVisibleOrView] = useGmxAccountModalOpen(); + const [, setDepositViewChain] = useGmxAccountDepositViewChain(); + const [, setDepositViewTokenAddress] = useGmxAccountDepositViewTokenAddress(); + + const onDepositTokenAddress = useCallback( + (tokenAddress: string, chainId: SourceChainId) => { + setDepositViewChain(chainId); + setDepositViewTokenAddress(tokenAddress); + setIsVisibleOrView("deposit"); + }, + [setDepositViewChain, setDepositViewTokenAddress, setIsVisibleOrView] + ); + + return onDepositTokenAddress; +} diff --git a/src/context/JsonRpcProviderContext/JsonRpcProviderContext.tsx b/src/context/JsonRpcProviderContext/JsonRpcProviderContext.tsx new file mode 100644 index 0000000000..0815508044 --- /dev/null +++ b/src/context/JsonRpcProviderContext/JsonRpcProviderContext.tsx @@ -0,0 +1,77 @@ +// TODO: use this sometime in the future + +import { JsonRpcProvider } from "ethers"; +import mapValues from "lodash/mapValues"; +import { createContext, PropsWithChildren, useCallback, useContext, useEffect, useMemo, useState } from "react"; +import { useLatest } from "react-use"; + +import { RPC_PROVIDERS, CONTRACTS_CHAIN_IDS } from "config/chains"; +import { SOURCE_CHAINS } from "config/multichain"; +import { EMPTY_OBJECT } from "lib/objects"; +import { getCurrentRpcUrls, RPC_TRACKER_UPDATE_EVENT } from "lib/rpc/bestRpcTracker"; +import { AnyChainId } from "sdk/configs/chains"; + +export type JsonRpcProviderContext = { + providers: Partial>; +}; + +export const context = createContext({ + providers: EMPTY_OBJECT, +}); + +export function JsonRpcProviderContext({ children }: PropsWithChildren) { + const [providers, setProviders] = + useState>>(EMPTY_OBJECT); + + const handleRpcUpdate = useCallback(() => { + for (const listenedChainId of CONTRACTS_CHAIN_IDS) { + const { primary } = getCurrentRpcUrls(listenedChainId); + + if (providers[listenedChainId]?.url === primary) continue; + + const provider = new JsonRpcProvider(primary, listenedChainId); + provider._start(); + provider._waitUntilReady().then(() => { + setProviders((prev) => ({ ...prev, [listenedChainId]: { provider, url: primary } })); + }); + } + + for (const listenedSourceChainId of SOURCE_CHAINS) { + const url = RPC_PROVIDERS[listenedSourceChainId]?.[0]; + if (url) { + if (providers[listenedSourceChainId]?.url !== url) { + const provider = new JsonRpcProvider(url, listenedSourceChainId); + provider._start(); + provider._waitUntilReady().then(() => { + setProviders((prev) => ({ ...prev, [listenedSourceChainId]: { provider, url } })); + }); + } + } + } + }, [providers]); + + const latestHandleRpcUpdate = useLatest(handleRpcUpdate); + + useEffect(() => { + const handler = latestHandleRpcUpdate.current; + handler(); + window.addEventListener(RPC_TRACKER_UPDATE_EVENT, handler); + + return () => { + window.removeEventListener(RPC_TRACKER_UPDATE_EVENT, handler); + }; + }, [latestHandleRpcUpdate]); + + const value = useMemo(() => { + return { + providers: mapValues(providers, (item) => item?.provider), + }; + }, [providers]); + + return {children}; +} + +export function useJsonRpcProvider(chainId: AnyChainId): { provider: JsonRpcProvider | undefined } { + const { providers } = useContext(context); + return { provider: providers[chainId]?.provider }; +} diff --git a/src/context/PendingTxnsContext/PendingTxnsContext.tsx b/src/context/PendingTxnsContext/PendingTxnsContext.tsx index c0f2e27959..d516287a98 100644 --- a/src/context/PendingTxnsContext/PendingTxnsContext.tsx +++ b/src/context/PendingTxnsContext/PendingTxnsContext.tsx @@ -8,8 +8,8 @@ import { parseError } from "lib/errors"; import { getCallStaticError } from "lib/errors/additionalValidation"; import { helperToast } from "lib/helperToast"; import { OrderMetricId, sendTxnErrorMetric } from "lib/metrics"; +import { useJsonRpcProvider } from "lib/rpc"; import { sendUserAnalyticsOrderResultEvent } from "lib/userAnalytics"; -import { useEthersSigner } from "lib/wallets/useEthersSigner"; import { getInsufficientExecutionFeeToastContent } from "components/Errors/errorToasts"; import ExternalLink from "components/ExternalLink/ExternalLink"; @@ -44,32 +44,32 @@ export function usePendingTxns() { } export function PendingTxnsContextProvider({ children }: { children: ReactNode }) { - const signer = useEthersSigner(); const { chainId } = useChainId(); + const { provider } = useJsonRpcProvider(chainId); const { setIsSettingsVisible, executionFeeBufferBps } = useSettings(); const [pendingTxns, setPendingTxns] = useState([]); useEffect(() => { const checkPendingTxns = async () => { - if (!signer) { + if (!provider) { return; } const updatedPendingTxns: any[] = []; for (let i = 0; i < pendingTxns.length; i++) { const pendingTxn = pendingTxns[i]; - const receipt = await signer.provider.getTransactionReceipt(pendingTxn.hash); + const receipt = await provider.getTransactionReceipt(pendingTxn.hash); if (receipt) { if (receipt.status === 0) { const txUrl = getExplorerUrl(chainId) + "tx/" + pendingTxn.hash; const { error: onchainError, txnData } = await getCallStaticError( chainId, - signer.provider, + provider, undefined, pendingTxn.hash ); - const errorData = onchainError ? parseError(onchainError) : undefined; + const errorData = onchainError ? parseError(onchainError as any) : undefined; let toastMsg: ReactNode; @@ -139,7 +139,7 @@ export function PendingTxnsContextProvider({ children }: { children: ReactNode } checkPendingTxns(); }, 2 * 1000); return () => clearInterval(interval); - }, [signer, pendingTxns, chainId, setIsSettingsVisible, executionFeeBufferBps]); + }, [provider, pendingTxns, chainId, setIsSettingsVisible, executionFeeBufferBps]); const state = useMemo(() => ({ pendingTxns, setPendingTxns }), [pendingTxns, setPendingTxns]); diff --git a/src/context/SettingsContext/SettingsContextProvider.tsx b/src/context/SettingsContext/SettingsContextProvider.tsx index e232f9d893..b82e76aec4 100644 --- a/src/context/SettingsContext/SettingsContextProvider.tsx +++ b/src/context/SettingsContext/SettingsContextProvider.tsx @@ -28,6 +28,7 @@ import { useLocalStorageByChainId, useLocalStorageSerializeKey } from "lib/local import { tenderlyLsKeys } from "lib/tenderly"; import useWallet from "lib/wallets/useWallet"; import { getDefaultGasPaymentToken } from "sdk/configs/express"; +import { isValidTokenSafe } from "sdk/configs/tokens"; import { DEFAULT_TWAP_NUMBER_OF_PARTS } from "sdk/configs/twap"; export type SettingsContextType = { @@ -96,8 +97,9 @@ export function useSettings() { } export function SettingsContextProvider({ children }: { children: ReactNode }) { + const { chainId, srcChainId } = useChainId(); const { account } = useWallet(); - const { chainId } = useChainId(); + const [isSettingsVisible, setIsSettingsVisible] = useState(false); const [showDebugValues, setShowDebugValues] = useLocalStorageSerializeKey(SHOW_DEBUG_VALUES_KEY, false); const [savedAllowedSlippage, setSavedAllowedSlippage] = useLocalStorageSerializeKey( @@ -122,6 +124,7 @@ export function SettingsContextProvider({ children }: { children: ReactNode }) { getExecutionFeeBufferBpsKey(chainId), EXECUTION_FEE_CONFIG_V2[chainId]?.defaultBufferBps ); + const shouldUseExecutionFeeBuffer = Boolean(EXECUTION_FEE_CONFIG_V2[chainId].defaultBufferBps); const [savedShowPnlAfterFees, setSavedShowPnlAfterFees] = useLocalStorageSerializeKey( @@ -166,10 +169,14 @@ export function SettingsContextProvider({ children }: { children: ReactNode }) { false ); - const [gasPaymentTokenAddress, setGasPaymentTokenAddress] = useLocalStorageSerializeKey( + let [gasPaymentTokenAddress, setGasPaymentTokenAddress] = useLocalStorageSerializeKey( getGasPaymentTokenAddressKey(chainId, account), getDefaultGasPaymentToken(chainId) ); + // Reason: useLocalStorageSerializeKey leaks previous value to the next render even if key is changed + if (gasPaymentTokenAddress && !isValidTokenSafe(chainId, gasPaymentTokenAddress)) { + gasPaymentTokenAddress = getDefaultGasPaymentToken(chainId); + } let savedShouldDisableValidationForTesting: boolean | undefined; let setSavedShouldDisableValidationForTesting: (val: boolean) => void; @@ -213,6 +220,15 @@ export function SettingsContextProvider({ children }: { children: ReactNode }) { setHasOverriddenDefaultArb30ExecutionFeeBufferBpsKey, ]); + useEffect( + function fallbackMultichain() { + if (srcChainId && !expressOrdersEnabled) { + setExpressOrdersEnabled(true); + } + }, + [expressOrdersEnabled, setExpressOrdersEnabled, srcChainId] + ); + const contextState: SettingsContextType = useMemo(() => { return { showDebugValues: isDevelopment() ? showDebugValues! : false, diff --git a/src/context/SubaccountContext/SubaccountContextProvider.tsx b/src/context/SubaccountContext/SubaccountContextProvider.tsx index 37279c63c2..cae10836ee 100644 --- a/src/context/SubaccountContext/SubaccountContextProvider.tsx +++ b/src/context/SubaccountContext/SubaccountContextProvider.tsx @@ -3,9 +3,17 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useR import { toast } from "react-toastify"; import { getSubaccountApprovalKey, getSubaccountConfigKey } from "config/localStorage"; +import { selectExpressGlobalParams } from "context/SyntheticsStateContext/selectors/expressSelectors"; +import { selectIsSponsoredCallAvailable } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectTradeboxIsFromTokenGmxAccount } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; +import { useCalcSelector } from "context/SyntheticsStateContext/utils"; +import { removeSubaccountExpressTxn, removeSubaccountWalletTxn } from "domain/synthetics/subaccount"; import { generateSubaccount } from "domain/synthetics/subaccount/generateSubaccount"; -import { removeSubaccountTxn } from "domain/synthetics/subaccount/removeSubaccount"; -import { SignedSubbacountApproval, Subaccount, SubaccountSerializedConfig } from "domain/synthetics/subaccount/types"; +import type { + SignedSubacсountApproval, + Subaccount, + SubaccountSerializedConfig, +} from "domain/synthetics/subaccount/types"; import { useSubaccountOnchainData } from "domain/synthetics/subaccount/useSubaccountOnchainData"; import { getActualApproval, @@ -18,6 +26,8 @@ import { useChainId } from "lib/chains"; import { helperToast } from "lib/helperToast"; import { useLocalStorageSerializeKey } from "lib/localStorage"; import { metrics } from "lib/metrics"; +import { useJsonRpcProvider } from "lib/rpc"; +import { useEthersSigner } from "lib/wallets/useEthersSigner"; import useWallet from "lib/wallets/useWallet"; import { StatusNotification } from "components/Synthetics/StatusNotification/StatusNotification"; @@ -42,7 +52,10 @@ export type SubaccountState = { subaccount: Subaccount | undefined; subaccountActivationState: SubaccountActivationState | undefined; subaccountDeactivationState: SubaccountDeactivationState | undefined; - updateSubaccountSettings: (params: { nextRemainigActions?: bigint; nextRemainingSeconds?: bigint }) => Promise; + updateSubaccountSettings: (params: { + nextRemainigActions?: bigint; + nextRemainingSeconds?: bigint; + }) => Promise; resetSubaccountApproval: () => void; tryEnableSubaccount: () => Promise; tryDisableSubaccount: () => Promise; @@ -60,8 +73,10 @@ export function useSubaccountContext() { } export function SubaccountContextProvider({ children }: { children: React.ReactNode }) { - const { chainId } = useChainId(); - const { signer } = useWallet(); + const { chainId, srcChainId } = useChainId(); + const signer = useEthersSigner(); + const { account } = useWallet(); + const { provider } = useJsonRpcProvider(chainId); const { subaccountConfig, @@ -83,6 +98,7 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN const { subaccountData, refreshSubaccountData } = useSubaccountOnchainData(chainId, { account: signer?.address, subaccountAddress: subaccountConfig?.address, + srcChainId, }); const subaccount: Subaccount | undefined = useMemo(() => { @@ -92,23 +108,28 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN const subaccountSigner = getSubaccountSigner(subaccountConfig, signer?.address, signer?.provider); - const composedSubbacount: Subaccount = { + const composedSubacсount: Subaccount = { address: subaccountConfig.address, signer: subaccountSigner, onchainData: subaccountData, signedApproval: getActualApproval({ + chainId, address: subaccountConfig.address, onchainData: subaccountData, signedApproval, }), + chainId, + signerChainId: srcChainId ?? chainId, }; - if (!getIsSubaccountActive(composedSubbacount)) { + if (!getIsSubaccountActive(composedSubacсount)) { return undefined; } - return composedSubbacount; - }, [signedApproval, signer?.address, signer?.provider, subaccountConfig, subaccountData]); + return composedSubacсount; + }, [chainId, signedApproval, signer?.address, signer?.provider, srcChainId, subaccountConfig, subaccountData]); + + const calcSelector = useCalcSelector(); const updateSubaccountSettings = useCallback( async function updateSubaccountSettings({ @@ -117,9 +138,9 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN }: { nextRemainigActions?: bigint; nextRemainingSeconds?: bigint; - }) { - if (!signer || !subaccount?.address) { - return; + }): Promise { + if (!signer || !subaccount?.address || !provider) { + return false; } helperToast.success( @@ -128,13 +149,17 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN ); + const isGmxAccount = calcSelector(selectTradeboxIsFromTokenGmxAccount); + try { const signedSubaccountApproval = await signUpdatedSubaccountSettings({ chainId, signer, + provider, subaccount, nextRemainigActions, nextRemainingSeconds, + isGmxAccount, }); helperToast.success( @@ -143,6 +168,7 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN ); setSignedApproval(signedSubaccountApproval); + return true; } catch (error) { // eslint-disable-next-line no-console console.error(error); @@ -153,18 +179,19 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN ); + return false; } }, - [signer, subaccount, chainId, setSignedApproval] + [signer, subaccount, provider, calcSelector, chainId, setSignedApproval] ); const resetSubaccountApproval = useCallback(() => { - setSignedApproval(undefined); + resetStoredApproval(); refreshSubaccountData(); - }, [refreshSubaccountData, setSignedApproval]); + }, [refreshSubaccountData, resetStoredApproval]); const tryEnableSubaccount = useCallback(async () => { - if (!signer?.provider) { + if (!provider || !signer) { return false; } @@ -204,14 +231,17 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN return false; } + const isGmxAccount = calcSelector(selectTradeboxIsFromTokenGmxAccount); + try { setSubaccountActivationState(SubaccountActivationState.ApprovalSigning); const defaultSubaccountApproval = await getInitialSubaccountApproval({ chainId, signer, - provider: signer?.provider, + provider, subaccountAddress: config!.address, + isGmxAccount, }); setSubaccountActivationState(SubaccountActivationState.Success); @@ -230,10 +260,19 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN metrics.pushError(error, "subaccount.signDefaultApproval"); return false; } - }, [signer, subaccountConfig, setSubaccountConfig, resetStoredConfig, chainId, setSignedApproval]); + }, [ + provider, + signer, + subaccountConfig, + calcSelector, + setSubaccountConfig, + resetStoredConfig, + chainId, + setSignedApproval, + ]); - const tryDisableSubaccount = useCallback(async () => { - if (!signer || !subaccount?.address) { + const tryDisableSubaccount = useCallback(async (): Promise => { + if (!signer || !subaccount?.address || !account) { return false; } @@ -246,8 +285,33 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN setSubaccountDeactivationState(SubaccountDeactivationState.Deactivating); + let removeSubaccount: () => Promise; + + if (srcChainId !== undefined) { + const globalExpressParams = calcSelector(selectExpressGlobalParams); + const isSponsoredCallAvailable = calcSelector(selectIsSponsoredCallAvailable); + + if (!provider || !globalExpressParams) { + return false; + } + + removeSubaccount = () => + removeSubaccountExpressTxn({ + chainId, + provider, + account, + srcChainId, + signer, + subaccount, + globalExpressParams, + isSponsoredCallAvailable, + }); + } else { + removeSubaccount = () => removeSubaccountWalletTxn(chainId, signer, subaccount.address); + } + try { - await removeSubaccountTxn(chainId, signer, subaccount.address); + await removeSubaccount(); setSubaccountDeactivationState(SubaccountDeactivationState.Success); @@ -262,7 +326,18 @@ export function SubaccountContextProvider({ children }: { children: React.ReactN setSubaccountDeactivationState(SubaccountDeactivationState.Error); return false; } - }, [signer, subaccount, chainId, resetStoredApproval, resetStoredConfig, refreshSubaccountData]); + }, [ + signer, + subaccount, + account, + srcChainId, + calcSelector, + provider, + chainId, + resetStoredApproval, + resetStoredConfig, + refreshSubaccountData, + ]); useEffect( function notifySubaccountActivation() { @@ -460,7 +535,7 @@ function useStoredSubaccountData(chainId: number, account: string | undefined) { } ); - const [signedApproval, setSignedApproval] = useLocalStorageSerializeKey( + const [signedApproval, setSignedApproval] = useLocalStorageSerializeKey( getSubaccountApprovalKey(chainId, account), undefined, { @@ -493,15 +568,15 @@ function useStoredSubaccountData(chainId: number, account: string | undefined) { } ); - return useMemo(() => { - function resetStoredApproval() { - setSignedApproval(null as any); - } + const resetStoredApproval = useCallback(() => { + setSignedApproval(null as any); + }, [setSignedApproval]); - function resetStoredConfig() { - setSubaccountConfig(null as any); - } + const resetStoredConfig = useCallback(() => { + setSubaccountConfig(null as any); + }, [setSubaccountConfig]); + return useMemo(() => { return { subaccountConfig, signedApproval, @@ -510,5 +585,12 @@ function useStoredSubaccountData(chainId: number, account: string | undefined) { resetStoredApproval, resetStoredConfig, }; - }, [subaccountConfig, signedApproval, setSubaccountConfig, setSignedApproval]); + }, [ + subaccountConfig, + signedApproval, + setSubaccountConfig, + setSignedApproval, + resetStoredApproval, + resetStoredConfig, + ]); } diff --git a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx index 0b12b9e621..cdddedbdde 100644 --- a/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx +++ b/src/context/SyntheticsEvents/SyntheticsEventsProvider.tsx @@ -1,9 +1,9 @@ import { TaskState } from "@gelatonetwork/relay-sdk"; import { t } from "@lingui/macro"; import { createContext, ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; +import { useLatest } from "react-use"; import { isDevelopment } from "config/env"; -import { useExpressNonces } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useSubaccountContext } from "context/SubaccountContext/SubaccountContextProvider"; import { useTokenPermitsContext } from "context/TokenPermitsContext/TokenPermitsContextProvider"; @@ -26,7 +26,6 @@ import { OrderTxnType, } from "domain/synthetics/orders"; import { getPositionKey } from "domain/synthetics/positions"; -import { getIsEmptySubaccountApproval } from "domain/synthetics/subaccount"; import { useTokensDataRequest } from "domain/synthetics/tokens"; import { getSwapPathOutputAddresses } from "domain/synthetics/trade"; import { useChainId } from "lib/chains"; @@ -89,6 +88,7 @@ import { WithdrawalCreatedEventData, WithdrawalStatuses, } from "./types"; +import { useMultichainEvents } from "./useMultichainEvents"; import { extractGelatoError, getGelatoTaskUrl, getPendingOrderKey } from "./utils"; export const SyntheticsEventsContext = createContext({}); @@ -98,7 +98,7 @@ export function useSyntheticsEvents(): SyntheticsEventsContextType { } export function SyntheticsEventsProvider({ children }: { children: ReactNode }) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const { account: currentAccount } = useWallet(); const provider = getProvider(undefined, chainId); const { wsProvider } = useWebsocketProvider(); @@ -106,9 +106,9 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) const { executionFeeBufferBps, setIsSettingsVisible } = useSettings(); const { resetTokenPermits } = useTokenPermitsContext(); - const { refreshSubaccountData, resetSubaccountApproval } = useSubaccountContext(); - const { tokensData } = useTokensDataRequest(chainId); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { refreshSubaccountData } = useSubaccountContext(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const { glvData } = useGlvMarketsInfo(isGlvEnabled(chainId), { marketsInfoData, @@ -147,7 +147,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) const [pendingExpressTxnParams, setPendingExpressTxnParams] = useState<{ [key: string]: Partial; }>({}); - const { refreshNonces, updateLocalAction } = useExpressNonces(); + const latestPendingExpressTxnParams = useLatest(pendingExpressTxnParams); const eventLogHandlers = useRef({}); const handleExpressTxnSuccess = useCallback( @@ -159,21 +159,22 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) } refreshSubaccountData(); - refreshNonces(); - updateLocalAction(pendingExpressTxn.subaccountApproval ? "subaccountRelayRouter" : "relayRouter", 1n); - - if ( - pendingExpressTxn?.subaccountApproval && - !getIsEmptySubaccountApproval(pendingExpressTxn.subaccountApproval) - ) { - resetSubaccountApproval(); - } + + // TODO MLTCH why was reset there if it does not work with working reset + // if ( + // pendingExpressTxn?.subaccountApproval && + // !getIsEmptySubaccountApproval(pendingExpressTxn.subaccountApproval) + // ) { + // resetSubaccountApproval(); + // } else { + // refreshSubaccountData(); + // } if (pendingExpressTxn?.tokenPermits?.length) { resetTokenPermits(); } }, - [refreshNonces, refreshSubaccountData, resetSubaccountApproval, resetTokenPermits, updateLocalAction] + [refreshSubaccountData, resetTokenPermits] ); const updateNativeTokenBalance = useCallback(() => { @@ -250,7 +251,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) ); const pendingOrderKey = getPendingOrderKey(data); - const pendingExpressTxn = Object.values(pendingExpressTxnParams).find((p) => + const pendingExpressTxn = Object.values(latestPendingExpressTxnParams.current).find((p) => p.pendingOrdersKeys?.includes(pendingOrderKey) ); @@ -1080,6 +1081,10 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) ] ); + const multichainEventsState = useMultichainEvents({ + hasPageLostFocus, + }); + const contextState: SyntheticsEventsContextType = useMemo(() => { return { orderStatuses, @@ -1227,6 +1232,8 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) setShiftStatusViewed(key: string) { setShiftStatuses((old) => updateByKey(old, key, { isViewed: true })); }, + + ...multichainEventsState, }; }, [ orderStatuses, @@ -1240,6 +1247,7 @@ export function SyntheticsEventsProvider({ children }: { children: ReactNode }) positionDecreaseEvents, pendingExpressTxnParams, gelatoTaskStatuses, + multichainEventsState, marketsInfoData, tokensData, glvAndGmMarketsData, diff --git a/src/context/SyntheticsEvents/types.ts b/src/context/SyntheticsEvents/types.ts index 3a156de470..c87aec39c1 100644 --- a/src/context/SyntheticsEvents/types.ts +++ b/src/context/SyntheticsEvents/types.ts @@ -1,11 +1,14 @@ -import { TaskState } from "@gelatonetwork/relay-sdk"; -import { ReactNode } from "react"; +import type { TaskState } from "@gelatonetwork/relay-sdk"; +import type { ReactNode } from "react"; -import { OrderTxnType, OrderType } from "domain/synthetics/orders"; -import { SignedSubbacountApproval } from "domain/synthetics/subaccount"; -import { OrderMetricId } from "lib/metrics/types"; -import { SignedTokenPermit } from "sdk/types/tokens"; -import { ExternalSwapQuote } from "sdk/types/trade"; +import type { MultichainFundingHistoryItem } from "domain/multichain/types"; +import type { OrderTxnType, OrderType } from "domain/synthetics/orders"; +import type { SignedSubacсountApproval } from "domain/synthetics/subaccount"; +import type { OrderMetricId } from "lib/metrics/types"; +import type { SignedTokenPermit } from "sdk/types/tokens"; +import type { ExternalSwapQuote } from "sdk/types/trade"; + +import type { MultichainEventsState } from "./useMultichainEvents"; export type MultiTransactionStatus = { key: string; @@ -77,7 +80,7 @@ export type PendingExpressTxnParams = { key: string; taskId: string | undefined; isSponsoredCall: boolean; - subaccountApproval?: SignedSubbacountApproval; + subaccountApproval?: SignedSubacсountApproval; tokenPermits?: SignedTokenPermit[]; payTokenAddresses?: string[]; pendingOrdersKeys?: string[]; @@ -112,6 +115,23 @@ export type PendingOrdersUpdates = { [key: string]: OrderTxnType; }; +export type SubmittedMultichainDeposit = { + amount: bigint; + settlementChainId: number; + sourceChainId: number; + tokenAddress: string; + sentTxn: string; +}; + +export type SubmittedMultichainWithdrawal = { + amount: bigint; + settlementChainId: number; + sourceChainId: number; + tokenAddress: string; +}; + +export type PendingMultichainFunding = MultichainFundingHistoryItem[]; + export type EventLogItems = { [key: string]: T; }; @@ -144,7 +164,7 @@ export type EventTxnParams = { blockNumber: number; }; -export type SyntheticsEventsContextType = { +export type SyntheticsEventsContextType = MultichainEventsState & { orderStatuses: OrderStatuses; depositStatuses: DepositStatuses; withdrawalStatuses: WithdrawalStatuses; diff --git a/src/context/SyntheticsEvents/useMultichainEvents.ts b/src/context/SyntheticsEvents/useMultichainEvents.ts new file mode 100644 index 0000000000..1fd63f077d --- /dev/null +++ b/src/context/SyntheticsEvents/useMultichainEvents.ts @@ -0,0 +1,1023 @@ +import keyBy from "lodash/keyBy"; +import pickBy from "lodash/pickBy"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { zeroAddress } from "viem"; +import { useAccount } from "wagmi"; + +import { getChainName, SourceChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { CHAIN_ID_TO_TOKEN_ID_MAP, getMappedTokenId, isSettlementChain, MultichainTokenId } from "config/multichain"; +import { ENDPOINT_ID_TO_CHAIN_ID } from "config/multichain"; +import { useGmxAccountSelectedTransferGuid } from "context/GmxAccountContext/hooks"; +import { + subscribeToComposeDeliveredEvents, + subscribeToMultichainApprovalEvents, + subscribeToOftReceivedEvents, + subscribeToOftSentEvents, +} from "context/WebsocketContext/subscribeToEvents"; +import { useWebsocketProvider, useWsAdditionalSourceChains } from "context/WebsocketContext/WebsocketContextProvider"; +import { CodecUiHelper } from "domain/multichain/codecs/CodecUiHelper"; +import { MultichainFundingHistoryItem } from "domain/multichain/types"; +import { isStepGreater } from "domain/multichain/useGmxAccountFundingHistory"; +import { useChainId } from "lib/chains"; +import { + getMultichainDepositMetricId, + getMultichainWithdrawalMetricId, + metrics, + MultichainDepositMetricData, + MultichainWithdrawalMetricData, + sendOrderExecutedMetric, +} from "lib/metrics"; +import { EMPTY_OBJECT } from "lib/objects"; +import { sendMultichainDepositSuccessEvent, sendMultichainWithdrawalSuccessEvent } from "lib/userAnalytics/utils"; +import { getToken } from "sdk/configs/tokens"; +import { LRUCache } from "sdk/utils/LruCache"; +import { nowInSeconds } from "sdk/utils/time"; + +import { useSyntheticsEvents } from "./SyntheticsEventsProvider"; +import type { + ApprovalStatuses, + PendingMultichainFunding, + SubmittedMultichainDeposit, + SubmittedMultichainWithdrawal, +} from "./types"; + +export type MultichainEventsState = { + multichainSourceChainApprovalStatuses: ApprovalStatuses; + setMultichainSourceChainApprovalsActiveListener: (chainId: SourceChainId, name: string) => void; + removeMultichainSourceChainApprovalsActiveListener: (chainId: SourceChainId, name: string) => void; + + pendingMultichainFunding: PendingMultichainFunding; + setMultichainSubmittedDeposit: (submittedDeposit: SubmittedMultichainDeposit) => string | undefined; + setMultichainSubmittedWithdrawal: (submittedWithdrawal: SubmittedMultichainWithdrawal) => string | undefined; + setMultichainWithdrawalSentTxnHash: (mockId: string, txnHash: string) => void; + setMultichainWithdrawalSentError: (mockId: string) => void; + updatePendingMultichainFunding: (items: MultichainFundingHistoryItem[]) => void; + + multichainFundingPendingIds: Record< + // Stub id for persistence + string, + // Stub id or real guid + string + >; + + removeMultichainFundingPendingIds: (id: string | string[]) => void; +}; + +const DEFAULT_MULTICHAIN_FUNDING_STATE: PendingMultichainFunding = []; + +const UNCERTAIN_WITHDRAWALS_CACHE = new LRUCache(1000); + +const FINISHED_FUNDING_ITEM_CLEARING_DELAY_MS = 5000; +const SUBSCRIPTION_MAX_TTL_MS = 5 * 60 * 1000; +const SOURCE_CHAIN_APPROVAL_LISTENER_CLEANUP_DELAY_MS = 1 * 60 * 1000; +const DEBUG_MULTICHAIN_EVENTS_LOGGING = false; + +const debugLog = (...args: any[]) => { + if (DEBUG_MULTICHAIN_EVENTS_LOGGING) { + // eslint-disable-next-line no-console + console.log("[multichain]", ...args); + } +}; + +export function useMultichainEvents({ hasPageLostFocus }: { hasPageLostFocus: boolean }) { + const [pendingMultichainFunding, setPendingMultichainFunding] = useState( + DEFAULT_MULTICHAIN_FUNDING_STATE + ); + const { chainId, srcChainId } = useChainId(); + + const { address: currentAccount } = useAccount(); + + const { wsProvider, wsSourceChainProviders } = useWebsocketProvider(); + const wsSourceChainProvider = srcChainId ? wsSourceChainProviders[srcChainId] : undefined; + + const [, setSelectedTransferGuid] = useGmxAccountSelectedTransferGuid(); + const [multichainFundingPendingIds, setMultichainFundingPendingIds] = useState>(EMPTY_OBJECT); + + const scheduleMultichainFundingItemClearing = useCallback( + (executedGuids: string[]) => { + setTimeout(() => { + setMultichainFundingPendingIds((prev) => { + return pickBy(prev, (value) => !executedGuids.includes(value)); + }); + }, FINISHED_FUNDING_ITEM_CLEARING_DELAY_MS); + }, + [setMultichainFundingPendingIds] + ); + + const pendingReceiveDepositGuidsRef = useRef([]); + const pendingExecuteDepositGuidsRef = useRef([]); + const pendingReceiveWithdrawalGuidsRef = useRef([]); + + const pendingReceiveDepositGuidsKey = useMemo(() => { + const guids = pendingMultichainFunding + .filter((item) => item.operation === "deposit" && item.step === "sent") + .map((item) => item.id); + pendingReceiveDepositGuidsRef.current = guids; + return guids.join(","); + }, [pendingMultichainFunding]); + + const pendingExecuteDepositGuidsKey = useMemo(() => { + const allGuids = pendingMultichainFunding + .filter((item) => item.operation === "deposit" && (item.step === "sent" || item.step === "received")) + .map((item) => item.id); + pendingExecuteDepositGuidsRef.current = allGuids; + return allGuids.join(","); + }, [pendingMultichainFunding]); + + const pendingReceiveWithdrawalGuidsKey = useMemo(() => { + const guids = pendingMultichainFunding + .filter((item) => item.operation === "withdrawal" && item.step === "sent") + .map((item) => item.id); + pendingReceiveWithdrawalGuidsRef.current = guids; + return guids.join(","); + }, [pendingMultichainFunding]); + + //#region Deposits + + // TODO MLTCH: make send events listening regardless of srcChainId + useEffect( + function subscribeSourceChainOftSentEvents() { + if ( + srcChainId === undefined || + hasPageLostFocus || + !currentAccount || + !wsSourceChainProvider || + !isSettlementChain(chainId) + ) { + return; + } + + const tokenIdMap = CHAIN_ID_TO_TOKEN_ID_MAP[srcChainId]; + const sourceChainStargates = Object.values(tokenIdMap).map((tokenId) => tokenId.stargate); + const tokenIdByStargate = keyBy(Object.values(tokenIdMap), (tokenId: MultichainTokenId) => tokenId.stargate); + + debugLog("subscribing to OFTSent events for", srcChainId); + + const unsubscribeFromOftSentEvents = subscribeToOftSentEvents( + wsSourceChainProvider, + currentAccount, + sourceChainStargates, + (info) => { + const settlementChainId = ENDPOINT_ID_TO_CHAIN_ID[info.dstEid]; + + if (settlementChainId !== chainId) { + return; + } + + const stargatePoolAddress = info.sender; + const tokenId = tokenIdByStargate[stargatePoolAddress]; + + const settlementChainTokenId = getMappedTokenId(tokenId.chainId, tokenId.address, chainId); + const tokenAddress = settlementChainTokenId?.address; + + if (!tokenAddress) { + throw new Error("No settlement chain token address for OFTSent event"); + } + + debugLog("got OFTSent event for", srcChainId, tokenAddress, info.txnHash); + + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding: PendingMultichainFunding = structuredClone(prev); + + const currentSubmittingDepositIndex = newPendingMultichainFunding.findIndex( + (item) => item.sentTxn === info.txnHash && item.step === "submitted" + ); + + if (currentSubmittingDepositIndex === -1) { + // If there were no submitted order from UI we can not be sure if this sent event is related to GMX without parsing the whole transaction for events + // If its really necessary we could fetch the tx to get PacketSent withing the same transaction event and parse the contents + + // eslint-disable-next-line no-console + console.warn("Got OFTSent event but no deposits were submitted from UI"); + return prev; + } + + const currentSubmittingDeposit = newPendingMultichainFunding[currentSubmittingDepositIndex]; + + setSelectedTransferGuid((prev) => { + if (!prev || prev !== currentSubmittingDeposit.id) { + return prev; + } + + return info.guid; + }); + + setMultichainFundingPendingIds((prev) => { + if (currentSubmittingDeposit.id in prev) { + return { ...prev, [currentSubmittingDeposit.id]: info.guid }; + } + + return prev; + }); + + newPendingMultichainFunding[currentSubmittingDepositIndex] = { + account: currentAccount, + sentAmount: info.amountSentLD, + id: info.guid, + sentTxn: info.txnHash, + operation: "deposit", + step: "sent", + token: tokenAddress, + sourceChainId: srcChainId, + settlementChainId: chainId, + sentTimestamp: currentSubmittingDeposit.sentTimestamp, + + executedTimestamp: undefined, + executedTxn: undefined, + isExecutionError: undefined, + receivedAmount: undefined, + receivedTimestamp: undefined, + receivedTxn: undefined, + + isFromWs: true, + }; + + return newPendingMultichainFunding; + }); + } + ); + + return function cleanup() { + debugLog("unsubscribing from OFTSent events for", srcChainId); + unsubscribeFromOftSentEvents(); + }; + }, + [chainId, currentAccount, hasPageLostFocus, setSelectedTransferGuid, srcChainId, wsSourceChainProvider] + ); + + useEffect( + function subscribeOftReceivedEvents() { + if ( + hasPageLostFocus || + !wsProvider || + !isSettlementChain(chainId) || + pendingReceiveDepositGuidsRef.current.length === 0 + ) { + return; + } + + const tokenIdMap = CHAIN_ID_TO_TOKEN_ID_MAP[chainId]; + const settlementChainStargates = Object.values(tokenIdMap).map((tokenId) => tokenId.stargate); + + const unsubscribeFromOftReceivedEvents = subscribeToOftReceivedEvents( + wsProvider, + settlementChainStargates, + pendingReceiveDepositGuidsRef.current, + (info) => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + + const pendingSentDeposit = newPendingMultichainFunding.find( + (item) => item.operation === "deposit" && item.step === "sent" && item.id === info.guid + ); + + if (!pendingSentDeposit) { + // eslint-disable-next-line no-console + console.warn("Got OFTReceive event but no pending deposits were sent from UI"); + + return newPendingMultichainFunding; + } + + debugLog("got OFTReceive event for", chainId, pendingSentDeposit.token, info.txnHash); + + pendingSentDeposit.step = "received"; + pendingSentDeposit.receivedAmount = info.amountReceivedLD; + pendingSentDeposit.receivedTimestamp = nowInSeconds(); + pendingSentDeposit.receivedTxn = info.txnHash; + + return newPendingMultichainFunding; + }); + } + ); + + const timeoutId = setTimeout(() => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + for (const guid of pendingReceiveDepositGuidsRef.current) { + const pendingSentDepositIndex = newPendingMultichainFunding.findIndex((item) => item.id === guid); + if (pendingSentDepositIndex !== -1) { + newPendingMultichainFunding.splice(pendingSentDepositIndex, 1); + } + } + return newPendingMultichainFunding; + }); + }, SUBSCRIPTION_MAX_TTL_MS); + + return function cleanup() { + unsubscribeFromOftReceivedEvents?.(); + clearTimeout(timeoutId); + }; + }, + [chainId, hasPageLostFocus, pendingReceiveDepositGuidsKey, wsProvider] + ); + + useEffect( + function subscribeComposeDeliveredEvents() { + if ( + hasPageLostFocus || + !wsProvider || + !isSettlementChain(chainId) || + pendingExecuteDepositGuidsRef.current.length === 0 + ) { + return; + } + + const lzEndpoint = CodecUiHelper.getLzEndpoint(chainId); + + const unsubscribeFromComposeDeliveredEvents = subscribeToComposeDeliveredEvents( + wsProvider, + lzEndpoint, + pendingExecuteDepositGuidsRef.current, + (info) => { + scheduleMultichainFundingItemClearing([info.guid]); + + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + + const pendingExecuteDeposit = newPendingMultichainFunding.find((item) => item.id === info.guid); + + if (!pendingExecuteDeposit) { + // eslint-disable-next-line no-console + console.warn("[multichain] Got ComposeDelivered event but no pending deposits were received from UI"); + return newPendingMultichainFunding; + } + + debugLog("got ComposeDelivered event for", chainId, pendingExecuteDeposit.token, info.txnHash); + + pendingExecuteDeposit.step = "executed"; + pendingExecuteDeposit.executedTimestamp = nowInSeconds(); + pendingExecuteDeposit.executedTxn = info.txnHash; + pendingExecuteDeposit.isExecutionError = false; + + queueSendDepositExecutedMetric(pendingExecuteDeposit); + + return newPendingMultichainFunding; + }); + } + ); + + const timeoutId = setTimeout(() => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + for (const guid of pendingExecuteDepositGuidsRef.current) { + const pendingExecuteDepositIndex = newPendingMultichainFunding.findIndex((item) => item.id === guid); + if (pendingExecuteDepositIndex !== -1) { + newPendingMultichainFunding.splice(pendingExecuteDepositIndex, 1); + } + } + return newPendingMultichainFunding; + }); + }, SUBSCRIPTION_MAX_TTL_MS); + + return function cleanup() { + unsubscribeFromComposeDeliveredEvents?.(); + clearTimeout(timeoutId); + }; + }, + [chainId, hasPageLostFocus, pendingExecuteDepositGuidsKey, scheduleMultichainFundingItemClearing, wsProvider] + ); + + //#endregion Deposits + + //#region Withdrawals + + useEffect( + function subscribeSettlementChainOftSentEvents() { + if ( + hasPageLostFocus || + !currentAccount || + !wsProvider || + !isSettlementChain(chainId) || + srcChainId === undefined + ) { + return; + } + + const tokenIdMap = CHAIN_ID_TO_TOKEN_ID_MAP[chainId]; + const settlementChainStargates = Object.values(tokenIdMap).map((tokenId) => tokenId.stargate); + const tokenIdByStargate = keyBy(Object.values(tokenIdMap), (tokenId: MultichainTokenId) => tokenId.stargate); + + const unsubscribeFromOftSentEvents = subscribeToOftSentEvents( + wsProvider, + getContract(chainId, "LayerZeroProvider"), + settlementChainStargates, + (info) => { + const sourceChainId = ENDPOINT_ID_TO_CHAIN_ID[info.dstEid]; + + if (sourceChainId !== srcChainId) { + return; + } + + debugLog("withdrawal got OFTSent event for", srcChainId, info.txnHash); + + const stargatePoolAddress = info.sender; + const tokenId = tokenIdByStargate[stargatePoolAddress]; + + const tokenAddress = tokenId.address; + + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding: PendingMultichainFunding = structuredClone(prev); + + const currentSubmittingWithdrawalIndex = newPendingMultichainFunding.findIndex( + (item) => item.sentTxn === info.txnHash && item.step === "submitted" + ); + + if (currentSubmittingWithdrawalIndex === -1) { + // If there were no submitted order from UI we can not be sure if this sent event is related to GMX without parsing the whole transaction for events + // If its really necessary we could fetch the tx to get PacketSent withing the same transaction event and parse the contents + + // eslint-disable-next-line no-console + console.warn( + "[multichain] Got OFTSent event but no withdrawals were submitted from UI", + newPendingMultichainFunding + ); + UNCERTAIN_WITHDRAWALS_CACHE.set(info.txnHash, info.guid); + return prev; + } + + const currentSubmittingWithdrawal = newPendingMultichainFunding[currentSubmittingWithdrawalIndex]; + + setSelectedTransferGuid((prev) => { + if (!prev || prev !== currentSubmittingWithdrawal.id) { + return prev; + } + + return info.guid; + }); + + setMultichainFundingPendingIds((prev) => { + if (currentSubmittingWithdrawal.id in prev) { + return { ...prev, [currentSubmittingWithdrawal.id]: info.guid }; + } + + return prev; + }); + + newPendingMultichainFunding[currentSubmittingWithdrawalIndex] = { + account: currentAccount, + sentAmount: info.amountSentLD, + id: info.guid, + sentTxn: info.txnHash, + operation: "withdrawal", + step: "sent", + token: tokenAddress, + sourceChainId: sourceChainId, + settlementChainId: chainId, + sentTimestamp: currentSubmittingWithdrawal.sentTimestamp, + + executedTimestamp: undefined, + executedTxn: undefined, + isExecutionError: undefined, + receivedAmount: undefined, + receivedTimestamp: undefined, + receivedTxn: undefined, + + isFromWs: true, + }; + + return newPendingMultichainFunding; + }); + } + ); + + return function cleanup() { + unsubscribeFromOftSentEvents(); + }; + }, + [chainId, currentAccount, hasPageLostFocus, setSelectedTransferGuid, srcChainId, wsProvider] + ); + + useEffect( + function subscribeSourceChainOftReceivedEvents() { + const guids = pendingReceiveWithdrawalGuidsRef.current; + + if ( + hasPageLostFocus || + !wsSourceChainProvider || + !isSettlementChain(chainId) || + srcChainId === undefined || + guids.length === 0 + ) { + return; + } + + const tokenIdMap = CHAIN_ID_TO_TOKEN_ID_MAP[srcChainId]; + const sourceChainStargates = Object.values(tokenIdMap).map((tokenId) => tokenId.stargate); + + debugLog("subscribing to source chain OFTReceive events for", srcChainId, guids); + + const unsubscribeFromOftReceivedEvents = subscribeToOftReceivedEvents( + wsSourceChainProvider, + sourceChainStargates, + guids, + (info) => { + debugLog("withdrawal on source chain got OFTReceive event for", srcChainId, info.txnHash); + + scheduleMultichainFundingItemClearing([info.guid]); + + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + + const pendingSentWithdrawal = newPendingMultichainFunding.find( + (item) => item.id === info.guid && item.step === "sent" + ); + + if (!pendingSentWithdrawal) { + // eslint-disable-next-line no-console + console.warn("[multichain] Got OFTReceive event but no pending withdrawals were sent from UI"); + + return newPendingMultichainFunding; + } + + pendingSentWithdrawal.step = "received"; + pendingSentWithdrawal.receivedAmount = info.amountReceivedLD; + pendingSentWithdrawal.receivedTimestamp = nowInSeconds(); + pendingSentWithdrawal.receivedTxn = info.txnHash; + + return newPendingMultichainFunding; + }); + } + ); + + // in 5 minutes clean up pending withdrawals that are not received + const timeoutId = setTimeout(() => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + for (const guid of guids) { + const pendingSentWithdrawalIndex = newPendingMultichainFunding.findIndex((item) => item.id === guid); + if (pendingSentWithdrawalIndex !== -1) { + newPendingMultichainFunding.splice(pendingSentWithdrawalIndex, 1); + } + } + return newPendingMultichainFunding; + }); + }, SUBSCRIPTION_MAX_TTL_MS); + + return function cleanup() { + unsubscribeFromOftReceivedEvents?.(); + clearTimeout(timeoutId); + }; + }, + [ + chainId, + hasPageLostFocus, + pendingReceiveWithdrawalGuidsKey, + scheduleMultichainFundingItemClearing, + srcChainId, + wsSourceChainProvider, + ] + ); + + //#endregion Withdrawals + + //#region Approval statuses + + const [sourceChainApprovalActiveListeners, setSourceChainApprovalActiveListeners] = + useState>>(EMPTY_OBJECT); + const [sourceChainApprovalStatuses, setSourceChainApprovalStatuses] = useState(EMPTY_OBJECT); + + const sourceChainApprovalUnsubscribersRef = useRef void>>>({}); + const sourceChainApprovalCleanupTimersRef = useRef>>({}); + + useEffect( + function subscribeMultichainApprovals() { + if (!currentAccount) { + return; + } + + const newUnsubscribers: Partial void>> = {}; + + for (const chainIdString of Object.keys(sourceChainApprovalActiveListeners)) { + if ( + !sourceChainApprovalActiveListeners[chainIdString] || + sourceChainApprovalActiveListeners[chainIdString].length === 0 + ) { + continue; + } + + const someSourceChainId = parseInt(chainIdString) as SourceChainId; + + if (sourceChainApprovalCleanupTimersRef.current[someSourceChainId]) { + debugLog("clearing timeout for source chain approval listener", someSourceChainId); + + clearTimeout(sourceChainApprovalCleanupTimersRef.current[someSourceChainId]); + delete sourceChainApprovalCleanupTimersRef.current[someSourceChainId]; + } + + if (sourceChainApprovalUnsubscribersRef.current[someSourceChainId]) { + debugLog("skipping source chain approval listener creation as it already exists", someSourceChainId); + continue; + } + + const wsSomeSourceChainProvider = wsSourceChainProviders[someSourceChainId]; + if (!wsSomeSourceChainProvider) { + debugLog("no ws source chain provider for source chain approval listener", someSourceChainId); + continue; + } + + const tokenIdMap = CHAIN_ID_TO_TOKEN_ID_MAP[someSourceChainId]; + const tokenAddresses = Object.values(tokenIdMap) + .filter((tokenId) => tokenId.address !== zeroAddress) + .map((tokenId) => tokenId.address); + const stargates = Object.values(tokenIdMap) + .filter((tokenId) => tokenId.address !== zeroAddress) + .map((tokenId) => tokenId.stargate); + + debugLog("subscribing to source chain approval events for", someSourceChainId); + const unsubscribeApproval = subscribeToMultichainApprovalEvents( + wsSomeSourceChainProvider, + currentAccount, + tokenAddresses, + stargates, + (tokenAddress, spender, value) => { + debugLog("got approval event for", someSourceChainId, tokenAddress, spender, value); + + setSourceChainApprovalStatuses((old) => ({ + ...old, + [tokenAddress]: { + ...old[tokenAddress], + [spender]: { value, createdAt: Date.now() }, + }, + })); + } + ); + + newUnsubscribers[someSourceChainId] = unsubscribeApproval; + } + + sourceChainApprovalUnsubscribersRef.current = { + ...sourceChainApprovalUnsubscribersRef.current, + ...newUnsubscribers, + }; + + return function cleanup() { + for (const chainIdString of Object.keys(newUnsubscribers)) { + const someSourceChainId = parseInt(chainIdString) as SourceChainId; + + debugLog("scheduling timeout for source chain approval listener", someSourceChainId); + + const timerId = window.setTimeout(() => { + debugLog("clearing source chain approval listener", someSourceChainId); + newUnsubscribers[someSourceChainId]?.(); + delete sourceChainApprovalUnsubscribersRef.current[someSourceChainId]; + // eslint-disable-next-line react-hooks/exhaustive-deps + delete sourceChainApprovalCleanupTimersRef.current[someSourceChainId]; + }, SOURCE_CHAIN_APPROVAL_LISTENER_CLEANUP_DELAY_MS); + + // eslint-disable-next-line react-hooks/exhaustive-deps + sourceChainApprovalCleanupTimersRef.current[someSourceChainId] = timerId; + } + }; + }, + [currentAccount, sourceChainApprovalActiveListeners, wsSourceChainProviders] + ); + + const multichainEventsState = useMemo( + (): MultichainEventsState => ({ + pendingMultichainFunding, + multichainFundingPendingIds, + setMultichainSubmittedDeposit: (submittedEvent) => { + if (!currentAccount) { + return; + } + + const stubId = ``; + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + newPendingMultichainFunding.push({ + account: currentAccount, + id: stubId, + operation: "deposit", + step: "submitted", + settlementChainId: chainId, + sourceChainId: submittedEvent.sourceChainId, + token: submittedEvent.tokenAddress, + sentAmount: submittedEvent.amount, + sentTxn: submittedEvent.sentTxn, + sentTimestamp: nowInSeconds(), + + receivedAmount: undefined, + receivedTxn: undefined, + receivedTimestamp: undefined, + isExecutionError: undefined, + executedTxn: undefined, + executedTimestamp: undefined, + + isFromWs: true, + }); + return newPendingMultichainFunding; + }); + + setMultichainFundingPendingIds((prev) => ({ ...prev, [stubId]: stubId })); + + return stubId; + }, + setMultichainSubmittedWithdrawal: (submittedEvent) => { + if (!currentAccount) { + return; + } + + const stubId = ``; + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + newPendingMultichainFunding.push({ + account: currentAccount, + id: stubId, + operation: "withdrawal", + step: "submitted", + settlementChainId: chainId, + sourceChainId: submittedEvent.sourceChainId, + token: submittedEvent.tokenAddress, + sentAmount: submittedEvent.amount, + sentTimestamp: nowInSeconds(), + + sentTxn: undefined, + receivedAmount: undefined, + receivedTxn: undefined, + receivedTimestamp: undefined, + isExecutionError: undefined, + executedTxn: undefined, + executedTimestamp: undefined, + + isFromWs: true, + }); + return newPendingMultichainFunding; + }); + + setMultichainFundingPendingIds((prev) => ({ ...prev, [stubId]: stubId })); + + return stubId; + }, + setMultichainWithdrawalSentTxnHash: (mockId, txnHash) => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + const submittedWithdrawalIndex = newPendingMultichainFunding.findIndex((item) => item.id === mockId); + debugLog("Setting multichain withdrawal sent txn hash"); + if (submittedWithdrawalIndex !== -1) { + const submittedWithdrawal = newPendingMultichainFunding[submittedWithdrawalIndex]; + submittedWithdrawal.sentTxn = txnHash; + submittedWithdrawal.sentTimestamp = nowInSeconds(); + debugLog("Found submitted withdrawal", submittedWithdrawal, UNCERTAIN_WITHDRAWALS_CACHE.get(txnHash)); + + if (UNCERTAIN_WITHDRAWALS_CACHE.has(txnHash)) { + debugLog("Found uncertain withdrawal in cache", txnHash); + const guid = UNCERTAIN_WITHDRAWALS_CACHE.get(txnHash)!; + submittedWithdrawal.step = "sent"; + submittedWithdrawal.id = guid; + + setSelectedTransferGuid((prev) => { + if (!prev || prev !== mockId) { + return prev; + } + + return guid; + }); + + setMultichainFundingPendingIds((prev) => { + if (mockId in prev) { + return { ...prev, [mockId]: guid }; + } + + return prev; + }); + + UNCERTAIN_WITHDRAWALS_CACHE.delete(txnHash); + } + } + return newPendingMultichainFunding; + }); + }, + setMultichainWithdrawalSentError: (mockId) => { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + const submittedWithdrawalIndex = newPendingMultichainFunding.findIndex((item) => item.id === mockId); + if (submittedWithdrawalIndex !== -1) { + newPendingMultichainFunding.splice(submittedWithdrawalIndex, 1); + } + return newPendingMultichainFunding; + }); + + setMultichainFundingPendingIds((prev) => { + const newPendingIds = { ...prev }; + delete newPendingIds[mockId]; + return newPendingIds; + }); + + setSelectedTransferGuid((prev) => { + if (!prev || prev !== mockId) { + return prev; + } + + return undefined; + }); + }, + multichainSourceChainApprovalStatuses: sourceChainApprovalStatuses, + setMultichainSourceChainApprovalsActiveListener: (chainId: SourceChainId, name: string) => { + setSourceChainApprovalActiveListeners((old) => { + const newListeners = structuredClone(old); + newListeners[chainId] = [...(newListeners[chainId] || []), name]; + return newListeners; + }); + }, + removeMultichainSourceChainApprovalsActiveListener: (chainId: SourceChainId, name: string) => { + setSourceChainApprovalActiveListeners((old) => { + const newListeners = structuredClone(old); + newListeners[chainId] = newListeners[chainId]?.filter((listener) => listener !== name) || []; + return newListeners; + }); + }, + updatePendingMultichainFunding: (items) => { + const intermediateStepGuids = getIntermediateStepGuids(pendingMultichainFunding); + + const updatedPendingItems: Record = {}; + let hasUpdatedPendingUpdates = false; + + for (const item of items) { + if (intermediateStepGuids.has(item.id)) { + updatedPendingItems[item.id] = item; + hasUpdatedPendingUpdates = true; + } + } + + if (hasUpdatedPendingUpdates) { + setPendingMultichainFunding((prev) => { + const newPendingMultichainFunding = structuredClone(prev); + + const executedGuids = progressMultichainFundingItems({ + pendingMultichainFunding: newPendingMultichainFunding, + updatedPendingItems, + }); + + scheduleMultichainFundingItemClearing(executedGuids); + + return newPendingMultichainFunding; + }); + } + }, + removeMultichainFundingPendingIds: (ids: string | string[]) => { + ids = typeof ids === "string" ? [ids] : ids; + setMultichainFundingPendingIds((prev) => { + const newIds = { ...prev }; + for (const id of ids) { + delete newIds[id]; + } + return newIds; + }); + }, + }), + [ + pendingMultichainFunding, + multichainFundingPendingIds, + sourceChainApprovalStatuses, + currentAccount, + chainId, + setSelectedTransferGuid, + scheduleMultichainFundingItemClearing, + ] + ); + + //#endregion Approval statuses + + useEffect( + function resetOnAccountChange() { + setPendingMultichainFunding(DEFAULT_MULTICHAIN_FUNDING_STATE); + setMultichainFundingPendingIds(EMPTY_OBJECT); + setSourceChainApprovalStatuses(EMPTY_OBJECT); + }, + [currentAccount] + ); + + return multichainEventsState; +} + +function getIntermediateStepGuids(pendingMultichainFunding: PendingMultichainFunding): Set { + const intermediateStepGuids = new Set(); + + for (const item of pendingMultichainFunding) { + if (item.operation === "deposit") { + if (item.step === "received" || item.step === "sent") { + intermediateStepGuids.add(item.id); + } + } else if (item.operation === "withdrawal") { + if (item.step === "sent") { + intermediateStepGuids.add(item.id); + } + } + } + + return intermediateStepGuids; +} + +function progressMultichainFundingItems({ + pendingMultichainFunding, + updatedPendingItems, +}: { + pendingMultichainFunding: PendingMultichainFunding; + updatedPendingItems: Record; +}) { + const executedGuids: string[] = []; + + for (let index = 0; index < pendingMultichainFunding.length; index++) { + const item = pendingMultichainFunding[index]; + const freshItem = updatedPendingItems[item.id]; + + if (!freshItem) { + continue; + } + + if (item.operation === "deposit") { + if (item.step === "received" || item.step === "sent") { + if (isStepGreater(freshItem.step, item.step)) { + pendingMultichainFunding[index] = freshItem; + + if (freshItem.step === "executed") { + executedGuids.push(item.id); + queueSendDepositExecutedMetric(freshItem); + } + } + } + } else if (item.operation === "withdrawal") { + if (item.step === "sent") { + if (isStepGreater(freshItem.step, item.step)) { + pendingMultichainFunding[index] = freshItem; + + if (freshItem.step === "received") { + executedGuids.push(item.id); + queueSendWithdrawalReceivedMetric(freshItem); + } + } + } + } + } + + return executedGuids; +} + +function queueSendDepositExecutedMetric(deposit: MultichainFundingHistoryItem) { + const token = getToken(deposit.settlementChainId, deposit.token); + const metricId = getMultichainDepositMetricId({ + settlementChain: deposit.settlementChainId, + sourceChain: deposit.sourceChainId, + assetSymbol: token.symbol, + }); + + const cache = metrics.getCachedMetricData(metricId); + if (cache) { + sendMultichainDepositSuccessEvent({ + settlementChain: getChainName(deposit.settlementChainId), + sourceChain: getChainName(deposit.sourceChainId), + asset: token.symbol, + sizeInUsd: cache.sizeInUsd, + isFirstTime: cache.isFirstDeposit, + }); + } + + sendOrderExecutedMetric(metricId); +} + +function queueSendWithdrawalReceivedMetric(withdrawal: MultichainFundingHistoryItem) { + const token = getToken(withdrawal.settlementChainId, withdrawal.token); + const metricId = getMultichainWithdrawalMetricId({ + settlementChain: withdrawal.settlementChainId, + sourceChain: withdrawal.sourceChainId, + assetSymbol: token.symbol, + }); + + const cache = metrics.getCachedMetricData(metricId); + if (cache) { + sendMultichainWithdrawalSuccessEvent({ + settlementChain: getChainName(withdrawal.settlementChainId), + sourceChain: getChainName(withdrawal.sourceChainId), + asset: token.symbol, + sizeInUsd: cache.sizeInUsd, + isFirstTime: cache.isFirstWithdrawal, + }); + } + + sendOrderExecutedMetric(metricId); +} + +export function useMultichainApprovalsActiveListener(chainId: SourceChainId | undefined, name: string) { + const { setMultichainSourceChainApprovalsActiveListener, removeMultichainSourceChainApprovalsActiveListener } = + useSyntheticsEvents(); + + useWsAdditionalSourceChains(chainId, name); + + useEffect(() => { + if (!chainId) { + return; + } + + setMultichainSourceChainApprovalsActiveListener(chainId, name); + + return () => { + removeMultichainSourceChainApprovalsActiveListener(chainId, name); + }; + }, [ + chainId, + name, + setMultichainSourceChainApprovalsActiveListener, + removeMultichainSourceChainApprovalsActiveListener, + ]); +} diff --git a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx index 7061a8acd6..9bfd2badfd 100644 --- a/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx +++ b/src/context/SyntheticsStateContext/SyntheticsStateContextProvider.tsx @@ -1,10 +1,9 @@ import { ethers } from "ethers"; -import { ReactNode, useCallback, useMemo, useState } from "react"; +import { ReactNode, useMemo, useState } from "react"; import { useParams } from "react-router-dom"; -import { Context, createContext, useContext, useContextSelector } from "use-context-selector"; +import type { ContractsChainId, SourceChainId } from "config/chains"; import { getKeepLeverageKey } from "config/localStorage"; -import { NoncesData, useExpressNonces } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; import { SettingsContextType, useSettings } from "context/SettingsContext/SettingsContextProvider"; import { SubaccountState, useSubaccountContext } from "context/SubaccountContext/SubaccountContextProvider"; import { TokenPermitsState, useTokenPermitsContext } from "context/TokenPermitsContext/TokenPermitsContextProvider"; @@ -29,9 +28,9 @@ import useUiFeeFactorRequest from "domain/synthetics/fees/utils/useUiFeeFactor"; import { MarketsInfoResult, MarketsResult, - useMarketTokensDataRequest, useMarkets, useMarketsInfoRequest, + useMarketTokensDataRequest, } from "domain/synthetics/markets"; import { isGlvEnabled } from "domain/synthetics/markets/glv"; import { useGlvMarketsInfo } from "domain/synthetics/markets/useGlvMarkets"; @@ -47,6 +46,7 @@ import { import { TokenAllowanceResult, TokensData, + TokensDataResult, useTokensAllowanceData, useTokensDataRequest, } from "domain/synthetics/tokens"; @@ -67,6 +67,7 @@ import { convertTokenAddress } from "sdk/configs/tokens"; import { useCollectSyntheticsMetrics } from "./useCollectSyntheticsMetrics"; import { LeaderboardState, useLeaderboardState } from "./useLeaderboardState"; +import { latestStateRef, StateCtx } from "./utils"; export type SyntheticsPageType = | "accounts" @@ -77,15 +78,19 @@ export type SyntheticsPageType = | "stats" | "stake" | "buy" - | "home"; + | "home" + | "gmxAccount" + | "referrals"; export type SyntheticsState = { pageType: SyntheticsPageType; globals: { - chainId: number; + chainId: ContractsChainId; + srcChainId: SourceChainId | undefined; markets: MarketsResult; marketsInfo: MarketsInfoResult; positionsInfo: PositionsInfoResult; + tokensDataResult: TokensDataResult; account: string | undefined; signer: WalletSigner | undefined; ordersInfo: AggregatedOrdersDataResult; @@ -137,13 +142,8 @@ export type SyntheticsState = { gasPaymentTokenAllowance: TokenAllowanceResult | undefined; sponsoredCallBalanceData: SponsoredCallBalanceData | undefined; l1ExpressOrderGasReference: L1ExpressOrderGasReference | undefined; - expressNoncesData: NoncesData | undefined; }; -const StateCtx = createContext(null); - -let latestState: SyntheticsState | null = null; - export function SyntheticsStateContextProvider({ children, skipLocalReferralCode, @@ -153,11 +153,12 @@ export function SyntheticsStateContextProvider({ children: ReactNode; skipLocalReferralCode: boolean; pageType: SyntheticsPageType; - overrideChainId?: number; + overrideChainId?: ContractsChainId; }) { - const { chainId: selectedChainId } = useChainId(); + const { chainId: selectedChainId, srcChainId } = useChainId(); const { account: walletAccount, signer } = useWallet(); + const { account: paramsAccount } = useParams<{ account?: string }>(); let checkSummedAccount: string | undefined; @@ -175,15 +176,15 @@ export function SyntheticsStateContextProvider({ const chainId = isLeaderboardPage ? leaderboard.chainId : overrideChainId ?? selectedChainId; const markets = useMarkets(chainId); - const { tokensData } = useTokensDataRequest(chainId); + const tokensDataResult = useTokensDataRequest(chainId, srcChainId); const positionsResult = usePositions(chainId, { account, marketsData: markets.marketsData, - tokensData, + tokensData: tokensDataResult.tokensData, }); - const marketsInfo = useMarketsInfoRequest(chainId); + const marketsInfo = useMarketsInfoRequest(chainId, { tokensData: tokensDataResult.tokensData }); const { isFirstOrder } = useIsFirstOrder(chainId, { account }); @@ -191,12 +192,12 @@ export function SyntheticsStateContextProvider({ isGlvEnabled(chainId) && (pageType === "pools" || pageType === "buy" || pageType === "stake"); const glvInfo = useGlvMarketsInfo(shouldFetchGlvMarkets, { marketsInfoData: marketsInfo.marketsInfoData, - tokensData: marketsInfo.tokensData, + tokensData: tokensDataResult.tokensData, chainId: chainId, account: account, }); - const { marketTokensData: depositMarketTokensData } = useMarketTokensDataRequest(chainId, { + const { marketTokensData: depositMarketTokensData } = useMarketTokensDataRequest(chainId, srcChainId, { isDeposit: true, account, glvData: glvInfo.glvData, @@ -207,10 +208,10 @@ export function SyntheticsStateContextProvider({ const userReferralInfo = useUserReferralInfoRequest(signer, chainId, account, skipLocalReferralCode); const [closingPositionKey, setClosingPositionKey] = useState(); const [isCandlesLoaded, setIsCandlesLoaded] = useState(false); - const { accruedPositionPriceImpactFees, claimablePositionPriceImpactFees } = useRebatesInfoRequest( - chainId, - isTradePage - ); + const { accruedPositionPriceImpactFees, claimablePositionPriceImpactFees } = useRebatesInfoRequest(chainId, { + enabled: isTradePage, + positionsConstants, + }); const oracleSettings = useOracleSettingsData(); @@ -232,21 +233,22 @@ export function SyntheticsStateContextProvider({ positionsError: positionsResult.error, marketsData: markets.marketsData, skipLocalReferralCode, - tokensData, + tokensData: tokensDataResult.tokensData, }); const ordersInfo = useOrdersInfoRequest(chainId, { account, marketsInfoData: marketsInfo.marketsInfoData, - tokensData: marketsInfo.tokensData, + tokensData: tokensDataResult.tokensData, }); const tradeboxState = useTradeboxState(chainId, isTradePage, { marketsInfoData: marketsInfo.marketsInfoData, marketsData: markets.marketsData, - tokensData: marketsInfo.tokensData, + tokensData: tokensDataResult.tokensData, positionsInfoData, ordersInfoData: ordersInfo.ordersInfoData, + srcChainId, }); const orderEditor = useOrderEditorState(ordersInfo.ordersInfoData); @@ -278,7 +280,7 @@ export function SyntheticsStateContextProvider({ // TODO move closingPositionKey to positionSellerState const positionSellerState = usePositionSellerState(chainId, positionsInfoData?.[closingPositionKey ?? ""]); - const positionEditorState = usePositionEditorState(chainId); + const positionEditorState = usePositionEditorState(chainId, srcChainId); const confirmationBoxState = useConfirmationBoxState(); const gasLimits = useGasLimits(chainId); @@ -288,6 +290,7 @@ export function SyntheticsStateContextProvider({ const [keepLeverage, setKeepLeverage] = useLocalStorageSerializeKey(getKeepLeverageKey(chainId), true); useCollectSyntheticsMetrics({ + tokensDataResult, marketsInfo, isPositionsInfoLoading: isLoading, positionsInfoData, @@ -299,7 +302,7 @@ export function SyntheticsStateContextProvider({ const externalSwapState = useInitExternalSwapState(); const tokenPermitsState = useTokenPermitsContext(); const sponsoredCallBalanceData = useIsSponsoredCallBalanceAvailable(chainId, { - tokensData: marketsInfo.tokensData, + tokensData: tokensDataResult.tokensData, }); const gasPaymentTokenAllowance = useTokensAllowanceData(chainId, { @@ -307,8 +310,6 @@ export function SyntheticsStateContextProvider({ tokenAddresses: [convertTokenAddress(chainId, settings.gasPaymentTokenAddress, "wrapped")], }); - const { noncesData: expressNoncesData } = useExpressNonces(); - const botanixStakingAssetsPerShare = useBotanixStakingAssetsPerShare({ chainId }); const state = useMemo(() => { @@ -316,6 +317,7 @@ export function SyntheticsStateContextProvider({ pageType, globals: { chainId, + srcChainId, account, signer, markets, @@ -328,6 +330,7 @@ export function SyntheticsStateContextProvider({ isLoading, positionsInfoData, }, + tokensDataResult, uiFeeFactor, userReferralInfo, depositMarketTokensData, @@ -369,75 +372,60 @@ export function SyntheticsStateContextProvider({ sponsoredCallBalanceData, gasPaymentTokenAllowance, l1ExpressOrderGasReference, - expressNoncesData, }; return s; }, [ - pageType, - chainId, account, - signer, - markets, - marketsInfo, - ordersInfo, - positionsConstants, - glvInfo, - isLoading, - positionsInfoData, - uiFeeFactor, - userReferralInfo, - depositMarketTokensData, + accountStats, + accruedPositionPriceImpactFees, + blockTimestampData, + botanixStakingAssetsPerShare, + chainId, + claimablePositionPriceImpactFees, closingPositionKey, - missedCoinsModalPlace, + confirmationBoxState, + depositMarketTokensData, + externalSwapState, + features, gasLimits, + gasPaymentTokenAllowance, gasPrice, - keepLeverage, - setKeepLeverage, - lastWeekAccountStats, - lastMonthAccountStats, - accountStats, + glvInfo, isCandlesLoaded, - isLargeAccount, isFirstOrder, - blockTimestampData, - accruedPositionPriceImpactFees, - claimablePositionPriceImpactFees, + isLargeAccount, + isLoading, + keepLeverage, + l1ExpressOrderGasReference, + lastMonthAccountStats, + lastWeekAccountStats, leaderboard, - settings, - subaccountState, - tradeboxState, - externalSwapState, - tokenPermitsState, + markets, + marketsInfo, + missedCoinsModalPlace, + oracleSettings, orderEditor, - positionSellerState, + ordersInfo, + pageType, positionEditorState, - confirmationBoxState, - features, + positionSellerState, + positionsConstants, + positionsInfoData, + setKeepLeverage, + settings, + signer, sponsoredCallBalanceData, - gasPaymentTokenAllowance, - l1ExpressOrderGasReference, - expressNoncesData, - oracleSettings, - botanixStakingAssetsPerShare, + srcChainId, + subaccountState, + tokenPermitsState, + tokensDataResult, + tradeboxState, + uiFeeFactor, + userReferralInfo, ]); - latestState = state; + latestStateRef.current = state; return {children}; } - -export function useSyntheticsStateSelector(selector: (s: SyntheticsState) => Selected) { - const value = useContext(StateCtx); - if (!value) { - throw new Error("Used useSyntheticsStateSelector outside of SyntheticsStateContextProvider"); - } - return useContextSelector(StateCtx as Context, selector) as Selected; -} - -export function useCalcSelector() { - return useCallback(function useCalcSelector(selector: (state: SyntheticsState) => Selected) { - if (!latestState) throw new Error("Used calcSelector outside of SyntheticsStateContextProvider"); - return selector(latestState); - }, []); -} diff --git a/src/context/SyntheticsStateContext/hooks/orderHooks.ts b/src/context/SyntheticsStateContext/hooks/orderHooks.ts index 5f59a6c6a5..a9530247b3 100644 --- a/src/context/SyntheticsStateContext/hooks/orderHooks.ts +++ b/src/context/SyntheticsStateContext/hooks/orderHooks.ts @@ -4,12 +4,13 @@ import { useCallback, useMemo } from "react"; import { estimateBatchExpressParams } from "domain/synthetics/express/expressOrderUtils"; import { sendBatchOrderTxn } from "domain/synthetics/orders/sendBatchOrderTxn"; import { useOrderTxnCallbacks } from "domain/synthetics/orders/useOrderTxnCallbacks"; +import { useJsonRpcProvider } from "lib/rpc"; import { useEthersSigner } from "lib/wallets/useEthersSigner"; import { OrderInfo } from "sdk/types/orders"; import { getOrderKeys } from "sdk/utils/orders"; import { selectExpressGlobalParams } from "../selectors/expressSelectors"; -import { selectChainId } from "../selectors/globalSelectors"; +import { selectChainId, selectSrcChainId, selectSubaccountForChainAction } from "../selectors/globalSelectors"; import { makeSelectOrderErrorByOrderKey, makeSelectOrdersWithErrorsByPositionKey, @@ -35,16 +36,19 @@ export const useOrderErrorsCount = () => useSelector(selectOrderErrorsCount); export function useCancelOrder(order: OrderInfo) { const chainId = useSelector(selectChainId); + const srcChainId = useSelector(selectSrcChainId); const signer = useEthersSigner(); + const { provider } = useJsonRpcProvider(chainId); const [cancellingOrdersKeys, setCancellingOrdersKeys] = useCancellingOrdersKeysState(); const { makeOrderTxnCallback } = useOrderTxnCallbacks(); const globalExpressParams = useSelector(selectExpressGlobalParams); + const subaccount = useSelector(selectSubaccountForChainAction); const isCancelOrderProcessing = cancellingOrdersKeys.includes(order.key); const onCancelOrder = useCallback( async function cancelOrder() { - if (!signer) return; + if (!signer || !provider) return; setCancellingOrdersKeys((p) => uniq(p.concat(order.key))); @@ -64,7 +68,9 @@ export function useCancelOrder(order: OrderInfo) { globalExpressParams, requireValidations: true, estimationMethod: "approximate", - provider: undefined, + provider, + isGmxAccount: srcChainId !== undefined, + subaccount, }) : undefined; @@ -74,13 +80,24 @@ export function useCancelOrder(order: OrderInfo) { batchParams, expressParams, simulationParams: undefined, - noncesData: globalExpressParams?.noncesData, callback: makeOrderTxnCallback({}), + provider, + isGmxAccount: srcChainId !== undefined, }).finally(() => { setCancellingOrdersKeys((prev) => prev.filter((k) => k !== order.key)); }); }, - [chainId, globalExpressParams, makeOrderTxnCallback, order, setCancellingOrdersKeys, signer] + [ + chainId, + globalExpressParams, + makeOrderTxnCallback, + order, + provider, + setCancellingOrdersKeys, + signer, + srcChainId, + subaccount, + ] ); return [isCancelOrderProcessing, onCancelOrder] as const; diff --git a/src/context/SyntheticsStateContext/hooks/positionEditorHooks.ts b/src/context/SyntheticsStateContext/hooks/positionEditorHooks.ts index 2d224bf95f..80dbbb141d 100644 --- a/src/context/SyntheticsStateContext/hooks/positionEditorHooks.ts +++ b/src/context/SyntheticsStateContext/hooks/positionEditorHooks.ts @@ -3,11 +3,13 @@ import type { Address } from "viem"; import { selectPositionEditorCollateralInputValue, selectPositionEditorEditingPositionKey, + selectPositionEditorIsCollateralTokenFromGmxAccount, selectPositionEditorMinCollateralFactor, selectPositionEditorPosition, selectPositionEditorSelectedCollateralAddress, selectPositionEditorSetCollateralInputValue, selectPositionEditorSetEditingPositionKey, + selectPositionEditorSetIsCollateralTokenFromGmxAccount, selectPositionEditorSetSelectedCollateralAddress, } from "../selectors/positionEditorSelectors"; import { useSelector } from "../utils"; @@ -30,6 +32,13 @@ export const usePositionEditorSelectedCollateralAddress = (): [Address | undefin return [selectedCollateralAddress, setSelectedCollateralAddress]; }; +export const usePositionEditorIsCollateralTokenFromGmxAccount = (): [boolean, (isGmxAccount: boolean) => void] => { + const isCollateralTokenFromGmxAccount = useSelector(selectPositionEditorIsCollateralTokenFromGmxAccount); + const setIsCollateralTokenFromGmxAccount = useSelector(selectPositionEditorSetIsCollateralTokenFromGmxAccount); + + return [isCollateralTokenFromGmxAccount, setIsCollateralTokenFromGmxAccount]; +}; + export const usePositionEditorCollateralInputValue = (): [string, (value: string) => void] => { const value = useSelector(selectPositionEditorCollateralInputValue); const setValue = useSelector(selectPositionEditorSetCollateralInputValue); diff --git a/src/context/SyntheticsStateContext/hooks/settingsHooks.ts b/src/context/SyntheticsStateContext/hooks/settingsHooks.ts index 2844a1d6b3..a88fa463ba 100644 --- a/src/context/SyntheticsStateContext/hooks/settingsHooks.ts +++ b/src/context/SyntheticsStateContext/hooks/settingsHooks.ts @@ -11,7 +11,7 @@ import { selectShouldUseExecutionFeeBuffer, selectShowDebugValues, } from "../selectors/settingsSelectors"; -import { useSyntheticsStateSelector as useSelector } from "../SyntheticsStateContextProvider"; +import { useSelector } from "../utils"; export const useShowDebugValues = () => useSelector(selectShowDebugValues); export const useSetShowDebugValues = () => useSelector(selectSetShowDebugValues); diff --git a/src/context/SyntheticsStateContext/selectors/__tests__/externalSwapSelectors.spec.ts b/src/context/SyntheticsStateContext/selectors/__tests__/externalSwapSelectors.spec.ts index 0c79faeb87..00ae5363aa 100644 --- a/src/context/SyntheticsStateContext/selectors/__tests__/externalSwapSelectors.spec.ts +++ b/src/context/SyntheticsStateContext/selectors/__tests__/externalSwapSelectors.spec.ts @@ -68,6 +68,8 @@ describe("externalSwapSelectors", () => { chainId: AVALANCHE, marketsInfo: { marketsInfoData, + }, + tokensDataResult: { tokensData, }, positionsInfo: { diff --git a/src/context/SyntheticsStateContext/selectors/chartSelectors/selectChartDynamicLines.tsx b/src/context/SyntheticsStateContext/selectors/chartSelectors/selectChartDynamicLines.tsx index 298007dcdd..3ac2ebaac8 100644 --- a/src/context/SyntheticsStateContext/selectors/chartSelectors/selectChartDynamicLines.tsx +++ b/src/context/SyntheticsStateContext/selectors/chartSelectors/selectChartDynamicLines.tsx @@ -5,7 +5,7 @@ import { selectTokensData, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { createSelector } from "context/SyntheticsStateContext/utils"; -import { PositionOrderInfo, isSwapOrderType } from "domain/synthetics/orders"; +import { PositionOrderInfo, isMarketOrderType, isSwapOrderType } from "domain/synthetics/orders"; import { getTokenData } from "domain/synthetics/tokens"; import { formatAmount } from "lib/numbers"; import { EMPTY_ARRAY } from "lib/objects"; @@ -29,7 +29,7 @@ export const selectChartDynamicLines = createSelector((q) => const orderLines: DynamicChartLine[] = Object.values(ordersInfo || {}) .filter((order) => { - if (isSwapOrderType(order.orderType)) { + if (isSwapOrderType(order.orderType) || isMarketOrderType(order.orderType)) { return false; } diff --git a/src/context/SyntheticsStateContext/selectors/expressSelectors.ts b/src/context/SyntheticsStateContext/selectors/expressSelectors.ts index 17c9439d9f..4136b850a1 100644 --- a/src/context/SyntheticsStateContext/selectors/expressSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/expressSelectors.ts @@ -1,14 +1,14 @@ import { ARBITRUM } from "config/chains"; import { isDevelopment } from "config/env"; -import { GlobalExpressParams } from "domain/synthetics/express"; +import type { GlobalExpressParams } from "domain/synthetics/express"; import { getByKey } from "lib/objects"; import { getRelayerFeeToken } from "sdk/configs/express"; +import type { FindSwapPath } from "sdk/types/trade"; import { createFindSwapPath } from "sdk/utils/swap/swapPath"; import { createSelector } from "../utils"; import { selectChainId, - selectExpressNoncesData, selectGasLimits, selectGasPaymentTokenAllowance, selectGasPrice, @@ -16,7 +16,6 @@ import { selectIsSponsoredCallAvailable, selectL1ExpressOrderGasReference, selectMarketsInfoData, - selectSubaccountForAction, selectTokensData, } from "./globalSelectors"; import { @@ -29,10 +28,14 @@ import { selectTokenPermits } from "./tokenPermitsSelectors"; import { selectGasEstimationParams } from "./tradeSelectors"; export const selectGasPaymentToken = createSelector((q) => { - const gasPaymnetTokenAddress = q(selectGasPaymentTokenAddress); - const tokensData = q(selectTokensData); + const gasPaymentTokenAddress = q(selectGasPaymentTokenAddress); + return q((state) => getByKey(selectTokensData(state), gasPaymentTokenAddress)); +}); - return getByKey(tokensData, gasPaymnetTokenAddress); +export const selectRelayerFeeToken = createSelector((q) => { + const chainId = q(selectChainId); + const relayerFeeTokenAddress = getRelayerFeeToken(chainId).address; + return q((state) => getByKey(selectTokensData(state), relayerFeeTokenAddress)); }); export const selectIsExpressTransactionAvailable = createSelector((q) => { @@ -53,13 +56,10 @@ export const selectExpressGlobalParams = createSelector(function selectExpressGl const chainId = q(selectChainId); const marketsInfoData = q(selectMarketsInfoData); - const gasEstimationParams = q(selectGasEstimationParams); - const noncesData = q(selectExpressNoncesData); const relayerFeeTokenAddress = getRelayerFeeToken(chainId).address; const gasPaymentTokenAddress = q(selectGasPaymentTokenAddress); const l1Reference = q(selectL1ExpressOrderGasReference); const tokensData = q(selectTokensData); - const subaccount = q(selectSubaccountForAction); const gasLimits = q(selectGasLimits); const gasPrice = q(selectGasPrice); const gasPaymentAllowance = q(selectGasPaymentTokenAllowance); @@ -86,27 +86,13 @@ export const selectExpressGlobalParams = createSelector(function selectExpressGl return undefined; } - const _debugSwapMarketsConfig = isDevelopment() ? q(selectDebugSwapMarketsConfig) : undefined; - - const findFeeSwapPath = createFindSwapPath({ - chainId, - fromTokenAddress: gasPaymentTokenAddress, - toTokenAddress: relayerFeeTokenAddress, - marketsInfoData, - isExpressFeeSwap: true, - disabledMarkets: _debugSwapMarketsConfig?.disabledSwapMarkets, - manualPath: _debugSwapMarketsConfig?.manualPath, - gasEstimationParams, - maxSwapPathLength: 1, - }); + const findFeeSwapPath = q(selectExpressFindSwapPath); return { l1Reference, tokensData, marketsInfoData, - noncesData, isSponsoredCall: isSponsoredCallAvailable, - subaccount, findFeeSwapPath, tokenPermits, gasPaymentAllowanceData: gasPaymentAllowance?.tokensAllowanceData, @@ -119,3 +105,27 @@ export const selectExpressGlobalParams = createSelector(function selectExpressGl relayerFeeToken, }; }); + +export const selectExpressFindSwapPath = createSelector(function selectExpressFindSwapPath(q): FindSwapPath { + const chainId = q(selectChainId); + const marketsInfoData = q(selectMarketsInfoData); + const gasEstimationParams = q(selectGasEstimationParams); + const relayerFeeTokenAddress = getRelayerFeeToken(chainId).address; + const gasPaymentTokenAddress = q(selectGasPaymentTokenAddress); + + const _debugSwapMarketsConfig = isDevelopment() ? q(selectDebugSwapMarketsConfig) : undefined; + + const findFeeSwapPath = createFindSwapPath({ + chainId, + fromTokenAddress: gasPaymentTokenAddress, + toTokenAddress: relayerFeeTokenAddress, + marketsInfoData, + isExpressFeeSwap: true, + disabledMarkets: _debugSwapMarketsConfig?.disabledSwapMarkets, + manualPath: _debugSwapMarketsConfig?.manualPath, + gasEstimationParams, + maxSwapPathLength: 1, + }); + + return findFeeSwapPath; +}); diff --git a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts index 062ad42645..a35ff1d13b 100644 --- a/src/context/SyntheticsStateContext/selectors/globalSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/globalSelectors.ts @@ -1,5 +1,6 @@ -import { FeaturesSettings } from "domain/synthetics/features/useDisabledFeatures"; -import { getIsInvalidSubaccount } from "domain/synthetics/subaccount"; +import { getOrderRelayRouterAddress } from "domain/synthetics/express/expressOrderUtils"; +import type { FeaturesSettings } from "domain/synthetics/features/useDisabledFeatures"; +import { getIsInvalidSubaccount } from "domain/synthetics/subaccount/utils"; import { SyntheticsState } from "../SyntheticsStateContextProvider"; import { createSelector, createSelectorDeprecated } from "../utils"; @@ -11,26 +12,25 @@ export const selectIsOrdersLoading = (s: SyntheticsState) => s.globals.ordersInf export const selectPositionsInfoData = (s: SyntheticsState) => s.globals.positionsInfo.positionsInfoData; export const selectIsPositionsLoading = (s: SyntheticsState) => s.globals.positionsInfo.isLoading; export const selectMarketsInfoData = (s: SyntheticsState) => s.globals.marketsInfo.marketsInfoData; -export const selectTokensData = (s: SyntheticsState) => s.globals.marketsInfo.tokensData; -export const selectPricesUpdatedAt = (s: SyntheticsState) => s.globals.marketsInfo.pricesUpdatedAt; +export const selectTokensData = (s: SyntheticsState) => s.globals.tokensDataResult.tokensData; +export const selectPricesUpdatedAt = (s: SyntheticsState) => s.globals.tokensDataResult.pricesUpdatedAt; export const selectGmMarkets = (s: SyntheticsState) => s.globals.markets.marketsData; export const selectUiFeeFactor = (s: SyntheticsState) => s.globals.uiFeeFactor; export const selectUserReferralInfo = (s: SyntheticsState) => s.globals.userReferralInfo; export const selectChainId = (s: SyntheticsState) => s.globals.chainId; +export const selectSrcChainId = (s: SyntheticsState) => s.globals.srcChainId; export const selectDepositMarketTokensData = (s: SyntheticsState) => s.globals.depositMarketTokensData; export const selectIsFirstOrder = (s: SyntheticsState) => s.globals.isFirstOrder; export const selectFeatures = (s: SyntheticsState) => s.features; export const selectIsSponsoredCallAvailable = (s: SyntheticsState) => s.sponsoredCallBalanceData?.isSponsoredCallAllowed ?? false; export const selectSubaccountState = (s: SyntheticsState) => s.subaccountState; -export const selectRawSubaccount = (s: SyntheticsState) => s.subaccountState.subaccount; export const selectGasPaymentTokenAllowance = (s: SyntheticsState) => s.gasPaymentTokenAllowance; -export const selectExpressNoncesData = (s: SyntheticsState) => s.expressNoncesData; export const selectUpdateSubaccountSettings = (s: SyntheticsState) => s.subaccountState.updateSubaccountSettings; export const selectL1ExpressOrderGasReference = (s: SyntheticsState) => s.l1ExpressOrderGasReference; -export const makeSelectEnabledFeature = (feature: keyof FeaturesSettings) => { +const makeSelectEnabledFeature = (feature: keyof FeaturesSettings) => { return createSelector((q) => { const features = q(selectFeatures); return features?.[feature] ?? false; @@ -56,9 +56,9 @@ export const selectGlvAndMarketsInfoData = createSelector((q) => { }; }); -export const selectMinCollateralUsd = (s: SyntheticsState) => s.globals.positionsConstants.minCollateralUsd; -export const selectMinPositionSizeUsd = (s: SyntheticsState) => s.globals.positionsConstants.minPositionSizeUsd; -export const selectMaxAutoCancelOrders = (s: SyntheticsState) => s.globals.positionsConstants.maxAutoCancelOrders; +export const selectMinCollateralUsd = (s: SyntheticsState) => s.globals.positionsConstants?.minCollateralUsd; +export const selectMinPositionSizeUsd = (s: SyntheticsState) => s.globals.positionsConstants?.minPositionSizeUsd; +export const selectMaxAutoCancelOrders = (s: SyntheticsState) => s.globals.positionsConstants?.maxAutoCancelOrders; export const selectClosingPositionKey = (s: SyntheticsState) => s.globals.closingPositionKey; export const selectSetClosingPositionKey = (s: SyntheticsState) => s.globals.setClosingPositionKey; @@ -106,17 +106,65 @@ export const selectPositiveFeePositionsSortedByUsd = createSelector((q) => { ); }); -export const selectSubaccountForAction = createSelector((q) => { +/** + * This selector might return subaccount with approval signed for other chain and lead to errors + */ +export const selectRawSubaccount = (s: SyntheticsState) => s.subaccountState.subaccount; + +export const selectSubaccountForSettlementChainAction = createSelector((q) => { + const chainId = q(selectChainId); + const rawSubaccount = q(selectRawSubaccount); + const isEnabled = q(selectIsSubaccountRelayRouterEnabled); + + if ( + !isEnabled || + !rawSubaccount || + getIsInvalidSubaccount({ + subaccount: rawSubaccount, + requiredActions: 1, + subaccountRouterAddress: getOrderRelayRouterAddress(chainId, true, false), + }) + ) { + return undefined; + } + + return rawSubaccount; +}); + +export const selectSubaccountForMultichainAction = createSelector((q) => { + const chainId = q(selectChainId); const rawSubaccount = q(selectRawSubaccount); const isEnabled = q(selectIsSubaccountRelayRouterEnabled); - if (!isEnabled || !rawSubaccount || getIsInvalidSubaccount(rawSubaccount, 1)) { + if ( + !isEnabled || + !rawSubaccount || + getIsInvalidSubaccount({ + subaccount: rawSubaccount, + requiredActions: 1, + subaccountRouterAddress: getOrderRelayRouterAddress(chainId, true, true), + }) + ) { return undefined; } return rawSubaccount; }); +/** + * When action target contract is purely dependent on srcChainId + * aka its not possible to send multichain txn from settlement chain + * we can use this selector to get subaccount for current source or settlement chain + */ +export const selectSubaccountForChainAction = createSelector((q) => { + const srcChainId = q(selectSrcChainId); + if (srcChainId !== undefined) { + return q(selectSubaccountForMultichainAction); + } + + return q(selectSubaccountForSettlementChainAction); +}); + export const selectOracleSettings = (s: SyntheticsState) => s.globals.oracleSettings; export const selectIsAutoCancelTPSLEnabled = (s: SyntheticsState) => s.settings.isAutoCancelTPSL; diff --git a/src/context/SyntheticsStateContext/selectors/leaderboardSelectors.ts b/src/context/SyntheticsStateContext/selectors/leaderboardSelectors.ts index 9d2aced502..2317cf427d 100644 --- a/src/context/SyntheticsStateContext/selectors/leaderboardSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/leaderboardSelectors.ts @@ -306,8 +306,8 @@ function getCloseFee( referralInfo: { totalRebateFactor: bigint; discountFactor: bigint } | undefined ) { const factor = forPositiveImpact - ? marketInfo.positionFeeFactorForPositiveImpact - : marketInfo.positionFeeFactorForNegativeImpact; + ? marketInfo.positionFeeFactorForBalanceWasImproved + : marketInfo.positionFeeFactorForBalanceWasNotImproved; let positionFeeUsd = applyFactor(sizeDeltaUsd, factor); diff --git a/src/context/SyntheticsStateContext/selectors/orderEditorSelectors.ts b/src/context/SyntheticsStateContext/selectors/orderEditorSelectors.ts index ed81efc1f3..f85f3c0606 100644 --- a/src/context/SyntheticsStateContext/selectors/orderEditorSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/orderEditorSelectors.ts @@ -8,10 +8,6 @@ import { } from "domain/synthetics/fees"; import { getMaxAllowedLeverageByMinCollateralFactor } from "domain/synthetics/markets"; import { - OrderInfo, - OrderType, - PositionOrderInfo, - SwapOrderInfo, isDecreaseOrderType, isIncreaseOrderType, isLimitOrderType, @@ -20,28 +16,32 @@ import { isSwapOrder, isSwapOrderType, isTriggerDecreaseOrderType, + OrderInfo, + OrderType, + PositionOrderInfo, sortPositionOrders, sortSwapOrders, + SwapOrderInfo, } from "domain/synthetics/orders"; import { getPositionOrderError } from "domain/synthetics/orders/getPositionOrderError"; import { getIsPositionInfoLoaded } from "domain/synthetics/positions"; import { - TokensRatio, convertToTokenAmount, convertToUsd, getAmountByRatio, getTokenData, getTokensRatioByPrice, + TokensRatio, } from "domain/synthetics/tokens"; import { - TradeMode, - TradeType, getAcceptablePriceInfo, getDecreasePositionAmounts, getIncreasePositionAmounts, getSwapPathOutputAddresses, getTradeFees, getTradeFlagsForOrder, + TradeMode, + TradeType, } from "domain/synthetics/trade"; import { getPositionKey } from "lib/legacy"; import { BN_ZERO, parseValue } from "lib/numbers"; @@ -66,8 +66,7 @@ import { selectUserReferralInfo, } from "./globalSelectors"; import { selectIsPnlInLeverage, selectSavedAcceptablePriceImpactBuffer } from "./settingsSelectors"; -import { selectExternalSwapQuote } from "./tradeboxSelectors"; -import { selectTradeboxAvailableTokensOptions } from "./tradeboxSelectors"; +import { selectExternalSwapQuote, selectTradeboxAvailableTokensOptions } from "./tradeboxSelectors"; import { makeSelectFindSwapPath, makeSelectNextPositionValuesForIncrease } from "./tradeSelectors"; export const selectCancellingOrdersKeys = (s: SyntheticsState) => s.orderEditor.cancellingOrdersKeys; @@ -128,7 +127,10 @@ export const selectOrderEditorSwapFees = createSelector((q) => { swapSteps: order.swapPathStats?.swapSteps ?? [], positionFeeUsd: 0n, swapPriceImpactDeltaUsd: order.swapPathStats?.totalSwapPriceImpactDeltaUsd ?? 0n, - positionPriceImpactDeltaUsd: 0n, + increasePositionPriceImpactDeltaUsd: 0n, + totalPendingImpactDeltaUsd: 0n, + proportionalPendingImpactDeltaUsd: 0n, + decreasePositionPriceImpactDeltaUsd: 0n, priceImpactDiffUsd: 0n, borrowingFeeUsd: 0n, fundingFeeUsd: 0n, @@ -136,6 +138,7 @@ export const selectOrderEditorSwapFees = createSelector((q) => { swapProfitFeeUsd: 0n, uiFeeFactor, externalSwapQuote: undefined, + type: "increase", }); }); @@ -589,6 +592,7 @@ export const selectOrderEditorPriceImpactFeeBps = createSelector((q) => { getAcceptablePriceInfo({ indexPrice: markPrice!, isIncrease: isIncreaseOrderType(order.orderType), + isLimit: isLimitOrderType(order.orderType), isLong: order.isLong, marketInfo: market, sizeDeltaUsd: sizeDeltaUsd!, diff --git a/src/context/SyntheticsStateContext/selectors/positionEditorSelectors.ts b/src/context/SyntheticsStateContext/selectors/positionEditorSelectors.ts index 31795ee67c..1c4d9f69b4 100644 --- a/src/context/SyntheticsStateContext/selectors/positionEditorSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/positionEditorSelectors.ts @@ -41,6 +41,11 @@ const selectPositionEditorSelectedCollateralAddressMap = (state: SyntheticsState export const selectPositionEditorSetSelectedCollateralAddress = (state: SyntheticsState) => state.positionEditor.setSelectedCollateralAddress; +export const selectPositionEditorIsCollateralTokenFromGmxAccount = (state: SyntheticsState) => + state.positionEditor.isCollateralTokenFromGmxAccount; +export const selectPositionEditorSetIsCollateralTokenFromGmxAccount = (state: SyntheticsState) => + state.positionEditor.setIsCollateralTokenFromGmxAccount; + export const selectPositionEditorSelectedCollateralAddress = createSelector((q) => { const positionKey = q(selectPositionEditorEditingPositionKey); @@ -61,11 +66,20 @@ export const selectPositionEditorSelectedCollateralAddress = createSelector((q) export const selectPositionEditorSelectedCollateralToken = createSelector((q) => { const tokenAddress = q(selectPositionEditorSelectedCollateralAddress); + const isCollateralTokenFromGmxAccount = q(selectPositionEditorIsCollateralTokenFromGmxAccount); if (!tokenAddress) return; const token = q((s) => selectTokensData(s)?.[tokenAddress]); + if (!token) { + return; + } + + if (isCollateralTokenFromGmxAccount && !token.isGmxAccount) { + return { ...token, isGmxAccount: true, balance: token.gmxAccountBalance }; + } + return token; }); diff --git a/src/context/SyntheticsStateContext/selectors/positionSellerSelectors.ts b/src/context/SyntheticsStateContext/selectors/positionSellerSelectors.ts index d44057ee3b..60c15aee4c 100644 --- a/src/context/SyntheticsStateContext/selectors/positionSellerSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/positionSellerSelectors.ts @@ -1,7 +1,5 @@ -import { USD_DECIMALS } from "config/factors"; -import { BASIS_POINTS_DIVISOR_BIGINT } from "config/factors"; -import { estimateExecuteDecreaseOrderGasLimit } from "domain/synthetics/fees"; -import { estimateOrderOraclePriceCount } from "domain/synthetics/fees"; +import { BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; +import { estimateExecuteDecreaseOrderGasLimit, estimateOrderOraclePriceCount } from "domain/synthetics/fees"; import { getIsPositionInfoLoaded, getMinCollateralFactorForPosition, @@ -9,11 +7,11 @@ import { } from "domain/synthetics/positions"; import { applySlippageToPrice, - getSwapAmountsByFromValue, - getNextPositionExecutionPrice, findAllReachableTokens, + getMarkPrice, + getSwapAmountsByFromValue, + getTradeFees, } from "domain/synthetics/trade"; -import { getMarkPrice, getTradeFees } from "domain/synthetics/trade"; import { OrderOption } from "domain/synthetics/trade/usePositionSellerState"; import { parseValue } from "lib/numbers"; import { EMPTY_ARRAY, getByKey } from "lib/objects"; @@ -27,14 +25,14 @@ import { getIsEquivalentTokens } from "sdk/utils/tokens"; import { SyntheticsState } from "../SyntheticsStateContextProvider"; import { createSelector } from "../utils"; import { + selectChainId, selectClosingPositionKey, - selectPositionsInfoData, - selectTokensData, - selectUiFeeFactor, selectGasLimits, selectGasPrice, - selectChainId, selectMarketsInfoData, + selectPositionsInfoData, + selectTokensData, + selectUiFeeFactor, } from "./globalSelectors"; import { selectIsPnlInLeverage } from "./settingsSelectors"; import { @@ -237,6 +235,7 @@ export const selectPositionSellerFees = createSelector((q) => { const collateralDeltaUsd = bigMath.mulDiv(position.collateralUsd, sizeReductionBps, BASIS_POINTS_DIVISOR_BIGINT); const oraclePriceCount = estimateOrderOraclePriceCount(swapPathLength); + return { fees: getTradeFees({ initialCollateralUsd: position.collateralUsd, @@ -246,13 +245,17 @@ export const selectPositionSellerFees = createSelector((q) => { externalSwapQuote: swapAmounts?.swapStrategy.externalSwapQuote, positionFeeUsd: decreaseAmounts.positionFeeUsd, swapPriceImpactDeltaUsd: swapAmounts?.swapStrategy.swapPathStats?.totalSwapPriceImpactDeltaUsd || 0n, - positionPriceImpactDeltaUsd: decreaseAmounts.positionPriceImpactDeltaUsd, + totalPendingImpactDeltaUsd: decreaseAmounts.totalPendingImpactDeltaUsd, + increasePositionPriceImpactDeltaUsd: 0n, priceImpactDiffUsd: decreaseAmounts.priceImpactDiffUsd, + proportionalPendingImpactDeltaUsd: decreaseAmounts.proportionalPendingImpactDeltaUsd, + decreasePositionPriceImpactDeltaUsd: decreaseAmounts.closePriceImpactDeltaUsd, borrowingFeeUsd: decreaseAmounts.borrowingFeeUsd, fundingFeeUsd: decreaseAmounts.fundingFeeUsd, feeDiscountUsd: decreaseAmounts.feeDiscountUsd, swapProfitFeeUsd: decreaseAmounts.swapProfitFeeUsd, uiFeeFactor, + type: "decrease", }), executionFee: getExecutionFee( chainId, @@ -266,30 +269,6 @@ export const selectPositionSellerFees = createSelector((q) => { }; }); -export const selectPositionSellerExecutionPrice = createSelector(function selectPositionSellerExecutionPrice(q) { - const position = q(selectPositionSellerPosition); - const markPrice = q(selectPositionSellerMarkPrice); - const orderOption = q(selectPositionSellerOrderOption); - const { fees } = q(selectPositionSellerFees); - - const decreaseAmounts = q(selectPositionSellerDecreaseAmounts); - - if (!position || fees?.positionPriceImpact?.deltaUsd === undefined) return null; - - const nextTriggerPrice = orderOption === OrderOption.Market ? markPrice : decreaseAmounts?.triggerPrice; - const sizeDeltaUsd = decreaseAmounts?.sizeDeltaUsd; - - if (nextTriggerPrice === undefined || sizeDeltaUsd === undefined) return null; - - return getNextPositionExecutionPrice({ - triggerPrice: nextTriggerPrice, - priceImpactUsd: fees.positionPriceImpact.deltaUsd, - sizeDeltaUsd, - isLong: position.isLong, - isIncrease: false, - }); -}); - export const selectPositionSellerReceiveToken = createSelector((q) => { const orderOption = q(selectPositionSellerOrderOption); const position = q(selectPositionSellerPosition); diff --git a/src/context/SyntheticsStateContext/selectors/tradeSelectors.ts b/src/context/SyntheticsStateContext/selectors/tradeSelectors.ts index 50cea02722..3379daa675 100644 --- a/src/context/SyntheticsStateContext/selectors/tradeSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/tradeSelectors.ts @@ -1,4 +1,4 @@ -import { UiContractsChain } from "config/chains"; +import { ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { isDevelopment } from "config/env"; import { OrderType } from "domain/synthetics/orders"; @@ -136,7 +136,7 @@ export const selectMarketAdjacencyGraph = isDevelopment() const disabledMarketAddresses = debugSwapMarketsConfig.disabledSwapMarkets; const strippedMarkets = Object.fromEntries( - Object.entries(MARKETS[chainId as UiContractsChain]).filter( + Object.entries(MARKETS[chainId as ContractsChainId]).filter( ([marketAddress]) => !disabledMarketAddresses.includes(marketAddress) ) ); diff --git a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.spec.ts b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.spec.ts index d17bd9a52a..9fa8499b82 100644 --- a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.spec.ts +++ b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.spec.ts @@ -13,16 +13,10 @@ describe("tradeboxSelectors", () => { expect(getTradeboxLeverageSliderMarks(180 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 50, 90]); expect(getTradeboxLeverageSliderMarks(200 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 25, 50, 100]); - expect(getTradeboxLeverageSliderMarks(220 * BASIS_POINTS_DIVISOR)).toEqual([ - 0.1, 1, 2, 5, 10, 25, 50, 100, 110, - ]); + expect(getTradeboxLeverageSliderMarks(220 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 25, 50, 100, 110]); expect(getTradeboxLeverageSliderMarks(240 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 30, 60, 120]); - expect(getTradeboxLeverageSliderMarks(250 * BASIS_POINTS_DIVISOR)).toEqual([ - 0.1, 1, 2, 5, 10, 50, 100, 125, - ]); + expect(getTradeboxLeverageSliderMarks(250 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 50, 100, 125]); - expect(getTradeboxLeverageSliderMarks(300 * BASIS_POINTS_DIVISOR)).toEqual([ - 0.1, 1, 2, 5, 10, 50, 100, 150, - ]); + expect(getTradeboxLeverageSliderMarks(300 * BASIS_POINTS_DIVISOR)).toEqual([0.1, 1, 2, 5, 10, 50, 100, 150]); }); }); diff --git a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.ts b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.ts index f225f0651e..5439dfb171 100644 --- a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.ts +++ b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/index.ts @@ -1,3 +1,5 @@ +import { maxUint256 } from "viem"; + import { getSwapDebugSettings, getSwapPriceImpactForExternalSwapThresholdBps } from "config/externalSwaps"; import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; import { SyntheticsState } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; @@ -40,7 +42,6 @@ import { TradeMode, TradeType, getMarkPrice, - getNextPositionExecutionPrice, getSwapAmountsByFromValue, getSwapAmountsByToValue, getTradeFees, @@ -84,6 +85,7 @@ import { selectTradeboxGetMaxLongShortLiquidityPool } from "./selectTradeboxGetM export * from "./selectTradeboxAvailableAndDisabledTokensForCollateral"; export * from "./selectTradeboxAvailableMarketsOptions"; export * from "./selectTradeboxGetMaxLongShortLiquidityPool"; +export * from "./selectTradeboxRelatedMarketsStats"; export const selectExternalSwapInputs = createSelector((q) => { const tradeMode = q(selectTradeboxTradeMode); @@ -282,14 +284,13 @@ export const selectExternalSwapInputsByLeverageSize = createSelector((q) => { }); }); -export * from "./selectTradeboxRelatedMarketsStats"; - const selectOnlyOnTradeboxPage = (s: SyntheticsState, selection: T) => s.pageType === "trade" ? selection : undefined; export const selectTradeboxState = (s: SyntheticsState) => s.tradebox; export const selectTradeboxTradeType = (s: SyntheticsState) => s.tradebox.tradeType; export const selectTradeboxTradeMode = (s: SyntheticsState) => s.tradebox.tradeMode; export const selectTradeboxFromTokenAddress = (s: SyntheticsState) => s.tradebox.fromTokenAddress; +export const selectTradeboxIsFromTokenGmxAccount = (s: SyntheticsState) => s.tradebox.isFromTokenGmxAccount; export const selectTradeboxToTokenAddress = (s: SyntheticsState) => s.tradebox.toTokenAddress; export const selectTradeboxMarketAddress = (s: SyntheticsState) => selectOnlyOnTradeboxPage(s, s.tradebox.marketAddress); @@ -465,7 +466,6 @@ export const selectTradeboxLeverageStrategy = createSelector((q) => { }); export const selectTradeboxIncreasePositionAmounts = createSelector((q) => { - const tokensData = q(selectTokensData); const tradeMode = q(selectTradeboxTradeMode); const tradeType = q(selectTradeboxTradeType); const fromTokenAddress = q(selectTradeboxFromTokenAddress); @@ -479,7 +479,8 @@ export const selectTradeboxIncreasePositionAmounts = createSelector((q) => { const triggerPrice = q(selectTradeboxTriggerPrice); const externalSwapQuote = q(selectExternalSwapQuote); const tradeFlags = createTradeFlags(tradeType, tradeMode); - const fromToken = fromTokenAddress ? getByKey(tokensData, fromTokenAddress) : undefined; + + const fromToken = q(selectTradeboxFromToken); const fromTokenAmount = fromToken ? parseValue(fromTokenInputValue || "0", fromToken.decimals)! : 0n; const positionKey = q(selectTradeboxSelectedPositionKey); const strategy = q(selectTradeboxLeverageStrategy); @@ -769,13 +770,17 @@ export const selectTradeboxFees = createSelector(function selectTradeboxFees(q) externalSwapQuote: swapAmounts.swapStrategy.externalSwapQuote, positionFeeUsd: 0n, swapPriceImpactDeltaUsd: swapAmounts.swapStrategy.swapPathStats.totalSwapPriceImpactDeltaUsd, - positionPriceImpactDeltaUsd: 0n, + increasePositionPriceImpactDeltaUsd: 0n, + decreasePositionPriceImpactDeltaUsd: 0n, priceImpactDiffUsd: 0n, + totalPendingImpactDeltaUsd: 0n, + proportionalPendingImpactDeltaUsd: 0n, borrowingFeeUsd: 0n, fundingFeeUsd: 0n, feeDiscountUsd: 0n, swapProfitFeeUsd: 0n, uiFeeFactor, + type: "swap", }); } case "increase": { @@ -793,13 +798,17 @@ export const selectTradeboxFees = createSelector(function selectTradeboxFees(q) externalSwapQuote: increaseAmounts.swapStrategy.externalSwapQuote, positionFeeUsd: increaseAmounts.positionFeeUsd, swapPriceImpactDeltaUsd: increaseAmounts.swapStrategy.swapPathStats?.totalSwapPriceImpactDeltaUsd || 0n, - positionPriceImpactDeltaUsd: increaseAmounts.positionPriceImpactDeltaUsd, + increasePositionPriceImpactDeltaUsd: increaseAmounts.positionPriceImpactDeltaUsd, + decreasePositionPriceImpactDeltaUsd: 0n, priceImpactDiffUsd: 0n, + totalPendingImpactDeltaUsd: 0n, + proportionalPendingImpactDeltaUsd: 0n, borrowingFeeUsd: selectedPosition?.pendingBorrowingFeesUsd || 0n, fundingFeeUsd: selectedPosition?.pendingFundingFeesUsd || 0n, feeDiscountUsd: increaseAmounts.feeDiscountUsd, swapProfitFeeUsd: 0n, uiFeeFactor, + type: "increase", }); } case "decrease": { @@ -825,13 +834,17 @@ export const selectTradeboxFees = createSelector(function selectTradeboxFees(q) externalSwapQuote: undefined, positionFeeUsd: decreaseAmounts.positionFeeUsd, swapPriceImpactDeltaUsd: 0n, - positionPriceImpactDeltaUsd: decreaseAmounts.positionPriceImpactDeltaUsd, + increasePositionPriceImpactDeltaUsd: 0n, + decreasePositionPriceImpactDeltaUsd: decreaseAmounts.closePriceImpactDeltaUsd, + proportionalPendingImpactDeltaUsd: decreaseAmounts.proportionalPendingImpactDeltaUsd, + totalPendingImpactDeltaUsd: decreaseAmounts.totalPendingImpactDeltaUsd, priceImpactDiffUsd: decreaseAmounts.priceImpactDiffUsd, borrowingFeeUsd: decreaseAmounts.borrowingFeeUsd, fundingFeeUsd: decreaseAmounts.fundingFeeUsd, feeDiscountUsd: decreaseAmounts.feeDiscountUsd, swapProfitFeeUsd: decreaseAmounts.swapProfitFeeUsd, uiFeeFactor, + type: "decrease", }); } case "edit": @@ -843,7 +856,7 @@ export const selectTradeboxFees = createSelector(function selectTradeboxFees(q) const selectNextValuesForIncrease = createSelector( (q): Parameters[0] => { - const tokensData = q(selectTokensData); + // const tokensData = q(selectTokensData); const tradeMode = q(selectTradeboxTradeMode); const tradeType = q(selectTradeboxTradeType); const fromTokenAddress = q(selectTradeboxFromTokenAddress); @@ -860,13 +873,16 @@ const selectNextValuesForIncrease = createSelector( const positionKey = q(selectTradeboxSelectedPositionKey); const tradeFlags = createTradeFlags(tradeType, tradeMode); - const fromToken = fromTokenAddress ? getByKey(tokensData, fromTokenAddress) : undefined; + // const fromToken = fromTokenAddress ? getByKey(tokensData, fromTokenAddress) : undefined; + const fromToken = q(selectTradeboxFromToken); const fromTokenAmount = fromToken ? parseValue(fromTokenInputValue || "0", fromToken.decimals)! : 0n; const leverage = BigInt(parseInt(String(Number(leverageOption!) * BASIS_POINTS_DIVISOR))); const isPnlInLeverage = q(selectIsPnlInLeverage); + const isFromTokenGmxAccount = q(selectTradeboxIsFromTokenGmxAccount); const externalSwapQuote = q(selectExternalSwapQuote); - const isExpressTxn = fromTokenAddress !== NATIVE_TOKEN_ADDRESS && q(selectIsExpressTransactionAvailable); + const isExpressTxn = + isFromTokenGmxAccount || (fromTokenAddress !== NATIVE_TOKEN_ADDRESS && q(selectIsExpressTransactionAvailable)); return { collateralTokenAddress, @@ -1090,11 +1106,12 @@ export const selectTradeboxTradeRatios = createSelector(function selectTradeboxT if (!isSwap) return {}; - const fromTokenAddress = q(selectTradeboxFromTokenAddress); + // const fromTokenAddress = q(selectTradeboxFromTokenAddress); const triggerRatioValue = q(selectTradeboxTriggerRatioValue); const toTokenAddress = q(selectTradeboxToTokenAddress); const toToken = q((s) => (toTokenAddress ? selectTokensData(s)?.[toTokenAddress] : undefined)); - const fromToken = q((s) => (fromTokenAddress ? selectTokensData(s)?.[fromTokenAddress] : undefined)); + // const fromToken = q((s) => (fromTokenAddress ? selectTokensData(s)?.[fromTokenAddress] : undefined)); + const fromToken = q(selectTradeboxFromToken); const fromTokenPrice = fromToken?.prices.minPrice; const markPrice = q(selectTradeboxMarkPrice); @@ -1164,34 +1181,6 @@ export const selectTradeboxLiquidity = createSelector(function selectTradeboxLiq }; }); -export const selectTradeboxExecutionPrice = createSelector(function selectTradeboxExecutionPrice(q) { - const marketInfo = q(selectTradeboxMarketInfo); - const fees = q(selectTradeboxFees); - const decreaseAmounts = q(selectTradeboxDecreasePositionAmounts); - const increaseAmounts = q(selectTradeboxIncreasePositionAmounts); - const triggerPrice = q(selectTradeboxTriggerPrice); - const markPrice = q(selectTradeboxMarkPrice); - - const { isLong, isIncrease, isMarket } = q(selectTradeboxTradeFlags); - - if (!marketInfo) return null; - if (fees?.positionPriceImpact?.deltaUsd === undefined) return null; - - const nextTriggerPrice = isMarket ? markPrice : triggerPrice; - const sizeDeltaUsd = isIncrease ? increaseAmounts?.sizeDeltaUsd : decreaseAmounts?.sizeDeltaUsd; - - if (nextTriggerPrice === undefined) return null; - if (sizeDeltaUsd === undefined) return null; - - return getNextPositionExecutionPrice({ - triggerPrice: nextTriggerPrice, - priceImpactUsd: fees.positionPriceImpact.deltaUsd, - sizeDeltaUsd, - isLong, - isIncrease, - }); -}); - export const selectTradeboxSelectedCollateralTokenSymbol = createSelector((q) => { const selectedCollateralAddress = q(selectTradeboxCollateralTokenAddress); const tokensData = q(selectTokensData); @@ -1225,10 +1214,31 @@ export const selectTradeboxToToken = createSelector((q) => { return q((state) => getByKey(selectTokensData(state), toToken)); }); -export const selectTradeboxFromToken = createSelector((q) => { +export const selectTradeboxFromToken = createSelector((q): TokenData | undefined => { const fromToken = q(selectTradeboxFromTokenAddress); + const isFromTokenGmxAccount = q(selectTradeboxIsFromTokenGmxAccount); - return q((state) => getByKey(selectTokensData(state), fromToken)); + const token = q((state) => getByKey(selectTokensData(state), fromToken)); + + if (token === undefined) { + return undefined; + } + + if (isFromTokenGmxAccount && !token.isGmxAccount) { + return { + ...token, + isGmxAccount: true, + balance: token.gmxAccountBalance, + }; + } else if (!isFromTokenGmxAccount && token.isGmxAccount) { + return { + ...token, + isGmxAccount: false, + balance: token.walletBalance, + }; + } + + return token; }); export const selectTradeboxSwapToTokenAddress = createSelector((q) => { @@ -1286,21 +1296,6 @@ export const selectTradeboxSwapFeesPercentage = createSelector((q) => { return bigMath.mulDiv(swapAmounts.swapStrategy.swapPathStats?.totalSwapFeeUsd * -1n, PRECISION, swapAmounts.usdIn); }); -export const selectTradeboxPriceImpactPercentage = createSelector((q) => { - const fees = q(selectTradeboxFees); - const { isSwap } = q(selectTradeboxTradeFlags); - - if (isSwap) { - return fees?.swapPriceImpact?.precisePercentage ?? 0n; - } - - if (fees?.positionPriceImpact?.precisePercentage === undefined) { - return 0n; - } - - return fees.positionPriceImpact.precisePercentage; -}); - export const selectTradeboxFeesPercentage = createSelector((q) => { const { isSwap } = q(selectTradeboxTradeFlags); @@ -1331,6 +1326,10 @@ export const selectTradeboxPayAmount = createSelector((q) => { }); export const selectTradeboxPayTokenAllowance = createSelector((q) => { + if (q(selectTradeboxIsFromTokenGmxAccount)) { + return maxUint256; + } + const fromTokenAddress = q(selectTradeboxFromTokenAddress); const tokensAllowance = q(selectTradeboxTokensAllowance); @@ -1338,6 +1337,12 @@ export const selectTradeboxPayTokenAllowance = createSelector((q) => { }); export const selectNeedTradeboxPayTokenApproval = createSelector((q) => { + const isFromTokenGmxAccount = q(selectTradeboxIsFromTokenGmxAccount); + + if (isFromTokenGmxAccount) { + return false; + } + const fromTokenAddress = q(selectTradeboxFromTokenAddress); const payAmount = q(selectTradeboxPayAmount); const tokensAllowance = q(selectTradeboxTokensAllowance); diff --git a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxAvailableMarketsOptions.ts b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxAvailableMarketsOptions.ts index ac7ea67bb5..02f74cdb07 100644 --- a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxAvailableMarketsOptions.ts +++ b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxAvailableMarketsOptions.ts @@ -14,6 +14,7 @@ import { selectTradeboxCollateralTokenAddress, selectTradeboxExistingOrder, selectTradeboxFocusedInput, + selectTradeboxFromToken, selectTradeboxFromTokenAddress, selectTradeboxFromTokenInputValue, selectTradeboxIncreasePositionAmounts, @@ -32,13 +33,13 @@ import { SyntheticsState } from "context/SyntheticsStateContext/SyntheticsStateC import { createSelector } from "context/SyntheticsStateContext/utils"; import { getCappedPositionImpactUsd, getFeeItem } from "domain/synthetics/fees"; import { - MarketInfo, getAvailableUsdLiquidityForPosition, getMinPriceImpactMarket, getMostLiquidMarketForPosition, + MarketInfo, } from "domain/synthetics/markets"; import { getLargestRelatedExistingPositionOrOrder } from "domain/synthetics/markets/chooseSuitableMarket"; -import { PositionOrderInfo, isIncreaseOrderType } from "domain/synthetics/orders"; +import { isIncreaseOrderType, PositionOrderInfo } from "domain/synthetics/orders"; import { IndexTokenStat, marketsInfoData2IndexTokenStatsMap, @@ -50,10 +51,10 @@ import { getByKey } from "lib/objects"; import { NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; import { createTradeFlags } from "sdk/utils/trade"; -import { selectTradeboxAvailableMarkets } from "./selectTradeboxAvailableMarkets"; import { selectIsExpressTransactionAvailable } from "../expressSelectors"; import { selectIsLeverageSliderEnabled } from "../settingsSelectors"; import { makeSelectIncreasePositionAmounts } from "../tradeSelectors"; +import { selectTradeboxAvailableMarkets } from "./selectTradeboxAvailableMarkets"; export type AvailableMarketsOptions = { allMarkets?: MarketInfo[]; @@ -211,10 +212,12 @@ export const selectTradeboxAvailableMarketsOptions = createSelector((q) => { marketIncreasePositionAmounts.sizeDeltaUsd ); - const priceImpactDeltaUsd = getCappedPositionImpactUsd( + const { priceImpactDeltaUsd } = getCappedPositionImpactUsd( liquidMarket, marketIncreasePositionAmounts.sizeDeltaUsd, - isLong + isLong, + true, + { shouldCapNegativeImpact: true } ); const { acceptablePriceDeltaBps } = getAcceptablePriceByPriceImpact({ @@ -244,7 +247,7 @@ export const selectTradeboxAvailableMarketsOptions = createSelector((q) => { }); export function getMarketIncreasePositionAmounts(q: QueryFunction, marketAddress: string) { - const tokensData = q(selectTokensData); + // const tokensData = q(selectTokensData); const tradeMode = q(selectTradeboxTradeMode); const tradeType = q(selectTradeboxTradeType); const fromTokenAddress = q(selectTradeboxFromTokenAddress); @@ -258,7 +261,8 @@ export function getMarketIncreasePositionAmounts(q: QueryFunction { marketIncreasePositionAmounts.sizeDeltaUsd ); - const priceImpactDeltaUsd = getCappedPositionImpactUsd( + const { priceImpactDeltaUsd } = getCappedPositionImpactUsd( relatedMarket, marketIncreasePositionAmounts.sizeDeltaUsd, - isLong + isLong, + true, + { shouldCapNegativeImpact: true } ); const { acceptablePriceDeltaBps } = getAcceptablePriceByPriceImpact({ diff --git a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxSidecarOrders.ts b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxSidecarOrders.ts index b0d4e4dab9..d6f60c0842 100644 --- a/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxSidecarOrders.ts +++ b/src/context/SyntheticsStateContext/selectors/tradeboxSelectors/selectTradeboxSidecarOrders.ts @@ -230,7 +230,10 @@ export const selectTradeboxMockPosition = createSelector((q) => { uiFeeUsd: 0n, pendingFundingFeesUsd: 0n, pendingClaimableFundingFeesUsd: 0n, + pendingImpactAmount: 0n, positionFeeAmount: 0n, + netPriceImapctDeltaUsd: 0n, + priceImpactDiffUsd: 0n, traderDiscountAmount: 0n, uiFeeAmount: 0n, }; diff --git a/src/context/SyntheticsStateContext/selectors/transactionsSelectors/tradeBoxOrdersSelectors.ts b/src/context/SyntheticsStateContext/selectors/transactionsSelectors/tradeBoxOrdersSelectors.ts index 59dd5a0292..ac8875e5ec 100644 --- a/src/context/SyntheticsStateContext/selectors/transactionsSelectors/tradeBoxOrdersSelectors.ts +++ b/src/context/SyntheticsStateContext/selectors/transactionsSelectors/tradeBoxOrdersSelectors.ts @@ -146,6 +146,14 @@ export const selectTradeboxIncreaseOrderParams = createSelector((q) => { !collateralTokenAddress || !increaseAmounts ) { + // console.log("selectTradeboxIncreaseOrderParams is undefined", { + // commonParams: !!commonParams, + // fromTokenAddress: !!fromTokenAddress, + // marketAddress: !!marketAddress, + // indexTokenAddress: !!indexTokenAddress, + // collateralTokenAddress: !!collateralTokenAddress, + // increaseAmounts: !!increaseAmounts, + // }); return undefined; } diff --git a/src/context/SyntheticsStateContext/useCollectSyntheticsMetrics.ts b/src/context/SyntheticsStateContext/useCollectSyntheticsMetrics.ts index d7e4c96fe9..1a65cc732a 100644 --- a/src/context/SyntheticsStateContext/useCollectSyntheticsMetrics.ts +++ b/src/context/SyntheticsStateContext/useCollectSyntheticsMetrics.ts @@ -3,10 +3,12 @@ import { useEffect, useState } from "react"; import { MarketsInfoResult } from "domain/synthetics/markets"; import { PositionsInfoData } from "domain/synthetics/positions"; +import { TokensDataResult } from "domain/synthetics/tokens"; import { useMeasureLoadTime } from "lib/metrics"; import useWallet from "lib/wallets/useWallet"; export function useCollectSyntheticsMetrics({ + tokensDataResult, marketsInfo, isCandlesLoaded, positionsInfoData, @@ -14,6 +16,7 @@ export function useCollectSyntheticsMetrics({ isPositionsInfoLoading, pageType, }: { + tokensDataResult: TokensDataResult; marketsInfo: MarketsInfoResult; positionsInfoData: PositionsInfoData | undefined; isPositionsInfoLoading: boolean; @@ -43,9 +46,9 @@ export function useCollectSyntheticsMetrics({ isLoaded: Boolean( marketsInfo.marketsInfoData && account && - marketsInfo.pricesUpdatedAt && - marketsInfo.tokensData && - marketsInfo.isBalancesLoaded && + tokensDataResult.pricesUpdatedAt && + tokensDataResult.tokensData && + tokensDataResult.isBalancesLoaded && isCandlesLoaded ), error: marketsInfo.error, diff --git a/src/context/SyntheticsStateContext/utils.ts b/src/context/SyntheticsStateContext/utils.ts index 80cb64ffcb..3b76b86123 100644 --- a/src/context/SyntheticsStateContext/utils.ts +++ b/src/context/SyntheticsStateContext/utils.ts @@ -1,12 +1,14 @@ import { EnhancedSelector, createSelectionContext } from "@taskworld.com/rereselect"; +import { useCallback } from "react"; import { Selector, createSelector as createSelectorCommon } from "reselect"; +import { Context, createContext, useContext, useContextSelector } from "use-context-selector"; -import { OrderOption } from "domain/synthetics/trade/usePositionSellerState"; -import { ExternalSwapQuote, TradeMode, TradeType } from "sdk/types/trade"; +import type { OrderOption } from "domain/synthetics/trade/usePositionSellerState"; +import type { ExternalSwapQuote, TradeMode, TradeType } from "sdk/types/trade"; import { LRUCache } from "sdk/utils/LruCache"; -import { BatchOrderTxnParams } from "sdk/utils/orderTransactions"; +import type { BatchOrderTxnParams } from "sdk/utils/orderTransactions"; -import { SyntheticsState } from "./SyntheticsStateContextProvider"; +import type { SyntheticsState } from "./SyntheticsStateContextProvider"; const context = createSelectionContext(); export const createSelector = context.makeSelector; @@ -44,8 +46,6 @@ export function getKeyForArgs(...args: SupportedArg[]) { .join(","); } -export { useSyntheticsStateSelector as useSelector } from "./SyntheticsStateContextProvider"; - /** * @deprecated use createSelector instead */ @@ -67,3 +67,23 @@ type Arg = export type SupportedArg = Arg | Record; export type CachedSelector = EnhancedSelector | Selector; + +function useSyntheticsStateSelector(selector: (s: SyntheticsState) => Selected) { + const value = useContext(StateCtx); + if (!value) { + throw new Error("Used useSyntheticsStateSelector outside of SyntheticsStateContextProvider"); + } + return useContextSelector(StateCtx as Context, selector) as Selected; +} + +export const useSelector = useSyntheticsStateSelector; + +export function useCalcSelector() { + return useCallback(function useCalcSelector(selector: (state: SyntheticsState) => Selected) { + if (!latestStateRef.current) throw new Error("Used calcSelector outside of SyntheticsStateContextProvider"); + return selector(latestStateRef.current); + }, []); +} +export const StateCtx = createContext(null); + +export const latestStateRef: { current: SyntheticsState | null } = { current: null }; diff --git a/src/context/WebsocketContext/WebsocketContextProvider.tsx b/src/context/WebsocketContext/WebsocketContextProvider.tsx index a5adab6e44..053ee6f10a 100644 --- a/src/context/WebsocketContext/WebsocketContextProvider.tsx +++ b/src/context/WebsocketContext/WebsocketContextProvider.tsx @@ -1,20 +1,45 @@ import { JsonRpcProvider, WebSocketProvider } from "ethers"; -import { ReactNode, createContext, useContext, useEffect, useMemo, useRef, useState } from "react"; +import uniq from "lodash/uniq"; +import { createContext, ReactNode, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react"; +import { useAccount } from "wagmi"; +import { SourceChainId } from "config/chains"; import { isDevelopment } from "config/env"; +import { isSourceChain } from "config/multichain"; import { useChainId } from "lib/chains"; -import { metrics, WsProviderConnected, WsProviderDisconnected, WsProviderHealthCheckFailed } from "lib/metrics"; +import { + metrics, + WsProviderConnected, + WsProviderDisconnected, + WsProviderHealthCheckFailed, + WsSourceChainProviderConnected, + WsSourceChainProviderDisconnected, +} from "lib/metrics"; +import { EMPTY_OBJECT } from "lib/objects"; import { closeWsConnection, getWsProvider, isProviderInClosedState, isWebsocketProvider } from "lib/rpc"; import { useHasLostFocus } from "lib/useHasPageLostFocus"; -import useWallet from "lib/wallets/useWallet"; import { getTotalSubscribersEventsCount } from "./subscribeToEvents"; const WS_HEALTH_CHECK_INTERVAL = 1000 * 30; const WS_RECONNECT_INTERVAL = 1000 * 5; +const WS_ADDITIONAL_SOURCE_CHAIN_DISCONNECT_DELAY = 1 * 60 * 1000; + +const DEBUG_WEBSOCKETS_LOGGING = false; + +const debugLog = (...args: any[]) => { + if (DEBUG_WEBSOCKETS_LOGGING) { + // eslint-disable-next-line no-console + console.log("[ws]", ...args); + } +}; export type WebsocketContextType = { - wsProvider?: WebSocketProvider | JsonRpcProvider; + wsProvider: WebSocketProvider | JsonRpcProvider | undefined; + wsSourceChainProviders: Partial>; + + setAdditionalSourceChain: (chainId: SourceChainId, name: string) => void; + removeAdditionalSourceChain: (chainId: SourceChainId, name: string) => void; }; export const WsContext = createContext({} as WebsocketContextType); @@ -24,9 +49,15 @@ export function useWebsocketProvider() { } export function WebsocketContextProvider({ children }: { children: ReactNode }) { - const { active } = useWallet(); - const { chainId } = useChainId(); + const { isConnected } = useAccount(); + const { chainId, srcChainId } = useChainId(); const [wsProvider, setWsProvider] = useState(); + const [additionalSourceChains, setAdditionalSourceChains] = + useState>>(EMPTY_OBJECT); + const additionalSourceChainsCleanupTimersRef = useRef>>({}); + const [wsSourceChainProviders, setWsSourceChainProviders] = + useState>>(EMPTY_OBJECT); + const { hasPageLostFocus, hasV1LostFocus, hasV2LostFocus } = useHasLostFocus(); const initializedTime = useRef(); const healthCheckTimerId = useRef(); @@ -37,7 +68,7 @@ export function WebsocketContextProvider({ children }: { children: ReactNode }) useEffect( function updateProviderEffect() { - if (!active || hasPageLostFocus) { + if (!isConnected || hasPageLostFocus) { return; } @@ -72,12 +103,134 @@ export function WebsocketContextProvider({ children }: { children: ReactNode }) }); }; }, - [active, chainId, hasPageLostFocus] + [isConnected, chainId, hasPageLostFocus, srcChainId] ); useEffect( - function healthCheckEff() { - if (!active || hasPageLostFocus || !isWebsocketProvider(wsProvider)) { + function updateSourceChainProviderEffect() { + if (!isConnected || hasPageLostFocus || srcChainId === undefined) { + return; + } + + if (additionalSourceChainsCleanupTimersRef.current[srcChainId]) { + window.clearTimeout(additionalSourceChainsCleanupTimersRef.current[srcChainId]); + delete additionalSourceChainsCleanupTimersRef.current[srcChainId]; + debugLog("cancelling cleanup timer for source chain", srcChainId); + } + + let newSourceChainProvider = getWsProvider(srcChainId); + + if (newSourceChainProvider) { + debugLog("source chain provider connected", srcChainId); + + metrics.pushEvent({ + event: "wsSourceChainProvider.connected", + isError: false, + data: { + chainId: srcChainId, + }, + }); + setWsSourceChainProviders((prev) => { + const newProviders = { ...prev }; + newProviders[srcChainId] = newSourceChainProvider; + return newProviders; + }); + } + + return function cleanup() { + const timer = window.setTimeout(() => { + if (isWebsocketProvider(newSourceChainProvider)) { + debugLog("source chain provider disconnected", srcChainId); + closeWsConnection(newSourceChainProvider); + } + debugLog("source chain provider cleanup", srcChainId); + setWsSourceChainProviders((prev) => { + const newProviders = { ...prev }; + delete newProviders[srcChainId]; + return newProviders; + }); + metrics.pushEvent({ + event: "wsSourceChainProvider.disconnected", + isError: false, + data: { + chainId: srcChainId, + }, + }); + }, WS_ADDITIONAL_SOURCE_CHAIN_DISCONNECT_DELAY); + + // eslint-disable-next-line react-hooks/exhaustive-deps + additionalSourceChainsCleanupTimersRef.current[srcChainId] = timer; + debugLog("scheduling cleanup timer for source chain", srcChainId); + }; + }, + [hasPageLostFocus, isConnected, srcChainId] + ); + + useEffect( + function updateAdditionalSourceChainEffect() { + if (!isConnected || hasPageLostFocus) { + return; + } + + const distinctChains = Object.keys(additionalSourceChains) + .map((chainId) => parseInt(chainId) as SourceChainId) + .filter((chainId) => chainId !== srcChainId && isSourceChain(chainId)); + + if (distinctChains.length === 0) { + return; + } + + const wsProviders: Partial> = {}; + + for (const additionalSourceChain of distinctChains) { + if (additionalSourceChainsCleanupTimersRef.current[additionalSourceChain]) { + window.clearTimeout(additionalSourceChainsCleanupTimersRef.current[additionalSourceChain]); + delete additionalSourceChainsCleanupTimersRef.current[additionalSourceChain]; + debugLog("cancelling cleanup timer for additional source chain", additionalSourceChain); + } + + const newSourceChainProvider = getWsProvider(additionalSourceChain); + + if (newSourceChainProvider) { + wsProviders[additionalSourceChain] = newSourceChainProvider; + } + } + + if (Object.keys(wsProviders).length !== 0) { + setWsSourceChainProviders((prev) => { + return { ...prev, ...wsProviders }; + }); + } + + return function cleanup() { + for (const additionalSourceChain in wsProviders) { + debugLog("scheduling cleanup timer for additional source chain", additionalSourceChain); + + const timer = window.setTimeout(() => { + debugLog("disconnecting from additional source chain", additionalSourceChain); + if (isWebsocketProvider(wsProviders[additionalSourceChain])) { + closeWsConnection(wsProviders[additionalSourceChain]); + } + setWsSourceChainProviders((prev) => { + const newProviders = { ...prev }; + delete newProviders[additionalSourceChain]; + return newProviders; + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + delete additionalSourceChainsCleanupTimersRef.current[additionalSourceChain]; + }, WS_ADDITIONAL_SOURCE_CHAIN_DISCONNECT_DELAY); + + // eslint-disable-next-line react-hooks/exhaustive-deps + additionalSourceChainsCleanupTimersRef.current[additionalSourceChain] = timer; + } + }; + }, + [additionalSourceChains, hasPageLostFocus, isConnected, srcChainId] + ); + + useEffect( + function healthCheckEffect() { + if (!isConnected || hasPageLostFocus || !isWebsocketProvider(wsProvider)) { return; } @@ -134,14 +287,53 @@ export function WebsocketContextProvider({ children }: { children: ReactNode }) clearTimeout(healthCheckTimerId.current); }; }, - [active, chainId, hasPageLostFocus, wsProvider] + [isConnected, chainId, hasPageLostFocus, wsProvider] ); + const setAdditionalSourceChain = useCallback((chainId: SourceChainId, name: string) => { + setAdditionalSourceChains((prev) => { + const newAdditionalSourceChains = structuredClone(prev); + newAdditionalSourceChains[chainId] = uniq((newAdditionalSourceChains[chainId] || []).concat(name)); + return newAdditionalSourceChains; + }); + }, []); + + const removeAdditionalSourceChain = useCallback((chainId: SourceChainId, name: string) => { + setAdditionalSourceChains((prev) => { + const newAdditionalSourceChains = structuredClone(prev); + newAdditionalSourceChains[chainId] = newAdditionalSourceChains[chainId]?.filter((c) => c !== name) || []; + return newAdditionalSourceChains; + }); + }, []); + const state: WebsocketContextType = useMemo(() => { return { wsProvider, + wsSourceChainProviders, + setAdditionalSourceChain, + removeAdditionalSourceChain, }; - }, [wsProvider]); + }, [removeAdditionalSourceChain, setAdditionalSourceChain, wsProvider, wsSourceChainProviders]); return {children}; } + +export function useWsAdditionalSourceChains(chainId: SourceChainId | undefined, name: string) { + const { setAdditionalSourceChain, removeAdditionalSourceChain } = useWebsocketProvider(); + + useEffect(() => { + if (!chainId) { + return; + } + + debugLog("setting up additional source chain", chainId); + + setAdditionalSourceChain(chainId, name); + + return () => { + debugLog("tearing down additional source chain", chainId); + + removeAdditionalSourceChain(chainId, name); + }; + }, [chainId, name, setAdditionalSourceChain, removeAdditionalSourceChain]); +} diff --git a/src/context/WebsocketContext/subscribeToEvents.ts b/src/context/WebsocketContext/subscribeToEvents.ts index 5dcfb4fcf4..a6c419142c 100644 --- a/src/context/WebsocketContext/subscribeToEvents.ts +++ b/src/context/WebsocketContext/subscribeToEvents.ts @@ -1,10 +1,12 @@ -import { AbiCoder, Contract, LogParams, Provider, ProviderEvent, ZeroAddress, ethers, isAddress } from "ethers"; +import { AbiCoder, Contract, ethers, isAddress, LogParams, Provider, ProviderEvent, ZeroAddress } from "ethers"; import { MutableRefObject } from "react"; +import { Abi, ContractEventArgsFromTopics, decodeEventLog, Hex } from "viem"; import { getContract, tryGetContract } from "config/contracts"; import type { EventLogData, EventTxnParams } from "context/SyntheticsEvents/types"; import { abis } from "sdk/abis"; -import { NATIVE_TOKEN_ADDRESS, getTokens } from "sdk/configs/tokens"; +import type { ContractsChainId } from "sdk/configs/chains"; +import { getTokens, NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; const coder = AbiCoder.defaultAbiCoder(); @@ -77,8 +79,54 @@ const GLV_WITHDRAWAL_CANCELLED_HASH = ethers.id("GlvWithdrawalCancelled"); const APPROVED_HASH = ethers.id("Approval(address,address,uint256)"); const TRANSFER_HASH = ethers.id("Transfer(address,address,uint256)"); +const MULTICHAIN_BRIDGE_IN_HASH = ethers.id("MultichainBridgeIn"); + +const OFT_SENT_HASH = ethers.id("OFTSent(bytes32,uint32,address,uint256,uint256)"); +const OFT_RECEIVED_HASH = ethers.id("OFTReceived(bytes32,uint32,address,uint256)"); +const COMPOSE_DELIVERED_HASH = ethers.id("ComposeDelivered(address,address,bytes32,uint16)"); + +export const OFT_SENT_ABI = [ + { + inputs: [ + { indexed: true, internalType: "bytes32", name: "guid", type: "bytes32" }, + { indexed: false, internalType: "uint32", name: "dstEid", type: "uint32" }, + { indexed: true, internalType: "address", name: "fromAddress", type: "address" }, + { indexed: false, internalType: "uint256", name: "amountSentLD", type: "uint256" }, + { indexed: false, internalType: "uint256", name: "amountReceivedLD", type: "uint256" }, + ], + name: "OFTSent", + type: "event", + }, +] as const satisfies Abi; + +export const OFT_RECEIVED_ABI = [ + { + inputs: [ + { indexed: true, internalType: "bytes32", name: "guid", type: "bytes32" }, + { indexed: false, internalType: "uint32", name: "srcEid", type: "uint32" }, + { indexed: true, internalType: "address", name: "toAddress", type: "address" }, + { indexed: false, internalType: "uint256", name: "amountReceivedLD", type: "uint256" }, + ], + name: "OFTReceived", + type: "event", + }, +] as const satisfies Abi; + +export const COMPOSE_DELIVERED_ABI = [ + { + inputs: [ + { indexed: false, internalType: "address", name: "from", type: "address" }, + { indexed: false, internalType: "address", name: "to", type: "address" }, + { indexed: false, internalType: "bytes32", name: "guid", type: "bytes32" }, + { indexed: false, internalType: "uint16", name: "index", type: "uint16" }, + ], + name: "ComposeDelivered", + type: "event", + }, +] as const satisfies Abi; + export function subscribeToV2Events( - chainId: number, + chainId: ContractsChainId, provider: Provider, account: string, eventLogHandlers: MutableRefObject< @@ -144,7 +192,7 @@ export function subscribeToV2Events( } export function subscribeToTransferEvents( - chainId: number, + chainId: ContractsChainId, provider: Provider, account: string, marketTokensAddresses: string[], @@ -216,7 +264,7 @@ export function subscribeToTransferEvents( } export function subscribeToApprovalEvents( - chainId: number, + chainId: ContractsChainId, provider: Provider, account: string, onApprove: (tokenAddress: string, spender: string, value: bigint) => void @@ -255,6 +303,161 @@ export function subscribeToApprovalEvents( }; } +export function subscribeToOftSentEvents( + provider: Provider, + account: string, + stargates: string[], + onOftSent: ( + info: { + sender: string; + txnHash: string; + } & ContractEventArgsFromTopics + ) => void +): () => void { + const addressHash = AbiCoder.defaultAbiCoder().encode(["address"], [account]); + + const providerFilter: ProviderEvent = { + address: stargates, + topics: [OFT_SENT_HASH, null, addressHash], + }; + + const handleOftSentLog = (log: LogParams) => { + const args = decodeEventLog({ + abi: OFT_SENT_ABI, + eventName: "OFTSent", + topics: log.topics as any, + data: log.data as Hex, + }).args; + + onOftSent({ + sender: log.address, + txnHash: log.transactionHash, + ...args, + }); + }; + + provider.on(providerFilter, handleOftSentLog); + + return () => { + provider.off(providerFilter, handleOftSentLog); + }; +} + +export function subscribeToOftReceivedEvents( + provider: Provider, + stargates: string[], + guids: string[], + onOftReceive: ( + info: { sender: string; txnHash: string } & ContractEventArgsFromTopics + ) => void +) { + if (guids.length === 0) { + return undefined; + } + + const providerFilter: ProviderEvent = { + address: stargates, + topics: [OFT_RECEIVED_HASH, guids, null], + }; + + const handleOftReceivedLog = (log: LogParams) => { + const args = decodeEventLog({ + abi: OFT_RECEIVED_ABI, + eventName: "OFTReceived", + topics: log.topics as any, + data: log.data as Hex, + }).args; + + onOftReceive({ + sender: log.address, + txnHash: log.transactionHash, + ...args, + }); + }; + + provider.on(providerFilter, handleOftReceivedLog); + + return () => { + provider.off(providerFilter, handleOftReceivedLog); + }; +} + +export function subscribeToComposeDeliveredEvents( + provider: Provider, + layerZeroEndpoint: string, + guids: string[], + onComposeDelivered: ( + info: { sender: string; txnHash: string } & ContractEventArgsFromTopics< + typeof COMPOSE_DELIVERED_ABI, + "ComposeDelivered" + > + ) => void +) { + if (guids.length === 0) { + return undefined; + } + + const providerFilter: ProviderEvent = { + address: layerZeroEndpoint, + topics: [COMPOSE_DELIVERED_HASH], + }; + + const handleComposeDeliveredLog = (log: LogParams) => { + const args = decodeEventLog({ + abi: COMPOSE_DELIVERED_ABI, + eventName: "ComposeDelivered", + topics: log.topics as any, + data: log.data as Hex, + }).args; + + // Manual filtering because event params are not indexed + if (!guids.includes(args.guid)) { + return; + } + + onComposeDelivered({ + sender: log.address, + txnHash: log.transactionHash, + ...args, + }); + }; + + provider.on(providerFilter, handleComposeDeliveredLog); + + return () => { + provider.off(providerFilter, handleComposeDeliveredLog); + }; +} + +export function subscribeToMultichainApprovalEvents( + provider: Provider, + account: string, + tokenAddresses: string[], + spenders: string[], + onApprove: (tokenAddress: string, spender: string, value: bigint) => void +) { + const spenderTopics = spenders.map((spender) => AbiCoder.defaultAbiCoder().encode(["address"], [spender])); + const addressHash = AbiCoder.defaultAbiCoder().encode(["address"], [account]); + + const approvalsFilter: ProviderEvent = { + address: tokenAddresses, + topics: [APPROVED_HASH, addressHash, spenderTopics], + }; + + const handleApprovalsLog = (log: LogParams) => { + const tokenAddress = log.address; + const spender = ethers.AbiCoder.defaultAbiCoder().decode(["address"], log.topics[2])[0]; + const value = ethers.AbiCoder.defaultAbiCoder().decode(["uint256"], log.data)[0]; + onApprove(tokenAddress, spender, value); + }; + + provider.on(approvalsFilter, handleApprovalsLog); + + return () => { + provider.off(approvalsFilter, handleApprovalsLog); + }; +} + function parseEventLogData(eventData): EventLogData { const ret: any = {}; for (const typeKey of [ @@ -280,7 +483,7 @@ function parseEventLogData(eventData): EventLogData { return ret as EventLogData; } -function createV2EventFilters(chainId: number, account: string, wsProvider: Provider): ProviderEvent[] { +function createV2EventFilters(chainId: ContractsChainId, account: string, wsProvider: Provider): ProviderEvent[] { const addressHash = AbiCoder.defaultAbiCoder().encode(["address"], [account]); const eventEmitter = new ethers.Contract(getContract(chainId, "EventEmitter"), abis.EventEmitter, wsProvider); const EVENT_LOG_TOPIC = eventEmitter.interface.getEvent("EventLog")?.topicHash ?? null; @@ -365,11 +568,16 @@ function createV2EventFilters(chainId: number, account: string, wsProvider: Prov address: getContract(chainId, "EventEmitter"), topics: [EVENT_LOG2_TOPIC, GLV_TOPICS_FILTER, null, addressHash], }, + // Multichain + { + address: getContract(chainId, "EventEmitter"), + topics: [EVENT_LOG1_TOPIC, [MULTICHAIN_BRIDGE_IN_HASH], addressHash], + }, ]; } export function getTotalSubscribersEventsCount( - chainId: number, + chainId: ContractsChainId, provider: Provider, { v1, v2 }: { v1: boolean; v2: boolean } ) { diff --git a/src/domain/multichain/SettlementChainWarningContainer.tsx b/src/domain/multichain/SettlementChainWarningContainer.tsx new file mode 100644 index 0000000000..cc643e11d9 --- /dev/null +++ b/src/domain/multichain/SettlementChainWarningContainer.tsx @@ -0,0 +1,65 @@ +import { Trans } from "@lingui/macro"; +import { useCallback } from "react"; + +import { MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING } from "config/multichain"; +import { getChainName, SettlementChainId } from "config/static/chains"; +import { useGmxAccountSettlementChainId } from "context/GmxAccountContext/hooks"; +import { useEmptyGmxAccounts } from "domain/multichain/useEmptyGmxAccounts"; +import { useChainId } from "lib/chains"; +import { formatUsd } from "lib/numbers"; +import { EMPTY_OBJECT } from "lib/objects"; + +import Button from "components/Button/Button"; +import { ColorfulBanner } from "components/ColorfulBanner/ColorfulBanner"; +import { useAvailableToTradeAssetMultichainRequest } from "components/Synthetics/GmxAccountModal/hooks"; + +import InfoIcon from "img/ic_info.svg?react"; + +export function SettlementChainWarningContainer() { + const { chainId: fallbackChainId, srcChainId } = useChainId(); + + const [settlementChainId, setGmxAccountSettlementChainId] = useGmxAccountSettlementChainId(); + + const settlementChains = srcChainId ? MULTICHAIN_SOURCE_TO_SETTLEMENTS_MAPPING[srcChainId] : undefined; + + const { emptyGmxAccounts } = useEmptyGmxAccounts(settlementChains); + + const isCurrentSettlementChainEmpty = emptyGmxAccounts?.[settlementChainId] === true; + + const anyNonEmptyGmxAccountChainId = Object.entries(emptyGmxAccounts ?? EMPTY_OBJECT) + .filter(([chainId, isEmpty]) => !isEmpty && chainId !== settlementChainId.toString()) + .map(([chainId]) => Number(chainId) as SettlementChainId) + .at(0); + + const { gmxAccountUsd } = useAvailableToTradeAssetMultichainRequest( + anyNonEmptyGmxAccountChainId ?? fallbackChainId, + srcChainId + ); + + const handleNetworkSwitch = useCallback(() => { + if (!anyNonEmptyGmxAccountChainId) { + return; + } + + setGmxAccountSettlementChainId(anyNonEmptyGmxAccountChainId); + }, [setGmxAccountSettlementChainId, anyNonEmptyGmxAccountChainId]); + + if (!anyNonEmptyGmxAccountChainId || !isCurrentSettlementChainEmpty) { + return null; + } + + return ( + +
+ + You switched your settlement network to {getChainName(settlementChainId)}, but you still have{" "} + {formatUsd(gmxAccountUsd)} remaining in your {getChainName(anyNonEmptyGmxAccountChainId)} Deposit + +
+ +
+
+ ); +} diff --git a/src/domain/multichain/arbitraryRelayParams.ts b/src/domain/multichain/arbitraryRelayParams.ts new file mode 100644 index 0000000000..f4404fdc21 --- /dev/null +++ b/src/domain/multichain/arbitraryRelayParams.ts @@ -0,0 +1,419 @@ +import type { Provider } from "ethers"; +import { useMemo } from "react"; +import { Address, encodePacked, Hex } from "viem"; + +import type { ContractsChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { GMX_SIMULATION_ORIGIN } from "config/dataStore"; +import { selectExpressGlobalParams } from "context/SyntheticsStateContext/selectors/expressSelectors"; +import { + selectAccount, + selectChainId, + selectSubaccountForMultichainAction, + selectSubaccountForSettlementChainAction, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectGasPaymentTokenAddress } from "context/SyntheticsStateContext/selectors/settingsSelectors"; +import { useSelector } from "context/SyntheticsStateContext/utils"; +import { + ExpressTransactionBuilder, + ExpressTxnParams, + GasPaymentParams, + GasPaymentValidations, + getRawRelayerParams, + getRelayerFeeParams, + GlobalExpressParams, + RawRelayParamsPayload, + RelayFeePayload, +} from "domain/synthetics/express"; +import { + estimateExpressParams, + getGasPaymentValidations, + getOrderRelayRouterAddress, +} from "domain/synthetics/express/expressOrderUtils"; +import { getSubaccountValidations } from "domain/synthetics/subaccount"; +import type { Subaccount, SubaccountValidations } from "domain/synthetics/subaccount/types"; +import { convertToTokenAmount } from "domain/tokens"; +import { CustomError, isCustomError } from "lib/errors"; +import { metrics } from "lib/metrics"; +import { expandDecimals, USD_DECIMALS } from "lib/numbers"; +import { EMPTY_ARRAY, EMPTY_OBJECT } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; +import { usePrevious } from "lib/usePrevious"; +import { AsyncResult, useThrottledAsync } from "lib/useThrottledAsync"; +import { gelatoRelay } from "sdk/utils/gelatoRelay"; +import { getEmptyExternalCallsPayload, type ExternalCallsPayload } from "sdk/utils/orderTransactions"; + +import { fallbackCustomError } from "./fallbackCustomError"; + +export function getRawBaseRelayerParams({ + chainId, + account, + globalExpressParams, +}: { + chainId: ContractsChainId; + account: string; + globalExpressParams: GlobalExpressParams; +}): Partial<{ + rawBaseRelayParamsPayload: RawRelayParamsPayload; + baseRelayFeeSwapParams: { + feeParams: RelayFeePayload; + externalCalls: ExternalCallsPayload; + feeExternalSwapGasLimit: bigint; + gasPaymentParams: GasPaymentParams; + }; +}> { + const { gasPaymentToken, relayerFeeToken, tokensData, marketsInfoData, gasPrice, findFeeSwapPath } = + globalExpressParams; + + if (!gasPaymentToken || !relayerFeeToken || !account || !tokensData || !marketsInfoData || gasPrice === undefined) { + return EMPTY_OBJECT; + } + + const baseRelayerFeeAmount = convertToTokenAmount( + expandDecimals(1, USD_DECIMALS), + relayerFeeToken.decimals, + relayerFeeToken.prices.maxPrice + )!; + + const baseRelayFeeSwapParams = getRelayerFeeParams({ + chainId: chainId, + account: account, + + gasPaymentToken, + relayerFeeToken, + relayerFeeAmount: baseRelayerFeeAmount, + totalRelayerFeeTokenAmount: baseRelayerFeeAmount, + gasPaymentTokenAsCollateralAmount: 0n, + findFeeSwapPath: findFeeSwapPath, + + transactionExternalCalls: getEmptyExternalCallsPayload(), + feeExternalSwapQuote: undefined, + }); + + if (baseRelayFeeSwapParams === undefined) { + return EMPTY_OBJECT; + } + + const rawBaseRelayParamsPayload = getRawRelayerParams({ + chainId, + gasPaymentTokenAddress: baseRelayFeeSwapParams.gasPaymentParams.gasPaymentTokenAddress, + relayerFeeTokenAddress: baseRelayFeeSwapParams.gasPaymentParams.relayerFeeTokenAddress, + feeParams: baseRelayFeeSwapParams.feeParams, + externalCalls: getEmptyExternalCallsPayload(), + tokenPermits: EMPTY_ARRAY, + marketsInfoData, + }); + + return { rawBaseRelayParamsPayload, baseRelayFeeSwapParams }; +} + +async function estimateArbitraryGasLimit({ + provider, + rawRelayParamsPayload, + gasPaymentParams, + expressTransactionBuilder, + subaccount, + chainId, +}: { + chainId: ContractsChainId; + provider: Provider; + rawRelayParamsPayload: RawRelayParamsPayload; + gasPaymentParams: GasPaymentParams; + expressTransactionBuilder: ExpressTransactionBuilder; + subaccount: Subaccount | undefined; +}): Promise { + const { txnData: baseTxnData } = await expressTransactionBuilder({ + relayParams: rawRelayParamsPayload, + gasPaymentParams, + subaccount, + }); + + const baseData = encodePacked( + ["bytes", "address", "address", "uint256"], + [ + baseTxnData.callData as Hex, + getContract(chainId, "GelatoRelayAddress"), + baseTxnData.feeToken as Address, + baseTxnData.feeAmount, + ] + ); + + const gasLimit = await fallbackCustomError( + async () => + provider.estimateGas({ + from: GMX_SIMULATION_ORIGIN as Address, + to: baseTxnData.to as Address, + data: baseData, + value: 0n, + }), + "gasLimit" + ); + + return gasLimit + 100_000n; +} + +export async function estimateArbitraryRelayFee({ + chainId, + provider, + rawRelayParamsPayload, + expressTransactionBuilder, + gasPaymentParams, + subaccount, +}: { + chainId: ContractsChainId; + provider: Provider; + rawRelayParamsPayload: RawRelayParamsPayload; + expressTransactionBuilder: ExpressTransactionBuilder; + gasPaymentParams: GasPaymentParams; + subaccount: Subaccount | undefined; +}) { + const gasLimit = await estimateArbitraryGasLimit({ + chainId, + provider, + rawRelayParamsPayload, + gasPaymentParams, + expressTransactionBuilder, + subaccount, + }); + + const fee = await gelatoRelay.getEstimatedFee( + BigInt(chainId), + gasPaymentParams.relayerFeeTokenAddress, + gasLimit, + false + ); + + return fee; +} + +export function getArbitraryRelayParamsAndPayload({ + chainId, + account, + isGmxAccount, + relayerFeeAmount, + globalExpressParams, + subaccount, +}: { + chainId: ContractsChainId; + isGmxAccount: boolean; + account: string; + relayerFeeAmount: bigint; + globalExpressParams: GlobalExpressParams; + subaccount: Subaccount | undefined; +}): Partial<{ + relayFeeParams: + | { + feeParams: RelayFeePayload; + externalCalls: ExternalCallsPayload; + feeExternalSwapGasLimit: bigint; + gasPaymentParams: GasPaymentParams; + } + | undefined; + relayParamsPayload: RawRelayParamsPayload | undefined; + gasPaymentValidations: GasPaymentValidations | undefined; + subaccountValidations: SubaccountValidations | undefined; +}> { + if (relayerFeeAmount === undefined) { + return { + relayFeeParams: undefined, + relayParamsPayload: undefined, + gasPaymentValidations: undefined, + subaccountValidations: undefined, + }; + } + + const relayFeeParams = getRelayerFeeParams({ + chainId: chainId, + account: account, + + gasPaymentToken: globalExpressParams.gasPaymentToken, + relayerFeeToken: globalExpressParams.relayerFeeToken, + relayerFeeAmount: relayerFeeAmount, + totalRelayerFeeTokenAmount: relayerFeeAmount, + gasPaymentTokenAsCollateralAmount: 0n, + findFeeSwapPath: globalExpressParams.findFeeSwapPath, + + transactionExternalCalls: getEmptyExternalCallsPayload(), + feeExternalSwapQuote: undefined, + }); + + if (relayFeeParams === undefined) { + return { + relayFeeParams: undefined, + relayParamsPayload: undefined, + gasPaymentValidations: undefined, + subaccountValidations: undefined, + }; + } + + const gasPaymentValidations = getGasPaymentValidations({ + gasPaymentToken: globalExpressParams.gasPaymentToken, + gasPaymentTokenAmount: relayFeeParams.gasPaymentParams.totalRelayerFeeTokenAmount, + gasPaymentTokenAsCollateralAmount: 0n, + gasPaymentAllowanceData: globalExpressParams.gasPaymentAllowanceData ?? EMPTY_OBJECT, + tokenPermits: globalExpressParams.tokenPermits, + isGmxAccount, + }); + + const relayParamsPayload = getRawRelayerParams({ + chainId, + gasPaymentTokenAddress: relayFeeParams.gasPaymentParams.gasPaymentTokenAddress, + relayerFeeTokenAddress: relayFeeParams.gasPaymentParams.relayerFeeTokenAddress, + feeParams: relayFeeParams.feeParams, + externalCalls: getEmptyExternalCallsPayload(), + tokenPermits: [], + marketsInfoData: globalExpressParams.marketsInfoData, + }); + + const subaccountValidations = + subaccount && + getSubaccountValidations({ + requiredActions: 1, + subaccount, + subaccountRouterAddress: getOrderRelayRouterAddress(chainId, true, isGmxAccount), + }); + + return { + relayFeeParams, + relayParamsPayload, + gasPaymentValidations, + subaccountValidations, + }; +} + +export function useArbitraryRelayParamsAndPayload({ + expressTransactionBuilder, + isGmxAccount, +}: { + expressTransactionBuilder: ExpressTransactionBuilder | undefined; + isGmxAccount: boolean; +}): AsyncResult { + const account = useSelector(selectAccount); + const chainId = useSelector(selectChainId); + const globalExpressParams = useSelector(selectExpressGlobalParams); + const subaccount = useSelector( + isGmxAccount ? selectSubaccountForMultichainAction : selectSubaccountForSettlementChainAction + ); + const { provider } = useJsonRpcProvider(chainId); + + const estimationKey = `${globalExpressParams?.gasPaymentTokenAddress}`; + const prevEstimationKey = usePrevious(estimationKey); + + const forceRecalculate = estimationKey !== prevEstimationKey; + + const expressTxnParamsAsyncResult = useThrottledAsync( + async ({ params: p }) => { + const { baseRelayFeeSwapParams, rawBaseRelayParamsPayload } = getRawBaseRelayerParams({ + chainId, + account: p.account, + globalExpressParams: p.globalExpressParams, + }); + + if (baseRelayFeeSwapParams === undefined || rawBaseRelayParamsPayload === undefined) { + throw new Error("no baseRelayFeeSwapParams or rawBaseRelayParamsPayload"); + } + + let gasLimit: bigint = await fallbackCustomError( + async () => + await estimateArbitraryGasLimit({ + chainId, + provider: p.provider, + expressTransactionBuilder: p.expressTransactionBuilder, + rawRelayParamsPayload: rawBaseRelayParamsPayload, + gasPaymentParams: baseRelayFeeSwapParams.gasPaymentParams, + subaccount: p.subaccount, + }), + "gasLimit" + ).catch((error) => { + metrics.pushError(error, "expressArbitrary.estimateGas"); + throw error; + }); + + try { + const expressParams = await estimateExpressParams({ + chainId, + isGmxAccount: p.isGmxAccount, + estimationMethod: "estimateGas", + globalExpressParams: p.globalExpressParams, + provider: p.provider, + requireValidations: true, + subaccount: p.subaccount, + transactionParams: { + account: p.account, + isValid: true, + transactionExternalCalls: getEmptyExternalCallsPayload(), + executionFeeAmount: 0n, + gasPaymentTokenAsCollateralAmount: 0n, + subaccountActions: 0, + transactionPayloadGasLimit: gasLimit, + expressTransactionBuilder: p.expressTransactionBuilder, + executionGasLimit: 0n, + }, + }); + return expressParams; + } catch (error) { + throw new Error("no expressParams"); + } + }, + { + leading: false, + trailing: true, + throttleMs: 2500, + withLoading: true, + params: + account !== undefined && + provider !== undefined && + globalExpressParams !== undefined && + expressTransactionBuilder !== undefined + ? { + account, + chainId, + provider, + globalExpressParams, + expressTransactionBuilder, + isGmxAccount, + subaccount, + } + : undefined, + forceRecalculate, + } + ); + + return expressTxnParamsAsyncResult; +} + +export function useArbitraryError(error: CustomError | Error | undefined): + | { + isOutOfTokenError?: { + tokenAddress: string; + isGasPaymentToken: boolean; + balance: bigint; + requiredAmount: bigint; + }; + } + | undefined { + const gasPaymentTokenAddress = useSelector(selectGasPaymentTokenAddress); + + return useMemo(() => { + if (!isCustomError(error)) { + return { + isOutOfTokenError: undefined, + }; + } + + const isInsufficientMultichainBalance = error.name === "InsufficientMultichainBalance"; + + if (isInsufficientMultichainBalance) { + return { + isOutOfTokenError: { + tokenAddress: error.args[1], + isGasPaymentToken: error.args[1] === gasPaymentTokenAddress, + balance: error.args[2], + requiredAmount: error.args[3], + }, + }; + } + + return undefined; + }, [error, gasPaymentTokenAddress]); +} diff --git a/src/domain/multichain/codecs/CodecUiHelper.ts b/src/domain/multichain/codecs/CodecUiHelper.ts new file mode 100644 index 0000000000..33c824c084 --- /dev/null +++ b/src/domain/multichain/codecs/CodecUiHelper.ts @@ -0,0 +1,129 @@ +import { addressToBytes32 } from "@layerzerolabs/lz-v2-utilities"; +import { Address, concatHex, encodeAbiParameters, Hex, isHex, toHex } from "viem"; + +import { RelayParamsPayload } from "domain/synthetics/express"; +import type { ContractsChainId, SettlementChainId } from "sdk/configs/chains"; +import { getContract } from "sdk/configs/contracts"; + +export enum MultichainActionType { + None = 0, + Deposit = 1, + GlvDeposit = 2, + BridgeOut = 3, + SetTraderReferralCode = 4, +} + +type CommonActionData = { + relayParams: RelayParamsPayload; + signature: string; +}; + +type SetTraderReferralCodeActionData = CommonActionData & { + referralCode: string; +}; + +type SetTraderReferralCodeAction = { + actionType: MultichainActionType.SetTraderReferralCode; + actionData: SetTraderReferralCodeActionData; +}; + +const RELAY_PARAMS_TYPE = { + type: "tuple", + name: "", + components: [ + { + type: "tuple", + name: "oracleParams", + components: [ + { type: "address[]", name: "tokens" }, + { type: "address[]", name: "providers" }, + { type: "bytes[]", name: "data" }, + ], + }, + { + type: "tuple", + name: "externalCalls", + components: [ + { type: "address[]", name: "sendTokens" }, + { type: "uint256[]", name: "sendAmounts" }, + { type: "address[]", name: "externalCallTargets" }, + { type: "bytes[]", name: "externalCallDataList" }, + { type: "address[]", name: "refundTokens" }, + { type: "address[]", name: "refundReceivers" }, + ], + }, + { + type: "tuple[]", + name: "tokenPermits", + components: [ + { type: "address", name: "owner" }, + { type: "address", name: "spender" }, + { type: "uint256", name: "value" }, + { type: "uint256", name: "deadline" }, + { type: "address", name: "token" }, + ], + }, + { + type: "tuple", + name: "fee", + components: [ + { type: "address", name: "feeToken" }, + { type: "uint256", name: "feeAmount" }, + { type: "address[]", name: "feeSwapPath" }, + ], + }, + { type: "uint256", name: "userNonce" }, + { type: "uint256", name: "deadline" }, + { type: "bytes", name: "signature" }, + { type: "uint256", name: "desChainId" }, + ], +} as const; + +export type MultichainAction = SetTraderReferralCodeAction; + +export class CodecUiHelper { + public static encodeDepositMessage(account: string, data?: string): string { + return encodeAbiParameters([{ type: "address" }, { type: "bytes" }], [account as Address, (data as Hex) ?? "0x"]); + } + + public static encodeComposeMsg(composeFromAddress: string, msg: string) { + if (!isHex(msg)) { + throw new Error("msg must start with 0x"); + } + + const composeFrom = toHex(addressToBytes32(composeFromAddress)); + + const composeFromWithMsg = concatHex([composeFrom, msg]); + + return composeFromWithMsg; + } + + public static composeDepositMessage(dstChainId: SettlementChainId, account: string, data?: string) { + const msg = CodecUiHelper.encodeDepositMessage(account, data); + return CodecUiHelper.encodeComposeMsg(CodecUiHelper.getLzEndpoint(dstChainId), msg); + } + + public static getLzEndpoint(chainId: ContractsChainId): Address { + const layerZeroEndpoint = getContract(chainId, "LayerZeroEndpoint"); + + return layerZeroEndpoint; + } + + public static encodeMultichainActionData(action: MultichainAction): string { + if (action.actionType === MultichainActionType.SetTraderReferralCode) { + const actionData = encodeAbiParameters( + [RELAY_PARAMS_TYPE, { type: "bytes32" }], + [ + { ...(action.actionData.relayParams as any), signature: action.actionData.signature as Hex }, + action.actionData.referralCode as Hex, + ] + ); + + const data = encodeAbiParameters([{ type: "uint8" }, { type: "bytes" }], [action.actionType, actionData]); + + return data; + } + + throw new Error("Unsupported multichain action type"); + } +} diff --git a/src/domain/multichain/codecs/OFTComposeMsgCodec.ts b/src/domain/multichain/codecs/OFTComposeMsgCodec.ts new file mode 100644 index 0000000000..50d2c4ecf5 --- /dev/null +++ b/src/domain/multichain/codecs/OFTComposeMsgCodec.ts @@ -0,0 +1,71 @@ +import { encodePacked, Hex, toBytes, bytesToBigInt, bytesToHex } from "viem"; + +export class OFTComposeMsgCodec { + // Offset constants for decoding composed messages + private static readonly NONCE_OFFSET = 8; + private static readonly SRC_EID_OFFSET = 12; + private static readonly AMOUNT_LD_OFFSET = 44; + private static readonly COMPOSE_FROM_OFFSET = 76; + + /** + * @dev Encodes a OFT composed message. + * @param _nonce The nonce value. + * @param _srcEid The source endpoint ID. + * @param _amountLD The amount in local decimals. + * @param _composeMsg The composed message. `0x[composeFrom][composeMsg]` + * @return _msg The encoded Composed message. + */ + public static encode(_nonce: bigint, _srcEid: number, _amountLD: bigint, _composeMsg: string): Hex { + return encodePacked(["uint64", "uint32", "uint256", "bytes"], [_nonce, _srcEid, _amountLD, _composeMsg as Hex]); + } + + /** + * @dev Retrieves the nonce from the composed message. + * @param _msg The message. + * @return The nonce value. + */ + public static nonce(_msg: Hex): bigint { + const bytes = toBytes(_msg); + return bytesToBigInt(bytes.slice(0, OFTComposeMsgCodec.NONCE_OFFSET)); + } + + /** + * @dev Retrieves the source endpoint ID from the composed message. + * @param _msg The message. + * @return The source endpoint ID. + */ + public static srcEid(_msg: Hex): bigint { + const bytes = toBytes(_msg); + return bytesToBigInt(bytes.slice(OFTComposeMsgCodec.NONCE_OFFSET, OFTComposeMsgCodec.SRC_EID_OFFSET)); + } + + /** + * @dev Retrieves the amount in local decimals from the composed message. + * @param _msg The message. + * @return The amount in local decimals. + */ + public static amountLD(_msg: Hex): bigint { + const bytes = toBytes(_msg); + return bytesToBigInt(bytes.slice(OFTComposeMsgCodec.SRC_EID_OFFSET, OFTComposeMsgCodec.AMOUNT_LD_OFFSET)); + } + + /** + * @dev Retrieves the composeFrom value from the composed message. + * @param _msg The message. + * @return The composeFrom value. + */ + public static composeFrom(_msg: Hex): Hex { + const bytes = toBytes(_msg); + return bytesToHex(bytes.slice(OFTComposeMsgCodec.AMOUNT_LD_OFFSET, OFTComposeMsgCodec.COMPOSE_FROM_OFFSET)); + } + + /** + * @dev Retrieves the composed message. + * @param _msg The message. + * @return The composed message. + */ + public static composeMsg(_msg: Hex): Hex { + const bytes = toBytes(_msg); + return bytesToHex(bytes.slice(OFTComposeMsgCodec.COMPOSE_FROM_OFFSET)); + } +} diff --git a/src/domain/multichain/codecs/OftCmd.ts b/src/domain/multichain/codecs/OftCmd.ts new file mode 100644 index 0000000000..aea1e18dca --- /dev/null +++ b/src/domain/multichain/codecs/OftCmd.ts @@ -0,0 +1,18 @@ +import { encodePacked } from "viem"; + +export const SEND_MODE_TAXI = 0; + +export class OftCmd { + constructor( + public sendMode: number, + public passengers: string[] + ) {} + + toBytes(): string { + if (this.sendMode === SEND_MODE_TAXI) { + return "0x"; + } else { + return encodePacked(["uint8"], [this.sendMode]); + } + } +} diff --git a/src/domain/multichain/fallbackCustomError.tsx b/src/domain/multichain/fallbackCustomError.tsx new file mode 100644 index 0000000000..c262726cbf --- /dev/null +++ b/src/domain/multichain/fallbackCustomError.tsx @@ -0,0 +1,37 @@ +import { BaseError, decodeErrorResult, Hex } from "viem"; + +import { CustomError, extendError, getCustomError, OrderErrorContext } from "lib/errors"; +import { abis } from "sdk/abis"; + +export async function fallbackCustomError(f: () => Promise, errorContext: OrderErrorContext) { + try { + return await f(); + } catch (error) { + if ("walk" in error && typeof error.walk === "function") { + const errorWithData = (error as BaseError).walk((e) => "data" in (e as any)) as (Error & { data: string }) | null; + + if (errorWithData && errorWithData.data) { + const data = errorWithData.data; + + const decodedError = decodeErrorResult({ + abi: abis.CustomErrors, + data: data as Hex, + }); + + const prettyError = new CustomError({ + name: decodedError.errorName, + message: JSON.stringify(decodedError, null, 2), + args: decodedError.args, + }); + + throw extendError(prettyError, { + errorContext, + }); + } + } + + throw extendError(getCustomError(error), { + errorContext, + }); + } +} diff --git a/src/domain/multichain/fetchMultichainTokenBalances.spec.ts b/src/domain/multichain/fetchMultichainTokenBalances.spec.ts new file mode 100644 index 0000000000..d50ee7c3e5 --- /dev/null +++ b/src/domain/multichain/fetchMultichainTokenBalances.spec.ts @@ -0,0 +1,27 @@ +import { afterAll, beforeAll, describe, expect, it } from "vitest"; + +import { ARBITRUM, SOURCE_BASE_MAINNET } from "config/chains"; +import { getMulticallBatchingLoggingEnabledKey } from "config/localStorage"; +import { NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; + +import { fetchMultichainTokenBalances } from "./fetchMultichainTokenBalances"; + +const DEBUG = false; + +describe("fetchMultichainTokenBalances", () => { + if (DEBUG) { + beforeAll(() => { + localStorage.setItem(JSON.stringify(getMulticallBatchingLoggingEnabledKey()), "1"); + }); + + afterAll(() => { + localStorage.removeItem(JSON.stringify(getMulticallBatchingLoggingEnabledKey())); + }); + } + + it("should fetch real token balances", async () => { + const account = "0x0000000000000000000000000000000000000000"; + const result = await fetchMultichainTokenBalances(ARBITRUM, account); + expect(result[SOURCE_BASE_MAINNET][NATIVE_TOKEN_ADDRESS]).toBeGreaterThan(0n); + }, 10_000); +}); diff --git a/src/domain/multichain/fetchMultichainTokenBalances.ts b/src/domain/multichain/fetchMultichainTokenBalances.ts new file mode 100644 index 0000000000..beb63233d6 --- /dev/null +++ b/src/domain/multichain/fetchMultichainTokenBalances.ts @@ -0,0 +1,94 @@ +import { zeroAddress } from "viem"; + +import { SettlementChainId, SourceChainId, getChainName } from "config/chains"; +import { MULTICALLS_MAP, MULTICHAIN_TOKEN_MAPPING } from "config/multichain"; +import { executeMulticall } from "lib/multicall/executeMulticall"; +import type { MulticallRequestConfig } from "lib/multicall/types"; + +export async function fetchMultichainTokenBalances( + currentSettlementChainId: SettlementChainId, + account: string, + progressCallback?: (chainId: number, tokensChainData: Record) => void +): Promise>> { + const requests: Promise<{ + chainId: number; + tokensChainData: Record; + }>[] = []; + + const sourceChainTokenIdMap = MULTICHAIN_TOKEN_MAPPING[currentSettlementChainId]; + + const result: Record> = {}; + + for (const sourceChainIdString in sourceChainTokenIdMap) { + const sourceChainId = parseInt(sourceChainIdString) as SourceChainId; + const tokenAddresses = Object.keys(sourceChainTokenIdMap[sourceChainId] ?? {}); + + const requestConfig: MulticallRequestConfig< + Record< + string, + { + calls: Record<"balanceOf", { methodName: "balanceOf" | "getEthBalance"; params: [string] | [] }>; + } + > + > = {}; + + for (const tokenAddress of tokenAddresses) { + if (tokenAddress === zeroAddress) { + requestConfig[tokenAddress] = { + contractAddress: MULTICALLS_MAP[sourceChainId as SourceChainId], + abiId: "Multicall", + calls: { + balanceOf: { + methodName: "getEthBalance", + params: [account], + }, + }, + }; + continue; + } + + requestConfig[tokenAddress] = { + contractAddress: tokenAddress, + abiId: "ERC20", + calls: { + balanceOf: { + methodName: "balanceOf", + params: [account], + }, + }, + }; + } + + const request = executeMulticall( + sourceChainId, + requestConfig, + "urgent", + `fetchMultichainTokens-${getChainName(sourceChainId)}` + ).then((res) => { + const tokensChainData: Record = {}; + for (const tokenAddress of tokenAddresses) { + if (tokenAddress === zeroAddress) { + const balance = res.data[tokenAddress].balanceOf.returnValues[0] ?? 0n; + tokensChainData[tokenAddress] = balance; + continue; + } + + const balance = res.data[tokenAddress].balanceOf.returnValues[0] ?? 0n; + tokensChainData[tokenAddress] = balance; + } + + result[sourceChainId] = tokensChainData; + progressCallback?.(sourceChainId, tokensChainData); + return { + chainId: sourceChainId, + tokensChainData, + }; + }); + + requests.push(request); + } + + await Promise.allSettled(requests); + + return result; +} diff --git a/src/domain/multichain/getSendParams.ts b/src/domain/multichain/getSendParams.ts new file mode 100644 index 0000000000..d3e30adf17 --- /dev/null +++ b/src/domain/multichain/getSendParams.ts @@ -0,0 +1,84 @@ +import { Options, addressToBytes32 } from "@layerzerolabs/lz-v2-utilities"; +import { toHex } from "viem"; + +import type { AnyChainId, ContractsChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { getLayerZeroEndpointId, isSettlementChain, isSourceChain } from "config/multichain"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; + +import { CodecUiHelper, MultichainAction } from "./codecs/CodecUiHelper"; +import { OftCmd, SEND_MODE_TAXI } from "./codecs/OftCmd"; + +/** + * Slippage is set to 0, meaning infinite slippage + */ +export function getMultichainTransferSendParams({ + dstChainId, + account, + srcChainId, + inputAmount, + composeGas, + isDeposit, + action, +}: { + dstChainId: AnyChainId; + account: string; + srcChainId?: AnyChainId; + inputAmount: bigint; + composeGas?: bigint; + isDeposit: boolean; + action?: MultichainAction; +}): SendParamStruct { + const oftCmd: OftCmd = new OftCmd(SEND_MODE_TAXI, []); + + const dstEid = getLayerZeroEndpointId(dstChainId); + + if (dstEid === undefined) { + throw new Error(`No layer zero endpoint for chain id ${dstChainId}`); + } + + if (isDeposit && (!isSettlementChain(dstChainId) || composeGas === undefined)) { + throw new Error("LayerZero provider is not supported on this chain"); + } + + let to: string; + + if (isDeposit) { + to = toHex(addressToBytes32(getContract(dstChainId as ContractsChainId, "LayerZeroProvider"))); + } else { + to = toHex(addressToBytes32(account)); + } + + let composeMsg = "0x"; + let extraOptions = "0x"; + + if (isDeposit) { + if (srcChainId === undefined) { + throw new Error("Source chain is not supported"); + } + if (!isSourceChain(srcChainId)) { + throw new Error("Source chain is not supported"); + } + + const data = action ? CodecUiHelper.encodeMultichainActionData(action) : undefined; + + composeMsg = CodecUiHelper.encodeDepositMessage(account, data); + const builder = Options.newOptions(); + extraOptions = builder.addExecutorComposeOption(0, composeGas!, 0).toHex(); + } else { + const builder = Options.newOptions(); + extraOptions = builder.toHex(); + } + + const sendParams: SendParamStruct = { + dstEid, + to, + amountLD: inputAmount, + minAmountLD: 0n, + extraOptions, + composeMsg, + oftCmd: oftCmd.toBytes(), + }; + + return sendParams; +} diff --git a/src/domain/multichain/gmxAccountTokenBalancesMulticallRequest.ts b/src/domain/multichain/gmxAccountTokenBalancesMulticallRequest.ts new file mode 100644 index 0000000000..00888b4214 --- /dev/null +++ b/src/domain/multichain/gmxAccountTokenBalancesMulticallRequest.ts @@ -0,0 +1,54 @@ +import type { SettlementChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { multichainBalanceKey } from "config/dataStore"; +import { getSettlementChainTradableTokenAddresses } from "config/markets"; +import type { TokenBalancesData } from "domain/tokens"; +import { MulticallRequestConfig, MulticallResult } from "lib/multicall"; + +export function buildGmxAccountTokenBalancesRequest(chainId: SettlementChainId, account: string) { + const tradableTokenAddresses: string[] = getSettlementChainTradableTokenAddresses(chainId); + + const erc20Calls = Object.fromEntries( + tradableTokenAddresses.map((tokenAddress) => [ + tokenAddress, + { + methodName: "getUint", + params: [multichainBalanceKey(account, tokenAddress)], + }, + ]) + ); + + const request: MulticallRequestConfig< + Record< + string, + { + calls: Record; + } + > + > = { + DataStore: { + abiId: "DataStore", + contractAddress: getContract(chainId, "DataStore"), + calls: erc20Calls, + }, + }; + + return request; +} + +export function parseGmxAccountTokenBalancesData( + data: MulticallResult< + MulticallRequestConfig< + Record< + string, + { + calls: Record; + } + > + > + > +): TokenBalancesData { + return Object.fromEntries( + Object.entries(data.data.DataStore).map(([tokenAddress, callResult]) => [tokenAddress, callResult.returnValues[0]]) + ); +} diff --git a/src/domain/multichain/isMultichainFundingItemLoading.ts b/src/domain/multichain/isMultichainFundingItemLoading.ts new file mode 100644 index 0000000000..38366cdbe2 --- /dev/null +++ b/src/domain/multichain/isMultichainFundingItemLoading.ts @@ -0,0 +1,11 @@ +import type { MultichainFundingHistoryItem } from "domain/multichain/types"; + +export function isMultichainFundingItemLoading({ + step, + operation, + isExecutionError, +}: Pick) { + return ( + (step === "submitted" || step === "sent" || (operation === "deposit" && step === "received")) && !isExecutionError + ); +} diff --git a/src/domain/multichain/sendCrossChainDepositTxn.ts b/src/domain/multichain/sendCrossChainDepositTxn.ts new file mode 100644 index 0000000000..5d9a6ff31e --- /dev/null +++ b/src/domain/multichain/sendCrossChainDepositTxn.ts @@ -0,0 +1,46 @@ +import { encodeFunctionData, zeroAddress } from "viem"; + +import type { SourceChainId } from "config/chains"; +import { IStargateAbi } from "config/multichain"; +import type { QuoteSend } from "domain/multichain/types"; +import { TxnCallback, WalletTxnCtx, sendWalletTransaction } from "lib/transactions"; +import type { WalletSigner } from "lib/wallets"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; + +export async function sendCrossChainDepositTxn({ + chainId, + signer, + sendParams, + account, + tokenAddress, + stargateAddress, + quoteSend, + amount, + callback, +}: { + chainId: SourceChainId; + signer: WalletSigner; + tokenAddress: string; + stargateAddress: string; + amount: bigint; + sendParams: SendParamStruct; + account: string; + quoteSend: QuoteSend; + callback?: TxnCallback; +}) { + const isNative = tokenAddress === zeroAddress; + const value = isNative ? amount : 0n; + + await sendWalletTransaction({ + chainId: chainId, + to: stargateAddress, + signer: signer, + callData: encodeFunctionData({ + abi: IStargateAbi, + functionName: "sendToken", + args: [sendParams, quoteSend, account], + }), + value: (quoteSend.nativeFee as bigint) + value, + callback, + }); +} diff --git a/src/domain/multichain/sendSameChainDepositTxn.ts b/src/domain/multichain/sendSameChainDepositTxn.ts new file mode 100644 index 0000000000..2efc6c076b --- /dev/null +++ b/src/domain/multichain/sendSameChainDepositTxn.ts @@ -0,0 +1,86 @@ +import { Contract } from "ethers"; +import { Address, encodeFunctionData, zeroAddress } from "viem"; + +import type { SettlementChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { TxnCallback, WalletTxnCtx, sendWalletTransaction } from "lib/transactions"; +import type { WalletSigner } from "lib/wallets"; +import { abis } from "sdk/abis"; +import { getToken } from "sdk/configs/tokens"; + +export async function sendSameChainDepositTxn({ + chainId, + signer, + tokenAddress, + amount, + account, + callback, +}: { + chainId: SettlementChainId; + signer: WalletSigner; + tokenAddress: string; + amount: bigint; + account: string; + callback?: TxnCallback; +}) { + const multichainVaultAddress = getContract(chainId, "MultichainVault"); + + const contract = new Contract( + getContract(chainId, "MultichainTransferRouter")!, + abis.MultichainTransferRouter, + signer + ); + + if (tokenAddress === zeroAddress) { + const token = getToken(chainId, tokenAddress); + const wrappedAddress = token?.wrappedAddress; + + if (!wrappedAddress) { + throw new Error("Wrapped address is not set"); + } + + await sendWalletTransaction({ + chainId: chainId, + signer: signer, + to: await contract.getAddress(), + callData: contract.interface.encodeFunctionData("multicall", [ + [ + encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "sendWnt", + args: [multichainVaultAddress, amount], + }), + encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "bridgeIn", + args: [account, wrappedAddress as Address], + }), + ], + ]), + value: amount, + callback, + }); + } else { + await sendWalletTransaction({ + chainId: chainId, + signer: signer, + to: await contract.getAddress(), + callData: contract.interface.encodeFunctionData("multicall", [ + [ + encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "sendTokens", + args: [tokenAddress as Address, multichainVaultAddress, amount], + }), + + encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "bridgeIn", + args: [account, tokenAddress as Address], + }), + ], + ]), + callback, + }); + } +} diff --git a/src/domain/multichain/toastEnableExpress.tsx b/src/domain/multichain/toastEnableExpress.tsx new file mode 100644 index 0000000000..2132c44191 --- /dev/null +++ b/src/domain/multichain/toastEnableExpress.tsx @@ -0,0 +1,18 @@ +import { Trans } from "@lingui/macro"; + +import { helperToast } from "lib/helperToast"; + +import Button from "components/Button/Button"; + +export function toastEnableExpress(openSettings: () => void) { + helperToast.error( + + Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in + the{" "} + + . + + ); +} diff --git a/src/domain/multichain/types.ts b/src/domain/multichain/types.ts new file mode 100644 index 0000000000..06db8ceb1d --- /dev/null +++ b/src/domain/multichain/types.ts @@ -0,0 +1,52 @@ +import type { SourceChainId } from "config/chains"; +import type { Token, TokenPrices } from "domain/tokens"; +import type { IRelayUtils } from "typechain-types/LayerZeroProvider"; +import type { + MessagingFeeStructOutput, + OFTFeeDetailStruct, + OFTLimitStruct, + OFTReceiptStruct, +} from "typechain-types-stargate/IStargate"; + +export type TokenChainData = Token & { + sourceChainId: SourceChainId; + sourceChainDecimals: number; + sourceChainPrices: TokenPrices | undefined; + sourceChainBalance: bigint | undefined; +}; + +export type MultichainFundingHistoryItem = { + id: string; + operation: "deposit" | "withdrawal"; + step: "executed" | "received" | "sent" | "submitted"; + settlementChainId: number; + sourceChainId: number; + account: string; + token: string; + sentAmount: bigint; + receivedAmount: bigint | undefined; + + sentTxn: string | undefined; + sentTimestamp: number; + receivedTxn: string | undefined; + receivedTimestamp: number | undefined; + isExecutionError: boolean | null | undefined; + executedTxn: string | undefined; + executedTimestamp: number | undefined; + + isFromWs?: boolean; +}; + +export type StrippedGeneratedType = Omit; + +export type BridgeOutParams = StrippedGeneratedType; + +export type LayerZeroEndpointId = 40161 | 40231 | 40232 | 30184 | 30110 | 30106; + +export type QuoteOft = { + limit: OFTLimitStruct; + oftFeeDetails: OFTFeeDetailStruct[]; + receipt: OFTReceiptStruct; +}; + +export type QuoteSend = StrippedGeneratedType; diff --git a/src/domain/multichain/useDisconnectAndClose.tsx b/src/domain/multichain/useDisconnectAndClose.tsx new file mode 100644 index 0000000000..d1a784378a --- /dev/null +++ b/src/domain/multichain/useDisconnectAndClose.tsx @@ -0,0 +1,31 @@ +import { useCallback } from "react"; +import { useDisconnect } from "wagmi"; + +import { SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY, CURRENT_PROVIDER_LOCALSTORAGE_KEY } from "config/localStorage"; +import { useGmxAccountModalOpen } from "context/GmxAccountContext/hooks"; +import { useSettings } from "context/SettingsContext/SettingsContextProvider"; +import { userAnalytics } from "lib/userAnalytics"; +import { DisconnectWalletEvent } from "lib/userAnalytics/types"; + +export function useDisconnectAndClose() { + const { setIsSettingsVisible } = useSettings(); + const [, setIsVisible] = useGmxAccountModalOpen(); + const { disconnect } = useDisconnect(); + + const handleDisconnect = useCallback(() => { + disconnect(); + userAnalytics.pushEvent({ + event: "ConnectWalletAction", + data: { + action: "Disconnect", + }, + }); + disconnect(); + localStorage.removeItem(SHOULD_EAGER_CONNECT_LOCALSTORAGE_KEY); + localStorage.removeItem(CURRENT_PROVIDER_LOCALSTORAGE_KEY); + setIsVisible(false); + setIsSettingsVisible(false); + }, [disconnect, setIsVisible, setIsSettingsVisible]); + + return handleDisconnect; +} diff --git a/src/domain/multichain/useEmptyGmxAccounts.ts b/src/domain/multichain/useEmptyGmxAccounts.ts new file mode 100644 index 0000000000..a3256d9b46 --- /dev/null +++ b/src/domain/multichain/useEmptyGmxAccounts.ts @@ -0,0 +1,80 @@ +import useSWRSubscription, { SWRSubscription } from "swr/subscription"; +import { useAccount } from "wagmi"; + +import type { SettlementChainId } from "config/chains"; +import { executeMulticall } from "lib/multicall"; +import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; + +import { + buildGmxAccountTokenBalancesRequest, + parseGmxAccountTokenBalancesData, +} from "./gmxAccountTokenBalancesMulticallRequest"; + +const subscribeEmptyGmxAccounts: SWRSubscription< + [name: string, chainIds: SettlementChainId[], account: string], + { + emptyGmxAccounts: Partial>; + isLoading: boolean; + } +> = (key, options) => { + const [, chainIds, account] = key as [string, SettlementChainId[], string]; + + const emptyGmxAccounts: Partial> = {}; + let isLoaded = false; + const didLoadMap: Partial> = {}; + + function fetchEmptyGmxAccounts() { + const requests = chainIds.map(async (chainId) => { + const req = buildGmxAccountTokenBalancesRequest(chainId, account); + const res = await executeMulticall(chainId, req, didLoadMap[chainId] ? "background" : "urgent"); + const parsedRes = parseGmxAccountTokenBalancesData(res); + let isEmpty = true; + for (const balance of Object.values(parsedRes)) { + if (balance > 0n) { + isEmpty = false; + break; + } + } + + emptyGmxAccounts[chainId] = isEmpty; + didLoadMap[chainId] = true; + + options.next(null, { emptyGmxAccounts, isLoading: !isLoaded }); + }); + + Promise.all(requests).then(() => { + if (!isLoaded) { + isLoaded = true; + options.next(null, { emptyGmxAccounts, isLoading: !isLoaded }); + } + }); + } + + fetchEmptyGmxAccounts(); + const interval = window.setInterval(() => { + fetchEmptyGmxAccounts(); + }, CONFIG_UPDATE_INTERVAL); + + return () => { + window.clearInterval(interval); + }; +}; + +export function useEmptyGmxAccounts(chainIds: SettlementChainId[] | undefined): { + emptyGmxAccounts: Partial> | undefined; + isLoading: boolean; +} { + const { address: account } = useAccount(); + + const { data } = useSWRSubscription( + account && chainIds && chainIds.length > 0 ? ["emptyGmxAccounts", chainIds, account] : null, + subscribeEmptyGmxAccounts + ); + const emptyGmxAccounts = data?.emptyGmxAccounts; + const isLoading = data?.isLoading; + + return { + emptyGmxAccounts, + isLoading: isLoading ?? true, + }; +} diff --git a/src/domain/multichain/useGmxAccountFundingHistory.tsx b/src/domain/multichain/useGmxAccountFundingHistory.tsx new file mode 100644 index 0000000000..af9c6fd7a3 --- /dev/null +++ b/src/domain/multichain/useGmxAccountFundingHistory.tsx @@ -0,0 +1,201 @@ +import { useMemo } from "react"; +import useSWR from "swr"; +import { useAccount } from "wagmi"; + +import { getSubgraphUrl } from "config/subgraph"; +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import { MultichainFundingHistoryItem } from "domain/multichain/types"; +import { useChainId } from "lib/chains"; +import { FREQUENT_UPDATE_INTERVAL } from "lib/timeConstants"; +import graphqlFetcher from "sdk/utils/graphqlFetcher"; + +const query = /* gql */ ` +query ($account: String, $guid: String) { + multichainFunding(where: {account: $account, id: $guid}) { + id + step + account + sentAmount + receivedAmount + isExecutionError + executedTimestamp + executedTxn + operation + receivedTimestamp + receivedTxn + sentTimestamp + sentTxn + settlementChainId + sourceChainId + token + } +} +`; + +async function fetchGmxAccountFundingHistory( + chainId: number, + variables: { + account?: string; + guid?: string; + } +): Promise { + const subsquidUrl = getSubgraphUrl(chainId, "subsquid"); + + if (!subsquidUrl) { + throw new Error("No squid url"); + } + + const response = (await graphqlFetcher(subsquidUrl, query, variables)) as { + multichainFunding: MultichainFundingHistoryItem[]; + }; + + return response.multichainFunding.map( + (item): MultichainFundingHistoryItem => ({ + ...item, + sentAmount: BigInt(item.sentAmount), + receivedAmount: item.receivedAmount ? BigInt(item.receivedAmount) : undefined, + sentTimestamp: item.sentTimestamp, + receivedTimestamp: item.receivedTimestamp ? item.receivedTimestamp : undefined, + executedTimestamp: item.executedTimestamp ? item.executedTimestamp : undefined, + + receivedTxn: item.receivedTxn ? item.receivedTxn : undefined, + executedTxn: item.executedTxn ? item.executedTxn : undefined, + }) + ); +} + +const STEP_ORDER: Record = { + submitted: 1, + sent: 2, + received: 3, + executed: 4, +}; + +export function isStepGreaterOrEqual( + step: MultichainFundingHistoryItem["step"], + than: MultichainFundingHistoryItem["step"] +): boolean { + return STEP_ORDER[step] - STEP_ORDER[than] >= 0; +} + +export function isStepGreater( + step: MultichainFundingHistoryItem["step"], + than: MultichainFundingHistoryItem["step"] +): boolean { + return STEP_ORDER[step] - STEP_ORDER[than] > 0; +} + +export function useGmxAccountFundingHistory(opts?: { enabled?: boolean }): { + fundingHistory: MultichainFundingHistoryItem[] | undefined; + isLoading: boolean; +} { + const { chainId } = useChainId(); + const { address: account } = useAccount(); + const { pendingMultichainFunding, updatePendingMultichainFunding } = useSyntheticsEvents(); + + const { data, isLoading } = useSWR( + account && opts?.enabled !== false ? [chainId, "gmx-account-funding-history", account] : null, + { + fetcher: () => fetchGmxAccountFundingHistory(chainId, { account }), + refreshInterval: FREQUENT_UPDATE_INTERVAL, + onSuccess(data) { + updatePendingMultichainFunding(data); + }, + } + ); + + const mergedData = useMemo(() => { + let mergedData = data ? [...data] : []; + const guidToIndex: Partial> = {}; + + for (let index = 0; index < mergedData.length; index++) { + const guid = mergedData[index].id; + guidToIndex[guid] = index; + } + + const dataToUnshift: MultichainFundingHistoryItem[] = []; + + for (const item of pendingMultichainFunding) { + if (item.step === "submitted") { + continue; + } + + const currentIndex = guidToIndex[item.id]; + + if (currentIndex === undefined) { + dataToUnshift.unshift(item); + continue; + } + + const current = mergedData[currentIndex]; + + if (isStepGreaterOrEqual(current.step, item.step)) { + continue; + } + + mergedData[currentIndex] = item; + } + + mergedData = dataToUnshift.concat(mergedData); + + const alreadySentTxns = mergedData.filter((item) => item.sentTxn !== undefined).map((item) => item.sentTxn!); + + const filteredSubmittedEvents = pendingMultichainFunding.filter( + (item) => item.step === "submitted" && (!item.sentTxn || !alreadySentTxns.includes(item.sentTxn)) + ); + + mergedData = [...filteredSubmittedEvents, ...mergedData]; + + mergedData.sort((a, b) => b.sentTimestamp - a.sentTimestamp); + + return mergedData; + }, [data, pendingMultichainFunding]); + + return { fundingHistory: mergedData, isLoading }; +} + +function useGmxAccountPendingFundingHistoryItem(guid: string | undefined): MultichainFundingHistoryItem | undefined { + const { pendingMultichainFunding } = useSyntheticsEvents(); + + const pendingItem = useMemo((): MultichainFundingHistoryItem | undefined => { + if (!guid) { + return undefined; + } + + const pendingItem = pendingMultichainFunding.find((item) => item.id === guid); + + return pendingItem; + }, [guid, pendingMultichainFunding]); + + return pendingItem; +} + +export function useGmxAccountFundingHistoryItem( + guid: string | undefined, + opts?: { refetch?: boolean } +): MultichainFundingHistoryItem | undefined { + const { chainId } = useChainId(); + + const { data } = useSWR(guid ? ["gmx-account-funding-history-item", guid] : null, { + fetcher: () => fetchGmxAccountFundingHistory(chainId, { guid }), + refreshInterval: opts?.refetch ? FREQUENT_UPDATE_INTERVAL : 0, + }); + + const currentItem = data?.[0]; + + const pendingItem = useGmxAccountPendingFundingHistoryItem(guid); + + if (!currentItem && !pendingItem) { + return undefined; + } + + if (!currentItem && pendingItem) { + return pendingItem; + } + + if (currentItem && !pendingItem) { + return currentItem; + } + + return isStepGreaterOrEqual(currentItem!.step, pendingItem!.step) ? currentItem : pendingItem; +} diff --git a/src/domain/multichain/useGmxAccountShowDepositButton.tsx b/src/domain/multichain/useGmxAccountShowDepositButton.tsx new file mode 100644 index 0000000000..8655749ad5 --- /dev/null +++ b/src/domain/multichain/useGmxAccountShowDepositButton.tsx @@ -0,0 +1,11 @@ +import { useChainId } from "lib/chains"; + +import { useAvailableToTradeAssetSettlementChain } from "components/Synthetics/GmxAccountModal/hooks"; + +export function useGmxAccountShowDepositButton() { + const { srcChainId } = useChainId(); + const { gmxAccountUsd, isGmxAccountLoading } = useAvailableToTradeAssetSettlementChain(); + const shouldShowDepositButton = !isGmxAccountLoading && gmxAccountUsd === 0n && srcChainId !== undefined; + + return { shouldShowDepositButton }; +} diff --git a/src/domain/multichain/useGmxAccountTokenBalances.ts b/src/domain/multichain/useGmxAccountTokenBalances.ts new file mode 100644 index 0000000000..7582c73a8c --- /dev/null +++ b/src/domain/multichain/useGmxAccountTokenBalances.ts @@ -0,0 +1,35 @@ +import { useAccount } from "wagmi"; + +import { isSettlementChain } from "config/multichain"; +import type { BalancesDataResult } from "domain/synthetics/tokens"; +import { useMulticall } from "lib/multicall"; +import type { ContractsChainId, SettlementChainId } from "sdk/configs/chains"; + +import { + buildGmxAccountTokenBalancesRequest, + parseGmxAccountTokenBalancesData, +} from "./gmxAccountTokenBalancesMulticallRequest"; + +export function useGmxAccountTokenBalances( + chainId: ContractsChainId, + params?: { + enabled?: boolean; + refreshInterval?: number; + } +): BalancesDataResult { + const { enabled = true, refreshInterval } = params ?? {}; + + const { address: account } = useAccount(); + + const { data, error } = useMulticall(chainId as SettlementChainId, "useGmxAccountTokenBalances", { + key: account && enabled && isSettlementChain(chainId) ? [account] : null, + refreshInterval, + request: (chainId, key) => buildGmxAccountTokenBalancesRequest(chainId, key?.[0] as string), + parseResponse: parseGmxAccountTokenBalancesData, + }); + + return { + balancesData: data, + error, + }; +} diff --git a/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts b/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts new file mode 100644 index 0000000000..eb46d014e5 --- /dev/null +++ b/src/domain/multichain/useMultichainDepositNetworkComposeGas.ts @@ -0,0 +1,168 @@ +import useSWR from "swr"; +import { Address, PublicClient, StateOverride, toHex, zeroAddress, zeroHash } from "viem"; +import { useAccount, usePublicClient } from "wagmi"; + +import { type ContractsChainId, type SettlementChainId, type SourceChainId } from "config/chains"; +import { tryGetContract } from "config/contracts"; +import { + CHAIN_ID_PREFERRED_DEPOSIT_TOKEN, + FAKE_INPUT_AMOUNT_MAP, + getLayerZeroEndpointId, + getStargatePoolAddress, + OVERRIDE_ERC20_BYTECODE, + RANDOM_SLOT, +} from "config/multichain"; +import { useGmxAccountDepositViewChain } from "context/GmxAccountContext/hooks"; +import { useChainId } from "lib/chains"; +import { applyGasLimitBuffer } from "lib/gas/estimateGasLimit"; +import { abis } from "sdk/abis"; +import { getToken } from "sdk/configs/tokens"; + +import { CodecUiHelper, MultichainAction } from "./codecs/CodecUiHelper"; +import { OFTComposeMsgCodec } from "./codecs/OFTComposeMsgCodec"; + +const MULTICHAIN_DEPOSIT_NETWORK_COMPOSE_GAS_REFRESH_INTERVAL = 5000; + +export function useMultichainDepositNetworkComposeGas(opts?: { + enabled?: boolean; + action?: MultichainAction; + tokenAddress?: string; +}): { + composeGas: bigint | undefined; +} { + const { chainId } = useChainId(); + const [depositViewChain] = useGmxAccountDepositViewChain(); + + const tokenAddress: string | undefined = opts?.tokenAddress ?? CHAIN_ID_PREFERRED_DEPOSIT_TOKEN[chainId]; + + const { address: account } = useAccount(); + const settlementChainPublicClient = usePublicClient({ chainId }); + + const composeGasQueryCondition = + settlementChainPublicClient && + account && + depositViewChain && + tokenAddress !== undefined && + getStargatePoolAddress(chainId, tokenAddress) !== undefined && + tryGetContract(chainId, "LayerZeroProvider") !== undefined && + depositViewChain !== (chainId as SourceChainId) && + opts?.enabled !== false; + + const composeGasQuery = useSWR( + composeGasQueryCondition ? ["composeGas", account, chainId, depositViewChain, tokenAddress] : null, + { + fetcher: async () => { + if (!composeGasQueryCondition) { + return undefined; + } + + return estimateMultichainDepositNetworkComposeGas({ + action: opts?.action, + chainId, + account, + srcChainId: depositViewChain, + tokenAddress, + settlementChainPublicClient, + }); + }, + refreshInterval: MULTICHAIN_DEPOSIT_NETWORK_COMPOSE_GAS_REFRESH_INTERVAL, + } + ); + const composeGas = composeGasQuery.data; + + return { + composeGas, + }; +} + +export async function estimateMultichainDepositNetworkComposeGas({ + action, + chainId, + account, + srcChainId, + tokenAddress, + settlementChainPublicClient, +}: { + action?: MultichainAction; + chainId: ContractsChainId; + account: string; + srcChainId: SourceChainId; + tokenAddress: string; + settlementChainPublicClient: PublicClient; +}): Promise { + const data = action ? CodecUiHelper.encodeMultichainActionData(action) : undefined; + const composeFromWithMsg = CodecUiHelper.composeDepositMessage(chainId as SettlementChainId, account, data); + + const settlementChainEndpointId = getLayerZeroEndpointId(chainId); + const sourceChainEndpointId = getLayerZeroEndpointId(srcChainId); + + if (!settlementChainEndpointId) { + throw new Error("Stargate endpoint ID not found"); + } + + if (!sourceChainEndpointId) { + throw new Error("Stargate endpoint ID not found"); + } + + const fakeAmount = FAKE_INPUT_AMOUNT_MAP[getToken(chainId, tokenAddress).symbol] ?? 10n ** 18n; + + const message = OFTComposeMsgCodec.encode(0n, sourceChainEndpointId, fakeAmount, composeFromWithMsg); + + const stargatePool = getStargatePoolAddress(chainId, tokenAddress); + + if (!stargatePool) { + throw new Error("Stargate pool not found"); + } + + const address = tryGetContract(chainId, "LayerZeroProvider")!; + + if (!address) { + throw new Error("LayerZero provider not found"); + } + + const stateOverride: StateOverride = []; + + if (tokenAddress !== zeroAddress) { + const stateOverrideForErc20: StateOverride[number] = { + address: tokenAddress as Address, + code: OVERRIDE_ERC20_BYTECODE, + state: [ + { + slot: RANDOM_SLOT, + value: zeroHash, + }, + ], + }; + stateOverride.push(stateOverrideForErc20); + } else { + const stateOverrideForNative: StateOverride[number] = { + address, + balance: fakeAmount * 2n, + }; + stateOverride.push(stateOverrideForNative); + } + + const args = [ + // From + stargatePool, + // Guid + toHex(0, { size: 32 }), + // Message + message, + // Executor + zeroAddress, + // Extra Data + "0x", + ]; + + const gas = await settlementChainPublicClient.estimateContractGas({ + address, + abi: abis.LayerZeroProvider, + functionName: "lzCompose", + args, + account: CodecUiHelper.getLzEndpoint(chainId), + stateOverride, + }); + + return applyGasLimitBuffer(gas); +} diff --git a/src/domain/multichain/useMultichainFundingToast.tsx b/src/domain/multichain/useMultichainFundingToast.tsx new file mode 100644 index 0000000000..49ae9e600d --- /dev/null +++ b/src/domain/multichain/useMultichainFundingToast.tsx @@ -0,0 +1,117 @@ +import { Trans } from "@lingui/macro"; +import { useEffect, useMemo, useRef } from "react"; +import { ImSpinner2 } from "react-icons/im"; +import { toast, ToastContent } from "react-toastify"; + +import { useSyntheticsEvents } from "context/SyntheticsEvents"; +import type { MultichainFundingHistoryItem } from "domain/multichain/types"; +import { useChainId } from "lib/chains"; +import { useLocalizedMap } from "lib/i18n"; +import { formatBalanceAmount } from "lib/numbers"; +import { EMPTY_OBJECT } from "lib/objects"; +import { getToken } from "sdk/configs/tokens"; + +import { FUNDING_OPERATIONS_LABELS } from "components/Synthetics/GmxAccountModal/keys"; + +import { isMultichainFundingItemLoading } from "./isMultichainFundingItemLoading"; +import { useGmxAccountFundingHistory } from "./useGmxAccountFundingHistory"; + +const TOAST_ID = "multichain-funding-toast"; + +function useGmxAccountPendingFundingHistoryItems( + guids: string[] | undefined +): Partial> | undefined { + const { fundingHistory } = useGmxAccountFundingHistory({ enabled: guids && guids.length > 0 }); + + const pendingItems = useMemo((): Partial> => { + if (!fundingHistory || fundingHistory.length === 0 || !guids || guids.length === 0) { + return EMPTY_OBJECT; + } + const result: Record = {}; + + for (const item of fundingHistory) { + if (guids.includes(item.id)) { + result[item.id] = item; + } + } + + return result; + }, [fundingHistory, guids]); + + return pendingItems; +} + +export function useMultichainFundingToast() { + const { chainId } = useChainId(); + const { multichainFundingPendingIds, removeMultichainFundingPendingIds } = useSyntheticsEvents(); + + const clearTimeout = useRef(); + const dymanicIds = useMemo(() => Object.values(multichainFundingPendingIds), [multichainFundingPendingIds]); + const pendingItems = useGmxAccountPendingFundingHistoryItems(dymanicIds); + + const labels = useLocalizedMap(FUNDING_OPERATIONS_LABELS); + + useEffect(() => { + if (!pendingItems || Object.keys(pendingItems).length === 0) { + if (toast.isActive(TOAST_ID)) { + toast.dismiss(TOAST_ID); + } + return; + } + + const hasDeposits = Object.values(pendingItems).some((item) => item?.operation === "deposit"); + const hasWithdrawals = Object.values(pendingItems).some((item) => item?.operation === "withdrawal"); + + window.clearTimeout(clearTimeout.current); + clearTimeout.current = undefined; + + let content: ToastContent = ( +
+ {hasDeposits && !hasWithdrawals && Depositing Funds to GMX} + {hasWithdrawals && !hasDeposits && Withdrawing Funds from GMX} + {hasDeposits && hasWithdrawals && Depositing and Withdrawing Funds to/from GMX} + {Object.keys(multichainFundingPendingIds).map((staticId, index, array) => { + const guid = multichainFundingPendingIds[staticId]; + const item = pendingItems[guid]; + if (!item) { + return null; + } + + const token = getToken(chainId, item.token); + + const formattedAmount = formatBalanceAmount(item.sentAmount, token.decimals, token.symbol); + + const isLoading = isMultichainFundingItemLoading(item); + + return ( +
+
+ {item.operation === "deposit" ? Deposit : Withdraw} + {array.length > 1 && <> {formattedAmount}} +
+ {isLoading && } +
+ ); + })} +
+ ); + + if (toast.isActive(TOAST_ID)) { + toast.update(TOAST_ID, { + render: content, + onClose: () => { + removeMultichainFundingPendingIds(Object.keys(multichainFundingPendingIds)); + }, + }); + } else { + toast(content, { + toastId: TOAST_ID, + type: "success", + autoClose: false, + onClose: () => { + removeMultichainFundingPendingIds(Object.keys(multichainFundingPendingIds)); + }, + }); + } + }, [chainId, labels, multichainFundingPendingIds, pendingItems, removeMultichainFundingPendingIds]); +} diff --git a/src/domain/multichain/useMultichainQuoteFeeUsd.ts b/src/domain/multichain/useMultichainQuoteFeeUsd.ts new file mode 100644 index 0000000000..792ed33f69 --- /dev/null +++ b/src/domain/multichain/useMultichainQuoteFeeUsd.ts @@ -0,0 +1,93 @@ +import { zeroAddress } from "viem"; + +import type { SettlementChainId, SourceChainId } from "config/chains"; +import { getMappedTokenId } from "config/multichain"; +import { useTokenRecentPricesRequest } from "domain/synthetics/tokens"; +import { convertToUsd } from "domain/tokens"; +import { useChainId } from "lib/chains"; +import { getToken } from "sdk/configs/tokens"; + +import type { QuoteOft, QuoteSend } from "./types"; + +export function useMultichainQuoteFeeUsd({ + quoteSend, + quoteOft, + unwrappedTokenAddress, + srcChainId, +}: { + quoteSend: QuoteSend | undefined; + quoteOft: QuoteOft | undefined; + unwrappedTokenAddress: string | undefined; + srcChainId: SourceChainId | undefined; +}): { + networkFee: bigint | undefined; + networkFeeUsd: bigint | undefined; + protocolFeeAmount: bigint | undefined; + protocolFeeUsd: bigint | undefined; + amountReceivedLD: bigint | undefined; +} { + const { chainId } = useChainId(); + const { pricesData: settlementChainTokenPricesData } = useTokenRecentPricesRequest(chainId); + + if (!unwrappedTokenAddress || srcChainId === undefined) { + return { + networkFee: undefined, + networkFeeUsd: undefined, + protocolFeeAmount: undefined, + protocolFeeUsd: undefined, + amountReceivedLD: undefined, + }; + } + + const sourceChainTokenId = getMappedTokenId( + chainId as SettlementChainId, + unwrappedTokenAddress, + srcChainId as SourceChainId + ); + + if (!sourceChainTokenId) { + return { + networkFee: undefined, + networkFeeUsd: undefined, + protocolFeeAmount: undefined, + protocolFeeUsd: undefined, + amountReceivedLD: undefined, + }; + } + + const nativeFee = quoteSend?.nativeFee as bigint; + const amountReceivedLD = quoteOft?.receipt.amountReceivedLD as bigint; + + // ETH is the same as the source chain + // TODO: check if this is correct + const nativeTokenPrices = settlementChainTokenPricesData?.[zeroAddress]; + const depositTokenPrices = settlementChainTokenPricesData?.[unwrappedTokenAddress]; + const sourceChainNativeTokenDecimals = getToken(chainId, zeroAddress)?.decimals ?? 18; + + const sourceChainDepositTokenDecimals = sourceChainTokenId?.decimals; + + const nativeFeeUsd = + nativeFee !== undefined + ? convertToUsd(nativeFee as bigint, sourceChainNativeTokenDecimals, nativeTokenPrices?.maxPrice) + : undefined; + + let protocolFeeAmount: bigint | undefined = undefined; + let protocolFeeUsd: bigint | undefined = undefined; + if (quoteOft !== undefined) { + protocolFeeAmount = 0n; + for (const feeDetail of quoteOft.oftFeeDetails) { + if (feeDetail.feeAmountLD) { + protocolFeeAmount -= feeDetail.feeAmountLD as bigint; + } + } + protocolFeeUsd = convertToUsd(protocolFeeAmount, sourceChainDepositTokenDecimals, depositTokenPrices?.maxPrice); + } + + return { + networkFee: nativeFee, + networkFeeUsd: nativeFeeUsd, + protocolFeeAmount, + protocolFeeUsd, + amountReceivedLD, + }; +} diff --git a/src/domain/multichain/useQuoteOft.ts b/src/domain/multichain/useQuoteOft.ts new file mode 100644 index 0000000000..b9eacf711b --- /dev/null +++ b/src/domain/multichain/useQuoteOft.ts @@ -0,0 +1,69 @@ +import { Contract, Provider } from "ethers"; +import useSWR from "swr"; + +import type { AnyChainId } from "config/chains"; +import { IStargateAbi } from "config/multichain"; +import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import { IStargate } from "typechain-types-stargate"; +import type { + OFTFeeDetailStruct, + OFTLimitStruct, + OFTReceiptStruct, + SendParamStruct, +} from "typechain-types-stargate/IStargate"; + +import type { QuoteOft } from "./types"; + +export function useQuoteOft({ + sendParams, + fromStargateAddress, + fromChainProvider, + fromChainId, + toChainId, +}: { + sendParams: SendParamStruct | undefined; + fromStargateAddress: string | undefined; + fromChainProvider: Provider | undefined; + fromChainId: AnyChainId | undefined; + toChainId: AnyChainId | undefined; +}): QuoteOft | undefined { + const quoteOftCondition = + sendParams !== undefined && + fromStargateAddress !== undefined && + fromChainProvider !== undefined && + toChainId !== undefined && + fromChainId !== undefined && + fromChainId !== toChainId; + + const quoteOftQuery = useSWR( + quoteOftCondition ? ["quoteOft", sendParams.dstEid, sendParams.to, sendParams.amountLD, fromStargateAddress] : null, + { + fetcher: async () => { + if (!quoteOftCondition) { + return; + } + + const iStargateInstance = new Contract( + fromStargateAddress, + IStargateAbi, + fromChainProvider + ) as unknown as IStargate; + + // TODO: add timing metrics + const [limit, oftFeeDetails, receipt]: [OFTLimitStruct, OFTFeeDetailStruct[], OFTReceiptStruct] = + await iStargateInstance.quoteOFT(sendParams); + + return { + limit, + oftFeeDetails, + receipt, + }; + }, + refreshInterval: CONFIG_UPDATE_INTERVAL, + } + ); + + const quoteOft = quoteOftQuery.data; + + return quoteOft; +} diff --git a/src/domain/multichain/useQuoteOftLimits.ts b/src/domain/multichain/useQuoteOftLimits.ts new file mode 100644 index 0000000000..9f4b71143d --- /dev/null +++ b/src/domain/multichain/useQuoteOftLimits.ts @@ -0,0 +1,55 @@ +import { useRef } from "react"; + +import type { QuoteOft } from "domain/multichain/types"; +import { formatBalanceAmount } from "lib/numbers"; + +export function useQuoteOftLimits({ + quoteOft, + inputAmount, + isStable, + decimals, +}: { + quoteOft: QuoteOft | undefined; + inputAmount: bigint | undefined; + isStable: boolean | undefined; + decimals: number | undefined; +}) { + const lastMinAmountLD = useRef(undefined); + const lastMaxAmountLD = useRef(undefined); + + if (quoteOft && quoteOft.limit.maxAmountLD && quoteOft.limit.minAmountLD) { + lastMaxAmountLD.current = quoteOft.limit.maxAmountLD as bigint; + lastMinAmountLD.current = quoteOft.limit.minAmountLD as bigint; + } + + const isBelowLimit = + lastMinAmountLD.current !== undefined && inputAmount !== undefined && inputAmount > 0n + ? inputAmount < lastMinAmountLD.current + : false; + + const lowerLimitFormatted = + isBelowLimit && decimals && lastMinAmountLD.current !== undefined + ? formatBalanceAmount(lastMinAmountLD.current, decimals, undefined, { + isStable, + }) + : undefined; + + const isAboveLimit = + lastMaxAmountLD.current !== undefined && inputAmount !== undefined && inputAmount > 0n + ? inputAmount > lastMaxAmountLD.current + : false; + + const upperLimitFormatted = + isAboveLimit && decimals && lastMaxAmountLD.current !== undefined + ? formatBalanceAmount(lastMaxAmountLD.current, decimals, undefined, { + isStable, + }) + : undefined; + + return { + isBelowLimit, + lowerLimitFormatted, + isAboveLimit, + upperLimitFormatted, + }; +} diff --git a/src/domain/multichain/useQuoteSend.ts b/src/domain/multichain/useQuoteSend.ts new file mode 100644 index 0000000000..93e544c1a6 --- /dev/null +++ b/src/domain/multichain/useQuoteSend.ts @@ -0,0 +1,65 @@ +import { Contract, Provider } from "ethers"; +import useSWR from "swr"; + +import type { AnyChainId } from "config/chains"; +import { IStargateAbi } from "config/multichain"; +import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { IStargate } from "typechain-types-stargate"; +import type { SendParamStruct } from "typechain-types-stargate/IStargate"; + +import type { QuoteSend } from "./types"; + +export function useQuoteSend({ + sendParams, + fromStargateAddress, + fromChainProvider, + fromChainId, + toChainId, + composeGas, +}: { + sendParams: SendParamStruct | undefined; + fromStargateAddress: string | undefined; + fromChainProvider: Provider | undefined; + fromChainId: AnyChainId | undefined; + toChainId: AnyChainId | undefined; + composeGas?: bigint; +}) { + const quoteSendCondition = + sendParams !== undefined && + fromStargateAddress !== undefined && + fromChainProvider !== undefined && + toChainId !== undefined && + fromChainId !== undefined && + fromChainId !== toChainId; + + const quoteSendQuery = useSWR( + quoteSendCondition + ? ["quoteSend", sendParams.dstEid, sendParams.to, sendParams.amountLD, fromStargateAddress, composeGas] + : null, + { + fetcher: async () => { + if (!quoteSendCondition) { + return; + } + + const iStargateInstance = new Contract( + fromStargateAddress, + IStargateAbi, + fromChainProvider + ) as unknown as IStargate; + + const result = await iStargateInstance.quoteSend(sendParams, false); + + return { + nativeFee: result.nativeFee, + lzTokenFee: result.lzTokenFee, + }; + }, + refreshInterval: CONFIG_UPDATE_INTERVAL, + } + ); + + const quoteSend = quoteSendQuery.data; + + return quoteSend; +} diff --git a/src/domain/referrals/hooks/index.ts b/src/domain/referrals/hooks/index.ts index fb822097d6..253f46543e 100644 --- a/src/domain/referrals/hooks/index.ts +++ b/src/domain/referrals/hooks/index.ts @@ -1,8 +1,8 @@ import { gql } from "@apollo/client"; -import { BigNumberish, Signer, ethers, isAddress } from "ethers"; +import { BigNumberish, ethers, isAddress, Signer } from "ethers"; import { useEffect, useMemo, useState } from "react"; import useSWR from "swr"; -import { Hash } from "viem"; +import { Hash, zeroAddress } from "viem"; import { BOTANIX } from "config/chains"; import { getContract } from "config/contracts"; @@ -15,19 +15,20 @@ import { getProvider } from "lib/rpc"; import { getReferralsGraphClient } from "lib/subgraph"; import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; import { abis } from "sdk/abis"; +import { ContractsChainId } from "sdk/configs/chains"; import { decodeReferralCode, encodeReferralCode } from "sdk/utils/referrals"; import { REGEX_VERIFY_BYTES32 } from "components/Referrals/referralsHelper"; import { UserReferralInfo } from "../types"; +export * from "./useReferralCodeFromUrl"; export * from "./useReferralsData"; export * from "./useUserCodesOnAllChain"; -export * from "./useReferralCodeFromUrl"; export function useUserReferralInfoRequest( signer: Signer | undefined, - chainId: number, + chainId: ContractsChainId, account?: string | null, skipLocalReferralCode = false ): UserReferralInfo | undefined { @@ -109,7 +110,7 @@ export function useAffiliateTier(signer, chainId, account) { }; } -export function useTiers(signer: Signer | undefined, chainId: number, tierLevel?: BigNumberish) { +export function useTiers(signer: Signer | undefined, chainId: ContractsChainId, tierLevel?: BigNumberish) { const referralStorageAddress = getContract(chainId, "ReferralStorage"); const { data: [totalRebate, discountShare] = [], error } = useSWR( @@ -129,7 +130,7 @@ export function useTiers(signer: Signer | undefined, chainId: number, tierLevel? }; } -export async function setAffiliateTier(chainId: number, affiliate: string, tierId: number, signer, opts) { +export async function setAffiliateTier(chainId: ContractsChainId, affiliate: string, tierId: number, signer, opts) { const referralStorageAddress = getContract(chainId, "ReferralStorage"); const timelockAddress = getContract(chainId, "Timelock"); const contract = new ethers.Contract(timelockAddress, abis.Timelock, signer); @@ -157,8 +158,11 @@ export async function setTraderReferralCodeByUser(chainId, referralCode, signer, return callContract(chainId, contract, "setTraderReferralCodeByUser", [referralCodeHex], opts); } -export async function getReferralCodeOwner(chainId, referralCode) { +export async function getReferralCodeOwner(chainId: ContractsChainId, referralCode: string): Promise { const referralStorageAddress = getContract(chainId, "ReferralStorage"); + if (referralStorageAddress === zeroAddress) { + return zeroAddress; + } const provider = getProvider(undefined, chainId); const contract = new ethers.Contract(referralStorageAddress, abis.ReferralStorage, provider); const codeOwner = await contract.codeOwners(referralCode); @@ -317,7 +321,7 @@ export function useReferrerDiscountShare(library, chainId, owner) { }; } -export async function validateReferralCodeExists(referralCode, chainId) { +export async function validateReferralCodeExists(referralCode: string, chainId: ContractsChainId) { const referralCodeBytes32 = encodeReferralCode(referralCode); const referralCodeOwner = await getReferralCodeOwner(chainId, referralCodeBytes32); return !isAddressZero(referralCodeOwner); diff --git a/src/domain/referrals/hooks/useReferralsData.ts b/src/domain/referrals/hooks/useReferralsData.ts index 72aa5feba0..a9a895ff3d 100644 --- a/src/domain/referrals/hooks/useReferralsData.ts +++ b/src/domain/referrals/hooks/useReferralsData.ts @@ -2,10 +2,10 @@ import { gql } from "@apollo/client"; import { BigNumberish, ethers } from "ethers"; import { useEffect, useState } from "react"; -import { SUPPORTED_CHAIN_IDS, UiContractsChain } from "config/chains"; +import { ContractsChainId, CONTRACTS_CHAIN_IDS } from "config/chains"; import { BN_ZERO } from "lib/numbers"; import { EMPTY_ARRAY } from "lib/objects"; -import { getReferralsGraphClient } from "lib/subgraph"; +import { getReferralsGraphClient, REFERRAL_SUPPORTED_CHAIN_IDS } from "lib/subgraph"; import { decodeReferralCode } from "sdk/utils/referrals"; import { @@ -144,7 +144,7 @@ export function useReferralsData(account?: string | null) { const referralCodes = res.data.referralCodes.map((e) => e.code); const allCodesOwnersOnOtherChains = await Promise.allSettled( - SUPPORTED_CHAIN_IDS.filter((otherChainId) => otherChainId !== chainId).map(async (otherChainId) => ({ + CONTRACTS_CHAIN_IDS.filter((otherChainId) => otherChainId !== chainId).map(async (otherChainId) => ({ chainId: otherChainId, data: await getCodeOwnersData(otherChainId, account, referralCodes), })) @@ -154,7 +154,7 @@ export function useReferralsData(account?: string | null) { ( chainResult ): chainResult is PromiseFulfilledResult<{ - chainId: UiContractsChain; + chainId: ContractsChainId; data: CodeOwnershipInfo[] | undefined; }> => chainResult.status === "fulfilled" ) @@ -292,7 +292,7 @@ export function useReferralsData(account?: string | null) { } Promise.allSettled( - SUPPORTED_CHAIN_IDS.map(async (chainId) => { + REFERRAL_SUPPORTED_CHAIN_IDS.map(async (chainId) => { try { const data = await getChainReferralData(chainId); return data; diff --git a/src/domain/stats/useGmxStacked.ts b/src/domain/stats/useGmxStacked.ts index ba5701204e..0255e9b534 100644 --- a/src/domain/stats/useGmxStacked.ts +++ b/src/domain/stats/useGmxStacked.ts @@ -1,12 +1,22 @@ import useSWR from "swr"; +import { zeroAddress } from "viem"; import { getContract } from "config/contracts"; import { contractFetcher } from "lib/contracts"; +import type { ContractsChainId } from "sdk/configs/chains"; -export function useGmxStaked(chainId: number) { +export function useGmxStaked(chainId: ContractsChainId) { const stakedGmxTrackerAddress = getContract(chainId, "StakedGmxTracker"); + const gmxAddress = getContract(chainId, "GMX"); + const { data: stakedGmxSupply } = useSWR( - [`StakeV2:stakedGmxSupply:${chainId}`, chainId, getContract(chainId, "GMX"), "balanceOf", stakedGmxTrackerAddress], + gmxAddress !== zeroAddress && [ + `StakeV2:stakedGmxSupply:${chainId}`, + chainId, + gmxAddress, + "balanceOf", + stakedGmxTrackerAddress, + ], { fetcher: contractFetcher(undefined, "Token"), } diff --git a/src/domain/synthetics/__tests__/trade/decrease.spec.ts b/src/domain/synthetics/__tests__/trade/decrease.spec.ts index 715c68c619..5729cd99e5 100644 --- a/src/domain/synthetics/__tests__/trade/decrease.spec.ts +++ b/src/domain/synthetics/__tests__/trade/decrease.spec.ts @@ -4,8 +4,8 @@ import { getMarketIndexName, getMarketPoolName, MarketInfo } from "domain/synthe import { DecreasePositionSwapType } from "domain/synthetics/orders"; import { PositionInfoLoaded } from "domain/synthetics/positions"; import { TokenData } from "domain/synthetics/tokens"; -import { getDecreasePositionAmounts } from "domain/synthetics/trade/utils/decrease"; import { expandDecimals } from "lib/numbers"; +import { getDecreasePositionAmounts } from "sdk/utils/trade/decrease"; const closeSizeUsd = BigInt(99); @@ -98,20 +98,25 @@ const marketInfo: MarketInfo = { maxPnlFactorForTradersLong: BigInt("0x0b5c0e8d21d902d61fa0000000"), maxPnlFactorForTradersShort: BigInt("0x0b5c0e8d21d902d61fa0000000"), minCollateralFactor: BigInt("0x204fce5e3e25026110000000"), + minCollateralFactorForLiquidation: BigInt("0x204fce5e3e25026110000000"), minCollateralFactorForOpenInterestLong: BigInt("0x0ad78ebc5ac6200000"), minCollateralFactorForOpenInterestShort: BigInt("0x0ad78ebc5ac6200000"), claimableFundingAmountLong: BigInt("0x1cefb332ff83"), claimableFundingAmountShort: BigInt("0x05b1ee"), - positionFeeFactorForPositiveImpact: BigInt("0x019d971e4fe8401e74000000"), - positionFeeFactorForNegativeImpact: BigInt("0x024306c4097859c43c000000"), + positionFeeFactorForBalanceWasImproved: BigInt("0x019d971e4fe8401e74000000"), + positionFeeFactorForBalanceWasNotImproved: BigInt("0x024306c4097859c43c000000"), positionImpactFactorPositive: BigInt("0x04e1003b28d9280000"), positionImpactFactorNegative: BigInt("0x0821ab0d4414980000"), maxPositionImpactFactorPositive: BigInt("0x1027e72f1f12813088000000"), maxPositionImpactFactorNegative: BigInt("0x1027e72f1f12813088000000"), maxPositionImpactFactorForLiquidations: BigInt("0x00"), + maxLendableImpactFactor: BigInt("0x00"), + maxLendableImpactFactorForWithdrawals: BigInt("0x00"), + maxLendableImpactUsd: BigInt("0x00"), + lentPositionImpactPoolAmount: BigInt("0x00"), positionImpactExponentFactor: BigInt("0x193e5939a08ce9dbd480000000"), - swapFeeFactorForPositiveImpact: BigInt("0x019d971e4fe8401e74000000"), - swapFeeFactorForNegativeImpact: BigInt("0x024306c4097859c43c000000"), + swapFeeFactorForBalanceWasImproved: BigInt("0x019d971e4fe8401e74000000"), + swapFeeFactorForBalanceWasNotImproved: BigInt("0x024306c4097859c43c000000"), swapImpactFactorPositive: BigInt("0x0ad78ebc5ac6200000"), swapImpactFactorNegative: BigInt("0x0ad78ebc5ac6200000"), swapImpactExponentFactor: BigInt("0x193e5939a08ce9dbd480000000"), @@ -139,6 +144,7 @@ const position: PositionInfoLoaded = { collateralAmount: BigInt("0x1b3c0b"), increasedAtTime: BigInt((Date.now() / 1000) >> 0), decreasedAtTime: BigInt((Date.now() / 1000) >> 0), + pendingImpactAmount: BigInt("0x00"), isLong: true, pendingBorrowingFeesUsd: BigInt("0x01f7685a27fa507f04c467a667"), fundingFeeAmount: BigInt("0x059624"), @@ -155,6 +161,8 @@ const position: PositionInfoLoaded = { pnlToken: wethToken, markPrice: BigInt("0x9630ee7c4228a0ae237af8000000"), entryPrice: BigInt("0x6f0b60ef22cc9d66ddf3e1340000"), + netPriceImapctDeltaUsd: BigInt("0x00"), + priceImpactDiffUsd: BigInt("0x00"), liquidationPrice: BigInt("0x682958f55ba441c1492a47080000"), collateralUsd: BigInt("0x1686d970e074ba9aa5c2e20000"), remainingCollateralUsd: BigInt("0x0ff0843a734b191deb6e225999"), diff --git a/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts b/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts index 7ee54b1287..7524f047c1 100644 --- a/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts +++ b/src/domain/synthetics/claimHistory/claimPriceImpactRebate.ts @@ -1,10 +1,18 @@ import { t } from "@lingui/macro"; import { Signer, ethers } from "ethers"; +import { encodeFunctionData } from "viem"; import { getContract } from "config/contracts"; import { callContract } from "lib/contracts"; +import type { ExpressTxnData } from "lib/transactions"; +import type { WalletSigner } from "lib/wallets"; +import { signTypedData } from "lib/wallets/signing"; import { abis } from "sdk/abis"; +import { ContractsChainId } from "sdk/configs/chains"; +import type { SourceChainId } from "sdk/configs/chains"; +import { type RelayParamsPayload, getGelatoRelayRouterDomain, hashRelayParams } from "../express"; +import { getMultichainInfoFromSigner } from "../express/expressOrderUtils"; import { RebateInfoItem } from "../fees/useRebatesInfo"; export type ClaimPriceImpactRebateParams = { @@ -13,7 +21,7 @@ export type ClaimPriceImpactRebateParams = { }; export async function createClaimCollateralTxn( - chainId: number, + chainId: ContractsChainId, signer: Signer, { account, claimablePositionPriceImpactFees }: ClaimPriceImpactRebateParams ) { @@ -35,3 +43,113 @@ export async function createClaimCollateralTxn( return txn; } + +export async function buildAndSignClaimPositionPriceImpactFeesTxn({ + signer, + relayParams, + account, + claimablePositionPriceImpactFees, + receiver, + chainId, + emptySignature = false, + relayerFeeTokenAddress, + relayerFeeAmount, +}: { + signer: WalletSigner; + relayParams: RelayParamsPayload; + account: string; + claimablePositionPriceImpactFees: RebateInfoItem[]; + receiver: string; + chainId: ContractsChainId; + emptySignature?: boolean; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; +}): Promise { + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + if (!srcChainId) { + throw new Error("No srcChainId"); + } + + // Build arrays for markets, tokens, timeKeys + const markets: string[] = []; + const tokens: string[] = []; + const timeKeys: bigint[] = []; + claimablePositionPriceImpactFees.forEach((p) => { + markets.push(p.marketAddress); + tokens.push(p.tokenAddress); + timeKeys.push(BigInt(p.timeKey)); + }); + + let signature: string; + if (emptySignature) { + signature = "0x"; + } else { + signature = await signClaimCollateralPayload({ + signer, + relayParams, + markets, + tokens, + timeKeys, + receiver, + chainId, + srcChainId, + }); + } + + const claimCollateralCallData = encodeFunctionData({ + abi: abis.MultichainClaimsRouter, + functionName: "claimCollateral", + args: [{ ...relayParams, signature }, account, srcChainId, markets, tokens, timeKeys, receiver], + }); + + return { + callData: claimCollateralCallData, + to: getContract(chainId, "MultichainClaimsRouter"), + feeToken: relayerFeeTokenAddress, + feeAmount: relayerFeeAmount, + }; +} + +async function signClaimCollateralPayload({ + signer, + relayParams, + markets, + tokens, + timeKeys, + receiver, + chainId, + srcChainId, +}: { + signer: WalletSigner; + relayParams: RelayParamsPayload; + markets: string[]; + tokens: string[]; + timeKeys: bigint[]; + receiver: string; + chainId: ContractsChainId; + srcChainId: number; +}): Promise { + const types = { + ClaimCollateral: [ + { name: "markets", type: "address[]" }, + { name: "tokens", type: "address[]" }, + { name: "timeKeys", type: "uint256[]" }, + { name: "receiver", type: "address" }, + { name: "relayParams", type: "bytes32" }, + ], + }; + + const domain = getGelatoRelayRouterDomain( + srcChainId as ContractsChainId | SourceChainId, + getContract(chainId, "MultichainClaimsRouter") + ); + const typedData = { + markets, + tokens, + timeKeys, + receiver, + relayParams: hashRelayParams(relayParams), + }; + + return signTypedData({ signer, domain, types, typedData }); +} diff --git a/src/domain/synthetics/claims/createClaimTransaction.ts b/src/domain/synthetics/claims/createClaimTransaction.ts index 9fc0645b54..be2691eba7 100644 --- a/src/domain/synthetics/claims/createClaimTransaction.ts +++ b/src/domain/synthetics/claims/createClaimTransaction.ts @@ -2,8 +2,9 @@ import { encodeFunctionData } from "viem"; import { getContract } from "config/contracts"; import { sendWalletTransaction, TxnCallback, WalletTxnCtx } from "lib/transactions"; -import { WalletSigner } from "lib/wallets"; +import type { WalletSigner } from "lib/wallets"; import ClaimHandlerAbi from "sdk/abis/ClaimHandler.json"; +import type { ContractsChainId } from "sdk/configs/chains"; export function getClaimTransactionCallData( tokens: string[], @@ -26,7 +27,7 @@ export function getClaimTransactionCallData( export function createClaimAmountsTransaction(data: { tokens: string[]; - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; account: string; signature: string; diff --git a/src/domain/synthetics/claims/useClaimExecutionFee.ts b/src/domain/synthetics/claims/useClaimExecutionFee.ts index b7d8bd6177..6ea5593ef6 100644 --- a/src/domain/synthetics/claims/useClaimExecutionFee.ts +++ b/src/domain/synthetics/claims/useClaimExecutionFee.ts @@ -3,7 +3,8 @@ import useSWR from "swr"; import { getContract } from "config/contracts"; import { estimateGasLimit } from "lib/gas/estimateGasLimit"; -import { WalletSigner } from "lib/wallets"; +import type { WalletSigner } from "lib/wallets"; +import type { ContractsChainId } from "sdk/configs/chains"; import { useGasPrice } from "../fees"; import { getClaimTransactionCallData } from "./createClaimTransaction"; @@ -18,7 +19,7 @@ export const useClaimExecutionFee = ({ }: { account: string | undefined; claimableTokens: string[]; - chainId: number; + chainId: ContractsChainId; claimTermsAcceptedSignature: string | undefined; signer: WalletSigner | undefined; distributionId: bigint; diff --git a/src/domain/synthetics/claims/useUserClaimableAmounts.ts b/src/domain/synthetics/claims/useUserClaimableAmounts.ts index 9a257f9cb3..f79ef0e854 100644 --- a/src/domain/synthetics/claims/useUserClaimableAmounts.ts +++ b/src/domain/synthetics/claims/useUserClaimableAmounts.ts @@ -7,10 +7,11 @@ import { selectGlvInfo, selectMarketsInfoData } from "context/SyntheticsStateCon import { useSelector } from "context/SyntheticsStateContext/utils"; import { TokenData } from "domain/tokens"; import { MulticallRequestConfig, useMulticall } from "lib/multicall"; +import { ContractsChainId } from "sdk/configs/chains"; import { getTokenBySymbolSafe } from "sdk/configs/tokens"; +import { getMarketPoolName } from "sdk/utils/markets"; import { convertToUsd } from "sdk/utils/tokens"; -import { getMarketPoolName } from "../../../../sdk/src/utils/markets"; import { useMarketTokensData } from "../markets"; export const GLP_DISTRIBUTION_TEST_ID = 4672592n; @@ -58,14 +59,14 @@ export interface ClaimableAmountsResult { | undefined >; claimableAmountsLoaded: boolean; - mutateClaimableAmounts: (shouldRevalidate?: boolean) => void; + mutateClaimableAmounts: () => void; } -export default function useUserClaimableAmounts(chainId: number, account?: string): ClaimableAmountsResult { +export default function useUserClaimableAmounts(chainId: ContractsChainId, account?: string): ClaimableAmountsResult { const glvsInfo = useSelector(selectGlvInfo); const marketsInfo = useSelector(selectMarketsInfoData); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); + const { marketTokensData } = useMarketTokensData(chainId, undefined, { isDeposit: false }); const tokensData = useTokensData(); const tokens = useMemo( diff --git a/src/domain/synthetics/express/callRelayTransaction.ts b/src/domain/synthetics/express/callRelayTransaction.ts new file mode 100644 index 0000000000..3cef1e5c1c --- /dev/null +++ b/src/domain/synthetics/express/callRelayTransaction.ts @@ -0,0 +1,44 @@ +import type { Provider } from "ethers"; +import { Hex, encodePacked, type Address } from "viem"; + +import { ContractsChainId } from "config/chains"; +import { getContract } from "config/contracts"; +import { GMX_SIMULATION_ORIGIN } from "config/dataStore"; + +export async function callRelayTransaction({ + chainId, + calldata, + gelatoRelayFeeToken, + gelatoRelayFeeAmount, + provider, + relayRouterAddress, +}: { + chainId: ContractsChainId; + calldata: string; + gelatoRelayFeeToken: string; + gelatoRelayFeeAmount: bigint; + provider: Provider; + relayRouterAddress: string; +}) { + try { + return await provider.call({ + to: relayRouterAddress, + from: GMX_SIMULATION_ORIGIN, + data: encodePacked( + ["bytes", "address", "address", "uint256"], + [ + calldata as Hex, + getContract(chainId, "GelatoRelayAddress"), + gelatoRelayFeeToken as Address, + gelatoRelayFeeAmount, + ] + ), + }); + } catch (ex) { + if (ex.error) { + // this gives much more readable error in the console with a stacktrace + throw ex.error; + } + throw ex; + } +} diff --git a/src/domain/synthetics/express/expressOrderUtils.ts b/src/domain/synthetics/express/expressOrderUtils.ts index b7407d6b6f..69817c83b9 100644 --- a/src/domain/synthetics/express/expressOrderUtils.ts +++ b/src/domain/synthetics/express/expressOrderUtils.ts @@ -1,11 +1,12 @@ -import { Provider, Wallet } from "ethers"; +import { Provider, Signer, Wallet } from "ethers"; import { encodeFunctionData, size, zeroAddress, zeroHash } from "viem"; import { BOTANIX } from "config/chains"; import { getContract } from "config/contracts"; import { GMX_SIMULATION_ORIGIN } from "config/dataStore"; import { BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; -import { NoncesData } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; +import { isSourceChain } from "config/multichain"; +import type { BridgeOutParams } from "domain/multichain/types"; import { ExpressParamsEstimationMethod, ExpressTransactionBuilder, @@ -15,16 +16,16 @@ import { getGelatoRelayRouterDomain, getRawRelayerParams, getRelayerFeeParams, - getRelayRouterNonceForSigner, GlobalExpressParams, hashRelayParams, RawRelayParamsPayload, RelayParamsPayload, + RelayParamsPayloadWithSignature, } from "domain/synthetics/express"; import { getSubaccountValidations, hashSubaccountApproval, - SignedSubbacountApproval, + SignedSubacсountApproval, Subaccount, SubaccountValidations, } from "domain/synthetics/subaccount"; @@ -37,8 +38,9 @@ import { getByKey } from "lib/objects"; import { ExpressTxnData } from "lib/transactions/sendExpressTransaction"; import { WalletSigner } from "lib/wallets"; import { signTypedData, SignTypedDataParams } from "lib/wallets/signing"; -import GelatoRelayRouterAbi from "sdk/abis/GelatoRelayRouter.json"; -import SubaccountGelatoRelayRouterAbi from "sdk/abis/SubaccountGelatoRelayRouter.json"; +import { abis } from "sdk/abis"; +import { AnyChainId, ContractsChainId, SettlementChainId, SourceChainId } from "sdk/configs/chains"; +import { ContractName } from "sdk/configs/contracts"; import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; import { bigMath } from "sdk/utils/bigmath"; import { gelatoRelay } from "sdk/utils/gelatoRelay"; @@ -54,6 +56,8 @@ import { } from "sdk/utils/orderTransactions"; import { nowInSeconds } from "sdk/utils/time"; import { setUiFeeReceiverIsExpress } from "sdk/utils/twap/uiFeeReceiver"; +import { GelatoRelayRouter, MultichainSubaccountRouter, SubaccountGelatoRelayRouter } from "typechain-types"; +import { MultichainOrderRouter } from "typechain-types/MultichainOrderRouter"; import { approximateL1GasBuffer, estimateBatchGasLimit, estimateRelayerGasLimit, GasLimitsConfig } from "../fees"; import { getNeedTokenApprove } from "../tokens"; @@ -63,17 +67,21 @@ export async function estimateBatchExpressParams({ provider, chainId, batchParams, + isGmxAccount, globalExpressParams, requireValidations, estimationMethod = "approximate", + subaccount, }: { - chainId: number; + chainId: ContractsChainId; + isGmxAccount: boolean; signer: WalletSigner; - provider: Provider | undefined; + provider: Provider; batchParams: BatchOrderTxnParams; globalExpressParams: GlobalExpressParams | undefined; estimationMethod: ExpressParamsEstimationMethod; requireValidations: boolean; + subaccount: Subaccount | undefined; }): Promise { if (!globalExpressParams) { return undefined; @@ -86,6 +94,7 @@ export async function estimateBatchExpressParams({ gasPaymentToken: globalExpressParams.gasPaymentToken, chainId, tokensData: globalExpressParams.tokensData, + isGmxAccount, }); if (!transactionParams) { @@ -99,24 +108,28 @@ export async function estimateBatchExpressParams({ globalExpressParams, estimationMethod, requireValidations, + isGmxAccount, + subaccount, }); return expressParams; } -export function getBatchExpressEstimatorParams({ +function getBatchExpressEstimatorParams({ signer, batchParams, gasLimits, gasPaymentToken, chainId, tokensData, + isGmxAccount, }: { signer: WalletSigner; batchParams: BatchOrderTxnParams; gasLimits: GasLimitsConfig; gasPaymentToken: TokenData; - chainId: number; + isGmxAccount: boolean; + chainId: ContractsChainId; tokensData: TokensData; }): ExpressTransactionEstimatorParams | undefined { const payAmounts = getBatchTotalPayCollateralAmount(batchParams); @@ -130,6 +143,7 @@ export function getBatchExpressEstimatorParams({ updateOrdersCount: batchParams.updateOrderParams.length, cancelOrdersCount: batchParams.cancelOrderParams.length, externalCallsGasLimit: getBatchExternalSwapGasLimit(batchParams), + isGmxAccount, }); if (!executionFeeAmount) { @@ -140,7 +154,6 @@ export function getBatchExpressEstimatorParams({ relayParams, gasPaymentParams, subaccount, - noncesData, }) => { return { txnData: await buildAndSignExpressBatchOrderTxn({ @@ -151,8 +164,8 @@ export function getBatchExpressEstimatorParams({ relayerFeeAmount: gasPaymentParams.relayerFeeAmount, subaccount, signer, - noncesData, emptySignature: true, + isGmxAccount, }), }; }; @@ -172,18 +185,22 @@ export function getBatchExpressEstimatorParams({ export async function estimateExpressParams({ chainId, + isGmxAccount, provider, transactionParams, globalExpressParams, estimationMethod = "approximate", requireValidations = true, + subaccount: rawSubaccount, }: { - chainId: number; - provider: Provider | undefined; + chainId: ContractsChainId; + isGmxAccount: boolean; + provider: Provider; globalExpressParams: GlobalExpressParams; transactionParams: ExpressTransactionEstimatorParams; estimationMethod: "approximate" | "estimateGas"; requireValidations: boolean; + subaccount: Subaccount | undefined; }): Promise { if (requireValidations && !transactionParams.isValid) { return undefined; @@ -201,7 +218,6 @@ export async function estimateExpressParams({ bufferBps, marketsInfoData, gasPaymentAllowanceData, - noncesData, } = globalExpressParams; const { @@ -215,14 +231,15 @@ export async function estimateExpressParams({ account, } = transactionParams; - const subaccountValidations = globalExpressParams.subaccount + const subaccountValidations = rawSubaccount ? getSubaccountValidations({ requiredActions: subaccountActions, - subaccount: globalExpressParams.subaccount, + subaccount: rawSubaccount, + subaccountRouterAddress: getOrderRelayRouterAddress(chainId, true, isGmxAccount), }) : undefined; - const subaccount = subaccountValidations?.isValid ? globalExpressParams.subaccount : undefined; + const subaccount = subaccountValidations?.isValid ? rawSubaccount : undefined; const baseRelayerGasLimit = estimateRelayerGasLimit({ gasLimits, @@ -245,6 +262,7 @@ export async function estimateExpressParams({ relayerFeeToken, relayerFeeAmount: baseRelayerFeeAmount, totalRelayerFeeTokenAmount: baseTotalRelayerFeeTokenAmount, + gasPaymentTokenAsCollateralAmount, transactionExternalCalls, feeExternalSwapQuote: undefined, findFeeSwapPath, @@ -268,7 +286,6 @@ export async function estimateExpressParams({ relayParams: baseRelayParams, gasPaymentParams: baseRelayFeeParams.gasPaymentParams, subaccount, - noncesData, }); const l1GasLimit = l1Reference @@ -285,6 +302,7 @@ export async function estimateExpressParams({ gasPaymentTokenAsCollateralAmount, gasPaymentTokenAmount: baseRelayFeeParams.gasPaymentParams.gasPaymentTokenAmount, gasPaymentAllowanceData, + isGmxAccount, tokenPermits, }); @@ -346,6 +364,7 @@ export async function estimateExpressParams({ relayerFeeToken, relayerFeeAmount, totalRelayerFeeTokenAmount, + gasPaymentTokenAsCollateralAmount, transactionExternalCalls, feeExternalSwapQuote: undefined, findFeeSwapPath, @@ -370,6 +389,7 @@ export async function estimateExpressParams({ gasPaymentTokenAmount: finalRelayFeeParams.gasPaymentParams.gasPaymentTokenAmount, gasPaymentTokenAsCollateralAmount, gasPaymentAllowanceData, + isGmxAccount, tokenPermits, }); @@ -421,26 +441,25 @@ export function getGasPaymentValidations({ gasPaymentTokenAsCollateralAmount, gasPaymentAllowanceData, tokenPermits, + isGmxAccount, }: { gasPaymentToken: TokenData; gasPaymentTokenAmount: bigint; gasPaymentTokenAsCollateralAmount: bigint; gasPaymentAllowanceData: TokensAllowanceData; tokenPermits: SignedTokenPermit[]; + isGmxAccount: boolean; }): GasPaymentValidations { // Add buffer to onchain avoid out of balance errors in case quick of network fee increase const gasTokenAmountWithBuffer = (gasPaymentTokenAmount * 13n) / 10n; const totalGasPaymentTokenAmount = gasPaymentTokenAsCollateralAmount + gasTokenAmountWithBuffer; - const isOutGasTokenBalance = - gasPaymentToken?.balance === undefined || totalGasPaymentTokenAmount > gasPaymentToken.balance; + const tokenBalance = isGmxAccount ? gasPaymentToken.gmxAccountBalance : gasPaymentToken.walletBalance; + const isOutGasTokenBalance = tokenBalance === undefined || totalGasPaymentTokenAmount > tokenBalance; - const needGasPaymentTokenApproval = getNeedTokenApprove( - gasPaymentAllowanceData, - gasPaymentToken?.address, - totalGasPaymentTokenAmount, - tokenPermits - ); + const needGasPaymentTokenApproval = isGmxAccount + ? false + : getNeedTokenApprove(gasPaymentAllowanceData, gasPaymentToken?.address, totalGasPaymentTokenAmount, tokenPermits); return { isOutGasTokenBalance, @@ -489,79 +508,123 @@ export async function buildAndSignExpressBatchOrderTxn({ relayerFeeAmount, subaccount, signer, - noncesData, + isGmxAccount, emptySignature = false, }: { signer: WalletSigner; - chainId: number; + chainId: ContractsChainId; batchParams: BatchOrderTxnParams; relayerFeeTokenAddress: string; relayerFeeAmount: bigint; relayParamsPayload: RawRelayParamsPayload; - noncesData: NoncesData | undefined; + isGmxAccount: boolean; subaccount: Subaccount | undefined; emptySignature?: boolean; }): Promise { const messageSigner = subaccount ? subaccount!.signer : signer; - const cachedNonce = subaccount ? noncesData?.subaccountRelayRouter?.nonce : noncesData?.relayRouter?.nonce; - - let userNonce: bigint; - if (cachedNonce === undefined) { - userNonce = await getRelayRouterNonceForSigner(chainId, messageSigner, subaccount?.signedApproval !== undefined); - } else { - userNonce = cachedNonce; - } + const relayRouterAddress = getOrderRelayRouterAddress(chainId, subaccount !== undefined, isGmxAccount); const params = { account: signer.address, messageSigner, chainId, relayPayload: { - ...relayParamsPayload, - userNonce, + ...(relayParamsPayload as RelayParamsPayload), deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), - }, - paramsLists: getBatchParamsLists(batchParams), + userNonce: nowInSeconds(), + } satisfies RelayParamsPayload, subaccountApproval: subaccount?.signedApproval, + paramsLists: getBatchParamsLists(batchParams), }; - const signature = emptySignature - ? "0x" - : await signTypedData( - getBatchSignatureParams({ - signer: params.messageSigner, - relayParams: params.relayPayload, - batchParams, - chainId, - account: params.account, - subaccountApproval: params.subaccountApproval, - }) - ); - - const batchCalldata = - params.subaccountApproval !== undefined - ? encodeFunctionData({ - abi: SubaccountGelatoRelayRouterAbi.abi, - functionName: "batch", - args: [ - { ...params.relayPayload, signature }, - params.subaccountApproval, - params.account, - params.subaccountApproval.subaccount, - params.paramsLists, - ], - }) - : encodeFunctionData({ - abi: GelatoRelayRouterAbi.abi, - functionName: "batch", - args: [{ ...params.relayPayload, signature }, params.account, params.paramsLists], - }); - - const relayRouterAddress = getContract( - chainId, - params.subaccountApproval ? "SubaccountGelatoRelayRouter" : "GelatoRelayRouter" - ); + let signature: string; + if (emptySignature) { + signature = "0x"; + } else { + const signatureParams = await getBatchSignatureParams({ + signer: params.messageSigner, + relayParams: params.relayPayload, + batchParams, + chainId, + account: params.account, + subaccountApproval: params.subaccountApproval, + relayRouterAddress, + }); + + signature = await signTypedData(signatureParams); + } + + let batchCalldata: string; + if (isGmxAccount) { + const srcChainId = (await getMultichainInfoFromSigner(signer, chainId)) ?? chainId; + + if (!srcChainId) { + throw new Error("No srcChainId"); + } + + if (subaccount) { + batchCalldata = encodeFunctionData({ + abi: abis.MultichainSubaccountRouter, + functionName: "batch", + args: [ + { + ...params.relayPayload, + signature, + } satisfies RelayParamsPayloadWithSignature, + subaccount.signedApproval, + params.account, + BigInt(srcChainId), + subaccount.signedApproval?.subaccount, + params.paramsLists, + ] satisfies Parameters, + }); + } else { + batchCalldata = encodeFunctionData({ + abi: abis.MultichainOrderRouter, + functionName: "batch", + args: [ + { + ...params.relayPayload, + signature, + }, + params.account, + BigInt(srcChainId), + params.paramsLists, + ] satisfies Parameters, + }); + } + } else { + if (subaccount) { + batchCalldata = encodeFunctionData({ + abi: abis.SubaccountGelatoRelayRouter, + functionName: "batch", + args: [ + { + ...params.relayPayload, + signature, + }, + subaccount.signedApproval, + params.account, + subaccount.signedApproval?.subaccount, + params.paramsLists, + ] satisfies Parameters, + }); + } else { + batchCalldata = encodeFunctionData({ + abi: abis.GelatoRelayRouter, + functionName: "batch", + args: [ + { + ...params.relayPayload, + signature, + }, + params.account, + params.paramsLists, + ] satisfies Parameters, + }); + } + } return { callData: batchCalldata, @@ -571,21 +634,23 @@ export async function buildAndSignExpressBatchOrderTxn({ }; } -export function getBatchSignatureParams({ +export async function getBatchSignatureParams({ signer, relayParams, batchParams, chainId, account, subaccountApproval, + relayRouterAddress, }: { account: string; - subaccountApproval: SignedSubbacountApproval | undefined; + subaccountApproval: SignedSubacсountApproval | undefined; signer: WalletSigner | Wallet; - relayParams: RelayParamsPayload; + relayParams: RelayParamsPayload | RelayParamsPayload; batchParams: BatchOrderTxnParams; - chainId: number; -}): SignTypedDataParams { + chainId: ContractsChainId; + relayRouterAddress: string; +}): Promise { const types = { Batch: [ { name: "account", type: "address" }, @@ -604,6 +669,7 @@ export function getBatchSignatureParams({ { name: "shouldUnwrapNativeToken", type: "bool" }, { name: "autoCancel", type: "bool" }, { name: "referralCode", type: "bytes32" }, + { name: "dataList", type: "bytes32[]" }, ], CreateOrderAddresses: [ { name: "receiver", type: "address" }, @@ -636,7 +702,8 @@ export function getBatchSignatureParams({ ], }; - const domain = getGelatoRelayRouterDomain(chainId, subaccountApproval !== undefined); + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + const domain = getGelatoRelayRouterDomain(srcChainId ?? chainId, relayRouterAddress); const paramsLists = getBatchParamsLists(batchParams); @@ -645,7 +712,7 @@ export function getBatchSignatureParams({ createOrderParamsList: paramsLists.createOrderParamsList, updateOrderParamsList: paramsLists.updateOrderParamsList, cancelOrderKeys: paramsLists.cancelOrderKeys, - relayParams: hashRelayParams(relayParams), + relayParams: hashRelayParams(relayParams as RelayParamsPayload), subaccountApproval: subaccountApproval ? hashSubaccountApproval(subaccountApproval) : zeroHash, }; @@ -669,6 +736,7 @@ function getBatchParamsLists(batchParams: BatchOrderTxnParams) { shouldUnwrapNativeToken: p.orderPayload.shouldUnwrapNativeToken, autoCancel: p.orderPayload.autoCancel, referralCode: p.orderPayload.referralCode, + dataList: p.orderPayload.dataList, })), updateOrderParamsList: batchParams.updateOrderParams.map((p) => ({ key: p.updatePayload.orderKey, @@ -684,6 +752,241 @@ function getBatchParamsLists(batchParams: BatchOrderTxnParams) { }; } +export async function getMultichainInfoFromSigner( + signer: Signer, + chainId: ContractsChainId +): Promise { + const srcChainId = await signer.provider!.getNetwork().then((n) => Number(n.chainId) as AnyChainId); + + if (!isSourceChain(srcChainId)) { + return undefined; + } + + const isMultichain = srcChainId !== (chainId as SourceChainId); + + if (!isMultichain) { + return undefined; + } + + return srcChainId; +} + +export function getOrderRelayRouterAddress( + chainId: ContractsChainId, + isSubaccount: boolean, + isMultichain: boolean +): string { + let contractName: ContractName; + if (isMultichain) { + if (isSubaccount) { + contractName = "MultichainSubaccountRouter"; + } else { + contractName = "MultichainOrderRouter"; + } + } else { + if (isSubaccount) { + contractName = "SubaccountGelatoRelayRouter"; + } else { + contractName = "GelatoRelayRouter"; + } + } + + return getContract(chainId, contractName); +} + +export async function buildAndSignBridgeOutTxn({ + chainId, + srcChainId, + relayParamsPayload, + params, + signer, + account, + emptySignature = false, + relayerFeeTokenAddress, + relayerFeeAmount, +}: { + chainId: SettlementChainId; + srcChainId: SourceChainId; + relayParamsPayload: RawRelayParamsPayload; + params: BridgeOutParams; + signer: WalletSigner | undefined; + account: string; + emptySignature?: boolean; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; +}): Promise { + let signature: string; + + const relayParams: RelayParamsPayload = { + ...relayParamsPayload, + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }; + + if (emptySignature) { + signature = "0x"; + } else { + if (!signer) { + throw new Error("Signer is required"); + } + + signature = await signBridgeOutPayload({ + relayParams, + params, + signer, + chainId, + srcChainId, + }); + } + + const bridgeOutCallData = encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "bridgeOut", + args: [ + { + ...relayParams, + signature, + }, + account, + BigInt(srcChainId), + params, + ], + }); + + return { + callData: bridgeOutCallData, + to: getContract(chainId, "MultichainTransferRouter"), + feeToken: relayerFeeTokenAddress, + feeAmount: relayerFeeAmount, + }; +} + +async function signBridgeOutPayload({ + signer, + relayParams, + params, + chainId, + srcChainId, +}: { + signer: WalletSigner; + relayParams: RelayParamsPayload; + params: BridgeOutParams; + chainId: SettlementChainId; + srcChainId: SourceChainId; +}): Promise { + const types = { + BridgeOut: [ + { name: "token", type: "address" }, + { name: "amount", type: "uint256" }, + { name: "minAmountOut", type: "uint256" }, + { name: "provider", type: "address" }, + { name: "data", type: "bytes" }, + { name: "relayParams", type: "bytes32" }, + ], + }; + + const typedData = { + token: params.token, + amount: params.amount, + minAmountOut: params.minAmountOut, + provider: params.provider, + data: params.data, + relayParams: hashRelayParams(relayParams), + }; + + const domain = getGelatoRelayRouterDomain(srcChainId, getContract(chainId, "MultichainTransferRouter")); + + return signTypedData({ signer, domain, types, typedData }); +} + +export async function buildAndSignSetTraderReferralCodeTxn({ + chainId, + relayParamsPayload, + params, + signer, + emptySignature = false, + relayerFeeTokenAddress, + relayerFeeAmount, +}: { + chainId: SettlementChainId; + relayParamsPayload: RelayParamsPayload; + params: BridgeOutParams; + signer: WalletSigner; + emptySignature?: boolean; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; +}): Promise { + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + if (!srcChainId) { + throw new Error("No srcChainId"); + } + + const address = signer.address; + + let signature: string; + + if (emptySignature) { + signature = "0x"; + } else { + signature = await signBridgeOutPayload({ + relayParams: relayParamsPayload, + params, + signer, + chainId, + srcChainId, + }); + } + + const bridgeOutCallData = encodeFunctionData({ + abi: abis.MultichainTransferRouter, + functionName: "bridgeOut", + args: [ + { + ...relayParamsPayload, + signature, + }, + address, + BigInt(srcChainId), + params, + ], + }); + + return { + callData: bridgeOutCallData, + to: getContract(chainId, "MultichainTransferRouter"), + feeToken: relayerFeeTokenAddress, + feeAmount: relayerFeeAmount, + }; +} + +export async function signSetTraderReferralCode({ + signer, + relayParams, + referralCode, + chainId, + srcChainId, +}: { + signer: WalletSigner | Wallet; + relayParams: RelayParamsPayload; + referralCode: string; + chainId: ContractsChainId; + srcChainId: SourceChainId; +}) { + const types = { + SetTraderReferralCode: [ + { name: "referralCode", type: "bytes32" }, + { name: "relayParams", type: "bytes32" }, + ], + }; + + const domain = getGelatoRelayRouterDomain(srcChainId ?? chainId, getContract(chainId, "MultichainOrderRouter")); + const typedData = { + referralCode: referralCode, + relayParams: hashRelayParams(relayParams), + }; + + return signTypedData({ signer, domain, types, typedData }); +} + function updateExpressOrdersAddresses(addressess: CreateOrderPayload["addresses"]): CreateOrderPayload["addresses"] { return { ...addressess, diff --git a/src/domain/synthetics/express/oracleParamsUtils.ts b/src/domain/synthetics/express/oracleParamsUtils.ts index 71ee642ed7..de03b49c30 100644 --- a/src/domain/synthetics/express/oracleParamsUtils.ts +++ b/src/domain/synthetics/express/oracleParamsUtils.ts @@ -1,5 +1,6 @@ import uniq from "lodash/uniq"; +import { ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { MarketsInfoData } from "domain/synthetics/markets/types"; import { convertTokenAddress } from "sdk/configs/tokens"; @@ -7,7 +8,7 @@ import { getOppositeCollateral } from "sdk/utils/markets"; import { getByKey } from "sdk/utils/objects"; import { ExternalCallsPayload } from "sdk/utils/orderTransactions"; -export function getOracleParams({ chainId, tokenAddresses }: { chainId: number; tokenAddresses: string[] }) { +export function getOracleParams({ chainId, tokenAddresses }: { chainId: ContractsChainId; tokenAddresses: string[] }) { const uniqTokenAddresses = uniq( tokenAddresses.map((tokenAddress) => convertTokenAddress(chainId, tokenAddress, "wrapped")) ); @@ -28,7 +29,7 @@ export function getOracleParamsForRelayParams({ externalCalls, marketsInfoData, }: { - chainId: number; + chainId: ContractsChainId; gasPaymentTokenAddress: string; relayerFeeTokenAddress: string; feeSwapPath: string[]; diff --git a/src/domain/synthetics/express/relayParamsUtils.ts b/src/domain/synthetics/express/relayParamsUtils.ts index e5738b3d75..c5151c88f3 100644 --- a/src/domain/synthetics/express/relayParamsUtils.ts +++ b/src/domain/synthetics/express/relayParamsUtils.ts @@ -1,12 +1,11 @@ -import { Contract, ethers, Provider, Wallet } from "ethers"; -import { encodeAbiParameters, keccak256 } from "viem"; +import { Address, encodeAbiParameters, keccak256 } from "viem"; +import type { ContractsChainId, SourceChainId } from "config/chains"; import { getBestSwapStrategy } from "domain/synthetics/externalSwaps/utils"; -import { SignedTokenPermit, TokenData } from "domain/tokens"; -import { WalletSigner } from "lib/wallets"; +import type { SignedTokenPermit, TokenData } from "domain/tokens"; +import type { SignatureDomain } from "lib/wallets/signing"; import { abis } from "sdk/abis"; -import RelayParamsAbi from "sdk/abis/RelayParams.json"; -import { getContract } from "sdk/configs/contracts"; +import { ContractName, getContract } from "sdk/configs/contracts"; import { MarketsInfoData } from "sdk/types/markets"; import { ExternalSwapQuote, FindSwapPath, SwapAmounts } from "sdk/types/trade"; import { @@ -16,30 +15,69 @@ import { getExternalCallsPayload, } from "sdk/utils/orderTransactions"; import { getSwapAmountsByToValue } from "sdk/utils/swap"; +import { nowInSeconds } from "sdk/utils/time"; import { getOracleParamsForRelayParams } from "./oracleParamsUtils"; -import { GasPaymentParams, RawRelayParamsPayload, RelayFeePayload, RelayParamsPayload } from "./types"; +import type { GasPaymentParams, RawRelayParamsPayload, RelayFeePayload, RelayParamsPayload } from "./types"; + +export function getExpressContractAddress( + chainId: ContractsChainId, + { + isSubaccount, + isMultichain, + scope, + }: { + isSubaccount?: boolean; + isMultichain?: boolean; + scope?: "glv" | "gm" | "transfer" | "claims" | "order" | "subaccount"; + } +): Address { + let contractName: ContractName; + if (isMultichain) { + switch (scope) { + case "claims": + contractName = "MultichainClaimsRouter"; + break; + case "order": + contractName = "MultichainOrderRouter"; + break; + case "subaccount": + contractName = "MultichainSubaccountRouter"; + break; + case "glv": + contractName = "MultichainGlvRouter"; + break; + case "gm": + contractName = "MultichainGmRouter"; + break; + case "transfer": + contractName = "MultichainTransferRouter"; + break; + default: + throw new Error(`Invalid scope: ${scope}`); + } + } else { + if (isSubaccount) { + contractName = "SubaccountGelatoRelayRouter"; + } else { + contractName = "GelatoRelayRouter"; + } + } -export function getExpressContractAddress(chainId: number, { isSubaccount }: { isSubaccount: boolean }) { - return getContract(chainId, isSubaccount ? "SubaccountGelatoRelayRouter" : "GelatoRelayRouter"); + return getContract(chainId, contractName); } -export function getExpressContractInstance(chainId: number, provider: Provider, isSubaccount: boolean) { - const contractAddress = getExpressContractAddress(chainId, { isSubaccount }); - - const abi = isSubaccount ? abis.SubaccountGelatoRelayRouter : abis.GelatoRelayRouter; - - const contract = new Contract(contractAddress, abi, provider); +export function getGelatoRelayRouterDomain( + chainId: SourceChainId | ContractsChainId, + relayRouterAddress: string +): SignatureDomain { + const name = "GmxBaseGelatoRelayRouter"; - return contract; -} - -export function getGelatoRelayRouterDomain(chainId: number, isSubaccount: boolean) { return { - name: "GmxBaseGelatoRelayRouter", + name, version: "1", - chainId: chainId, - verifyingContract: getExpressContractAddress(chainId, { isSubaccount }), + chainId, + verifyingContract: relayRouterAddress, }; } @@ -50,16 +88,18 @@ export function getRelayerFeeParams({ relayerFeeToken, relayerFeeAmount, totalRelayerFeeTokenAmount, + gasPaymentTokenAsCollateralAmount, transactionExternalCalls, feeExternalSwapQuote, findFeeSwapPath, }: { - chainId: number; + chainId: ContractsChainId; account: string; relayerFeeAmount: bigint; totalRelayerFeeTokenAmount: bigint; relayerFeeToken: TokenData; gasPaymentToken: TokenData; + gasPaymentTokenAsCollateralAmount: bigint; findFeeSwapPath: FindSwapPath | undefined; feeExternalSwapQuote: ExternalSwapQuote | undefined; /** @@ -76,6 +116,7 @@ export function getRelayerFeeParams({ relayerFeeAmount, totalRelayerFeeTokenAmount, gasPaymentTokenAmount: 0n, + gasPaymentTokenAsCollateralAmount, }; let feeParams: RelayFeePayload; @@ -158,14 +199,14 @@ export function getRawRelayerParams({ tokenPermits, marketsInfoData, }: { - chainId: number; + chainId: ContractsChainId; gasPaymentTokenAddress: string; relayerFeeTokenAddress: string; feeParams: RelayFeePayload; externalCalls: ExternalCallsPayload; tokenPermits: SignedTokenPermit[]; marketsInfoData: MarketsInfoData; -}) { +}): RawRelayParamsPayload { const oracleParams = getOracleParamsForRelayParams({ chainId, externalCalls, @@ -180,13 +221,15 @@ export function getRawRelayerParams({ tokenPermits, externalCalls, fee: feeParams, + desChainId: BigInt(chainId), + userNonce: nowInSeconds(), }; return relayParamsPayload; } export function hashRelayParams(relayParams: RelayParamsPayload) { - const encoded = encodeAbiParameters(RelayParamsAbi.abi, [ + const encoded = encodeAbiParameters(abis.RelayParams, [ [relayParams.oracleParams.tokens, relayParams.oracleParams.providers, relayParams.oracleParams.data], [ relayParams.externalCalls.sendTokens, @@ -200,20 +243,10 @@ export function hashRelayParams(relayParams: RelayParamsPayload) { [relayParams.fee.feeToken, relayParams.fee.feeAmount, relayParams.fee.feeSwapPath], relayParams.userNonce, relayParams.deadline, + relayParams.desChainId, ]); const hash = keccak256(encoded); return hash; } - -export async function getRelayRouterNonceForSigner( - chainId: number, - signer: WalletSigner | Wallet, - isSubaccount: boolean -): Promise { - const contractAddress = getExpressContractAddress(chainId, { isSubaccount }); - const contract = new ethers.Contract(contractAddress, abis.GelatoRelayRouter, signer); - - return contract.userNonces(signer.address); -} diff --git a/src/domain/synthetics/express/types.ts b/src/domain/synthetics/express/types.ts index 9f40b7d7db..25388d25d5 100644 --- a/src/domain/synthetics/express/types.ts +++ b/src/domain/synthetics/express/types.ts @@ -1,17 +1,15 @@ -import { NoncesData } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; -import { SignedTokenPermit, TokenData, TokensAllowanceData, TokensData } from "domain/tokens"; -import { ExpressTxnData } from "lib/transactions"; -import { ExternalCallsPayload } from "sdk/utils/orderTransactions"; +import type { SignedTokenPermit, TokenData, TokensAllowanceData, TokensData } from "domain/tokens"; +import type { ExpressTxnData } from "lib/transactions"; +import type { ExternalCallsPayload } from "sdk/utils/orderTransactions"; -import { GasLimitsConfig, L1ExpressOrderGasReference } from "../fees"; -import { MarketsInfoData } from "../markets"; -import { Subaccount, SubaccountValidations } from "../subaccount"; -import { FindSwapPath } from "../trade"; +import type { GasLimitsConfig, L1ExpressOrderGasReference } from "../fees"; +import type { MarketsInfoData } from "../markets"; +import type { Subaccount, SubaccountValidations } from "../subaccount"; +import type { FindSwapPath } from "../trade"; export type GlobalExpressParams = { tokensData: TokensData; marketsInfoData: MarketsInfoData; - subaccount: Subaccount | undefined; tokenPermits: SignedTokenPermit[]; gasPaymentTokenAddress: string; relayerFeeTokenAddress: string; @@ -24,7 +22,6 @@ export type GlobalExpressParams = { l1Reference: L1ExpressOrderGasReference | undefined; bufferBps: number; isSponsoredCall: boolean; - noncesData: NoncesData | undefined; }; export type ExpressParamsEstimationMethod = "approximate" | "estimateGas"; @@ -49,12 +46,10 @@ export type ExpressTransactionBuilder = ({ relayParams, gasPaymentParams, subaccount, - noncesData, }: { relayParams: RawRelayParamsPayload; gasPaymentParams: GasPaymentParams; subaccount: Subaccount | undefined; - noncesData: NoncesData | undefined; }) => Promise<{ txnData: ExpressTxnData }>; export type ExpressTransactionEstimatorParams = { @@ -77,6 +72,7 @@ export type GasPaymentParams = { relayerFeeAmount: bigint; gasPaymentTokenAmount: bigint; totalRelayerFeeTokenAmount: bigint; + gasPaymentTokenAsCollateralAmount: bigint; }; export type RelayParamsPayload = { @@ -85,10 +81,15 @@ export type RelayParamsPayload = { externalCalls: ExternalCallsPayload; fee: RelayFeePayload; deadline: bigint; - userNonce: bigint; + desChainId: bigint; + userNonce: bigint | number; +}; + +export type RelayParamsPayloadWithSignature = RelayParamsPayload & { + signature: string; }; -export type RawRelayParamsPayload = Omit; +export type RawRelayParamsPayload = Omit; export type OracleParamsPayload = { tokens: string[]; diff --git a/src/domain/synthetics/express/useIsOutOfGasPaymentBalance.ts b/src/domain/synthetics/express/useIsOutOfGasPaymentBalance.ts index 608dc1f846..8875a683a1 100644 --- a/src/domain/synthetics/express/useIsOutOfGasPaymentBalance.ts +++ b/src/domain/synthetics/express/useIsOutOfGasPaymentBalance.ts @@ -10,8 +10,8 @@ import { useTokensDataRequest } from "../tokens"; import { useL1ExpressOrderGasReference } from "./useL1ExpressGasReference"; export function useIsOutOfGasPaymentBalance() { - const { chainId } = useChainId(); - const { tokensData } = useTokensDataRequest(chainId); + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); const gasPrice = useGasPrice(chainId); const gasLimits = useGasLimits(chainId); const l1Reference = useL1ExpressOrderGasReference(); @@ -41,11 +41,12 @@ export function useIsOutOfGasPaymentBalance() { createOrdersCount: 1, updateOrdersCount: 0, cancelOrdersCount: 0, + isGmxAccount: srcChainId !== undefined, }); return token.balance === undefined || token.balance < minBalance; }); return conditions.every((condition) => condition); - }, [chainId, gasLimits, gasPaymentTokens, gasPrice, l1Reference, relayFeeToken, tokensData]); + }, [chainId, gasLimits, gasPaymentTokens, gasPrice, l1Reference, relayFeeToken, srcChainId, tokensData]); } diff --git a/src/domain/synthetics/express/useL1ExpressGasReference.ts b/src/domain/synthetics/express/useL1ExpressGasReference.ts index 3bd128b60f..20fb9bc0f9 100644 --- a/src/domain/synthetics/express/useL1ExpressGasReference.ts +++ b/src/domain/synthetics/express/useL1ExpressGasReference.ts @@ -1,7 +1,7 @@ import useSWR from "swr"; import { decodeFunctionResult, encodeFunctionData, size } from "viem"; -import { ARBITRUM } from "config/chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA } from "config/chains"; import { useChainId } from "lib/chains"; import { metrics } from "lib/metrics"; import { useJsonRpcProvider } from "lib/rpc"; @@ -16,7 +16,7 @@ export function useL1ExpressOrderGasReference() { const { chainId } = useChainId(); const { provider } = useJsonRpcProvider(chainId); - const hasL1Gas = chainId === ARBITRUM; + const hasL1Gas = chainId === ARBITRUM || chainId === ARBITRUM_SEPOLIA; const { data } = useSWR(hasL1Gas && provider ? [chainId, provider, "l1ExpressOrderGasReference"] : null, { refreshInterval: FREQUENT_UPDATE_INTERVAL, diff --git a/src/domain/synthetics/express/useRelayerFeeHandler.ts b/src/domain/synthetics/express/useRelayerFeeHandler.ts index 04d2b652b5..4a69f2e643 100644 --- a/src/domain/synthetics/express/useRelayerFeeHandler.ts +++ b/src/domain/synthetics/express/useRelayerFeeHandler.ts @@ -5,6 +5,10 @@ import { selectExpressGlobalParams, selectIsExpressTransactionAvailable, } from "context/SyntheticsStateContext/selectors/expressSelectors"; +import { + selectSubaccountForMultichainAction, + selectSubaccountForSettlementChainAction, +} from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { useChainId } from "lib/chains"; import { throttleLog } from "lib/logging"; @@ -24,7 +28,7 @@ import { import { ExpressTxnParams } from "."; import { estimateBatchExpressParams } from "./expressOrderUtils"; -import { useSwitchGasPaymentTokenIfRequired } from "./useSwitchGasPaymentTokenIfRequired"; +import { useSwitchGasPaymentTokenIfRequiredFromExpressParams } from "./useSwitchGasPaymentTokenIfRequired"; export type ExpressOrdersParamsResult = { expressParams: ExpressTxnParams | undefined; @@ -36,17 +40,21 @@ export type ExpressOrdersParamsResult = { export function useExpressOrdersParams({ orderParams, - label, + isGmxAccount, }: { orderParams: BatchOrderTxnParams | undefined; totalExecutionFee?: bigint; label?: string; + isGmxAccount: boolean; }): ExpressOrdersParamsResult { const { chainId } = useChainId(); const showDebugValues = useShowDebugValues(); const globalExpressParams = useSelector(selectExpressGlobalParams); + const subaccount = useSelector( + isGmxAccount ? selectSubaccountForMultichainAction : selectSubaccountForSettlementChainAction + ); const isExpressAvailable = useSelector(selectIsExpressTransactionAvailable); const isAvailable = isExpressAvailable && orderParams && !getBatchIsNativePayment(orderParams); @@ -75,23 +83,27 @@ export function useExpressOrdersParams({ chainId: p.chainId, batchParams: p.orderParams, signer: p.signer, - provider: undefined, + provider: p.provider, globalExpressParams: p.globalExpressParams, requireValidations: false, estimationMethod: "approximate", + isGmxAccount: p.isGmxAccount, + subaccount: p.subaccount, }); return nextApproximateParams; }, { params: - isAvailable && globalExpressParams && signer && orderParams + isAvailable && globalExpressParams && signer && orderParams && provider ? { chainId, signer, provider, orderParams, globalExpressParams, + isGmxAccount, + subaccount, } : undefined, forceRecalculate, @@ -112,6 +124,8 @@ export function useExpressOrdersParams({ globalExpressParams: p.globalExpressParams, requireValidations: false, estimationMethod: "estimateGas", + isGmxAccount: p.isGmxAccount, + subaccount: p.subaccount, }); return expressParams; @@ -125,6 +139,8 @@ export function useExpressOrdersParams({ provider, orderParams, globalExpressParams, + isGmxAccount, + subaccount, } : undefined, forceRecalculate, @@ -165,7 +181,10 @@ export function useExpressOrdersParams({ }; }, [isAvailable, asyncExpressParams, fastExpressParams, fastExpressPromise, asyncExpressPromise]); - useSwitchGasPaymentTokenIfRequired({ expressParams: result.expressParams }); + useSwitchGasPaymentTokenIfRequiredFromExpressParams({ + expressParams: result.expressParams, + isGmxAccount, + }); if (showDebugValues && label && result.expressParams) { throttleLog(`${label} express params`, { diff --git a/src/domain/synthetics/express/useSelectMinGasPaymentTokenBalance.ts b/src/domain/synthetics/express/useSelectMinGasPaymentTokenBalance.ts deleted file mode 100644 index 1a090d4f0b..0000000000 --- a/src/domain/synthetics/express/useSelectMinGasPaymentTokenBalance.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { useMemo } from "react"; - -import { selectGasPaymentToken } from "context/SyntheticsStateContext/selectors/expressSelectors"; -import { - selectGasLimits, - selectGasPrice, - selectL1ExpressOrderGasReference, - selectTokensData, -} from "context/SyntheticsStateContext/selectors/globalSelectors"; -import { useSelector } from "context/SyntheticsStateContext/utils"; -import { useChainId } from "lib/chains"; -import { getByKey } from "lib/objects"; -import { getRelayerFeeToken } from "sdk/configs/express"; -import { BatchOrderTxnParams, getBatchTotalExecutionFee } from "sdk/utils/orderTransactions"; - -import { estimateBatchMinGasPaymentTokenAmount } from "../fees"; - -export function useSelectMinGasPaymentTokenBalance({ - tokenAddress, - batchParams, -}: { - tokenAddress: string | undefined; - batchParams: BatchOrderTxnParams | undefined; -}) { - const { chainId } = useChainId(); - const tokensData = useSelector(selectTokensData); - const gasPrice = useSelector(selectGasPrice); - const gasLimits = useSelector(selectGasLimits); - const l1Reference = useSelector(selectL1ExpressOrderGasReference); - const gasPaymentToken = useSelector(selectGasPaymentToken); - const relayFeeToken = getByKey(tokensData, getRelayerFeeToken(chainId).address); - - return useMemo(() => { - if (!tokenAddress || tokenAddress !== gasPaymentToken?.address) { - return 0n; - } - - if (!gasLimits || gasPrice === undefined || !tokensData || !relayFeeToken) { - return 0n; - } - - const executionFee = batchParams ? getBatchTotalExecutionFee({ batchParams, tokensData, chainId }) : undefined; - - const minBalance = estimateBatchMinGasPaymentTokenAmount({ - gasLimits, - gasPaymentToken, - relayFeeToken, - gasPrice, - l1Reference, - tokensData, - chainId, - executionFeeAmount: executionFee?.feeTokenAmount, - createOrdersCount: batchParams?.createOrderParams.length ?? 1, - updateOrdersCount: batchParams?.updateOrderParams.length ?? 0, - cancelOrdersCount: batchParams?.cancelOrderParams.length ?? 0, - }); - - return minBalance; - }, [ - tokenAddress, - gasPaymentToken, - gasLimits, - gasPrice, - l1Reference, - tokensData, - relayFeeToken, - batchParams, - chainId, - ]); -} diff --git a/src/domain/synthetics/express/useSponsoredCallParamsRequest.ts b/src/domain/synthetics/express/useSponsoredCallParamsRequest.ts index 6cf446652d..b56159218e 100644 --- a/src/domain/synthetics/express/useSponsoredCallParamsRequest.ts +++ b/src/domain/synthetics/express/useSponsoredCallParamsRequest.ts @@ -2,7 +2,7 @@ import { useMemo } from "react"; import useSWR from "swr"; import { getIsFlagEnabled } from "config/ab"; -import { BOTANIX } from "config/chains"; +import { ARBITRUM_SEPOLIA, BOTANIX } from "config/chains"; import { convertToUsd, TokensData } from "domain/tokens"; import { metrics } from "lib/metrics"; import { getByKey } from "lib/objects"; @@ -21,6 +21,10 @@ export function useIsSponsoredCallBalanceAvailable( const { data: isSponsoredCallAllowed } = useSWR(tokensData ? [chainId, "isSponsoredCallAllowed"] : null, { refreshInterval: FREQUENT_UPDATE_INTERVAL, fetcher: async () => { + if (chainId === ARBITRUM_SEPOLIA) { + return false; + } + try { if (!getIsFlagEnabled("testSponsoredCall")) { return false; diff --git a/src/domain/synthetics/express/useSwitchGasPaymentTokenIfRequired.ts b/src/domain/synthetics/express/useSwitchGasPaymentTokenIfRequired.ts index 6c83653c6a..a9bbc50798 100644 --- a/src/domain/synthetics/express/useSwitchGasPaymentTokenIfRequired.ts +++ b/src/domain/synthetics/express/useSwitchGasPaymentTokenIfRequired.ts @@ -3,47 +3,87 @@ import { useEffect } from "react"; import { selectTokensData } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectSetGasPaymentTokenAddress } from "context/SyntheticsStateContext/selectors/settingsSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; -import { convertToTokenAmount, convertToUsd } from "domain/tokens"; +import { convertToTokenAmount, convertToUsd, TokenData } from "domain/tokens"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import { getGasPaymentTokens } from "sdk/configs/express"; import { ExpressTxnParams } from "./types"; -export function useSwitchGasPaymentTokenIfRequired({ expressParams }: { expressParams: ExpressTxnParams | undefined }) { +export function useSwitchGasPaymentTokenIfRequiredFromExpressParams({ + expressParams, + isGmxAccount, +}: { + expressParams: Pick | undefined; + isGmxAccount: boolean; +}) { + useSwitchGasPaymentTokenIfRequired({ + isOutGasTokenBalance: expressParams?.gasPaymentValidations.isOutGasTokenBalance, + gasPaymentToken: expressParams?.gasPaymentParams.gasPaymentToken, + totalGasPaymentTokenAmount: expressParams + ? expressParams.gasPaymentParams.gasPaymentTokenAmount + + expressParams.gasPaymentParams.gasPaymentTokenAsCollateralAmount + : undefined, + isGmxAccount, + }); +} + +export function useSwitchGasPaymentTokenIfRequired({ + isOutGasTokenBalance, + gasPaymentToken, + totalGasPaymentTokenAmount, + isGmxAccount, +}: { + isOutGasTokenBalance: boolean | undefined; + gasPaymentToken: TokenData | undefined; + totalGasPaymentTokenAmount: bigint | undefined; + isGmxAccount: boolean; +}) { const { chainId } = useChainId(); const setGasPaymentTokenAddress = useSelector(selectSetGasPaymentTokenAddress); const tokensData = useSelector(selectTokensData); useEffect( function switchGasPaymentToken() { - if (expressParams?.gasPaymentValidations.isOutGasTokenBalance) { - const { gasPaymentToken, gasPaymentTokenAmount } = expressParams.gasPaymentParams; - - const usdValue = convertToUsd(gasPaymentTokenAmount, gasPaymentToken.decimals, gasPaymentToken.prices.minPrice); + if (isOutGasTokenBalance && gasPaymentToken && totalGasPaymentTokenAmount !== undefined) { + const usdValue = convertToUsd( + totalGasPaymentTokenAmount, + gasPaymentToken.decimals, + gasPaymentToken.prices.minPrice + ); const anotherGasToken = getGasPaymentTokens(chainId).find((tokenAddress) => { const tokenData = getByKey(tokensData, tokenAddress); const requiredTokenAmount = convertToTokenAmount(usdValue, tokenData?.decimals, tokenData?.prices.minPrice); + const balance = isGmxAccount ? tokenData?.gmxAccountBalance : tokenData?.walletBalance; + if ( tokenData?.address === gasPaymentToken.address || usdValue === undefined || requiredTokenAmount === undefined || - tokenData?.balance === undefined + balance === undefined ) { return false; } - return tokenData.balance > requiredTokenAmount; + return balance > requiredTokenAmount; }); - if (anotherGasToken && anotherGasToken !== expressParams.gasPaymentParams.gasPaymentTokenAddress) { + if (anotherGasToken && anotherGasToken !== gasPaymentToken.address) { setGasPaymentTokenAddress(anotherGasToken); } } }, - [chainId, expressParams, setGasPaymentTokenAddress, tokensData] + [ + chainId, + gasPaymentToken, + totalGasPaymentTokenAmount, + isGmxAccount, + isOutGasTokenBalance, + setGasPaymentTokenAddress, + tokensData, + ] ); } diff --git a/src/domain/synthetics/externalSwaps/openOcean.ts b/src/domain/synthetics/externalSwaps/openOcean.ts index c7a0f73cf2..d25b7e2dbc 100644 --- a/src/domain/synthetics/externalSwaps/openOcean.ts +++ b/src/domain/synthetics/externalSwaps/openOcean.ts @@ -4,6 +4,7 @@ import { USD_DECIMALS } from "config/factors"; import { buildUrl } from "lib/buildUrl"; import { metrics } from "lib/metrics"; import { formatTokenAmount, numberToBigint } from "lib/numbers"; +import type { ContractsChainId } from "sdk/configs/chains"; import { convertTokenAddress, getToken } from "sdk/configs/tokens"; type OpenOceanTxnResponse = { @@ -64,7 +65,7 @@ export async function getOpenOceanTxnData({ }: { senderAddress: string; receiverAddress: string; - chainId: number; + chainId: ContractsChainId; tokenInAddress: string; tokenOutAddress: string; amountIn: bigint; diff --git a/src/domain/synthetics/externalSwaps/useBotanixStakingAssetsPerShare.ts b/src/domain/synthetics/externalSwaps/useBotanixStakingAssetsPerShare.ts index 171635d4b9..19a70582b0 100644 --- a/src/domain/synthetics/externalSwaps/useBotanixStakingAssetsPerShare.ts +++ b/src/domain/synthetics/externalSwaps/useBotanixStakingAssetsPerShare.ts @@ -1,10 +1,10 @@ -import { BOTANIX } from "config/chains"; +import { BOTANIX, ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { useMulticall } from "lib/multicall"; const DEFAULT_ASSETS_PER_SHARE = 10n ** 18n; -export const useBotanixStakingAssetsPerShare = ({ chainId }: { chainId: number }): bigint | undefined => { +export const useBotanixStakingAssetsPerShare = ({ chainId }: { chainId: ContractsChainId }): bigint | undefined => { const { data: botanixData } = useMulticall(chainId, "useBotanixStakingAssetsPerShare_StBTC", { key: chainId === BOTANIX ? [] : null, request: () => { diff --git a/src/domain/synthetics/externalSwaps/useExternalSwapOutputRequest.ts b/src/domain/synthetics/externalSwaps/useExternalSwapOutputRequest.ts index c88bc2d91c..1b38b6cfbb 100644 --- a/src/domain/synthetics/externalSwaps/useExternalSwapOutputRequest.ts +++ b/src/domain/synthetics/externalSwaps/useExternalSwapOutputRequest.ts @@ -6,15 +6,16 @@ import { BOTANIX } from "config/chains"; import { useTokensData } from "context/SyntheticsStateContext/hooks/globalsHooks"; import { selectBotanixStakingAssetsPerShare } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useDebounce } from "lib/debounce/useDebounce"; import { metrics, OpenOceanQuoteTiming } from "lib/metrics"; -import { useDebounce } from "lib/useDebounce"; +import { ContractsChainId } from "sdk/configs/chains"; import { getContract } from "sdk/configs/contracts"; import { convertTokenAddress } from "sdk/configs/tokens"; import { ExternalSwapAggregator, ExternalSwapQuote } from "sdk/types/trade"; +import { getBotanixStakingExternalSwapQuote } from "sdk/utils/swap/botanixStaking"; -import { getOpenOceanTxnData, OpenOceanQuote } from "./openOcean"; -import { getBotanixStakingExternalSwapQuote } from "../../../../sdk/src/utils/swap/botanixStaking"; import { getNeedTokenApprove, useTokensAllowanceData } from "../tokens"; +import { getOpenOceanTxnData, OpenOceanQuote } from "./openOcean"; export function useExternalSwapOutputRequest({ chainId, @@ -26,7 +27,7 @@ export function useExternalSwapOutputRequest({ gasPrice, enabled = true, }: { - chainId: number; + chainId: ContractsChainId; tokenInAddress: string | undefined; tokenOutAddress: string | undefined; receiverAddress: string | undefined; diff --git a/src/domain/synthetics/externalSwaps/useExternalSwapsEnabled.ts b/src/domain/synthetics/externalSwaps/useExternalSwapsEnabled.ts index f0bcee818a..5e70c06660 100644 --- a/src/domain/synthetics/externalSwaps/useExternalSwapsEnabled.ts +++ b/src/domain/synthetics/externalSwaps/useExternalSwapsEnabled.ts @@ -4,7 +4,7 @@ import { selectGasPaymentToken, selectIsExpressTransactionAvailable, } from "context/SyntheticsStateContext/selectors/expressSelectors"; -import { selectSubaccountForAction } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectSubaccountForSettlementChainAction } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectShouldRequestExternalSwapQuote, selectTradeboxCollateralToken, @@ -28,7 +28,7 @@ export function useExternalSwapsEnabled(): boolean | undefined { return gasPaymentToken === collateralToken; }, [collateralToken, gasPaymentToken, isExpressTradingEnabled]); - const subaccount = useSelector(selectSubaccountForAction); + const subaccount = useSelector(selectSubaccountForSettlementChainAction); return !disabledByExpressSchema && !isTwap && !subaccount && shouldRequestExternalSwapQuote; } diff --git a/src/domain/synthetics/features/useDisabledFeatures.ts b/src/domain/synthetics/features/useDisabledFeatures.ts index 04bd1946f9..2814dcf663 100644 --- a/src/domain/synthetics/features/useDisabledFeatures.ts +++ b/src/domain/synthetics/features/useDisabledFeatures.ts @@ -3,6 +3,7 @@ import { useMemo } from "react"; import { getContract } from "config/contracts"; import { useMulticall } from "lib/multicall"; import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; import { gaslessFeatureDisabledKey } from "sdk/configs/dataStore"; export type FeaturesSettings = { @@ -14,7 +15,7 @@ export type EnabledFeaturesResult = { features: FeaturesSettings | undefined; }; -export function useEnabledFeaturesRequest(chainId: number): EnabledFeaturesResult { +export function useEnabledFeaturesRequest(chainId: ContractsChainId): EnabledFeaturesResult { const { data } = useMulticall(chainId, "useEnabledFeatures", { key: [], refreshInterval: CONFIG_UPDATE_INTERVAL, diff --git a/src/domain/synthetics/fees/useGasLimits.ts b/src/domain/synthetics/fees/useGasLimits.ts index 00a9c3b377..32830808e7 100644 --- a/src/domain/synthetics/fees/useGasLimits.ts +++ b/src/domain/synthetics/fees/useGasLimits.ts @@ -17,10 +17,11 @@ import { } from "config/dataStore"; import { useMulticall } from "lib/multicall"; import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; import { GAS_LIMITS_STATIC_CONFIG } from "sdk/configs/chains"; import type { GasLimitsConfig } from "sdk/types/fees"; -export function useGasLimits(chainId: number): GasLimitsConfig | undefined { +export function useGasLimits(chainId: ContractsChainId): GasLimitsConfig | undefined { const { data } = useMulticall(chainId, "useGasLimitsConfig", { key: [], diff --git a/src/domain/synthetics/fees/useRebatesInfo.ts b/src/domain/synthetics/fees/useRebatesInfo.ts index 007b5e49f4..c9f17dfec9 100644 --- a/src/domain/synthetics/fees/useRebatesInfo.ts +++ b/src/domain/synthetics/fees/useRebatesInfo.ts @@ -3,9 +3,12 @@ import { getAddress } from "ethers"; import { useMemo } from "react"; import useSWR from "swr"; -import { expandDecimals } from "lib/numbers"; -import { getSyntheticsGraphClient } from "lib/subgraph"; +import { expandDecimals, PRECISION } from "lib/numbers"; +import { getSubsquidGraphClient } from "lib/subgraph"; import useWallet from "lib/wallets/useWallet"; +import { nowInSeconds } from "sdk/utils/time"; + +import { PositionsConstants } from "../positions/usePositionsConstants"; type RawClaimableCollateral = { marketAddress: string; @@ -14,6 +17,7 @@ type RawClaimableCollateral = { value: string; factor: string; factorByTime: string; + reductionFactor: string; id: string; }; @@ -24,6 +28,7 @@ export type RebateInfoItem = { timeKey: string; tokenAddress: string; valueByFactor: bigint; + reductionFactor: bigint; id: string; }; @@ -32,9 +37,18 @@ export type RebatesInfoResult = { claimablePositionPriceImpactFees: RebateInfoItem[]; }; -export function useRebatesInfoRequest(chainId: number, enabled: boolean): RebatesInfoResult { +export function useRebatesInfoRequest( + chainId: number, + { + enabled, + positionsConstants, + }: { + enabled: boolean; + positionsConstants: PositionsConstants | undefined; + } +): RebatesInfoResult { const { account } = useWallet(); - const client = getSyntheticsGraphClient(chainId); + const client = getSubsquidGraphClient(chainId); const key = enabled && chainId && client && account ? [chainId, "useRebatesInfo", account] : null; @@ -42,7 +56,7 @@ export function useRebatesInfoRequest(chainId: number, enabled: boolean): Rebate fetcher: async () => { const query = gql(`{ claimableCollaterals( - where: { account: "${account!.toLowerCase()}", claimed: false } + where: { account_eq: "${account}", claimed_eq: false } ) { id marketAddress @@ -50,6 +64,7 @@ export function useRebatesInfoRequest(chainId: number, enabled: boolean): Rebate timeKey value factor + reductionFactor factorByTime } }`); @@ -61,21 +76,44 @@ export function useRebatesInfoRequest(chainId: number, enabled: boolean): Rebate }); const { accruedPositionPriceImpactFees, claimablePositionPriceImpactFees } = useMemo(() => { + if (!positionsConstants) { + return { + accruedPositionPriceImpactFees: [], + claimablePositionPriceImpactFees: [], + }; + } + const res: { accruedPositionPriceImpactFees: RebateInfoItem[]; claimablePositionPriceImpactFees: RebateInfoItem[]; } = { accruedPositionPriceImpactFees: [], claimablePositionPriceImpactFees: [] }; data?.forEach((rawRebateInfo) => { - let factor = BigInt(rawRebateInfo.factor); const factorByTime = BigInt(rawRebateInfo.factorByTime); + const reductionFactor = BigInt(rawRebateInfo.reductionFactor); + const timeKey = BigInt(rawRebateInfo.timeKey); + const value = BigInt(rawRebateInfo.value); + + let factor = BigInt(rawRebateInfo.factor); + // factorByTime > factorByAccount if (factorByTime > factor) { factor = factorByTime; } - const value = BigInt(rawRebateInfo.value); - const valueByFactor = (value * factor) / expandDecimals(1, 30); + const timeDiff = BigInt(nowInSeconds()) - timeKey * positionsConstants.claimableCollateralTimeDivisor; + + if (factor === 0n && reductionFactor === 0n && timeDiff > positionsConstants.claimableCollateralDelay) { + factor = PRECISION; + } + + if (factor > reductionFactor) { + factor -= reductionFactor; + } else { + factor = 0n; + } + + let valueByFactor = (value * factor) / expandDecimals(1, 30); const rebateInfo: RebateInfoItem = { factor, @@ -84,6 +122,7 @@ export function useRebatesInfoRequest(chainId: number, enabled: boolean): Rebate timeKey: rawRebateInfo.timeKey, marketAddress: getAddress(rawRebateInfo.marketAddress), tokenAddress: getAddress(rawRebateInfo.tokenAddress), + reductionFactor, id: rawRebateInfo.id, }; @@ -101,7 +140,7 @@ export function useRebatesInfoRequest(chainId: number, enabled: boolean): Rebate }); return res; - }, [data]); + }, [data, positionsConstants]); return { accruedPositionPriceImpactFees, diff --git a/src/domain/synthetics/fees/utils/useUiFeeFactor.ts b/src/domain/synthetics/fees/utils/useUiFeeFactor.ts index 1137deb360..1ca275c84a 100644 --- a/src/domain/synthetics/fees/utils/useUiFeeFactor.ts +++ b/src/domain/synthetics/fees/utils/useUiFeeFactor.ts @@ -6,8 +6,9 @@ import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; import { useMulticall } from "lib/multicall"; import { BN_ZERO } from "lib/numbers"; import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; -export default function useUiFeeFactorRequest(chainId: number) { +export default function useUiFeeFactorRequest(chainId: ContractsChainId) { const account = UI_FEE_RECEIVER_ACCOUNT; const { data: uiFeeFactor, error } = useMulticall(chainId, "uiFeeFactorForAccount", { key: account ? [account] : null, diff --git a/src/domain/synthetics/governance/useGovTokenAmount.ts b/src/domain/synthetics/governance/useGovTokenAmount.ts index fed7446726..b3f9062529 100644 --- a/src/domain/synthetics/governance/useGovTokenAmount.ts +++ b/src/domain/synthetics/governance/useGovTokenAmount.ts @@ -4,8 +4,9 @@ import { getContract } from "config/contracts"; import { contractFetcher } from "lib/contracts"; import { PLACEHOLDER_ACCOUNT } from "lib/legacy"; import useWallet from "lib/wallets/useWallet"; +import type { ContractsChainId } from "sdk/configs/chains"; -export function useGovTokenAmount(chainId: number) { +export function useGovTokenAmount(chainId: ContractsChainId) { let govTokenAddress; try { diff --git a/src/domain/synthetics/governance/useGovTokenDelegates.ts b/src/domain/synthetics/governance/useGovTokenDelegates.ts index ac4de548a3..6835598493 100644 --- a/src/domain/synthetics/governance/useGovTokenDelegates.ts +++ b/src/domain/synthetics/governance/useGovTokenDelegates.ts @@ -4,8 +4,9 @@ import { getContract } from "config/contracts"; import { contractFetcher } from "lib/contracts"; import { PLACEHOLDER_ACCOUNT } from "lib/legacy"; import useWallet from "lib/wallets/useWallet"; +import type { ContractsChainId } from "sdk/configs/chains"; -export function useGovTokenDelegates(chainId: number) { +export function useGovTokenDelegates(chainId: ContractsChainId) { let govTokenAddress; try { diff --git a/src/domain/synthetics/leaderboard/types.ts b/src/domain/synthetics/leaderboard/types.ts index f8b55b43da..b01774917a 100644 --- a/src/domain/synthetics/leaderboard/types.ts +++ b/src/domain/synthetics/leaderboard/types.ts @@ -1,3 +1,5 @@ +import type { ContractsChainId } from "sdk/configs/chains"; + import { LEADERBOARD_PAGES_ORDER } from "./constants"; export enum PerfPeriod { @@ -37,7 +39,7 @@ export type LeaderboardPageConfig = key: LeaderboardPageKey; href: string; isCompetition: true; - chainId: number; + chainId: ContractsChainId; enabled: boolean; timeframe: LeaderboardTimeframe; }; diff --git a/src/domain/synthetics/markets/claimFundingFeesTxn.ts b/src/domain/synthetics/markets/claimFundingFeesTxn.ts index 10732f9662..a16b8777af 100644 --- a/src/domain/synthetics/markets/claimFundingFeesTxn.ts +++ b/src/domain/synthetics/markets/claimFundingFeesTxn.ts @@ -1,12 +1,20 @@ import { t } from "@lingui/macro"; -import { Signer, ethers } from "ethers"; +import { Signer, Wallet, ethers } from "ethers"; +import { encodeFunctionData } from "viem"; import { getContract } from "config/contracts"; import { callContract } from "lib/contracts"; +import { ExpressTxnData } from "lib/transactions"; +import { WalletSigner } from "lib/wallets"; +import { signTypedData } from "lib/wallets/signing"; import { abis } from "sdk/abis"; +import { ContractsChainId, SourceChainId } from "sdk/configs/chains"; import { validateSignerAddress } from "components/Errors/errorToasts"; +import { RelayParamsPayload, getGelatoRelayRouterDomain, hashRelayParams } from "../express"; +import { getMultichainInfoFromSigner } from "../express/expressOrderUtils"; + type Params = { account: string; fundingFees: { @@ -16,7 +24,7 @@ type Params = { setPendingTxns: (txns: any) => void; }; -export async function claimFundingFeesTxn(chainId: number, signer: Signer, p: Params) { +export async function claimFundingFeesTxn(chainId: ContractsChainId, signer: Signer, p: Params) { const { setPendingTxns, fundingFees, account } = p; await validateSignerAddress(signer, account); @@ -37,3 +45,98 @@ export async function claimFundingFeesTxn(chainId: number, signer: Signer, p: Pa } ); } + +export async function buildAndSignClaimFundingFeesTxn({ + signer, + relayParams, + account, + markets, + tokens, + receiver, + chainId, + emptySignature = false, + relayerFeeTokenAddress, + relayerFeeAmount, +}: { + signer: WalletSigner; + relayParams: RelayParamsPayload; + account: string; + markets: string[]; + tokens: string[]; + receiver: string; + chainId: ContractsChainId; + emptySignature?: boolean; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; +}): Promise { + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + if (!srcChainId) { + throw new Error("No srcChainId"); + } + + let signature: string; + + if (emptySignature) { + signature = "0x"; + } else { + signature = await signClaimFundingFeesPayload({ + signer, + relayParams, + markets, + tokens, + receiver, + chainId, + srcChainId, + }); + } + + const claimFundingFeesCallData = encodeFunctionData({ + abi: abis.MultichainClaimsRouter, + functionName: "claimFundingFees", + args: [{ ...relayParams, signature }, account, srcChainId, markets, tokens, receiver], + }); + + return { + callData: claimFundingFeesCallData, + to: getContract(chainId, "MultichainClaimsRouter"), + feeToken: relayerFeeTokenAddress, + feeAmount: relayerFeeAmount, + }; +} + +async function signClaimFundingFeesPayload({ + signer, + relayParams, + markets, + tokens, + receiver, + chainId, + srcChainId, +}: { + signer: WalletSigner | Wallet; + relayParams: RelayParamsPayload; + markets: string[]; + tokens: string[]; + receiver: string; + chainId: ContractsChainId; + srcChainId: SourceChainId; +}) { + const types = { + ClaimFundingFees: [ + { name: "markets", type: "address[]" }, + { name: "tokens", type: "address[]" }, + { name: "receiver", type: "address" }, + { name: "relayParams", type: "bytes32" }, + ], + }; + + const domain = getGelatoRelayRouterDomain(srcChainId, getContract(chainId, "MultichainClaimsRouter")); + const typedData = { + markets, + tokens, + receiver, + relayParams: hashRelayParams(relayParams), + }; + + return signTypedData({ signer, domain, types, typedData }); +} diff --git a/src/domain/synthetics/markets/createDepositTxn.ts b/src/domain/synthetics/markets/createDepositTxn.ts index 71e13373af..9a525274a0 100644 --- a/src/domain/synthetics/markets/createDepositTxn.ts +++ b/src/domain/synthetics/markets/createDepositTxn.ts @@ -8,7 +8,9 @@ import { callContract } from "lib/contracts"; import { OrderMetricId } from "lib/metrics/types"; import { BlockTimestampData } from "lib/useBlockTimestampRequest"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { NATIVE_TOKEN_ADDRESS, convertTokenAddress } from "sdk/configs/tokens"; +import { IDepositUtils } from "typechain-types/ExchangeRouter"; import { validateSignerAddress } from "components/Errors/errorToasts"; @@ -38,7 +40,7 @@ export type CreateDepositParams = { setPendingDeposit: SetPendingDeposit; }; -export async function createDepositTxn(chainId: number, signer: Signer, p: CreateDepositParams) { +export async function createDepositTxn(chainId: ContractsChainId, signer: Signer, p: CreateDepositParams) { const contract = new ethers.Contract(getContract(chainId, "ExchangeRouter"), abis.ExchangeRouter, signer); const depositVaultAddress = getContract(chainId, "DepositVault"); @@ -85,19 +87,22 @@ export async function createDepositTxn(chainId: number, signer: Signer, p: Creat method: "createDeposit", params: [ { - receiver: p.account, - callbackContract: ethers.ZeroAddress, - market: p.marketTokenAddress, - initialLongToken: initialLongTokenAddress, - initialShortToken: initialShortTokenAddress, - longTokenSwapPath: p.longTokenSwapPath, - shortTokenSwapPath: p.shortTokenSwapPath, + addresses: { + receiver: p.account, + callbackContract: ethers.ZeroAddress, + uiFeeReceiver: UI_FEE_RECEIVER_ACCOUNT ?? ethers.ZeroAddress, + market: p.marketTokenAddress, + initialLongToken: initialLongTokenAddress, + initialShortToken: initialShortTokenAddress, + longTokenSwapPath: p.longTokenSwapPath, + shortTokenSwapPath: p.shortTokenSwapPath, + }, minMarketTokens: minMarketTokens, shouldUnwrapNativeToken: shouldUnwrapNativeToken, executionFee: p.executionFee, - callbackGasLimit: 0n, - uiFeeReceiver: UI_FEE_RECEIVER_ACCOUNT ?? ethers.ZeroAddress, - }, + callbackGasLimit: 0, + dataList: [], + } satisfies IDepositUtils.CreateDepositParamsStruct, ], }, ]; diff --git a/src/domain/synthetics/markets/createGlvDepositTxn.ts b/src/domain/synthetics/markets/createGlvDepositTxn.ts index 438bd3f4cc..7d3df45ff3 100644 --- a/src/domain/synthetics/markets/createGlvDepositTxn.ts +++ b/src/domain/synthetics/markets/createGlvDepositTxn.ts @@ -1,11 +1,14 @@ import { t } from "@lingui/macro"; import { Signer, ethers } from "ethers"; +import { numberToHex } from "viem"; import { getContract } from "config/contracts"; import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; import { callContract } from "lib/contracts"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { NATIVE_TOKEN_ADDRESS, convertTokenAddress } from "sdk/configs/tokens"; +import { IGlvDepositUtils } from "typechain-types/GlvRouter"; import { validateSignerAddress } from "components/Errors/errorToasts"; @@ -18,9 +21,10 @@ interface CreateGlvDepositParams extends CreateDepositParams { glvAddress: string; marketTokenAmount: bigint; isMarketTokenDeposit: boolean; + isFirstDeposit: boolean; } -export async function createGlvDepositTxn(chainId: number, signer: Signer, p: CreateGlvDepositParams) { +export async function createGlvDepositTxn(chainId: ContractsChainId, signer: Signer, p: CreateGlvDepositParams) { const contract = new ethers.Contract(getContract(chainId, "GlvRouter"), abis.GlvRouter, signer); const depositVaultAddress = getContract(chainId, "GlvVault"); @@ -71,21 +75,24 @@ export async function createGlvDepositTxn(chainId: number, signer: Signer, p: Cr method: "createGlvDeposit", params: [ { - glv: p.glvAddress, - market: p.marketTokenAddress, - receiver: p.account, - callbackContract: ethers.ZeroAddress, - uiFeeReceiver: UI_FEE_RECEIVER_ACCOUNT ?? ethers.ZeroAddress, - initialLongToken: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialLongTokenAddress, - initialShortToken: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialShortTokenAddress, - longTokenSwapPath: [], - shortTokenSwapPath: [], + addresses: { + glv: p.glvAddress, + market: p.marketTokenAddress, + receiver: p.isFirstDeposit ? numberToHex(1, { size: 20 }) : p.account, + callbackContract: ethers.ZeroAddress, + uiFeeReceiver: UI_FEE_RECEIVER_ACCOUNT ?? ethers.ZeroAddress, + initialLongToken: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialLongTokenAddress, + initialShortToken: p.isMarketTokenDeposit ? ethers.ZeroAddress : initialShortTokenAddress, + longTokenSwapPath: [], + shortTokenSwapPath: [], + }, minGlvTokens: minGlvTokens, executionFee: p.executionFee, callbackGasLimit: 0n, shouldUnwrapNativeToken, isMarketTokenDeposit: p.isMarketTokenDeposit, - }, + dataList: [], + } satisfies IGlvDepositUtils.CreateGlvDepositParamsStruct, ], }, ]; diff --git a/src/domain/synthetics/markets/createGlvWithdrawalTxn.ts b/src/domain/synthetics/markets/createGlvWithdrawalTxn.ts index 28486961f5..084d753d5e 100644 --- a/src/domain/synthetics/markets/createGlvWithdrawalTxn.ts +++ b/src/domain/synthetics/markets/createGlvWithdrawalTxn.ts @@ -6,6 +6,8 @@ import { UI_FEE_RECEIVER_ACCOUNT } from "config/ui"; import { callContract } from "lib/contracts"; import { isAddressZero } from "lib/legacy"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; +import { IGlvWithdrawalUtils } from "typechain-types/GlvRouter"; import { validateSignerAddress } from "components/Errors/errorToasts"; @@ -22,7 +24,7 @@ interface GlvWithdrawalParams extends Omit 0 ? [...marketsAddresses] : null, @@ -248,7 +246,7 @@ function useMarketsConfigsRequest({ isDependenciesLoading, marketsAddresses, }: { - chainId: number; + chainId: ContractsChainId; isDependenciesLoading: boolean; marketsAddresses: string[] | undefined; }) { @@ -313,23 +311,33 @@ function useMarketsConfigsRequest({ maxPnlFactorForTradersShort: dataStoreValues.maxPnlFactorForTradersShort.returnValues[0], minCollateralFactor: dataStoreValues.minCollateralFactor.returnValues[0], + minCollateralFactorForLiquidation: dataStoreValues.minCollateralFactorForLiquidation.returnValues[0], + minCollateralFactorForOpenInterestLong: dataStoreValues.minCollateralFactorForOpenInterestLong.returnValues[0], minCollateralFactorForOpenInterestShort: dataStoreValues.minCollateralFactorForOpenInterestShort.returnValues[0], - positionFeeFactorForPositiveImpact: dataStoreValues.positionFeeFactorForPositiveImpact.returnValues[0], - positionFeeFactorForNegativeImpact: dataStoreValues.positionFeeFactorForNegativeImpact.returnValues[0], + positionFeeFactorForBalanceWasImproved: + dataStoreValues.positionFeeFactorForBalanceWasImproved.returnValues[0], + positionFeeFactorForBalanceWasNotImproved: + dataStoreValues.positionFeeFactorForBalanceWasNotImproved.returnValues[0], positionImpactFactorPositive: dataStoreValues.positionImpactFactorPositive.returnValues[0], positionImpactFactorNegative: dataStoreValues.positionImpactFactorNegative.returnValues[0], maxPositionImpactFactorPositive: dataStoreValues.maxPositionImpactFactorPositive.returnValues[0], maxPositionImpactFactorNegative: dataStoreValues.maxPositionImpactFactorNegative.returnValues[0], maxPositionImpactFactorForLiquidations: dataStoreValues.maxPositionImpactFactorForLiquidations.returnValues[0], + maxLendableImpactFactor: dataStoreValues.maxLendableImpactFactor.returnValues[0], + maxLendableImpactFactorForWithdrawals: + dataStoreValues.maxLendableImpactFactorForWithdrawals.returnValues[0], + maxLendableImpactUsd: dataStoreValues.maxLendableImpactUsd.returnValues[0], + lentPositionImpactPoolAmount: dataStoreValues.lentPositionImpactPoolAmount.returnValues[0], positionImpactExponentFactor: dataStoreValues.positionImpactExponentFactor.returnValues[0], - swapFeeFactorForPositiveImpact: dataStoreValues.swapFeeFactorForPositiveImpact.returnValues[0], - swapFeeFactorForNegativeImpact: dataStoreValues.swapFeeFactorForNegativeImpact.returnValues[0], + swapFeeFactorForBalanceWasImproved: dataStoreValues.swapFeeFactorForBalanceWasImproved.returnValues[0], + swapFeeFactorForBalanceWasNotImproved: + dataStoreValues.swapFeeFactorForBalanceWasNotImproved.returnValues[0], swapImpactFactorPositive: dataStoreValues.swapImpactFactorPositive.returnValues[0], swapImpactFactorNegative: dataStoreValues.swapImpactFactorNegative.returnValues[0], atomicSwapFeeFactor: dataStoreValues.atomicSwapFeeFactor.returnValues[0], diff --git a/src/domain/synthetics/markets/useMarketsInfoRequest/useFastMarketsInfoRequest.ts b/src/domain/synthetics/markets/useMarketsInfoRequest/useFastMarketsInfoRequest.ts index 06e307e4c9..82b39bdef0 100644 --- a/src/domain/synthetics/markets/useMarketsInfoRequest/useFastMarketsInfoRequest.ts +++ b/src/domain/synthetics/markets/useMarketsInfoRequest/useFastMarketsInfoRequest.ts @@ -87,6 +87,11 @@ export function useFastMarketsInfoRequest(chainId: number) { positionImpactFactorNegative maxPositionImpactFactorPositive maxPositionImpactFactorNegative + maxLendableImpactFactor + maxLendableImpactFactorForWithdrawals + maxLendableImpactUsd + lentPositionImpactPoolAmount + atomicSwapFeeFactor maxPositionImpactFactorForLiquidations positionImpactExponentFactor @@ -174,13 +179,14 @@ export function useFastMarketsInfoRequest(chainId: number) { positionImpactPoolDistributionRate: BigInt(mInfo.positionImpactPoolDistributionRate), minCollateralFactor: BigInt(mInfo.minCollateralFactor), + minCollateralFactorForLiquidation: BigInt(mInfo.minCollateralFactor), minCollateralFactorForOpenInterestLong: BigInt(mInfo.minCollateralFactorForOpenInterestLong), minCollateralFactorForOpenInterestShort: BigInt(mInfo.minCollateralFactorForOpenInterestShort), swapImpactPoolAmountLong: BigInt(mInfo.swapImpactPoolAmountLong), swapImpactPoolAmountShort: BigInt(mInfo.swapImpactPoolAmountShort), - atomicSwapFeeFactor: 0n, + atomicSwapFeeFactor: BigInt(mInfo.atomicSwapFeeFactor), maxPnlFactorForTradersLong: BigInt(mInfo.maxPnlFactorForTradersLong), maxPnlFactorForTradersShort: BigInt(mInfo.maxPnlFactorForTradersShort), @@ -190,17 +196,21 @@ export function useFastMarketsInfoRequest(chainId: number) { longInterestInTokens: BigInt(mInfo.longOpenInterestInTokens), shortInterestInTokens: BigInt(mInfo.shortOpenInterestInTokens), - positionFeeFactorForPositiveImpact: BigInt(mInfo.positionFeeFactorForPositiveImpact), - positionFeeFactorForNegativeImpact: BigInt(mInfo.positionFeeFactorForNegativeImpact), + positionFeeFactorForBalanceWasImproved: BigInt(mInfo.positionFeeFactorForPositiveImpact), + positionFeeFactorForBalanceWasNotImproved: BigInt(mInfo.positionFeeFactorForNegativeImpact), positionImpactFactorPositive: BigInt(mInfo.positionImpactFactorPositive), positionImpactFactorNegative: BigInt(mInfo.positionImpactFactorNegative), maxPositionImpactFactorPositive: BigInt(mInfo.maxPositionImpactFactorPositive), maxPositionImpactFactorNegative: BigInt(mInfo.maxPositionImpactFactorNegative), maxPositionImpactFactorForLiquidations: BigInt(mInfo.maxPositionImpactFactorForLiquidations), + maxLendableImpactFactor: BigInt(mInfo.maxLendableImpactFactor), + maxLendableImpactFactorForWithdrawals: BigInt(mInfo.maxLendableImpactFactorForWithdrawals), + maxLendableImpactUsd: BigInt(mInfo.maxLendableImpactUsd), + lentPositionImpactPoolAmount: BigInt(mInfo.lentPositionImpactPoolAmount), positionImpactExponentFactor: BigInt(mInfo.positionImpactExponentFactor), - swapFeeFactorForPositiveImpact: BigInt(mInfo.swapFeeFactorForPositiveImpact), - swapFeeFactorForNegativeImpact: BigInt(mInfo.swapFeeFactorForNegativeImpact), + swapFeeFactorForBalanceWasImproved: BigInt(mInfo.swapFeeFactorForPositiveImpact), + swapFeeFactorForBalanceWasNotImproved: BigInt(mInfo.swapFeeFactorForNegativeImpact), swapImpactFactorPositive: BigInt(mInfo.swapImpactFactorPositive), swapImpactFactorNegative: BigInt(mInfo.swapImpactFactorNegative), swapImpactExponentFactor: BigInt(mInfo.swapImpactExponentFactor), diff --git a/src/domain/synthetics/markets/useUserEarnings.ts b/src/domain/synthetics/markets/useUserEarnings.ts index ae031a5917..50a0c61482 100644 --- a/src/domain/synthetics/markets/useUserEarnings.ts +++ b/src/domain/synthetics/markets/useUserEarnings.ts @@ -6,6 +6,7 @@ import { getSubgraphUrl } from "config/subgraph"; import { GMX_DECIMALS } from "lib/legacy"; import { expandDecimals } from "lib/numbers"; import useWallet from "lib/wallets/useWallet"; +import type { ContractsChainId, SourceChainId } from "sdk/configs/chains"; import { bigMath } from "sdk/utils/bigmath"; import graphqlFetcher from "sdk/utils/graphqlFetcher"; @@ -14,6 +15,7 @@ import { useDaysConsideredInMarketsApr } from "./useDaysConsideredInMarketsApr"; import { useGmMarketsApy } from "./useGmMarketsApy"; import { useMarketsInfoRequest } from "./useMarketsInfoRequest"; import { useMarketTokensData } from "./useMarketTokensData"; +import { useTokensDataRequest } from "../tokens"; type RawBalanceChange = { cumulativeIncome: string; @@ -87,9 +89,10 @@ function createQuery(marketAddress: string) { `; } -export const useUserEarnings = (chainId: number) => { - const { marketsInfoData } = useMarketsInfoRequest(chainId); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: true }); +export const useUserEarnings = (chainId: ContractsChainId, srcChainId: SourceChainId | undefined) => { + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true }); const subgraphUrl = getSubgraphUrl(chainId, "syntheticsStats"); const marketAddresses = useMemo( @@ -102,7 +105,7 @@ export const useUserEarnings = (chainId: number) => { const daysConsidered = useDaysConsideredInMarketsApr(); const { account } = useWallet(); - const marketsTokensAPRData = useGmMarketsApy(chainId, { period: "7d" }).marketsTokensApyData; + const marketsTokensAPRData = useGmMarketsApy(chainId, srcChainId, { period: "7d" }).marketsTokensApyData; const { data } = useSWR(key, { fetcher: async (): Promise => { diff --git a/src/domain/synthetics/markets/utils.ts b/src/domain/synthetics/markets/utils.ts index 1b9c824932..37e18ba7d6 100644 --- a/src/domain/synthetics/markets/utils.ts +++ b/src/domain/synthetics/markets/utils.ts @@ -195,7 +195,9 @@ export function getMinPriceImpactMarket( const liquidity = getAvailableUsdLiquidityForPosition(marketInfo, isLong); if (isMarketIndexToken(marketInfo, indexTokenAddress) && liquidity > sizeDeltaUsd) { - const priceImpactDeltaUsd = getCappedPositionImpactUsd(marketInfo, sizeDeltaUsd, isLong); + const { priceImpactDeltaUsd } = getCappedPositionImpactUsd(marketInfo, sizeDeltaUsd, isLong, true, { + shouldCapNegativeImpact: true, + }); if (bestImpactDeltaUsd === undefined || priceImpactDeltaUsd > bestImpactDeltaUsd) { bestMarket = marketInfo; diff --git a/src/domain/synthetics/orders/cancelOrdersTxn.ts b/src/domain/synthetics/orders/cancelOrdersTxn.ts index 5a8d6281d2..ebef5ce393 100644 --- a/src/domain/synthetics/orders/cancelOrdersTxn.ts +++ b/src/domain/synthetics/orders/cancelOrdersTxn.ts @@ -5,6 +5,7 @@ import { ReactNode } from "react"; import { getContract } from "config/contracts"; import { callContract } from "lib/contracts"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { isTwapOrder } from "sdk/utils/orders"; import { OrderParams } from "./types"; @@ -15,7 +16,7 @@ export type CancelOrderParams = { detailsMsg?: ReactNode; }; -export async function cancelOrdersTxn(chainId: number, signer: Signer, p: CancelOrderParams) { +export async function cancelOrdersTxn(chainId: ContractsChainId, signer: Signer, p: CancelOrderParams) { const router = new ethers.Contract(getContract(chainId, "ExchangeRouter"), abis.ExchangeRouter, signer); const orderKeys = p.orders.flatMap((o) => (isTwapOrder(o) ? o.orders.map((o) => o.key as string) : o.key)); diff --git a/src/domain/synthetics/orders/sendBatchOrderTxn.ts b/src/domain/synthetics/orders/sendBatchOrderTxn.ts index 819b7a42d2..dc9adabe28 100644 --- a/src/domain/synthetics/orders/sendBatchOrderTxn.ts +++ b/src/domain/synthetics/orders/sendBatchOrderTxn.ts @@ -1,6 +1,7 @@ +import { Provider } from "ethers"; import { withRetry } from "viem"; -import { NoncesData } from "context/ExpressNoncesContext/ExpressNoncesContextProvider"; +import { ContractsChainId } from "config/chains"; import { ExpressTxnParams } from "domain/synthetics/express"; import { buildAndSignExpressBatchOrderTxn } from "domain/synthetics/express/expressOrderUtils"; import { isLimitSwapOrderType } from "domain/synthetics/orders"; @@ -22,6 +23,7 @@ import { import { signerAddressError } from "components/Errors/errorToasts"; import { getOrdersTriggerPriceOverrides, getSimulationPrices, simulateExecution } from "./simulation"; +import { callRelayTransaction } from "../express/callRelayTransaction"; export type BatchSimulationParams = { tokensData: TokensData; @@ -34,52 +36,67 @@ export type BatchOrderTxnCtx = { signer: WalletSigner; }; +const DEFAULT_RUN_SIMULATION = () => Promise.resolve(undefined); + export async function sendBatchOrderTxn({ chainId, signer, + isGmxAccount, + provider, batchParams, - noncesData, expressParams, simulationParams, callback, }: { - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; + isGmxAccount: boolean; + provider: Provider; batchParams: BatchOrderTxnParams; expressParams: ExpressTxnParams | undefined; - noncesData?: NoncesData; simulationParams: BatchSimulationParams | undefined; callback: TxnCallback | undefined; }) { const eventBuilder = new TxnEventBuilder({ expressParams, batchParams, signer }); try { + if (isGmxAccount && !expressParams) { + throw new Error("Multichain orders are only supported with express params"); + } + + if (isGmxAccount && !provider) { + throw new Error("provider is required for multichain txns"); + } callback?.(eventBuilder.Submitted()); - const runSimulation = async () => - simulationParams - ? makeBatchOrderSimulation({ - chainId, - signer, - batchParams, - blockTimestampData: simulationParams.blockTimestampData, - tokensData: simulationParams.tokensData, - expressParams, - }) - : Promise.resolve(undefined); + let runSimulation: () => Promise = DEFAULT_RUN_SIMULATION; + + if (simulationParams) { + runSimulation = () => { + return makeBatchOrderSimulation({ + chainId, + signer, + batchParams, + blockTimestampData: simulationParams.blockTimestampData, + tokensData: simulationParams.tokensData, + expressParams, + provider, + isGmxAccount, + }); + }; + } if (expressParams) { await runSimulation().then(() => callback?.(eventBuilder.Simulated())); - const txnData = await buildAndSignExpressBatchOrderTxn({ - chainId, + chainId: chainId as ContractsChainId, signer, batchParams, relayParamsPayload: expressParams.relayParamsPayload, relayerFeeTokenAddress: expressParams.gasPaymentParams.relayerFeeTokenAddress, relayerFeeAmount: expressParams.gasPaymentParams.relayerFeeAmount, subaccount: expressParams.subaccount, - noncesData, + isGmxAccount, }); callback?.(eventBuilder.Sending()); @@ -138,18 +155,22 @@ export async function sendBatchOrderTxn({ export const makeBatchOrderSimulation = async ({ chainId, signer, + isGmxAccount, + provider, batchParams, blockTimestampData, tokensData, expressParams, }: { - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; + isGmxAccount: boolean; + provider: Provider; batchParams: BatchOrderTxnParams; blockTimestampData: BlockTimestampData | undefined; tokensData: TokensData; expressParams: ExpressTxnParams | undefined; -}) => { +}): Promise => { try { if (getIsInvalidBatchReceiver(batchParams, signer.address)) { throw extendError(new Error(signerAddressError), { @@ -175,12 +196,15 @@ export const makeBatchOrderSimulation = async ({ expiresAt: onchainData.expiresAt, isActive: onchainData.active, nonce: onchainData.approvalNonce, + multichainNonce: onchainData.multichainApprovalNonce, + integrationId: onchainData.integrationId, }, signedData: { maxAllowedCount: signedApproval.maxAllowedCount, expiresAt: signedApproval.expiresAt, shouldAdd: signedApproval.shouldAdd, nonce: signedApproval.nonce, + integrationId: signedApproval.integrationId, }, }, }); @@ -213,26 +237,53 @@ export const makeBatchOrderSimulation = async ({ return Promise.resolve(); } - const { encodedMulticall, value } = getBatchOrderMulticallPayload({ - params: { - ...batchParams, - createOrderParams: [batchParams.createOrderParams[0]], - }, - }); + if (isGmxAccount) { + if (!expressParams) { + throw new Error("Multichain orders are only supported with express params"); + } - return simulateExecution(chainId, { - account: signer.address, - prices: getSimulationPrices( + const { callData, feeAmount, feeToken, to } = await buildAndSignExpressBatchOrderTxn({ + signer, chainId, - tokensData, - getOrdersTriggerPriceOverrides([batchParams.createOrderParams[0]]) - ), - tokenPermits: expressParams?.relayParamsPayload.tokenPermits ?? [], - createMulticallPayload: encodedMulticall, - value, - blockTimestampData, - isExpress: Boolean(expressParams), - }); + relayParamsPayload: expressParams.relayParamsPayload, + batchParams: batchParams, + subaccount: expressParams.subaccount, + emptySignature: true, + relayerFeeTokenAddress: expressParams.gasPaymentParams.relayerFeeTokenAddress, + relayerFeeAmount: expressParams.gasPaymentParams.relayerFeeAmount, + isGmxAccount, + }); + + await callRelayTransaction({ + chainId, + relayRouterAddress: to, + gelatoRelayFeeToken: feeToken, + gelatoRelayFeeAmount: feeAmount, + provider, + calldata: callData, + }); + } else { + const { encodedMulticall, value } = getBatchOrderMulticallPayload({ + params: { + ...batchParams, + createOrderParams: [batchParams.createOrderParams[0]], + }, + }); + + await simulateExecution(chainId, { + account: signer.address, + prices: getSimulationPrices( + chainId, + tokensData, + getOrdersTriggerPriceOverrides([batchParams.createOrderParams[0]]) + ), + tokenPermits: expressParams?.relayParamsPayload.tokenPermits ?? [], + createMulticallPayload: encodedMulticall, + value, + blockTimestampData, + isExpress: Boolean(expressParams), + }); + } } catch (error) { throw extendError(error, { errorContext: "simulation", diff --git a/src/domain/synthetics/orders/setAutoCancelOrdersTxn.ts b/src/domain/synthetics/orders/setAutoCancelOrdersTxn.ts index 10ce72a9cf..9615e87db5 100644 --- a/src/domain/synthetics/orders/setAutoCancelOrdersTxn.ts +++ b/src/domain/synthetics/orders/setAutoCancelOrdersTxn.ts @@ -6,6 +6,7 @@ import { getContract } from "config/contracts"; import { Token } from "domain/tokens"; import { callContract } from "lib/contracts"; import { abis } from "sdk/abis"; +import { ContractsChainId } from "sdk/configs/chains"; import { OrderType } from "sdk/types/orders"; import { buildUpdateOrderMulticall, @@ -30,7 +31,7 @@ type SetAutoCancelOrdersMeta = { }; export function setAutoCancelOrdersTxn( - chainId: number, + chainId: ContractsChainId, signer: Signer, setPendingTxns: (txns: any) => void, ps: SetAutoCancelOrdersParams[], diff --git a/src/domain/synthetics/orders/simulateExecuteTxn.tsx b/src/domain/synthetics/orders/simulateExecuteTxn.tsx index da54842997..cee2626ce9 100644 --- a/src/domain/synthetics/orders/simulateExecuteTxn.tsx +++ b/src/domain/synthetics/orders/simulateExecuteTxn.tsx @@ -19,6 +19,7 @@ import { getProvider } from "lib/rpc"; import { getTenderlyConfig, simulateTxWithTenderly } from "lib/tenderly"; import { BlockTimestampData, adjustBlockTimestamp } from "lib/useBlockTimestampRequest"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { convertTokenAddress } from "sdk/configs/tokens"; import { ExternalSwapQuote } from "sdk/types/trade"; import { CustomErrorName, ErrorData, extractDataFromError, extractTxnError, isContractError } from "sdk/utils/errors"; @@ -64,7 +65,7 @@ export function isSimulationPassed(errorData: ErrorData) { /** * @deprecated use simulateExecution instead */ -export async function simulateExecuteTxn(chainId: number, p: SimulateExecuteParams) { +export async function simulateExecuteTxn(chainId: ContractsChainId, p: SimulateExecuteParams) { const provider = getProvider(undefined, chainId); const multicallAddress = getContract(chainId, "Multicall"); @@ -177,7 +178,6 @@ export async function simulateExecuteTxn(chainId: number, p: SimulateExecutePara try { const errorData = extractDataFromError(txnError?.info?.error?.message) ?? extractDataFromError(txnError?.message); - const error = new Error("No data found in error."); error.cause = txnError; if (!errorData) throw error; diff --git a/src/domain/synthetics/orders/simulation.ts b/src/domain/synthetics/orders/simulation.ts index 39dc932fb5..d21fd3084b 100644 --- a/src/domain/synthetics/orders/simulation.ts +++ b/src/domain/synthetics/orders/simulation.ts @@ -17,6 +17,7 @@ import { getExpressProvider, getProvider } from "lib/rpc"; import { getTenderlyConfig, simulateTxWithTenderly } from "lib/tenderly"; import { BlockTimestampData, adjustBlockTimestamp } from "lib/useBlockTimestampRequest"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { convertTokenAddress } from "sdk/configs/tokens"; import { CustomErrorName, ErrorData, TxErrorType, extendError, isContractError, parseError } from "sdk/utils/errors"; import { CreateOrderTxnParams, ExternalCallsPayload } from "sdk/utils/orderTransactions"; @@ -43,7 +44,7 @@ export function isSimulationPassed(errorData: ErrorData) { return isContractError(errorData, CustomErrorName.EndOfOracleSimulation); } -export async function simulateExecution(chainId: number, p: SimulateExecuteParams) { +export async function simulateExecution(chainId: ContractsChainId, p: SimulateExecuteParams) { let provider: JsonRpcProvider; if (p.isExpress) { diff --git a/src/domain/synthetics/orders/updateOrderTxn.ts b/src/domain/synthetics/orders/updateOrderTxn.ts index d02d0b52e0..8b55879273 100644 --- a/src/domain/synthetics/orders/updateOrderTxn.ts +++ b/src/domain/synthetics/orders/updateOrderTxn.ts @@ -4,7 +4,8 @@ import { getContract } from "config/contracts"; import { SetPendingTransactions } from "context/PendingTxnsContext/PendingTxnsContext"; import type { SetPendingOrderUpdate } from "context/SyntheticsEvents"; import { convertToContractPrice } from "domain/synthetics/tokens"; -import { Token } from "domain/tokens"; +import type { Token } from "domain/tokens"; +import type { ContractsChainId } from "sdk/configs/chains"; export type UpdateOrderParams = { orderKey: string; @@ -35,7 +36,7 @@ export function createUpdateEncodedPayload({ minOutputAmount, autoCancel, }: { - chainId: number; + chainId: ContractsChainId; router: ethers.Contract; orderKey: string; sizeDeltaUsd: bigint; diff --git a/src/domain/synthetics/orders/useOrderEditorState.ts b/src/domain/synthetics/orders/useOrderEditorState.ts index 6002a4793b..5d13ec7052 100644 --- a/src/domain/synthetics/orders/useOrderEditorState.ts +++ b/src/domain/synthetics/orders/useOrderEditorState.ts @@ -154,7 +154,8 @@ function useAcceptablePrice( const initialTriggerPrice = positionOrder.triggerPrice; const initialPriceDelta = initialAcceptablePrice === undefined ? 0n : bigMath.abs(initialAcceptablePrice - (initialTriggerPrice ?? 0n)); - initialAcceptablePriceImpactBps = getBasisPoints(initialPriceDelta, initialTriggerPrice); + initialAcceptablePriceImpactBps = + initialTriggerPrice === 0n ? 0n : getBasisPoints(initialPriceDelta, initialTriggerPrice); } const [acceptablePriceImpactBps, setAcceptablePriceImpactBps] = useState(initialAcceptablePriceImpactBps); diff --git a/src/domain/synthetics/orders/useOrders.ts b/src/domain/synthetics/orders/useOrders.ts index 078d26d28f..d4ab7db252 100644 --- a/src/domain/synthetics/orders/useOrders.ts +++ b/src/domain/synthetics/orders/useOrders.ts @@ -1,8 +1,13 @@ import { useMemo } from "react"; import { Address, isAddressEqual } from "viem"; +import { ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { accountOrderListKey } from "config/dataStore"; +import type { MarketsInfoData } from "domain/synthetics/markets/types"; +import { OrderTypeFilterValue, convertOrderTypeFilterValues } from "domain/synthetics/orders/ordersFilters"; +import { DecreasePositionSwapType, Order, OrderType, OrdersData } from "domain/synthetics/orders/types"; +import { getSwapPathOutputAddresses } from "domain/synthetics/trade"; import { CacheKey, MulticallRequestConfig, MulticallResult, useMulticall } from "lib/multicall"; import { EMPTY_ARRAY } from "lib/objects"; import { getWrappedToken } from "sdk/configs/tokens"; @@ -15,17 +20,13 @@ import { isVisibleOrder, } from "sdk/utils/orders"; import { decodeTwapUiFeeReceiver } from "sdk/utils/twap/uiFeeReceiver"; +import { ReaderUtils } from "typechain-types/SyntheticsReader"; import type { MarketFilterLongShortDirection, MarketFilterLongShortItemData, } from "components/Synthetics/TableMarketFilter/MarketFilterLongShort"; -import type { MarketsInfoData } from "../markets/types"; -import { getSwapPathOutputAddresses } from "../trade"; -import { OrderTypeFilterValue, convertOrderTypeFilterValues } from "./ordersFilters"; -import { DecreasePositionSwapType, OrderType, OrdersData } from "./types"; - type OrdersResult = { ordersData?: OrdersData; count?: number; @@ -34,7 +35,7 @@ type OrdersResult = { const DEFAULT_COUNT = 1000; export function useOrders( - chainId: number, + chainId: ContractsChainId, { account, marketsDirectionsFilter = EMPTY_ARRAY, @@ -91,7 +92,7 @@ export function useOrders( [account, marketsDirectionsFilter, orderTypesFilter] ); - const { data } = useMulticall(chainId, "useOrdersData", { + const { data } = useMulticall(chainId, `useOrdersData-${chainId}`, { key: key, request: buildUseOrdersMulticall, parseResponse: parseResponse, @@ -158,7 +159,7 @@ export function useOrders( }; } -function buildUseOrdersMulticall(chainId: number, key: CacheKey) { +function buildUseOrdersMulticall(chainId: ContractsChainId, key: CacheKey) { const account = key![0] as string; return { @@ -198,34 +199,35 @@ function parseResponse(res: MulticallResult { const key = orderKeys[i]; - const { data } = order; + const orderData = order.order as ReaderUtils.OrderInfoStructOutput["order"]; return { key, - account: order.addresses.account as Address, - receiver: order.addresses.receiver as Address, - callbackContract: order.addresses.callbackContract as Address, - marketAddress: order.addresses.market as Address, - initialCollateralTokenAddress: order.addresses.initialCollateralToken as Address, - swapPath: order.addresses.swapPath as Address[], - sizeDeltaUsd: BigInt(order.numbers.sizeDeltaUsd), - initialCollateralDeltaAmount: BigInt(order.numbers.initialCollateralDeltaAmount), - contractTriggerPrice: BigInt(order.numbers.triggerPrice), - contractAcceptablePrice: BigInt(order.numbers.acceptablePrice), - executionFee: BigInt(order.numbers.executionFee), - callbackGasLimit: BigInt(order.numbers.callbackGasLimit), - minOutputAmount: BigInt(order.numbers.minOutputAmount), - updatedAtTime: order.numbers.updatedAtTime, - isLong: order.flags.isLong as boolean, - shouldUnwrapNativeToken: order.flags.shouldUnwrapNativeToken as boolean, - isFrozen: order.flags.isFrozen as boolean, - orderType: order.numbers.orderType as OrderType, - decreasePositionSwapType: order.numbers.decreasePositionSwapType as DecreasePositionSwapType, - autoCancel: order.flags.autoCancel as boolean, - uiFeeReceiver: order.addresses.uiFeeReceiver as Address, - validFromTime: BigInt(order.numbers.validFromTime), - data, - }; + account: orderData.addresses.account as Address, + receiver: orderData.addresses.receiver as Address, + // cancellationReceiver: orderData.addresses.cancellationReceiver as Address, + callbackContract: orderData.addresses.callbackContract as Address, + uiFeeReceiver: orderData.addresses.uiFeeReceiver as Address, + marketAddress: orderData.addresses.market as Address, + initialCollateralTokenAddress: orderData.addresses.initialCollateralToken as Address, + swapPath: orderData.addresses.swapPath as Address[], + sizeDeltaUsd: BigInt(orderData.numbers.sizeDeltaUsd), + initialCollateralDeltaAmount: BigInt(orderData.numbers.initialCollateralDeltaAmount), + contractTriggerPrice: BigInt(orderData.numbers.triggerPrice), + contractAcceptablePrice: BigInt(orderData.numbers.acceptablePrice), + executionFee: BigInt(orderData.numbers.executionFee), + callbackGasLimit: BigInt(orderData.numbers.callbackGasLimit), + minOutputAmount: BigInt(orderData.numbers.minOutputAmount), + updatedAtTime: orderData.numbers.updatedAtTime, + validFromTime: orderData.numbers.validFromTime, + isLong: orderData.flags.isLong as boolean, + shouldUnwrapNativeToken: orderData.flags.shouldUnwrapNativeToken as boolean, + isFrozen: orderData.flags.isFrozen as boolean, + orderType: orderData.numbers.orderType as unknown as OrderType, + decreasePositionSwapType: orderData.numbers.decreasePositionSwapType as unknown as DecreasePositionSwapType, + autoCancel: orderData.flags.autoCancel as boolean, + data: orderData._dataList, + } satisfies Order; }), }; } diff --git a/src/domain/synthetics/orders/useOrdersInfo.ts b/src/domain/synthetics/orders/useOrdersInfo.ts index 0d2313718c..23247f5fc0 100644 --- a/src/domain/synthetics/orders/useOrdersInfo.ts +++ b/src/domain/synthetics/orders/useOrdersInfo.ts @@ -2,6 +2,7 @@ import { useMemo } from "react"; import { Token } from "domain/tokens"; import { getByKey } from "lib/objects"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getWrappedToken } from "sdk/configs/tokens"; import { getOrderInfo, isPositionOrder, isSwapOrder, isTwapPositionOrder, isTwapSwapOrder } from "sdk/utils/orders"; import { getTwapOrderKey } from "sdk/utils/twap/index"; @@ -9,11 +10,11 @@ import { decodeTwapUiFeeReceiver } from "sdk/utils/twap/uiFeeReceiver"; import { MarketFilterLongShortItemData } from "components/Synthetics/TableMarketFilter/MarketFilterLongShort"; +import { useOrders } from "./useOrders"; import { MarketsInfoData } from "../markets"; import { TokensData } from "../tokens"; import { OrderTypeFilterValue } from "./ordersFilters"; import { Order, OrdersInfoData, TwapOrderInfo } from "./types"; -import { useOrders } from "./useOrders"; import { setOrderInfoTitle } from "./utils"; export type AggregatedOrdersDataResult = { @@ -23,7 +24,7 @@ export type AggregatedOrdersDataResult = { }; export function useOrdersInfoRequest( - chainId: number, + chainId: ContractsChainId, p: { marketsInfoData?: MarketsInfoData; marketsDirectionsFilter?: MarketFilterLongShortItemData[]; diff --git a/src/domain/synthetics/orders/useSetOrdersAutoCancelByQueryParams.ts b/src/domain/synthetics/orders/useSetOrdersAutoCancelByQueryParams.ts index 53e736757f..a261c599d7 100644 --- a/src/domain/synthetics/orders/useSetOrdersAutoCancelByQueryParams.ts +++ b/src/domain/synthetics/orders/useSetOrdersAutoCancelByQueryParams.ts @@ -98,7 +98,9 @@ export function useSetOrdersAutoCancelByQueryParams() { }); if (history.location.search) { - history.replace({ search: "" }); + const query = new URLSearchParams(history.location.search); + query.delete("setOrdersAutoCancel"); + history.replace({ search: query.toString() }); } }, [setOrdersAutoCancel, ordersInfoData, signer, chainId, history, maxAutoCancelOrders, setPendingTxns] diff --git a/src/domain/synthetics/orders/utils.tsx b/src/domain/synthetics/orders/utils.tsx index 2b4d8df8e2..a94873dd43 100644 --- a/src/domain/synthetics/orders/utils.tsx +++ b/src/domain/synthetics/orders/utils.tsx @@ -6,6 +6,7 @@ import { getTokenVisualMultiplier } from "sdk/configs/tokens"; import { isDecreaseOrderType, isIncreaseOrderType, + isLimitOrderType, isMarketOrderType, isOrderForPosition, isSwapOrder, @@ -197,6 +198,7 @@ export function getOrderErrors(p: { const { acceptablePriceDeltaBps: currentAcceptablePriceDeltaBps } = getAcceptablePriceInfo({ marketInfo: positionOrder.marketInfo, isIncrease: isIncreaseOrderType(positionOrder.orderType), + isLimit: isLimitOrderType(positionOrder.orderType), isLong: positionOrder.isLong, indexPrice: positionOrder.triggerPrice, sizeDeltaUsd: positionOrder.sizeDeltaUsd, diff --git a/src/domain/synthetics/positions/index.ts b/src/domain/synthetics/positions/index.ts index fca53d218c..889831467c 100644 --- a/src/domain/synthetics/positions/index.ts +++ b/src/domain/synthetics/positions/index.ts @@ -1,5 +1,5 @@ export * from "./types"; -export * from "./usePositions"; export * from "./usePositionsInfo"; export * from "./usePositionsConstants"; export * from "./utils"; +export * from "./usePositions"; diff --git a/src/domain/synthetics/positions/types.ts b/src/domain/synthetics/positions/types.ts index 890d46d795..1231d09d06 100644 --- a/src/domain/synthetics/positions/types.ts +++ b/src/domain/synthetics/positions/types.ts @@ -1,8 +1,6 @@ import { PendingPositionUpdate } from "context/SyntheticsEvents"; import { Position as BasePosition, PositionInfo as BasePositionInfo } from "sdk/types/positions"; -import { MarketInfo } from "../markets"; - export * from "sdk/types/positions"; export type Position = BasePosition & { @@ -12,5 +10,3 @@ export type Position = BasePosition & { export type PositionInfo = BasePositionInfo & { pendingUpdate?: PendingPositionUpdate; }; - -export type PositionInfoLoaded = PositionInfo & { marketInfo: MarketInfo }; diff --git a/src/domain/synthetics/positions/usePositions.ts b/src/domain/synthetics/positions/usePositions.ts index 5d1053af47..f56d6eb76c 100644 --- a/src/domain/synthetics/positions/usePositions.ts +++ b/src/domain/synthetics/positions/usePositions.ts @@ -1,22 +1,25 @@ import { ethers } from "ethers"; -import { useEffect, useMemo, useState } from "react"; +import { useMemo } from "react"; import { getContract } from "config/contracts"; import { hashedPositionKey } from "config/dataStore"; +import { ContractsChainId } from "config/static/chains"; import { PendingPositionUpdate, PositionDecreaseEvent, PositionIncreaseEvent, useSyntheticsEvents, } from "context/SyntheticsEvents"; +import type { Position } from "domain/synthetics/positions/types"; import { useMulticall } from "lib/multicall"; import { getByKey } from "lib/objects"; import { FREQUENT_MULTICALL_REFRESH_INTERVAL } from "lib/timeConstants"; +import type { ContractMarketPrices, MarketsData } from "sdk/types/markets"; +import type { PositionsData } from "sdk/types/positions"; +import type { TokensData } from "sdk/types/tokens"; +import { getContractMarketPrices } from "sdk/utils/markets"; import { getPositionKey, parsePositionKey } from "sdk/utils/positions"; - -import { ContractMarketPrices, MarketsData, getContractMarketPrices } from "../markets"; -import { TokensData } from "../tokens"; -import { Position, PositionsData } from "./types"; +import type { SyntheticsReader } from "typechain-types/SyntheticsReader"; const MAX_PENDING_UPDATE_AGE = 600 * 1000; // 10 minutes @@ -26,8 +29,12 @@ type PositionsResult = { error?: Error; }; +// todo +// sometimes there is an issue with decoding from abi +// Multicall request failed: usePositionsData-multichain-421614 Error: Response error reader: positions: Bytes value "102,1,128,153,224,35,39,163,83,117,145" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.; + export function usePositions( - chainId: number, + chainId: ContractsChainId, p: { marketsData?: MarketsData; tokensData?: TokensData; @@ -35,7 +42,6 @@ export function usePositions( } ): PositionsResult { const { marketsData, tokensData, account } = p; - const [disableBatching, setDisableBatching] = useState(true); const keysAndPrices = useKeysAndPricesParams({ marketsData, @@ -53,36 +59,37 @@ export function usePositions( refreshInterval: FREQUENT_MULTICALL_REFRESH_INTERVAL, clearUnusedKeys: true, keepPreviousData: true, - disableBatching, - - request: () => ({ - reader: { - contractAddress: getContract(chainId, "SyntheticsReader"), - abiId: "SyntheticsReader", - calls: { - positions: { - methodName: "getAccountPositionInfoList", - params: [ - getContract(chainId, "DataStore"), - getContract(chainId, "ReferralStorage"), - account, - keysAndPrices.marketsKeys, - keysAndPrices.marketsPrices, - // uiFeeReceiver - ethers.ZeroAddress, - 0, - 1000, - ], + + request: (requestChainId) => { + return { + reader: { + contractAddress: getContract(requestChainId, "SyntheticsReader"), + abiId: "SyntheticsReader", + calls: { + positions: { + methodName: "getAccountPositionInfoList", + params: [ + getContract(requestChainId, "DataStore"), + getContract(requestChainId, "ReferralStorage"), + account!, + keysAndPrices.marketsKeys, + keysAndPrices.marketsPrices, + // uiFeeReceiver + ethers.ZeroAddress, + 0, + 1000, + ] satisfies Parameters, + }, }, }, - }, - }), + }; + }, parseResponse: (res) => { const positions = res.data.reader.positions.returnValues; return positions.reduce((positionsMap: PositionsData, positionInfo) => { const { position, fees, basePnlUsd } = positionInfo; - const { addresses, numbers, flags, data } = position; + const { addresses, numbers, flags } = position; const { account, market: marketAddress, collateralToken: collateralTokenAddress } = addresses; // Empty position @@ -109,11 +116,12 @@ export function usePositions( fundingFeeAmount: fees.funding.fundingFeeAmount, claimableLongTokenAmount: fees.funding.claimableLongTokenAmount, claimableShortTokenAmount: fees.funding.claimableShortTokenAmount, + pendingImpactAmount: numbers.pendingImpactAmount, pnl: basePnlUsd, positionFeeAmount: fees.positionFeeAmount, traderDiscountAmount: fees.referral.traderDiscountAmount, uiFeeAmount: fees.ui.uiFeeAmount, - data, + data: "", }; return positionsMap; @@ -121,12 +129,6 @@ export function usePositions( }, }); - useEffect(() => { - if (positionsData && disableBatching) { - setDisableBatching(false); - } - }, [disableBatching, positionsData]); - const optimisticPositionsData = useOptimisticPositions({ positionsData: positionsData, allPositionsKeys: keysAndPrices?.allPositionsKeys, @@ -310,8 +312,12 @@ export function getPendingMockPosition(pendingUpdate: PendingPositionUpdate): Po uiFeeAmount: 0n, pnl: 0n, traderDiscountAmount: 0n, + pendingImpactAmount: 0n, + borrowingFactor: 0n, + fundingFeeAmountPerSize: 0n, + longTokenClaimableFundingAmountPerSize: 0n, + shortTokenClaimableFundingAmountPerSize: 0n, data: "0x", - isOpening: true, pendingUpdate: pendingUpdate, }; diff --git a/src/domain/synthetics/positions/usePositionsConstants.ts b/src/domain/synthetics/positions/usePositionsConstants.ts index 2642edccfa..9c523f6bf8 100644 --- a/src/domain/synthetics/positions/usePositionsConstants.ts +++ b/src/domain/synthetics/positions/usePositionsConstants.ts @@ -1,20 +1,33 @@ import { useMemo } from "react"; import { getContract } from "config/contracts"; -import { MAX_AUTO_CANCEL_ORDERS_KEY, MIN_COLLATERAL_USD_KEY, MIN_POSITION_SIZE_USD_KEY } from "config/dataStore"; +import { + CLAIMABLE_COLLATERAL_DELAY_KEY, + CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY, + CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY, + MAX_AUTO_CANCEL_ORDERS_KEY, + MIN_COLLATERAL_USD_KEY, + MIN_POSITION_SIZE_USD_KEY, +} from "config/dataStore"; import { useMulticall } from "lib/multicall"; import { CONFIG_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; + +export type PositionsConstants = { + minCollateralUsd: bigint; + minPositionSizeUsd: bigint; + maxAutoCancelOrders: bigint; + claimableCollateralDelay: bigint; + claimableCollateralReductionFactor: bigint; + claimableCollateralTimeDivisor: bigint; +}; export type PositionsConstantsResult = { - positionsConstants: { - minCollateralUsd?: bigint; - minPositionSizeUsd?: bigint; - maxAutoCancelOrders?: bigint; - }; + positionsConstants: PositionsConstants | undefined; error?: Error; }; -export function usePositionsConstantsRequest(chainId: number): PositionsConstantsResult { +export function usePositionsConstantsRequest(chainId: ContractsChainId): PositionsConstantsResult { const { data, error } = useMulticall(chainId, "usePositionsConstants", { key: [], @@ -37,6 +50,18 @@ export function usePositionsConstantsRequest(chainId: number): PositionsConstant methodName: "getUint", params: [MAX_AUTO_CANCEL_ORDERS_KEY], }, + claimableCollateralDelay: { + methodName: "getUint", + params: [CLAIMABLE_COLLATERAL_DELAY_KEY], + }, + claimableCollateralReductionFactor: { + methodName: "getUint", + params: [CLAIMABLE_COLLATERAL_REDUCTION_FACTOR_KEY], + }, + claimableCollateralTimeDivisor: { + methodName: "getUint", + params: [CLAIMABLE_COLLATERAL_TIME_DIVISOR_KEY], + }, }, }, }, @@ -45,13 +70,16 @@ export function usePositionsConstantsRequest(chainId: number): PositionsConstant minCollateralUsd: res.data.dataStore.minCollateralUsd.returnValues[0], minPositionSizeUsd: res.data.dataStore.minPositionSizeUsd.returnValues[0], maxAutoCancelOrders: res.data.dataStore.maxAutoCancelOrders.returnValues[0], + claimableCollateralDelay: res.data.dataStore.claimableCollateralDelay.returnValues[0], + claimableCollateralReductionFactor: res.data.dataStore.claimableCollateralReductionFactor.returnValues[0], + claimableCollateralTimeDivisor: res.data.dataStore.claimableCollateralTimeDivisor.returnValues[0], }; }, }); return useMemo( () => ({ - positionsConstants: data || {}, + positionsConstants: data || undefined, error, }), [data, error] diff --git a/src/domain/synthetics/positions/usePositionsInfo.ts b/src/domain/synthetics/positions/usePositionsInfo.ts index f117a2554b..d270d2d9f2 100644 --- a/src/domain/synthetics/positions/usePositionsInfo.ts +++ b/src/domain/synthetics/positions/usePositionsInfo.ts @@ -1,11 +1,18 @@ import { useMemo } from "react"; import { useUserReferralInfoRequest } from "domain/referrals"; -import { getBasisPoints } from "lib/numbers"; +import { BASIS_POINTS_DIVISOR_BIGINT, getBasisPoints } from "lib/numbers"; import { getByKey } from "lib/objects"; import useWallet from "lib/wallets/useWallet"; +import { ContractsChainId } from "sdk/configs/chains"; import { convertTokenAddress } from "sdk/configs/tokens"; -import { getEntryPrice, getPositionPnlUsd } from "sdk/utils/positions"; +import { bigMath } from "sdk/utils/bigmath"; +import { + getEntryPrice, + getNetPriceImpactDeltaUsdForDecrease, + getPositionPnlAfterFees, + getPositionPnlUsd, +} from "sdk/utils/positions"; import useUiFeeFactorRequest from "../fees/utils/useUiFeeFactor"; import { @@ -16,7 +23,7 @@ import { getMaxAllowedLeverageByMinCollateralFactor, } from "../markets"; import { TokensData, convertToTokenAmount, convertToUsd } from "../tokens"; -import { getMarkPrice } from "../trade"; +import { getAcceptablePriceInfo, getMarkPrice } from "../trade"; import { PositionsData, PositionsInfoData } from "./types"; import { usePositionsConstantsRequest } from "./usePositionsConstants"; import { getLeverage, getLiquidationPrice, getPositionNetValue, getPositionPendingFeesUsd } from "./utils"; @@ -28,7 +35,7 @@ export type PositionsInfoResult = { }; export function usePositionsInfoRequest( - chainId: number, + chainId: ContractsChainId, p: { account: string | null | undefined; marketsInfoData?: MarketsInfoData; @@ -52,10 +59,8 @@ export function usePositionsInfoRequest( } = p; const { signer } = useWallet(); - const { - positionsConstants: { minCollateralUsd }, - error: positionsConstantsError, - } = usePositionsConstantsRequest(chainId); + const { positionsConstants, error: positionsConstantsError } = usePositionsConstantsRequest(chainId); + const { minCollateralUsd } = positionsConstants || {}; const { error: uiFeeFactorError } = useUiFeeFactorRequest(chainId); const userReferralInfo = useUserReferralInfoRequest(signer, chainId, account, skipLocalReferralCode); @@ -152,6 +157,28 @@ export function usePositionsInfoRequest( const pnlPercentage = collateralUsd !== undefined && collateralUsd != 0n ? getBasisPoints(pnl, collateralUsd) : 0n; + const closeAcceptablePriceInfo = marketInfo + ? getAcceptablePriceInfo({ + marketInfo, + isIncrease: false, + isLimit: false, + isLong: position.isLong, + indexPrice: getMarkPrice({ prices: indexToken.prices, isLong: position.isLong, isIncrease: false }), + sizeDeltaUsd: position.sizeInUsd, + }) + : undefined; + + const netPriceImapctValues = + marketInfo && closeAcceptablePriceInfo + ? getNetPriceImpactDeltaUsdForDecrease({ + marketInfo, + sizeInUsd: position.sizeInUsd, + pendingImpactAmount: position.pendingImpactAmount, + sizeDeltaUsd: position.sizeInUsd, + priceImpactDeltaUsd: closeAcceptablePriceInfo.priceImpactDeltaUsd, + }) + : undefined; + const netValue = getPositionNetValue({ collateralUsd: collateralUsd, pnl, @@ -159,9 +186,20 @@ export function usePositionsInfoRequest( pendingFundingFeesUsd: pendingFundingFeesUsd, closingFeeUsd, uiFeeUsd, + totalPendingImpactDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, + }); + + const pnlAfterFees = getPositionPnlAfterFees({ + pnl, + pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, + pendingFundingFeesUsd: pendingFundingFeesUsd, + closingFeeUsd, + uiFeeUsd, + totalPendingImpactDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, }); - const pnlAfterFees = pnl - totalPendingFeesUsd - closingFeeUsd - uiFeeUsd; const pnlAfterFeesPercentage = collateralUsd != 0n ? getBasisPoints(pnlAfterFees, collateralUsd + closingFeeUsd) : 0n; @@ -173,13 +211,10 @@ export function usePositionsInfoRequest( pendingFundingFeesUsd: pendingFundingFeesUsd, }); - const leverageWithPnl = getLeverage({ - sizeInUsd: position.sizeInUsd, - collateralUsd: collateralUsd, - pnl, - pendingBorrowingFeesUsd: position.pendingBorrowingFeesUsd, - pendingFundingFeesUsd: pendingFundingFeesUsd, - }); + const leverageWithPnl = + netValue !== undefined && netValue !== 0n + ? bigMath.mulDiv(position.sizeInUsd, BASIS_POINTS_DIVISOR_BIGINT, netValue) + : leverage; const maxAllowedLeverage = marketInfo ? getMaxAllowedLeverageByMinCollateralFactor(marketInfo.minCollateralFactor) @@ -192,6 +227,7 @@ export function usePositionsInfoRequest( ? getLiquidationPrice({ marketInfo, collateralToken, + pendingImpactAmount: position.pendingImpactAmount, sizeInUsd: position.sizeInUsd, sizeInTokens: position.sizeInTokens, collateralUsd, @@ -232,6 +268,8 @@ export function usePositionsInfoRequest( pnlAfterFees, pnlAfterFeesPercentage, netValue, + netPriceImapctDeltaUsd: netPriceImapctValues?.totalImpactDeltaUsd ?? 0n, + priceImpactDiffUsd: netPriceImapctValues?.priceImpactDiffUsd ?? 0n, closingFeeUsd, uiFeeUsd, pendingFundingFeesUsd, diff --git a/src/domain/synthetics/positions/usePositionsTotalCollateral.ts b/src/domain/synthetics/positions/usePositionsTotalCollateral.ts index d6b539da4f..598940d8ea 100644 --- a/src/domain/synthetics/positions/usePositionsTotalCollateral.ts +++ b/src/domain/synthetics/positions/usePositionsTotalCollateral.ts @@ -3,6 +3,7 @@ import useSWR from "swr"; import type { Address } from "viem"; import { getSubsquidGraphClient } from "lib/subgraph/clients"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getByKey } from "sdk/utils/objects"; import { convertToUsd, useTokensDataRequest } from "../tokens"; @@ -16,7 +17,7 @@ const POSITIONS_COLLATERAL_QUERY = gql` } `; -export function usePositionsTotalCollateral(chainId: number) { +export function usePositionsTotalCollateral(chainId: ContractsChainId) { const { tokensData } = useTokensDataRequest(chainId); const { data } = useSWR( diff --git a/src/domain/synthetics/positions/utils.ts b/src/domain/synthetics/positions/utils.ts index adec482bda..54195c6368 100644 --- a/src/domain/synthetics/positions/utils.ts +++ b/src/domain/synthetics/positions/utils.ts @@ -2,31 +2,27 @@ import { t } from "@lingui/macro"; import { ethers } from "ethers"; import { BASIS_POINTS_DIVISOR_BIGINT } from "config/factors"; -import { UserReferralInfo } from "domain/referrals"; -import { - MarketInfo, - getCappedPoolPnl, - getMarketPnl, - getOpenInterestUsd, - getPoolUsdWithoutPnl, -} from "domain/synthetics/markets"; +import { MarketInfo, getCappedPoolPnl, getMarketPnl, getPoolUsdWithoutPnl } from "domain/synthetics/markets"; import { Token } from "domain/tokens"; import { CHART_PERIODS } from "lib/legacy"; import { applyFactor, + calculateDisplayDecimals, expandDecimals, formatAmount, formatUsd, - calculateDisplayDecimals, - PRECISION, formatUsdPrice, } from "lib/numbers"; import { bigMath } from "sdk/utils/bigmath"; -import { getIsEquivalentTokens } from "sdk/utils/tokens"; -import { getBorrowingFeeRateUsd, getFundingFeeRateUsd, getPositionFee, getPriceImpactForPosition } from "../fees"; +import { + capPositionImpactUsdByMaxPriceImpactFactor, + getBorrowingFeeRateUsd, + getFundingFeeRateUsd, + getPriceImpactForPosition, +} from "../fees"; import { OrderType } from "../orders/types"; -import { TokenData, convertToUsd } from "../tokens"; +import { convertToUsd } from "../tokens"; import { PositionInfo, PositionInfoLoaded } from "./types"; export * from "sdk/utils/positions"; @@ -43,21 +39,6 @@ export function getPositionPendingFeesUsd(p: { pendingFundingFeesUsd: bigint; pe return pendingBorrowingFeesUsd + pendingFundingFeesUsd; } -export function getPositionNetValue(p: { - collateralUsd: bigint; - pendingFundingFeesUsd: bigint; - pendingBorrowingFeesUsd: bigint; - pnl: bigint; - closingFeeUsd: bigint; - uiFeeUsd: bigint; -}) { - const { pnl, closingFeeUsd, collateralUsd, uiFeeUsd } = p; - - const pendingFeesUsd = getPositionPendingFeesUsd(p); - - return collateralUsd - pendingFeesUsd - closingFeeUsd - uiFeeUsd + pnl; -} - export function getPositionPnlUsd(p: { marketInfo: MarketInfo; sizeInUsd: bigint; @@ -94,118 +75,6 @@ export function getPositionPnlUsd(p: { return totalPnl; } -export function getLiquidationPrice(p: { - sizeInUsd: bigint; - sizeInTokens: bigint; - collateralAmount: bigint; - collateralUsd: bigint; - collateralToken: TokenData; - marketInfo: MarketInfo | undefined; - pendingFundingFeesUsd: bigint; - pendingBorrowingFeesUsd: bigint; - minCollateralUsd: bigint; - isLong: boolean; - useMaxPriceImpact?: boolean; - userReferralInfo: UserReferralInfo | undefined; -}) { - const { - sizeInUsd, - sizeInTokens, - collateralUsd, - collateralAmount, - marketInfo, - collateralToken, - pendingFundingFeesUsd, - pendingBorrowingFeesUsd, - minCollateralUsd, - isLong, - userReferralInfo, - useMaxPriceImpact, - } = p; - - if (sizeInUsd <= 0 || sizeInTokens <= 0 || !marketInfo) { - return undefined; - } - - const { indexToken } = marketInfo; - - const closingFeeUsd = getPositionFee(marketInfo, sizeInUsd, false, userReferralInfo).positionFeeUsd; - const totalPendingFeesUsd = getPositionPendingFeesUsd({ pendingFundingFeesUsd, pendingBorrowingFeesUsd }); - const totalFeesUsd = totalPendingFeesUsd + closingFeeUsd; - - const maxNegativePriceImpactUsd = -1n * applyFactor(sizeInUsd, marketInfo.maxPositionImpactFactorForLiquidations); - - let priceImpactDeltaUsd = 0n; - - if (useMaxPriceImpact) { - priceImpactDeltaUsd = maxNegativePriceImpactUsd; - } else { - priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { fallbackToZero: true }); - - if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { - priceImpactDeltaUsd = maxNegativePriceImpactUsd; - } - - // Ignore positive price impact - if (priceImpactDeltaUsd > 0) { - priceImpactDeltaUsd = 0n; - } - } - - let liquidationCollateralUsd = applyFactor(sizeInUsd, marketInfo.minCollateralFactor); - if (liquidationCollateralUsd < minCollateralUsd) { - liquidationCollateralUsd = minCollateralUsd; - } - - let liquidationPrice: bigint; - - if (getIsEquivalentTokens(collateralToken, indexToken)) { - if (isLong) { - const denominator = sizeInTokens + collateralAmount; - - if (denominator == 0n) { - return undefined; - } - - liquidationPrice = - ((sizeInUsd + liquidationCollateralUsd - priceImpactDeltaUsd + totalFeesUsd) / denominator) * - expandDecimals(1, indexToken.decimals); - } else { - const denominator = sizeInTokens - collateralAmount; - - if (denominator == 0n) { - return undefined; - } - - liquidationPrice = - ((sizeInUsd - liquidationCollateralUsd + priceImpactDeltaUsd - totalFeesUsd) / denominator) * - expandDecimals(1, indexToken.decimals); - } - } else { - if (sizeInTokens == 0n) { - return undefined; - } - - const remainingCollateralUsd = collateralUsd + priceImpactDeltaUsd - totalPendingFeesUsd - closingFeeUsd; - - if (isLong) { - liquidationPrice = - ((liquidationCollateralUsd - remainingCollateralUsd + sizeInUsd) / sizeInTokens) * - expandDecimals(1, indexToken.decimals); - } else { - liquidationPrice = - ((liquidationCollateralUsd - remainingCollateralUsd - sizeInUsd) / -sizeInTokens) * - expandDecimals(1, indexToken.decimals); - } - } - - if (liquidationPrice <= 0) { - return undefined; - } - - return liquidationPrice; -} - export function formatLiquidationPrice( liquidationPrice?: bigint, opts: { displayDecimals?: number; visualMultiplier?: number } = {} @@ -273,19 +142,30 @@ export function getEstimatedLiquidationTimeInHours( const borrowFeePerHour = getBorrowingFeeRateUsd(marketInfo, isLong, sizeInUsd, CHART_PERIODS["1h"]); const fundingFeePerHour = getFundingFeeRateUsd(marketInfo, isLong, sizeInUsd, CHART_PERIODS["1h"]); const maxNegativePriceImpactUsd = -1n * applyFactor(sizeInUsd, marketInfo.maxPositionImpactFactorForLiquidations); - let priceImpactDeltaUsd = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { + let { priceImpactDeltaUsd } = getPriceImpactForPosition(marketInfo, -sizeInUsd, isLong, { fallbackToZero: true, }); - if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { - priceImpactDeltaUsd = maxNegativePriceImpactUsd; + if (priceImpactDeltaUsd > 0) { + priceImpactDeltaUsd = capPositionImpactUsdByMaxPriceImpactFactor(marketInfo, sizeInUsd, priceImpactDeltaUsd); } - // Ignore positive price impact + const pendingImpactUsd = convertToUsd( + position.pendingImpactAmount, + marketInfo.indexToken.decimals, + position.pendingImpactAmount > 0 ? marketInfo.indexToken.prices.minPrice : marketInfo.indexToken.prices.maxPrice + )!; + + priceImpactDeltaUsd = priceImpactDeltaUsd + pendingImpactUsd; + if (priceImpactDeltaUsd > 0) { priceImpactDeltaUsd = 0n; + } else if (priceImpactDeltaUsd < maxNegativePriceImpactUsd) { + priceImpactDeltaUsd = maxNegativePriceImpactUsd; } + // Ignore positive price impact + const totalFeesPerHour = bigMath.abs(borrowFeePerHour) + (fundingFeePerHour < 0 ? bigMath.abs(fundingFeePerHour) : 0n); @@ -436,24 +316,6 @@ export function willPositionCollateralBeSufficientForPosition( ); } -export function getMinCollateralFactorForPosition(position: PositionInfoLoaded, openInterestDelta: bigint) { - const marketInfo = position.marketInfo; - - const isLong = position.isLong; - const openInterest = getOpenInterestUsd(marketInfo, isLong) + openInterestDelta; - const minCollateralFactorMultiplier = isLong - ? marketInfo.minCollateralFactorForOpenInterestLong - : marketInfo.minCollateralFactorForOpenInterestShort; - let minCollateralFactor = bigMath.mulDiv(openInterest, minCollateralFactorMultiplier, PRECISION); - const minCollateralFactorForMarket = marketInfo.minCollateralFactor; - - if (minCollateralFactorForMarket > minCollateralFactor) { - minCollateralFactor = minCollateralFactorForMarket; - } - - return minCollateralFactor; -} - export function getIsPositionInfoLoaded(pos: PositionInfo | PositionInfoLoaded | undefined): pos is PositionInfoLoaded { return Boolean(pos?.marketInfo); } diff --git a/src/domain/synthetics/referrals/claimAffiliateRewardsTxn.ts b/src/domain/synthetics/referrals/claimAffiliateRewardsTxn.ts index 41d885e38c..5bd8a4db81 100644 --- a/src/domain/synthetics/referrals/claimAffiliateRewardsTxn.ts +++ b/src/domain/synthetics/referrals/claimAffiliateRewardsTxn.ts @@ -4,6 +4,7 @@ import { Signer, ethers } from "ethers"; import { getContract } from "config/contracts"; import { callContract } from "lib/contracts"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import { validateSignerAddress } from "components/Errors/errorToasts"; @@ -16,7 +17,7 @@ type Params = { setPendingTxns: (txns: any) => void; }; -export async function claimAffiliateRewardsTxn(chainId: number, signer: Signer, p: Params) { +export async function claimAffiliateRewardsTxn(chainId: ContractsChainId, signer: Signer, p: Params) { const { setPendingTxns, rewardsParams, account } = p; await validateSignerAddress(signer, account); diff --git a/src/domain/synthetics/referrals/useAffiliateRewards.tsx b/src/domain/synthetics/referrals/useAffiliateRewards.tsx index 86d70132e0..5fadb9c6ed 100644 --- a/src/domain/synthetics/referrals/useAffiliateRewards.tsx +++ b/src/domain/synthetics/referrals/useAffiliateRewards.tsx @@ -3,6 +3,7 @@ import { affiliateRewardKey } from "config/dataStore"; import { useMarkets } from "domain/synthetics/markets"; import { useMulticall } from "lib/multicall"; import useWallet from "lib/wallets/useWallet"; +import type { ContractsChainId } from "sdk/configs/chains"; import { AffiliateRewardsData } from "./types"; @@ -10,7 +11,7 @@ export type AffiliateRewardsResult = { affiliateRewardsData?: AffiliateRewardsData; }; -export function useAffiliateRewards(chainId: number) { +export function useAffiliateRewards(chainId: ContractsChainId) { const { account } = useWallet(); const { marketsData, marketsAddresses } = useMarkets(chainId); diff --git a/src/domain/synthetics/stats/useV2Stats.ts b/src/domain/synthetics/stats/useV2Stats.ts index 82a1930976..b6bc132f70 100644 --- a/src/domain/synthetics/stats/useV2Stats.ts +++ b/src/domain/synthetics/stats/useV2Stats.ts @@ -1,10 +1,13 @@ // current v2 import { useMemo } from "react"; +import type { ContractsChainId } from "sdk/configs/chains"; + import useV2FeesInfo from "./useV2FeesInfo"; import { useMarketsInfoRequest } from "../markets"; import useUsers from "../stats/useUsers"; import useVolumeInfo from "../stats/useVolumeInfo"; +import { useTokensDataRequest } from "../tokens"; export type DashboardOverview = { totalGMLiquidity: bigint; @@ -19,10 +22,11 @@ export type DashboardOverview = { totalUsers: bigint; }; -export default function useV2Stats(chainId: number): DashboardOverview { +export default function useV2Stats(chainId: ContractsChainId): DashboardOverview { const volumeInfo = useVolumeInfo(chainId); const feesInfo = useV2FeesInfo(chainId); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const usersInfo = useUsers(chainId); const stats = useMemo(() => { diff --git a/src/domain/synthetics/subaccount/removeSubaccount.ts b/src/domain/synthetics/subaccount/removeSubaccount.ts index 7d3ed78ead..23a4a348b5 100644 --- a/src/domain/synthetics/subaccount/removeSubaccount.ts +++ b/src/domain/synthetics/subaccount/removeSubaccount.ts @@ -1,16 +1,39 @@ -import { ethers, Signer } from "ethers"; +import { ethers, Provider, Signer } from "ethers"; import { encodeFunctionData } from "viem"; +import type { ContractsChainId, SourceChainId } from "config/static/chains"; +import { + estimateArbitraryRelayFee, + getArbitraryRelayParamsAndPayload, + getRawBaseRelayerParams, +} from "domain/multichain/arbitraryRelayParams"; import { callContract } from "lib/contracts"; +import { ExpressTxnData, sendExpressTransaction } from "lib/transactions"; +import type { WalletSigner } from "lib/wallets"; import { signTypedData } from "lib/wallets/signing"; import { abis } from "sdk/abis"; import SubaccountRouter from "sdk/abis/SubaccountRouter.json"; import { getContract } from "sdk/configs/contracts"; +import { DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION } from "sdk/configs/express"; +import { nowInSeconds } from "sdk/utils/time"; +import { MultichainSubaccountRouter, SubaccountGelatoRelayRouter } from "typechain-types"; -import { getGelatoRelayRouterDomain, hashRelayParams, RelayParamsPayload } from "../express"; +import { + ExpressTransactionBuilder, + getExpressContractAddress, + getGelatoRelayRouterDomain, + GlobalExpressParams, + hashRelayParams, + RelayParamsPayload, +} from "../express"; +import { getMultichainInfoFromSigner, getOrderRelayRouterAddress } from "../express/expressOrderUtils"; import { Subaccount } from "../subaccount"; -export async function removeSubaccountTxn(chainId: number, signer: Signer, subaccountAddress: string) { +export async function removeSubaccountWalletTxn( + chainId: ContractsChainId, + signer: Signer, + subaccountAddress: string +): Promise { const subaccountRouter = new ethers.Contract(getContract(chainId, "SubaccountRouter"), SubaccountRouter.abi, signer); return callContract(chainId, subaccountRouter, "removeSubaccount", [subaccountAddress], { @@ -26,44 +49,79 @@ export async function buildAndSignRemoveSubaccountTxn({ relayParamsPayload, subaccount, signer, + relayerFeeTokenAddress, + relayerFeeAmount, + emptySignature, }: { - chainId: number; + chainId: ContractsChainId; relayParamsPayload: RelayParamsPayload; subaccount: Subaccount; - signer: Signer; -}) { - const signature = await signRemoveSubaccountPayload({ - signer, - relayParams: relayParamsPayload, - subaccountAddress: subaccount.address, - chainId, + signer: WalletSigner; + relayerFeeTokenAddress: string; + relayerFeeAmount: bigint; + emptySignature?: boolean; +}): Promise { + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + + const isMultichain = srcChainId !== undefined; + + const relayRouterAddress = getExpressContractAddress(chainId, { + isSubaccount: true, + isMultichain, + scope: "subaccount", }); + let signature: string; + + if (emptySignature) { + signature = "0x"; + } else { + signature = await signRemoveSubaccountPayload({ + signer, + relayParams: relayParamsPayload, + subaccountAddress: subaccount.address, + chainId, + }); + } + const removeSubaccountCallData = encodeFunctionData({ - abi: abis.SubaccountGelatoRelayRouter, + abi: isMultichain ? abis.MultichainSubaccountRouter : abis.SubaccountGelatoRelayRouter, functionName: "removeSubaccount", - args: [{ ...relayParamsPayload, signature }, await signer.getAddress(), subaccount.address], + args: isMultichain + ? ([ + { ...relayParamsPayload, signature }, + signer.address, + srcChainId ?? chainId, + subaccount.address, + ] satisfies Parameters) + : ([{ ...relayParamsPayload, signature }, signer.address, subaccount.address] satisfies Parameters< + SubaccountGelatoRelayRouter["removeSubaccount"] + >), }); return { callData: removeSubaccountCallData, - contractAddress: getContract(chainId, "SubaccountGelatoRelayRouter"), - feeToken: relayParamsPayload.fee.feeToken, - feeAmount: relayParamsPayload.fee.feeAmount, + to: relayRouterAddress, + feeToken: relayerFeeTokenAddress, + feeAmount: relayerFeeAmount, }; } -export async function signRemoveSubaccountPayload({ +async function signRemoveSubaccountPayload({ signer, relayParams, subaccountAddress, chainId, }: { - signer: Signer; - relayParams: RelayParamsPayload; + signer: WalletSigner; + relayParams: RelayParamsPayload | RelayParamsPayload; subaccountAddress: string; - chainId: number; + chainId: ContractsChainId; }) { + const srcChainId = await getMultichainInfoFromSigner(signer, chainId); + + const relayRouterAddress = getOrderRelayRouterAddress(chainId, true, srcChainId !== undefined); + const types = { RemoveSubaccount: [ { name: "subaccount", type: "address" }, @@ -71,10 +129,10 @@ export async function signRemoveSubaccountPayload({ ], }; - const domain = getGelatoRelayRouterDomain(chainId, true); + const domain = getGelatoRelayRouterDomain(srcChainId ?? chainId, relayRouterAddress); const typedData = { - subaccountAddress, + subaccount: subaccountAddress, relayParams: hashRelayParams(relayParams), }; @@ -85,3 +143,109 @@ export async function signRemoveSubaccountPayload({ domain, }); } + +export async function removeSubaccountExpressTxn({ + chainId, + provider, + account, + srcChainId, + signer, + subaccount, + globalExpressParams, + isSponsoredCallAvailable, +}: { + chainId: ContractsChainId; + provider: Provider; + account: string; + srcChainId: SourceChainId | undefined; + signer: WalletSigner; + subaccount: Subaccount; + globalExpressParams: GlobalExpressParams; + isSponsoredCallAvailable: boolean; +}) { + if (!provider || !account) { + throw new Error("No provider or account"); + } + + const { rawBaseRelayParamsPayload, baseRelayFeeSwapParams } = getRawBaseRelayerParams({ + chainId, + account, + globalExpressParams: globalExpressParams, + }); + + if (!rawBaseRelayParamsPayload || !baseRelayFeeSwapParams) { + throw new Error("No base express params"); + } + + const getTxnData: ExpressTransactionBuilder = async ({ relayParams, gasPaymentParams, subaccount }) => { + if (!subaccount) { + throw new Error("No subaccount"); + } + + const txnData = await buildAndSignRemoveSubaccountTxn({ + chainId, + signer, + subaccount, + relayParamsPayload: { + ...relayParams, + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + relayerFeeAmount: gasPaymentParams.relayerFeeAmount, + relayerFeeTokenAddress: gasPaymentParams.relayerFeeTokenAddress, + emptySignature: true, + }); + + return { + txnData, + }; + }; + + const relayerFeeAmount = await estimateArbitraryRelayFee({ + chainId, + provider, + rawRelayParamsPayload: rawBaseRelayParamsPayload, + expressTransactionBuilder: getTxnData, + gasPaymentParams: baseRelayFeeSwapParams.gasPaymentParams, + subaccount: subaccount, + }); + + if (relayerFeeAmount === undefined) { + throw new Error("No relay fee amount"); + } + + const { relayFeeParams, relayParamsPayload } = getArbitraryRelayParamsAndPayload({ + chainId, + account, + isGmxAccount: srcChainId !== undefined, + relayerFeeAmount, + globalExpressParams: globalExpressParams, + subaccount, + }); + + if (!relayFeeParams || !relayParamsPayload) { + throw new Error("No relayFeeParams or relayParamsPayload"); + } + + const txnData = await buildAndSignRemoveSubaccountTxn({ + chainId, + signer, + subaccount, + relayParamsPayload: { + ...relayParamsPayload, + deadline: BigInt(nowInSeconds() + DEFAULT_EXPRESS_ORDER_DEADLINE_DURATION), + }, + relayerFeeAmount: relayFeeParams.gasPaymentParams.relayerFeeAmount, + relayerFeeTokenAddress: relayFeeParams.gasPaymentParams.relayerFeeTokenAddress, + emptySignature: false, + }); + + if (!txnData) { + throw new Error("No txnData"); + } + + await sendExpressTransaction({ + chainId, + isSponsoredCall: isSponsoredCallAvailable, + txnData, + }); +} diff --git a/src/domain/synthetics/subaccount/types.ts b/src/domain/synthetics/subaccount/types.ts index 0357633c03..c9355e4ce0 100644 --- a/src/domain/synthetics/subaccount/types.ts +++ b/src/domain/synthetics/subaccount/types.ts @@ -1,6 +1,8 @@ -import { Wallet } from "ethers"; +import type { Wallet } from "ethers"; -import { SubaccountOnchainData } from "./useSubaccountOnchainData"; +import type { AnyChainId, ContractsChainId } from "config/chains"; + +import type { SubaccountOnchainData } from "./useSubaccountOnchainData"; export type SubaccountSerializedConfig = { privateKey: string; @@ -10,8 +12,10 @@ export type SubaccountSerializedConfig = { export type Subaccount = { address: string; + chainId: ContractsChainId; + signerChainId: AnyChainId; signer: Wallet; - signedApproval: SignedSubbacountApproval; + signedApproval: SignedSubacсountApproval; onchainData: SubaccountOnchainData; }; @@ -22,17 +26,22 @@ export type SubaccountApproval = { expiresAt: bigint; maxAllowedCount: bigint; actionType: string; + desChainId: ContractsChainId; deadline: bigint; + integrationId: string; }; -export type SignedSubbacountApproval = SubaccountApproval & { +export type SignedSubacсountApproval = SubaccountApproval & { signature: string; signedAt: number; + signatureChainId: AnyChainId; + subaccountRouterAddress: string; }; export type SubaccountValidations = { isExpired: boolean; isActionsExceeded: boolean; isNonceExpired: boolean; + isApprovalInvalid: boolean; isValid: boolean; }; diff --git a/src/domain/synthetics/subaccount/useSubaccountOnchainData.ts b/src/domain/synthetics/subaccount/useSubaccountOnchainData.ts index ef23e44b2f..e2e93f4b9c 100644 --- a/src/domain/synthetics/subaccount/useSubaccountOnchainData.ts +++ b/src/domain/synthetics/subaccount/useSubaccountOnchainData.ts @@ -3,13 +3,16 @@ import { useMemo } from "react"; import { getContract } from "config/contracts"; import { useMulticall } from "lib/multicall"; import { FREQUENT_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; import { maxAllowedSubaccountActionCountKey, SUBACCOUNT_ORDER_ACTION, subaccountActionCountKey, subaccountExpiresAtKey, + subaccountIntegrationIdKey, subaccountListKey, } from "sdk/configs/dataStore"; +import type { MulticallRequestConfig } from "sdk/utils/multicall"; export type SubaccountOnchainData = { active: boolean; @@ -17,6 +20,8 @@ export type SubaccountOnchainData = { currentActionsCount: bigint; expiresAt: bigint; approvalNonce: bigint; + multichainApprovalNonce: bigint; + integrationId: string | undefined; }; export type SubaccountOnchainDataResult = { @@ -25,28 +30,41 @@ export type SubaccountOnchainDataResult = { }; export function useSubaccountOnchainData( - chainId: number, + chainId: ContractsChainId, { account, subaccountAddress, + srcChainId, }: { account: string | undefined; subaccountAddress: string | undefined; + srcChainId: number | undefined; } ): SubaccountOnchainDataResult { + const queryCondition = account && subaccountAddress !== undefined; + const { data, mutate } = useMulticall(chainId, "useSubaccountOnchainData", { - key: account && subaccountAddress ? [account, subaccountAddress] : null, + key: queryCondition ? [account, subaccountAddress, srcChainId] : null, refreshInterval: FREQUENT_UPDATE_INTERVAL, - request: () => { - if (!account || !subaccountAddress) { + if (!queryCondition) { return {} as any; } return { subaccountRelayRouter: { contractAddress: getContract(chainId, "SubaccountGelatoRelayRouter"), - abiId: "SubaccountGelatoRelayRouter", + abiId: "AbstractSubaccountApprovalNonceable", + calls: { + subaccountApproval: { + methodName: "subaccountApprovalNonces", + params: [account], + }, + }, + }, + multichainSubaccountRelayRouter: { + contractAddress: getContract(chainId, "MultichainSubaccountRouter"), + abiId: "AbstractSubaccountApprovalNonceable", calls: { subaccountApproval: { methodName: "subaccountApprovalNonces", @@ -74,9 +92,13 @@ export function useSubaccountOnchainData( methodName: "getUint", params: [subaccountExpiresAtKey(account!, subaccountAddress, SUBACCOUNT_ORDER_ACTION)], }, + integrationId: { + methodName: "getBytes32", + params: [subaccountIntegrationIdKey(account!, subaccountAddress)], + }, }, }, - }; + } satisfies MulticallRequestConfig; }, parseResponse: (res) => { const isSubaccountActive = Boolean(res.data.dataStore.isSubaccountActive.returnValues[0]); @@ -84,7 +106,21 @@ export function useSubaccountOnchainData( const currentActionsCount = BigInt(res.data.dataStore.currentActionsCount.returnValues[0]); const expiresAt = BigInt(res.data.dataStore.expiresAt.returnValues[0]); const approvalNonce = BigInt(res.data.subaccountRelayRouter.subaccountApproval.returnValues[0]); - return { active: isSubaccountActive, maxAllowedCount, currentActionsCount, expiresAt, approvalNonce }; + const multichainApprovalNonce = BigInt( + res.data.multichainSubaccountRelayRouter.subaccountApproval.returnValues[0] + ); + + const integrationId = res.data.dataStore.integrationId.returnValues[0]; + + return { + active: isSubaccountActive, + maxAllowedCount, + currentActionsCount, + expiresAt, + approvalNonce, + multichainApprovalNonce, + integrationId, + }; }, }); diff --git a/src/domain/synthetics/subaccount/utils.ts b/src/domain/synthetics/subaccount/utils.ts index 127fba8de0..833bfd0581 100644 --- a/src/domain/synthetics/subaccount/utils.ts +++ b/src/domain/synthetics/subaccount/utils.ts @@ -1,17 +1,27 @@ import cryptoJs from "crypto-js"; -import { ethers, Provider, Signer } from "ethers"; -import { decodeFunctionResult, encodeAbiParameters, encodeFunctionData, keccak256, maxUint256, zeroHash } from "viem"; - +import { ethers, Provider } from "ethers"; import { - SignedSubbacountApproval, + decodeFunctionResult, + encodeAbiParameters, + encodeFunctionData, + Hex, + keccak256, + maxUint256, + zeroAddress, + zeroHash, +} from "viem"; + +import { isSourceChain } from "config/multichain"; +import type { AnyChainId, ContractsChainId } from "config/static/chains"; +import type { + SignedSubacсountApproval, Subaccount, SubaccountApproval, SubaccountSerializedConfig, SubaccountValidations, } from "domain/synthetics/subaccount/types"; -import { SubaccountOnchainData } from "domain/synthetics/subaccount/useSubaccountOnchainData"; import { WalletSigner } from "lib/wallets"; -import { signTypedData } from "lib/wallets/signing"; +import { SignatureTypes, signTypedData } from "lib/wallets/signing"; import { abis } from "sdk/abis"; import { getContract } from "sdk/configs/contracts"; import { @@ -19,33 +29,46 @@ import { SUBACCOUNT_ORDER_ACTION, subaccountActionCountKey, subaccountExpiresAtKey, + subaccountIntegrationIdKey, subaccountListKey, } from "sdk/configs/dataStore"; import { DEFAULT_SUBACCOUNT_EXPIRY_DURATION, DEFAULT_SUBACCOUNT_MAX_ALLOWED_COUNT } from "sdk/configs/express"; import { bigMath } from "sdk/utils/bigmath"; import { ZERO_DATA } from "sdk/utils/hash"; import { nowInSeconds, secondsToPeriod } from "sdk/utils/time"; +import type { SubaccountGelatoRelayRouter } from "typechain-types"; -import { getExpressContractAddress, getGelatoRelayRouterDomain } from "../express"; +import { getGelatoRelayRouterDomain } from "../express"; +import { SubaccountOnchainData } from "./useSubaccountOnchainData"; +import { getMultichainInfoFromSigner, getOrderRelayRouterAddress } from "../express/expressOrderUtils"; export function getSubaccountValidations({ requiredActions, subaccount, + subaccountRouterAddress, }: { requiredActions: number; subaccount: Subaccount; + subaccountRouterAddress: string; }): SubaccountValidations { return { isExpired: getIsSubaccountExpired(subaccount), isActionsExceeded: getIsSubaccountActionsExceeded(subaccount, requiredActions), isNonceExpired: getIsSubaccountNonceExpired(subaccount), - isValid: !getIsInvalidSubaccount(subaccount, requiredActions), + isApprovalInvalid: getIsSubaccountApprovalInvalid({ + chainId: subaccount.chainId, + signerChainId: subaccount.signerChainId, + onchainData: subaccount.onchainData, + signedApproval: subaccount.signedApproval, + subaccountRouterAddress, + }), + isValid: !getIsInvalidSubaccount({ subaccount, requiredActions, subaccountRouterAddress }), }; } export function getIsSubaccountActive(subaccount: { onchainData: SubaccountOnchainData; - signedApproval: SignedSubbacountApproval | undefined; + signedApproval: SignedSubacсountApproval | undefined; }): boolean { let active = subaccount.onchainData.active; @@ -65,7 +88,7 @@ export function getSubaccountSigner(config: SubaccountSerializedConfig, account: export function getMaxSubaccountActions(subaccount: { onchainData: SubaccountOnchainData; - signedApproval: SignedSubbacountApproval | undefined; + signedApproval: SignedSubacсountApproval | undefined; }): bigint { if (subaccount.signedApproval && !getIsEmptySubaccountApproval(subaccount.signedApproval)) { return BigInt(subaccount.signedApproval.maxAllowedCount); @@ -76,7 +99,7 @@ export function getMaxSubaccountActions(subaccount: { export function getSubaccountExpiresAt(subaccount: { onchainData: SubaccountOnchainData; - signedApproval: SignedSubbacountApproval | undefined; + signedApproval: SignedSubacсountApproval | undefined; }): bigint { if (subaccount.signedApproval && !getIsEmptySubaccountApproval(subaccount.signedApproval)) { return BigInt(subaccount.signedApproval.expiresAt); @@ -87,7 +110,7 @@ export function getSubaccountExpiresAt(subaccount: { export function getRemainingSubaccountActions(subaccount: { onchainData: SubaccountOnchainData; - signedApproval: SignedSubbacountApproval | undefined; + signedApproval: SignedSubacсountApproval | undefined; }): bigint { const maxAllowedCount = getMaxSubaccountActions(subaccount); const currentActionCount = subaccount.onchainData.currentActionsCount; @@ -120,6 +143,9 @@ export function getRemainingSubaccountDays(subaccount: Subaccount): bigint { return BigInt(secondsToPeriod(Number(seconds), "1d")); } +/** + * Returns false for empty subaccount approval + */ export function getIsApprovalExpired(subaccount: Subaccount): boolean { const { signedApproval } = subaccount; @@ -135,20 +161,97 @@ export function getIsApprovalExpired(subaccount: Subaccount): boolean { return now >= expiresAt || now >= deadline; } -export function getIsSubaccountNonceExpired(subaccount: { +/** + * Returns false for empty subaccount approval + */ +export function getIsSubaccountNonceExpired({ + chainId, + onchainData, + signedApproval, +}: { + chainId: ContractsChainId; onchainData: SubaccountOnchainData; - signedApproval: SignedSubbacountApproval; + signedApproval: SignedSubacсountApproval; }): boolean { - if (getIsEmptySubaccountApproval(subaccount.signedApproval)) { + if (getIsEmptySubaccountApproval(signedApproval)) { + return false; + } + + if (chainId !== signedApproval.signatureChainId) { + return false; + } + + let onChainNonce: bigint; + if (signedApproval.subaccountRouterAddress === getContract(chainId, "SubaccountGelatoRelayRouter")) { + onChainNonce = onchainData.approvalNonce; + } else if (signedApproval.subaccountRouterAddress === getContract(chainId, "MultichainSubaccountRouter")) { + onChainNonce = onchainData.multichainApprovalNonce; + } else if (!signedApproval.subaccountRouterAddress) { + if (isSourceChain(signedApproval.signatureChainId)) { + onChainNonce = onchainData.multichainApprovalNonce; + } else { + onChainNonce = onchainData.approvalNonce; + } + } else { + // eslint-disable-next-line no-console + console.error( + `Invalid subaccount router address: ${signedApproval.subaccountRouterAddress} at ${signedApproval.signatureChainId} for chainId: ${chainId}` + ); return false; } - const onChainNonce = subaccount.onchainData.approvalNonce; - const signedNonce = subaccount.signedApproval.nonce; + const signedNonce = signedApproval.nonce; return signedNonce !== onChainNonce; } +/** + * Returns false for empty subaccount approval + */ +export function getIsSubaccountApprovalInvalid({ + chainId, + signerChainId, + signedApproval, + onchainData, + subaccountRouterAddress, +}: { + chainId: ContractsChainId; + signerChainId: AnyChainId; + signedApproval: SignedSubacсountApproval; + onchainData: SubaccountOnchainData; + subaccountRouterAddress: string; +}): boolean { + if (getIsEmptySubaccountApproval(signedApproval)) { + return false; + } + + const isSignedSubaccountFresh = !onchainData.active; + + let relatedOnchainNonce: bigint | undefined; + if (signedApproval.subaccountRouterAddress === getContract(chainId, "MultichainSubaccountRouter")) { + relatedOnchainNonce = onchainData.multichainApprovalNonce; + } else if ( + signedApproval.subaccountRouterAddress === getContract(chainId, "SubaccountGelatoRelayRouter") || + !signedApproval.subaccountRouterAddress + ) { + relatedOnchainNonce = onchainData.approvalNonce; + } else { + return true; + } + + // Technically it is possible to create a new subaccount without deactivating the old one + // For this we need to check approval signature even if currently there is a subaccount but our nonce + // would be able to update it + const isSignedSubaccountPossibleUpdate = signedApproval.nonce === relatedOnchainNonce; + + const result = + (isSignedSubaccountFresh || isSignedSubaccountPossibleUpdate) && + (signedApproval.signatureChainId !== signerChainId || + signedApproval.subaccountRouterAddress !== subaccountRouterAddress); + + return result; +} + export function getIsSubaccountExpired(subaccount: Subaccount): boolean { const now = BigInt(nowInSeconds()); const isApprovalExpired = getIsApprovalExpired(subaccount); @@ -163,15 +266,33 @@ export function getIsSubaccountExpired(subaccount: Subaccount): boolean { return isExpired; } -export function getIsInvalidSubaccount(subaccount: Subaccount, requiredActions: number): boolean { +export function getIsInvalidSubaccount({ + subaccount, + requiredActions, + subaccountRouterAddress, +}: { + subaccount: Subaccount; + requiredActions: number; + subaccountRouterAddress: string; +}): boolean { const isExpired = getIsSubaccountExpired(subaccount); const isNonceExpired = getIsSubaccountNonceExpired(subaccount); const actionsExceeded = getIsSubaccountActionsExceeded(subaccount, requiredActions); + const isApprovalInvalid = getIsSubaccountApprovalInvalid({ + chainId: subaccount.chainId, + signedApproval: subaccount.signedApproval, + subaccountRouterAddress, + signerChainId: subaccount.signerChainId, + onchainData: subaccount.onchainData, + }); - return isExpired || isNonceExpired || actionsExceeded; + return isExpired || isNonceExpired || actionsExceeded || isApprovalInvalid; } -export function getEmptySubaccountApproval(subaccountAddress: string): SignedSubbacountApproval { +export function getEmptySubaccountApproval( + chainId: ContractsChainId, + subaccountAddress: string +): SignedSubacсountApproval { return { subaccount: subaccountAddress, shouldAdd: false, @@ -180,18 +301,23 @@ export function getEmptySubaccountApproval(subaccountAddress: string): SignedSub actionType: SUBACCOUNT_ORDER_ACTION, nonce: 0n, deadline: maxUint256, + desChainId: chainId, signature: ZERO_DATA, signedAt: 0, + integrationId: zeroHash, + subaccountRouterAddress: zeroAddress, + signatureChainId: chainId, }; } -export function getIsEmptySubaccountApproval(subaccountApproval: SignedSubbacountApproval): boolean { +export function getIsEmptySubaccountApproval(subaccountApproval: SignedSubacсountApproval): boolean { return ( subaccountApproval.signature === ZERO_DATA && subaccountApproval.nonce === 0n && subaccountApproval.expiresAt === 0n && subaccountApproval.maxAllowedCount === 0n && - subaccountApproval.shouldAdd === false + subaccountApproval.shouldAdd === false && + subaccountApproval.integrationId === zeroHash ); } @@ -200,11 +326,13 @@ export async function getInitialSubaccountApproval({ signer, provider, subaccountAddress, + isGmxAccount, }: { - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; provider: Provider; subaccountAddress: string; + isGmxAccount: boolean; }) { const onchainData = await getSubaccountOnchainData({ chainId, signer, provider, subaccountAddress }); @@ -225,42 +353,52 @@ export async function getInitialSubaccountApproval({ const defaultSubaccountApproval = await createAndSignSubaccountApproval( chainId, signer, + provider, subaccountAddress, - onchainData.approvalNonce, { shouldAdd: !onchainData.active, expiresAt, maxAllowedCount, - } + }, + isGmxAccount ); return defaultSubaccountApproval; } -export function getActualApproval(subaccount: { +export function getActualApproval(params: { + chainId: ContractsChainId; address: string; - signedApproval: SignedSubbacountApproval | undefined; + signedApproval: SignedSubacсountApproval | undefined; onchainData: SubaccountOnchainData; -}): SignedSubbacountApproval { - const { signedApproval, address, onchainData } = subaccount; - - if (!signedApproval || getIsSubaccountApprovalSynced({ signedApproval, onchainData })) { - return getEmptySubaccountApproval(address); +}): SignedSubacсountApproval { + const { chainId, signedApproval, address, onchainData } = params; + + if ( + !signedApproval || + getIsSubaccountApprovalSynced({ + chainId, + signedApproval, + onchainData, + }) + ) { + return getEmptySubaccountApproval(chainId, address); } return signedApproval; } -export function getIsSubaccountApprovalSynced(subaccount: { - signedApproval: SignedSubbacountApproval; +export function getIsSubaccountApprovalSynced(params: { + chainId: ContractsChainId; + signedApproval: SignedSubacсountApproval; onchainData: SubaccountOnchainData; }): boolean { - const { signedApproval, onchainData } = subaccount; + const { signedApproval, onchainData } = params; /** * If nonce is expired, we believe a newer settings have been applied in some other way e.g. different browser */ - if (getIsSubaccountNonceExpired(subaccount)) { + if (getIsSubaccountNonceExpired(params)) { return true; } @@ -274,15 +412,19 @@ export function getIsSubaccountApprovalSynced(subaccount: { export async function signUpdatedSubaccountSettings({ chainId, signer, + provider, subaccount, nextRemainigActions, nextRemainingSeconds, + isGmxAccount, }: { - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; + provider: Provider; subaccount: Subaccount; nextRemainigActions: bigint | undefined; nextRemainingSeconds: bigint | undefined; + isGmxAccount: boolean; }) { const oldMaxAllowedCount = getMaxSubaccountActions(subaccount); const oldRemainingActions = getRemainingSubaccountActions(subaccount); @@ -302,29 +444,41 @@ export async function signUpdatedSubaccountSettings({ nextExpiresAt = oldExpiresAt + nextRemainingSeconds - oldRemainingSeconds; } - const nonce = await getSubaccountApprovalNonceForSigner(chainId, signer); - - const signedSubaccountApproval = await createAndSignSubaccountApproval(chainId, signer, subaccount.address, nonce, { - expiresAt: nextExpiresAt, - maxAllowedCount: nextMaxAllowedCount, - shouldAdd: !subaccount.onchainData.active, - }); + const signedSubaccountApproval = await createAndSignSubaccountApproval( + chainId, + signer, + provider, + subaccount.address, + { + expiresAt: nextExpiresAt, + maxAllowedCount: nextMaxAllowedCount, + shouldAdd: !subaccount.onchainData.active, + }, + isGmxAccount + ); return signedSubaccountApproval; } export async function createAndSignSubaccountApproval( - chainId: number, - mainAccountSigner: Signer, + chainId: ContractsChainId, + mainAccountSigner: WalletSigner, + provider: Provider, subaccountAddress: string, - nonce: bigint, params: { shouldAdd: boolean; expiresAt: bigint; maxAllowedCount: bigint; - } -): Promise { - const types = { + }, + isGmxAccount: boolean +): Promise { + const srcChainId = await getMultichainInfoFromSigner(mainAccountSigner, chainId); + + const nonce = await getSubaccountApprovalNonceForProvider(chainId, mainAccountSigner, provider, isGmxAccount); + + const subaccountRouterAddress = getOrderRelayRouterAddress(chainId, true, isGmxAccount); + + const types: SignatureTypes = { SubaccountApproval: [ { name: "subaccount", type: "address" }, { name: "shouldAdd", type: "bool" }, @@ -332,19 +486,23 @@ export async function createAndSignSubaccountApproval( { name: "maxAllowedCount", type: "uint256" }, { name: "actionType", type: "bytes32" }, { name: "nonce", type: "uint256" }, + { name: "desChainId", type: "uint256" }, { name: "deadline", type: "uint256" }, + { name: "integrationId", type: "bytes32" }, ], }; - const domain = getGelatoRelayRouterDomain(chainId, true); + const domain = getGelatoRelayRouterDomain(srcChainId ?? chainId, subaccountRouterAddress); const typedData = { subaccount: subaccountAddress, shouldAdd: params.shouldAdd, - actionType: SUBACCOUNT_ORDER_ACTION, expiresAt: params.expiresAt, maxAllowedCount: params.maxAllowedCount, + desChainId: chainId, + actionType: SUBACCOUNT_ORDER_ACTION, nonce, + integrationId: zeroHash, deadline: params.expiresAt, }; @@ -354,10 +512,12 @@ export async function createAndSignSubaccountApproval( ...typedData, signature, signedAt: Date.now(), + signatureChainId: domain.chainId as AnyChainId, + subaccountRouterAddress, }; } -export function hashSubaccountApproval(subaccountApproval: SignedSubbacountApproval) { +export function hashSubaccountApproval(subaccountApproval: SignedSubacсountApproval) { if (!subaccountApproval) { return zeroHash; } @@ -373,7 +533,9 @@ export function hashSubaccountApproval(subaccountApproval: SignedSubbacountAppro { name: "maxAllowedCount", type: "uint256" }, { name: "actionType", type: "bytes32" }, { name: "nonce", type: "uint256" }, + { name: "desChainId", type: "uint256" }, { name: "deadline", type: "uint256" }, + { name: "integrationId", type: "bytes32" }, { name: "signature", type: "bytes" }, ], }, @@ -384,11 +546,25 @@ export function hashSubaccountApproval(subaccountApproval: SignedSubbacountAppro return keccak256(encodedData); } -export async function getSubaccountApprovalNonceForSigner(chainId: number, signer: WalletSigner) { - const contractAddress = getExpressContractAddress(chainId, { isSubaccount: true }); - const contract = new ethers.Contract(contractAddress, abis.SubaccountGelatoRelayRouter, signer); +async function getSubaccountApprovalNonceForProvider( + chainId: ContractsChainId, + signer: WalletSigner, + provider: Provider, + isGmxAccount: boolean +): Promise { + if (provider === undefined) { + throw new Error("Provider is required for multicall"); + } + + const subaccountRouterAddress = getOrderRelayRouterAddress(chainId, true, isGmxAccount); - return contract.subaccountApprovalNonces(signer.address); + const contract = new ethers.Contract( + subaccountRouterAddress, + abis.AbstractSubaccountApprovalNonceable, + provider + ) as unknown as SubaccountGelatoRelayRouter; + + return await contract.subaccountApprovalNonces(signer.address); } export async function getSubaccountOnchainData({ @@ -397,7 +573,7 @@ export async function getSubaccountOnchainData({ provider, subaccountAddress, }: { - chainId: number; + chainId: ContractsChainId; signer: WalletSigner; provider: Provider; subaccountAddress: string; @@ -405,16 +581,24 @@ export async function getSubaccountOnchainData({ const account = signer.address; const calls: { - [key in keyof SubaccountOnchainData]: { - contractAddress: string; - abi: any; - functionName: string; - args: any[]; - }; + [key in keyof SubaccountOnchainData]: + | { + contractAddress: string; + abi: any; + functionName: string; + args: any[]; + } + | undefined; } = { approvalNonce: { - contractAddress: getExpressContractAddress(chainId, { isSubaccount: true }), - abi: abis.SubaccountGelatoRelayRouter, + contractAddress: getContract(chainId, "SubaccountGelatoRelayRouter"), + abi: abis.AbstractSubaccountApprovalNonceable, + functionName: "subaccountApprovalNonces", + args: [account], + }, + multichainApprovalNonce: { + contractAddress: getContract(chainId, "MultichainSubaccountRouter"), + abi: abis.AbstractSubaccountApprovalNonceable, functionName: "subaccountApprovalNonces", args: [account], }, @@ -442,16 +626,26 @@ export async function getSubaccountOnchainData({ functionName: "getUint", args: [subaccountExpiresAtKey(account, subaccountAddress, SUBACCOUNT_ORDER_ACTION)], }, + integrationId: { + contractAddress: getContract(chainId, "DataStore"), + abi: abis.DataStore, + functionName: "getBytes32", + args: [subaccountIntegrationIdKey(account, subaccountAddress)], + }, }; const callData = encodeFunctionData({ abi: abis.Multicall, functionName: "aggregate", args: [ - Object.values(calls).map((call) => ({ - target: call.contractAddress, - callData: encodeFunctionData(call), - })), + Object.values(calls) + .filter( + (call): call is { contractAddress: string; abi: any; functionName: string; args: any[] } => call !== undefined + ) + .map((call) => ({ + target: call.contractAddress, + callData: encodeFunctionData(call), + })), ], }); @@ -462,15 +656,19 @@ export async function getSubaccountOnchainData({ const [_, decodedMulticallResults] = decodeFunctionResult({ abi: abis.Multicall, - data: result as `0x${string}`, + data: result as Hex, functionName: "aggregate", }) as [bigint, string[]]; const results: SubaccountOnchainData = Object.entries(calls).reduce((acc, [key, call], index) => { + if (call === undefined) { + return acc; + } + acc[key] = decodeFunctionResult({ abi: call.abi, functionName: call.functionName, - data: decodedMulticallResults[index] as `0x${string}`, + data: decodedMulticallResults[index] as Hex, }); return acc; diff --git a/src/domain/synthetics/testUtils/mocks.ts b/src/domain/synthetics/testUtils/mocks.ts index b98c148cee..f2cac133ae 100644 --- a/src/domain/synthetics/testUtils/mocks.ts +++ b/src/domain/synthetics/testUtils/mocks.ts @@ -56,6 +56,7 @@ export function mockPositionInfo( collateralAmount: convertToTokenAmount(collateralUsd, collateralToken.decimals, collateralToken.prices?.minPrice)!, increasedAtTime: BigInt((Date.now() / 1000) >> 0), decreasedAtTime: BigInt((Date.now() / 1000) >> 0), + pendingImpactAmount: 0n, isLong: true, pendingBorrowingFeesUsd: 0n, fundingFeeAmount: 0n, @@ -89,6 +90,8 @@ export function mockPositionInfo( pnlPercentage: 0n, pnlAfterFees: 0n, pnlAfterFeesPercentage: 0n, + netPriceImapctDeltaUsd: 0n, + priceImpactDiffUsd: 0n, netValue: 0n, closingFeeUsd: 0n, uiFeeUsd: 0n, diff --git a/src/domain/synthetics/tokens/types.ts b/src/domain/synthetics/tokens/types.ts index ade5cabb1a..259df9cb71 100644 --- a/src/domain/synthetics/tokens/types.ts +++ b/src/domain/synthetics/tokens/types.ts @@ -1,17 +1,12 @@ import type { Token } from "domain/tokens"; +export type { TokenData, TokensData } from "sdk/types/tokens"; + export type TokenPrices = { minPrice: bigint; maxPrice: bigint; }; -export type TokenData = Token & { - prices: TokenPrices; - balance?: bigint; - totalSupply?: bigint; - hasPriceFeedProvider?: boolean; -}; - export type TokensRatio = { ratio: bigint; largestToken: Token; @@ -37,6 +32,7 @@ export type TokensAllowanceData = { [tokenAddress: string]: bigint; }; -export type TokensData = { - [address: string]: TokenData; +export type BalancesDataResult = { + balancesData?: TokenBalancesData; + error?: Error; }; diff --git a/src/domain/synthetics/tokens/use24hPriceDeltaMap.ts b/src/domain/synthetics/tokens/use24hPriceDeltaMap.ts index 9217cee2a8..07fc24d322 100644 --- a/src/domain/synthetics/tokens/use24hPriceDeltaMap.ts +++ b/src/domain/synthetics/tokens/use24hPriceDeltaMap.ts @@ -2,10 +2,9 @@ import { useMemo } from "react"; import useSWR from "swr"; import { Address } from "viem"; +import { useOracleKeeperFetcher } from "lib/oracleKeeperFetcher/useOracleKeeperFetcher"; import { getNormalizedTokenSymbol, getToken } from "sdk/configs/tokens"; -import { useOracleKeeperFetcher } from "../../../lib/oracleKeeperFetcher/useOracleKeeperFetcher"; - export type PriceDelta = { close: number; deltaPercentage: number; diff --git a/src/domain/synthetics/tokens/useOnchainTokenConfigs.ts b/src/domain/synthetics/tokens/useOnchainTokenConfigs.ts index 0cdd8ef2c9..747c22a0b0 100644 --- a/src/domain/synthetics/tokens/useOnchainTokenConfigs.ts +++ b/src/domain/synthetics/tokens/useOnchainTokenConfigs.ts @@ -3,9 +3,10 @@ import { zeroAddress } from "viem"; import { getContract } from "config/contracts"; import { priceFeedKey } from "config/dataStore"; import { useMulticall } from "lib/multicall"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getV2Tokens, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; -export function useOnchainTokenConfigs(chainId: number) { +export function useOnchainTokenConfigs(chainId: ContractsChainId) { const tokens = getV2Tokens(chainId); const { data, error } = useMulticall(chainId, "useOnchainTokenConfigs", { diff --git a/src/domain/synthetics/tokens/useTokenAllowanceData.ts b/src/domain/synthetics/tokens/useTokenAllowanceData.ts index 8db1d2c66e..88d440cb8c 100644 --- a/src/domain/synthetics/tokens/useTokenAllowanceData.ts +++ b/src/domain/synthetics/tokens/useTokenAllowanceData.ts @@ -1,10 +1,12 @@ import { useMemo } from "react"; +import { isSourceChain } from "config/multichain"; import { useSyntheticsEvents } from "context/SyntheticsEvents"; import { MulticallRequestConfig, useMulticall } from "lib/multicall"; import { EMPTY_OBJECT } from "lib/objects"; import { FREQUENT_MULTICALL_REFRESH_INTERVAL } from "lib/timeConstants"; import useWallet from "lib/wallets/useWallet"; +import type { AnyChainId } from "sdk/configs/chains"; import { NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; import type { TokensAllowanceData } from "./types"; @@ -17,7 +19,7 @@ export type TokenAllowanceResult = { }; export function useTokensAllowanceData( - chainId: number, + chainId: AnyChainId | undefined, p: { spenderAddress?: string; tokenAddresses: string[]; @@ -26,7 +28,7 @@ export function useTokensAllowanceData( ): TokenAllowanceResult { const { spenderAddress, tokenAddresses, skip } = p; const { account } = useWallet(); - const { approvalStatuses } = useSyntheticsEvents(); + const { approvalStatuses, multichainSourceChainApprovalStatuses } = useSyntheticsEvents(); const validAddresses = tokenAddresses.filter((address): address is string => address !== NATIVE_TOKEN_ADDRESS); @@ -74,8 +76,13 @@ export function useTokensAllowanceData( const newData: TokensAllowanceData = {}; + let statuses = approvalStatuses; + if (chainId !== undefined && !isSourceChain(chainId)) { + statuses = multichainSourceChainApprovalStatuses; + } + for (const tokenAddress of validAddresses) { - const event = approvalStatuses[tokenAddress]?.[spenderAddress]; + const event = statuses[tokenAddress]?.[spenderAddress]; const eventValue: bigint | undefined = event?.value; const eventCreatedAt: number = event?.createdAt ?? 0; @@ -90,7 +97,15 @@ export function useTokensAllowanceData( } return newData; - }, [spenderAddress, validAddresses, data, approvalStatuses]); + }, [ + spenderAddress, + validAddresses, + approvalStatuses, + chainId, + multichainSourceChainApprovalStatuses, + data?.tokenAllowance, + data?.createdAt, + ]); const isLoaded = validAddresses.length > 0 && validAddresses.every((address) => mergedData?.[address] !== undefined); const isLoading = Boolean(key) && !isLoaded; diff --git a/src/domain/synthetics/tokens/useTokenBalances.ts b/src/domain/synthetics/tokens/useTokenBalances.ts index ab0aeda279..cbebe47767 100644 --- a/src/domain/synthetics/tokens/useTokenBalances.ts +++ b/src/domain/synthetics/tokens/useTokenBalances.ts @@ -1,75 +1,87 @@ +import { useAccount } from "wagmi"; + import { getContract } from "config/contracts"; import { useTokensBalancesUpdates, useUpdatedTokensBalances, } from "context/TokensBalancesContext/TokensBalancesContextProvider"; +import { Token } from "domain/tokens"; import { PLACEHOLDER_ACCOUNT } from "lib/legacy"; -import { MulticallRequestConfig, useMulticall } from "lib/multicall"; -import useWallet from "lib/wallets/useWallet"; -import { getV2Tokens, NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; - -import { TokenBalancesData } from "./types"; - -type BalancesDataResult = { - balancesData?: TokenBalancesData; - error?: Error; -}; +import { CacheKey, MulticallRequestConfig, useMulticall } from "lib/multicall"; +import type { ContractsChainId } from "sdk/configs/chains"; +import { getToken, getV2Tokens, NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; + +import type { BalancesDataResult, TokenBalancesData } from "./types"; + +function buildTokenBalancesRequest(chainId: ContractsChainId, key: CacheKey) { + const [account, overrideTokenList] = key as [account: string, overrideTokenList: string[] | undefined]; + + let tokenList: Token[]; + if (overrideTokenList && overrideTokenList.length > 0) { + tokenList = overrideTokenList.map((address) => getToken(chainId, address)); + } else { + tokenList = getV2Tokens(chainId); + } + + return tokenList.reduce((acc, token) => { + if (token.isSynthetic) return acc; + + const address = token.address; + + if (address === NATIVE_TOKEN_ADDRESS) { + acc[address] = { + contractAddress: getContract(chainId as ContractsChainId, "Multicall"), + abiId: "Multicall", + calls: { + balance: { + methodName: "getEthBalance", + params: [account], + }, + }, + }; + } else { + acc[address] = { + contractAddress: address, + abiId: "Token", + calls: { + balance: { + methodName: "balanceOf", + params: [account ?? PLACEHOLDER_ACCOUNT], + }, + }, + }; + } + + return acc; + }, {} as MulticallRequestConfig); +} export function useTokenBalances( - chainId: number, - overrideAccount?: string | undefined, - overrideTokenList?: { - address: string; - isSynthetic?: boolean; - }[], - refreshInterval?: number + chainId: ContractsChainId, + params?: { + overrideAccount?: string | undefined; + overrideTokenList?: { + address: string; + isSynthetic?: boolean; + }[]; + refreshInterval?: number; + enabled?: boolean; + } ): BalancesDataResult { + const { overrideAccount, overrideTokenList, refreshInterval, enabled = true } = params ?? {}; + const { resetTokensBalancesUpdates } = useTokensBalancesUpdates(); - const { account: currentAccount } = useWallet(); + const { address: currentAccount } = useAccount(); const account = overrideAccount ?? currentAccount; const { data, error } = useMulticall(chainId, "useTokenBalances", { - key: account ? [account, ...(overrideTokenList || []).map((t) => t.address)] : null, - + key: account && enabled ? [account, overrideTokenList?.map((t) => t.address)] : null, refreshInterval, - - request: () => - (overrideTokenList ?? getV2Tokens(chainId)).reduce((acc, token) => { - // Skip synthetic tokens - if (token.isSynthetic) return acc; - - const address = token.address; - - if (address === NATIVE_TOKEN_ADDRESS) { - acc[address] = { - contractAddress: getContract(chainId, "Multicall"), - abiId: "Multicall", - calls: { - balance: { - methodName: "getEthBalance", - params: [account], - }, - }, - }; - } else { - acc[address] = { - contractAddress: address, - abiId: "Token", - calls: { - balance: { - methodName: "balanceOf", - params: [account ?? PLACEHOLDER_ACCOUNT], - }, - }, - }; - } - - return acc; - }, {} as MulticallRequestConfig), + request: buildTokenBalancesRequest, parseResponse: (res) => { - const result: TokenBalancesData = {}; + let result: TokenBalancesData = {}; Object.keys(res.data).forEach((tokenAddress) => { result[tokenAddress] = res.data[tokenAddress].balance.returnValues[0]; diff --git a/src/domain/synthetics/tokens/useTokenRecentPricesData.ts b/src/domain/synthetics/tokens/useTokenRecentPricesData.ts index b26f9307a6..93e6eddba7 100644 --- a/src/domain/synthetics/tokens/useTokenRecentPricesData.ts +++ b/src/domain/synthetics/tokens/useTokenRecentPricesData.ts @@ -1,6 +1,7 @@ import { useMemo } from "react"; import { useLocation } from "react-router-dom"; +import { useOracleKeeperFetcher } from "lib/oracleKeeperFetcher/useOracleKeeperFetcher"; import { LEADERBOARD_PRICES_UPDATE_INTERVAL, PRICES_UPDATE_INTERVAL } from "lib/timeConstants"; import { getToken, getWrappedToken, NATIVE_TOKEN_ADDRESS } from "sdk/configs/tokens"; import type { Token } from "sdk/types/tokens"; @@ -8,12 +9,12 @@ import type { Token } from "sdk/types/tokens"; import { TokenPricesData } from "./types"; import { useSequentialTimedSWR } from "./useSequentialTimedSWR"; import { parseContractPrice } from "./utils"; -import { useOracleKeeperFetcher } from "../../../lib/oracleKeeperFetcher/useOracleKeeperFetcher"; type TokenPricesDataResult = { pricesData?: TokenPricesData; updatedAt?: number; error?: Error; + isPriceDataLoading: boolean; }; export function useTokenRecentPricesRequest(chainId: number): TokenPricesDataResult { @@ -27,7 +28,7 @@ export function useTokenRecentPricesRequest(chainId: number): TokenPricesDataRes : PRICES_UPDATE_INTERVAL; }, [pathname]); - const { data, error } = useSequentialTimedSWR([chainId, oracleKeeperFetcher.url, "useTokenRecentPrices"], { + const { data, error, isLoading } = useSequentialTimedSWR([chainId, oracleKeeperFetcher.url, "useTokenRecentPrices"], { refreshInterval: refreshPricesInterval, fetcher: ([chainId]) => oracleKeeperFetcher.fetchTickers().then((priceItems) => { @@ -68,5 +69,6 @@ export function useTokenRecentPricesRequest(chainId: number): TokenPricesDataRes pricesData: data?.pricesData, updatedAt: data?.updatedAt, error, + isPriceDataLoading: isLoading, }; } diff --git a/src/domain/synthetics/tokens/useTokensDataRequest.ts b/src/domain/synthetics/tokens/useTokensDataRequest.ts index c14862c92d..7ed75124b9 100644 --- a/src/domain/synthetics/tokens/useTokensDataRequest.ts +++ b/src/domain/synthetics/tokens/useTokensDataRequest.ts @@ -1,5 +1,7 @@ import { useMemo } from "react"; +import { useGmxAccountTokenBalances } from "domain/multichain/useGmxAccountTokenBalances"; +import { ContractsChainId, SourceChainId } from "sdk/configs/chains"; import { getTokensMap, getV2Tokens } from "sdk/configs/tokens"; import { TokensData } from "./types"; @@ -7,25 +9,37 @@ import { useOnchainTokenConfigs } from "./useOnchainTokenConfigs"; import { useTokenBalances } from "./useTokenBalances"; import { useTokenRecentPricesRequest } from "./useTokenRecentPricesData"; -type TokensDataResult = { - tokensData?: TokensData; - pricesUpdatedAt?: number; - isBalancesLoaded?: boolean; - error?: Error; +export type TokensDataResult = { + tokensData: TokensData | undefined; + pricesUpdatedAt: number | undefined; + isGmxAccountBalancesLoaded: boolean; + isWalletBalancesLoaded: boolean; + /** + * If srcChainId is undefined, then this is the wallet balances loaded + * If srcChainId is defined, then this is the gmx account balances loaded + */ + isBalancesLoaded: boolean; + error: Error | undefined; }; -export function useTokensDataRequest(chainId: number): TokensDataResult { +export function useTokensDataRequest(chainId: ContractsChainId, srcChainId?: SourceChainId): TokensDataResult { const tokenConfigs = getTokensMap(chainId); - const { balancesData, error: balancesError } = useTokenBalances(chainId); + const { balancesData: walletBalancesData, error: walletBalancesError } = useTokenBalances(chainId); + const { balancesData: gmxAccountBalancesData, error: gmxAccountBalancesError } = useGmxAccountTokenBalances(chainId); const { pricesData, updatedAt: pricesUpdatedAt, error: pricesError } = useTokenRecentPricesRequest(chainId); const { data: onchainConfigsData, error: onchainConfigsError } = useOnchainTokenConfigs(chainId); - const error = balancesError || pricesError || onchainConfigsError; + const error = walletBalancesError || pricesError || onchainConfigsError || gmxAccountBalancesError; - return useMemo(() => { + return useMemo((): TokensDataResult => { if (error) { return { error, + tokensData: undefined, + pricesUpdatedAt: undefined, + isGmxAccountBalancesLoaded: false, + isWalletBalancesLoaded: false, + isBalancesLoaded: false, }; } @@ -35,15 +49,23 @@ export function useTokensDataRequest(chainId: number): TokensDataResult { return { tokensData: undefined, pricesUpdatedAt: undefined, + isGmxAccountBalancesLoaded: false, + isWalletBalancesLoaded: false, + isBalancesLoaded: false, + error: undefined, }; } - const isBalancesLoaded = Boolean(balancesData); + const isWalletBalancesLoaded = Boolean(walletBalancesData); + const isGmxAccountBalancesLoaded = Boolean(gmxAccountBalancesData); + + const isBalancesLoaded = srcChainId !== undefined ? isGmxAccountBalancesLoaded : isWalletBalancesLoaded; return { tokensData: tokenAddresses.reduce((acc: TokensData, tokenAddress) => { const prices = pricesData[tokenAddress]; - const balance = balancesData?.[tokenAddress]; + const walletBalance = walletBalancesData?.[tokenAddress]; + const gmxAccountBalance = gmxAccountBalancesData?.[tokenAddress]; const tokenConfig = tokenConfigs[tokenAddress]; const onchainConfig = onchainConfigsData?.[tokenAddress]; @@ -55,13 +77,29 @@ export function useTokensDataRequest(chainId: number): TokensDataResult { ...tokenConfig, ...onchainConfig, prices, - balance, + walletBalance, + gmxAccountBalance, + balance: srcChainId !== undefined ? gmxAccountBalance : walletBalance, + isGmxAccount: srcChainId !== undefined, }; return acc; }, {} as TokensData), pricesUpdatedAt, isBalancesLoaded, + isGmxAccountBalancesLoaded, + isWalletBalancesLoaded, + error: undefined, }; - }, [error, chainId, pricesData, pricesUpdatedAt, balancesData, tokenConfigs, onchainConfigsData]); + }, [ + walletBalancesData, + chainId, + error, + gmxAccountBalancesData, + onchainConfigsData, + pricesData, + pricesUpdatedAt, + srcChainId, + tokenConfigs, + ]); } diff --git a/src/domain/synthetics/trade/useAvailableTokenOptions.ts b/src/domain/synthetics/trade/useAvailableTokenOptions.ts index 3f29c268d5..1b2833d356 100644 --- a/src/domain/synthetics/trade/useAvailableTokenOptions.ts +++ b/src/domain/synthetics/trade/useAvailableTokenOptions.ts @@ -1,12 +1,13 @@ import { useEffect, useMemo, useRef } from "react"; import { zeroAddress } from "viem"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiSupportedChain } from "config/chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "config/chains"; import { getSortedMarketsAddressesKey } from "config/localStorage"; import { SORTED_MARKETS } from "config/static/sortedMarkets"; import { GlvAndGmMarketsInfoData, Market, MarketInfo, MarketsData, isMarketInfo } from "domain/synthetics/markets"; import { InfoTokens, Token, getMidPrice } from "domain/tokens"; import { getByKey } from "lib/objects"; +import type { ContractsChainId, SourceChainId } from "sdk/configs/chains"; import { NATIVE_TOKEN_ADDRESS, getTokensMap } from "sdk/configs/tokens"; import { isGlvInfo } from "../markets/glv"; @@ -59,7 +60,7 @@ function getSortedMarketsConfigs(marketsData?: MarketsData, sortedAddresses?: st return resultSortedAddresses.map((address) => getByKey(marketsData, address)).filter(Boolean) as Market[]; } -const FORCE_ALLOWED_COLLATERAL_TOKENS: Record = { +const FORCE_ALLOWED_COLLATERAL_TOKENS: Record = { // handled by wrapOrUnwrap or by stakeOrUnstake [BOTANIX]: [ // bBTC @@ -70,6 +71,7 @@ const FORCE_ALLOWED_COLLATERAL_TOKENS: Record = { [AVALANCHE]: [], [ARBITRUM]: [], [AVALANCHE_FUJI]: [], + [ARBITRUM_SEPOLIA]: [], }; export function useAvailableTokenOptions( @@ -79,9 +81,10 @@ export function useAvailableTokenOptions( marketsData?: MarketsData; tokensData?: TokensData; marketTokens?: TokensData; + srcChainId: SourceChainId | undefined; } ): AvailableTokenOptions { - const { marketsInfoData, marketsData, tokensData, marketTokens } = p; + const { marketsInfoData, marketsData, tokensData, marketTokens, srcChainId } = p; const sortedMarketAddressesRef = useRef(); @@ -144,7 +147,7 @@ export function useAvailableTokenOptions( continue; } - if ((longToken.isWrapped || shortToken.isWrapped) && nativeToken) { + if ((longToken.isWrapped || shortToken.isWrapped) && nativeToken && !srcChainId) { collaterals.add(nativeToken); } @@ -230,5 +233,5 @@ export function useAvailableTokenOptions( sortedAllMarkets, sortedMarketConfigs, }; - }, [marketsInfoData, marketsData, chainId, tokensData, marketTokens]); + }, [marketsInfoData, chainId, tokensData, marketsData, marketTokens, srcChainId]); } diff --git a/src/domain/synthetics/trade/usePositionEditorState.ts b/src/domain/synthetics/trade/usePositionEditorState.ts index 4edffd80d3..f75bc1cb2a 100644 --- a/src/domain/synthetics/trade/usePositionEditorState.ts +++ b/src/domain/synthetics/trade/usePositionEditorState.ts @@ -1,44 +1,49 @@ +import noop from "lodash/noop"; import { useCallback, useEffect, useMemo, useState } from "react"; import { Address } from "viem"; -import { getSyntheticsCollateralEditAddressKey, getSyntheticsCollateralEditAddressMapKey } from "config/localStorage"; +import type { ContractsChainId, SourceChainId } from "config/chains"; +import { + getSyntheticsCollateralEditAddressMapKey, + getSyntheticsCollateralEditTokenIsFromGmxAccountMapKey, +} from "config/localStorage"; +import { isSettlementChain } from "config/multichain"; +import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { useLocalStorageSerializeKey } from "lib/localStorage"; -import { SUPPORTED_CHAIN_IDS } from "sdk/configs/chains"; -import { getTokens } from "sdk/configs/tokens"; import { parsePositionKey } from "../positions"; - export type PositionEditorState = ReturnType; -// start script to migrate getSyntheticsCollateralEditAddressKey to getSyntheticsCollateralEditAddressMapKey - -for (const chainId of SUPPORTED_CHAIN_IDS) { - const mapKey = getSyntheticsCollateralEditAddressMapKey(chainId); - const alreadyExists = localStorage.getItem(JSON.stringify(mapKey)); - if (alreadyExists) { - continue; - } - const map = {}; - for (const token of getTokens(chainId)) { - const key = getSyntheticsCollateralEditAddressKey(chainId, token.address); - const rawValue = localStorage.getItem(JSON.stringify(key)); - if (!rawValue) { - continue; - } - map[token.address] = JSON.parse(rawValue); - - localStorage.removeItem(JSON.stringify(key)); - } - - localStorage.setItem(JSON.stringify(mapKey), JSON.stringify(map)); -} - -export function usePositionEditorState(chainId: number) { +export function usePositionEditorState(chainId: ContractsChainId, srcChainId: SourceChainId | undefined) { + // const expressOrdersEnabled = useSelector(selectExpressOrdersEnabled); + const { expressOrdersEnabled } = useSettings(); const [editingPositionKey, setEditingPositionKey] = useState(); const [collateralInputValue, setCollateralInputValue] = useState(""); const [selectedCollateralAddressMap, setSelectedCollateralAddressMap] = useLocalStorageSerializeKey< Partial> >(getSyntheticsCollateralEditAddressMapKey(chainId), {}); + const [_isCollateralTokenFromGmxAccount, _setIsCollateralTokenFromGmxAccount] = useLocalStorageSerializeKey( + getSyntheticsCollateralEditTokenIsFromGmxAccountMapKey(chainId), + false + ); + + let isCollateralTokenFromGmxAccount = false; + if (srcChainId !== undefined) { + isCollateralTokenFromGmxAccount = true; + } else if (!isSettlementChain(chainId)) { + isCollateralTokenFromGmxAccount = false; + } else { + isCollateralTokenFromGmxAccount = Boolean(_isCollateralTokenFromGmxAccount); + } + + let setIsCollateralTokenFromGmxAccount: (value: boolean) => void; + if (srcChainId !== undefined) { + setIsCollateralTokenFromGmxAccount = noop; + } else if (!isSettlementChain(chainId)) { + setIsCollateralTokenFromGmxAccount = noop; + } else { + setIsCollateralTokenFromGmxAccount = _setIsCollateralTokenFromGmxAccount; + } const setSelectedCollateralAddress = useCallback( (selectedCollateralAddress: Address) => { @@ -56,7 +61,21 @@ export function usePositionEditorState(chainId: number) { useEffect(() => { setEditingPositionKey(undefined); setCollateralInputValue(""); - }, [chainId]); + _setIsCollateralTokenFromGmxAccount(srcChainId !== undefined); + }, [_setIsCollateralTokenFromGmxAccount, chainId, srcChainId]); + + useEffect( + function fallbackIsCollateralTokenFromGmxAccount() { + if (expressOrdersEnabled) { + return; + } + + if (isCollateralTokenFromGmxAccount && !expressOrdersEnabled) { + setIsCollateralTokenFromGmxAccount(false); + } + }, + [expressOrdersEnabled, isCollateralTokenFromGmxAccount, setIsCollateralTokenFromGmxAccount] + ); return useMemo( () => ({ @@ -66,7 +85,16 @@ export function usePositionEditorState(chainId: number) { setCollateralInputValue, selectedCollateralAddressMap, setSelectedCollateralAddress, + isCollateralTokenFromGmxAccount, + setIsCollateralTokenFromGmxAccount, }), - [collateralInputValue, editingPositionKey, selectedCollateralAddressMap, setSelectedCollateralAddress] + [ + collateralInputValue, + editingPositionKey, + selectedCollateralAddressMap, + setSelectedCollateralAddress, + isCollateralTokenFromGmxAccount, + setIsCollateralTokenFromGmxAccount, + ] ); } diff --git a/src/domain/synthetics/trade/usePriceImpactWarningState.ts b/src/domain/synthetics/trade/usePriceImpactWarningState.ts index 15286f4d55..df621d8daf 100644 --- a/src/domain/synthetics/trade/usePriceImpactWarningState.ts +++ b/src/domain/synthetics/trade/usePriceImpactWarningState.ts @@ -32,8 +32,8 @@ export type WarningState = { }; export function usePriceImpactWarningState({ - collateralImpact, - positionImpact, + collateralNetPriceImpact, + positionNetPriceImpact, swapPriceImpact, swapProfitFee, executionFeeUsd, @@ -42,8 +42,8 @@ export function usePriceImpactWarningState({ tradeFlags, payUsd, }: { - collateralImpact?: FeeItem; - positionImpact?: FeeItem; + collateralNetPriceImpact?: FeeItem; + positionNetPriceImpact?: FeeItem; swapPriceImpact?: FeeItem; swapProfitFee?: FeeItem; executionFeeUsd?: bigint; @@ -77,10 +77,10 @@ export function usePriceImpactWarningState({ } }, [prevFlags, tradeFlags]); - const isHighPositionImpact = getIsHighPositionImpact(positionImpact); + const isHighPositionImpact = getIsHighPositionImpact(positionNetPriceImpact); const prevIsHighPositionImpact = usePrevious(isHighPositionImpact); - const isHighCollateralImpact = getIsHighCollateralImpact(collateralImpact); + const isHighCollateralImpact = getIsHighCollateralImpact(collateralNetPriceImpact); const prevIsHighCollateralImpact = usePrevious(isHighCollateralImpact); const isHighSwapImpact = getIsHighSwapImpact(swapPriceImpact); diff --git a/src/domain/synthetics/trade/useTradeParamsProcessor.ts b/src/domain/synthetics/trade/useTradeParamsProcessor.ts index e351f958d5..a1b9ea7463 100644 --- a/src/domain/synthetics/trade/useTradeParamsProcessor.ts +++ b/src/domain/synthetics/trade/useTradeParamsProcessor.ts @@ -1,11 +1,16 @@ import isMatch from "lodash/isMatch"; -import { useEffect, useRef } from "react"; +import { useEffect } from "react"; import { useHistory, useParams } from "react-router-dom"; +import { useLatest } from "react-use"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiSupportedChain } from "config/chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "config/chains"; import { selectTradeboxAvailableTokensOptions, + selectTradeboxCollateralTokenAddress, + selectTradeboxFromTokenAddress, + selectTradeboxMarketAddress, selectTradeboxSetTradeConfig, + selectTradeboxToTokenAddress, selectTradeboxTradeMode, selectTradeboxTradeType, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; @@ -28,33 +33,31 @@ type TradeOptions = { collateralAddress?: string; }; -const validChainIds: Record = { +const validChainIds: Record = { [ARBITRUM]: true, [AVALANCHE]: true, [AVALANCHE_FUJI]: true, [BOTANIX]: true, + [ARBITRUM_SEPOLIA]: true, }; export function useTradeParamsProcessor() { const setTradeConfig = useSelector(selectTradeboxSetTradeConfig); const availableTokensOptions = useSelector(selectTradeboxAvailableTokensOptions); const markets = availableTokensOptions.sortedAllMarkets; - const tradeMode = useSelector(selectTradeboxTradeMode); - const tradeType = useSelector(selectTradeboxTradeType); - const { chainId } = useChainId(); const history = useHistory(); const params = useParams<{ tradeType?: string }>(); const searchParams = useSearchParams(); const { indexTokens, swapTokens } = availableTokensOptions; - const prevTradeOptions = useRef({ - fromTokenAddress: undefined, - toTokenAddress: undefined, - marketAddress: undefined, - tradeType: tradeType, - tradeMode: tradeMode, - collateralAddress: undefined, + const latestTradeOptions = useLatest({ + fromTokenAddress: useSelector(selectTradeboxFromTokenAddress), + toTokenAddress: useSelector(selectTradeboxToTokenAddress), + marketAddress: useSelector(selectTradeboxMarketAddress), + tradeType: useSelector(selectTradeboxTradeType), + tradeMode: useSelector(selectTradeboxTradeMode), + collateralAddress: useSelector(selectTradeboxCollateralTokenAddress), }); useEffect(() => { @@ -142,21 +145,35 @@ export function useTradeParamsProcessor() { } setTimeout(() => { if (history.location.search) { - history.replace({ search: "" }); + const query = new URLSearchParams(history.location.search); + query.delete("mode"); + query.delete("from"); + query.delete("to"); + query.delete("market"); + query.delete("pool"); + query.delete("collateral"); + query.delete("chainId"); + history.replace({ search: query.toString() }); } }, 2000); } - if (!isMatch(prevTradeOptions.current, tradeOptions)) { - prevTradeOptions.current = tradeOptions; + if (!isMatch(latestTradeOptions.current, tradeOptions)) { setTradeConfig(tradeOptions); } if (history.location.search && !toToken && !pool) { setTimeout(() => { if (history.location.search) { - history.replace({ search: "" }); - prevTradeOptions.current = {}; + const query = new URLSearchParams(history.location.search); + query.delete("mode"); + query.delete("from"); + query.delete("to"); + query.delete("market"); + query.delete("pool"); + query.delete("collateral"); + query.delete("chainId"); + history.replace({ search: query.toString() }); } }, 2000); } @@ -170,5 +187,6 @@ export function useTradeParamsProcessor() { swapTokens, indexTokens, availableTokensOptions, + latestTradeOptions, ]); } diff --git a/src/domain/synthetics/trade/useTradeboxState.ts b/src/domain/synthetics/trade/useTradeboxState.ts index 7834443f00..f479edcda7 100644 --- a/src/domain/synthetics/trade/useTradeboxState.ts +++ b/src/domain/synthetics/trade/useTradeboxState.ts @@ -7,7 +7,9 @@ import set from "lodash/set"; import values from "lodash/values"; import { SetStateAction, useCallback, useEffect, useMemo, useState } from "react"; +import { ContractsChainId, SourceChainId } from "config/chains"; import { getKeepLeverageKey, getLeverageKey, getSyntheticsTradeOptionsKey } from "config/localStorage"; +import { isSettlementChain } from "config/multichain"; import { useSettings } from "context/SettingsContext/SettingsContextProvider"; import { createGetMaxLongShortLiquidityPool } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; import { MarketInfo } from "domain/synthetics/markets"; @@ -68,6 +70,7 @@ type StoredTradeOptions = { }; }; advanced?: TradeboxAdvancedOptions; + isFromTokenGmxAccount: boolean; }; const INITIAL_SYNTHETICS_TRADE_OPTIONS_STATE: StoredTradeOptions = { @@ -80,10 +83,11 @@ const INITIAL_SYNTHETICS_TRADE_OPTIONS_STATE: StoredTradeOptions = { advancedDisplay: false, limitOrTPSL: false, }, + isFromTokenGmxAccount: false, }; export function useTradeboxState( - chainId: number, + chainId: ContractsChainId, enabled: boolean, p: { marketsData?: MarketsData; @@ -91,11 +95,17 @@ export function useTradeboxState( positionsInfoData?: PositionsInfoData; ordersInfoData?: OrdersInfoData; tokensData?: TokensData; + srcChainId: SourceChainId | undefined; } ) { - const { marketsInfoData, marketsData, tokensData, positionsInfoData, ordersInfoData } = p; + const { marketsInfoData, marketsData, tokensData, positionsInfoData, ordersInfoData, srcChainId } = p; - const availableTokensOptions = useAvailableTokenOptions(chainId, { marketsInfoData, tokensData, marketsData }); + const availableTokensOptions = useAvailableTokenOptions(chainId, { + marketsInfoData, + tokensData, + marketsData, + srcChainId, + }); const availableSwapTokenAddresses = useMemo( () => availableTokensOptions.swapTokens.map((t) => t.address), @@ -146,7 +156,7 @@ export function useTradeboxState( [chainId] ); - const { savedAllowedSlippage, savedTwapNumberOfParts } = useSettings(); + const { savedAllowedSlippage, savedTwapNumberOfParts, expressOrdersEnabled } = useSettings(); const [syncedChainId, setSyncedChainId] = useState(undefined); const [allowedSlippage, setAllowedSlippage] = useState(savedAllowedSlippage); @@ -211,13 +221,14 @@ export function useTradeboxState( let newState = typeof args === "function" ? args(oldState) : args; if (newState && (newState.tradeType === TradeType.Long || newState.tradeType === TradeType.Short)) { - newState = fallbackPositionTokens( + newState = fallbackPositionTokens({ chainId, - oldState, - newState, - availableSwapTokenAddresses, - availableTokensOptions.sortedAllMarkets - ); + srcChainId, + prevState: oldState, + nextState: newState, + allowedPayTokens: availableSwapTokenAddresses, + allowedMarkets: availableTokensOptions.sortedAllMarkets, + }); newState = fallbackCollateralTokens(newState, marketsInfoData); } @@ -225,11 +236,12 @@ export function useTradeboxState( }); }, [ + setStoredOptionsOnChain, chainId, + srcChainId, availableSwapTokenAddresses, - setStoredOptionsOnChain, - marketsInfoData, availableTokensOptions.sortedAllMarkets, + marketsInfoData, ] ); @@ -265,6 +277,7 @@ export function useTradeboxState( const { isSwap } = tradeFlags; const fromTokenAddress = storedOptions?.tokens.fromTokenAddress; + const isFromTokenGmxAccount = Boolean(storedOptions?.isFromTokenGmxAccount); const toTokenAddress = tradeFlags.isSwap ? storedOptions?.tokens.swapToTokenAddress @@ -363,6 +376,13 @@ export function useTradeboxState( [setStoredOptions] ); + const setIsFromTokenGmxAccount = useCallback( + (isFromTokenGmxAccount: boolean) => { + setStoredOptions((oldState) => ({ ...oldState, isFromTokenGmxAccount })); + }, + [setStoredOptions] + ); + const setToTokenAddress = useCallback( function setToTokenAddressCallback(tokenAddress: string, marketTokenAddress?: string, tradeType?: TradeType) { setStoredOptions(setToTokenAddressUpdaterBuilder(tradeType, tokenAddress, marketTokenAddress)); @@ -399,10 +419,11 @@ export function useTradeboxState( let swappedOptionsWithFallback; try { - swappedOptionsWithFallback = fallbackPositionTokens( + swappedOptionsWithFallback = fallbackPositionTokens({ chainId, - storedOptions, - { + srcChainId, + prevState: storedOptions, + nextState: { ...storedOptions, tokens: { ...storedOptions.tokens, @@ -410,9 +431,9 @@ export function useTradeboxState( indexTokenAddress: desirableToAddress, }, }, - availableSwapTokenAddresses, - availableTokensOptions.sortedAllMarkets - ); + allowedPayTokens: availableSwapTokenAddresses, + allowedMarkets: availableTokensOptions.sortedAllMarkets, + }); } catch (e) { /** * This fallback made in attempt to prevent crushes for those users who already have invalid stored options. @@ -437,6 +458,7 @@ export function useTradeboxState( enabled, storedOptions, chainId, + srcChainId, availableSwapTokenAddresses, availableTokensOptions.sortedAllMarkets, setStoredOptionsOnChain, @@ -634,19 +656,39 @@ export function useTradeboxState( return; } - const needFromUpdate = !swapTokens.find((t) => t.address === fromTokenAddress); + const needFromAddressUpdate = !swapTokens.find((t) => t.address === fromTokenAddress); + const canFromTokenBeGmxAccount = isSettlementChain(chainId); + const mustFromTokenBeGmxAccount = srcChainId !== undefined; + const needFromIsGmxAccountUpdate = + (!canFromTokenBeGmxAccount && isFromTokenGmxAccount) || (mustFromTokenBeGmxAccount && !isFromTokenGmxAccount); - if (needFromUpdate) { + if (needFromAddressUpdate) { setFromTokenAddress(swapTokens[0].address); } + if (needFromIsGmxAccountUpdate) { + setIsFromTokenGmxAccount(srcChainId !== undefined); + } + const needToUpdate = !swapTokens.find((t) => t.address === toTokenAddress); if (needToUpdate) { setToTokenAddress(swapTokens[0].address); } }, - [enabled, fromTokenAddress, isSwap, setFromTokenAddress, setToTokenAddress, swapTokens, toTokenAddress] + [ + chainId, + enabled, + fromTokenAddress, + isFromTokenGmxAccount, + isSwap, + setFromTokenAddress, + setIsFromTokenGmxAccount, + setToTokenAddress, + srcChainId, + swapTokens, + toTokenAddress, + ] ); useEffect(() => { @@ -666,6 +708,19 @@ export function useTradeboxState( }); }, [advancedOptions, setStoredOptionsOnChain, storedOptions.advanced]); + useEffect( + function fallbackIsFromTokenGmxAccount() { + if (expressOrdersEnabled) { + return; + } + + if (isFromTokenGmxAccount && !expressOrdersEnabled) { + setIsFromTokenGmxAccount(false); + } + }, + [expressOrdersEnabled, isFromTokenGmxAccount, setIsFromTokenGmxAccount] + ); + return { tradeType, tradeMode, @@ -715,14 +770,14 @@ export function useTradeboxState( setLeverageInputValue: handleLeverageInputChange, leverageOption, setLeverageOption: handleLeverageSliderChange, - // isLeverageEnabled, - // setIsLeverageEnabled, keepLeverage, setKeepLeverage, advancedOptions, setAdvancedOptions, allowedSlippage, setAllowedSlippage, + isFromTokenGmxAccount, + setIsFromTokenGmxAccount, numberOfParts, setNumberOfParts, duration, @@ -768,13 +823,21 @@ function setToTokenAddressUpdaterBuilder( * This function does not care about user's positions, fees, sizes, etc. * It must set any suitable token and market addresses combination in case it is not correct. */ -function fallbackPositionTokens( - chainId: number, - prevState: StoredTradeOptions, - nextState: StoredTradeOptions, - allowedPayTokens: string[], - allowedMarkets: MarketInfo[] -) { +function fallbackPositionTokens({ + chainId, + srcChainId, + prevState, + nextState, + allowedPayTokens, + allowedMarkets, +}: { + chainId: number; + srcChainId: SourceChainId | undefined; + prevState: StoredTradeOptions; + nextState: StoredTradeOptions; + allowedPayTokens: string[]; + allowedMarkets: MarketInfo[]; +}) { const longOrShort = nextState.tradeType === TradeType.Long ? "long" : "short"; const allowedPayTokensSet = new Set(allowedPayTokens); @@ -790,6 +853,12 @@ function fallbackPositionTokens( const isNextIndexTokenValid = nextIndexTokenAddress && allowedIndexTokens.has(nextIndexTokenAddress); const isNextMarketTokenValid = nextMarketTokenAdress && marketsMap[nextMarketTokenAdress]?.marketTokenAddress === nextMarketTokenAdress; + const canFromTokenBeGmxAccount = isSettlementChain(chainId); + const mustFromTokenBeGmxAccount = srcChainId !== undefined; + const isNextPayTokenSourceValid = !( + (!canFromTokenBeGmxAccount && nextState.isFromTokenGmxAccount) || + (mustFromTokenBeGmxAccount && !nextState.isFromTokenGmxAccount) + ); const fallbackPayToken = (fallbackPayToken?: string) => { return produce(nextState, (draft) => { @@ -818,7 +887,7 @@ function fallbackPositionTokens( return updater(nextState); }; - if (isNextPayTokenValid && isNextIndexTokenValid && isNextMarketTokenValid) { + if (isNextPayTokenValid && isNextIndexTokenValid && isNextMarketTokenValid && isNextPayTokenSourceValid) { return nextState; } @@ -870,6 +939,12 @@ function fallbackPositionTokens( nextState = fallbackIndexTokenAndMarket(nextState.tokens.indexTokenAddress); } + if (!isNextPayTokenSourceValid) { + nextState = produce(nextState, (draft) => { + draft.isFromTokenGmxAccount = srcChainId !== undefined; + }); + } + const isFallbackPayTokenValid = nextState.tokens.fromTokenAddress && allowedPayTokensSet.has(nextState.tokens.fromTokenAddress); const isFallbackIndexTokenValid = diff --git a/src/domain/synthetics/trade/utils/common.ts b/src/domain/synthetics/trade/utils/common.ts index 48c6224750..51b9e84d7d 100644 --- a/src/domain/synthetics/trade/utils/common.ts +++ b/src/domain/synthetics/trade/utils/common.ts @@ -7,8 +7,7 @@ import { } from "domain/synthetics/fees"; import { OrderInfo, isLimitOrderType, isMarketOrderType, isSwapOrderType } from "domain/synthetics/orders"; import { PRECISION, applyFactor, getBasisPoints } from "lib/numbers"; -import { ExternalSwapQuote } from "sdk/types/trade"; -import { SwapStats, TradeFees, TradeFlags, TradeMode, TradeType } from "sdk/types/trade"; +import { ExternalSwapQuote, SwapStats, TradeFees, TradeFlags, TradeMode, TradeType } from "sdk/types/trade"; import { bigMath } from "sdk/utils/bigmath"; import { OrderOption } from "../usePositionSellerState"; @@ -96,13 +95,17 @@ export function getTradeFees(p: { externalSwapQuote: ExternalSwapQuote | undefined; positionFeeUsd: bigint; swapPriceImpactDeltaUsd: bigint; - positionPriceImpactDeltaUsd: bigint; + increasePositionPriceImpactDeltaUsd: bigint; + totalPendingImpactDeltaUsd: bigint; + proportionalPendingImpactDeltaUsd: bigint; + decreasePositionPriceImpactDeltaUsd: bigint; priceImpactDiffUsd: bigint; borrowingFeeUsd: bigint; fundingFeeUsd: bigint; feeDiscountUsd: bigint; swapProfitFeeUsd: bigint; uiFeeFactor: bigint; + type: "increase" | "decrease" | "swap"; }): TradeFees { const { initialCollateralUsd, @@ -111,14 +114,18 @@ export function getTradeFees(p: { swapSteps, positionFeeUsd, swapPriceImpactDeltaUsd, - positionPriceImpactDeltaUsd, + increasePositionPriceImpactDeltaUsd, + totalPendingImpactDeltaUsd, externalSwapQuote, priceImpactDiffUsd, borrowingFeeUsd, fundingFeeUsd, feeDiscountUsd, swapProfitFeeUsd, + proportionalPendingImpactDeltaUsd, + decreasePositionPriceImpactDeltaUsd, uiFeeFactor, + type, } = p; const swapFees: SwapFeeItem[] | undefined = @@ -170,29 +177,27 @@ export function getTradeFees(p: { const borrowFee = getFeeItem(borrowingFeeUsd * -1n, initialCollateralUsd); const fundingFee = getFeeItem(fundingFeeUsd * -1n, initialCollateralUsd); - const positionPriceImpact = getFeeItem(positionPriceImpactDeltaUsd, sizeDeltaUsd); + const increasePositionPriceImpact = getFeeItem(increasePositionPriceImpactDeltaUsd, sizeDeltaUsd); + const decreasePositionPriceImpact = getFeeItem(decreasePositionPriceImpactDeltaUsd, sizeDeltaUsd); + const proportionalPendingImpact = getFeeItem(proportionalPendingImpactDeltaUsd, sizeDeltaUsd); + const totalPendingImpact = getFeeItem(totalPendingImpactDeltaUsd, sizeDeltaUsd); const priceImpactDiff = getFeeItem(priceImpactDiffUsd, sizeDeltaUsd); + const positionNetPriceImpact = getTotalFeeItem([totalPendingImpact, priceImpactDiff]); - const positionCollateralPriceImpact = getFeeItem(positionPriceImpactDeltaUsd, bigMath.abs(collateralDeltaUsd)); + const positionCollateralPriceImpact = getFeeItem( + type === "increase" ? increasePositionPriceImpactDeltaUsd : totalPendingImpactDeltaUsd, + bigMath.abs(collateralDeltaUsd) + ); const collateralPriceImpactDiff = getFeeItem(priceImpactDiffUsd, collateralDeltaUsd); + const collateralNetPriceImpact = getTotalFeeItem([positionCollateralPriceImpact, collateralPriceImpactDiff]); const totalFees = getTotalFeeItem([ ...(swapFees || []), externalSwapFee, swapProfitFee, swapPriceImpact, - positionFeeAfterDiscount, - borrowFee, - fundingFee, - uiFee, - uiSwapFee, - ]); - - // TODO: this is the same as totalFees, we should remove this - const payTotalFees = getTotalFeeItem([ - ...(swapFees || []), - swapProfitFee, - swapPriceImpact, + type === "decrease" ? totalPendingImpact : undefined, + type === "decrease" ? priceImpactDiff : undefined, positionFeeAfterDiscount, borrowFee, fundingFee, @@ -202,15 +207,20 @@ export function getTradeFees(p: { return { totalFees, - payTotalFees, + payTotalFees: totalFees, swapFees, swapProfitFee, swapPriceImpact, positionFee: positionFeeBeforeDiscount, - positionPriceImpact, priceImpactDiff, positionCollateralPriceImpact, + proportionalPendingImpact, + increasePositionPriceImpact, + decreasePositionPriceImpact, + totalPendingImpact, collateralPriceImpactDiff, + positionNetPriceImpact, + collateralNetPriceImpact, borrowFee, fundingFee, feeDiscountUsd, diff --git a/src/domain/synthetics/trade/utils/decrease.spec.ts b/src/domain/synthetics/trade/utils/decrease.spec.ts index b940cff179..9e34e1c326 100644 --- a/src/domain/synthetics/trade/utils/decrease.spec.ts +++ b/src/domain/synthetics/trade/utils/decrease.spec.ts @@ -6,7 +6,7 @@ import { PositionInfoLoaded } from "domain/synthetics/positions"; import { TokenData } from "domain/synthetics/tokens"; import { expandDecimals } from "lib/numbers"; -import { getDecreasePositionAmounts } from "./decrease"; +import { getDecreasePositionAmounts } from "../../../../../sdk/src/utils/trade/decrease"; const closeSizeUsd = BigInt(99); @@ -99,23 +99,28 @@ const marketInfo: MarketInfo = { maxPnlFactorForTradersLong: BigInt("0x0b5c0e8d21d902d61fa0000000"), maxPnlFactorForTradersShort: BigInt("0x0b5c0e8d21d902d61fa0000000"), minCollateralFactor: BigInt("0x204fce5e3e25026110000000"), + minCollateralFactorForLiquidation: BigInt("0x204fce5e3e25026110000000"), minCollateralFactorForOpenInterestLong: BigInt("0x0ad78ebc5ac6200000"), minCollateralFactorForOpenInterestShort: BigInt("0x0ad78ebc5ac6200000"), claimableFundingAmountLong: BigInt("0x1cefb332ff83"), claimableFundingAmountShort: BigInt("0x05b1ee"), - positionFeeFactorForPositiveImpact: BigInt("0x019d971e4fe8401e74000000"), - positionFeeFactorForNegativeImpact: BigInt("0x024306c4097859c43c000000"), + positionFeeFactorForBalanceWasImproved: BigInt("0x019d971e4fe8401e74000000"), + positionFeeFactorForBalanceWasNotImproved: BigInt("0x024306c4097859c43c000000"), positionImpactFactorPositive: BigInt("0x04e1003b28d9280000"), positionImpactFactorNegative: BigInt("0x0821ab0d4414980000"), maxPositionImpactFactorPositive: BigInt("0x1027e72f1f12813088000000"), maxPositionImpactFactorNegative: BigInt("0x1027e72f1f12813088000000"), maxPositionImpactFactorForLiquidations: BigInt("0x00"), + maxLendableImpactFactor: BigInt("0x00"), + maxLendableImpactFactorForWithdrawals: BigInt("0x00"), + maxLendableImpactUsd: BigInt("0x00"), positionImpactExponentFactor: BigInt("0x193e5939a08ce9dbd480000000"), - swapFeeFactorForPositiveImpact: BigInt("0x019d971e4fe8401e74000000"), - swapFeeFactorForNegativeImpact: BigInt("0x024306c4097859c43c000000"), + swapFeeFactorForBalanceWasImproved: BigInt("0x019d971e4fe8401e74000000"), + swapFeeFactorForBalanceWasNotImproved: BigInt("0x024306c4097859c43c000000"), swapImpactFactorPositive: BigInt("0x0ad78ebc5ac6200000"), swapImpactFactorNegative: BigInt("0x0ad78ebc5ac6200000"), swapImpactExponentFactor: BigInt("0x193e5939a08ce9dbd480000000"), + lentPositionImpactPoolAmount: BigInt("0x00"), atomicSwapFeeFactor: BigInt("0x00"), borrowingFactorPerSecondForLongs: BigInt("0x00"), borrowingFactorPerSecondForShorts: BigInt("0xd03c28208ed1247ad5"), @@ -143,6 +148,7 @@ const position: PositionInfoLoaded = { isLong: true, pendingBorrowingFeesUsd: BigInt("0x01f7685a27fa507f04c467a667"), fundingFeeAmount: BigInt("0x059624"), + pendingImpactAmount: BigInt("0x00"), claimableLongTokenAmount: BigInt("0x00"), claimableShortTokenAmount: BigInt("0x00"), marketInfo, @@ -175,6 +181,8 @@ const position: PositionInfoLoaded = { positionFeeAmount: 0n, traderDiscountAmount: 0n, uiFeeAmount: 0n, + netPriceImapctDeltaUsd: 0n, + priceImpactDiffUsd: 0n, }; const keepLeverage = false; diff --git a/src/domain/synthetics/trade/utils/deposit.ts b/src/domain/synthetics/trade/utils/deposit.ts index 5b2c82a831..f18bd272da 100644 --- a/src/domain/synthetics/trade/utils/deposit.ts +++ b/src/domain/synthetics/trade/utils/deposit.ts @@ -86,7 +86,7 @@ export function getDepositAmounts(p: { return values; } - values.swapPriceImpactDeltaUsd = getPriceImpactForSwap( + const priceImpactValues = getPriceImpactForSwap( marketInfo, longToken, shortToken, @@ -94,12 +94,14 @@ export function getDepositAmounts(p: { values.shortTokenUsd ); + values.swapPriceImpactDeltaUsd = priceImpactValues.priceImpactDeltaUsd; + const totalDepositUsd = values.longTokenUsd + values.shortTokenUsd; if (values.longTokenUsd > 0) { const swapFeeUsd = p.forShift ? 0n - : getSwapFee(marketInfo, values.longTokenUsd, values.swapPriceImpactDeltaUsd > 0, false); + : getSwapFee(marketInfo, values.longTokenUsd, priceImpactValues.balanceWasImproved, false); values.swapFeeUsd = values.swapFeeUsd + swapFeeUsd; const uiFeeUsd = applyFactor(values.longTokenUsd, uiFeeFactor); @@ -120,7 +122,7 @@ export function getDepositAmounts(p: { if (values.shortTokenUsd > 0) { const swapFeeUsd = p.forShift ? 0n - : getSwapFee(marketInfo, values.shortTokenUsd, values.swapPriceImpactDeltaUsd > 0, false); + : getSwapFee(marketInfo, values.shortTokenUsd, priceImpactValues.balanceWasImproved, false); values.swapFeeUsd = values.swapFeeUsd + swapFeeUsd; const uiFeeUsd = applyFactor(values.shortTokenUsd, uiFeeFactor); @@ -196,7 +198,7 @@ export function getDepositAmounts(p: { values.shortTokenUsd = values.marketTokenUsd; } - values.swapPriceImpactDeltaUsd = getPriceImpactForSwap( + const priceImpactValues = getPriceImpactForSwap( marketInfo, longToken, shortToken, @@ -205,7 +207,7 @@ export function getDepositAmounts(p: { ); if (!p.forShift) { - const swapFeeUsd = getSwapFee(marketInfo, values.marketTokenUsd, values.swapPriceImpactDeltaUsd > 0, false); + const swapFeeUsd = getSwapFee(marketInfo, values.marketTokenUsd, priceImpactValues.balanceWasImproved, false); values.swapFeeUsd = values.swapFeeUsd + swapFeeUsd; } diff --git a/src/domain/synthetics/trade/utils/increase.ts b/src/domain/synthetics/trade/utils/increase.ts index 5d355ed45a..2969fea05e 100644 --- a/src/domain/synthetics/trade/utils/increase.ts +++ b/src/domain/synthetics/trade/utils/increase.ts @@ -1,99 +1 @@ -import { UserReferralInfo } from "domain/referrals"; -import { MarketInfo } from "domain/synthetics/markets"; -import { - PositionInfo, - getEntryPrice, - getLeverage, - getLiquidationPrice, - getPositionPnlUsd, -} from "domain/synthetics/positions"; -import { TokenData } from "domain/synthetics/tokens"; -import { NextPositionValues } from "sdk/types/trade"; - -export * from "sdk/utils/trade/amounts"; - -export function getNextPositionValuesForIncreaseTrade(p: { - existingPosition?: PositionInfo; - marketInfo: MarketInfo; - collateralToken: TokenData; - sizeDeltaUsd: bigint; - sizeDeltaInTokens: bigint; - collateralDeltaUsd: bigint; - collateralDeltaAmount: bigint; - indexPrice: bigint; - isLong: boolean; - showPnlInLeverage: boolean; - minCollateralUsd: bigint; - userReferralInfo: UserReferralInfo | undefined; -}): NextPositionValues { - const { - existingPosition, - marketInfo, - collateralToken, - sizeDeltaUsd, - sizeDeltaInTokens, - collateralDeltaUsd, - collateralDeltaAmount, - indexPrice, - isLong, - showPnlInLeverage, - minCollateralUsd, - userReferralInfo, - } = p; - - const nextCollateralUsd = existingPosition ? existingPosition.collateralUsd + collateralDeltaUsd : collateralDeltaUsd; - - const nextCollateralAmount = existingPosition - ? existingPosition.collateralAmount + collateralDeltaAmount - : collateralDeltaAmount; - - const nextSizeUsd = existingPosition ? existingPosition.sizeInUsd + sizeDeltaUsd : sizeDeltaUsd; - const nextSizeInTokens = existingPosition ? existingPosition.sizeInTokens + sizeDeltaInTokens : sizeDeltaInTokens; - - const nextEntryPrice = - getEntryPrice({ - sizeInUsd: nextSizeUsd, - sizeInTokens: nextSizeInTokens, - indexToken: marketInfo.indexToken, - }) ?? indexPrice; - - const nextPnl = existingPosition - ? getPositionPnlUsd({ - marketInfo, - sizeInUsd: nextSizeUsd, - sizeInTokens: nextSizeInTokens, - markPrice: indexPrice, - isLong, - }) - : undefined; - - const nextLeverage = getLeverage({ - sizeInUsd: nextSizeUsd, - collateralUsd: nextCollateralUsd, - pnl: showPnlInLeverage ? nextPnl : undefined, - pendingBorrowingFeesUsd: 0n, // deducted on order - pendingFundingFeesUsd: 0n, // deducted on order - }); - - const nextLiqPrice = getLiquidationPrice({ - marketInfo, - collateralToken, - sizeInUsd: nextSizeUsd, - sizeInTokens: nextSizeInTokens, - collateralUsd: nextCollateralUsd, - collateralAmount: nextCollateralAmount, - minCollateralUsd, - pendingBorrowingFeesUsd: 0n, // deducted on order - pendingFundingFeesUsd: 0n, // deducted on order - isLong: isLong, - userReferralInfo, - }); - - return { - nextSizeUsd, - nextCollateralUsd, - nextEntryPrice, - nextLeverage, - nextLiqPrice, - }; -} +export * from "sdk/utils/trade/increase"; diff --git a/src/domain/synthetics/trade/utils/index.ts b/src/domain/synthetics/trade/utils/index.ts index ce50ea3aee..9998aa6a2d 100644 --- a/src/domain/synthetics/trade/utils/index.ts +++ b/src/domain/synthetics/trade/utils/index.ts @@ -1,9 +1,9 @@ export * from "sdk/utils/swap/swapRouting"; export * from "sdk/utils/swap/swapStats"; -export * from "./swap"; +export * from "sdk/utils/trade/decrease"; +export * from "./common"; export * from "./increase"; -export * from "./decrease"; export * from "./prices"; -export * from "./common"; +export * from "./swap"; export * from "sdk/utils/trade"; diff --git a/src/domain/synthetics/trade/utils/warnings.ts b/src/domain/synthetics/trade/utils/warnings.ts index 3981ffc52e..9081c342ba 100644 --- a/src/domain/synthetics/trade/utils/warnings.ts +++ b/src/domain/synthetics/trade/utils/warnings.ts @@ -4,21 +4,25 @@ import { bigMath } from "sdk/utils/bigmath"; import type { FeeItem } from "../../fees"; -export function getIsHighCollateralImpact(collateralImpact?: FeeItem) { +export function getIsHighCollateralImpact(collateralNetPriceImpact?: FeeItem) { return Boolean( - collateralImpact && collateralImpact.deltaUsd < 0 && bigMath.abs(collateralImpact.bps) >= HIGH_COLLATERAL_IMPACT_BPS + collateralNetPriceImpact && + collateralNetPriceImpact.deltaUsd < 0 && + bigMath.abs(collateralNetPriceImpact.bps) > HIGH_COLLATERAL_IMPACT_BPS ); } export function getIsHighSwapImpact(swapPriceImpact?: FeeItem) { return Boolean( - swapPriceImpact && swapPriceImpact.deltaUsd < 0 && bigMath.abs(swapPriceImpact.bps) >= HIGH_SWAP_IMPACT_BPS + swapPriceImpact && swapPriceImpact.deltaUsd < 0 && bigMath.abs(swapPriceImpact.bps) > HIGH_SWAP_IMPACT_BPS ); } -export function getIsHighPositionImpact(positionImpact?: FeeItem) { +export function getIsHighPositionImpact(positionNetPriceImpact?: FeeItem) { return Boolean( - positionImpact && positionImpact.deltaUsd < 0 && bigMath.abs(positionImpact.bps) >= HIGH_POSITION_IMPACT_BPS + positionNetPriceImpact && + positionNetPriceImpact.deltaUsd < 0 && + bigMath.abs(positionNetPriceImpact.bps) > HIGH_POSITION_IMPACT_BPS ); } diff --git a/src/domain/synthetics/trade/utils/withdrawal.ts b/src/domain/synthetics/trade/utils/withdrawal.ts index fba35e6d92..02db0ff34b 100644 --- a/src/domain/synthetics/trade/utils/withdrawal.ts +++ b/src/domain/synthetics/trade/utils/withdrawal.ts @@ -78,10 +78,10 @@ export function getWithdrawalAmounts(p: { const longSwapFeeUsd = p.forShift ? 0n - : applyFactor(values.longTokenUsd, p.marketInfo.swapFeeFactorForNegativeImpact); + : applyFactor(values.longTokenUsd, p.marketInfo.swapFeeFactorForBalanceWasNotImproved); const shortSwapFeeUsd = p.forShift ? 0n - : applyFactor(values.shortTokenUsd, p.marketInfo.swapFeeFactorForNegativeImpact); + : applyFactor(values.shortTokenUsd, p.marketInfo.swapFeeFactorForBalanceWasNotImproved); const longUiFeeUsd = applyFactor(values.marketTokenUsd, uiFeeFactor); const shortUiFeeUsd = applyFactor(values.shortTokenUsd, uiFeeFactor); @@ -131,7 +131,7 @@ export function getWithdrawalAmounts(p: { if (!p.forShift) { values.swapFeeUsd = applyFactor( values.longTokenUsd + values.shortTokenUsd, - p.marketInfo.swapFeeFactorForNegativeImpact + p.marketInfo.swapFeeFactorForBalanceWasNotImproved ); } diff --git a/src/domain/synthetics/tradeHistory/useTradeHistory.ts b/src/domain/synthetics/tradeHistory/useTradeHistory.ts index 143cb587b6..b11076698c 100644 --- a/src/domain/synthetics/tradeHistory/useTradeHistory.ts +++ b/src/domain/synthetics/tradeHistory/useTradeHistory.ts @@ -317,6 +317,7 @@ export async function fetchTradeActions({ id eventName + srcChainId account marketAddress swapPath @@ -351,6 +352,8 @@ export async function fetchTradeActions({ shouldUnwrapNativeToken twapGroupId numberOfParts + totalImpactUsd + proportionalPendingImpactUsd reason reasonBytes diff --git a/src/domain/synthetics/userFeedback/useLpInterviewNotification.tsx b/src/domain/synthetics/userFeedback/useLpInterviewNotification.tsx index 01896c211c..842dbdffc5 100644 --- a/src/domain/synthetics/userFeedback/useLpInterviewNotification.tsx +++ b/src/domain/synthetics/userFeedback/useLpInterviewNotification.tsx @@ -4,7 +4,7 @@ import { toast } from "react-toastify"; import { HIGH_LIQUIDITY_FOR_FEEDBACK, TIME_SPENT_ON_EARN_PAGE_FOR_INVITATION_TOAST } from "config/constants"; import { LP_INTERVIEW_INVITATION_SHOWN_TIME_KEY } from "config/localStorage"; -import { selectChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; +import { selectChainId, selectSrcChainId } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { useSelector } from "context/SyntheticsStateContext/utils"; import { helperToast } from "lib/helperToast"; import { useLocalStorageSerializeKey } from "lib/localStorage"; @@ -16,7 +16,8 @@ import { getTotalGlvInfo, getTotalGmInfo } from "../markets/utils"; function useTotalProvidedLiquidityUsd() { const chainId = useSelector(selectChainId); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false, withGlv: true }); + const srcChainId = useSelector(selectSrcChainId); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: false, withGlv: true }); return useMemo(() => { const totalGmInfo = getTotalGmInfo(marketTokensData); diff --git a/src/domain/tokens/approveTokens.tsx b/src/domain/tokens/approveTokens.tsx index 9f8d46408f..b212b4873f 100644 --- a/src/domain/tokens/approveTokens.tsx +++ b/src/domain/tokens/approveTokens.tsx @@ -53,7 +53,7 @@ export async function approveTokens({ includeMessage, approveAmount, permitParams, -}: Params) { +}: Params): Promise { setIsApproving(true); if (approveAmount === undefined) { @@ -115,7 +115,7 @@ export async function approveTokens({ const contract = new ethers.Contract(tokenAddress, Token.abi, signer); const nativeToken = getNativeToken(chainId); const networkName = getChainName(chainId); - contract + return await contract .approve(spender, approveAmount ?? ethers.MaxUint256) .then(async (res) => { const txUrl = getExplorerUrl(chainId) + "tx/" + res.hash; diff --git a/src/domain/tokens/permitUtils.ts b/src/domain/tokens/permitUtils.ts index 1b6dffe8fb..b25c291207 100644 --- a/src/domain/tokens/permitUtils.ts +++ b/src/domain/tokens/permitUtils.ts @@ -7,6 +7,7 @@ import { WalletSigner } from "lib/wallets"; import { signTypedData, splitSignature } from "lib/wallets/signing"; import { abis } from "sdk/abis"; import ERC20PermitInterfaceAbi from "sdk/abis/ERC20PermitInterface.json"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getContract } from "sdk/configs/contracts"; import { DEFAULT_PERMIT_DEADLINE_DURATION } from "sdk/configs/express"; import { getToken } from "sdk/configs/tokens"; @@ -14,7 +15,7 @@ import { SignedTokenPermit } from "sdk/types/tokens"; import { nowInSeconds } from "sdk/utils/time"; export async function createAndSignTokenPermit( - chainId: number, + chainId: ContractsChainId, signer: WalletSigner, tokenAddress: string, spender: string, @@ -75,7 +76,7 @@ export function getIsPermitExpired(permit: SignedTokenPermit) { } export async function getTokenPermitParams( - chainId: number, + chainId: ContractsChainId, owner: string, tokenAddress: string, provider: ethers.Provider diff --git a/src/domain/tokens/useApproveTokens.tsx b/src/domain/tokens/useApproveTokens.tsx index c17f03a29a..c3ecdb17a0 100644 --- a/src/domain/tokens/useApproveTokens.tsx +++ b/src/domain/tokens/useApproveTokens.tsx @@ -2,8 +2,9 @@ import { useCallback } from "react"; import { useTokenPermitsContext } from "context/TokenPermitsContext/TokenPermitsContextProvider"; import { userAnalytics } from "lib/userAnalytics"; -import { TokenApproveClickEvent, TokenApproveResultEvent } from "lib/userAnalytics/types"; -import { WalletSigner } from "lib/wallets"; +import type { TokenApproveClickEvent, TokenApproveResultEvent } from "lib/userAnalytics/types"; +import type { WalletSigner } from "lib/wallets"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getContract } from "sdk/configs/contracts"; import { approveTokens as approveTokensFn } from "./approveTokens"; @@ -19,7 +20,7 @@ export function useApproveToken() { signer, allowPermit, }: { - chainId: number; + chainId: ContractsChainId; tokenAddress: string; signer: WalletSigner; allowPermit: boolean; diff --git a/src/domain/tokens/useInfoTokens.ts b/src/domain/tokens/useInfoTokens.ts index bda9e044d4..837350344f 100644 --- a/src/domain/tokens/useInfoTokens.ts +++ b/src/domain/tokens/useInfoTokens.ts @@ -8,6 +8,7 @@ import { contractFetcher } from "lib/contracts"; import { DEFAULT_MAX_USDG_AMOUNT, MAX_PRICE_DEVIATION_BASIS_POINTS, USDG_ADDRESS } from "lib/legacy"; import { expandDecimals } from "lib/numbers"; import { PRICES_UPDATE_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getV1Tokens, getWhitelistedV1Tokens } from "sdk/configs/tokens"; import { InfoTokens, Token, TokenInfo } from "sdk/types/tokens"; import { bigMath } from "sdk/utils/bigmath"; @@ -16,7 +17,7 @@ import { getSpread } from "./utils"; export function useInfoTokens( signer: Signer | undefined, - chainId: number, + chainId: ContractsChainId, active: boolean, tokenBalances?: bigint[], fundingRateInfo?: bigint[], diff --git a/src/domain/trade/useV1TradeParamsProcessor.ts b/src/domain/trade/useV1TradeParamsProcessor.ts index 8f33208fdb..b58aac90bc 100644 --- a/src/domain/trade/useV1TradeParamsProcessor.ts +++ b/src/domain/trade/useV1TradeParamsProcessor.ts @@ -104,7 +104,13 @@ export default function useV1TradeParamsProcessor({ updateTradeOptions, swapOpti prevTradeOptions.current = options; if (history.location.search) { - history.replace({ search: "" }); + const query = new URLSearchParams(history.location.search); + query.delete("from"); + query.delete("to"); + query.delete("market"); + query.delete("collateral"); + query.delete("mode"); + history.replace({ search: query.toString() }); prevTradeOptions.current = {}; } } diff --git a/src/domain/tradingview/DataFeed.ts b/src/domain/tradingview/DataFeed.ts index 894e88211a..6efe81d6d4 100644 --- a/src/domain/tradingview/DataFeed.ts +++ b/src/domain/tradingview/DataFeed.ts @@ -21,7 +21,7 @@ import { parseSymbolName, } from "domain/tradingview/utils"; import { parseError } from "lib/errors"; -import { LoadingFailedEvent, LoadingStartEvent, LoadingSuccessEvent, getRequestId, metrics } from "lib/metrics"; +import { getRequestId, LoadingFailedEvent, LoadingStartEvent, LoadingSuccessEvent, metrics } from "lib/metrics"; import { OracleFetcher } from "lib/oracleKeeperFetcher/types"; import { PauseableInterval } from "lib/PauseableInterval"; import { sleep } from "lib/sleep"; diff --git a/src/domain/vesting/useVestingData.ts b/src/domain/vesting/useVestingData.ts index 6fa0f93df4..8ec6e31525 100644 --- a/src/domain/vesting/useVestingData.ts +++ b/src/domain/vesting/useVestingData.ts @@ -1,23 +1,31 @@ import { useMemo } from "react"; import useSWR from "swr"; +import { zeroAddress } from "viem"; import { getContract } from "config/contracts"; import { useChainId } from "lib/chains"; import { contractFetcher } from "lib/contracts"; import { PLACEHOLDER_ACCOUNT, getVestingData } from "lib/legacy"; import useWallet from "lib/wallets/useWallet"; +import type { ContractName } from "sdk/configs/contracts"; export default function useVestingData(account?: string) { const { active } = useWallet(); const { chainId } = useChainId(); const readerAddress = getContract(chainId, "Reader"); - const vesterAddresses = ["GmxVester", "GlpVester", "AffiliateVester"] + const vesterAddresses = (["GmxVester", "GlpVester", "AffiliateVester"] satisfies ContractName[]) .map((contractName) => getContract(chainId, contractName)) .filter(Boolean); const { data: vestingInfo } = useSWR( - [`StakeV2:vestingInfo:${active}`, chainId, readerAddress, "getVestingInfo", account ?? PLACEHOLDER_ACCOUNT], + readerAddress !== zeroAddress && [ + `StakeV2:vestingInfo:${active}`, + chainId, + readerAddress, + "getVestingInfo", + account ?? PLACEHOLDER_ACCOUNT, + ], { fetcher: contractFetcher(undefined, "ReaderV2", [vesterAddresses.filter(Boolean)]), } diff --git a/src/img/bell.svg b/src/img/bell.svg index 4967ae5cc9..fa3e7148bd 100644 --- a/src/img/bell.svg +++ b/src/img/bell.svg @@ -1 +1 @@ - \ No newline at end of file + diff --git a/src/img/ic_arbitrum_sepolia_24.svg b/src/img/ic_arbitrum_sepolia_24.svg new file mode 100644 index 0000000000..85ed9e9e62 --- /dev/null +++ b/src/img/ic_arbitrum_sepolia_24.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/img/ic_base_24.svg b/src/img/ic_base_24.svg new file mode 100644 index 0000000000..a770ac1c2b --- /dev/null +++ b/src/img/ic_base_24.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/img/ic_sepolia_24.svg b/src/img/ic_sepolia_24.svg new file mode 100644 index 0000000000..3c82ed994d --- /dev/null +++ b/src/img/ic_sepolia_24.svg @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/img/ic_usdc.sg_24.svg b/src/img/ic_usdc.sg_24.svg new file mode 100644 index 0000000000..dd2f52ae09 --- /dev/null +++ b/src/img/ic_usdc.sg_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/img/ic_usdc.sg_40.svg b/src/img/ic_usdc.sg_40.svg new file mode 100644 index 0000000000..913f66e83b --- /dev/null +++ b/src/img/ic_usdc.sg_40.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/lib/chains/blockExplorers.tsx b/src/lib/chains/blockExplorers.tsx new file mode 100644 index 0000000000..14019d0a2e --- /dev/null +++ b/src/lib/chains/blockExplorers.tsx @@ -0,0 +1,36 @@ +import { arbitrumSepolia, base } from "viem/chains"; + +import { + AnyChainId, + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + getExplorerUrl, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, +} from "config/chains"; + +export const CHAIN_ID_TO_TX_URL_BUILDER: Record string> = { + [ARBITRUM]: (txId: string) => `${getExplorerUrl(ARBITRUM)}tx/${txId}`, + [AVALANCHE]: (txId: string) => `${getExplorerUrl(AVALANCHE)}tx/${txId}`, + [SOURCE_BASE_MAINNET]: (txId: string) => `${getExplorerUrl(SOURCE_BASE_MAINNET)}tx/${txId}`, + [SOURCE_OPTIMISM_SEPOLIA]: (txId: string) => `${getExplorerUrl(SOURCE_OPTIMISM_SEPOLIA)}tx/${txId}`, + [ARBITRUM_SEPOLIA]: (txId: string) => `${getExplorerUrl(ARBITRUM_SEPOLIA)}tx/${txId}`, + [AVALANCHE_FUJI]: (txId: string) => `${getExplorerUrl(AVALANCHE_FUJI)}tx/${txId}`, + [SOURCE_SEPOLIA]: (txId: string) => `${getExplorerUrl(SOURCE_SEPOLIA)}tx/${txId}`, + [BOTANIX]: (txId: string) => `${getExplorerUrl(BOTANIX)}tx/${txId}`, +}; + +export const CHAIN_ID_TO_EXPLORER_NAME: Record = { + [ARBITRUM]: "Arbiscan", + [AVALANCHE]: "Snowtrace", + [AVALANCHE_FUJI]: "Snowtrace", + [ARBITRUM_SEPOLIA]: arbitrumSepolia.blockExplorers.default.name, + [SOURCE_BASE_MAINNET]: base.blockExplorers.default.name, + [SOURCE_OPTIMISM_SEPOLIA]: "OP Sepolia Etherscan", + [SOURCE_SEPOLIA]: "Sepolia Etherscan", + [BOTANIX]: "Botanix Explorer", +}; diff --git a/src/lib/chains/index.ts b/src/lib/chains/index.ts index 5c0ae0c404..7dc533cb2b 100644 --- a/src/lib/chains/index.ts +++ b/src/lib/chains/index.ts @@ -1,75 +1,5 @@ -import { watchAccount } from "@wagmi/core"; -import { useEffect, useState } from "react"; -import { useAccount } from "wagmi"; +import { useChainContext } from "context/ChainContext/ChainContext"; -import { DEFAULT_CHAIN_ID, isSupportedChain } from "config/chains"; -import { isDevelopment } from "config/env"; -import { SELECTED_NETWORK_LOCAL_STORAGE_KEY } from "config/localStorage"; -import { getRainbowKitConfig } from "lib/wallets/rainbowKitConfig"; - -/** - * This returns default chainId if chainId is not supported or not found - */ export function useChainId() { - let { chainId: unsanitizedChainId } = useAccount(); - - const [displayedChainId, setDisplayedChainId] = useState(unsanitizedChainId ?? DEFAULT_CHAIN_ID); - - const chainIdFromLocalStorage = parseInt(localStorage.getItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY) || ""); - - const currentChainIdIsSupported = unsanitizedChainId && isSupportedChain(unsanitizedChainId, isDevelopment()); - const localStorageChainIdIsSupported = - chainIdFromLocalStorage && isSupportedChain(chainIdFromLocalStorage, isDevelopment()); - - const mustChangeChainId = !currentChainIdIsSupported || !unsanitizedChainId; - - useEffect(() => { - if (currentChainIdIsSupported) { - setDisplayedChainId(unsanitizedChainId); - return; - } - if (localStorageChainIdIsSupported) { - setDisplayedChainId(chainIdFromLocalStorage); - return; - } - - setDisplayedChainId(DEFAULT_CHAIN_ID); - }, [unsanitizedChainId, chainIdFromLocalStorage, currentChainIdIsSupported, localStorageChainIdIsSupported]); - - useEffect(() => { - if (mustChangeChainId) { - if (localStorageChainIdIsSupported) { - setDisplayedChainId(chainIdFromLocalStorage); - } else { - setDisplayedChainId(DEFAULT_CHAIN_ID); - localStorage.removeItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY); - } - } - }, [chainIdFromLocalStorage, localStorageChainIdIsSupported, mustChangeChainId]); - - useEffect(() => { - const unsubscribe = watchAccount(getRainbowKitConfig(), { - onChange: (account) => { - if (!account.chainId) return; - if (!isSupportedChain(account.chainId, isDevelopment())) return; - - setDisplayedChainId(account.chainId); - localStorage.setItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY, account.chainId.toString()); - }, - }); - - return () => { - unsubscribe(); - }; - }, []); - - if (mustChangeChainId) { - if (localStorageChainIdIsSupported) { - return { chainId: chainIdFromLocalStorage }; - } - - return { chainId: DEFAULT_CHAIN_ID }; - } - - return { chainId: displayedChainId, isConnectedToChainId: displayedChainId === unsanitizedChainId }; + return useChainContext(); } diff --git a/src/lib/chains/useChainIdImpl.ts b/src/lib/chains/useChainIdImpl.ts new file mode 100644 index 0000000000..8e569147a2 --- /dev/null +++ b/src/lib/chains/useChainIdImpl.ts @@ -0,0 +1,185 @@ +import { watchAccount } from "@wagmi/core"; +import { useEffect, useRef, useState } from "react"; +import { useAccount } from "wagmi"; + +import { + type ContractsChainId, + type SettlementChainId, + type SourceChainId, + ARBITRUM, + ARBITRUM_SEPOLIA, + isContractsChain, +} from "config/chains"; +import { isDevelopment } from "config/env"; +import { SELECTED_NETWORK_LOCAL_STORAGE_KEY } from "config/localStorage"; +import { isSettlementChain, isSourceChain } from "config/multichain"; +import { getRainbowKitConfig } from "lib/wallets/rainbowKitConfig"; + +const IS_DEVELOPMENT = isDevelopment(); + +let INITIAL_CHAIN_ID: ContractsChainId; +if (IS_DEVELOPMENT) { + INITIAL_CHAIN_ID = ARBITRUM_SEPOLIA; +} else { + INITIAL_CHAIN_ID = ARBITRUM; +} + +/** + * This returns default chainId if chainId is not supported or not found + */ +export function useChainIdImpl(settlementChainId: SettlementChainId): { + chainId: ContractsChainId; + isConnectedToChainId?: boolean; + srcChainId?: SourceChainId; +} { + let { chainId: connectedChainId } = useAccount(); + + const [displayedChainId, setDisplayedChainId] = useState(connectedChainId ?? INITIAL_CHAIN_ID); + const rawChainIdFromLocalStorage = localStorage.getItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY); + const chainIdFromLocalStorage = rawChainIdFromLocalStorage ? parseInt(rawChainIdFromLocalStorage) : undefined; + + const possibleSrcChainId = connectedChainId ?? chainIdFromLocalStorage; + let srcChainId: SourceChainId | undefined = undefined; + if (possibleSrcChainId && isSourceChain(possibleSrcChainId) && !isSettlementChain(possibleSrcChainId)) { + srcChainId = possibleSrcChainId; + } + + const isCurrentChainSupported = connectedChainId && isContractsChain(connectedChainId, IS_DEVELOPMENT); + const isCurrentChainSource = connectedChainId && isSourceChain(connectedChainId); + + const isLocalStorageChainSupported = + chainIdFromLocalStorage && isContractsChain(chainIdFromLocalStorage, IS_DEVELOPMENT); + const isLocalStorageChainSource = chainIdFromLocalStorage && isSourceChain(chainIdFromLocalStorage); + + const mustChangeChainId = !connectedChainId || (!isCurrentChainSource && !isCurrentChainSupported); + + const connectedRef = useRef(false); + useEffect(() => { + if (chainIdFromLocalStorage || connectedRef.current) { + return; + } + + connectedRef.current = true; + + const connectHandler = (connectInfo: { chainId: string }) => { + const rawChainId = parseInt(connectInfo.chainId); + if (isContractsChain(rawChainId, IS_DEVELOPMENT) || isSourceChain(rawChainId)) { + setDisplayedChainId(rawChainId); + localStorage.setItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY, rawChainId.toString()); + } + }; + + window.ethereum?.on("connect", connectHandler); + return () => { + window.ethereum?.removeListener("connect", connectHandler); + }; + }, [chainIdFromLocalStorage]); + + useEffect(() => { + if (isCurrentChainSupported) { + setDisplayedChainId(connectedChainId); + return; + } + + if (isCurrentChainSource) { + setDisplayedChainId(settlementChainId); + return; + } + + if (isLocalStorageChainSupported) { + setDisplayedChainId(chainIdFromLocalStorage); + return; + } + + if (isLocalStorageChainSource) { + setDisplayedChainId(settlementChainId); + return; + } + + setDisplayedChainId(INITIAL_CHAIN_ID); + }, [ + chainIdFromLocalStorage, + isCurrentChainSource, + isCurrentChainSupported, + isLocalStorageChainSource, + isLocalStorageChainSupported, + settlementChainId, + connectedChainId, + ]); + + useEffect(() => { + if (!mustChangeChainId) { + return; + } + if (isLocalStorageChainSupported) { + setDisplayedChainId(chainIdFromLocalStorage); + return; + } + + if (isLocalStorageChainSource) { + setDisplayedChainId(settlementChainId); + return; + } + + setDisplayedChainId(INITIAL_CHAIN_ID); + localStorage.removeItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY); + }, [ + chainIdFromLocalStorage, + settlementChainId, + isLocalStorageChainSource, + isLocalStorageChainSupported, + mustChangeChainId, + ]); + + useEffect(() => { + const unsubscribe = watchAccount(getRainbowKitConfig(), { + onChange: (account) => { + if (!account.chainId) { + return; + } + if ( + !isSourceChain(account.chainId) && + !isContractsChain(account.chainId, IS_DEVELOPMENT) && + !isSettlementChain(account.chainId) + ) { + return; + } + + setDisplayedChainId(account.chainId); + localStorage.setItem(SELECTED_NETWORK_LOCAL_STORAGE_KEY, account.chainId.toString()); + }, + }); + + return unsubscribe; + }, []); + + if (mustChangeChainId) { + if (isLocalStorageChainSupported) { + return { chainId: chainIdFromLocalStorage as SettlementChainId, srcChainId }; + } + + if (isLocalStorageChainSource) { + return { chainId: settlementChainId, srcChainId }; + } + + return { chainId: INITIAL_CHAIN_ID, srcChainId }; + } + + if (isCurrentChainSupported) { + return { + chainId: connectedChainId as ContractsChainId, + isConnectedToChainId: displayedChainId === connectedChainId, + srcChainId, + }; + } + + if (isCurrentChainSource) { + return { + chainId: settlementChainId as SettlementChainId, + isConnectedToChainId: true, + srcChainId, + }; + } + + return { chainId: INITIAL_CHAIN_ID, isConnectedToChainId: false, srcChainId }; +} diff --git a/src/lib/contracts/callContract.tsx b/src/lib/contracts/callContract.tsx index 609f0d1418..1953e2b2b0 100644 --- a/src/lib/contracts/callContract.tsx +++ b/src/lib/contracts/callContract.tsx @@ -111,7 +111,8 @@ export async function callContract( async function retrieveGasLimit() { return customGasLimits[i] !== undefined ? (customGasLimits[i] as bigint | number) - : await getGasLimit(cntrct, method, params, opts.value); + : // here + await getGasLimit(cntrct, method, params, opts.value); } async function retrieveGasPrice() { diff --git a/src/lib/contracts/utils.ts b/src/lib/contracts/utils.ts index ee9099a322..20266a0299 100644 --- a/src/lib/contracts/utils.ts +++ b/src/lib/contracts/utils.ts @@ -28,7 +28,7 @@ export async function getGasLimit( } if (gasLimit < 22000) { - gasLimit = 22000n; + gasLimit = 220000n; } return (gasLimit * 11n) / 10n; // add a 10% buffer diff --git a/src/lib/dates.ts b/src/lib/dates.ts index c90fadb434..a71b2bd7b8 100644 --- a/src/lib/dates.ts +++ b/src/lib/dates.ts @@ -1,4 +1,5 @@ -import { format as formatDateFn, set as setTime } from "date-fns"; +import { t } from "@lingui/macro"; +import { format as formatDateFn, isToday, isYesterday, set as setTime } from "date-fns"; import { useMemo, useState } from "react"; export function formatDateTime(time: number) { @@ -9,6 +10,22 @@ export function formatDate(time: number) { return formatDateFn(time * 1000, "dd MMM yyyy"); } +export function formatDateWithComma(time: number) { + return formatDateFn(time * 1000, "MMM dd, yyyy"); +} + +export function formatRelativeDateWithComma(time: number) { + if (isToday(time * 1000)) { + return t`Today`; + } + + if (isYesterday(time * 1000)) { + return t`Yesterday`; + } + + return formatDateWithComma(time); +} + export function formatTVDate(date: Date) { return formatDateFn(date, "dd MMM yyyy"); } diff --git a/src/lib/useDebounce.ts b/src/lib/debounce/useDebounce.ts similarity index 100% rename from src/lib/useDebounce.ts rename to src/lib/debounce/useDebounce.ts diff --git a/src/lib/useDebouncedInputValue.ts b/src/lib/debounce/useDebouncedInputValue.ts similarity index 100% rename from src/lib/useDebouncedInputValue.ts rename to src/lib/debounce/useDebouncedInputValue.ts diff --git a/src/lib/debounce/useLeadingDebounde.ts b/src/lib/debounce/useLeadingDebounde.ts new file mode 100644 index 0000000000..41b0358f63 --- /dev/null +++ b/src/lib/debounce/useLeadingDebounde.ts @@ -0,0 +1,17 @@ +// eslint-disable-next-line no-restricted-imports +import { type DebouncedFuncLeading } from "lodash"; +import debounce from "lodash/debounce"; +import identity from "lodash/identity"; +import { useMemo } from "react"; + +export function useLeadingDebounce(value: T): T { + const leadingDebounce: DebouncedFuncLeading<(value: T) => T> = useMemo(() => { + return debounce(identity, 100, { + leading: true, + trailing: true, + maxWait: 1000, + }); + }, []); + + return leadingDebounce(value); +} diff --git a/src/lib/gas/estimateGasLimit.ts b/src/lib/gas/estimateGasLimit.ts index cf9f1650e6..27df311180 100644 --- a/src/lib/gas/estimateGasLimit.ts +++ b/src/lib/gas/estimateGasLimit.ts @@ -1,4 +1,4 @@ -import { Provider } from "ethers"; +import type { Provider } from "ethers"; import { extendError } from "lib/errors"; diff --git a/src/lib/legacy.ts b/src/lib/legacy.ts index b09111eea2..2ebe10ef4a 100644 --- a/src/lib/legacy.ts +++ b/src/lib/legacy.ts @@ -5,7 +5,7 @@ import useSWR from "swr"; import { useEnsName } from "wagmi"; import { getServerBaseUrl } from "config/backend"; -import { CHAIN_ID, ETH_MAINNET, getExplorerUrl } from "config/chains"; +import { CHAIN_ID, ETH_MAINNET, getExplorerUrl, ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { isLocal } from "config/env"; import { BASIS_POINTS_DIVISOR, BASIS_POINTS_DIVISOR_BIGINT, USD_DECIMALS } from "config/factors"; @@ -880,7 +880,7 @@ export function getOrderKey(order) { export function useAccountOrders( flagOrdersEnabled: boolean, overrideAccount?: string, - overrideChainId?: number, + overrideChainId?: ContractsChainId, overrideSigner?: ethers.JsonRpcSigner, overrideActive?: boolean ) { @@ -984,7 +984,7 @@ export function useAccountOrders( return [orders, updateOrders, ordersError]; } -export function getAccountUrl(chainId, account) { +export function getAccountUrl(chainId: number, account: string) { if (!account) { return getExplorerUrl(chainId); } diff --git a/src/lib/metrics/types.ts b/src/lib/metrics/types.ts index 5d2b87e4a0..e33ab68d50 100644 --- a/src/lib/metrics/types.ts +++ b/src/lib/metrics/types.ts @@ -1,8 +1,9 @@ -import { DecreasePositionSwapType, OrderType } from "domain/synthetics/orders"; -import { MissedCoinsPlace } from "domain/synthetics/userFeedback"; -import { ErrorData } from "lib/errors"; -import { TradeMode } from "sdk/types/trade"; -import { TwapDuration } from "sdk/types/twap"; +import type { SourceChainId } from "config/chains"; +import type { DecreasePositionSwapType, OrderType } from "domain/synthetics/orders"; +import type { MissedCoinsPlace } from "domain/synthetics/userFeedback"; +import type { ErrorData } from "lib/errors"; +import type { TradeMode } from "sdk/types/trade"; +import type { TwapDuration } from "sdk/types/twap"; export type GlobalMetricData = { isMobileMetamask: boolean; @@ -54,7 +55,9 @@ export type OrderMetricType = | EditCollateralMetricData["metricType"] | SwapGmMetricData["metricType"] | SwapGLVMetricData["metricType"] - | ShiftGmMetricData["metricType"]; + | ShiftGmMetricData["metricType"] + | MultichainDepositMetricData["metricType"] + | MultichainWithdrawalMetricData["metricType"]; export type OrderEventName = `${OrderMetricType}.${OrderStage}`; export type MeasureEventName = `${MeasureMetricType}.${LoadingStage}`; @@ -68,7 +71,9 @@ export type OrderMetricData = | EditCollateralMetricData | SwapGmMetricData | SwapGLVMetricData - | ShiftGmMetricData; + | ShiftGmMetricData + | MultichainDepositMetricData + | MultichainWithdrawalMetricData; // General metrics export type OpenAppEvent = { @@ -107,6 +112,22 @@ export type WsProviderHealthCheckFailed = { }; }; +export type WsSourceChainProviderConnected = { + event: "wsSourceChainProvider.connected"; + isError: false; + data: { + chainId: SourceChainId; + }; +}; + +export type WsSourceChainProviderDisconnected = { + event: "wsSourceChainProvider.disconnected"; + isError: false; + data: { + chainId: SourceChainId; + }; +}; + // Loading measurements export type LoadingStartEvent = { event: `${MeasureMetricType}.${LoadingStage.Started}`; @@ -303,6 +324,8 @@ export type SwapMetricData = { partsCount: number | undefined; tradeMode: TradeMode | undefined; expressData: ExpressOrderMetricData | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }; export type IncreaseOrderMetricData = PositionOrderMetricParams & { @@ -365,6 +388,8 @@ export type PositionOrderMetricParams = { partsCount: number | undefined; tradeMode: TradeMode | undefined; expressData: ExpressOrderMetricData | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }; export type EditCollateralMetricData = { @@ -384,6 +409,8 @@ export type EditCollateralMetricData = { orderType: OrderType | undefined; executionFee: number | undefined; expressData: ExpressOrderMetricData | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }; export type SwapGmMetricData = { @@ -520,3 +547,34 @@ export type GetFeeDataBlockError = { export type SetAutoCloseOrdersAction = { event: "announcement.autoCloseOrders.updateExistingOrders"; }; + +type MultichainFundingParams = { + sourceChain: number; + settlementChain: number; + assetSymbol: string; + sizeInUsd: number; +}; + +export type MultichainDepositMetricData = MultichainFundingParams & { + metricId: `multichainDeposit:${string}`; + metricType: "multichainDeposit"; + isFirstDeposit: boolean; +}; + +export type MultichainWithdrawalMetricData = MultichainFundingParams & { + metricId: `multichainWithdrawal:${string}`; + metricType: "multichainWithdrawal"; + isFirstWithdrawal: boolean; +}; + +export type MultichainDepositEvent = { + event: "multichainDeposit"; + isError: false; + data: MultichainDepositMetricData; +}; + +export type MultichainWithdrawalEvent = { + event: "multichainWithdrawal"; + isError: false; + data: MultichainWithdrawalMetricData; +}; diff --git a/src/lib/metrics/utils.ts b/src/lib/metrics/utils.ts index 3f4879180b..2d1f856009 100644 --- a/src/lib/metrics/utils.ts +++ b/src/lib/metrics/utils.ts @@ -18,6 +18,8 @@ import { EditCollateralMetricData, ExpressOrderMetricData, IncreaseOrderMetricData, + MultichainDepositMetricData, + MultichainWithdrawalMetricData, OrderCancelledEvent, OrderCreatedEvent, OrderExecutedEvent, @@ -97,6 +99,8 @@ export function initSwapMetricData({ expressParams, asyncExpressParams, fastExpressParams, + chainId, + isCollateralFromMultichain, }: { fromToken: TokenData | undefined; toToken: TokenData | undefined; @@ -117,6 +121,8 @@ export function initSwapMetricData({ expressParams: ExpressTxnParams | undefined; asyncExpressParams: ExpressTxnParams | undefined; fastExpressParams: ExpressTxnParams | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }) { let metricType: SwapMetricData["metricType"] = "swap"; if (tradeMode === TradeMode.Twap) { @@ -164,6 +170,8 @@ export function initSwapMetricData({ partsCount, tradeMode, expressData, + chainId, + isCollateralFromMultichain, }); } @@ -199,6 +207,8 @@ export function initIncreaseOrderMetricData({ expressParams, asyncExpressParams, fastExpressParams, + chainId, + isCollateralFromMultichain, }: { fromToken: TokenData | undefined; increaseAmounts: IncreasePositionAmounts | undefined; @@ -232,6 +242,8 @@ export function initIncreaseOrderMetricData({ expressParams: ExpressTxnParams | undefined; asyncExpressParams: ExpressTxnParams | undefined; fastExpressParams: ExpressTxnParams | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }) { let metricType: IncreaseOrderMetricData["metricType"] = "increasePosition"; if (orderType === OrderType.LimitIncrease) { @@ -268,7 +280,7 @@ export function initIncreaseOrderMetricData({ initialCollateralBalance: fromToken?.balance?.toString(), initialCollateralSymbol: fromToken?.symbol, initialCollateralDeltaAmount: formatAmountForMetrics(increaseAmounts?.initialCollateralAmount, fromToken?.decimals), - swapPath: increaseAmounts?.swapStrategy.swapPathStats?.swapPath || [], + swapPath: increaseAmounts?.swapStrategy.swapPathStats?.swapPath || [], sizeDeltaUsd: formatAmountForMetrics(increaseAmounts?.sizeDeltaUsd), sizeDeltaInTokens: formatAmountForMetrics(increaseAmounts?.sizeDeltaInTokens, marketInfo?.indexToken.decimals), triggerPrice: formatAmountForMetrics(triggerPrice, USD_DECIMALS, false), @@ -305,6 +317,8 @@ export function initIncreaseOrderMetricData({ partsCount, tradeMode, expressData: getExpressMetricData({ expressParams, asyncExpressParams, fastExpressParams }), + chainId, + isCollateralFromMultichain, }); } @@ -334,6 +348,8 @@ export function initDecreaseOrderMetricData({ expressParams, asyncExpressParams, fastExpressParams, + chainId, + isCollateralFromMultichain, }: { collateralToken: TokenData | undefined; decreaseAmounts: DecreasePositionAmounts | undefined; @@ -361,6 +377,8 @@ export function initDecreaseOrderMetricData({ expressParams: ExpressTxnParams | undefined; asyncExpressParams: ExpressTxnParams | undefined; fastExpressParams: ExpressTxnParams | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }) { let metricType: DecreaseOrderMetricData["metricType"] = "decreasePosition"; if (orderType === OrderType.LimitDecrease) { @@ -418,6 +436,8 @@ export function initDecreaseOrderMetricData({ partsCount, tradeMode, expressData: getExpressMetricData({ expressParams, asyncExpressParams, fastExpressParams }), + chainId, + isCollateralFromMultichain, }); } @@ -434,6 +454,8 @@ export function initEditCollateralMetricData({ expressParams, asyncExpressParams, fastExpressParams, + chainId, + isCollateralFromMultichain, }: { collateralToken: TokenData | undefined; executionFee: ExecutionFee | undefined; @@ -447,6 +469,8 @@ export function initEditCollateralMetricData({ expressParams: ExpressTxnParams | undefined; asyncExpressParams: ExpressTxnParams | undefined; fastExpressParams: ExpressTxnParams | undefined; + chainId: number; + isCollateralFromMultichain: boolean; }) { return metrics.setCachedMetricData({ metricId: getPositionOrderMetricId({ @@ -473,6 +497,8 @@ export function initEditCollateralMetricData({ isExpress1CT: Boolean(subaccount), requestId: getRequestId(), expressData: getExpressMetricData({ expressParams, asyncExpressParams, fastExpressParams }), + chainId, + isCollateralFromMultichain, }); } @@ -631,6 +657,62 @@ export function initShiftGmMetricData({ }); } +export function initMultichainDepositMetricData({ + sourceChain, + settlementChain, + assetSymbol, + sizeInUsd, + isFirstDeposit, +}: { + sourceChain: number; + settlementChain: number; + assetSymbol: string; + sizeInUsd: bigint; + isFirstDeposit: boolean; +}) { + return metrics.setCachedMetricData({ + metricId: getMultichainDepositMetricId({ + sourceChain, + settlementChain, + assetSymbol, + }), + metricType: "multichainDeposit", + sourceChain, + settlementChain, + assetSymbol, + sizeInUsd: formatAmountForMetrics(sizeInUsd)!, + isFirstDeposit, + }); +} + +export function initMultichainWithdrawalMetricData({ + sourceChain, + settlementChain, + assetSymbol, + isFirstWithdrawal, + sizeInUsd, +}: { + sourceChain: number; + settlementChain: number; + assetSymbol: string; + isFirstWithdrawal: boolean; + sizeInUsd: bigint; +}) { + return metrics.setCachedMetricData({ + metricId: getMultichainWithdrawalMetricId({ + sourceChain, + settlementChain, + assetSymbol, + }), + metricType: "multichainWithdrawal", + sourceChain, + settlementChain, + assetSymbol, + sizeInUsd: formatAmountForMetrics(sizeInUsd)!, + isFirstWithdrawal, + }); +} + export function getGMSwapMetricId(p: { marketAddress: string | undefined; executionFee: bigint | undefined; @@ -685,6 +767,22 @@ export function getPositionOrderMetricId(p: { ].join(":")}`; } +export function getMultichainDepositMetricId(p: { + sourceChain: number; + settlementChain: number; + assetSymbol: string; +}): MultichainDepositMetricData["metricId"] { + return `multichainDeposit:${[p.sourceChain, p.settlementChain, p.assetSymbol].join(":")}`; +} + +export function getMultichainWithdrawalMetricId(p: { + sourceChain: number; + settlementChain: number; + assetSymbol: string; +}): MultichainWithdrawalMetricData["metricId"] { + return `multichainWithdrawal:${[p.sourceChain, p.settlementChain, p.assetSymbol].join(":")}`; +} + export function sendOrderSubmittedMetric(metricId: OrderMetricId) { const metricData = metrics.getCachedMetricData(metricId); diff --git a/src/lib/multicall/Multicall.ts b/src/lib/multicall/Multicall.ts index a478917fe6..f79bdd0c01 100644 --- a/src/lib/multicall/Multicall.ts +++ b/src/lib/multicall/Multicall.ts @@ -2,7 +2,7 @@ import { Chain, createPublicClient, http } from "viem"; import { getViemChain } from "config/chains"; import { isWebWorker } from "config/env"; -import { +import type { MulticallErrorEvent, MulticallFallbackRpcModeCounter, MulticallRequestCounter, @@ -10,15 +10,14 @@ import { MulticallTimeoutEvent, } from "lib/metrics"; import { emitMetricCounter, emitMetricEvent, emitMetricTiming } from "lib/metrics/emitMetricEvent"; +import type { MulticallRequestConfig, MulticallResult } from "lib/multicall/types"; +import { serializeMulticallErrors } from "lib/multicall/utils"; import { getProviderNameFromUrl } from "lib/rpc/getProviderNameFromUrl"; import { sleep } from "lib/sleep"; import { SlidingWindowFallbackSwitcher } from "lib/slidingWindowFallbackSwitcher"; -import { abis as allAbis } from "sdk/abis"; +import { AbiId, abis as allAbis } from "sdk/abis"; import { BATCH_CONFIGS } from "sdk/configs/batch"; -import type { MulticallRequestConfig, MulticallResult } from "./types"; -import { serializeMulticallErrors } from "./utils"; - export const MAX_TIMEOUT = 20000; export type MulticallProviderUrls = { @@ -98,7 +97,7 @@ export class Multicall { callKey: string; }[] = []; - const abis: any = {}; + const abiWithErrorsMap: Partial> = {}; const encodedPayload: { address: string; abi: any; functionName: string; args: any }[] = []; @@ -119,12 +118,11 @@ export class Multicall { } // Add Errors ABI to each contract ABI to correctly parse errors - abis[contractCallConfig.contractAddress] = abis[contractCallConfig.contractAddress] || [ - ...allAbis[contractCallConfig.abiId], - ...allAbis.CustomErrors, - ]; + if (!abiWithErrorsMap[contractCallConfig.abiId]) { + abiWithErrorsMap[contractCallConfig.abiId] = [...allAbis[contractCallConfig.abiId], ...allAbis.CustomErrors]; + } - const abi = abis[contractCallConfig.contractAddress]; + const abi = abiWithErrorsMap[contractCallConfig.abiId]; originalKeys.push({ contractKey, diff --git a/src/lib/multicall/executeMulticall.ts b/src/lib/multicall/executeMulticall.ts index 6d8e0c6e03..4a0d6b3118 100644 --- a/src/lib/multicall/executeMulticall.ts +++ b/src/lib/multicall/executeMulticall.ts @@ -14,7 +14,7 @@ import { debugLog, getIsMulticallBatchingDisabled } from "./debug"; import { executeMulticallMainThread } from "./executeMulticallMainThread"; import { executeMulticallWorker } from "./executeMulticallWorker"; import type { ContractCallResult, MulticallError, MulticallRequestConfig, MulticallResult } from "./types"; -import { getCallId } from "./utils"; +import { getCallId, getContractAbiKey } from "./utils"; type CallResultHandler = ( destination: { @@ -112,8 +112,9 @@ async function executeChainMulticall(chainId: number, calls: MulticallFetcherCon if (combinedResults) { for (const call of values(calls)) { - const callResult = combinedResults.data[call.callData.contractAddress]?.[call.callData.callId]; - const callError = combinedResults.errors[call.callData.contractAddress]?.[call.callData.callId]; + const contractAbiKey = getContractAbiKey(call.callData.contractAddress, call.callData.abiId); + const callResult = combinedResults.data[contractAbiKey]?.[call.callData.callId]; + const callError = combinedResults.errors[contractAbiKey]?.[call.callData.callId]; for (const handler of Object.values(call.handlers)) { for (const destination of handler.destinations) { @@ -191,7 +192,7 @@ export function executeMulticall>( // There are two main reasons for this: // 1. Single token backed pools have many pairs with the same method signatures // 2. The majority of pools have USDC as the short token, which means they all have some common calls - const callId = getCallId(callGroup.contractAddress, call.methodName, call.params); + const callId = getCallId(callGroup.contractAddress, callGroup.abiId, call.methodName, call.params); if (!store.current[chainId]) { store.current[chainId] = {}; @@ -284,23 +285,23 @@ function combineCallResults(batchedResponsesOrFailures: (MulticallResult | acc.success = acc.success && result.success; - for (const [contractAddress, contractResult] of entries(result.errors)) { - if (acc.errors[contractAddress]) { + for (const [contractAbiKey, contractResult] of entries(result.errors)) { + if (acc.errors[contractAbiKey]) { for (const [callId, callResult] of entries(contractResult)) { - acc.errors[contractAddress][callId] = callResult; + acc.errors[contractAbiKey][callId] = callResult; } } else { - acc.errors[contractAddress] = contractResult; + acc.errors[contractAbiKey] = contractResult; } } - for (const [contractAddress, contractResult] of entries(result.data)) { - if (acc.data[contractAddress]) { + for (const [contractAbiKey, contractResult] of entries(result.data)) { + if (acc.data[contractAbiKey]) { for (const [callId, callResult] of entries(contractResult)) { - acc.data[contractAddress][callId] = callResult; + acc.data[contractAbiKey][callId] = callResult; } } else { - acc.data[contractAddress] = contractResult; + acc.data[contractAbiKey] = contractResult; } } @@ -318,15 +319,16 @@ function getRequest(callEntries: [string, { callData: MulticallFetcherConfig[num const requests: MulticallRequestConfig = {}; for (const [callId, { callData }] of callEntries) { - if (!requests[callData.contractAddress]) { - requests[callData.contractAddress] = { + const contractAbiKey = getContractAbiKey(callData.contractAddress, callData.abiId); + if (!requests[contractAbiKey]) { + requests[contractAbiKey] = { abiId: callData.abiId, contractAddress: callData.contractAddress, calls: {}, }; } - requests[callData.contractAddress].calls[callId] = { + requests[contractAbiKey].calls[callId] = { methodName: callData.methodName, params: callData.params, }; diff --git a/src/lib/multicall/executeMulticallWorker.ts b/src/lib/multicall/executeMulticallWorker.ts index 92ac23080b..72bca072f4 100644 --- a/src/lib/multicall/executeMulticallWorker.ts +++ b/src/lib/multicall/executeMulticallWorker.ts @@ -9,7 +9,8 @@ import { getCurrentRpcUrls } from "lib/rpc/bestRpcTracker"; import { sleep } from "lib/sleep"; import { executeMulticallMainThread } from "./executeMulticallMainThread"; -import { MAX_TIMEOUT, MulticallProviderUrls } from "./Multicall"; +import { MulticallProviderUrls } from "./Multicall"; +import { MAX_TIMEOUT } from "./Multicall"; import type { MulticallRequestConfig, MulticallResult } from "./types"; const executorWorker: Worker = new Worker(new URL("./multicall.worker", import.meta.url), { type: "module" }); diff --git a/src/lib/multicall/useMulticall.ts b/src/lib/multicall/useMulticall.ts index ad1d2e0349..c14eddb71a 100644 --- a/src/lib/multicall/useMulticall.ts +++ b/src/lib/multicall/useMulticall.ts @@ -6,6 +6,7 @@ import { KeyedMutator, stableHash } from "swr/_internal"; import type { ErrorEvent } from "lib/metrics"; import { emitMetricEvent } from "lib/metrics/emitMetricEvent"; import type { SWRGCMiddlewareConfig } from "lib/swrMiddlewares"; +import { ContractsChainId, AnyChainId } from "sdk/configs/chains"; import { debugLog } from "./debug"; import { executeMulticall } from "./executeMulticall"; @@ -24,8 +25,12 @@ const mutateFlagsRef: { current: Record } = { current: {} }; * @param params.request - contract calls config or callback which returns it * @param params.parseResponse - optional callback to pre-process and format the response */ -export function useMulticall, TResult = MulticallResult>( - chainId: number, +export function useMulticall< + TConfig extends MulticallRequestConfig, + TResult = MulticallResult, + TChainId extends AnyChainId = ContractsChainId, +>( + chainId: TChainId | undefined, name: string, params: { key: CacheKey | SkipKey; @@ -33,8 +38,8 @@ export function useMulticall, TResul disableBatching?: boolean; clearUnusedKeys?: boolean; keepPreviousData?: boolean; - request: TConfig | ((chainId: number, key: CacheKey) => TConfig | Promise); - parseResponse?: (result: MulticallResult, chainId: number, key: CacheKey) => TResult; + request: TConfig | ((chainId: TChainId, key: CacheKey) => TConfig | Promise); + parseResponse?: (result: MulticallResult, chainId: TChainId, key: CacheKey) => TResult; } ) { const defaultConfig = useSWRConfig(); @@ -70,7 +75,7 @@ export function useMulticall, TResul // prettier-ignore request = typeof params.request === "function" - ? await params.request(chainId, params.key as CacheKey) + ? await params.request(chainId!, params.key as CacheKey) : params.request; debugLog(() => { @@ -97,7 +102,7 @@ export function useMulticall, TResul } else if (params.refreshInterval === undefined) { if (typeof defaultConfig.refreshInterval === "number") { isInterval = true; - } else if (hasData && defaultConfig.refreshInterval?.(successDataByChainIdRef.current[chainId])) { + } else if (hasData && defaultConfig.refreshInterval?.(successDataByChainIdRef.current[chainId!])) { isInterval = true; } } @@ -116,7 +121,7 @@ export function useMulticall, TResul startTime = Date.now(); }); - responseOrFailure = await executeMulticall(chainId, request, priority, name, params.disableBatching); + responseOrFailure = await executeMulticall(chainId!, request, priority, name, params.disableBatching); debugLog(() => { const endTime = Date.now(); @@ -127,12 +132,12 @@ export function useMulticall, TResul } if (responseOrFailure?.success) { - successDataByChainIdRef.current[chainId] = responseOrFailure; + successDataByChainIdRef.current[chainId!] = responseOrFailure; } else if (Object.keys(responseOrFailure.errors).length > 0) { throw new Error(`Response error ${serializeMulticallErrors(responseOrFailure.errors)}`); } - const response = successDataByChainIdRef.current[chainId]; + const response = successDataByChainIdRef.current[chainId!]; if (!response) { throw new Error(`Multicall response is empty`); @@ -140,7 +145,7 @@ export function useMulticall, TResul // prettier-ignore const result = typeof params.parseResponse === "function" - ? params.parseResponse(response, chainId, params.key as CacheKey) + ? params.parseResponse(response, chainId!, params.key as CacheKey) : response; return result as TResult; diff --git a/src/lib/multicall/utils.ts b/src/lib/multicall/utils.ts index d5c0ec88c8..447b1dc7a7 100644 --- a/src/lib/multicall/utils.ts +++ b/src/lib/multicall/utils.ts @@ -1,4 +1,6 @@ -import { MulticallErrors } from "./types"; +import type { AbiId } from "sdk/abis"; + +import type { MulticallErrors } from "./types"; export function serializeMulticallErrors(errors: MulticallErrors) { let errorString = ""; @@ -24,6 +26,18 @@ export function serializeMulticallErrors(errors: MulticallErrors) { return errorString; } -export function getCallId(contractAddress: string, methodName: string, params: any[]) { - return JSON.stringify([contractAddress, methodName, params]); +export function getCallId(contractAddress: string, abiId: AbiId, methodName: string, params: any[]) { + return JSON.stringify([contractAddress, abiId, methodName, params]); +} + +export function getContractAbiKey(contractAddress: string, abiId: AbiId) { + return `${contractAddress}-${abiId}`; +} + +export function parseContractAbiKey(contractAbiKey: string) { + const firstHyphenIndex = contractAbiKey.indexOf("-"); + const contractAddress = contractAbiKey.slice(0, firstHyphenIndex); + const abiId = contractAbiKey.slice(firstHyphenIndex + 1); + + return { contractAddress, abiId }; } diff --git a/src/lib/rpc/bestRpcTracker.ts b/src/lib/rpc/bestRpcTracker.ts index 0984f2fa54..9d5f0532e7 100644 --- a/src/lib/rpc/bestRpcTracker.ts +++ b/src/lib/rpc/bestRpcTracker.ts @@ -1,5 +1,5 @@ import { differenceInMilliseconds } from "date-fns"; -import { Provider, ethers } from "ethers"; +import { ethers, Provider } from "ethers"; import maxBy from "lodash/maxBy"; import minBy from "lodash/minBy"; import orderBy from "lodash/orderBy"; @@ -7,24 +7,25 @@ import { useEffect, useState } from "react"; import { Address } from "viem"; import { - RPC_PROVIDERS, - FALLBACK_PROVIDERS, - SUPPORTED_CHAIN_IDS, ARBITRUM, + ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, - getFallbackRpcUrl, - UiContractsChain, BOTANIX, + CONTRACTS_CHAIN_IDS, + ContractsChainId, + FALLBACK_PROVIDERS, + getFallbackRpcUrl, PRIVATE_RPC_PROVIDERS, + RPC_PROVIDERS, } from "config/chains"; -import { getMulticallContract, getDataStoreContract } from "config/contracts"; -import { getContract } from "config/contracts"; +import { getContract, getDataStoreContract, getMulticallContract } from "config/contracts"; import { getRpcProviderKey } from "config/localStorage"; import { getIsLargeAccount } from "domain/stats/isLargeAccount"; import { isDebugMode } from "lib/localStorage"; import { RpcTrackerRankingCounter } from "lib/metrics"; import { emitMetricCounter } from "lib/metrics/emitMetricEvent"; +import { EMPTY_OBJECT } from "lib/objects"; import { getProviderNameFromUrl } from "lib/rpc/getProviderNameFromUrl"; import { sleep } from "lib/sleep"; import { HASHED_MARKET_CONFIG_KEYS } from "sdk/prebuilt"; @@ -37,16 +38,17 @@ const DISABLE_UNUSED_TRACKING_TIMEOUT = 1 * 60 * 1000; // 1 minute / Pause probi const BLOCK_FROM_FUTURE_THRESHOLD = 1000; // Omit RPC if block number is higher than average on this value const BLOCK_LAGGING_THRESHOLD = 50; // Omit RPC if block number is lower than highest valid on this value -const RPC_TRACKER_UPDATE_EVENT = "rpc-tracker-update-event"; +export const RPC_TRACKER_UPDATE_EVENT = "rpc-tracker-update-event"; // DataStore field used for probing const PROBE_SAMPLE_FIELD = "minCollateralFactor"; // Markets used for `PROBE_SAMPLE_FIELD` reading -const PROBE_SAMPLE_MARKET: Record = { +const PROBE_SAMPLE_MARKET: Record = { [ARBITRUM]: "0x70d95587d40A2caf56bd97485aB3Eec10Bee6336", // ETH/USD [AVALANCHE]: "0xB7e69749E3d2EDd90ea59A4932EFEa2D41E245d7", // ETH/USD [AVALANCHE_FUJI]: "0xbf338a6C595f06B7Cfff2FA8c958d49201466374", // ETH/USD [BOTANIX]: "0x6682BB60590a045A956541B1433f016Ed22E361d", // STBTC-STBTC + [ARBITRUM_SEPOLIA]: "0xb6fC4C9eB02C35A134044526C62bb15014Ac0Bcc", // ETH/USD }; type ProbeData = { @@ -65,8 +67,8 @@ type ProviderData = { }; type RpcTrackerState = { - [chainId in UiContractsChain]: { - chainId: UiContractsChain; + [chainId in ContractsChainId]: { + chainId: ContractsChainId; lastUsage: Date | null; currentPrimaryUrl: string; currentSecondaryUrl: string; @@ -122,7 +124,7 @@ function trackRpcProviders({ warmUp = false } = {}) { }); } -async function getBestRpcProvidersForChain({ providers, chainId }: RpcTrackerState[UiContractsChain]) { +async function getBestRpcProvidersForChain({ providers, chainId }: RpcTrackerState[ContractsChainId]) { const providersList = Object.values(providers); const providersToProbe = getIsLargeAccount() ? providersList : providersList.filter(({ isPublic }) => isPublic); @@ -250,7 +252,7 @@ function setCurrentProviders(chainId: number, { primaryUrl, secondaryUrl, bestBe } async function probeRpc( - chainId: UiContractsChain, + chainId: ContractsChainId, provider: Provider, providerUrl: string, isPublic: boolean @@ -358,7 +360,7 @@ async function probeRpc( function initTrackerState() { const now = Date.now(); - return SUPPORTED_CHAIN_IDS.reduce((acc, chainId) => { + return CONTRACTS_CHAIN_IDS.reduce((acc, chainId) => { const prepareProviders = (urls: string[], { isPublic }: { isPublic: boolean }) => { return urls.reduce>((acc, rpcUrl) => { acc[rpcUrl] = { @@ -415,7 +417,7 @@ function initTrackerState() { }, {} as RpcTrackerState); } -export function getCurrentRpcUrls(chainId: number) { +export function getCurrentRpcUrls(chainId: number): { primary: string; secondary: string } { if (!RPC_PROVIDERS[chainId]?.length) { throw new Error(`No RPC providers found for chainId: ${chainId}`); } @@ -432,20 +434,27 @@ export function getCurrentRpcUrls(chainId: number) { return { primary, secondary }; } -export function useCurrentRpcUrls(chainId: number) { +export function useCurrentRpcUrls(chainId: number | undefined): { primary?: string; secondary?: string } { const [bestRpcUrls, setBestRpcUrls] = useState<{ - primary: string; + primary?: string; secondary?: string; - }>(() => getCurrentRpcUrls(chainId)); + }>(chainId ? () => getCurrentRpcUrls(chainId) : EMPTY_OBJECT); useEffect(() => { + if (!chainId) { + setBestRpcUrls(EMPTY_OBJECT); + return; + } + + const closureChainId = chainId; + let isMounted = true; - setBestRpcUrls(getCurrentRpcUrls(chainId)); + setBestRpcUrls(getCurrentRpcUrls(closureChainId)); function handleRpcUpdate() { if (isMounted) { - setBestRpcUrls(getCurrentRpcUrls(chainId)); + setBestRpcUrls(getCurrentRpcUrls(closureChainId)); } } diff --git a/src/lib/rpc/index.ts b/src/lib/rpc/index.ts index e24574f9d0..b5a6750565 100644 --- a/src/lib/rpc/index.ts +++ b/src/lib/rpc/index.ts @@ -1,16 +1,25 @@ -import { JsonRpcProvider, Network, Signer, WebSocketProvider, ethers } from "ethers"; +import { ethers, JsonRpcProvider, Network, Signer, WebSocketProvider } from "ethers"; import { useEffect, useMemo, useState } from "react"; import { + AnyChainId, ARBITRUM, + ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, FALLBACK_PROVIDERS, + getAlchemyArbitrumSepoliaWsUrl, getAlchemyArbitrumWsUrl, + getAlchemyBaseMainnetWsUrl, getAlchemyBotanixWsUrl, + getAlchemyOptimismSepoliaWsUrl, + getAlchemySepoliaWsUrl, getExpressRpcUrl, getFallbackRpcUrl, + SOURCE_BASE_MAINNET, + SOURCE_OPTIMISM_SEPOLIA, + SOURCE_SEPOLIA, } from "config/chains"; import { isDevelopment } from "config/env"; import { getIsLargeAccount } from "domain/stats/isLargeAccount"; @@ -33,7 +42,7 @@ export function getProvider(signer: Signer | undefined, chainId: number): ethers return new ethers.JsonRpcProvider(url, chainId, { staticNetwork: network }); } -export function getWsProvider(chainId: number): WebSocketProvider | JsonRpcProvider | undefined { +export function getWsProvider(chainId: AnyChainId): WebSocketProvider | JsonRpcProvider { const network = Network.from(chainId); if (chainId === ARBITRUM) { @@ -45,7 +54,10 @@ export function getWsProvider(chainId: number): WebSocketProvider | JsonRpcProvi } if (chainId === AVALANCHE) { - return new ethers.WebSocketProvider("wss://api.avax.network/ext/bc/C/ws", network, { staticNetwork: network }); + const provider = new ethers.WebSocketProvider("wss://api.avax.network/ext/bc/C/ws", network, { + staticNetwork: network, + }); + return provider; } if (chainId === AVALANCHE_FUJI) { @@ -56,6 +68,27 @@ export function getWsProvider(chainId: number): WebSocketProvider | JsonRpcProvi return provider; } + if (chainId === ARBITRUM_SEPOLIA) { + const provider = new ethers.WebSocketProvider(getAlchemyArbitrumSepoliaWsUrl("fallback"), network, { + staticNetwork: network, + }); + return provider; + } + + if (chainId === SOURCE_SEPOLIA) { + const provider = new ethers.WebSocketProvider(getAlchemySepoliaWsUrl("fallback"), network, { + staticNetwork: network, + }); + return provider; + } + + if (chainId === SOURCE_OPTIMISM_SEPOLIA) { + const provider = new ethers.WebSocketProvider(getAlchemyOptimismSepoliaWsUrl("fallback"), network, { + staticNetwork: network, + }); + return provider; + } + if (chainId === BOTANIX) { return new ethers.WebSocketProvider( getAlchemyBotanixWsUrl(getIsLargeAccount() ? "largeAccount" : "fallback"), @@ -63,6 +96,18 @@ export function getWsProvider(chainId: number): WebSocketProvider | JsonRpcProvi { staticNetwork: network } ); } + + if (chainId === SOURCE_BASE_MAINNET) { + return new ethers.WebSocketProvider( + getAlchemyBaseMainnetWsUrl(getIsLargeAccount() ? "largeAccount" : "fallback"), + network, + { + staticNetwork: network, + } + ); + } + + throw new Error(`Unsupported websocket provider for chain id: ${chainId}`); } export function getFallbackProvider(chainId: number) { @@ -85,13 +130,20 @@ export function getExpressProvider(chainId: number) { }); } -export function useJsonRpcProvider(chainId: number, { isExpress = false }: { isExpress?: boolean } = {}) { +export function useJsonRpcProvider(chainId: number | undefined, { isExpress = false }: { isExpress?: boolean } = {}) { const [provider, setProvider] = useState(); const { primary } = useCurrentRpcUrls(chainId); - const rpcUrl = useMemo(() => (isExpress ? getExpressRpcUrl(chainId) : primary), [chainId, isExpress, primary]); + const rpcUrl = useMemo( + () => (isExpress && chainId ? getExpressRpcUrl(chainId) : primary), + [chainId, isExpress, primary] + ); useEffect(() => { + if (!chainId) { + return; + } + async function initializeProvider() { if (!rpcUrl) return; diff --git a/src/lib/subgraph/clients.ts b/src/lib/subgraph/clients.ts index 81576ce11e..22372d48cd 100644 --- a/src/lib/subgraph/clients.ts +++ b/src/lib/subgraph/clients.ts @@ -1,4 +1,5 @@ -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ETH_MAINNET } from "config/chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ETH_MAINNET } from "config/chains"; +import { isDevelopment } from "config/env"; import { createClient } from "./utils"; @@ -20,8 +21,13 @@ export const botanixSyntheticsStatsClient = createClient(BOTANIX, "syntheticsSta export const arbitrumSubsquidClient = createClient(ARBITRUM, "subsquid"); export const avalancheSubsquidClient = createClient(AVALANCHE, "subsquid"); export const avalancheFujiSubsquidClient = createClient(AVALANCHE_FUJI, "subsquid"); +export const arbitrumSepoliaSubsquidClient = createClient(ARBITRUM_SEPOLIA, "subsquid"); export const botanixSubsquidClient = createClient(BOTANIX, "subsquid"); +export const REFERRAL_SUPPORTED_CHAIN_IDS = isDevelopment() + ? [ARBITRUM, AVALANCHE, AVALANCHE_FUJI] + : [ARBITRUM, AVALANCHE]; + export function getSyntheticsGraphClient(chainId: number) { if (chainId === ARBITRUM) { return arbitrumSyntheticsStatsClient; @@ -55,6 +61,10 @@ export function getSubsquidGraphClient(chainId: number) { return avalancheFujiSubsquidClient; } + if (chainId === ARBITRUM_SEPOLIA) { + return arbitrumSepoliaSubsquidClient; + } + if (chainId === BOTANIX) { return botanixSubsquidClient; } diff --git a/src/lib/tenderly.tsx b/src/lib/tenderly.tsx index 2c4f7a3bb7..05a3e9c5b4 100644 --- a/src/lib/tenderly.tsx +++ b/src/lib/tenderly.tsx @@ -68,7 +68,6 @@ export async function simulateCallDataWithTenderly({ return processSimulation({ chainId, config: tenderlyConfig, - account: tenderlyConfig.accountSlug, from, to, data, @@ -129,7 +128,6 @@ export const simulateTxWithTenderly = async ( gasPriceData, chainId, config, - account, gasLimit, value: opts.value ?? 0n, blockNumber, @@ -142,7 +140,7 @@ export const simulateTxWithTenderly = async ( async function processSimulation({ chainId, config, - account, + from, data, value, to, @@ -153,7 +151,6 @@ async function processSimulation({ }: { config: TenderlyConfig; chainId: number; - account: string; from: string; to: string; data: string; @@ -166,7 +163,7 @@ async function processSimulation({ const simulationParams = buildSimulationRequest( chainId, { - from: account, + from, to, gas: gasLimit !== undefined ? BigInt(gasLimit) : undefined, input: data, diff --git a/src/lib/transactions/sendExpressTransaction.ts b/src/lib/transactions/sendExpressTransaction.ts index 7055ed9cac..32f6038a7b 100644 --- a/src/lib/transactions/sendExpressTransaction.ts +++ b/src/lib/transactions/sendExpressTransaction.ts @@ -1,12 +1,12 @@ import { TaskState } from "@gelatonetwork/relay-sdk"; import { Address, encodePacked } from "viem"; -import { ARBITRUM, AVALANCHE, BOTANIX } from "config/chains"; +import { ARBITRUM, AVALANCHE, BOTANIX, ContractsChainId } from "config/chains"; import { GelatoPollingTiming, metrics } from "lib/metrics"; import { sleep } from "lib/sleep"; import { gelatoRelay } from "sdk/utils/gelatoRelay"; -import { GelatoTaskStatus, TransactionWaiterResult } from "./types"; +import type { GelatoTaskStatus, TransactionWaiterResult } from "./types"; export type ExpressTxnData = { callData: string; @@ -21,7 +21,7 @@ export type ExpressTxnResult = { }; export async function sendExpressTransaction(p: { - chainId: number; + chainId: ContractsChainId; txnData: ExpressTxnData; isSponsoredCall: boolean; }) { @@ -32,7 +32,7 @@ export async function sendExpressTransaction(p: { let gelatoPromise: Promise<{ taskId: string }> | undefined; - const apiKey = apiKeys[p.chainId]; + const apiKey = GELATO_API_KEYS[p.chainId]; gelatoPromise = sendTxnToGelato({ chainId: p.chainId, @@ -41,7 +41,7 @@ export async function sendExpressTransaction(p: { feeToken: p.txnData.feeToken, sponsorApiKey: apiKey, retries: 0, - isSponsoredCall: p.isSponsoredCall, + isSponsoredCall: apiKey ? p.isSponsoredCall : false, }); return gelatoPromise.then((res) => { @@ -90,7 +90,7 @@ function makeExpressTxnResultWaiter(res: { taskId: string }) { const GELATO_API = "https://api.gelato.digital"; -const apiKeys = { +export const GELATO_API_KEYS: Partial> = { [ARBITRUM]: "6dE6kOa9pc1ap4dQQC2iaK9i6nBFp8eYxQlm00VreWc_", [AVALANCHE]: "FalsQh9loL6V0rwPy4gWgnQPR6uTHfWjSVT2qlTzUq4_", [BOTANIX]: "s5GgkfX7dvd_2uYqsRSCjzMekUrXh0dibUvfLab1Anc_", @@ -109,10 +109,14 @@ export async function sendTxnToGelato({ target: string; data: string; feeToken: string; - sponsorApiKey: string; + sponsorApiKey: string | undefined; retries: number; isSponsoredCall: boolean; }) { + if (isSponsoredCall && !sponsorApiKey) { + throw new Error("Sponsor API key is required for sponsored call"); + } + const url = isSponsoredCall ? `${GELATO_API}/relays/v2/sponsored-call` : `${GELATO_API}/relays/v2/call-with-sync-fee`; const res = await fetch(url, { diff --git a/src/lib/useBlockTimestampRequest.ts b/src/lib/useBlockTimestampRequest.ts index 8e1dad4131..2f1ffea469 100644 --- a/src/lib/useBlockTimestampRequest.ts +++ b/src/lib/useBlockTimestampRequest.ts @@ -1,6 +1,7 @@ import { useMemo } from "react"; import { getContract } from "config/contracts"; +import type { ContractsChainId } from "sdk/configs/chains"; import { useMulticall } from "./multicall"; import { FREQUENT_UPDATE_INTERVAL } from "./timeConstants"; @@ -14,7 +15,10 @@ export type BlockTimestampResult = { blockTimestampData?: BlockTimestampData; }; -export function useBlockTimestampRequest(chainId: number, { skip }: { skip?: boolean } = {}): BlockTimestampResult { +export function useBlockTimestampRequest( + chainId: ContractsChainId, + { skip }: { skip?: boolean } = {} +): BlockTimestampResult { const { data } = useMulticall(chainId, "useBlockTimestamp", { key: !skip ? [] : null, diff --git a/src/lib/useThrottledAsync.ts b/src/lib/useThrottledAsync.ts index 9a6bccd518..ceba7c80e9 100644 --- a/src/lib/useThrottledAsync.ts +++ b/src/lib/useThrottledAsync.ts @@ -9,7 +9,7 @@ type AsyncFnParams = { type AsyncFn = (args: AsyncFnParams) => Promise>; -type AsyncResult = { +export type AsyncResult = { data: T | undefined; isLoading: boolean; error: Error | undefined; diff --git a/src/lib/userAnalytics/types.ts b/src/lib/userAnalytics/types.ts index 7a28509be6..6a748aeccc 100644 --- a/src/lib/userAnalytics/types.ts +++ b/src/lib/userAnalytics/types.ts @@ -1,3 +1,4 @@ +import type { ChainName } from "config/chains"; import { EditingOrderSource } from "domain/synthetics/orders/types"; import { TradeMode, TradeType } from "domain/synthetics/trade"; @@ -21,7 +22,7 @@ export type LandingPageProtocolTokenEvent = { event: "LandingPageAction"; data: { action: "ProtocolTokenAction"; - chain: "Arbitrum" | "Avalanche" | "Botanix"; + chain: ChainName; type: "GMX" | "GM" | "GLV" | "GLP"; }; }; @@ -197,7 +198,7 @@ export type TradeBoxWarningShownEvent = { isExpress1CT: boolean; sizeDeltaUsd: number; leverage: string; - chain: "Arbitrum" | "Avalanche"; + chain: ChainName; isFirstOrder: boolean; }; }; @@ -308,3 +309,15 @@ export type TradePageEditOrderEvent = { source: EditingOrderSource; }; }; + +export type MultichainActionEvent = { + event: "MultichainAction"; + data: { + action: "DepositSuccess" | "WithdrawalSuccess"; + settlementChain: ChainName; + sourceChain: ChainName; + sizeInUsd: number; + asset: string; + isFirstTime: boolean; + }; +}; diff --git a/src/lib/userAnalytics/utils.ts b/src/lib/userAnalytics/utils.ts index 208a311bf2..bcebc4bbbf 100644 --- a/src/lib/userAnalytics/utils.ts +++ b/src/lib/userAnalytics/utils.ts @@ -1,6 +1,6 @@ import debounce from "lodash/debounce"; -import { getChainName } from "config/chains"; +import { ChainName, getChainName } from "config/chains"; import { USD_DECIMALS } from "config/factors"; import { MarketInfo } from "domain/synthetics/markets"; import { @@ -38,6 +38,8 @@ import { } from "lib/userAnalytics/types"; import { getTwapDurationInSeconds } from "sdk/utils/twap"; +import type { MultichainActionEvent } from "./types"; + export function getTradeInteractionKey(pair: string) { return `trade-${pair}`; } @@ -473,3 +475,55 @@ export const sendEditOrderEvent = ({ }, }); }; + +export function sendMultichainDepositSuccessEvent({ + settlementChain, + sourceChain, + sizeInUsd, + asset, + isFirstTime, +}: { + settlementChain: ChainName; + sourceChain: ChainName; + sizeInUsd: number; + asset: string; + isFirstTime: boolean; +}) { + userAnalytics.pushEvent({ + event: "MultichainAction", + data: { + action: "DepositSuccess", + settlementChain, + sourceChain, + sizeInUsd, + asset, + isFirstTime, + }, + }); +} + +export function sendMultichainWithdrawalSuccessEvent({ + settlementChain, + sourceChain, + sizeInUsd, + asset, + isFirstTime, +}: { + settlementChain: ChainName; + sourceChain: ChainName; + sizeInUsd: number; + asset: string; + isFirstTime: boolean; +}) { + userAnalytics.pushEvent({ + event: "MultichainAction", + data: { + action: "WithdrawalSuccess", + settlementChain, + sourceChain, + sizeInUsd, + asset, + isFirstTime, + }, + }); +} diff --git a/src/lib/wallets/rainbowKitConfig.ts b/src/lib/wallets/rainbowKitConfig.ts index c022071fe7..3a958bbbc1 100644 --- a/src/lib/wallets/rainbowKitConfig.ts +++ b/src/lib/wallets/rainbowKitConfig.ts @@ -1,5 +1,5 @@ import { geminiRainbowKitConnector } from "@gemini-wallet/rainbow"; -import { getDefaultConfig, WalletList } from "@rainbow-me/rainbowkit"; +import { Chain, getDefaultConfig, WalletList } from "@rainbow-me/rainbowkit"; import { coinbaseWallet, coreWallet, @@ -12,8 +12,8 @@ import { walletConnectWallet, } from "@rainbow-me/rainbowkit/wallets"; import once from "lodash/once"; -import { Chain, http } from "viem"; -import { arbitrum, avalanche, avalancheFuji } from "viem/chains"; +import { http } from "viem"; +import { arbitrum, arbitrumSepolia, avalanche, avalancheFuji, base, optimismSepolia, sepolia } from "viem/chains"; import { botanix } from "config/chains"; import { isDevelopment } from "config/env"; @@ -51,11 +51,21 @@ export const getRainbowKitConfig = once(() => getDefaultConfig({ appName: APP_NAME, projectId: WALLET_CONNECT_PROJECT_ID, - chains: [arbitrum, avalanche, botanix as Chain, ...(isDevelopment() ? [avalancheFuji] : [])], + chains: [ + arbitrum, + avalanche, + botanix as Chain, + base, + ...(isDevelopment() ? [avalancheFuji, arbitrumSepolia, optimismSepolia, sepolia] : []), + ], transports: { [arbitrum.id]: http(), [avalanche.id]: http(), [avalancheFuji.id]: http(), + [arbitrumSepolia.id]: http(), + [base.id]: http(), + [optimismSepolia.id]: http(), + [sepolia.id]: http(), [botanix.id]: http(), }, wallets: [...popularWalletList, ...othersWalletList], diff --git a/src/lib/wallets/signing.ts b/src/lib/wallets/signing.ts index 914ba6bdfa..c641ffb549 100644 --- a/src/lib/wallets/signing.ts +++ b/src/lib/wallets/signing.ts @@ -1,8 +1,10 @@ -import { Signer } from "ethers"; +import { TypedDataEncoder, type Wallet } from "ethers"; import { withRetry } from "viem"; import { parseError } from "lib/errors"; +import type { WalletSigner } from "."; + export type SignatureDomain = { name: string; version: string; @@ -13,11 +15,12 @@ export type SignatureDomain = { export type SignatureTypes = Record; export type SignTypedDataParams = { - signer: Signer; + signer: WalletSigner | Wallet; types: SignatureTypes; typedData: Record; domain: SignatureDomain; shouldUseSignerMethod?: boolean; + minified?: boolean; }; export async function signTypedData({ @@ -26,6 +29,7 @@ export async function signTypedData({ types, typedData, shouldUseSignerMethod = false, + minified = true, }: SignTypedDataParams) { // filter inputs for (const [key, value] of Object.entries(domain)) { @@ -46,9 +50,23 @@ export async function signTypedData({ } } + let typesToSign = types; + let messageToSign = typedData; + + if (minified) { + const digest = TypedDataEncoder.hash(domain, types, typedData); + const minifiedTypes = { + Minified: [{ name: "digest", type: "bytes32" }], + }; + typesToSign = minifiedTypes; + messageToSign = { + digest, + }; + } + if (shouldUseSignerMethod && signer.signTypedData) { try { - return await signer.signTypedData(domain, types, typedData); + return await signer.signTypedData(domain, typesToSign, messageToSign); } catch (e) { if (e.message.includes("requires a provider")) { // ignore and try to send request directly to provider @@ -58,7 +76,7 @@ export async function signTypedData({ } } - const primaryType = Object.keys(types).filter((t) => t !== "EIP712Domain")[0]; + const primaryType = Object.keys(typesToSign).filter((t) => t !== "EIP712Domain")[0]; const provider = signer.provider; const from = await signer.getAddress(); @@ -71,11 +89,11 @@ export async function signTypedData({ { name: "chainId", type: "uint256" }, { name: "verifyingContract", type: "address" }, ], - ...types, + ...typesToSign, }, primaryType, domain, - message: typedData, + message: messageToSign, }; const signature = await withRetry( diff --git a/src/lib/wallets/useEthersSigner.ts b/src/lib/wallets/useEthersSigner.ts index e5e65e04c0..386e2df65b 100644 --- a/src/lib/wallets/useEthersSigner.ts +++ b/src/lib/wallets/useEthersSigner.ts @@ -22,7 +22,7 @@ export function clientToSigner(client: Client, accoun signer.address = account; } - return signer; + return signer as WalletSigner; } /** Hook to convert a Viem Client to an ethers.js Signer. */ diff --git a/src/locales/de/messages.po b/src/locales/de/messages.po index f2405723c6..e23ecba164 100644 --- a/src/locales/de/messages.po +++ b/src/locales/de/messages.po @@ -46,6 +46,10 @@ msgstr "Dezentrales Tradingprotokoll" msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "" @@ -54,7 +58,8 @@ msgstr "" msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "Verbindung trennen" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -291,7 +297,7 @@ msgstr "Limit Swap abbrechen" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}s" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}s" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -329,10 +336,6 @@ msgstr "" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "Nettowert: Initiales Kollateral + Gewinn/Verlust - Leihgebühr - Negative Funding-Gebühr - Schließgebühr - UI-Gebühr" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "Der Spread beträgt > 1 %, stelle bitte sicher, dass die Handelsdetails akzeptabel sind, bevor du bestätigst" @@ -376,10 +379,19 @@ msgstr "Take-Profit fehlgeschlagen" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "Abrechnung bestätigen" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "Limitpreis unter Markpreis" msgid "sell" msgstr "verkaufen" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0} kann nicht an Smart-Contract-Adressen gesendet werden. Wähle einen #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "Transaktion fehlgeschlagen aufgrund von RPC-Fehler.<0/><1/>Bitte aktiviere <2>Express-Trading in den Einstellungen, was eine bessere Erfahrung bieten sollte." +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "Referral Code hinzugefügt!" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "GMX V2-Datenanalysen in Telegram" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "Du kannst ETH von anderen Netzwerken zu Arbitrum transferieren, indem du eine der folgenden Optionen nutzt:" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Erstellte Limit-Order für {0} {1}: {2} USD!" @@ -586,10 +616,18 @@ msgstr "Max. Kapazität" msgid "Market Swap" msgstr "Markt-Tausch" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx msgid "More" @@ -772,6 +810,10 @@ msgstr "Durchschnittliche Positionsgröße." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> zu {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} Short-Markt: {0} eine Short-Position zum aktuellen Preis." @@ -865,13 +907,19 @@ msgstr "Eröffne Positionen über eine einfache Swap-Schnittstelle. Tausche bequ #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "Keine Märkte passen" +msgstr "" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "MAX" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "Ungültiger Schlupfwert" @@ -889,7 +937,7 @@ msgstr "Max. {0} kaufbarer Betrag überschritten" msgid "Sell submitted!" msgstr "Verkauf übermittelt!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "Code bereits vergeben" @@ -939,6 +987,7 @@ msgstr "Liq. {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "Bezahlen" @@ -999,7 +1048,7 @@ msgstr "Kaufe mit {0}" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "Asset-Management" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (Angebot)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "Alternative Links findest du in den <0>Dokumenten.<1/><2/>Mit dem Klick auf Zustimmen akzeptierst du die <3>Geschäftsbedingungen und <4>Referral-Bedingungen.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "Gesamte Zeit" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "Der Empfehlungscode darf nicht länger als {MAX_REFERRAL_CODE_LENGTH} Zeichen sein." @@ -1262,6 +1315,10 @@ msgstr "FUNDING-GEBÜHR" msgid "Markets" msgstr "Märkte" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "Echtzeit-Rants über GMX-Trades" @@ -1334,6 +1391,10 @@ msgstr "Kaufe Token auf:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "Limit Swap fehlgeschlagen" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "Liq. {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "Gehe Long..." @@ -1361,6 +1426,11 @@ msgstr "Rabatte insgesamt" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "Dieser Token akkumuliert automatisch Gebühren aus Leverage-Trading und Swaps für den {0}-Markt. Er ist auch {1} und {2} ausgesetzt, wie in der Zusammensetzung dargestellt." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Min. Order: {0}" @@ -1487,6 +1557,10 @@ msgstr "Transfer übermittelt" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "One-Click-Trading ist deaktiviert. Aktionslimit überschritten." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "NFT Wallet" msgid "GMX Proposals Voting page" msgstr "GMX-Vorschläge Abstimmungsseite" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "Du kannst ETH direkt auf <0>Arbitrum mit diesen Optionen kaufen:" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "" msgid "Search Market" msgstr "Markt suchen" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "Der akzeptable Preis der Order umfasst den aktuellen Preisimpakt und die festgelegte erlaubte Schlupf. Der Ausführungspreis muss diese Bedingung erfüllen, damit die Order ausgeführt wird." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "Sobald der Markpreis den Limitpreis erreicht, wird die Order versuchen auszuführen, unter Garantie des akzeptablen Preises, der den festgelegten akzeptablen Preisimpakt einschließt. Beachte, dass bei negativem Preisimpakt der Markpreis höher als der Limitpreis sein muss." - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "Order erstellen" msgid "Utilization" msgstr "Nutzung" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} für {1}" @@ -1872,6 +1938,11 @@ msgstr "Paar" msgid "Max {0} out" msgstr "Max. {0} heraus" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "Es gibt keinen Preisimpakt. Es gibt einen einzelnen<0/>Ausführungspreis für die Erhöhung von Shorts oder<1/>Verringerung von Longs für diese Größe." @@ -1953,9 +2024,9 @@ msgstr "Details anzeigen" msgid "To reduce fees, select a different asset to pay with." msgstr "Um die Gebühren zu senken, wähle ein anderes Zahlungsmittel." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "Sobald der Markpreis den Limitpreis erreicht, wird die Order versuchen auszuführen, unter Garantie des akzeptablen Preises, der den festgelegten akzeptablen Preisimpakt einschließt. Beachte, dass bei negativem Preisimpakt der Markpreis niedriger als der Limitpreis sein muss." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2047,7 +2118,7 @@ msgstr "Der USD-Wert der Gebühren wird zum Zeitpunkt ihrer Erhebung berechnet u #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "Max" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2131,10 +2202,14 @@ msgstr "Größe" msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." msgstr "Wir schätzen deine Erfahrung und Einblicke und laden dich zu einem anonymen One-on-One-Chat ein." +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "" + #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "<0>Mehr lesen über Gebühren." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "Du wirst mind. {0} {1} erhalten, wenn dieser Auftrag ausgeführt wird. Der Ausführungspreis kann je nach den Swap-Gebühren zum Zeitpunkt der Auftragsausführung variieren." @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2301,6 +2380,10 @@ msgstr "GLP-Kauf deaktiviert, {0} Aktualisierung steht noch aus" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "Tausch" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "Reserviert für Vesting" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "Standardmäßiges Zulässiges Slippage" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX Analytics" msgid "{0} Price" msgstr "{0} Preis" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "Kaufe GMX von zentralisierten Diensten" @@ -2531,13 +2621,17 @@ msgstr "Leihgebührenrate" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "Maximale Anzahl von Teilen: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "App starten" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "{0} USD in {tokenSymbol} {longOrShortText} eingezahlt" @@ -2582,6 +2676,10 @@ msgstr "NETTO-RATE / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vesting mit GMX auf Avalanche" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" msgstr "Relayer-Anfrage fehlgeschlagen" @@ -2682,7 +2780,7 @@ msgstr "Order storniert" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "Einklappen" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "Gib bis zu 10 Coins ein" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "Exposition gegenüber Backing-Tokens" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "Handeln" msgid "Adding referral code failed." msgstr "Hinzufügen des Referral-Codes fehlgeschlagen." +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "Max. Hebelwirkung ohne PnL: {0}x" @@ -3011,6 +3115,10 @@ msgstr "Erlaube, {tokenSymbol} auszugeben" msgid "Help us improve" msgstr "Hilf uns zu verbessern" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "Ein Aggregat hochwertiger Preisfeeds bestimmt, wann Liquidationen stattfinden. Das schützt Positionen vor temporären Wicks." @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "Gesamt gestaket" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "Netzwerkgebühr" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "Erwarteter Ausführungspreis für die Order, einschließlich des aktuellen Preisimpacts." - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3173,6 +3279,10 @@ msgstr "Aktivieren von Orders gesendet." msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "Keine Ansprüche entsprechen den ausgewählten Filtern" @@ -3181,6 +3291,7 @@ msgstr "Keine Ansprüche entsprechen den ausgewählten Filtern" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3207,6 +3318,9 @@ msgstr "Markt" msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." msgstr "Tauschbetrag von {0} zu {1} überschreitet {2} akzeptablen Betrag. Kann nur {3} erhalten." +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" @@ -3224,6 +3338,10 @@ msgstr "Regeln lesen" msgid "Lev." msgstr "Hebel." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "Staking fehlgeschlagen." @@ -3232,6 +3350,11 @@ msgstr "Staking fehlgeschlagen." msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." msgstr "" +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submitting..." @@ -3241,6 +3364,10 @@ msgstr "Einreichen..." msgid "App" msgstr "App" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "{marketName} zur Wallet hinzufügen" @@ -3293,6 +3420,10 @@ msgstr "Kaufen..." msgid "Enter a new ratio or allowed slippage" msgstr "Gib ein neues Verhältnis oder zulässiges Slippage ein" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "Tausch-UI-Gebühr" @@ -3310,6 +3441,10 @@ msgstr "Angefallene positive Finanzierungsgebühr" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "Absender hat alle Tokens aus dem Affiliate-Vesting-Vault abgehoben" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "Richtung" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "GM kann für {0} und {1} für diesen Markt bis zu den angegebenen Verkaufslimits verkauft werden. Die verbleibenden Tokens im Pool sind für aktuelle offene Positionen reserviert." +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "Graph, der die Performance im Vergleich zum Benchmark über den ausgewählten Zeitraum zeigt." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3463,6 +3597,7 @@ msgstr "Order kann nicht ausgeführt werden, da die verbleibende Position kleine #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx @@ -3470,10 +3605,18 @@ msgstr "Order kann nicht ausgeführt werden, da die verbleibende Position kleine msgid "Claiming..." msgstr "Beanspruchen..." +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "Markterhöhungsanfrage" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "{0} bearbeiten" @@ -3520,6 +3663,10 @@ msgstr "Die Website ist eine von der Community bereitgestellte und gepflegte Ins msgid "Deposit failed." msgstr "Einzahlung fehlgeschlagen." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "Markttausch anfordern" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "Unzureichende Liquidität im {0}-Marktpool. Wähle einen anderen Pool für diesen Markt.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "App deaktiviert, ausstehendes {0}-Upgrade" @@ -3686,7 +3837,11 @@ msgstr "" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "Netzwerk" +msgstr "" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>jede {hours} Stunden{0}" msgid "Fail External Swaps" msgstr "Externe Tausche fehlschlagen" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "Express-Trading ist nicht verfügbar mit dem nativen Token {0} des Netzw msgid "Market Increase" msgstr "Markterhöhung" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "Noch keine Ansprüche" @@ -3747,12 +3910,21 @@ msgstr "Noch keine Ansprüche" msgid "Cancel Order" msgstr "Order abbrechen" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "Vestete beanspruchbare GMX" msgid "Buy {nativeTokenSymbol}" msgstr "Kaufe {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Im Explorer anzeigen" @@ -3795,10 +3968,6 @@ msgstr "Du hast mehrere bestehende Erhöhungs-{longOrShortText} {0} Limit-Orders msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "Nach dem Scannen erscheint eine Verbindungsaufforderung, um deine Wallet zu verbinden." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "Du kannst AVAX von anderen Netzwerken zu Avalanche transferieren, indem du eine der untenstehenden Optionen nutzt:" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "Nicht unterstütztes Netzwerk" @@ -3809,6 +3978,10 @@ msgstr "Nicht unterstütztes Netzwerk" msgid "Opening..." msgstr "Öffnen..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Geworbene Trader auf Avalanche" @@ -3940,6 +4113,10 @@ msgstr "Nach dem Beanspruchen werden die esGMX-Tokens innerhalb von 7 Tagen auf msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "GLV kaufen" @@ -3970,6 +4147,7 @@ msgstr "Erhöhungsanfrage {0} {longOrShortText}, +{1} USD, Akzeptabler Preis: {2 #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "Kollateral In" @@ -4024,7 +4202,6 @@ msgstr "Rabatte, die von diesem Konto als Trader verdient wurden." #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "Affiliate-Vault" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "Preis eingeben" +msgstr "Einen Preis eingeben" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,6 +4439,7 @@ msgstr "{daysConsidered} Tage verdiente Gebühren" msgid "Fulfilling order request" msgstr "Orderanfrage erfüllen" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "Unzureichendes {0}-Guthaben, um Gas zu bezahlen" @@ -4270,10 +4448,6 @@ msgstr "Unzureichendes {0}-Guthaben, um Gas zu bezahlen" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Du kannst derzeit maximal {0} esGMX-Tokens in einem Verhältnis von {1} {stakingToken} zu 1 esGMX vesten." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Kaufe AVAX direkt auf Avalanche oder transferiere es dorthin." - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "Fehler beim Vorbereiten der Transaktion. Provider ist nicht definiert" msgid "Insufficient liquidity in GM Pool" msgstr "Unzureichende Liquidität im GM-Pool" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "Handele auf GMX und gewinne <0>250.000 $ an Preisen! Live bis 30. November, <1>klicke hier, um mehr zu erfahren." @@ -4311,7 +4489,8 @@ msgstr "Angefallene Leihgebühr" msgid "Read more." msgstr "Mehr lesen." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "PnL-Analyse" @@ -4344,7 +4523,7 @@ msgstr "<0>Benachrichtigungen werden von Notifi bereitgestellt und sind nicht mi #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} und {avalancheLink} GLV-Pools sind <0>incetiviert{sparkle}." +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "Gas-Zahlungstoken" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "Preisimpact" @@ -4485,13 +4659,18 @@ msgstr "GMX Technische Ankündigungen" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "Fehlgeschlagener Stop Market" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "Einstellungen" @@ -4548,8 +4727,15 @@ msgstr "Transfer bereits initiiert" msgid "Withdraw submitted." msgstr "Abheben eingereicht." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "Code eingeben" @@ -4557,6 +4743,10 @@ msgstr "Code eingeben" msgid "Details" msgstr "Details" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "Ungültige NFT-Adresse" msgid "LIQ." msgstr "LIQ." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "GLP und GMX autocompounding Vaults" @@ -5134,6 +5328,11 @@ msgstr "One-Click-Einstellungen" msgid "GMX Announcements" msgstr "GMX Ankündigungen" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "Trades" msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "Kein Swap-Pfad verfügbar." @@ -5365,6 +5569,10 @@ msgstr "Übertrage" msgid "GLP autocompounding vaults" msgstr "GLP autocompounding Vaults" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "TP/SL-Orders überschreiten die Position" @@ -5471,6 +5679,10 @@ msgstr "Ordergröße ist 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "Die kaufbaren Limit für den Pool GM: {0} in {1} [{2}] wurde erreicht. Bitte reduziere die Kaufgröße, wähle einen anderen GM-Token oder verschiebe die GM-Token in einen anderen Pool und versuche es erneut." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "{longOrShortText} {0} schließen" @@ -5494,14 +5706,19 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "Max. {0} in" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" #: src/components/EmptyTableContent/EmptyTableContent.tsx msgid "No items yet" -msgstr "Noch keine Elemente" +msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough available swap liquidity to fill the order." @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "Keine offenen Positionen" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "Größe, $" @@ -5566,10 +5787,6 @@ msgstr "STIP.b Retroaktiver Bonus" msgid "Referral code updated." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "Du kannst AVAX direkt auf <0>Avalanche mit diesen Optionen kaufen:" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "Netto-Wert: Anfängliches Kollateral + PnL - Leihgebühr - Schließgebühr" @@ -5742,10 +5959,6 @@ msgstr "TWAP-Swap-Teil ausführen" msgid "<0>every {seconds} seconds" msgstr "<0>jede {seconds} Sekunden" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "Kaufe oder transferiere AVAX zu Avalanche" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "Du hast eine <0>ausstehende Übertragung an {pendingReceiver}." msgid "Limit size is required" msgstr "Limit-Größe ist erforderlich" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "Protokoll-Token" msgid "Collateral at Liquidation" msgstr "Kollateral bei Liquidation" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Nach dem Beanspruchen kannst du maximal {0} esGMX in einem Verhältnis von {1} {stakingToken} zu 1 esGMX vesten." +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "Heute" @@ -5958,6 +6181,10 @@ msgstr "Tier {0} ({currentTierDiscount}% Rabatt)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "Diese Order mit {collateralSymbol} als Kollateral ist nicht gültig für die bestehende {longText}-Position mit {symbol} als Kollateral." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - AIGMX Agent" @@ -6044,6 +6271,10 @@ msgstr "3. Platz" msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "Stop Loss aktualisieren" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1h" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "Balance" @@ -6147,6 +6379,7 @@ msgstr "Gewinn/Verlust" msgid "Names could be separated by commas or spaces" msgstr "Namen können durch Kommas oder Leerzeichen getrennt werden" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "Kaufe GMX von dezentralen Exchanges" @@ -6155,9 +6388,14 @@ msgstr "Kaufe GMX von dezentralen Exchanges" msgid "Powered by" msgstr "Unterstützt von" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "Der akzeptable Preis der Order umfasst den eingestellten akzeptablen Preisimpact. Der Ausführungspreis muss diese Bedingung erfüllen, damit die Order ausgeführt wird." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "Fehler beim Herunterladen des Trade-Verlaufs-CSV." msgid "market" msgstr "markt" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "Gleich wie der derzeit aktive Code" @@ -6237,14 +6476,14 @@ msgstr "GMX-Community mit NFTs, Trading und Bildungsinitiativen" msgid "Liquidation Confirmations" msgstr "Liquidationsbestätigungen" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "Erwarteter Ausführungspreis für die Order, inklusive aktuellem Preisimpact, sobald die Stop-Market-Order ausgeführt wird." - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "Bestätige, dass Epoch in {minutes} Minuten endet" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "Hoher Preisimpact" @@ -6257,13 +6496,9 @@ msgstr "Wir wollen deine Einblicke, um GMX zu verbessern. Aus Sicherheitsgründe msgid "Claim esGMX" msgstr "esGMX beanspruchen" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "Kaufe oder transferiere ETH zu Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "Erwarteter Ausführungspreis für die Order, inklusive aktuellem Preisimpact, sobald die Limit-Order ausgeführt wird." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "Übermitteln" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "Kopieren" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "Menge" @@ -6397,6 +6634,8 @@ msgstr "Trigger-Preis" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "Beanspruchen" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "Preisimpact / Gebühren" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "Der Ausführungspreis der Order berücksichtigt den Preisimpact." msgid "Buy GLP or GMX" msgstr "Kaufe GLP oder GMX" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6474,9 +6735,9 @@ msgstr "Betrag eingeben" msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "Verbinden" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "Unbekannte Shift-GM-Order" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Die max. Hebelwirkung von 100x wurde überschritten, das verbleibende Kollateral nach Abzug von Verlusten und Gebühren wurde auf dein Konto zurückgesendet:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "{symbol} verschieben..." @@ -6582,6 +6850,10 @@ msgstr "GM Airdrop" msgid "Save on Fees" msgstr "Gebühren sparen" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "Take Profit aktualisieren" @@ -6746,7 +7018,7 @@ msgstr "Eröffnungsgebühr" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "Sieht so aus, als hättest du keinen Referral-Code zum Teilen. <0/> Erstelle jetzt einen und beginne, Rabatte zu verdienen!" @@ -6789,11 +7061,21 @@ msgstr "Du" msgid "Deactivate 1CT (One-Click Trading)" msgstr "1CT (One-Click-Trading) deaktivieren" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "Größe pro Teil" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7031,10 +7315,6 @@ msgstr "Limit-Preis" msgid "Initial collateral (collateral excluding borrow fee)." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "Preisimpact-Rabatte für schließende Trades sind unter dem Claims-Tab beanspruchbar. <0>Mehr lesen." - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "Orderanfrage senden" @@ -7058,7 +7338,7 @@ msgstr "Max. Netzwerkgebühr umfasst Gebühren für zusätzliche Orders. Sie wir #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "Rabatte" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "GMX V1-Märkte sind deaktiviert und erlauben nur Positions-Schließungen msgid "Sell failed." msgstr "Verkauf fehlgeschlagen." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "Limit aktualisieren" @@ -7078,6 +7362,10 @@ msgstr "Limit aktualisieren" msgid "Edit order" msgstr "Order bearbeiten" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,6 +7391,10 @@ msgstr "Datum" msgid "Buy GMX using FIAT gateways:" msgstr "Kaufe GMX mit FIAT-Gateways:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." msgstr "" @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Layer 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "Max. {0}-Betrag überschritten" msgid "Position close disabled, pending {0} upgrade" msgstr "Positionsschließung deaktiviert, ausstehendes {0}-Upgrade" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "Tauschen..." @@ -7280,10 +7580,18 @@ msgstr "Abhebung fehlgeschlagen" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "Erhalte Gebührenrabatte und verdiene Rebates über das GMX-Referral-Programm.<0/>Für weitere Informationen lies die <1>Details zum Referral-Programm." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "Einfrieren" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Express-Parameter laden..." @@ -7357,7 +7665,7 @@ msgstr "Wähle einen Zahlungstoken" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "Die verfügbare Liquidität ist der geringere Wert der Differenz zwischen dem Maximalwert und dem aktuellen Wert sowohl für die Reserve als auch für das offene Interesse." +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "Dieser Code wurde von jemand anderem auf {takenNetworkNames} verwendet, msgid "Confirm Claim" msgstr "Anspruch bestätigen" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "GMX-Community-Diskussion" @@ -7502,6 +7815,14 @@ msgstr "<0>Die Kapazität des Pools wurde für {0} erreicht. Bitte verwende eine msgid "GMX dashboards and analytics." msgstr "GMX-Dashboards und -Analysen." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "Externer Tausch {0} zu {1}" @@ -7608,6 +7929,10 @@ msgstr "Ungültige Adresse. Stelle sicher, dass du eine gültige Ethereum-Adress msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "Absender hat alle Tokens aus dem GMX-Vesting-Vault zurückgezogen" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7717,6 +8042,7 @@ msgstr "Bestätigung von Trigger-Orders akzeptieren" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "Wähle, ob du von dezentralen oder zentralen Exchanges kaufst." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "" @@ -7733,6 +8059,10 @@ msgstr "{avalancheLink} GM-Pools sind <0>incenitivisiert{sparkle}." msgid "Shift order cancelled." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" +msgstr "" + #: src/lib/legacy.ts msgid "Order size is bigger than position, will only be executable if position increases" msgstr "Ordergröße ist größer als die Position. Wird nur ausgeführt, wenn sich die Position erhöht" @@ -7754,6 +8084,10 @@ msgstr "Gesamte Belohnungen" msgid "NFT ID" msgstr "NFT-ID" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "Dezentraler Perpetual-Exchange | GMX" @@ -7791,6 +8125,10 @@ msgstr "" msgid "Fee APY" msgstr "Gebühren-APY" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "Keine Märkte passen." @@ -7832,7 +8170,7 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "Fehler aufgetreten. Bitte erneut versuchen" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "Nur Buchstaben, Zahlen und Unterstriche erlaubt." @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "Fehler bei der Bilderzeugung, bitte aktualisieren und erneut versuchen." #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "Preiswirkungs-Rebates" @@ -7898,7 +8237,11 @@ msgstr "Rebates auf V1" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "Ungültiger Token indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "Warnungen" @@ -7943,6 +8286,8 @@ msgstr "Der Bonus-APR wird als {airdropTokenTitle}-Tokens airdropped. <0>Mehr le #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7955,10 +8300,6 @@ msgstr "Wallet" msgid "You have a pending transfer from {sender}." msgstr "Du hast eine ausstehende Überweisung von {sender}." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "Sobald der Markpreis den Stop-Preis erreicht, wird der Auftrag versucht auszuführen." - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "Triggerpreis eingeben" @@ -8011,7 +8352,11 @@ msgstr "Stabilize-Protokoll" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "Gültige Coin-Namen eingeben" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "Stop-Loss-Gewinn/Verlust" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8078,10 +8427,6 @@ msgstr "{prefix} <0>{text}" msgid "Failed to update settings" msgstr "Einstellungen aktualisieren fehlgeschlagen" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "Positive Preiswirkung / Gebühren" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "Tweeten" @@ -8119,14 +8464,14 @@ msgstr "Stop-Loss fehlgeschlagen" msgid "Daily Profit" msgstr "Täglicher Gewinn" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." msgstr "Die esGMX-Tokens können jederzeit gestaket oder gevested werden." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Kaufe ETH direkt auf Arbitrum oder übertrage es dorthin." - #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" @@ -8164,6 +8509,7 @@ msgstr "2. Platz" msgid "LAST PRICE" msgstr "LETZTER PREIS" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "Erneut signieren" @@ -8184,6 +8530,11 @@ msgstr "<0>Delegiere deine nicht delegierte {0} GMX DAO Stimmkraft vor dem B msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "Du wirst long {indexSymbol} von deiner Long-Position sowie von deinem {collateralSymbol}-Kollateral. Der Liquidationspreis ist höher im Vergleich zur Verwendung eines Stablecoins als Kollateral, da der Wert des Kollaterals mit seinem Preis ändert." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "Ausführungspreis" @@ -8237,7 +8587,7 @@ msgstr "Gebührenwerte enthalten keine Incentives." msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "Referral-Code generieren" @@ -8273,6 +8623,7 @@ msgstr "Einzahlung von {0} USD in {1} {longOrShortText}" msgid "Distribution" msgstr "Verteilung" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8293,10 +8644,6 @@ msgstr "Gesamte User" msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "Netto-Wert: Ursprüngliches Kollateral + Gewinn/Verlust - Leihgebühr - Negative Finanzierungsgebühr - Schließungsgebühr" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "Triggerpreis unter niedrigstem Limitpreis" @@ -8315,7 +8662,13 @@ msgstr "Position teilen" msgid "Min leverage: 1.1x" msgstr "Min. Hebel: 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "Einzahlungsgebühr" @@ -8361,6 +8714,10 @@ msgstr "Du hast keinen berechtigten Trade während des Wettbewerbsfensters." msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "Ausführungspreise für das Erhöhen von Longs und<0/>Verringern von Shorts." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "Dashboards" msgid "Create TWAP {0} order" msgstr "TWAP {0}-Order erstellen" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8398,7 +8755,7 @@ msgstr "" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7T" +msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "GMX-Belohnungen beanspruchen" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "Referral-Code eingeben" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 20-27 Mär" @@ -8461,6 +8814,10 @@ msgstr "{marketName} im Explorer öffnen" msgid "Partial Liquidation" msgstr "Teilweise Liquidierung" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "Aktivierung der Einzahlung gesendet." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "Abhebung von {0} aus {positionText}" @@ -8632,6 +8993,7 @@ msgstr "Netto-Rate kombiniert Finanzierungs- und Leihgebühren, schließt jedoch msgid "Accrued Price Impact Rebates" msgstr "Angesammelte Preiswirkungs-Rebates" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "Gestern" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "Anonymer Chat mit GMX" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8685,14 +9049,19 @@ msgstr "Limit" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "Du erhältst mindestens {toAmountText}, wenn diese Order ausgeführt wird. Dieser Preis wird in Echtzeit basierend auf Tauschgebühren und Preiswirkung aktualisiert." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "Akzeptabler Preis gilt nicht für Stop-Loss-Orders, da sie unabhängig von Preiswirkung ausgeführt werden." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "Wir planen dann einen Chat oder ein Interview mit dir. Als Dankeschön erhältst du <0>100 <1/> für dein Feedback." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "{longOrShort}-Positionen zahlen keine Finanzierungsgebühr und zahlen ei msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "Erhöhen aktiv: {0}, ausgeführt: {1}, abgebrochen: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "{0} ist für das Kollateral erforderlich." msgid "Decentralized Options Protocol" msgstr "Dezentrales Optionsprotokoll" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "TWAP-Tausch-Teil aktualisieren" @@ -8797,6 +9175,10 @@ msgstr "TWAP-Teil aktualisieren" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "Kontoübertragung abschließen" msgid "Claim Rewards" msgstr "Belohnungen beanspruchen" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "Adresse kopieren" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "Unterstützende Zusammensetzung" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "Du hast {balanceFormatted} verbleibend in deinem alten Version 1CT-Subaccount." #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "GMX unstaken" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "" diff --git a/src/locales/en/messages.po b/src/locales/en/messages.po index cc01a2eb7a..c36c3ae544 100644 --- a/src/locales/en/messages.po +++ b/src/locales/en/messages.po @@ -46,6 +46,10 @@ msgstr "Decentralized Trading Protocol" msgid "STIP.b Trading Incentives" msgstr "STIP.b Trading Incentives" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "Buy order executed." @@ -54,7 +58,8 @@ msgstr "Buy order executed." msgid "Claims are disabled" msgstr "Claims are disabled" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "Disconnect" @@ -181,6 +186,7 @@ msgstr "Keep leverage is not possible." #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}s" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -329,10 +336,6 @@ msgstr "Max leverage without PnL: 100x" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "The spread is > 1%, please ensure the trade details are acceptable before confirming" @@ -376,10 +379,19 @@ msgstr "Failed Take Profit" msgid "Swapped {0} for {1}." msgstr "Swapped {0} for {1}." +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "No necessary params to claim. Retry in a few seconds." + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "Confirm Settle" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "Select token" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "Limit price below mark price" msgid "sell" msgstr "sell" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "Switch to {0}" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -467,6 +484,14 @@ msgstr "{0} can not be sent to smart contract addresses. Select another token." msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." msgstr "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "Referral code added!" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "Available to Trade" + #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" msgstr "SELLABLE" @@ -542,14 +567,19 @@ msgstr "GMX V2 Data Analytics within Telegram" msgid "High external swap impact" msgstr "High external swap impact" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "You can transfer ETH from other networks to Arbitrum using any of the below options:" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "Adding" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "Network for Cross-Chain Deposits and positions." + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Created limit order for {0} {1}: {2} USD!" @@ -586,10 +616,18 @@ msgstr "Max Capacity" msgid "Market Swap" msgstr "Market Swap" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." msgstr "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." + #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx msgid "More" @@ -772,6 +810,10 @@ msgstr "Average position size." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> to {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "Sent referral code transaction" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} Short Market: {0} a short position at the current price." @@ -868,10 +910,16 @@ msgid "No markets matched" msgstr "No markets matched" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "MAX" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "No centralized exchanges available for this network." + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "Invalid slippage value" @@ -889,7 +937,7 @@ msgstr "Max {0} buyable amount exceeded" msgid "Sell submitted!" msgstr "Sell submitted!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "Code already taken" @@ -939,6 +987,7 @@ msgstr "Liq. {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "Pay" @@ -1065,11 +1114,15 @@ msgstr "TVL (Supply)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "Claiming funding fees" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "All Time" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." @@ -1262,6 +1315,10 @@ msgstr "FUNDING FEE" msgid "Markets" msgstr "Markets" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "To begin trading on GMX deposit assets into GMX account" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "Real-time rants about GMX Trades" @@ -1334,6 +1391,10 @@ msgstr "Buy token on:" msgid "Claims history" msgstr "Claims history" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "Failed Limit Swap" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "Liq. {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "Market - Long Inc." + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "Longing..." @@ -1361,6 +1426,11 @@ msgstr "Total Rebates" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "To Network" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Min order: {0}" @@ -1487,6 +1557,10 @@ msgstr "Transfer Submitted" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "One-Click Trading is disabled. Action limit exceeded." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "NFT Wallet" msgid "GMX Proposals Voting page" msgstr "GMX Proposals Voting page" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "You can buy ETH directly on <0>Arbitrum using these options:" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "Withdrawn {balanceFormatted} to main account." msgid "Search Market" msgstr "Search Market" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "Create Order" msgid "Utilization" msgstr "Utilization" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "Select Asset to Deposit" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} for {1}" @@ -1872,6 +1938,11 @@ msgstr "Pair" msgid "Max {0} out" msgstr "Max {0} out" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "No assets available for deposit" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." @@ -1953,9 +2024,9 @@ msgstr "Show details" msgid "To reduce fees, select a different asset to pay with." msgstr "To reduce fees, select a different asset to pay with." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "Settlement Chain" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2131,10 +2202,14 @@ msgstr "Size" msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." msgstr "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "Market - Short Inc." + #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "Open positions" msgid "<0>Read more about fees." msgstr "<0>Read more about fees." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." @@ -2260,7 +2339,7 @@ msgstr "You have an existing position with {0} as collateral. This Order will no msgid "Fulfilling sell request." msgstr "Fulfilling sell request." -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "Creating" @@ -2301,6 +2380,10 @@ msgstr "GLP buy disabled, pending {0} upgrade" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "Initial collateral (collateral excluding borrow and funding fee)." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "No options available to buy {nativeTokenSymbol} directly on {chainName}." + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "Swaps" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "Reserved for Vesting" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "Theme" msgid "Default Allowed Slippage" msgstr "Default Allowed Slippage" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "Claiming funding fees failed" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX Analytics" msgid "{0} Price" msgstr "{0} Price" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "Buy GMX from centralized services" @@ -2531,13 +2621,17 @@ msgstr "Borrow Fee Rate" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "Launch App" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "Available to Pay" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "Deposited {0} USD into {tokenSymbol} {longOrShortText}" @@ -2582,6 +2676,10 @@ msgstr "NET RATE / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vest with GMX on Avalanche" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "Change to {0}" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" msgstr "Relayer request failed" @@ -2953,10 +3051,16 @@ msgstr "Trade" msgid "Adding referral code failed." msgstr "Adding referral code failed." +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "Updating" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "Deposit USDC" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "Max leverage without PnL: {0}x" @@ -3011,6 +3115,10 @@ msgstr "Allow {tokenSymbol} to be spent" msgid "Help us improve" msgstr "Help us improve" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "Total Staked" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "Network Fee" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "Expected execution price for the order, including the current price impact." - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3173,6 +3279,10 @@ msgstr "Enable orders sent." msgid "Price below mark price" msgstr "Price below mark price" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "Withdrawing..." + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "No claims match the selected filters" @@ -3181,6 +3291,7 @@ msgstr "No claims match the selected filters" msgid "Staking" msgstr "Staking" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "Claiming" @@ -3207,6 +3318,9 @@ msgstr "Market" msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." msgstr "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" @@ -3224,6 +3338,10 @@ msgstr "Read the rules" msgid "Lev." msgstr "Lev." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "Available to Trade Assets" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "Stake failed." @@ -3232,6 +3350,11 @@ msgstr "Stake failed." msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." msgstr "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" +msgstr "Withdrawal" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submitting..." @@ -3241,6 +3364,10 @@ msgstr "Submitting..." msgid "App" msgstr "App" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "Add {marketName} to Wallet" @@ -3293,6 +3420,10 @@ msgstr "Buying..." msgid "Enter a new ratio or allowed slippage" msgstr "Enter a new ratio or allowed slippage" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "Swap UI Fee" @@ -3310,6 +3441,10 @@ msgstr "Accrued Positive Funding Fee" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "Sender has withdrawn all tokens from Affiliate Vesting Vault" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "Unstake submitted." @@ -3350,7 +3485,6 @@ msgstr "GM can be sold for {0} and {1} for this market up to the specified selli msgid "Graph showing performance vs benchmark over the selected period." msgstr "Graph showing performance vs benchmark over the selected period." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3463,6 +3597,7 @@ msgstr "Order cannot be executed as the remaining position would be smaller than #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx @@ -3470,10 +3605,18 @@ msgstr "Order cannot be executed as the remaining position would be smaller than msgid "Claiming..." msgstr "Claiming..." +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "All" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "Request Market Increase" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "Edit {0}" @@ -3520,6 +3663,10 @@ msgstr "The website is a community deployed and maintained instance of the open msgid "Deposit failed." msgstr "Deposit failed." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "Enter withdrawal amount" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "Request Market Swap" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "App disabled, pending {0} upgrade" @@ -3688,6 +3839,10 @@ msgstr "Yes, GLV is fully liquid and permissionless. You can sell via the GMX in msgid "Network" msgstr "Network" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "Success claiming funding fees" + #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" msgstr "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>every {hours} hours{0}" msgid "Fail External Swaps" msgstr "Fail External Swaps" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "Repeat Transaction" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "High swap profit fee" @@ -3739,6 +3898,10 @@ msgstr "Express Trading is not available using network's native token {0}. Consi msgid "Market Increase" msgstr "Market Increase" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "No funding activity" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "No claims yet" @@ -3747,12 +3910,21 @@ msgstr "No claims yet" msgid "Cancel Order" msgstr "Cancel Order" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "Claiming position price impact fees failed" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "Vested Claimable GMX" msgid "Buy {nativeTokenSymbol}" msgstr "Buy {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "View in Explorer" @@ -3795,10 +3968,6 @@ msgstr "You have multiple existing Increase {longOrShortText} {0} limit orders" msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "After you scan, a connection prompt will appear for you to connect your wallet." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "You can transfer AVAX from other networks to Avalanche using any of the below options:" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "Unsupported network" @@ -3809,6 +3978,10 @@ msgstr "Unsupported network" msgid "Opening..." msgstr "Opening..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "Fee" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Traders Referred on Avalanche" @@ -3940,6 +4113,10 @@ msgstr "After claiming, the esGMX tokens will be airdropped to your account on t msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "Funding Activity" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "Buy GLV" @@ -3970,6 +4147,7 @@ msgstr "Request increase {0} {longOrShortText}, +{1} USD, Acceptable Price: {2} #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "Collateral In" @@ -4024,7 +4202,6 @@ msgstr "Rebates earned by this account as a trader." #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4262,6 +4439,7 @@ msgstr "{daysConsidered}d Earned Fees" msgid "Fulfilling order request" msgstr "Fulfilling order request" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "Insufficient {0} balance to pay for gas" @@ -4270,10 +4448,6 @@ msgstr "Insufficient {0} balance to pay for gas" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Buy AVAX directly to Avalanche or transfer it there." - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "Error preparing transaction. Provider is not defined" msgid "Insufficient liquidity in GM Pool" msgstr "Insufficient liquidity in GM Pool" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." @@ -4311,7 +4489,8 @@ msgstr "Accrued Borrow Fee" msgid "Read more." msgstr "Read more." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "PnL Analysis" @@ -4374,15 +4553,10 @@ msgstr "Gas Payment Token" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "Price Impact" @@ -4487,11 +4661,16 @@ msgstr "GMX Technical Announcements" msgid "Failed Stop Market" msgstr "Failed Stop Market" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "Address copied to your clipboard" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "Settings" @@ -4548,8 +4727,15 @@ msgstr "Transfer already initiated" msgid "Withdraw submitted." msgstr "Withdraw submitted." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "Net Price Impact" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "Enter a code" @@ -4557,6 +4743,10 @@ msgstr "Enter a code" msgid "Details" msgstr "Details" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "Market - Short Dec." + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "Invalid NFT Address" msgid "LIQ." msgstr "LIQ." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "Transfer Details" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "GLP and GMX autocompounding vaults" @@ -5134,6 +5328,11 @@ msgstr "One-Click Settings" msgid "GMX Announcements" msgstr "GMX Announcements" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "Cancelling {ordersText}." #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "Trades" msgid "Swapped {0} {1} for {2} {3}." msgstr "Swapped {0} {1} for {2} {3}." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "No swap path available." @@ -5365,6 +5569,10 @@ msgstr "Transferring" msgid "GLP autocompounding vaults" msgstr "GLP autocompounding vaults" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "Your deposit of from {sourceChainName} was not executed due to an error" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "TP/SL orders exceed the position" @@ -5471,6 +5679,10 @@ msgstr "Order size is 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "Available to Deposit" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "Close {longOrShortText} {0}" @@ -5494,7 +5706,12 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "Max {0} in" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "Asset" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "Checking code" @@ -5546,6 +5763,10 @@ msgstr "Positive Funding Fees" msgid "No open positions" msgstr "No open positions" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "To Wallet" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "Size, $" @@ -5566,10 +5787,6 @@ msgstr "STIP.b Retroactive Bonus" msgid "Referral code updated." msgstr "Referral code updated." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "You can buy AVAX directly on <0>Avalanche using these options:" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" @@ -5742,10 +5959,6 @@ msgstr "Execute TWAP Swap Part" msgid "<0>every {seconds} seconds" msgstr "<0>every {seconds} seconds" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "Buy or Transfer AVAX to Avalanche" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "You have a <0>pending transfer to {pendingReceiver}." msgid "Limit size is required" msgstr "Limit size is required" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "From Network" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "Protocol Tokens" msgid "Collateral at Liquidation" msgstr "Collateral at Liquidation" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "Today" @@ -5958,6 +6181,10 @@ msgstr "Tier {0} ({currentTierDiscount}% discount)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "Pick an asset to deposit" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - AIGMX Agent" @@ -6044,6 +6271,10 @@ msgstr "3rd Place" msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "Enter deposit amount" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "Update Stop Loss" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1h" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "Balance" @@ -6147,6 +6379,7 @@ msgstr "Win/Loss" msgid "Names could be separated by commas or spaces" msgstr "Names could be separated by commas or spaces" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "Buy GMX from decentralized exchanges" @@ -6155,9 +6388,14 @@ msgstr "Buy GMX from decentralized exchanges" msgid "Powered by" msgstr "Powered by" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "Asset Balance" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "No options available to transfer {nativeTokenSymbol} to {chainName}." #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "Failed to download trade history CSV." msgid "market" msgstr "market" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "Same as current active code" @@ -6237,14 +6476,14 @@ msgstr "GMX Community with NFTs, Trading and Education initiatives" msgid "Liquidation Confirmations" msgstr "Liquidation Confirmations" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "Expected execution price for the order, including the current price impact, once the stop market order executes." - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "Acknowledge epoch is ending in {minutes} minutes" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "From Wallet" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "High Price Impact" @@ -6257,13 +6496,9 @@ msgstr "We want your insights to help improve GMX. For security reasons, we won' msgid "Claim esGMX" msgstr "Claim esGMX" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "Buy or Transfer ETH to Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "Expected execution price for the order, including the current price impact, once the limit order executes." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6313,6 +6548,7 @@ msgstr "Open positions with orders" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "Submit" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "Could not execute deposit into {0} {longOrShortText}." #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "Copy" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "Amount" @@ -6397,6 +6634,8 @@ msgstr "trigger price" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "Claim" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "Price Impact / Fees" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "Order execution price takes into account price impact." msgid "Buy GLP or GMX" msgstr "Buy GLP or GMX" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "Source Base is now available on GMX" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." msgstr "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "Deposit failed" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "Deposit USDC or ETH" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "Referral code created." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "Withdrawing Funds from GMX" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "Notifications" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "No decentralized exchanges available for this network." + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "Price is below mark price" @@ -6474,9 +6735,9 @@ msgstr "Enter an amount" msgid "Order update submitted." msgstr "Order update submitted." -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "Connect" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "No assets are available for deposit" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "Unknown shift GM order" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "GMX Balance" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "Shifting {symbol}..." @@ -6582,6 +6850,10 @@ msgstr "GM Airdrop" msgid "Save on Fees" msgstr "Save on Fees" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "Approving" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "Update Take Profit" @@ -6746,7 +7018,7 @@ msgstr "Open Fee" msgid "Sell order executed." msgstr "Sell order executed." -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" @@ -6789,11 +7061,21 @@ msgstr "You" msgid "Deactivate 1CT (One-Click Trading)" msgstr "Deactivate 1CT (One-Click Trading)" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "Size per part" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7031,10 +7315,6 @@ msgstr "limit price" msgid "Initial collateral (collateral excluding borrow fee)." msgstr "Initial collateral (collateral excluding borrow fee)." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "Sending order request" @@ -7068,6 +7348,10 @@ msgstr "GMX V1 markets are disabled and only allow for position closing. GLP is msgid "Sell failed." msgstr "Sell failed." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "Insufficient {nativeTokenSymbol} balance" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "Update Limit" @@ -7078,6 +7362,10 @@ msgstr "Update Limit" msgid "Edit order" msgstr "Edit order" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "Error simulating withdrawal" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "Failed to withdraw {balanceFormatted} to main account." #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,6 +7391,10 @@ msgstr "Date" msgid "Buy GMX using FIAT gateways:" msgstr "Buy GMX using FIAT gateways:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." msgstr "Approval failed." @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Layer 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "Depositing" @@ -7205,6 +7499,12 @@ msgstr "Max {0} amount exceeded" msgid "Position close disabled, pending {0} upgrade" msgstr "Position close disabled, pending {0} upgrade" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "No assets available for deposit on {0}" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "Swapping..." @@ -7280,10 +7580,18 @@ msgstr "Failed Withdraw" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "Buy or Transfer {nativeTokenSymbol} to {chainName}" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "Freeze" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "Depositing Funds to GMX" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Express params loading..." @@ -7404,6 +7712,11 @@ msgstr "This code has been taken by someone else on {takenNetworkNames}, you wil msgid "Confirm Claim" msgstr "Confirm Claim" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "GMX Account Balance" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "GMX community discussion" @@ -7502,6 +7815,14 @@ msgstr "<0>The pool's capacity has been reached for {0}. Please use another toke msgid "GMX dashboards and analytics." msgstr "GMX dashboards and analytics." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "External Swap {0} to {1}" @@ -7608,6 +7929,10 @@ msgstr "Invalid address. Please make sure you have entered a valid Ethereum addr msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "Sender has withdrawn all tokens from GMX Vesting Vault" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "Claiming position price impact fees" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7717,6 +8042,7 @@ msgstr "Accept confirmation of trigger orders" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "Choose to buy from decentralized or centralized exchanges." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "GMX Account" @@ -7733,6 +8059,10 @@ msgstr "{avalancheLink} GM Pools are <0>incentivized{sparkle}." msgid "Shift order cancelled." msgstr "Shift order cancelled." +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" +msgstr "Success claiming position price impact fees" + #: src/lib/legacy.ts msgid "Order size is bigger than position, will only be executable if position increases" msgstr "Order size is bigger than position, will only be executable if position increases" @@ -7754,6 +8084,10 @@ msgstr "Total Rewards" msgid "NFT ID" msgstr "NFT ID" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "Select network" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "Decentralized Perpetual Exchange | GMX" @@ -7791,6 +8125,10 @@ msgstr "The execution price didn't meet the acceptable price condition. The orde msgid "Fee APY" msgstr "Fee APY" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "Please <0>swap to get {nativeTokenSymbol}." + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "No markets matched." @@ -7832,7 +8170,7 @@ msgstr "dynamically allocates its liquidity to the highest-utilised markets, max msgid "Error occurred. Please try again" msgstr "Error occurred. Please try again" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "Only letters, numbers and underscores are allowed." @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "Image generation error, please refresh and try again." #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "Price Impact Rebates" @@ -7898,7 +8237,11 @@ msgstr "Rebates on V1" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "Withdraw Fee" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "Alerts" @@ -7943,6 +8286,8 @@ msgstr "The Bonus APR will be airdropped as {airdropTokenTitle} tokens. <0>Read #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7955,10 +8300,6 @@ msgstr "Wallet" msgid "You have a pending transfer from {sender}." msgstr "You have a pending transfer from {sender}." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "Once the mark price hits the stop price, the order will attempt to execute." - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "Enter a trigger price" @@ -8013,6 +8354,10 @@ msgstr "Stabilize Protocol" msgid "Enter a valid coin names" msgstr "Enter a valid coin names" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "All assets" + #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx msgid "Long Liq." @@ -8038,6 +8383,10 @@ msgstr "You have an existing position in the {0} market pool.<0>Switch to {1} ma msgid "Stop Loss PnL" msgstr "Stop Loss PnL" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "Market - Long Dec." + #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx @@ -8078,10 +8427,6 @@ msgstr "{prefix} <0>{text}" msgid "Failed to update settings" msgstr "Failed to update settings" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "Positive Price Impact / Fees" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "Tweet" @@ -8119,14 +8464,14 @@ msgstr "Failed Stop Loss" msgid "Daily Profit" msgstr "Daily Profit" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." msgstr "The esGMX tokens can be staked or vested at any time." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Buy ETH directly on Arbitrum or transfer it there." - #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" @@ -8164,6 +8509,7 @@ msgstr "2nd Place" msgid "LAST PRICE" msgstr "LAST PRICE" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "Re-sign" @@ -8184,6 +8530,11 @@ msgstr "<0>Delegate your undelegated {0} GMX DAOvoting power before claiming msgid "Claim funds" msgstr "Claim funds" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "Net Price Impact / Fees" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "{0} required" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "Execution Price" @@ -8237,7 +8587,7 @@ msgstr "Fee values do not include incentives." msgid "For detailed stats" msgstr "For detailed stats" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "Generate Referral Code" @@ -8273,6 +8623,7 @@ msgstr "Deposit {0} USD into {1} {longOrShortText}" msgid "Distribution" msgstr "Distribution" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "Referral code does not exist" @@ -8293,10 +8644,6 @@ msgstr "Total Users" msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "The maximum allowed percentage difference between the mark price and the execution price for market orders." -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "Trigger price below lowest limit price" @@ -8315,7 +8662,13 @@ msgstr "Share Position" msgid "Min leverage: 1.1x" msgstr "Min leverage: 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "Insufficient gas balance, please deposit more USDC." + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "Deposit Fee" @@ -8361,6 +8714,10 @@ msgstr "You do not have any eligible trade during the competition window." msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "Execution prices for increasing longs and<0/>decreasing shorts." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "It will take a couple of minutes to be reflected. Please check back later." + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "Processing your claim…" @@ -8379,7 +8736,7 @@ msgstr "Dashboards" msgid "Create TWAP {0} order" msgstr "Create TWAP {0} order" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "Address copied to your clipboard." @@ -8416,10 +8773,6 @@ msgstr "Click on the position to select it, then use the trade box to increase i msgid "Claim GMX Rewards" msgstr "Claim GMX Rewards" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "Enter Referral Code" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 20-27 Mar" @@ -8461,6 +8814,10 @@ msgstr "Open {marketName} in Explorer" msgid "Partial Liquidation" msgstr "Partial Liquidation" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "Gmx Account" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "Enable deposit sent." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "No funding activity matching your search" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "Withdrawing {0} from {positionText}" @@ -8632,6 +8993,7 @@ msgstr "Net rate combines funding and borrowing fees but excludes open, swap or msgid "Accrued Price Impact Rebates" msgstr "Accrued Price Impact Rebates" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "Yesterday" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "Anonymous chat with GMX" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "Loading" @@ -8685,14 +9049,19 @@ msgstr "Limit" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "Depositing and Withdrawing Funds to/from GMX" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "Available:" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "There are more longs than shorts, borrow fees for shorting is currently zero." @@ -8768,6 +9137,10 @@ msgstr "{longOrShort} positions do not pay a funding fee and pay a borrow fee of msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "Increase active: {0}, executed: {1}, cancelled: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "{0} is required for collateral." msgid "Decentralized Options Protocol" msgstr "Decentralized Options Protocol" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "Insufficient gas balance, please deposit more ETH or USDC." + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "Update TWAP Swap Part" @@ -8797,6 +9175,10 @@ msgstr "Update TWAP Part" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "How does GLV earn yield, and where do I see my earnings?" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "Please switch to {0} to create your referral code. It will work across all other networks." + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,7 +9188,7 @@ msgstr "Complete Account Transfer" msgid "Claim Rewards" msgstr "Claim Rewards" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" msgstr "Copy Address" @@ -8856,6 +9238,11 @@ msgstr "Backing Composition" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "Insufficient balance" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "You have {balanceFormatted} remaining in your old version 1CT subaccount." @@ -8863,3 +9250,7 @@ msgstr "You have {balanceFormatted} remaining in your old version 1CT subaccount #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" msgstr "Unstake GMX" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" diff --git a/src/locales/es/messages.po b/src/locales/es/messages.po index 86429878cf..d73f5474e1 100644 --- a/src/locales/es/messages.po +++ b/src/locales/es/messages.po @@ -46,6 +46,10 @@ msgstr "Protocolo de Trading Descentralizado" msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "" @@ -54,7 +58,8 @@ msgstr "" msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "Desconectar" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -291,7 +297,7 @@ msgstr "Cancelar Intercambio Límite" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}s" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}s" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -329,10 +336,6 @@ msgstr "" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "Valor Neto: Garantía Inicial + PnL - Comisión de Préstamo - Comisión de Financiación Negativa - Comisión de Cierre - Comisión de UI" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "El spread es > 1%, por favor asegúrate de que los detalles de la operación son aceptables antes de confirmar" @@ -376,10 +379,19 @@ msgstr "Take Profit Fallido" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "Confirmar Liquidación" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "Precio límite por debajo del precio de referencia" msgid "sell" msgstr "vender" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0} no se puede enviar a direcciones de contratos inteligentes. Seleccio #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "Transacción fallida debido a error RPC.<0/><1/>Por favor, activa <2>Trading Express en ajustes, lo que debería ofrecer una mejor experiencia." +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "¡Código de referido añadido!" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "Análisis de Datos GMX V2 dentro de Telegram" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "Puedes transferir ETH desde otras redes a Arbitrum usando cualquiera de las siguientes opciones:" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Orden límite creada para {0} {1}: {2} USD!" @@ -586,10 +616,18 @@ msgstr "Capacidad Máxima" msgid "Market Swap" msgstr "Intercambio de Mercado" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx msgid "More" @@ -772,6 +810,10 @@ msgstr "Tamaño promedio de posición." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> a {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} Mercado Corto: {0} una posición corta al precio actual." @@ -865,13 +907,19 @@ msgstr "Abre posiciones a través de una simple interfaz de intercambio. Interca #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "No se encontraron mercados" +msgstr "" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "MÁX" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "Valor de deslizamiento no válido" @@ -889,7 +937,7 @@ msgstr "Cantidad máxima comprable de {0} superada" msgid "Sell submitted!" msgstr "¡Venta enviada!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "Código ya cogido" @@ -939,6 +987,7 @@ msgstr "Liq. {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "Pagar" @@ -999,7 +1048,7 @@ msgstr "Compra con {0}" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "Gestión de Activos" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (Suministro)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "Links alternativos pueden encontrarse en <0>docs.<1/><2/>Haciendo clic aceptas el <3>T&Cs y <4>Referidos T&Cs.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "Todo el Tiempo" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "El código de referido no puede tener más de {MAX_REFERRAL_CODE_LENGTH} caracteres." @@ -1262,6 +1315,10 @@ msgstr "COMISIÓN DE FINANCIACIÓN" msgid "Markets" msgstr "Mercados" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "Rants en tiempo real sobre Operaciones GMX" @@ -1334,6 +1391,10 @@ msgstr "Comprar token en:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "Intercambio Límite Fallido" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "Liq. {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "Entrando a largo..." @@ -1361,6 +1426,11 @@ msgstr "Total de Reembolsos" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "Este token acumula automáticamente comisiones de trading con apalancamiento e intercambios para el mercado {0}. También está expuesto a {1} y {2} según la composición mostrada." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Orden mín.: {0}" @@ -1487,6 +1557,10 @@ msgstr "Transferencia Enviada" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "Trading en Un Clic desactivado. Límite de acciones superado." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "Monedero NFT" msgid "GMX Proposals Voting page" msgstr "Página de votación de propuestas GMX" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "Puedes comprar ETH directamente en <0>Arbitrum usando estas opciones:" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "" msgid "Search Market" msgstr "Buscar Mercado" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "El precio aceptable de la orden incluye el impacto de precio actual y el deslizamiento permitido establecido. El precio de ejecución debe cumplir esta condición para que la orden se ejecute." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "Una vez que el precio de referencia alcance el precio límite, la orden intentará ejecutarse, garantizando el precio aceptable, que incluye el impacto de precio aceptable establecido. Nota que si hay un impacto de precio negativo, el precio de referencia puede necesitar ser mayor que el precio límite." - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "Crear Orden" msgid "Utilization" msgstr "Utilización" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} por {1}" @@ -1872,6 +1938,11 @@ msgstr "Par" msgid "Max {0} out" msgstr "Máx. {0} fuera" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "No hay impacto de precio. Hay un precio de ejecución único para aumentar cortos o<0/>reducir largos para este tamaño." @@ -1953,9 +2024,9 @@ msgstr "Mostrar detalles" msgid "To reduce fees, select a different asset to pay with." msgstr "Para reducir las comisiones, seleccione un activo diferente con el que pagar." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "Una vez que el precio de referencia alcance el precio límite, la orden intentará ejecutarse, garantizando el precio aceptable, que incluye el impacto de precio aceptable establecido. Nota que si hay un impacto de precio negativo, el precio de referencia puede necesitar ser menor que el precio límite." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2047,7 +2118,7 @@ msgstr "El valor USD de las comisiones se calcula en el momento en que se ganan #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "Máx." +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2131,10 +2202,14 @@ msgstr "Tamaño" msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." msgstr "Valoramos tu experiencia e insights y te invitamos a participar en un chat anónimo uno a uno." +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "" + #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "<0>Leer más sobre comisiones." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "Recibirás al menos {0} {1} si esta orden se ejecuta. El precio de ejecución puede variar dependiendo de las comisiones de intercambio en el momento en el que la orden es ejecutada." @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2301,6 +2380,10 @@ msgstr "Compra de GLP desactivada, actualización {0} pendiente" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "Intercambios" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "Reservado para Adquisición" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "Deslizamiento Permitido Predeterminado" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX Analytics" msgid "{0} Price" msgstr "Precio de {0}" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "Comprar GMX en servicios centralizados" @@ -2531,13 +2621,17 @@ msgstr "Tasa de Préstamo" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "Número máximo de partes: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "Abrir App" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "Depositado {0} USD en {tokenSymbol} {longOrShortText}" @@ -2580,7 +2674,11 @@ msgstr "TASA NETA / 1 H" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Vest with GMX on Avalanche" -msgstr "Adquirir con GMX en Avalanche" +msgstr "Adquiera con GMX en Avalanche" + +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" @@ -2682,7 +2780,7 @@ msgstr "Orden cancelada" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "Contraer" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "Ingresa hasta 10 monedas" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "Exposición a Tokens de Respaldo" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "Trading" msgid "Adding referral code failed." msgstr "Fallo al añadir código de referido." +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "Apalancamiento máximo sin GyP: {0}x" @@ -3011,6 +3115,10 @@ msgstr "Permitir gastar {tokenSymbol}" msgid "Help us improve" msgstr "Ayúdanos a mejorar" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "Un conjunto de fuentes de precios de alta calidad determinan cuando se producen las liquidaciones. Esto mantiene las posiciones a salvo de altibajos temporales." @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "Total Stakeado" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "Comisión de Red" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "Precio de ejecución esperado para la orden, incluyendo el impacto de precio actual." - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3173,6 +3279,10 @@ msgstr "Activación de órdenes enviada." msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "No hay reclamos que coincidan con los filtros seleccionados" @@ -3181,6 +3291,7 @@ msgstr "No hay reclamos que coincidan con los filtros seleccionados" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3207,6 +3318,9 @@ msgstr "Mercado" msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." msgstr "Cantidad de intercambio de {0} a {1} excede {2} cantidad aceptable. Solo se puede recibir {3}." +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" @@ -3224,6 +3338,10 @@ msgstr "Lee las reglas" msgid "Lev." msgstr "Apal." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "Stake fallido." @@ -3232,6 +3350,11 @@ msgstr "Stake fallido." msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." msgstr "" +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submitting..." @@ -3241,6 +3364,10 @@ msgstr "Enviando..." msgid "App" msgstr "App" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "Agregar {marketName} a Monedero" @@ -3293,6 +3420,10 @@ msgstr "Comprando..." msgid "Enter a new ratio or allowed slippage" msgstr "Ingresa una nueva proporción o deslizamiento permitido" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "Comisión UI de Intercambio" @@ -3310,6 +3441,10 @@ msgstr "Comisión de Financiación Positiva Acumulada" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "Emisor ha retirado todos los tokens del Vault de Adquisición de Afiliado" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "Dirección" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "GM puede venderse por {0} y {1} para este mercado hasta los límites de venta especificados. Los tokens restantes en la reserva están reservados para posiciones abiertas actuales." +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "Gráfico mostrando rendimiento vs benchmark durante el período seleccionado." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3463,6 +3597,7 @@ msgstr "La orden no se puede ejecutar ya que la posición restante sería menor #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx @@ -3470,10 +3605,18 @@ msgstr "La orden no se puede ejecutar ya que la posición restante sería menor msgid "Claiming..." msgstr "Reclamando..." +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "Solicitar Aumento de Mercado" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "Editar {0}" @@ -3520,6 +3663,10 @@ msgstr "La página web es una instancia desplegada y mantenida por la comunidad msgid "Deposit failed." msgstr "Depósito fallido." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "Solicitar Intercambio de Mercado" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "Liquidez insuficiente en la reserva de mercado {0}. Selecciona una reserva diferente para este mercado.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "App deshabilitada, pendiente actualización de {0}" @@ -3686,7 +3837,11 @@ msgstr "" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "Red" +msgstr "" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>cada {hours} horas{0}" msgid "Fail External Swaps" msgstr "Fallar Intercambios Externos" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "Trading Express no está disponible usando el token nativo de la red {0} msgid "Market Increase" msgstr "Aumento de Mercado" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "No hay reclamos todavía" @@ -3747,12 +3910,21 @@ msgstr "No hay reclamos todavía" msgid "Cancel Order" msgstr "Cancelar Orden" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "GMX Adquirible Reclamable" msgid "Buy {nativeTokenSymbol}" msgstr "Comprar {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Ver en Explorador" @@ -3795,10 +3968,6 @@ msgstr "Tienes múltiples órdenes límites existentes para aumentar {longOrShor msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "Después de escanear, aparecerá un mensaje de conexión para que conectes tu monedero." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "Puedes transferir AVAX desde otras redes a Avalanche usando cualquiera de las opciones abajo:" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "Red no compatible" @@ -3809,6 +3978,10 @@ msgstr "Red no compatible" msgid "Opening..." msgstr "Abriendo..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Traders Referidos en Avalanche" @@ -3940,6 +4113,10 @@ msgstr "Después de reclamar, los tokens esGMX serán enviados a tu cuenta en la msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "Comprar GLV" @@ -3970,6 +4147,7 @@ msgstr "Solicitar aumento {0} {longOrShortText}, +{1} USD, Precio Aceptable: {2} #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "Garantía En" @@ -4024,7 +4202,6 @@ msgstr "Reembolsos ganados por esta cuenta como trader." #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "Vault de Afiliado" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "Ingresa un precio" +msgstr "Introduce un precio" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,6 +4439,7 @@ msgstr "Comisiones Ganadas en {daysConsidered}d" msgid "Fulfilling order request" msgstr "Cumpliendo solicitud de orden" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "Saldo de {0} insuficiente para pagar gas" @@ -4270,10 +4448,6 @@ msgstr "Saldo de {0} insuficiente para pagar gas" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Actualmente puedes adquirir un máximo de {0} tokens esGMX a una razón de {1} {stakingToken} por 1 esGMX." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Comprar AVAX directamente en Avalanche o transferirlo allí." - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "Error preparando transacción. Proveedor no definido" msgid "Insufficient liquidity in GM Pool" msgstr "Liquidez insuficiente en Reserva GM" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "Tradea en GMX y gana <0>$250.000 en premios! Activo hasta el 30 de Noviembre, <1>haz clic aquí para aprender más." @@ -4311,7 +4489,8 @@ msgstr "Comisión de Préstamo Acumulada" msgid "Read more." msgstr "Leer más." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "Análisis de GyP" @@ -4344,7 +4523,7 @@ msgstr "<0>Las notificaciones son proporcionadas por Notifi y no afiliadas con G #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} y {avalancheLink} Reservas GLV están <0>incentivadas{sparkle}." +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "Token de Pago de Gas" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "Impacto de Precio" @@ -4485,13 +4659,18 @@ msgstr "Anuncios Técnicos de GMX" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "Stop Mercado Fallido" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "Ajustes" @@ -4548,8 +4727,15 @@ msgstr "Transferencia ya iniciada" msgid "Withdraw submitted." msgstr "Retiro enviado." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "Ingresa un código" @@ -4557,6 +4743,10 @@ msgstr "Ingresa un código" msgid "Details" msgstr "Detalles" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "Dirección NFT inválida" msgid "LIQ." msgstr "LIQ." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "Vaults de autocomposición de GLP y GMX" @@ -5134,6 +5328,11 @@ msgstr "Configuraciones One-Click" msgid "GMX Announcements" msgstr "Anuncios de GMX" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "Operaciones" msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "No hay ruta de intercambio disponible." @@ -5365,6 +5569,10 @@ msgstr "Transfiriendo" msgid "GLP autocompounding vaults" msgstr "Vaults de autocomposición de GLP" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "Órdenes TP/SL exceden la posición" @@ -5471,6 +5679,10 @@ msgstr "El tamaño de la orden es 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "El límite de compra para la reserva GM: {0} en {1} [{2}] ha sido alcanzado. Por favor, reduce el tamaño de compra, elige un token GM diferente, o cambia los tokens GM a una reserva diferente e inténtalo de nuevo." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "Cerrar {longOrShortText} {0}" @@ -5494,14 +5706,19 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "Máx. {0} dentro" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" #: src/components/EmptyTableContent/EmptyTableContent.tsx msgid "No items yet" -msgstr "No hay elementos aún" +msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough available swap liquidity to fill the order." @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "No hay posiciones abiertas" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "Tamaño, $" @@ -5566,10 +5787,6 @@ msgstr "Bonificación Retroactiva STIP.b" msgid "Referral code updated." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "Puedes comprar AVAX directamente en <0>Avalanche usando estas opciones:" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "Valor Neto: Garantía Inicial + PnL - Comisión de Préstamo - Comisión de Cierre" @@ -5742,10 +5959,6 @@ msgstr "Ejecutar Parte de Intercambio TWAP" msgid "<0>every {seconds} seconds" msgstr "<0>cada {seconds} segundos" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "Comprar o Transferir AVAX a Avalanche" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "Tienes una transferencia <0>pendiente a {pendingReceiver}." msgid "Limit size is required" msgstr "Se requiere tamaño límite" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "Tokens de Protocolo" msgid "Collateral at Liquidation" msgstr "Garantía en Liquidación" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Tras reclamar podrás adquirir un máximo de {0} esGMX en una relación de {1} {stakingToken} por 1 esGMX" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "Hoy" @@ -5958,6 +6181,10 @@ msgstr "Nivel {0} ({currentTierDiscount}% descuento)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "Esta orden usando {collateralSymbol} como garantía no será válida para la posición {longText} existente usando {symbol} como garantía." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - Agente AIGMX" @@ -6044,6 +6271,10 @@ msgstr "3er Lugar" msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "Actualizar Stop Loss" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1h" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "Balance" @@ -6147,6 +6379,7 @@ msgstr "Ganancia/Pérdida" msgid "Names could be separated by commas or spaces" msgstr "Los nombres pueden separarse por comas o espacios" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "Comprar GMX de exchanges descentralizados" @@ -6155,9 +6388,14 @@ msgstr "Comprar GMX de exchanges descentralizados" msgid "Powered by" msgstr "Impulsado por" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "El precio aceptable de la orden incluye el impacto de precio aceptable establecido. El precio de ejecución debe cumplir esta condición para que la orden se ejecute." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "Falló la descarga del CSV de historial de operaciones." msgid "market" msgstr "mercado" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "Igual que el código activo actual" @@ -6237,14 +6476,14 @@ msgstr "Comunidad GMX con iniciativas de NFTs, Trading y Educación" msgid "Liquidation Confirmations" msgstr "Confirmaciones de Liquidación" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "Precio de ejecución esperado para la orden, incluyendo el impacto de precio actual, una vez que la orden stop market se ejecute." - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "Reconocer que la época termina en {minutes} minutos" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "Alto Impacto de Precio" @@ -6257,13 +6496,9 @@ msgstr "Queremos tus insights para mejorar GMX. Por razones de seguridad, no te msgid "Claim esGMX" msgstr "Reclamar esGMX" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "Comprar o Transferir ETH a Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "Precio de ejecución esperado para la orden, incluyendo el impacto de precio actual, una vez que la orden límite se ejecute." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "Enviar" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "Copiar" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "Cantidad" @@ -6397,6 +6634,8 @@ msgstr "precio de activación" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "Reclamar" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "Impacto de Precio / Comisiones" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "El precio de ejecución de la orden tiene en cuenta el impacto del preci msgid "Buy GLP or GMX" msgstr "Comprar GLP o GMX" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6474,9 +6735,9 @@ msgstr "Introduzca una cantidad" msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "Conectar" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "Orden de cambio GM desconocida" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "El apalancamiento máximo de 100x ha sido superado, la garantía restante después de restar las pérdidas y comisiones ha sido enviada de vuelta a tu cuenta:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "Cambiando {symbol}..." @@ -6582,6 +6850,10 @@ msgstr "Airdrop GM" msgid "Save on Fees" msgstr "Ahorrar en Comisiones" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "Actualizar Take Profit" @@ -6746,7 +7018,7 @@ msgstr "Comisión de Apertura" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "Parece que no tienes un código de referido para compartir. <0/> ¡Crea uno ahora y empieza a ganar reembolsos!" @@ -6789,11 +7061,21 @@ msgstr "Tú" msgid "Deactivate 1CT (One-Click Trading)" msgstr "Desactivar 1CT (One-Click Trading)" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "Tamaño por parte" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7031,10 +7315,6 @@ msgstr "precio límite" msgid "Initial collateral (collateral excluding borrow fee)." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "Reembolsos de impacto de precio para cierres de operaciones son reclamables en la pestaña de reclamaciones. <0>Leer más." - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "Enviando solicitud de orden" @@ -7058,7 +7338,7 @@ msgstr "Comisión Máxima de Red incluye comisiones para órdenes adicionales. S #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "Reembolsos" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "Mercados GMX V1 están desactivados y solo permiten cierre de posiciones msgid "Sell failed." msgstr "Venta fallida." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "Actualizar Límite" @@ -7078,6 +7362,10 @@ msgstr "Actualizar Límite" msgid "Edit order" msgstr "Editar orden" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,6 +7391,10 @@ msgstr "Fecha" msgid "Buy GMX using FIAT gateways:" msgstr "Comprar GMX usando pasarelas FIAT:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." msgstr "" @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Capa 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "Cantidad máxima de {0} excedida" msgid "Position close disabled, pending {0} upgrade" msgstr "Cierre de posición deshabilitado, pendiente actualización de {0}" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "Intercambiando..." @@ -7280,10 +7580,18 @@ msgstr "Retiro Fallido" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "Obtenga descuentos en comisiones y gane reembolsos a través del programa de referidos de GMX.<0/>Para más información, lea los <1>detalles del programa de referidos." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "Congelar" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Cargando parámetros express..." @@ -7357,7 +7665,7 @@ msgstr "Selecciona un token de pago" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "La liquidez disponible será la menor de la diferencia entre el valor máximo y el valor actual tanto para la reserva como para el interés abierto." +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "Este código ha sido tomado por otra persona en {takenNetworkNames}, no msgid "Confirm Claim" msgstr "Confirmar Reclamación" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "Discusión comunitaria de GMX" @@ -7502,6 +7815,14 @@ msgstr "<0>La capacidad de la reserva ha sido alcanzada para {0}. Por favor use msgid "GMX dashboards and analytics." msgstr "Paneles y análisis de GMX." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "Intercambio Externo {0} a {1}" @@ -7608,6 +7929,10 @@ msgstr "Dirección inválida. Asegúrate de haber ingresado una dirección Ether msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "El remitente ha retirado todos los tokens del Vault de Adquisición GMX" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7717,6 +8042,7 @@ msgstr "Aceptar confirmación de órdenes de activación" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "Elige comprar en exchanges descentralizados o centralizados." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "" @@ -7733,6 +8059,10 @@ msgstr "{avalancheLink} Las reservas GM están <0>incentivadas{sparkle}." msgid "Shift order cancelled." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" +msgstr "" + #: src/lib/legacy.ts msgid "Order size is bigger than position, will only be executable if position increases" msgstr "El tamaño de la orden es mayor que la posición, solo se ejecutará si la posición aumenta" @@ -7754,6 +8084,10 @@ msgstr "Recompensas Totales" msgid "NFT ID" msgstr "ID de NFT" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "Exchange Perpetuo Descentralizado | GMX" @@ -7791,6 +8125,10 @@ msgstr "" msgid "Fee APY" msgstr "APY de Comisión" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "No hay mercados coincidentes." @@ -7832,7 +8170,7 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "Ocurrió un error. Por favor intenta de nuevo" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "Solo letras, números y guiones bajos están permitidos" @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "Error de generación de imagen, por favor actualice e intente de nuevo" #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "Reembolsos de Impacto de Precio" @@ -7898,7 +8237,11 @@ msgstr "Reembolsos en V1" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "Token inválido índice del token: \"{0}\" Garantía del token: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "Alertas" @@ -7943,6 +8286,8 @@ msgstr "El APR de Bonificación se airdropeará como tokens {airdropTokenTitle}. #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7955,10 +8300,6 @@ msgstr "Monedero" msgid "You have a pending transfer from {sender}." msgstr "Tienes una transferencia pendiente de {sender}." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "Una vez que el precio de referencia alcance el precio stop, la orden intentará ejecutarse." - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "Ingresa un precio de activación" @@ -8011,7 +8352,11 @@ msgstr "Protocolo Stabilize" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "Ingresa nombres de monedas válidos" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "PnL de Stop Loss" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8078,10 +8427,6 @@ msgstr "{prefix} <0>{text}" msgid "Failed to update settings" msgstr "Falló la actualización de ajustes" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "Impacto de Precio Positivo / Comisiones" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "Tweet" @@ -8119,14 +8464,14 @@ msgstr "Stop Loss Fallido" msgid "Daily Profit" msgstr "Ganancia Diaria" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." msgstr "Los tokens esGMX pueden ser stakeados o adquiridos en cualquier momento." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Compra ETH directamente en Arbitrum o transfiérelo allí." - #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" @@ -8164,6 +8509,7 @@ msgstr "2do Lugar" msgid "LAST PRICE" msgstr "ÚLTIMO PRECIO" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "Re-firmar" @@ -8184,6 +8530,11 @@ msgstr "<0>Delega tu poder de voto {0} GMX DAO no delegado antes de reclamar msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "Estarás largo en {indexSymbol} desde tu posición larga, así como desde tu garantía {collateralSymbol}. El precio de liquidación es más alto comparado con usar una stablecoin como garantía ya que el valor de la garantía cambiará con su precio." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "Precio de Ejecución" @@ -8237,7 +8587,7 @@ msgstr "Los valores de comisiones no incluyen incentivos." msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "Generar Código de Referido" @@ -8273,6 +8623,7 @@ msgstr "Depositar {0} USD en {1} {longOrShortText}" msgid "Distribution" msgstr "Distribución" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8293,10 +8644,6 @@ msgstr "Usuarios Totales" msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "Valor Neto: Garantía Inicial + PnL - Comisión de Préstamo - Comisión de Financiación Negativa - Comisión de Cierre" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "Precio de activación por debajo del precio límite más bajo" @@ -8315,7 +8662,13 @@ msgstr "Compartir Posición" msgid "Min leverage: 1.1x" msgstr "Apalancamiento Mín.: 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "Comisión de Depósito" @@ -8361,6 +8714,10 @@ msgstr "No tienes ningún trade elegible durante la ventana de competencia." msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "Precios de ejecución para incrementar largos y<0/>disminuir cortos." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "Paneles" msgid "Create TWAP {0} order" msgstr "Crear orden TWAP {0}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8398,7 +8755,7 @@ msgstr "" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7d" +msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "Reclamar Recompensas GMX" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "Ingresa Código de Referido" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 20-27 Mar" @@ -8461,6 +8814,10 @@ msgstr "Abrir {marketName} en Explorer" msgid "Partial Liquidation" msgstr "Liquidación Parcial" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "Depósito habilitado enviado." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "Retirando {0} de {positionText}" @@ -8632,6 +8993,7 @@ msgstr "Tasa neta combina comisiones de financiación y préstamo pero excluye c msgid "Accrued Price Impact Rebates" msgstr "Reembolsos de Impacto de Precio Acumulados" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "Ayer" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "Chat anónimo con GMX" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8685,14 +9049,19 @@ msgstr "Límite" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "Recibirás al menos {toAmountText} si esta orden se ejecuta. Este precio se actualiza en tiempo real basado en comisiones de intercambio e impacto de precio." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "Precio aceptable no aplica a órdenes stop loss, ya que se ejecutarán independientemente de cualquier impacto de precio." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "Luego programaremos un chat o entrevista contigo. Como agradecimiento, recibirás <0>100 <1/> por proporcionar tus comentarios." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "Posiciones {longOrShort} no pagan comisión de financiación y pagan com msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "Incrementar activo: {0}, ejecutado: {1}, cancelado: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "{0} es requerido como garantía." msgid "Decentralized Options Protocol" msgstr "Protocolo de Opciones Descentralizado" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "Actualizar Parte de Intercambio TWAP" @@ -8797,6 +9175,10 @@ msgstr "Actualizar Parte TWAP" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "Completar Transferencia de Cuenta" msgid "Claim Rewards" msgstr "Reclamar Recompensas" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "Copiar Dirección" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "Composición de Respaldo" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "Tienes {balanceFormatted} restante en tu subcuenta 1CT de versión antigua." #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "Desstakear GMX" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "" diff --git a/src/locales/fr/messages.po b/src/locales/fr/messages.po index 9c80671245..9a1a0d5656 100644 --- a/src/locales/fr/messages.po +++ b/src/locales/fr/messages.po @@ -46,6 +46,10 @@ msgstr "Protocole d'échange décentralisé" msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "" @@ -54,7 +58,8 @@ msgstr "" msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "Déconnecter" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -291,7 +297,7 @@ msgstr "Annuler l'échange limité" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}s" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}s" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -329,10 +336,6 @@ msgstr "" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "Valeur nette : Collatéral initial + PnL - Frais d'emprunt - Frais de financement négatifs - Frais de fermeture - Frais d'UI" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "L'écart est > 1%, veuillez vous assurer que les détails de la transaction sont acceptables avant de confirmer" @@ -376,10 +379,19 @@ msgstr "Take Profit échoué" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "Confirmer le règlement" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "Prix limite en dessous du prix mark" msgid "sell" msgstr "vendre" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0} ne peut pas être envoyé à des adresses de contrats intelligents. #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "Transaction échouée en raison d'une erreur RPC.<0/><1/>Veuillez activer <2>Trading Express dans les paramètres, ce qui devrait offrir une meilleure expérience." +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "Code de parrainage ajouté!" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "Analytique de données GMX V2 dans Telegram" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "Vous pouvez transférer ETH provenant d'autres réseaux vers Arbitrum en utilisant l'une des options ci-dessous :" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Ordre limite créé pour {0} {1} : {2} USD !" @@ -586,10 +616,18 @@ msgstr "Capacité maximale" msgid "Market Swap" msgstr "Swap de marché" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx msgid "More" @@ -772,6 +810,10 @@ msgstr "Taille moyenne de position." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> à {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} Short Market : {0} une position short au prix actuel." @@ -865,13 +907,19 @@ msgstr "Ouvrez des positions via une interface de swap simple. Swap commodément #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "Aucun marché correspondant" +msgstr "" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "MAX" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "Valeur de slippage invalide" @@ -889,7 +937,7 @@ msgstr "Montant achetable max {0} dépassé" msgid "Sell submitted!" msgstr "Vente soumise !" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "Code déjà pris" @@ -939,6 +987,7 @@ msgstr "Liq. {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "Payer" @@ -999,7 +1048,7 @@ msgstr "Acheter avec {0}" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "Gestion d'actifs" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (Supply)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "Des liens alternatifs peuvent être trouvés dans la section <0>docs.<1/><2/>En cliquant sur Accepter, vous acceptez les <3>Conditions générales et <4> Conditions générales de parrainage.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "Tout le temps" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "Le code de parrainage ne peut pas dépasser {MAX_REFERRAL_CODE_LENGTH} caractères." @@ -1262,6 +1315,10 @@ msgstr "FRAIS DE FINANCEMENT" msgid "Markets" msgstr "Marchés" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "Rants en temps réel sur les trades GMX" @@ -1334,6 +1391,10 @@ msgstr "Acheter token sur :" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "Swap limité échoué" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "Liq. {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "Long en cours..." @@ -1361,6 +1426,11 @@ msgstr "Remises totales" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "Ce token accumule automatiquement des frais du trading à effet de levier et des swaps pour le marché {0}. Il est également exposé à {1} et {2} selon la composition affichée." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Ordre min : {0}" @@ -1487,6 +1557,10 @@ msgstr "Transfert soumis" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "Trading en un clic désactivé. Limite d'action dépassée." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "Portefeuille NFT" msgid "GMX Proposals Voting page" msgstr "Page de vote des propositions GMX" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "Vous pouvez acheter ETH directement sur <0>Arbitrum en utilisant ces options :" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "" msgid "Search Market" msgstr "Rechercher marché" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "Le prix acceptable de l'ordre inclut l'impact de prix actuel et le slippage autorisé défini. Le prix d'exécution doit satisfaire cette condition pour que l'ordre soit exécuté." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "Une fois que le prix mark atteint le prix limite, l'ordre tentera de s'exécuter, garantissant le prix acceptable, qui inclut l'impact de prix acceptable défini. Notez que si l'impact de prix est négatif, le prix mark peut devoir être supérieur au prix limite." - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "Créer un ordre" msgid "Utilization" msgstr "Utilisation" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} pour {1}" @@ -1872,6 +1938,11 @@ msgstr "Paire" msgid "Max {0} out" msgstr "Sortir max {0}" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "Il n'y a pas d'impact de prix. Il y a un prix d'exécution unique pour augmenter les shorts ou<1/>diminuer les longs pour cette taille." @@ -1953,9 +2024,9 @@ msgstr "Afficher les détails" msgid "To reduce fees, select a different asset to pay with." msgstr "Pour réduire les frais, sélectionnez un actif différent pour payer." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "Une fois que le prix mark atteint le prix limite, l'ordre tentera de s'exécuter, garantissant le prix acceptable, qui inclut l'impact de prix acceptable défini. Notez que si l'impact de prix est négatif, le prix mark peut devoir être inférieur au prix limite." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2047,7 +2118,7 @@ msgstr "La valeur USD des frais est calculée au moment où ils sont gagnés et #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "Max" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2131,10 +2202,14 @@ msgstr "Taille" msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." msgstr "Nous valorisons votre expérience et vos insights et vous invitons à participer à un chat anonyme en tête-à-tête." +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "" + #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "<0>Lire plus sur les frais." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "Vous recevrez au moins {0} {1} si cet ordre est exécuté. Le prix d'exécution peut varier en fonction des frais de swap au moment de l'exécution de l'ordre." @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2301,6 +2380,10 @@ msgstr "Achat GLP désactivé, en attente de mise à niveau {0}" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "Swaps" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "Réservé pour le vesting" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "Glissement autorisé par défaut" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Analyses GMX de Saulius" msgid "{0} Price" msgstr "Prix {0}" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "Acheter GMX sur des services centralisés" @@ -2531,13 +2621,17 @@ msgstr "Taux de frais d'emprunt" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "Nombre maximum de parties : {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "Lancer l'application" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "{0} USD déposés sur {tokenSymbol} {longOrShortText}" @@ -2582,6 +2676,10 @@ msgstr "TAUX NET / 1 H" msgid "Vest with GMX on Avalanche" msgstr "Vester avec GMX sur Avalanche" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" msgstr "Échec de la demande de relais" @@ -2682,7 +2780,7 @@ msgstr "Ordre annulé" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "Réduire" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "Entrez jusqu'à 10 coins" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "Exposition aux tokens de soutien" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "Trader" msgid "Adding referral code failed." msgstr "L'ajout du code de parrainage a échoué." +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "Levier max sans PnL : {0}x" @@ -3011,6 +3115,10 @@ msgstr "Autoriser {tokenSymbol} à être dépensé" msgid "Help us improve" msgstr "Aidez-nous à nous améliorer" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "Un agrégat de flux de prix de qualité supérieure détermine quand les liquidations ont lieu. Cela protège les positions des oscillations temporaires." @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "Total staké" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "Frais de réseau" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "Prix d'exécution attendu pour l'ordre, incluant l'impact sur le prix actuel." - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3173,6 +3279,10 @@ msgstr "Activation des ordres envoyée." msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "Aucune réclamation ne correspond aux filtres sélectionnés" @@ -3181,6 +3291,7 @@ msgstr "Aucune réclamation ne correspond aux filtres sélectionnés" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3207,6 +3318,9 @@ msgstr "Marché" msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." msgstr "Le montant d'échange de {0} à {1} dépasse le montant acceptable de {2}. Peut seulement recevoir {3}." +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" @@ -3224,6 +3338,10 @@ msgstr "Lire les règles" msgid "Lev." msgstr "Lev." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "Échec du staking." @@ -3232,6 +3350,11 @@ msgstr "Échec du staking." msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." msgstr "" +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submitting..." @@ -3241,6 +3364,10 @@ msgstr "Soumission..." msgid "App" msgstr "Application" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "Ajouter {marketName} au portefeuille" @@ -3293,6 +3420,10 @@ msgstr "Achat..." msgid "Enter a new ratio or allowed slippage" msgstr "Entrez un nouveau ratio ou glissement autorisé" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "Frais d'interface d'échange" @@ -3310,6 +3441,10 @@ msgstr "Frais de financement positif accumulé" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "L'expéditeur a retiré tous les tokens du coffre-fort de vesting affilié" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "Direction" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "GM peut être vendu pour {0} et {1} pour ce marché jusqu'aux plafonds de vente spécifiés. Les tokens restants dans le pool sont réservés pour les positions actuellement ouvertes." +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "Graphique montrant la performance vs benchmark sur la période sélectionnée." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3463,6 +3597,7 @@ msgstr "L'ordre ne peut être exécuté car la position restante serait inférie #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx @@ -3470,10 +3605,18 @@ msgstr "L'ordre ne peut être exécuté car la position restante serait inférie msgid "Claiming..." msgstr "Réclamation en cours..." +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "Demander une augmentation du marché" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "Modifier {0}" @@ -3520,6 +3663,10 @@ msgstr "Le site web est une instance déployée et maintenue par la communauté msgid "Deposit failed." msgstr "Échec du dépôt." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "Demander un échange de marché" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "Liquidité insuffisante dans le pool de marché {0}. Sélectionnez un pool différent pour ce marché.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "Application désactivée, en attente de mise à niveau {0}" @@ -3686,7 +3837,11 @@ msgstr "" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "Réseau" +msgstr "" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>toutes les {hours} heures{0}" msgid "Fail External Swaps" msgstr "Échec des échanges externes" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "Le trading express n'est pas disponible en utilisant le token natif du r msgid "Market Increase" msgstr "Augmentation du marché" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "Pas encore de réclamations" @@ -3747,12 +3910,21 @@ msgstr "Pas encore de réclamations" msgid "Cancel Order" msgstr "Annuler l'ordre" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "GMX acquis réclamable" msgid "Buy {nativeTokenSymbol}" msgstr "Acheter {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Voir dans Explorer" @@ -3795,10 +3968,6 @@ msgstr "Vous avez plusieurs augmentations existantes {longOrShortText} {0} ordre msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "Après avoir scanné, une invite de connexion apparaîtra pour vous permettre de connecter votre portefeuille." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "Vous pouvez transférer AVAX depuis d'autres réseaux vers Avalanche en utilisant l'une des options ci-dessous :" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "Réseau non pris en charge" @@ -3809,6 +3978,10 @@ msgstr "Réseau non pris en charge" msgid "Opening..." msgstr "Ouverture..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Traders parrainés sur Avalanche" @@ -3940,6 +4113,10 @@ msgstr "Après la réclamation, les tokens esGMX seront airdroppés sur votre co msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "Acheter GLV" @@ -3970,6 +4147,7 @@ msgstr "Demander une augmentation {0} {longOrShortText}, +{1} USD, Prix acceptab #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "Collatéral En" @@ -4024,7 +4202,6 @@ msgstr "Remises obtenues par ce compte en tant que trader." #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "Coffre-fort affilié" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "Entrez un prix" +msgstr "Indiquer un prix" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,6 +4439,7 @@ msgstr "Frais gagnés sur {daysConsidered}j" msgid "Fulfilling order request" msgstr "Remplir la demande d'ordre" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "Solde {0} insuffisant pour payer le gaz" @@ -4270,10 +4448,6 @@ msgstr "Solde {0} insuffisant pour payer le gaz" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Vous pouvez actuellement vester un maximum de {0} tokens esGMX à un ratio de {1} {stakingToken} pour 1 esGMX." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Acheter AVAX directement sur Avalanche ou le transférer là-bas." - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "Erreur lors de la préparation de la transaction. Fournisseur non défin msgid "Insufficient liquidity in GM Pool" msgstr "Liquidité insuffisante dans le pool GM" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "Tradez sur GMX et gagnez <0>250.000 $ de prix ! En direct jusqu'au 30 novembre, <1>cliquez ici pour en savoir plus." @@ -4311,7 +4489,8 @@ msgstr "Frais d'emprunt accumulés" msgid "Read more." msgstr "Lire plus." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "Analyse PnL" @@ -4344,7 +4523,7 @@ msgstr "<0>Les notifications sont fournies par Notifi et non affiliées à GMX. #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} et {avalancheLink} Pools GLV sont <0>incités{sparkle}." +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "Token de paiement de gaz" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "Impact sur le prix" @@ -4485,13 +4659,18 @@ msgstr "Annonces techniques GMX" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "Stop Market échoué" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "Paramètres" @@ -4548,8 +4727,15 @@ msgstr "Transfert déjà initié" msgid "Withdraw submitted." msgstr "Retrait soumis." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "Entrez un code" @@ -4557,6 +4743,10 @@ msgstr "Entrez un code" msgid "Details" msgstr "Détails" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "Adresse NFT invalide" msgid "LIQ." msgstr "LIQ." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "Vaults d'auto-composition GLP et GMX" @@ -5134,6 +5328,11 @@ msgstr "Paramètres One-Click" msgid "GMX Announcements" msgstr "Annonces GMX" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "Opérations" msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "Aucun chemin de swap disponible." @@ -5365,6 +5569,10 @@ msgstr "Transfert en cours" msgid "GLP autocompounding vaults" msgstr "Vaults d'auto-composition GLP" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "Les ordres TP/SL dépassent la position" @@ -5471,6 +5679,10 @@ msgstr "La taille de l'ordre est 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "Le plafond d'achat pour le pool GM : {0} en {1} [{2}] a été atteint. Veuillez réduire la taille d'achat, choisir un token GM différent, ou déplacer les tokens GM vers un pool différent et réessayer." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "Fermer {longOrShortText} {0}" @@ -5494,14 +5706,19 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "Max {0} dans" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" #: src/components/EmptyTableContent/EmptyTableContent.tsx msgid "No items yet" -msgstr "Aucun élément pour le moment" +msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough available swap liquidity to fill the order." @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "Aucune position ouverte" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "Taille, $" @@ -5566,10 +5787,6 @@ msgstr "Bonus rétroactif STIP.b" msgid "Referral code updated." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "Vous pouvez acheter AVAX directement sur <0>Avalanche en utilisant ces options :" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "Valeur nette : Collatéral initial + PnL - Frais d'emprunt - Frais de clôture" @@ -5742,10 +5959,6 @@ msgstr "Exécuter la partie de swap TWAP" msgid "<0>every {seconds} seconds" msgstr "<0>toutes les {seconds} secondes" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "Acheter ou transférer AVAX vers Avalanche" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "Vous avez un <0>transfert en attente vers {pendingReceiver}." msgid "Limit size is required" msgstr "La taille limite est requise" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "Tokens du protocole" msgid "Collateral at Liquidation" msgstr "Collatéral à la liquidation" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "Après réclamation, vous pourrez vester un maximum de {0} esGMX à un ratio de {1} {stakingToken} pour 1 esGMX." +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "Aujourd'hui" @@ -5958,6 +6181,10 @@ msgstr "Tier {0} ({currentTierDiscount}% de remise)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "Cet ordre utilisant {collateralSymbol} comme collatéral ne sera pas valide pour la position {longText} existante utilisant {symbol} comme collatéral." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - Agent AIGMX" @@ -6044,6 +6271,10 @@ msgstr "3e Place" msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "Mettre à jour le Stop Loss" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1h" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "Solde" @@ -6147,6 +6379,7 @@ msgstr "Gain/Perte" msgid "Names could be separated by commas or spaces" msgstr "Les noms peuvent être séparés par des virgules ou des espaces" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "Acheter GMX sur des exchanges décentralisés" @@ -6155,9 +6388,14 @@ msgstr "Acheter GMX sur des exchanges décentralisés" msgid "Powered by" msgstr "Propulsé par" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "Le prix acceptable de l'ordre inclut l'impact sur le prix acceptable défini. Le prix d'exécution doit respecter cette condition pour que l'ordre soit exécuté." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "Échec du téléchargement du CSV d'historique de trades." msgid "market" msgstr "marché" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "Identique au code actif actuel" @@ -6237,14 +6476,14 @@ msgstr "Communauté GMX avec initiatives NFTs, Trading et Éducation" msgid "Liquidation Confirmations" msgstr "Confirmations de liquidation" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "Prix d'exécution attendu pour l'ordre, incluant l'impact sur le prix actuel, une fois que l'ordre stop market s'exécute." - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "Reconnaître que l'époque se termine dans {minutes} minutes" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "Impact élevé sur le prix" @@ -6257,13 +6496,9 @@ msgstr "Nous voulons vos insights pour améliorer GMX. Pour des raisons de sécu msgid "Claim esGMX" msgstr "Réclamer esGMX" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "Acheter ou transférer ETH vers Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "Prix d'exécution attendu pour l'ordre, incluant l'impact sur le prix actuel, une fois que l'ordre limite s'exécute." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "Soumettre" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "Copier" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "Montant" @@ -6397,6 +6634,8 @@ msgstr "prix de déclenchement" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "Réclamer" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "Impact sur le prix / Frais" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "Le prix d'exécution de l'ordre tient compte de l'impact sur le prix." msgid "Buy GLP or GMX" msgstr "Acheter GLP ou GMX" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6474,9 +6735,9 @@ msgstr "Entrez un montant" msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "Connecter" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "Ordre de déplacement GM inconnu" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "L'effet de levier maximal de 100x a été dépassé, le collatéral restant après déduction des pertes et frais a été renvoyé sur votre compte :" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "Déplacement de {symbol}..." @@ -6582,6 +6850,10 @@ msgstr "Airdrop GM" msgid "Save on Fees" msgstr "Économiser sur les frais" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "Mettre à jour le Take Profit" @@ -6746,7 +7018,7 @@ msgstr "Frais d'ouverture" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "Il semble que vous n'ayez pas de code de parrainage à partager. <0/> Créez-en un maintenant et commencez à gagner des remises !" @@ -6789,11 +7061,21 @@ msgstr "Vous" msgid "Deactivate 1CT (One-Click Trading)" msgstr "Désactiver 1CT (One-Click Trading)" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "Taille par partie" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7031,10 +7315,6 @@ msgstr "prix limite" msgid "Initial collateral (collateral excluding borrow fee)." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "Les remises d'impact sur le prix pour la clôture des trades sont réclamables sous l'onglet réclamations. <0>Lire plus." - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "Envoi de la demande d'ordre" @@ -7058,7 +7338,7 @@ msgstr "Frais de réseau maximal inclut les frais pour les ordres supplémentair #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "Remises" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "Les marchés GMX V1 sont désactivés et permettent uniquement la clôtu msgid "Sell failed." msgstr "Vente échouée." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "Mettre à jour la limite" @@ -7078,6 +7362,10 @@ msgstr "Mettre à jour la limite" msgid "Edit order" msgstr "Modifier l'ordre" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,6 +7391,10 @@ msgstr "Date" msgid "Buy GMX using FIAT gateways:" msgstr "Acheter GMX en utilisant des passerelles FIAT :" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." msgstr "" @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Couche 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "Montant max. {0} dépassé" msgid "Position close disabled, pending {0} upgrade" msgstr "Fermeture de position désactivée, mise à niveau {0} en attente" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "Échange en cours..." @@ -7280,10 +7580,18 @@ msgstr "Retrait échoué" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "Obtenez des remises sur les frais et gagnez des rabais via le programme de parrainage GMX.<0/>Pour plus d'informations, veuillez lire les <1>détails du programme de parrainage." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "Geler" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Chargement des paramètres express..." @@ -7357,7 +7665,7 @@ msgstr "Sélectionner un token de paiement" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "La liquidité disponible sera la moindre de la différence entre la valeur maximale et la valeur actuelle pour la réserve et l'intérêt ouvert." +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "Ce code a été pris par quelqu'un d'autre sur {takenNetworkNames}, vous msgid "Confirm Claim" msgstr "Confirmer la réclamation" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "Discussion de la communauté GMX" @@ -7502,6 +7815,14 @@ msgstr "<0>La capacité du pool a été atteinte pour {0}. Veuillez utiliser un msgid "GMX dashboards and analytics." msgstr "Tableaux de bord et analyses GMX." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "Échange externe {0} vers {1}" @@ -7608,6 +7929,10 @@ msgstr "Adresse invalide. Veuillez vous assurer d'avoir entré une adresse Ether msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "L'expéditeur a retiré tous les tokens du coffre de vesting GMX." +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7717,6 +8042,7 @@ msgstr "Accepter la confirmation des ordres de déclenchement" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "Choisissez d'acheter depuis des exchanges décentralisés ou centralisés." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "" @@ -7733,6 +8059,10 @@ msgstr "{avalancheLink} Les pools GM sont <0>incités{sparkle}." msgid "Shift order cancelled." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" +msgstr "" + #: src/lib/legacy.ts msgid "Order size is bigger than position, will only be executable if position increases" msgstr "La taille de l'ordre est supérieure à la position, il sera exécutable seulement si la position augmente." @@ -7754,6 +8084,10 @@ msgstr "Récompenses totales" msgid "NFT ID" msgstr "ID NFT" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "Exchange perpétuel décentralisé | GMX" @@ -7791,6 +8125,10 @@ msgstr "" msgid "Fee APY" msgstr "TAEG des frais" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "Aucun marché correspondant." @@ -7832,7 +8170,7 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "Une erreur s'est produite. Veuillez réessayer" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "Seules les lettres, les chiffres et les soulignés sont autorisés." @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "Erreur de génération d'image, veuillez rafraîchir et réessayer." #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "Rabais d'impact sur le prix" @@ -7898,7 +8237,11 @@ msgstr "Rabais sur V1" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "Token invalide indexToken : \"{0}\" collateralToken : \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "Alertes" @@ -7943,6 +8286,8 @@ msgstr "Le TAEG bonus sera airdroppé sous forme de tokens {airdropTokenTitle}. #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7955,10 +8300,6 @@ msgstr "Portefeuille" msgid "You have a pending transfer from {sender}." msgstr "Vous avez un transfert en attente de {sender}." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "Une fois que le prix de marque atteint le prix stop, l'ordre tentera de s'exécuter." - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "Saisir un prix de déclenchement" @@ -8011,7 +8352,11 @@ msgstr "Protocole Stabilize" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "Saisir des noms de coins valides" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "PnL Stop Loss" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8078,10 +8427,6 @@ msgstr "{prefix} <0>{text}" msgid "Failed to update settings" msgstr "Échec de la mise à jour des paramètres" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "Impact positif sur le prix / Frais" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "Tweet" @@ -8119,14 +8464,14 @@ msgstr "Stop Loss échoué" msgid "Daily Profit" msgstr "Profit quotidien" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." msgstr "Les tokens esGMX peuvent être stakés ou vestés à tout moment." -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Acheter ETH directement sur Arbitrum ou le transférer là-bas." - #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" @@ -8164,6 +8509,7 @@ msgstr "2e Place" msgid "LAST PRICE" msgstr "DERNIER PRIX" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "Re-signer" @@ -8184,6 +8530,11 @@ msgstr "<0>Déléguez votre pouvoir de vote {0} GMX DAO non délégué avant msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "Vous serez long {indexSymbol} depuis votre position longue, ainsi que depuis votre collatéral {collateralSymbol}. Le prix de liquidation est plus élevé par rapport à l'utilisation d'un stablecoin comme collatéral car la valeur du collatéral changera avec son prix." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "Prix d'exécution" @@ -8237,7 +8587,7 @@ msgstr "Les valeurs de frais n'incluent pas les incitations." msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "Générer un code de parrainage" @@ -8273,6 +8623,7 @@ msgstr "Déposer {0} USD dans {1} {longOrShortText}" msgid "Distribution" msgstr "Distribution" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8293,10 +8644,6 @@ msgstr "Utilisateurs totaux" msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "Valeur nette : Collatéral initial + PnL - Frais d'emprunt - Frais de financement négatifs - Frais de fermeture" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "Prix de déclenchement inférieur au prix limite le plus bas" @@ -8315,7 +8662,13 @@ msgstr "Partager la position" msgid "Min leverage: 1.1x" msgstr "Levier min. : 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "Frais de dépôt" @@ -8361,6 +8714,10 @@ msgstr "Vous n'avez aucune transaction éligible pendant la fenêtre de compéti msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "Prix d'exécution pour augmenter les longs et<0/>diminuer les shorts." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "Tableaux de bord" msgid "Create TWAP {0} order" msgstr "Créer un ordre TWAP {0}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8398,7 +8755,7 @@ msgstr "" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7j" +msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "Réclamer les récompenses GMX" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "Saisir le code de parrainage" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 20-27 Mar" @@ -8461,6 +8814,10 @@ msgstr "Ouvrir {marketName} dans l'explorateur" msgid "Partial Liquidation" msgstr "Liquidation partielle" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "Dépôt activé envoyé." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "Retrait de {0} de {positionText}" @@ -8632,6 +8993,7 @@ msgstr "Le taux net combine les frais de financement et d'emprunt mais exclut le msgid "Accrued Price Impact Rebates" msgstr "Rabais d'impact sur le prix accumulés" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "Hier" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "Chat anonyme avec GMX" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8685,14 +9049,19 @@ msgstr "Limite" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "Vous recevrez au moins {toAmountText} si cet ordre est exécuté. Ce prix est mis à jour en temps réel basé sur les frais d'échange et l'impact sur le prix." -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "Le prix acceptable ne s'applique pas aux ordres stop loss, car ils seront exécutés indépendamment de tout impact sur le prix." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "Nous planifierons ensuite un chat ou un entretien avec vous. En remerciement, vous recevrez <0>100 <1/> pour votre feedback." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "Les positions {longOrShort} ne paient pas de frais de financement et pai msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "Augmentation active : {0}, exécutée : {1}, annulée : {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "{0} est requis pour le collatéral." msgid "Decentralized Options Protocol" msgstr "Protocole d'options décentralisé" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "Mettre à jour la partie d'échange TWAP" @@ -8797,6 +9175,10 @@ msgstr "Mettre à jour la partie TWAP" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "Compléter le transfert de compte" msgid "Claim Rewards" msgstr "Réclamer les récompenses" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "Copier l'adresse" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "Composition de soutien" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "Vous avez {balanceFormatted} restant dans votre ancien sous-compte 1CT version." #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "Unstaker GMX" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "" diff --git a/src/locales/ja/messages.po b/src/locales/ja/messages.po index 993a1022c1..e9dfbffc28 100644 --- a/src/locales/ja/messages.po +++ b/src/locales/ja/messages.po @@ -46,6 +46,10 @@ msgstr "分散型取引プロトコル" msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "" @@ -54,7 +58,8 @@ msgstr "" msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "接続停止" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -291,7 +297,7 @@ msgstr "指値スワップのキャンセル" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}秒" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}秒" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -329,10 +336,6 @@ msgstr "" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "ネット価値: 初期担保 + PnL - 借入手数料 - 負のファンディング手数料 - クローズ手数料 - UI手数料" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "スプレッドが1%を超えています。確認前に取引詳細が許容可能であることを確認してください" @@ -376,10 +379,19 @@ msgstr "テイクプロフィット失敗" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "決済を確認" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "指値価格がマーク価格を下回っています" msgid "sell" msgstr "売却" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0}はスマートコントラクトアドレスに送信できません #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "RPCエラーにより取引が失敗しました。<0/><1/><2>エクスプレストレーディングを設定で有効にしてください。これによりより良い体験が得られるはずです。" +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "紹介コードが追加されました!" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "Telegram内のGMX V2データ分析" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "以下の選択肢のいずれかを使い、ETHを他のネットワークからArbitrumへ送ることができます。" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "{0} {1}: {2} USDの指値注文の作成完了!" @@ -586,10 +616,18 @@ msgstr "最大キャパシティ" msgid "Market Swap" msgstr "市場スワップ" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "" + #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx msgid "More" @@ -772,6 +810,10 @@ msgstr "平均ポジションサイズ。" msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> から {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} ショート市場: 現在の価格でショートポジションを{0}。" @@ -865,13 +907,19 @@ msgstr "シンプルなスワップインターフェースでポジションを #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "一致する市場がありません" +msgstr "" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "最大" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "無効なスリッページ値" @@ -889,7 +937,7 @@ msgstr "最大{0}購入可能額超過" msgid "Sell submitted!" msgstr "売却申し込み完了!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "そのコードは既に使用されています" @@ -939,6 +987,7 @@ msgstr "清算 {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "支払い" @@ -999,7 +1048,7 @@ msgstr "{0}で購入" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "資産管理" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (供給)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "他にもリンクが <0>文書ページにあります。<1/><2/>同意ボタンをクリックすることで、 <3>条項および<4>紹介プログラムの条項に合意したものとみなします。<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "全期間" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "紹介コードは{MAX_REFERRAL_CODE_LENGTH}文字を超えることはできません。" @@ -1262,6 +1315,10 @@ msgstr "ファンディング手数料" msgid "Markets" msgstr "市場" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "GMXトレードのリアルタイムな不満" @@ -1334,6 +1391,10 @@ msgstr "トークンを購入:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "指値スワップ失敗" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "清算 {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "ロング中..." @@ -1361,6 +1426,11 @@ msgstr "リベート総額" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "このトークンは{0}市場のレバレッジ取引とスワップから手数料を自動的に蓄積します。表示された構成に従って{1}と{2}に露出しています。" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "最低注文: {0}" @@ -1487,6 +1557,10 @@ msgstr "移転申し込み完了" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "ワンクリックトレーディング無効。アクション制限超過。" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "NFTウォレット" msgid "GMX Proposals Voting page" msgstr "GMXのプロポーザル投票ページ" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "これらのオプションを使用して<0>Arbitrumで直接ETHを購入できます:" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "" msgid "Search Market" msgstr "市場検索" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "注文の許容価格は現在の価格影響と設定された許容スリッページを含みます。執行価格はこの条件を満たす必要があります。" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "マーク価格が指値価格に達すると、注文は設定された許容価格影響を含む許容価格を保証して執行を試みます。負の価格影響がある場合、マーク価格は指値価格より高くなる必要がある可能性があります。" - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "注文の作成" msgid "Utilization" msgstr "利用率" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} を {1}に" @@ -1872,6 +1938,11 @@ msgstr "ペア" msgid "Max {0} out" msgstr "最大 {0} out" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "価格影響はありません。このサイズのショート増加またはロング減少のための単一<0/>執行価格があります。" @@ -1953,9 +2024,9 @@ msgstr "詳細を表示" msgid "To reduce fees, select a different asset to pay with." msgstr "手数料を削減するには別のアセットを支払いに使用してください。" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "マーク価格が指値価格に達すると、注文は設定された許容価格影響を含む許容価格を保証して執行を試みます。負の価格影響がある場合、マーク価格は指値価格より低くなる必要がある可能性があります。" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2047,7 +2118,7 @@ msgstr "手数料のUSD価値は獲得時に計算され、インセンティブ #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "最大" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2131,10 +2202,14 @@ msgstr "サイズ" msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." msgstr "あなたの体験と洞察を評価し、匿名の一対一チャットへの参加を招待します。" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "" + #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "手数料について<0>詳しく読む" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "この注文が執行された場合、少なくとも{0} {1}を受け取ることになります。正確な執行価格は注文執行時のスワップ手数料によって異なります。" @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2301,6 +2380,10 @@ msgstr "{0}アップグレード未完了のためGLP購入は停止中です" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "スワップ" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "べスティングのためのリザーブ" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "デフォルトの最大許容スリッページ" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMXアナリティクス" msgid "{0} Price" msgstr "{0} 価格" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "中央集権型サービスからGMXを購入" @@ -2531,13 +2621,17 @@ msgstr "借入手数料率" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "最大パート数: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "アプリ起動" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "{0} USDを {tokenSymbol} {longOrShortText}に入金済" @@ -2582,6 +2676,10 @@ msgstr "1時間あたりのネットレート" msgid "Vest with GMX on Avalanche" msgstr "AvalancheでGMXを使ってべスティングする" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" msgstr "リレヤーリクエストに失敗しました" @@ -2682,7 +2780,7 @@ msgstr "注文はキャンセルされました" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "折りたたむ" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "最大10個のコインを入力" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "バッキングトークンへのエクスポージャー" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "トレード" msgid "Adding referral code failed." msgstr "紹介コードが追加できませんでした" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "損益なしの最大レバレッジ: {0}x" @@ -3011,6 +3115,10 @@ msgstr "{tokenSymbol}の支出を許可" msgid "Help us improve" msgstr "改善をお手伝いください" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "清算が発生した時点で高品質の価格フィードの集成価格が確定します。これによりポジションは一時的変動から守られます。" @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "ステーク総額" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "ネットワーク手数料" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "現在の価格インパクトを含む注文の予想実行価格。" - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3173,6 +3279,10 @@ msgstr "注文有効化申し込み完了。" msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "選択したフィルターに一致する請求がありません" @@ -3181,6 +3291,7 @@ msgstr "選択したフィルターに一致する請求がありません" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3207,6 +3318,9 @@ msgstr "マーケット" msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." msgstr "{0}から{1}へのスワップ額が{2}の許容額を超えています。{3}のみ受け取り可能です。" +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" @@ -3224,6 +3338,10 @@ msgstr "ルールを読む" msgid "Lev." msgstr "レバレッジ" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "ステークに失敗しました。" @@ -3232,6 +3350,11 @@ msgstr "ステークに失敗しました。" msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." msgstr "" +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submitting..." @@ -3241,6 +3364,10 @@ msgstr "送信中..." msgid "App" msgstr "アプリ" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "{marketName}をウォレットに追加" @@ -3293,6 +3420,10 @@ msgstr "購入中" msgid "Enter a new ratio or allowed slippage" msgstr "新しい比率または許容スリッページを入力" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "スワップUI手数料" @@ -3310,6 +3441,10 @@ msgstr "累積ポジティブファンディング手数料" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "送信者がアフィリエイトベストボールトからすべてのトークンを出金しました" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "方向" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "このマーケットでは指定された売却上限までGMを{0}と{1}で売却できます。プールの残りのトークンは現在オープンのポジションのために予約されています。" +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "選択された期間のパフォーマンス対ベンチマークのグラフ。" -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3463,6 +3597,7 @@ msgstr "ポジション金額が$5未満になるため注文を執行できま #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx @@ -3470,10 +3605,18 @@ msgstr "ポジション金額が$5未満になるため注文を執行できま msgid "Claiming..." msgstr "請求中..." +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "マーケット増加リクエスト" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "{0}を編集" @@ -3520,6 +3663,10 @@ msgstr "ウェブサイトはオープンソースの<0>GMXフロントエンド msgid "Deposit failed." msgstr "入金失敗。" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "マーケットスワップリクエスト" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "{0}マーケットプールの流動性が不足しています。このマーケットで別のプールを選択してください。{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "{0}アップグレード待ちのためアプリ無効" @@ -3686,7 +3837,11 @@ msgstr "" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "ネットワーク" +msgstr "" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>毎 {hours}時間{0}" msgid "Fail External Swaps" msgstr "外部スワップの失敗" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "ネットワークのネイティブトークン{0}を使用したエク msgid "Market Increase" msgstr "マーケット増加" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "請求なし" @@ -3747,12 +3910,21 @@ msgstr "請求なし" msgid "Cancel Order" msgstr "注文をキャンセル" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "ベストされた請求可能GMX" msgid "Buy {nativeTokenSymbol}" msgstr "{nativeTokenSymbol}を購入" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Explorerで見る" @@ -3795,10 +3968,6 @@ msgstr "{longOrShortText} {0}のリミット注文を増額する複数の注文 msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "スキャン後、ウォレットを接続するためのプロンプトが表示されます。" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "以下のオプションのいずれかを使用して他のネットワークからAVAXをAvalancheに転送できます:" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "サポートされていないネットワーク" @@ -3809,6 +3978,10 @@ msgstr "サポートされていないネットワーク" msgid "Opening..." msgstr "オープン中..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Avalancheで紹介したトレーダー" @@ -3940,6 +4113,10 @@ msgstr "請求後7日以内に指定のネットワーク上のあなたのア msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "GLVを購入" @@ -3970,6 +4147,7 @@ msgstr "{0} {longOrShortText}の増額をリクエスト +{1} USD 可能な価 #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "担保の種類" @@ -4024,7 +4202,6 @@ msgstr "トレーダーとしてこのアカウントが獲得したリベート #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4262,6 +4439,7 @@ msgstr "{daysConsidered}日間の獲得手数料" msgid "Fulfilling order request" msgstr "注文リクエストを履行中" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "ガス支払いのための{0}残高が不足しています" @@ -4270,10 +4448,6 @@ msgstr "ガス支払いのための{0}残高が不足しています" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "{1} {stakingToken}対1 esGMXの比率で最大{0} esGMXトークンを現在べスティングすることができます。" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "AVAXをAvalancheに直接購入するか、そこに転送してください。" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "取引準備エラー。プロバイダーが定義されていません msgid "Insufficient liquidity in GM Pool" msgstr "GMプールの流動性が不足しています" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "GMXでトレードして賞金<0>250,000ドルを獲得しよう! 11月30日まで。<1>ここをクリックして詳細を知る。" @@ -4311,7 +4489,8 @@ msgstr "累積借入手数料" msgid "Read more." msgstr "詳細を読む。" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "損益分析" @@ -4344,7 +4523,7 @@ msgstr "<0>Notifiが提供する通知はGMXと提携していません。購読 #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink}および{avalancheLink} GLVプールは<0>インセンティブ付き{sparkle}。" +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "ガス支払いトークン" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "価格インパクト" @@ -4485,13 +4659,18 @@ msgstr "GMX技術発表" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "ストップマーケット失敗" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "設定" @@ -4548,8 +4727,15 @@ msgstr "移転はすでに開始されています" msgid "Withdraw submitted." msgstr "出金申し込み完了。" -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "コードを入力" @@ -4557,6 +4743,10 @@ msgstr "コードを入力" msgid "Details" msgstr "詳細" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "無効なNFTアドレス" msgid "LIQ." msgstr "清算" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "GLPおよびGMXの自動複利ボールト" @@ -5134,6 +5328,11 @@ msgstr "ワンクリック設定" msgid "GMX Announcements" msgstr "GMXのお知らせ" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "取引" msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "利用可能なスワップパスがありません。" @@ -5365,6 +5569,10 @@ msgstr "移転中..." msgid "GLP autocompounding vaults" msgstr "GLP自動複利ボールト" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "TP/SL注文がポジションを超過" @@ -5471,6 +5679,10 @@ msgstr "注文サイズがゼロです" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "プールGM: {0} の{1} [{2}]での購入可能上限に達しました。購入サイズを減らすか、別のGMトークンを選択するか、GMトークンを別のプールにシフトして再試行してください。" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "{longOrShortText} {0} をクローズ" @@ -5494,14 +5706,19 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "最大 {0} in" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" #: src/components/EmptyTableContent/EmptyTableContent.tsx msgid "No items yet" -msgstr "項目なし" +msgstr "" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Not enough available swap liquidity to fill the order." @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "オープンのポジションはありません" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "サイズ, $" @@ -5566,10 +5787,6 @@ msgstr "STIP.b 遡及ボーナス" msgid "Referral code updated." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "これらのオプションを使って<0>Avalanche上で直接AVAXを購入できます:" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "純価値: 初期担保 + PnL - 借入手数料 - クローズ手数料" @@ -5742,10 +5959,6 @@ msgstr "TWAPスワップ部分を執行" msgid "<0>every {seconds} seconds" msgstr "<0>毎 {seconds} 秒" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "AVAXを購入またはAvalancheへ移転" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "{pendingReceiver}への<0>未完了の移転 があります。" msgid "Limit size is required" msgstr "指値サイズが必要です" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "プロトコルトークン" msgid "Collateral at Liquidation" msgstr "清算時の担保" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "請求後、最大で{1} {stakingToken} 対 1esGMXトークンの比率でべスティングすることができます。" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "今日" @@ -5958,6 +6181,10 @@ msgstr "ティア {0} ({currentTierDiscount}% 割引)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "{collateralSymbol}を担保とするこの注文は、{symbol}を担保とする既存の{longText}ポジションで有効になりません。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - AIGMX Agent" @@ -6044,6 +6271,10 @@ msgstr "3位" msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "ストップロスを更新" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1 時間" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "残高" @@ -6147,6 +6379,7 @@ msgstr "勝/敗" msgid "Names could be separated by commas or spaces" msgstr "名前はコンマまたはスペースで区切ることができます" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "分散型取引所からGMXを購入" @@ -6155,9 +6388,14 @@ msgstr "分散型取引所からGMXを購入" msgid "Powered by" msgstr "提供:" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "注文の許容価格には設定された許容価格インパクトが含まれます。執行価格はこの条件を満たす必要があります。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "取引履歴CSVのダウンロードに失敗。" msgid "market" msgstr "市場" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "現在アクティブなコードと同じです" @@ -6237,14 +6476,14 @@ msgstr "NFT、取引、教育イニシアチブを持つGMXコミュニティ" msgid "Liquidation Confirmations" msgstr "清算確認" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "ストップマーケット注文が執行された場合の現在の価格インパクトを含む注文の予想執行価格。" - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "{minutes}分でエポック終了を承認" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "高い価格インパクト" @@ -6257,13 +6496,9 @@ msgstr "GMXの改善にあなたの洞察をお願いします。セキュリテ msgid "Claim esGMX" msgstr "esGMXの請求" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "ETHを購入またはArbitrumへ移転" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "指値注文が執行された場合の現在の価格インパクトを含む注文の予想執行価格。" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "提出" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "コピー" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "額" @@ -6397,6 +6634,8 @@ msgstr "トリガー価格" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "請求" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "価格インパクト / 手数料" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "注文執行価格は価格インパクトを考慮しています。" msgid "Buy GLP or GMX" msgstr "GLPまたはGMXを購入" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6474,9 +6735,9 @@ msgstr "額を入力" msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "接続" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "不明なシフトGM注文" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "最大レバレッジ100倍を超過し、損失と手数料を差し引き後に残った担保はアカウントに返送されました:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "{symbol} をシフト中..." @@ -6582,6 +6850,10 @@ msgstr "GMエアドロップ" msgid "Save on Fees" msgstr "手数料削減" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "テイクプロフィットを更新" @@ -6746,7 +7018,7 @@ msgstr "オープン手数料" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "シェアできる紹介コードがないようです。<0/> コードをいま作成して紹介報酬を稼ぎましょう!" @@ -6789,11 +7061,21 @@ msgstr "あなた" msgid "Deactivate 1CT (One-Click Trading)" msgstr "1CT (ワンクリック取引) を無効化" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "部分ごとのサイズ" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7031,10 +7315,6 @@ msgstr "指値価格" msgid "Initial collateral (collateral excluding borrow fee)." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "クローズ取引の価格インパクトリベートは請求タブで請求可能です。<0>詳細を読む。" - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "注文リクエストを送信中" @@ -7058,7 +7338,7 @@ msgstr "最大ネットワーク手数料には追加注文の手数料が含ま #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "リベート" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "GMX V1市場は無効化され、ポジションクローズのみ可能 msgid "Sell failed." msgstr "売却できませんでした。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "指値を更新" @@ -7078,6 +7362,10 @@ msgstr "指値を更新" msgid "Edit order" msgstr "注文を編集" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,6 +7391,10 @@ msgstr "日付" msgid "Buy GMX using FIAT gateways:" msgstr "FIATゲートウェイを使ってGMXを購入:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." msgstr "" @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "レイヤー1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "最大{0}額を超えました" msgid "Position close disabled, pending {0} upgrade" msgstr "ポジションクローズが無効化されました。{0}のアップグレードを待機中" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "スワップ中..." @@ -7280,10 +7580,18 @@ msgstr "出金失敗" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "GMX紹介プログラムを通じて手数料割引を受け取り、リベートを獲得。<0/>詳細は<1>紹介プログラムの詳細をお読みください。" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "凍結" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Expressパラメータを読み込み中..." @@ -7357,7 +7665,7 @@ msgstr "支払いトークンを選択" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "利用可能な流動性は、リザーブとオープンインタレストの両方について最大値と現在値の差分の小さい方になります。" +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "このコードは{takenNetworkNames}で他の誰かに取られてい msgid "Confirm Claim" msgstr "請求を確認" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "GMXコミュニティ議論" @@ -7502,6 +7815,14 @@ msgstr "<0>{0}についてプールの容量に達しました。GLPを購入す msgid "GMX dashboards and analytics." msgstr "GMXダッシュボードと分析。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "外部スワップ {0} から {1}" @@ -7608,6 +7929,10 @@ msgstr "無効なアドレスです。有効なEthereumアドレスを入力し msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "送信者はGMXベストボールトからすべてのトークンを引き出しました" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7717,6 +8042,7 @@ msgstr "トリガー注文の確認を受け入れる" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "分散型または集中型取引所から購入を選択。" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "" @@ -7733,6 +8059,10 @@ msgstr "{avalancheLink} GMプールは<0>インセンティブ付き{sparkle}。 msgid "Shift order cancelled." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" +msgstr "" + #: src/lib/legacy.ts msgid "Order size is bigger than position, will only be executable if position increases" msgstr "注文サイズがポジションより大きいため、ポジションが増加した場合のみ執行可能です" @@ -7754,6 +8084,10 @@ msgstr "総報酬" msgid "NFT ID" msgstr "NFT ID" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "分散型永久取引所 | GMX" @@ -7791,6 +8125,10 @@ msgstr "" msgid "Fee APY" msgstr "手数料APY" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "一致するマーケットがありません。" @@ -7832,7 +8170,7 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "エラーが発生しました。再度お試しください" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "文字、数字、アンダースコアのみ許可されます。" @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "画像生成エラー。更新して再度試してください。" #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "価格インパクトリベート" @@ -7898,7 +8237,11 @@ msgstr "V1のリベート" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "無効なトークン indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "アラート" @@ -7943,6 +8286,8 @@ msgstr "ボーナスAPRは{airdropTokenTitle}トークンとしてエアドロ #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7955,10 +8300,6 @@ msgstr "ウォレット" msgid "You have a pending transfer from {sender}." msgstr "{sender}からの保留中の転送があります。" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "マーク価格がストップ価格に達すると、注文が執行を試みます。" - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "トリガー価格を入力" @@ -8011,7 +8352,11 @@ msgstr "Stabilizeプロトコル" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "有効なコイン名を入力" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "ストップロスPnL" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8078,10 +8427,6 @@ msgstr "{prefix} <0>{text}" msgid "Failed to update settings" msgstr "設定更新に失敗" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "ポジティブ価格インパクト / 手数料" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "ツイート" @@ -8119,14 +8464,14 @@ msgstr "ストップロス失敗" msgid "Daily Profit" msgstr "日次利益" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." msgstr "esGMXトークンはいつでもステークまたはベストできます。" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "ArbitrumでETHを直接購入するか、そこへ転送してください。" - #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" @@ -8164,6 +8509,7 @@ msgstr "2位" msgid "LAST PRICE" msgstr "最終価格" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "再署名" @@ -8184,6 +8530,11 @@ msgstr "<0>請求前に未委任の{0} GMX DAO投票権を委任。" msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "ロングポジションと{collateralSymbol}担保から{indexSymbol}をロングします。担保価値が価格とともに変化するため、ステーブルコイン担保使用時より清算価格が高くなります。" @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "執行価格" @@ -8237,7 +8587,7 @@ msgstr "手数料値はインセンティブを含みません。" msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "紹介コード生成" @@ -8273,6 +8623,7 @@ msgstr "{0} USDを {1} {longOrShortText} に入金" msgid "Distribution" msgstr "分配" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8293,10 +8644,6 @@ msgstr "総ユーザー" msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "ネット価値: 初期担保 + PnL - 借入手数料 - ネガティブファンディング手数料 - クローズ手数料" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "トリガー価格が最低リミット価格を下回っています" @@ -8315,7 +8662,13 @@ msgstr "ポジション共有" msgid "Min leverage: 1.1x" msgstr "最小レバレッジ: 1.1倍" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "入金手数料" @@ -8361,6 +8714,10 @@ msgstr "コンペティション期間中に適格な取引がありません。 msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "ロング増加と<0/>ショート減少の執行価格。" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "ダッシュボード" msgid "Create TWAP {0} order" msgstr "TWAP {0}注文を作成" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8398,7 +8755,7 @@ msgstr "" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7日" +msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "GMX報酬を請求" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "紹介コードを入力" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844、3月20-27日" @@ -8461,6 +8814,10 @@ msgstr "{marketName}をエクスプローラーで開く" msgid "Partial Liquidation" msgstr "部分的清算" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "デポジットの有効化が送信されました。" msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "{positionText}から{0}を出金中" @@ -8632,6 +8993,7 @@ msgstr "ネットレートはファンディングと借入手数料を組み合 msgid "Accrued Price Impact Rebates" msgstr "蓄積価格インパクトリベート" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "昨日" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "GMXとの匿名チャット" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8685,14 +9049,19 @@ msgstr "リミット" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "この注文が執行された場合、少なくとも{toAmountText}を受け取ります。この価格はスワップ手数料と価格インパクトに基づいてリアルタイムで更新されます。" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "許容価格はストップロス注文に適用されず、価格インパクトに関わらず執行されます。" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "あなたとチャットまたはインタビューをスケジュールします。フィードバック提供の感謝として<0>100 <1/>をお受け取りください。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "{longOrShort}ポジションはファンディング手数料を支払 msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "増加 アクティブ: {0}、執行済: {1}、キャンセル済: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "担保に{0}が必要です。" msgid "Decentralized Options Protocol" msgstr "分散型オプションプロトコル" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "TWAPスワップパートを更新" @@ -8797,6 +9175,10 @@ msgstr "TWAPパートを更新" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "アカウント転送完了" msgid "Claim Rewards" msgstr "報酬を請求" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "アドレスをコピー" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "裏付け構成" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "古いバージョン1CTサブアカウントに{balanceFormatted}が残っています。" #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "GMXをアンストーク" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "" diff --git a/src/locales/ko/messages.po b/src/locales/ko/messages.po index a00ce352c0..e441a0a60c 100644 --- a/src/locales/ko/messages.po +++ b/src/locales/ko/messages.po @@ -40,21 +40,26 @@ msgstr "선택한 네트워크에서 이용가능" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Decentralized Trading Protocol" -msgstr "탈중앙화 트레이딩 프로토콜" +msgstr "탈중앙화 트레이딩 프로토콜<<<<<<< HEAD" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "연결 끊기" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -278,7 +284,7 @@ msgstr "{0}은 지정된 구매 상한까지 이 마켓의 GM 구매에 사용 #: src/components/Synthetics/TradeHistory/keys.ts msgid "Execute Market Swap" -msgstr "마켓 스왑 실행" +msgstr "" #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx #: src/pages/Dashboard/StatsCard.tsx @@ -291,7 +297,7 @@ msgstr "지정가 스왑 취소" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}초" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}초" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -327,11 +334,7 @@ msgstr "" #: src/components/Errors/errorToasts.tsx msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "순 가치: 초기 담보 + PnL - 차용 수수료 - 음의 펀딩 수수료 - 종료 수수료 - UI 수수료" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" @@ -376,10 +379,19 @@ msgstr "익절 실패" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "정산 확인" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "지정가 가격이 마크 가격 미만" msgid "sell" msgstr "판매" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0}은 스마트 컨트랙트 주소로 보낼 수 없습니다. 다른 #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "RPC 오류로 트랜잭션 실패.<0/><1/>설정에서 <2>익스프레스 트레이딩을 활성화하세요. 더 나은 경험을 제공할 것입니다." +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "RPC 오류로 트랜잭션 실패.<0/><1/>설정에서 <2>익스프레스 트레이딩을 활성화하세요. 더 나은 경험을 제공할 것입니다.>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "텔레그램 내 GMX V2 데이터 분석" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "아래의 옵션중 하나를 사용해, ETH를 Arbitrum에 보낼 수 있습니다." - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "{0} {1}: {2} USD의 지정가 주문을 생성하였습니다!" @@ -586,9 +616,17 @@ msgstr "최대 수용량" msgid "Market Swap" msgstr "마켓 스왑" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx @@ -772,6 +810,10 @@ msgstr "평균 포지션 크기." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> to {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} 숏 마켓: 현재 가격으로 숏 포지션 {0}." @@ -861,17 +903,23 @@ msgstr "GM으로 크로스체인 원클릭 예치" #: src/pages/Home/Home.tsx msgid "Open positions through a simple swap interface. Conveniently swap from any supported asset into the position of your choice." -msgstr "간단한 스왑 인터페이스를 통해 포지션을 열어보세요. 지원되는 자산내에서 원하는 포지션으로 편리하게 스왑할 수 있습니다." +msgstr "간단한 스왑 인터페이스를 통해 포지션을 열어보세요. 지원되는 자산내에서 원하는 포지션으로 편리하게 스왑할 수 있습니다.<<<<<<< HEAD" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "일치하는 마켓 없음" +msgstr "일치하는 마켓 없음>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "최대" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "유효하지 않은 슬리피지 값" @@ -887,9 +935,9 @@ msgstr "최대 {0} 구매 가능 금액 초과" #: src/components/Glp/GlpSwap.jsx msgid "Sell submitted!" -msgstr "판매 제출 완료!" +msgstr "판매 제출 완료!<<<<<<< HEAD" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "이미 사용된 코드입니다" @@ -939,6 +987,7 @@ msgstr "청산 {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "지불" @@ -999,7 +1048,7 @@ msgstr "{0}로 구매" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "자산 관리" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (공급)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "이외의 링크는 <0>docs에서 확인할 수 있습니다.<1/><2/>동의 버튼을 클릭하여 <3>T&Cs 그리고 <4>Referral T&Cs에 동의합니다.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "전체 기간" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "추천인 코드의 길이는 {MAX_REFERRAL_CODE_LENGTH}글자를 넘을 수 없습니다." @@ -1262,6 +1315,10 @@ msgstr "펀딩 수수료" msgid "Markets" msgstr "마켓" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "GMX 거래에 대한 실시간 란트" @@ -1334,6 +1391,10 @@ msgstr "토큰 구매:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "지정가 스왑 실패" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "청산 {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "롱 실행중..." @@ -1361,6 +1426,11 @@ msgstr "총 소개 보수" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "이 토큰은 {0} 마켓의 레버리지 트레이딩 및 스왑에서 수수료가 자동 누적됩니다. 표시된 구성에 따라 {1} 및 {2}에 노출됩니다." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "최소 주문: {0}" @@ -1487,6 +1557,10 @@ msgstr "전송 제출 완료" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "원클릭 트레이딩 비활성화. 액션 제한 초과." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1617,11 +1691,7 @@ msgstr "NFT 지갑" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX Proposals Voting page" -msgstr "GMX 프로포절 투표 페이지" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "<0>Arbitrum에서 직접 ETH 구매 가능:" +msgstr "GMX 프로포절 투표 페이지<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1664,15 +1734,7 @@ msgstr "" #: src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Search Market" -msgstr "마켓 검색" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "주문의 허용 가격은 현재 가격 영향 및 설정된 허용 슬리피지를 포함합니다. 실행 가격이 이 조건을 충족해야 주문이 실행됩니다." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "마크 가격이 지정가 가격에 도달하면 주문이 실행을 시도하며, 설정된 허용 가격 영향을 포함한 허용 가격을 보장합니다. 음의 가격 영향이 있으면 마크 가격이 지정가 가격보다 높아야 할 수 있습니다." +msgstr "마켓 검색<<<<<<< HEAD=======" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx @@ -1777,6 +1839,10 @@ msgstr "주문 생성" msgid "Utilization" msgstr "이용률" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0}을 {1}로" @@ -1872,6 +1938,11 @@ msgstr "페어" msgid "Max {0} out" msgstr "최대 {0} 아웃" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "가격 영향 없음. 이 크기에 대해 숏 증가 또는 롱 감소에 대한 단일<0/>실행 가격이 있습니다." @@ -1951,11 +2022,11 @@ msgstr "세부 사항 표시" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx msgid "To reduce fees, select a different asset to pay with." -msgstr "수수료를 줄이기 위해서는 다른 자산으로 지불해주세요." +msgstr "수수료를 줄이기 위해서는 다른 자산으로 지불해주세요.<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "마크 가격이 지정가 가격에 도달하면 주문이 실행을 시도하며, 설정된 허용 가격 영향을 포함한 허용 가격을 보장합니다. 음의 가격 영향이 있으면 마크 가격이 지정가 가격보다 낮아야 할 수 있습니다." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "=======" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2047,7 +2118,7 @@ msgstr "수수료의 USD 가치는 적립 시 계산되며 인센티브를 포 #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "최대" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2129,12 +2200,16 @@ msgstr "크기" #: src/components/InterviewToast/InterviewToast.tsx msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." -msgstr "귀하의 경험과 통찰을 소중히 여기며 익명 일대일 채팅 참여를 초대합니다." +msgstr "귀하의 경험과 통찰을 소중히 여기며 익명 일대일 채팅 참여를 초대합니다.<<<<<<< HEAD" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "=======" #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "수수료에 대해 <0>더 읽기" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "해당 주문이 실행되게 되면 최소 {0} {1}을 받을 수 있습니다. 정확한 실행가격은 주문이 실행된 스왑 수수료에 의해 상이합니다." @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2295,12 +2374,16 @@ msgstr "탈중앙화 금융 대시보드" #: src/components/Glp/GlpSwap.jsx msgid "GLP buy disabled, pending {0} upgrade" -msgstr "{0} 업그레이드를 위해 GLP 구매가 비활성화되었습니다" +msgstr "{0} 업그레이드를 위해 GLP 구매가 비활성화되었습니다<<<<<<< HEAD" #: src/components/Synthetics/PositionEditor/PositionEditorAdvancedRows.tsx msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "스왑" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "베스팅 예약" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "기본 허용 슬리피지" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX 분석" msgid "{0} Price" msgstr "{0} 가격" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "중앙화 서비스에서 GMX 구매" @@ -2531,13 +2621,17 @@ msgstr "차입 수수료율" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "최대 부분 수: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "앱 실행하기" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "{0} USD를 {tokenSymbol} {longOrShortText}으로 입금 완료" @@ -2580,7 +2674,11 @@ msgstr "1시간 당 순 수수료율" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Vest with GMX on Avalanche" -msgstr "Avalanche에서 GMX로 베스팅하기" +msgstr "Avalanche에서 GMX로 베스팅하기<<<<<<< HEAD" + +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" @@ -2678,11 +2776,11 @@ msgstr "언스테이킹 실패" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Order cancelled" -msgstr "주문 최소됨" +msgstr "주문 최소됨<<<<<<< HEAD" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "접기" +msgstr "접기>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "최대 10개의 코인 입력" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "기반 토큰 노출" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2951,12 +3049,18 @@ msgstr "트레이드" #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding referral code failed." -msgstr "추천 코드 추가 실패" +msgstr "추천 코드 추가 실패<<<<<<< HEAD" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "PnL 제외 최대 레버리지: {0}x" @@ -3011,6 +3115,10 @@ msgstr "{tokenSymbol} 지출 허용" msgid "Help us improve" msgstr "개선 도와주기" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "고품질의 여러 가격 피드를 통해 청산 발생 시기를 결정합니다. 이것은 일시적인 가격 변화로부터 포지션을 안전하게 유지합니다." @@ -3141,15 +3249,13 @@ msgid "Total Staked" msgstr "총 스테이킹" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" -msgstr "네트워크 수수료" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "현재 가격 영향을 포함한 주문의 예상 실행 가격." +msgstr "네트워크 수수료<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx @@ -3167,12 +3273,16 @@ msgstr "레버리지" #: src/pages/Exchange/Exchange.tsx msgid "Enable orders sent." -msgstr "주문 유효화 제출 완료" +msgstr "주문 유효화 제출 완료<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "선택한 필터와 일치하는 수령이 없습니다" @@ -3181,6 +3291,7 @@ msgstr "선택한 필터와 일치하는 수령이 없습니다" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3205,12 +3316,15 @@ msgstr "마켓" #: src/components/Exchange/PositionSeller.jsx msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." -msgstr "{0}에서 {1}로 스왑 금액이 {2} 허용 금액을 초과합니다. {3}만 수령할 수 있습니다." +msgstr "{0}에서 {1}로 스왑 금액이 {2} 허용 금액을 초과합니다. {3}만 수령할 수 있습니다.<<<<<<< HEAD=======" +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/PositionEditor.jsx msgid "Withdraw disabled, pending {0} upgrade" @@ -3224,12 +3338,21 @@ msgstr "규칙 읽기" msgid "Lev." msgstr "레버리지" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "스테이킹 실패" #: src/components/Exchange/ConfirmationBox.jsx msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -3241,6 +3364,10 @@ msgstr "제출 중..." msgid "App" msgstr "앱" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "{marketName}을 지갑에 추가" @@ -3293,6 +3420,10 @@ msgstr "구매중..." msgid "Enter a new ratio or allowed slippage" msgstr "새 비율 또는 허용 슬리피지 입력" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "스왑 UI 수수료" @@ -3310,6 +3441,10 @@ msgstr "누적 양의 자금 수수료" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "발신자가 어필리에이트 베스팅 볼트에서 모든 토큰을 인출함" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "방향" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "이 시장에서 GM은 지정된 판매 상한까지 {0} 및 {1}로 판매될 수 있습니다. 풀의 나머지 토큰은 현재 열린 포지션에 예약됩니다." +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "선택 기간 동안 벤치마크 대비 성과를 보여주는 그래프." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3450,12 +3584,12 @@ msgstr "지정가 - 숏 증가" #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" -msgstr "정산 요청 전송 중" +msgstr "정산 요청 전송 중<<<<<<< HEAD=======" #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Express params loading" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Order cannot be executed as the remaining position would be smaller than $5.00" @@ -3463,17 +3597,26 @@ msgstr "포지션의 금액이 $5.00 이하로 남게되면 주문은 실행될 #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx #: src/pages/Stake/ClaimModal.tsx msgid "Claiming..." -msgstr "수령중..." +msgstr "수령중...<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "마켓 증가 요청" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "{0} 편집" @@ -3520,6 +3663,10 @@ msgstr "웹사이트는 오픈소스인 <0>GMX front end를 이용하고 커 msgid "Deposit failed." msgstr "입금 실패" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "마켓 스왑 요청" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "{0} 시장 풀의 유동성 부족. 이 시장에 대해 다른 풀을 선택하세요.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "{0} 업그레이드 대기 중 앱 비활성화" @@ -3682,11 +3833,15 @@ msgstr "GLV는 GMX V2 볼트의 유동성 제공자 토큰입니다. 여러 GM #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "Yes, GLV is fully liquid and permissionless. You can sell via the GMX interface to redeem for underlying assets, with low fees." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "네트워크" +msgstr "네트워크>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>매 {hours} 시간{0}" msgid "Fail External Swaps" msgstr "외부 스왑 실패" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "네트워크의 네이티브 토큰 {0}을 사용한 익스프레스 거 msgid "Market Increase" msgstr "시장 증가" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "수령 없음" @@ -3747,12 +3910,21 @@ msgstr "수령 없음" msgid "Cancel Order" msgstr "주문 취소" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "베스팅된 수령 가능 GMX" msgid "Buy {nativeTokenSymbol}" msgstr "{nativeTokenSymbol} 구매" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Explorer에서 보기" @@ -3793,11 +3966,7 @@ msgstr "{longOrShortText} {0}에 대한 복수의 지정가 주문이 존재합 #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "After you scan, a connection prompt will appear for you to connect your wallet." -msgstr "스캔 후, 지갑을 연결할 수 있는 연결 프롬프트가 나타납니다." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "아래 옵션 중 하나를 사용하여 다른 네트워크에서 AVAX를 Avalanche로 이전할 수 있습니다:" +msgstr "스캔 후, 지갑을 연결할 수 있는 연결 프롬프트가 나타납니다.<<<<<<< HEAD=======" #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" @@ -3809,6 +3978,10 @@ msgstr "지원되지 않는 네트워크" msgid "Opening..." msgstr "여는 중..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Avalanche에서 추천된 거래자" @@ -3934,12 +4107,16 @@ msgstr "가격 영향이 없습니다. 이 크기로 롱 증가 또는 숏 감 #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." -msgstr "수령 후, esGMX 토큰은 7일 이내에 선택한 네트워크의 계정으로 에어드랍됩니다." +msgstr "수령 후, esGMX 토큰은 7일 이내에 선택한 네트워크의 계정으로 에어드랍됩니다.<<<<<<< HEAD" #: src/components/Exchange/PositionEditor.jsx msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "GLV 구매" @@ -3970,6 +4147,7 @@ msgstr "{0} {longOrShortText} 증가 요청, +{1} USD, 허용가능한 가격: { #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "담보 자산" @@ -4024,7 +4202,6 @@ msgstr "트레이더로서 이 계정이 획득한 소개 보수." #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "어필리에이트 볼트" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "가격 입력" +msgstr "가격 입력<<<<<<< HEAD" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,17 +4439,14 @@ msgstr "{daysConsidered}일 획득 수수료" msgid "Fulfilling order request" msgstr "주문 요청 이행 중" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "가스 지불을 위한 {0} 잔액 부족" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." -msgstr "{1} {stakingToken} 대 1 esGMX 비율로 최대 {0} esGMX 토큰을 현재 베스팅 할 수 있습니다." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Avalanche로 직접 AVAX 구매 또는 이전." +msgstr "{1} {stakingToken} 대 1 esGMX 비율로 최대 {0} esGMX 토큰을 현재 베스팅 할 수 있습니다.<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "트랜잭션 준비 오류. 제공자가 정의되지 않음" msgid "Insufficient liquidity in GM Pool" msgstr "GM 풀의 유동성 부족" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "GMX에서 트레이드하고 <0>$250.000 상금을 획득하세요! 11월 30일까지 진행되며, <1>여기를 클릭해 더 많은 정보를 확인하세요." @@ -4311,7 +4489,8 @@ msgstr "누적 차입 수수료" msgid "Read more." msgstr "더 읽기." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "PnL 분석" @@ -4344,7 +4523,7 @@ msgstr "<0>알림은 Notifi에서 제공되며 GMX와 무관합니다. 구독 #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} 및 {avalancheLink} GLV 풀은 <0>인센티브{sparkle}." +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "가스 지불 토큰" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "가격 영향" @@ -4485,13 +4659,18 @@ msgstr "GMX 기술 공지" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "스탑 마켓 실패" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "설정" @@ -4548,8 +4727,15 @@ msgstr "이전이 이미 시작됐습니다" msgid "Withdraw submitted." msgstr "인출 제출 완료." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "코드 입력" @@ -4557,6 +4743,10 @@ msgstr "코드 입력" msgid "Details" msgstr "상세" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "유효하지 않은 NFT 주소" msgid "LIQ." msgstr "청산" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "GLP 및 GMX 자동 복리 볼트" @@ -5134,6 +5328,11 @@ msgstr "원클릭 설정" msgid "GMX Announcements" msgstr "GMX 발표" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5230,6 +5430,10 @@ msgstr "거래" msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "사용 가능한 스왑 경로가 없습니다." @@ -5365,6 +5569,10 @@ msgstr "이전 중" msgid "GLP autocompounding vaults" msgstr "GLP 자동 복리 볼트" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "TP/SL 주문이 포지션을 초과합니다" @@ -5471,6 +5679,10 @@ msgstr "주문 크기가 0입니다" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "풀 GM: {1} [{2}]의 {0} 구매 가능 상한에 도달했습니다. 구매 크기를 줄이거나 다른 GM 토큰을 선택하거나 GM 토큰을 다른 풀로 이전한 후 다시 시도해주세요." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "{longOrShortText} {0} 종료" @@ -5492,9 +5704,14 @@ msgstr "TP/SL" #: src/components/Exchange/PositionSeller.jsx #: src/components/Exchange/SwapBox.jsx msgid "Max {0} in" -msgstr "최대 {0} in" +msgstr "최대 {0} in<<<<<<< HEAD" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "열려 있는 포지션 없음" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "크기, $" @@ -5564,11 +5785,7 @@ msgstr "STIP.b 소급 보너스" #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code updated." -msgstr "" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "<0>Avalanche에서 직접 AVAX를 구매할 수 있습니다:" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" @@ -5740,11 +5957,7 @@ msgstr "TWAP 스왑 부분 실행" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {seconds} seconds" -msgstr "<0>매 {seconds} 초" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "AVAX 구매 또는 Avalanche로 전송" +msgstr "<0>매 {seconds} 초<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "{pendingReceiver}로 <0>보류 중인 전송이 있습니다." msgid "Limit size is required" msgstr "지정가 크기가 필요합니다" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "프로토콜 토큰" msgid "Collateral at Liquidation" msgstr "청산 시 담보" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "수령 후 {1} {stakingToken} 대 1 esGMX 비율로 최대 {0} esGMX를 베스팅할 수 있습니다." +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "오늘" @@ -5958,6 +6181,10 @@ msgstr "티어 {0} ({currentTierDiscount}% 할인)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "{collateralSymbol}을 담보로 사용하는 이 주문은 {symbol}을 담보로 사용하는 기존 {longText} 포지션에 유효하지 않습니다." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Generative Market eXplore - AIGMX 에이전트" @@ -6038,12 +6265,16 @@ msgstr "인출 완료!" #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx msgid "3rd Place" -msgstr "3위" +msgstr "3위<<<<<<< HEAD" #: src/components/SettingsModal/TradingSettings.tsx msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "손절 업데이트" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1시간" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "잔고" @@ -6147,17 +6379,23 @@ msgstr "승/패" msgid "Names could be separated by commas or spaces" msgstr "이름은 쉼표 또는 공백으로 구분될 수 있습니다" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "분산 거래소에서 GMX 구매" #: src/components/NotifyModal/NotifyModal.tsx msgid "Powered by" -msgstr "Powered by" +msgstr "Powered by<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "주문의 허용 가격에는 설정된 허용 가격 영향이 포함됩니다. 실행 가격은 주문 실행을 위해 이 조건을 충족해야 합니다." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "거래 내역 CSV 다운로드 실패." msgid "market" msgstr "시장" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "현재 활성 코드와 동일" @@ -6235,16 +6474,16 @@ msgstr "NFT, 거래 및 교육 이니셔티브를 가진 GMX 커뮤니티" #: src/components/NotifyModal/NotifyModal.tsx msgid "Liquidation Confirmations" -msgstr "청산 확인" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "스톱 마켓 주문이 실행되면 현재 가격 영향을 포함한 주문의 예상 실행 가격." +msgstr "청산 확인<<<<<<< HEAD=======" #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "{minutes} 분 후 에포크 종료 인정" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "높은 가격 영향" @@ -6255,19 +6494,15 @@ msgstr "GMX 개선을 돕기 위해 귀하의 통찰을 원합니다. 보안 이 #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Claim esGMX" -msgstr "esGMX 수령" +msgstr "esGMX 수령<<<<<<< HEAD" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "ETH 구매 또는 Arbitrum으로 전송" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "지정가 주문이 실행되면 현재 가격 영향을 포함한 주문의 예상 실행 가격." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "of open fee" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "제출" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "복사" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "수량" @@ -6397,6 +6634,8 @@ msgstr "트리거 가격" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "수령" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "가격 영향 / 수수료" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "주문 실행 가격은 가격 영향을 고려합니다." msgid "Buy GLP or GMX" msgstr "GLP 또는 GMX 구매" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6474,9 +6735,9 @@ msgstr "금액 입력" msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "연결" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "알 수 없는 GM 이전 주문" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "최대 레버리지 100x 초과, 손실 및 수수료 공제 후 남은 담보가 계정으로 반환됨:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "{symbol} 이전 중..." @@ -6582,6 +6850,10 @@ msgstr "GM 에어드랍" msgid "Save on Fees" msgstr "수수료 절약" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "이익 실현 업데이트" @@ -6746,7 +7018,7 @@ msgstr "개설 수수료" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "공유할 추천 코드가 없는 것 같습니다. <0/> 지금 생성하여 리베이트를 벌기 시작하세요!" @@ -6789,11 +7061,21 @@ msgstr "당신" msgid "Deactivate 1CT (One-Click Trading)" msgstr "1CT(원클릭 거래) 비활성화" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "부분당 크기" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7029,11 +7313,7 @@ msgstr "지정가" #: src/components/Exchange/PositionSeller.jsx msgid "Initial collateral (collateral excluding borrow fee)." -msgstr "" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "거래 종료에 대한 가격 영향 리베이트는 청구 탭에서 수령 가능합니다. <0>더 읽기." +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" @@ -7058,7 +7338,7 @@ msgstr "최대 네트워크 수수료에는 추가 주문 수수료가 포함됩 #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "리베이트" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "GMX V1 시장은 비활성화되어 포지션 종료만 허용됩니다. msgid "Sell failed." msgstr "판매 실패" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "지정가 업데이트" @@ -7078,6 +7362,10 @@ msgstr "지정가 업데이트" msgid "Edit order" msgstr "주문 수정" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,9 +7391,13 @@ msgstr "날짜" msgid "Buy GMX using FIAT gateways:" msgstr "FIAT 게이트웨이를 사용하여 GMX 구매:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/PositionSeller.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "레이어 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "최대 {0} 수량 초과" msgid "Position close disabled, pending {0} upgrade" msgstr "포지션 종료 비활성화, {0} 업그레이드 대기 중" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "스왑 중..." @@ -7280,10 +7580,18 @@ msgstr "출금 실패" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "GMX 추천 프로그램을 통해 수수료 할인과 리베이트를 받으세요.<0/>자세한 정보는 <1>추천 프로그램 세부 사항을 읽어주세요." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "동결" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "익스프레스 파라미터 로딩 중..." @@ -7357,7 +7665,7 @@ msgstr "지불 토큰 선택" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "사용 가능한 유동성은 예비금과 미결제약정의 최대값과 현재값 차이 중 작은 값입니다." +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "이 코드는 {takenNetworkNames}에서 다른 사람이 사용 중입 msgid "Confirm Claim" msgstr "수령 확인" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "GMX 커뮤니티 토론" @@ -7502,6 +7815,14 @@ msgstr "<0>{0}에 대한 풀 용량이 도달했습니다. 다른 토큰으로 G msgid "GMX dashboards and analytics." msgstr "GMX 대시보드 및 분석." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "{0}을 {1}로 외부 스왑" @@ -7608,6 +7929,10 @@ msgstr "유효하지 않은 주소. 유효한 이더리움 주소를 입력했 msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "보낸 사람이 GMX 베스팅 볼트에서 모든 토큰을 인출했습니다." +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7627,11 +7952,11 @@ msgstr "{increaseOrDecreaseText} {tokenText}를 {sizeText}만큼" #: src/components/Exchange/PositionSeller.jsx msgid "Neither collateral nor realized PnL is enough to cover pending fees. Please close a larger position amount." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/SettingsModal/ThemeSelector.tsx msgid "Dark" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Stake/UnstakeModal.tsx msgid "{0}<0>You will earn {1}% less rewards with this action." @@ -7717,9 +8042,10 @@ msgstr "트리거 주문 확인 수락" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "탈중앙화 또는 중앙화 거래소에서 구매 선택." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" -msgstr "" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/Ecosystem.tsx msgid "GMX ecosystem pages." @@ -7731,6 +8057,10 @@ msgstr "{avalancheLink} GM 풀은 <0>인센티브{sparkle}." #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Shift order cancelled." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" msgstr "" #: src/lib/legacy.ts @@ -7752,7 +8082,11 @@ msgstr "총 보상" #: src/pages/NftWallet/NftWallet.jsx msgid "NFT ID" -msgstr "NFT ID" +msgstr "NFT ID<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" @@ -7781,16 +8115,20 @@ msgstr "추천 약관" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter unique coins" -msgstr "고유 코인 입력" +msgstr "고유 코인 입력<<<<<<< HEAD=======" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "The execution price didn't meet the acceptable price condition. The order will get filled when the condition is met." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/GmList/FeeApyLabel.tsx msgid "Fee APY" msgstr "수수료 APY" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "일치하는 시장 없음." @@ -7832,13 +8170,13 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "오류 발생. 다시 시도하세요" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "문자, 숫자 및 언더스코어만 허용됩니다." #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High TWAP network fee" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "APY" @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "이미지 생성 오류. 새로고침 후 다시 시도." #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "가격 영향 리베이트" @@ -7898,7 +8237,11 @@ msgstr "V1 리베이트" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "유효하지 않은 토큰 indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "알림" @@ -7943,6 +8286,8 @@ msgstr "보너스 APR은 {airdropTokenTitle} 토큰으로 에어드랍됩니다. #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7953,11 +8298,7 @@ msgstr "지갑" #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "You have a pending transfer from {sender}." -msgstr "{sender}로부터 보류 중인 전송 있음." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "시장 평균가가 스탑 가격에 도달하면 주문 실행 시도." +msgstr "{sender}로부터 보류 중인 전송 있음.<<<<<<< HEAD=======" #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" @@ -8011,7 +8352,11 @@ msgstr "스태빌라이즈 프로토콜" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "유효한 코인 이름 입력" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "스탑 로스 PnL" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8076,11 +8425,7 @@ msgstr "{prefix} <0>{text}" #: src/context/SubaccountContext/SubaccountContextProvider.tsx msgid "Failed to update settings" -msgstr "설정 업데이트 실패" - -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "긍정 가격 영향 / 수수료" +msgstr "설정 업데이트 실패<<<<<<< HEAD=======" #: src/components/Exchange/PositionShare.tsx msgid "Tweet" @@ -8119,18 +8464,18 @@ msgstr "스탑 로스 실패" msgid "Daily Profit" msgstr "일일 이익" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." -msgstr "esGMX 토큰은 언제든 스테이킹 또는 베스팅 가능." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Arbitrum에서 ETH 직접 구매 또는 전송." +msgstr "esGMX 토큰은 언제든 스테이킹 또는 베스팅 가능.<<<<<<< HEAD=======" #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Max 110 symbols exceeded" @@ -8164,6 +8509,7 @@ msgstr "2위" msgid "LAST PRICE" msgstr "최종 가격" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "재서명" @@ -8184,6 +8530,11 @@ msgstr "<0>청구 전 위임되지 않은 {0} GMX DAO 투표권 위임." msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "롱 포지션과 {collateralSymbol} 담보로부터 {indexSymbol} 롱이 됩니다. 담보 가치가 가격 변화로 스테이블코인 담보 대비 청산 가격이 높아집니다." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "실행 가격" @@ -8237,7 +8587,7 @@ msgstr "수수료 값은 인센티브 포함 안 함." msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "추천 코드 생성" @@ -8273,6 +8623,7 @@ msgstr "{0} USD를 {1} {longOrShortText}에 입금" msgid "Distribution" msgstr "분배" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8291,11 +8642,7 @@ msgstr "총 사용자" #: src/components/SettingsModal/TradingSettings.tsx msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "순 가치: 초기 담보 + PnL - 대출 수수료 - 부정 자금 수수료 - 종료 수수료" +msgstr "<<<<<<< HEAD=======" #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" @@ -8315,7 +8662,13 @@ msgstr "포지션 공유" msgid "Min leverage: 1.1x" msgstr "최소 레버리지: 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "입금 수수료" @@ -8361,6 +8714,10 @@ msgstr "대회 기간 동안 적격 거래 없음." msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "롱 증가 및<0/>숏 감소 실행 가격." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "대시보드" msgid "Create TWAP {0} order" msgstr "TWAP {0} 주문 생성" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8394,11 +8751,11 @@ msgstr "트리거" #: src/components/Exchange/TradeHistory.jsx #: src/components/Exchange/TradeHistory.jsx msgid "Try increasing the \"Allowed Slippage\", under the settings menu on the top right." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7일" +msgstr "7일>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "GMX 보상 청구" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "추천 코드 입력" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 3월 20-27일" @@ -8461,6 +8814,10 @@ msgstr "탐색기에서 {marketName} 열기" msgid "Partial Liquidation" msgstr "부분 청산" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "입금 활성화 제출됨." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "{positionText}에서 {0} 인출 중" @@ -8632,6 +8993,7 @@ msgstr "순 비율은 자금 및 대출 수수료 결합, 개설/스왑/영향 msgid "Accrued Price Impact Rebates" msgstr "적립 가격 영향 리베이트" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "어제" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "GMX와 익명 채팅" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8683,16 +9047,21 @@ msgstr "지정가" #: src/components/Synthetics/OrderItem/OrderItem.tsx msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." -msgstr "주문 실행 시 최소 {toAmountText} 수령. 스왑 수수료 및 가격 영향 기반 실시간 업데이트." +msgstr "주문 실행 시 최소 {toAmountText} 수령. 스왑 수수료 및 가격 영향 기반 실시간 업데이트.<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "허용 가격은 가격 영향 무관 실행되는 스탑 로스 주문에 적용 안 됨." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "=======" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "채팅 또는 인터뷰 일정 잡음. 피드백 제공 감사로 <0>100 <1/> 수령." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "{longOrShort} 포지션은 자금 수수료 미지불, 시간당 {borrow msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "증가 액티브: {0}, 실행 완료: {1}, 취소 완료: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "담보로 {0} 필요." msgid "Decentralized Options Protocol" msgstr "탈중앙화 옵션 프로토콜" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "TWAP 스왑 파트 업데이트" @@ -8797,6 +9175,10 @@ msgstr "TWAP 파트 업데이트" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "계정 전송 완료" msgid "Claim Rewards" msgstr "보상 청구" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "주소 복사" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "백킹 구성" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "구 버전 1CT 서브계정에 {balanceFormatted} 남음." #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "GMX 언스테이킹" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "GMX 언스테이킹>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" diff --git a/src/locales/pseudo/messages.po b/src/locales/pseudo/messages.po index 29229504e8..f48d517a2b 100644 --- a/src/locales/pseudo/messages.po +++ b/src/locales/pseudo/messages.po @@ -40,12 +40,16 @@ msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Decentralized Trading Protocol" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." msgstr "" @@ -54,7 +58,8 @@ msgstr "" msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -278,7 +284,7 @@ msgstr "" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Execute Market Swap" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx #: src/pages/Dashboard/StatsCard.tsx @@ -291,7 +297,7 @@ msgstr "" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -319,7 +326,7 @@ msgstr "" #: src/components/SettingsModal/TradingSettings.tsx msgid "TWAP Number of Parts" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/PositionSeller.jsx msgid "Max leverage without PnL: 100x" @@ -329,10 +336,6 @@ msgstr "" msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "" - #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" msgstr "" @@ -369,17 +372,26 @@ msgstr "" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Take Profit" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/domain/synthetics/orders/createWrapOrUnwrapTxn.ts #: src/domain/synthetics/orders/createWrapOrUnwrapTxn.ts msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "" msgid "sell" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,8 +482,16 @@ msgstr "" #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." +msgstr "<<<<<<< HEAD" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" msgstr "" @@ -536,20 +561,25 @@ msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX V2 Data Analytics within Telegram" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "" - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "" @@ -586,9 +616,17 @@ msgstr "" msgid "Market Swap" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx @@ -772,6 +810,10 @@ msgstr "" msgid "{0} <0/><1> to {1} <2/>" msgstr "" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "" @@ -861,17 +903,23 @@ msgstr "" #: src/pages/Home/Home.tsx msgid "Open positions through a simple swap interface. Conveniently swap from any supported asset into the position of your choice." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "" @@ -887,9 +935,9 @@ msgstr "" #: src/components/Glp/GlpSwap.jsx msgid "Sell submitted!" -msgstr "" +msgstr "<<<<<<< HEAD" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "" @@ -939,6 +987,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "" @@ -999,7 +1048,7 @@ msgstr "" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "" @@ -1262,6 +1315,10 @@ msgstr "" msgid "Markets" msgstr "" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "" @@ -1328,12 +1385,16 @@ msgstr "" #: src/components/TokenCard/TokenCard.tsx #: src/components/TokenCard/TokenCard.tsx msgid "Buy token on:" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "" @@ -1361,6 +1426,11 @@ msgstr "" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "" @@ -1487,6 +1557,10 @@ msgstr "" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1619,10 +1693,6 @@ msgstr "" msgid "GMX Proposals Voting page" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "" - #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1666,14 +1736,6 @@ msgstr "" msgid "Search Market" msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "" - #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Transaction ID" @@ -1777,6 +1839,10 @@ msgstr "" msgid "Utilization" msgstr "" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "" @@ -1872,6 +1938,11 @@ msgstr "" msgid "Max {0} out" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "" @@ -1953,8 +2024,8 @@ msgstr "" msgid "To reduce fees, select a different asset to pay with." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" msgstr "" #: src/pages/Dashboard/AssetDropdown.tsx @@ -2047,7 +2118,7 @@ msgstr "" #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2129,12 +2200,16 @@ msgstr "" #: src/components/InterviewToast/InterviewToast.tsx msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "=======" #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "" @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2295,12 +2374,16 @@ msgstr "" #: src/components/Glp/GlpSwap.jsx msgid "GLP buy disabled, pending {0} upgrade" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/PositionEditor/PositionEditorAdvancedRows.tsx msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "" msgid "{0} Price" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "" @@ -2531,13 +2621,17 @@ msgstr "" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "" @@ -2580,6 +2674,10 @@ msgstr "" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Vest with GMX on Avalanche" +msgstr "<<<<<<< HEAD" + +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" msgstr "" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx @@ -2714,7 +2812,7 @@ msgstr "" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2951,12 +3049,18 @@ msgstr "" #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding referral code failed." -msgstr "" +msgstr "<<<<<<< HEAD" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "" @@ -3009,7 +3113,11 @@ msgstr "" #: src/components/NpsModal/NpsModal.tsx msgid "Help us improve" -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." @@ -3141,16 +3249,14 @@ msgid "Total Staked" msgstr "" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "" - #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionSeller.jsx @@ -3167,12 +3273,16 @@ msgstr "" #: src/pages/Exchange/Exchange.tsx msgid "Enable orders sent." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "" @@ -3181,6 +3291,7 @@ msgstr "" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3205,12 +3316,15 @@ msgstr "" #: src/components/Exchange/PositionSeller.jsx msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." -msgstr "" +msgstr "<<<<<<< HEAD=======" +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/PositionEditor.jsx msgid "Withdraw disabled, pending {0} upgrade" @@ -3224,12 +3338,21 @@ msgstr "" msgid "Lev." msgstr "" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/ConfirmationBox.jsx msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -3239,7 +3362,11 @@ msgstr "" #: src/components/Header/HomeHeaderLinks.tsx msgid "App" -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" @@ -3293,6 +3420,10 @@ msgstr "" msgid "Enter a new ratio or allowed slippage" msgstr "" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "" @@ -3308,6 +3439,10 @@ msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." msgstr "" #: src/pages/Stake/UnstakeModal.tsx @@ -3350,7 +3485,6 @@ msgstr "" msgid "Graph showing performance vs benchmark over the selected period." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3450,12 +3584,12 @@ msgstr "" #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Express params loading" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Order cannot be executed as the remaining position would be smaller than $5.00" @@ -3463,17 +3597,26 @@ msgstr "" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx #: src/pages/Stake/ClaimModal.tsx msgid "Claiming..." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "" @@ -3520,6 +3663,10 @@ msgstr "" msgid "Deposit failed." msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "" @@ -3682,12 +3833,16 @@ msgstr "" #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "Yes, GLV is fully liquid and permissionless. You can sell via the GMX interface to redeem for underlying assets, with low fees." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" msgstr "" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "" + #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" msgstr "" @@ -3695,6 +3850,10 @@ msgstr "" #: src/components/DebugExpressSettings/DebugSwapsSettings.tsx #: src/components/DebugSwapsSettings/DebugSwapsSettings.tsx msgid "Fail External Swaps" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" msgstr "" #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx @@ -3739,6 +3898,10 @@ msgstr "" msgid "Market Increase" msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "" @@ -3747,12 +3910,21 @@ msgstr "" msgid "Cancel Order" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "" msgid "Buy {nativeTokenSymbol}" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "" @@ -3795,10 +3968,6 @@ msgstr "" msgid "After you scan, a connection prompt will appear for you to connect your wallet." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "" - #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" msgstr "" @@ -3809,6 +3978,10 @@ msgstr "" msgid "Opening..." msgstr "" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "" @@ -3934,12 +4107,16 @@ msgstr "" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming, the esGMX tokens will be airdropped to your account on the selected network within 7 days." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/PositionEditor.jsx msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "" @@ -3970,6 +4147,7 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "" @@ -4024,7 +4202,6 @@ msgstr "" #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4200,7 +4377,7 @@ msgstr "" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4259,6 +4436,7 @@ msgstr "" msgid "Fulfilling order request" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "" @@ -4267,10 +4445,6 @@ msgstr "" msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" msgstr "" @@ -4287,6 +4461,10 @@ msgstr "" msgid "Insufficient liquidity in GM Pool" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "" @@ -4308,7 +4486,8 @@ msgstr "" msgid "Read more." msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "" @@ -4371,15 +4550,10 @@ msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "" @@ -4482,6 +4656,10 @@ msgstr "" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" msgstr "" #: src/components/Header/AppHeaderLinks.tsx @@ -4489,6 +4667,7 @@ msgstr "" #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "" @@ -4545,8 +4724,15 @@ msgstr "" msgid "Withdraw submitted." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "" @@ -4554,6 +4740,10 @@ msgstr "" msgid "Details" msgstr "" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "" @@ -5020,6 +5210,10 @@ msgstr "" msgid "LIQ." msgstr "" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "" @@ -5131,6 +5325,11 @@ msgstr "" msgid "GMX Announcements" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5193,6 +5392,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5221,12 +5421,16 @@ msgstr "" #: src/pages/Exchange/Exchange.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Trades" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/SwapBox.jsx msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "" @@ -5362,6 +5566,10 @@ msgstr "" msgid "GLP autocompounding vaults" msgstr "" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "" @@ -5468,6 +5676,10 @@ msgstr "" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "" @@ -5489,9 +5701,14 @@ msgstr "" #: src/components/Exchange/PositionSeller.jsx #: src/components/Exchange/SwapBox.jsx msgid "Max {0} in" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" @@ -5543,6 +5760,10 @@ msgstr "" msgid "No open positions" msgstr "" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "" @@ -5563,10 +5784,6 @@ msgstr "" msgid "Referral code updated." msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "" - #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" msgstr "" @@ -5739,10 +5956,6 @@ msgstr "" msgid "<0>every {seconds} seconds" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "" - #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" msgstr "" @@ -5865,6 +6078,11 @@ msgstr "" msgid "Limit size is required" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5874,10 +6092,15 @@ msgstr "" msgid "Collateral at Liquidation" msgstr "" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "" @@ -5955,6 +6178,10 @@ msgstr "" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "" @@ -6035,12 +6262,16 @@ msgstr "" #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx msgid "3rd Place" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/SettingsModal/TradingSettings.tsx msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "" @@ -6108,6 +6339,7 @@ msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "" @@ -6144,16 +6376,22 @@ msgstr "" msgid "Names could be separated by commas or spaces" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "" #: src/components/NotifyModal/NotifyModal.tsx msgid "Powered by" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." msgstr "" #: src/components/Synthetics/TwapRows/TwapRows.tsx @@ -6186,6 +6424,7 @@ msgstr "" msgid "market" msgstr "" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "" @@ -6234,14 +6473,14 @@ msgstr "" msgid "Liquidation Confirmations" msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "" - #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "" @@ -6254,13 +6493,9 @@ msgstr "" msgid "Claim esGMX" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "<<<<<<< HEAD" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" @@ -6310,6 +6545,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "" @@ -6344,7 +6580,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6366,6 +6602,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "" @@ -6394,6 +6631,8 @@ msgstr "" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6405,15 +6644,9 @@ msgid "Claim" msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6423,14 +6656,42 @@ msgstr "" msgid "Buy GLP or GMX" msgstr "" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" +msgstr "" + +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6465,14 +6726,14 @@ msgstr "" #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Enter an amount" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" msgstr "" #: src/components/Referrals/AffiliatesStats.tsx @@ -6523,6 +6784,13 @@ msgstr "" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "" @@ -6579,6 +6847,10 @@ msgstr "" msgid "Save on Fees" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "" @@ -6734,13 +7006,13 @@ msgstr "" #: src/components/Exchange/NetValueTooltip.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Open Fee" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "" @@ -6781,13 +7053,23 @@ msgstr "" #: src/context/SubaccountContext/SubaccountContextProvider.tsx msgid "Deactivate 1CT (One-Click Trading)" -msgstr "" +msgstr "<<<<<<< HEAD" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7005,6 +7287,8 @@ msgid "Size per part" msgstr "" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7019,16 +7303,12 @@ msgstr "" #: src/domain/synthetics/orders/utils.tsx msgid "limit price" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/PositionSeller.jsx msgid "Initial collateral (collateral excluding borrow fee)." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "" - #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" msgstr "" @@ -7062,6 +7342,10 @@ msgstr "" msgid "Sell failed." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "" @@ -7072,6 +7356,10 @@ msgstr "" msgid "Edit order" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7085,6 +7373,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7094,6 +7383,10 @@ msgstr "" #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX using FIAT gateways:" +msgstr "<<<<<<< HEAD" + +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." msgstr "" #: src/domain/tokens/approveTokens.tsx @@ -7171,16 +7464,17 @@ msgstr "" #: src/context/TokensFavoritesContext/TokensFavoritesContextProvider.tsx msgid "Layer 1" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" #: src/components/Exchange/TradeHistory.jsx msgid "Min Required Collateral" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/TradeHistory.jsx msgid "{0}  {1} {longOrShortText}, -{2} USD, {3} Price: ${4} USD" @@ -7199,6 +7493,12 @@ msgstr "" msgid "Position close disabled, pending {0} upgrade" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "" @@ -7274,10 +7574,18 @@ msgstr "" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "" @@ -7351,7 +7659,7 @@ msgstr "" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7398,6 +7706,11 @@ msgstr "" msgid "Confirm Claim" msgstr "" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "" @@ -7496,6 +7809,14 @@ msgstr "" msgid "GMX dashboards and analytics." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "" @@ -7602,6 +7923,10 @@ msgstr "" msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7617,7 +7942,7 @@ msgstr "" #: src/domain/synthetics/orders/utils.tsx msgid "{increaseOrDecreaseText} {tokenText} by {sizeText}" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/PositionSeller.jsx msgid "Neither collateral nor realized PnL is enough to cover pending fees. Please close a larger position amount." @@ -7625,7 +7950,7 @@ msgstr "" #: src/components/SettingsModal/ThemeSelector.tsx msgid "Dark" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Stake/UnstakeModal.tsx msgid "{0}<0>You will earn {1}% less rewards with this action." @@ -7711,6 +8036,7 @@ msgstr "" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" msgstr "" @@ -7721,10 +8047,14 @@ msgstr "" #: src/components/TokenCard/TokenCard.tsx msgid "{avalancheLink} GM Pools are <0>incentivized{sparkle}." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Shift order cancelled." +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" msgstr "" #: src/lib/legacy.ts @@ -7746,7 +8076,11 @@ msgstr "" #: src/pages/NftWallet/NftWallet.jsx msgid "NFT ID" -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" @@ -7775,16 +8109,20 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter unique coins" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "The execution price didn't meet the acceptable price condition. The order will get filled when the condition is met." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/GmList/FeeApyLabel.tsx msgid "Fee APY" msgstr "" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "" @@ -7826,13 +8164,13 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "" #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High TWAP network fee" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "APY" @@ -7860,7 +8198,8 @@ msgid "Image generation error, please refresh and try again." msgstr "" #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "" @@ -7892,7 +8231,11 @@ msgstr "" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "" @@ -7937,6 +8280,8 @@ msgstr "" #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7949,10 +8294,6 @@ msgstr "" msgid "You have a pending transfer from {sender}." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "" - #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" msgstr "" @@ -8005,6 +8346,10 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8030,6 +8375,10 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" +msgstr "<<<<<<< HEAD" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." msgstr "" #: src/components/Exchange/UsefulLinks.tsx @@ -8072,10 +8421,6 @@ msgstr "" msgid "Failed to update settings" msgstr "" -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "" - #: src/components/Exchange/PositionShare.tsx msgid "Tweet" msgstr "" @@ -8113,12 +8458,12 @@ msgstr "" msgid "Daily Profit" msgstr "" -#: src/pages/ClaimEsGmx/ClaimEsGmx.jsx -msgid "The esGMX tokens can be staked or vested at any time." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." +#: src/pages/ClaimEsGmx/ClaimEsGmx.jsx +msgid "The esGMX tokens can be staked or vested at any time." msgstr "" #: src/components/Exchange/OrderEditor.jsx @@ -8158,6 +8503,7 @@ msgstr "" msgid "LAST PRICE" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "" @@ -8178,6 +8524,11 @@ msgstr "" msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "" @@ -8197,7 +8548,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "" @@ -8225,13 +8575,13 @@ msgstr "" #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx msgid "Fee values do not include incentives." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/pages/Dashboard/DashboardV2.tsx msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "" @@ -8267,6 +8617,7 @@ msgstr "" msgid "Distribution" msgstr "" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8281,16 +8632,12 @@ msgstr "" #: src/pages/Home/Home.tsx msgid "Total Users" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/SettingsModal/TradingSettings.tsx msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." msgstr "" -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "" - #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" msgstr "" @@ -8309,7 +8656,13 @@ msgstr "" msgid "Min leverage: 1.1x" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "" @@ -8355,6 +8708,10 @@ msgstr "" msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8373,7 +8730,7 @@ msgstr "" msgid "Create TWAP {0} order" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8383,7 +8740,7 @@ msgstr "" #: src/domain/synthetics/positions/utils.ts msgid "trigger" -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/TradeHistory.jsx #: src/components/Exchange/TradeHistory.jsx @@ -8392,7 +8749,7 @@ msgstr "" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8410,10 +8767,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "" @@ -8455,6 +8808,10 @@ msgstr "" msgid "Partial Liquidation" msgstr "" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8486,12 +8843,16 @@ msgstr "" #: src/components/Exchange/PositionEditor.jsx msgid "Enable deposit sent." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/PositionSeller.jsx msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "" @@ -8626,6 +8987,7 @@ msgstr "" msgid "Accrued Price Impact Rebates" msgstr "" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "" @@ -8656,9 +9018,11 @@ msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "Anonymous chat with GMX" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8679,12 +9043,17 @@ msgstr "" msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." msgstr "" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" msgstr "" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" msgstr "" #: src/components/Exchange/SwapBox.jsx @@ -8762,6 +9131,10 @@ msgstr "" msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8779,6 +9152,11 @@ msgstr "" msgid "Decentralized Options Protocol" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "" @@ -8791,6 +9169,10 @@ msgstr "" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8800,7 +9182,7 @@ msgstr "" msgid "Claim Rewards" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" msgstr "" @@ -8850,10 +9232,19 @@ msgstr "" msgid "DeBank" msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "" #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" diff --git a/src/locales/ru/messages.po b/src/locales/ru/messages.po index 31553dd3df..fa5840dabb 100644 --- a/src/locales/ru/messages.po +++ b/src/locales/ru/messages.po @@ -40,21 +40,26 @@ msgstr "Доступно в предпочитаемой сети" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Decentralized Trading Protocol" -msgstr "Децентрализованный Торговый Протокол" +msgstr "Децентрализованный Торговый Протокол<<<<<<< HEAD" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "Разъединить" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -278,7 +284,7 @@ msgstr "{0} может использоваться для покупки GM д #: src/components/Synthetics/TradeHistory/keys.ts msgid "Execute Market Swap" -msgstr "Исполнение рыночного обмена" +msgstr "Исполнение рыночного обмена<<<<<<< HEAD" #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx #: src/pages/Dashboard/StatsCard.tsx @@ -291,7 +297,7 @@ msgstr "Отмена лимитного обмена" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}с" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}с" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -327,11 +334,7 @@ msgstr "" #: src/components/Errors/errorToasts.tsx msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "Чистая стоимость: Начальный залог + PnL - Комиссия за заимствование - Отрицательная комиссия финансирования - Комиссия за закрытие - Комиссия UI" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" @@ -376,10 +379,19 @@ msgstr "Тейк-профит не удался" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "Подтвердить расчет" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "Лимитная цена ниже рыночной цены" msgid "sell" msgstr "продать" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0} не может быть отправлен на адреса сма #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "Транзакция не удалась из-за ошибки RPC.<0/><1/>Пожалуйста, включите <2>экспресс-трейдинг в настройках, что должно улучшить опыт." +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "Транзакция не удалась из-за ошибки RPC.<0/><1/>Пожалуйста, включите <2>экспресс-трейдинг в настройках, что должно улучшить опыт.>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -542,14 +567,19 @@ msgstr "Аналитика данных GMX V2 в Telegram" msgid "High external swap impact" msgstr "" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "Вы можете перевести ETH в Arbitrum, используя любой из приведенных ниже вариантов." - +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "Создан лимитный ордер на {0} {1}: {2} USD!" @@ -586,9 +616,17 @@ msgstr "Максимальная емкость" msgid "Market Swap" msgstr "Рыночный обмен" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx @@ -772,6 +810,10 @@ msgstr "Средний размер позиции." msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> до {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} Шорт рынок: {0} короткую позицию по текущей цене." @@ -861,17 +903,23 @@ msgstr "Кросс-чейн депозиты в один клик в GM" #: src/pages/Home/Home.tsx msgid "Open positions through a simple swap interface. Conveniently swap from any supported asset into the position of your choice." -msgstr "Открывайте позиции с помощью простого интерфейса обмена. Удобно обменивайте любой поддерживаемый актив на выбранную позицию." +msgstr "Открывайте позиции с помощью простого интерфейса обмена. Удобно обменивайте любой поддерживаемый актив на выбранную позицию.<<<<<<< HEAD" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "Нет совпадающих рынков" +msgstr "Нет совпадающих рынков>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "МАКС" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "Недопустимое значение скольжения" @@ -889,7 +937,7 @@ msgstr "Максимальная сумма покупки {0} превышен msgid "Sell submitted!" msgstr "Продажа отправлена!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "Код уже занят" @@ -939,6 +987,7 @@ msgstr "Ликв. {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "Оплатить" @@ -999,7 +1048,7 @@ msgstr "Купить с {0}" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "Управление активами" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (Поставка)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "Альтернативные ссылки можно найти в <0>документах.<1/><2/>Нажав кнопку Согласен, вы принимаете <3>T&Cs и <4>Referral T&Cs.<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "Все время" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "Реферальный код не может быть больше {MAX_REFERRAL_CODE_LENGTH} символов." @@ -1262,6 +1315,10 @@ msgstr "КОМИССИЯ ЗА ФИНАНСИРОВАНИЕ" msgid "Markets" msgstr "Рынки" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "Ранты в реальном времени о торгах GMX" @@ -1334,6 +1391,10 @@ msgstr "Купить токен на:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "Лимитный обмен не удался" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "Ликв. {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "Открытие лонга..." @@ -1361,6 +1426,11 @@ msgstr "Всего Ребайтов" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "Этот токен автоматически накапливает комиссии от торговли с левереджем и обменов для рынка {0}. Он также подвержен {1} и {2} в соответствии с отображаемым составом." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "Мин. ордер: {0}" @@ -1487,6 +1557,10 @@ msgstr "Перевод Подтверждён" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "Торговля в один клик отключена. Превышен лимит действий." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1617,11 +1691,7 @@ msgstr "NFT Кошелёк" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX Proposals Voting page" -msgstr "Страница Голосования по предложениям GMX" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "Вы можете купить ETH напрямую на <0>Arbitrum с помощью этих опций:" +msgstr "Страница Голосования по предложениям GMX<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1664,15 +1734,7 @@ msgstr "" #: src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Search Market" -msgstr "Искать Рынок" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "Допустимая цена ордера включает текущее влияние на цену и установленное допустимое скольжение. Цена исполнения должна соответствовать этому условию для исполнения ордера." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "Как только рыночная цена достигнет лимитной цены, ордер попытается исполниться, гарантируя допустимую цену, которая включает установленное допустимое влияние на цену. Обратите внимание, что если влияние на цену отрицательное, рыночная цена может потребоваться выше лимитной цены." +msgstr "Искать Рынок<<<<<<< HEAD=======" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx @@ -1777,6 +1839,10 @@ msgstr "Создать Ордер" msgid "Utilization" msgstr "Утилизация" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} за {1}" @@ -1872,6 +1938,11 @@ msgstr "Пара" msgid "Max {0} out" msgstr "Макс {0} выход" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "Нет влияния на цену. Есть единая<0/>цена исполнения для увеличения шортов или<1/>уменьшения лонгов для этого размера." @@ -1951,11 +2022,11 @@ msgstr "Показать детали" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx msgid "To reduce fees, select a different asset to pay with." -msgstr "Чтобы уменьшить комиссию, выберите другой способ оплаты." +msgstr "Чтобы уменьшить комиссию, выберите другой способ оплаты.<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "Как только рыночная цена достигнет лимитной цены, ордер попытается исполниться, гарантируя допустимую цену, которая включает установленное допустимое влияние на цену. Обратите внимание, что если влияние на цену отрицательное, рыночная цена может потребоваться ниже лимитной цены." +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "=======" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2023,7 +2094,7 @@ msgstr "Комиссия за Пользование Кредитом" #: src/components/Glp/GlpSwap.jsx msgid "Buy submitted." -msgstr "Покупка отправлена." +msgstr "" #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you sell GLP for. <0/>Enter the amount of GLP you want to redeem in the order form, then check here to compare fees." @@ -2047,7 +2118,7 @@ msgstr "Стоимость комиссий в USD рассчитывается #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "Макс" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2129,12 +2200,16 @@ msgstr "Размер" #: src/components/InterviewToast/InterviewToast.tsx msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." -msgstr "Мы ценим ваш опыт и insights и приглашаем вас участвовать в анонимном чате один на один." +msgstr "Мы ценим ваш опыт и insights и приглашаем вас участвовать в анонимном чате один на один.<<<<<<< HEAD" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "=======" #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "<0>Подробнее о комиссиях." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "Вы получите не менее {0} {1}, если этот ордер будет исполнен. Цена исполнения может варьироваться в зависимости от комиссии обмена на момент исполнения ордера." @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2295,12 +2374,16 @@ msgstr "Децентрализованная Финансовая Панель" #: src/components/Glp/GlpSwap.jsx msgid "GLP buy disabled, pending {0} upgrade" -msgstr "Покупка GLP приостановлена, ожидается {0} обновление" +msgstr "Покупка GLP приостановлена, ожидается {0} обновление<<<<<<< HEAD" #: src/components/Synthetics/PositionEditor/PositionEditorAdvancedRows.tsx msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "Обмены" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "Зарезервировано для вестинга" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "Допустимое Скольжение по умолчанию" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX Аналитика" msgid "{0} Price" msgstr "{0} Цена" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "Купить GMX на централизованных сервисах" @@ -2531,13 +2621,17 @@ msgstr "Ставка Комиссии за Заимствование" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "Максимальное количество частей: {MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "Запустить Приложение" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "Внесено {0} USD в {tokenSymbol} {longOrShortText}" @@ -2580,7 +2674,11 @@ msgstr "ЧИСТАЯ СТАВКА / 1 Ч" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Vest with GMX on Avalanche" -msgstr "Вестинг GMX на Avalanche" +msgstr "Вестинг GMX на Avalanche<<<<<<< HEAD" + +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" @@ -2678,11 +2776,11 @@ msgstr "Снятие стейкинга не удалось." #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Order cancelled" -msgstr "Ордер отменён" +msgstr "Ордер отменён<<<<<<< HEAD" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "Свернуть" +msgstr "Свернуть>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "Введите до 10 монет" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "Экспозиция к Токенам Поддержки" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "Торговля" msgid "Adding referral code failed." msgstr "Добавление реферального кода не удалось." +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "Макс. плечо без PnL: {0}x" @@ -3011,6 +3115,10 @@ msgstr "Разрешить тратить {tokenSymbol}" msgid "Help us improve" msgstr "Помогите нам улучшиться" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "Совокупность высококачественных ценовых фидов определяет, когда происходит ликвидация. Это защищает позиции от временных виков." @@ -3141,15 +3249,13 @@ msgid "Total Staked" msgstr "Всего Стейкано" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" -msgstr "Комиссия Сети" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "Ожидаемая цена выполнения ордера, включая текущее влияние цены." +msgstr "Комиссия Сети<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx @@ -3167,12 +3273,16 @@ msgstr "Плечо" #: src/pages/Exchange/Exchange.tsx msgid "Enable orders sent." -msgstr "Активация ордеров отправлена." +msgstr "Активация ордеров отправлена.<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "Нет требований, соответствующих выбранным фильтрам" @@ -3181,6 +3291,7 @@ msgstr "Нет требований, соответствующих выбран msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3205,12 +3316,15 @@ msgstr "Рынок" #: src/components/Exchange/PositionSeller.jsx msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." -msgstr "Сумма обмена от {0} к {1} превышает {2} допустимую сумму. Можно получить только {3}." +msgstr "Сумма обмена от {0} к {1} превышает {2} допустимую сумму. Можно получить только {3}.<<<<<<< HEAD=======" +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/PositionEditor.jsx msgid "Withdraw disabled, pending {0} upgrade" @@ -3224,12 +3338,21 @@ msgstr "Прочитайте правила" msgid "Lev." msgstr "Плечо" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "Стейкинг не удался." #: src/components/Exchange/ConfirmationBox.jsx msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -3241,6 +3364,10 @@ msgstr "Отправка..." msgid "App" msgstr "Приложение" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "Добавить {marketName} в Кошелёк" @@ -3293,6 +3420,10 @@ msgstr "Покупка..." msgid "Enter a new ratio or allowed slippage" msgstr "Введите новое соотношение или допустимое скольжение" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "Комиссия UI Обмена" @@ -3310,6 +3441,10 @@ msgstr "Начисленная Положительная Комиссия за msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "Отправитель вывел все токены из Аффилиатского Хранилища Вестинга" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "Направление" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "GM можно продать за {0} и {1} на этом рынке до указанных лимитов продажи. Остальные токены в пуле зарезервированы для текущих открытых позиций." +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "График, показывающий производительность по сравнению с эталоном за выбранный период." -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3450,12 +3584,12 @@ msgstr "Лимит - Шорт Увелич." #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" -msgstr "Отправка запроса на расчёт" +msgstr "Отправка запроса на расчёт<<<<<<< HEAD=======" #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Express params loading" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Order cannot be executed as the remaining position would be smaller than $5.00" @@ -3463,17 +3597,26 @@ msgstr "Ордер не может быть выполнен, поскольку #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx #: src/pages/Stake/ClaimModal.tsx msgid "Claiming..." -msgstr "Требование..." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "Требование...>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "Запрос на Рыночное Увеличение" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "Редактировать {0}" @@ -3520,6 +3663,10 @@ msgstr "Сайт представляет собой развернутый и msgid "Deposit failed." msgstr "Депозит не удался." +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "" + #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx msgid "<0>Set Recommended Impact: {0}." @@ -3645,6 +3792,10 @@ msgstr "Запрос на Рыночный Обмен" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "Недостаточно ликвидности в пуле рынка {0}. Выберите другой пул для этого рынка.{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "Приложение отключено, ожидается обновление {0}" @@ -3682,11 +3833,15 @@ msgstr "GLV — это токен поставщика ликвидности д #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "Yes, GLV is fully liquid and permissionless. You can sell via the GMX interface to redeem for underlying assets, with low fees." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "Сеть" +msgstr "Сеть>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>каждые {hours} часов{0}" msgid "Fail External Swaps" msgstr "Неудача Внешних Обменов" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "Экспресс-Торговля недоступна с использ msgid "Market Increase" msgstr "Рыночное Увеличение" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "Пока нет требований" @@ -3747,12 +3910,21 @@ msgstr "Пока нет требований" msgid "Cancel Order" msgstr "Отменить Ордер" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "Вестинговый Требуемый GMX" msgid "Buy {nativeTokenSymbol}" msgstr "Купить {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "Просмотреть в Эксплорере" @@ -3793,11 +3966,7 @@ msgstr "У вас есть несколько существующих орде #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "After you scan, a connection prompt will appear for you to connect your wallet." -msgstr "После сканирования появится запрос на подключение вашего кошелька." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "Вы можете перевести AVAX из других сетей в Avalanche, используя любой из нижеперечисленных вариантов:" +msgstr "После сканирования появится запрос на подключение вашего кошелька.<<<<<<< HEAD=======" #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" @@ -3809,6 +3978,10 @@ msgstr "Неподдерживаемая сеть" msgid "Opening..." msgstr "Открытие..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "Трейдеры, Привлечённые на Avalanche" @@ -3940,6 +4113,10 @@ msgstr "После требования токены esGMX будут сброш msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "Купить GLV" @@ -3970,6 +4147,7 @@ msgstr "Запрос на увеличение {0} {longOrShortText}, +{1} USD, #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "Залог Внесён" @@ -4024,7 +4202,6 @@ msgstr "Рибейты, заработанные этим аккаунтом в #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "Аффилиатское Хранилище" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "Введите цену" +msgstr "Введите цену<<<<<<< HEAD" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,17 +4439,14 @@ msgstr "{daysConsidered}д Заработанных Комиссий" msgid "Fulfilling order request" msgstr "Выполнение запроса ордера" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "Недостаточно баланса {0} для оплаты газа" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." -msgstr "В настоящее время вы можете вестить максимум {0} токенов esGMX в соотношении {1} {stakingToken} к 1 esGMX." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "Купить AVAX напрямую в Avalanche или перевести туда." +msgstr "В настоящее время вы можете вестить максимум {0} токенов esGMX в соотношении {1} {stakingToken} к 1 esGMX.<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "Ошибка подготовки транзакции. Провайде msgid "Insufficient liquidity in GM Pool" msgstr "Недостаточно ликвидности в Пуле GM" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "Торгуйте на GMX и выиграйте <0>$250.000 в призах! Действует до 30 ноября, <1>нажмите здесь, чтобы узнать больше." @@ -4311,7 +4489,8 @@ msgstr "Начисленная Комиссия за Заимствование" msgid "Read more." msgstr "Подробнее." -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "Анализ PnL" @@ -4344,7 +4523,7 @@ msgstr "<0>Уведомления предоставляются Notifi и не #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} и {avalancheLink} Пулы GLV <0>стимулированы{sparkle}." +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "Токен Оплаты Газа" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "Влияние Цены" @@ -4485,13 +4659,18 @@ msgstr "Технические Анонсы GMX" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "Неудачный Стоп-Маркет" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "Настройки" @@ -4548,8 +4727,15 @@ msgstr "Перевод уже инициирован" msgid "Withdraw submitted." msgstr "Вывод отправлен." -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "Введите код" @@ -4557,6 +4743,10 @@ msgstr "Введите код" msgid "Details" msgstr "Детали" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "Неверный адрес NFT" msgid "LIQ." msgstr "ЛИКВ." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "Хранилища с автокомпаундингом GLP и GMX" @@ -5134,6 +5328,11 @@ msgstr "Настройки One-Click" msgid "GMX Announcements" msgstr "Объявления GMX" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5224,12 +5424,16 @@ msgstr "Выполнить" #: src/pages/Exchange/Exchange.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Trades" -msgstr "Торги" +msgstr "Торги<<<<<<< HEAD" #: src/components/Exchange/SwapBox.jsx msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "Нет доступного пути обмена." @@ -5365,6 +5569,10 @@ msgstr "Передача" msgid "GLP autocompounding vaults" msgstr "Хранилища с автокомпаундингом GLP" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "Ордера TP/SL превышают позицию" @@ -5471,6 +5679,10 @@ msgstr "Размер ордера равен 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "Достигнут лимит покупки для пула GM: {0} в {1} [{2}]. Пожалуйста, уменьшите размер покупки, выберите другой токен GM или сдвиньте токены GM в другой пул и попробуйте снова." +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "Закрыть {longOrShortText} {0}" @@ -5494,7 +5706,12 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "Макс {0} в" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "Нет открытых позиций" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "Размер, $" @@ -5564,11 +5785,7 @@ msgstr "Ретроактивный бонус STIP.b" #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code updated." -msgstr "" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "Вы можете купить AVAX напрямую на <0>Avalanche с использованием этих опций:" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" @@ -5740,11 +5957,7 @@ msgstr "Выполнить часть TWAP обмена" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {seconds} seconds" -msgstr "<0>каждые {seconds} секунд" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "Купить или перевести AVAX в Avalanche" +msgstr "<0>каждые {seconds} секунд<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "У вас есть <0>ожидающий перевод на {pendin msgid "Limit size is required" msgstr "Требуется лимит размера" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "Токены протокола" msgid "Collateral at Liquidation" msgstr "Залог при ликвидации" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "После запроса вы сможете вестить максимум {0} esGMX в соотношении {1} {stakingToken} к 1 esGMX." +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "Сегодня" @@ -5958,6 +6181,10 @@ msgstr "Уровень {0} ({currentTierDiscount}% скидка)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "Этот ордер с использованием {collateralSymbol} в качестве залога не будет действителен для существующей позиции {longText} с использованием {symbol} в качестве залога." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "Генеративный рынок eXplore - AIGMX агент" @@ -6038,12 +6265,16 @@ msgstr "Выведено!" #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx msgid "3rd Place" -msgstr "3-е место" +msgstr "3-е место<<<<<<< HEAD" #: src/components/SettingsModal/TradingSettings.tsx msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "Обновить стоп-лосс" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1ч" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "Баланс" @@ -6147,17 +6379,23 @@ msgstr "Победа/Поражение" msgid "Names could be separated by commas or spaces" msgstr "Имена могут быть разделены запятыми или пробелами" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "Купить GMX на децентрализованных биржах" #: src/components/NotifyModal/NotifyModal.tsx msgid "Powered by" -msgstr "Работает на" +msgstr "Работает на<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "Допустимая цена ордера включает установленное допустимое влияние цены. Цена исполнения должна соответствовать этому условию для выполнения ордера." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "Не удалось скачать CSV истории торгов." msgid "market" msgstr "рынок" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "Такой же, как текущий активный код" @@ -6235,16 +6474,16 @@ msgstr "Сообщество GMX с NFT, торговлей и образова #: src/components/NotifyModal/NotifyModal.tsx msgid "Liquidation Confirmations" -msgstr "Подтверждения ликвидаций" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "Ожидаемая цена исполнения ордера, включая текущее влияние цены, после выполнения стоп-маркет ордера." +msgstr "Подтверждения ликвидаций<<<<<<< HEAD=======" #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "Подтвердить, что эпоха заканчивается через {minutes} минут" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "Высокое влияние цены" @@ -6255,19 +6494,15 @@ msgstr "Мы хотим ваши insights, чтобы улучшить GMX. По #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Claim esGMX" -msgstr "Запросить esGMX" +msgstr "Запросить esGMX<<<<<<< HEAD" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "Купить или перевести ETH в Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "Ожидаемая цена исполнения ордера, включая текущее влияние цены, после выполнения лимитного ордера." +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "of open fee" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "Подать" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "Копировать" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "Сумма" @@ -6397,6 +6634,8 @@ msgstr "цена триггера" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "Запросить" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "Влияние цены / Комиссии" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6426,14 +6659,42 @@ msgstr "Цена исполнения ордера учитывает влиян msgid "Buy GLP or GMX" msgstr "Купить GLP или GMX" +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "" + #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6468,15 +6729,15 @@ msgstr "" #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Enter an amount" -msgstr "Введите сумму" +msgstr "Введите сумму<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "Подключить" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "Неизвестный ордер сдвига GM" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "Максимальное плечо 100x было превышено, оставшийся залог после вычета убытков и комиссий отправлен обратно на ваш аккаунт:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "Сдвиг {symbol}..." @@ -6582,6 +6850,10 @@ msgstr "Эйрдроп GM" msgid "Save on Fees" msgstr "Сэкономьте на комиссиях" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "Обновить тейк-профит" @@ -6746,7 +7018,7 @@ msgstr "Комиссия за открытие" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "Похоже, у вас нет реферального кода для分享. <0/> Создайте его сейчас и начните получать возвраты!" @@ -6789,11 +7061,21 @@ msgstr "Вы" msgid "Deactivate 1CT (One-Click Trading)" msgstr "Деактивировать 1CT (One-Click Trading)" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "Размер на часть" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7029,11 +7313,7 @@ msgstr "лимитная цена" #: src/components/Exchange/PositionSeller.jsx msgid "Initial collateral (collateral excluding borrow fee)." -msgstr "" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "Возвраты влияния цены за закрытие торгов запрашиваются во вкладке запросов. <0>Подробнее." +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" @@ -7058,7 +7338,7 @@ msgstr "Максимальная комиссия сети включает ко #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "Возвраты" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "Рынки GMX V1 отключены и позволяют только msgid "Sell failed." msgstr "Продажа не удалась." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "Обновить лимит" @@ -7078,6 +7362,10 @@ msgstr "Обновить лимит" msgid "Edit order" msgstr "Редактировать ордер" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7102,9 +7391,13 @@ msgstr "Дата" msgid "Buy GMX using FIAT gateways:" msgstr "Купить GMX используя FIAT шлюзы:" +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" + #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Exchange/PositionSeller.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Слой 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "Превышена максимальная сумма {0}" msgid "Position close disabled, pending {0} upgrade" msgstr "Закрытие позиции отключено, ожидается обновление {0}" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "Обмен..." @@ -7280,10 +7580,18 @@ msgstr "Вывод не удался" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "Получайте скидки на комиссии и зарабатывайте рибейты через реферальную программу GMX.<0/>Для получения дополнительной информации прочитайте <1>детали реферальной программы." +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "Заморозить" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "Загрузка параметров Express..." @@ -7357,7 +7665,7 @@ msgstr "Выберите токен для оплаты" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "Доступная ликвидность будет меньшей из разниц между максимальным значением и текущим значением как для резерва, так и для открытого интереса." +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "Этот код был взят кем-то другим на {takenNetw msgid "Confirm Claim" msgstr "Подтвердить заявку" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "Обсуждение сообщества GMX" @@ -7502,6 +7815,14 @@ msgstr "<0>Емкость пула достигнута для {0}. Пожалу msgid "GMX dashboards and analytics." msgstr "Панели управления и аналитика GMX." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "Внешний обмен {0} на {1}" @@ -7608,6 +7929,10 @@ msgstr "Неверный адрес. Убедитесь, что вы ввели msgid "Sender has withdrawn all tokens from GMX Vesting Vault" msgstr "Отправитель вывел все токены из хранилища вестинга GMX" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "" + #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx msgid "Failed Settlement of Funding Fees" @@ -7627,11 +7952,11 @@ msgstr "{increaseOrDecreaseText} {tokenText} на {sizeText}" #: src/components/Exchange/PositionSeller.jsx msgid "Neither collateral nor realized PnL is enough to cover pending fees. Please close a larger position amount." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/SettingsModal/ThemeSelector.tsx msgid "Dark" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Stake/UnstakeModal.tsx msgid "{0}<0>You will earn {1}% less rewards with this action." @@ -7717,9 +8042,10 @@ msgstr "Принять подтверждение триггерных орде msgid "Choose to buy from decentralized or centralized exchanges." msgstr "Выберите покупку на децентрализованных или централизованных биржах." +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" -msgstr "" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/Ecosystem.tsx msgid "GMX ecosystem pages." @@ -7731,6 +8057,10 @@ msgstr "{avalancheLink} Пулы GM <0>стимулируются{sparkle}." #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Shift order cancelled." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" msgstr "" #: src/lib/legacy.ts @@ -7754,6 +8084,10 @@ msgstr "Общие награды" msgid "NFT ID" msgstr "ID NFT" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "" + #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" msgstr "Децентрализованная биржа перпетuals | GMX" @@ -7781,16 +8115,20 @@ msgstr "Условия рефералов" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter unique coins" -msgstr "Введите уникальные монеты" +msgstr "Введите уникальные монеты<<<<<<< HEAD=======" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "The execution price didn't meet the acceptable price condition. The order will get filled when the condition is met." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/GmList/FeeApyLabel.tsx msgid "Fee APY" msgstr "APY комиссий" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "Нет подходящих рынков." @@ -7832,13 +8170,13 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "Произошла ошибка. Попробуйте снова" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "Допускаются только буквы, цифры и подчеркивания." #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High TWAP network fee" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "APY" @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "Ошибка генерации изображения, пожалуйста, обновите и попробуйте снова." #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "Рибейты за влияние на цену" @@ -7898,7 +8237,11 @@ msgstr "Рибейты на V1" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "Неверный токен indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "Оповещения" @@ -7943,6 +8286,8 @@ msgstr "Бонусный APR будет аирдропнут как токены #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7953,11 +8298,7 @@ msgstr "Кошелек" #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "You have a pending transfer from {sender}." -msgstr "У вас есть ожидающий перевод от {sender}." - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "Как только маркированная цена достигнет стоп-цены, ордер попытается исполниться." +msgstr "У вас есть ожидающий перевод от {sender}.<<<<<<< HEAD=======" #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" @@ -8011,7 +8352,11 @@ msgstr "Протокол Stabilize" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "Введите действительные имена монет" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "PnL стоп-лосса" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8076,11 +8425,7 @@ msgstr "{prefix} <0>{text}" #: src/context/SubaccountContext/SubaccountContextProvider.tsx msgid "Failed to update settings" -msgstr "Не удалось обновить настройки" - -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "Положительное влияние на цену / Комиссии" +msgstr "Не удалось обновить настройки<<<<<<< HEAD=======" #: src/components/Exchange/PositionShare.tsx msgid "Tweet" @@ -8119,18 +8464,18 @@ msgstr "Неудачный стоп-лосс" msgid "Daily Profit" msgstr "Ежедневная прибыль" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." -msgstr "Токены esGMX можно стейкать или вестить в любое время." - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "Купите ETH напрямую на Arbitrum или переведите его туда." +msgstr "Токены esGMX можно стейкать или вестить в любое время.<<<<<<< HEAD=======" #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Max 110 symbols exceeded" @@ -8164,6 +8509,7 @@ msgstr "2-е место" msgid "LAST PRICE" msgstr "ПОСЛЕДНЯЯ ЦЕНА" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "Переподписать" @@ -8184,6 +8530,11 @@ msgstr "<0>Делегируйте вашу не делегированную {0} msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "Вы будете в лонге {indexSymbol} из вашей лонг позиции, а также из вашего залога {collateralSymbol}. Цена ликвидации выше по сравнению с использованием стейблкоина в качестве залога, поскольку стоимость залога изменяется с его ценой." @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "Цена исполнения" @@ -8237,7 +8587,7 @@ msgstr "Значения комиссий не включают стимулы." msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "Сгенерировать реферальный код" @@ -8273,6 +8623,7 @@ msgstr "Внести {0} USD в {1} {longOrShortText}" msgid "Distribution" msgstr "Распределение" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8291,11 +8642,7 @@ msgstr "Общее количество пользователей" #: src/components/SettingsModal/TradingSettings.tsx msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "Чистая стоимость: Первоначальный залог + PnL - Комиссия за заем - Отрицательная комиссия за финансирование - Комиссия за закрытие" +msgstr "<<<<<<< HEAD=======" #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" @@ -8315,7 +8662,13 @@ msgstr "Поделиться позицией" msgid "Min leverage: 1.1x" msgstr "Мин. плечо: 1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "Комиссия за депозит" @@ -8361,6 +8714,10 @@ msgstr "У вас нет подходящих сделок в окне соре msgid "Execution prices for increasing longs and<0/>decreasing shorts." msgstr "Цены исполнения для увеличения лонгов и<0/>уменьшения шортов." +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "" + #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" msgstr "" @@ -8379,7 +8736,7 @@ msgstr "Панели" msgid "Create TWAP {0} order" msgstr "Создать TWAP {0} ордер" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8394,11 +8751,11 @@ msgstr "триггер" #: src/components/Exchange/TradeHistory.jsx #: src/components/Exchange/TradeHistory.jsx msgid "Try increasing the \"Allowed Slippage\", under the settings menu on the top right." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7д" +msgstr "7д>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "Заявить награды GMX" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "Введите реферальный код" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 20-27 марта" @@ -8461,6 +8814,10 @@ msgstr "Открыть {marketName} в Explorer" msgid "Partial Liquidation" msgstr "Частичная ликвидация" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "Включение депозита отправлено." msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "Вывод {0} из {positionText}" @@ -8632,6 +8993,7 @@ msgstr "Чистая ставка объединяет комиссии за ф msgid "Accrued Price Impact Rebates" msgstr "Начисленные рибейты за влияние на цену" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "Вчера" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "Анонимный чат с GMX" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8683,16 +9047,21 @@ msgstr "Лимит" #: src/components/Synthetics/OrderItem/OrderItem.tsx msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." -msgstr "Вы получите не менее {toAmountText}, если этот ордер будет исполнен. Эта цена обновляется в реальном времени на основе комиссий свопа и влияния на цену." +msgstr "Вы получите не менее {toAmountText}, если этот ордер будет исполнен. Эта цена обновляется в реальном времени на основе комиссий свопа и влияния на цену.<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "Приемлемая цена не применяется к ордерам стоп-лосс, поскольку они будут исполнены независимо от влияния на цену." +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "=======" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "Затем мы назначим чат или интервью с вами. В знак благодарности вы получите <0>100 <1/> за ваш отзыв." +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "Позиции {longOrShort} не платят комиссию за ф msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "Увеличение активных: {0}, исполнено: {1}, отменено: {2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,6 +9158,11 @@ msgstr "{0} требуется для залога." msgid "Decentralized Options Protocol" msgstr "Децентрализованный протокол опционов" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "Обновить часть TWAP свопа" @@ -8797,6 +9175,10 @@ msgstr "Обновить часть TWAP" msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "Завершить перевод аккаунта" msgid "Claim Rewards" msgstr "Заявить награды" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "Копировать адрес" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "Состав обеспечения" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "У вас осталось {balanceFormatted} в старой версии субаккаунта 1CT." #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "Анстейкать GMX" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "Анстейкать GMX>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" diff --git a/src/locales/zh/messages.po b/src/locales/zh/messages.po index 528e593c05..81f954a561 100644 --- a/src/locales/zh/messages.po +++ b/src/locales/zh/messages.po @@ -40,21 +40,26 @@ msgstr "可在您的首选网络上使用" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Decentralized Trading Protocol" -msgstr "去中心化交易协议" +msgstr "去中心化交易协议<<<<<<< HEAD" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "STIP.b Trading Incentives" msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below options:" +msgstr "" + #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Buy order executed." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx msgid "Claims are disabled" msgstr "" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Disconnect" msgstr "断开连接" @@ -181,6 +186,7 @@ msgstr "" #: src/components/Exchange/OrdersList.jsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/OrderList/filters/OrderTypeFilter.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/OrdersOverview/OrdersOverview.jsx @@ -278,7 +284,7 @@ msgstr "{0} 可用于为此市场购买 GM,直至指定的购买上限。" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Execute Market Swap" -msgstr "执行市场交换" +msgstr "执行市场交换<<<<<<< HEAD" #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx #: src/pages/Dashboard/StatsCard.tsx @@ -291,7 +297,7 @@ msgstr "取消限价交换" #: src/pages/LeaderboardPage/components/CompetitionCountdown.tsx msgid "{seconds}s" -msgstr "{seconds}秒" +msgstr "" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/ConfirmationBox.jsx @@ -304,6 +310,7 @@ msgstr "{seconds}秒" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx #: src/pages/Dashboard/StatsCard.tsx msgid "Fees" @@ -327,11 +334,7 @@ msgstr "" #: src/components/Errors/errorToasts.tsx msgid "The mark price has changed, consider increasing your allowed slippage by clicking on the \"...\" icon next to your address." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee - UI Fee" -msgstr "净值:初始抵押品 + 盈亏 - 借款费用 - 负资金费用 - 关闭费用 - UI 费用" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx msgid "The spread is > 1%, please ensure the trade details are acceptable before confirming" @@ -376,10 +379,19 @@ msgstr "止盈失败" msgid "Swapped {0} for {1}." msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "No necessary params to claim. Retry in a few seconds." +msgstr "" + #: src/components/Synthetics/SettleAccruedFundingFeeModal/SettleAccruedFundingFeeModal.tsx msgid "Confirm Settle" msgstr "确认结算" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select token" +msgstr "" + #: src/domain/synthetics/markets/createDepositTxn.ts #: src/domain/synthetics/markets/createGlvDepositTxn.ts msgid "Deposit error." @@ -447,6 +459,11 @@ msgstr "限价低于标记价格" msgid "sell" msgstr "售卖" +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainButtons.tsx +msgid "Switch to {0}" +msgstr "" + #: src/components/Exchange/SwapBox.jsx #: src/config/events.tsx msgid "Please migrate your positions to GMX V2." @@ -465,7 +482,15 @@ msgstr "{0} 无法发送到智能合约地址。请选择另一个代币。" #: src/components/Errors/errorToasts.tsx msgid "Transaction failed due to RPC error.<0/><1/>Please enable <2>Express trading under settings, which should offer a better experience." -msgstr "由于 RPC 错误,交易失败。<0/><1/>请在设置下启用 <2>快速交易,这应该提供更好的体验。" +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Referral code added!" +msgstr "由于 RPC 错误,交易失败。<0/><1/>请在设置下启用 <2>快速交易,这应该提供更好的体验。>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Available to Trade" +msgstr "" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "SELLABLE" @@ -540,16 +565,21 @@ msgstr "Telegram 内的 GMX V2 数据分析" #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High external swap impact" -msgstr "" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer ETH from other networks to Arbitrum using any of the below options:" -msgstr "您可以使用以下任何选项将 ETH 从其他网络转移到 Arbitrum:" +msgstr "<<<<<<< HEAD" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Adding" msgstr "" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Network for Cross-Chain Deposits and positions." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>deposit or <1>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "Created limit order for {0} {1}: {2} USD!" msgstr "为 {0} {1}: {2} USD 创建限价订单!" @@ -584,11 +614,19 @@ msgstr "最大容量" #: src/domain/synthetics/orders/utils.tsx msgid "Market Swap" -msgstr "市场交换" +msgstr "市场交换<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "A $500,000 GLV pool (funded by DAO funds) rewards long-term holders: If you keep your distributed GLV for at least 3 months (without selling or transferring), you'll receive a pro rata share." -msgstr "" +msgstr "<<<<<<< HEAD" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy {nativeTokenSymbol} directly on {chainName} or transfer it there." +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Tabs/NestedTab.tsx @@ -772,6 +810,10 @@ msgstr "平均仓位规模。" msgid "{0} <0/><1> to {1} <2/>" msgstr "{0} <0/><1> 到 {1} <2/>" +#: src/components/Referrals/JoinReferralCode.tsx +msgid "Sent referral code transaction" +msgstr "" + #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Short Market: {0} a short position at the current price." msgstr "{typeString} 空头市场:以当前价格 {0} 空头仓位。" @@ -861,17 +903,23 @@ msgstr "跨链一键存款到 GM" #: src/pages/Home/Home.tsx msgid "Open positions through a simple swap interface. Conveniently swap from any supported asset into the position of your choice." -msgstr "通过简单的交换界面开仓。从任何支持的资产方便地交换到您选择的仓位。" +msgstr "通过简单的交换界面开仓。从任何支持的资产方便地交换到您选择的仓位。<<<<<<< HEAD" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "No markets matched" -msgstr "没有匹配的市场" +msgstr "没有匹配的市场>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/InputSection/InputSection.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "MAX" msgstr "最大" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No centralized exchanges available for this network." +msgstr "" + #: src/components/SettingsModal/SettingsModal.tsx msgid "Invalid slippage value" msgstr "无效滑点值" @@ -889,7 +937,7 @@ msgstr "超过最大 {0} 可购买金额" msgid "Sell submitted!" msgstr "售卖已提交!" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Code already taken" msgstr "代码已被使用" @@ -939,6 +987,7 @@ msgstr "清算 {0} {longOrShortText}" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx #: src/components/Synthetics/TradeBox/TradeBox.tsx +#: src/components/Synthetics/TradeBox/TradeBox.tsx msgid "Pay" msgstr "支付" @@ -999,7 +1048,7 @@ msgstr "使用 {0} 购买" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Asset Management" -msgstr "资产管理" +msgstr "" #: src/pages/Actions/SyntheticsActions.tsx msgid "GMX {VERSION_NAME} {networkName} actions for all accounts." @@ -1065,11 +1114,15 @@ msgstr "TVL (供应)" msgid "Alternative links can be found in the <0>docs.<1/><2/>By clicking Agree you accept the <3>T&Cs and <4>Referral T&Cs.<5/><6/>" msgstr "可在 <0>文档 中找到替代链接。<1/><2/>点击同意即接受 <3>条款与条件 和 <4>推荐条款与条件。<5/><6/>" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees" +msgstr "" + #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "All Time" msgstr "所有时间" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "The referral code can't be more than {MAX_REFERRAL_CODE_LENGTH} characters." msgstr "推荐代码不能超过 {MAX_REFERRAL_CODE_LENGTH} 个字符。" @@ -1262,6 +1315,10 @@ msgstr "资金费用" msgid "Markets" msgstr "市场" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "To begin trading on GMX deposit assets into GMX account" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Real-time rants about GMX Trades" msgstr "GMX 交易的实时吐槽" @@ -1334,6 +1391,10 @@ msgstr "购买代币于:" msgid "Claims history" msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "One-Click Trading approval is invalid. This may happen when switching chains or changing payment tokens. Please sign a new approval to continue." +msgstr "" + #: src/pages/AccountDashboard/dailyAndCumulativePnLDebug.tsx #: src/pages/AccountDashboard/generalPerformanceDetailsDebug.tsx #: src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -1349,6 +1410,10 @@ msgstr "限价交换失败" msgid "Liq. {longOrShortText} - {marketIndexName}" msgstr "清算 {longOrShortText} - {marketIndexName}" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Inc." +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Longing..." msgstr "做多中..." @@ -1361,6 +1426,11 @@ msgstr "总返利" msgid "This token automatically accrues fees from leverage trading and swaps for the {0} market. It is also exposed to {1} and {2} as per the composition displayed." msgstr "此代币从 {0} 市场的杠杆交易和交换中自动累积费用。它还根据显示的组成暴露于 {1} 和 {2}。" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "To Network" +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "Min order: {0}" msgstr "最小订单:{0}" @@ -1487,6 +1557,10 @@ msgstr "转移已提交" msgid "One-Click Trading is disabled. Action limit exceeded." msgstr "一键交易已禁用。操作限制已超过。" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx @@ -1617,11 +1691,7 @@ msgstr "NFT 钱包" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX Proposals Voting page" -msgstr "GMX 提案投票页面" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy ETH directly on <0>Arbitrum using these options:" -msgstr "您可以使用这些选项直接在 <0>Arbitrum 上购买 ETH:" +msgstr "GMX 提案投票页面<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx #: src/pages/Ecosystem/ecosystemConstants.tsx @@ -1664,15 +1734,7 @@ msgstr "" #: src/components/Synthetics/TableMarketFilter/MarketFilterBase.tsx #: src/components/Synthetics/TableMarketFilter/MarketFilterLongShort.tsx msgid "Search Market" -msgstr "搜索市场" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the current price impact and set allowed slippage. The execution price must meet this condition for the order to be executed." -msgstr "订单的可接受价格包括当前价格影响和设置的允许滑点。执行价格必须满足此条件才能执行订单。" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be higher than the limit price." -msgstr "一旦标记价格达到限价,订单将尝试执行,保证可接受价格,包括设置的可接受价格影响。请注意,如果有负价格影响,标记价格可能需要高于限价。" +msgstr "搜索市场<<<<<<< HEAD=======" #: src/components/Synthetics/Claims/ClaimsHistory.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx @@ -1777,6 +1839,10 @@ msgstr "创建订单" msgid "Utilization" msgstr "利用率" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Select Asset to Deposit" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "{orderTypeText} {0} for {1}" msgstr "{orderTypeText} {0} 为 {1}" @@ -1872,6 +1938,11 @@ msgstr "对" msgid "Max {0} out" msgstr "最大 {0} 输出" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "No assets available for deposit" +msgstr "" + #: src/components/DepthChart/DepthChartTooltip.tsx msgid "There is no price impact. There is a single<0/>execution price for increasing shorts or<1/>decreasing longs for this size." msgstr "没有价格影响。对于增加空头或减少多头,此规模有单一<0/>执行价格。" @@ -1951,11 +2022,11 @@ msgstr "显示详情" #: src/components/Glp/GlpSwap.jsx #: src/components/Glp/GlpSwap.jsx msgid "To reduce fees, select a different asset to pay with." -msgstr "为减少费用,请选择不同的资产支付。" +msgstr "为减少费用,请选择不同的资产支付。<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the limit price, the order will attempt to execute, guaranteeing the acceptable price, which includes the set acceptable price impact. Note that if there is a negative price impact, the mark price may need to be lower than the limit price." -msgstr "一旦标记价格达到限价,订单将尝试执行,保证可接受价格,包括设置的可接受价格影响。请注意,如果有负价格影响,标记价格可能需要低于限价。" +#: src/components/SettingsModal/TradingSettings.tsx +msgid "Settlement Chain" +msgstr "=======" #: src/pages/Dashboard/AssetDropdown.tsx msgid "Buy {0}" @@ -2023,7 +2094,7 @@ msgstr "借款费用" #: src/components/Glp/GlpSwap.jsx msgid "Buy submitted." -msgstr "购买已提交。" +msgstr "" #: src/components/Glp/GlpSwap.jsx msgid "Fees may vary depending on which asset you sell GLP for. <0/>Enter the amount of GLP you want to redeem in the order form, then check here to compare fees." @@ -2047,7 +2118,7 @@ msgstr "费用的 USD 值在赚取时计算,不包括激励。" #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Max" -msgstr "最大" +msgstr "" #: src/components/Synthetics/GmList/GmList.tsx #: src/components/Synthetics/MarketsList/MarketsList.tsx @@ -2129,12 +2200,16 @@ msgstr "规模" #: src/components/InterviewToast/InterviewToast.tsx msgid "We value your experience and insights and invite you to participate in an anonymous one-on-one chat." -msgstr "我们重视您的经验和见解,并邀请您参与匿名一对一聊天。" +msgstr "我们重视您的经验和见解,并邀请您参与匿名一对一聊天。<<<<<<< HEAD" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Inc." +msgstr "=======" #: src/components/AppHeader/AppHeaderUser.tsx #: src/components/Glp/GlpSwap.jsx -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -2169,6 +2244,10 @@ msgstr "" msgid "<0>Read more about fees." msgstr "<0>阅读更多 关于费用。" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing requires {0} while you have {1}. Please <0>swap or <1>deposit more {2} to your GMX account." +msgstr "" + #: src/components/Exchange/OrdersList.jsx msgid "You will receive at least {0} {1} if this order is executed. The execution price may vary depending on swap fees at the time the order is executed." msgstr "如果此订单执行,您将至少收到 {0} {1}。执行价格可能因订单执行时的交换费用而异。" @@ -2260,7 +2339,7 @@ msgstr "" msgid "Fulfilling sell request." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Creating" msgstr "" @@ -2301,6 +2380,10 @@ msgstr "GLP 购买已禁用,待 {0} 升级" msgid "Initial collateral (collateral excluding borrow and funding fee)." msgstr "" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to buy {nativeTokenSymbol} directly on {chainName}." +msgstr "" + #: src/components/Errors/errorToasts.tsx #: src/components/Errors/errorToasts.tsx msgid "<0>Error submitting order.<1/><2>Signer address does not match receiver address.<3/><4>Please reload the page and try again." @@ -2359,6 +2442,7 @@ msgid "Swaps" msgstr "交换" #: src/components/ApproveTokenButton/ApproveTokenButton.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx @@ -2388,6 +2472,7 @@ msgstr "保留用于归属" #: src/components/Exchange/TradeHistory.jsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Update" @@ -2459,6 +2544,10 @@ msgstr "" msgid "Default Allowed Slippage" msgstr "默认允许滑点" +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Claiming funding fees failed" +msgstr "" + #. Total Value Locked #: src/components/Synthetics/MarketsList/MarketsList.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -2505,6 +2594,7 @@ msgstr "Saulius GMX 分析" msgid "{0} Price" msgstr "{0} 价格" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from centralized services" msgstr "从中心化服务购买 GMX" @@ -2531,13 +2621,17 @@ msgstr "借贷费用率" msgid "Max number of parts: {MAX_TWAP_NUMBER_OF_PARTS}" msgstr "最大部分数量:{MAX_TWAP_NUMBER_OF_PARTS}" -#: src/components/Header/AppHeaderUser.tsx -#: src/components/Header/AppHeaderUser.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx +#: src/components/Header/AppHeaderChainAndSettings.tsx #: src/components/ModalViews/RedirectModal.tsx #: src/pages/Home/Home.tsx msgid "Launch App" msgstr "启动应用程序" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Pay" +msgstr "" + #: src/pages/Exchange/Exchange.tsx msgid "Deposited {0} USD into {tokenSymbol} {longOrShortText}" msgstr "已存入 {0} USD 到 {tokenSymbol} {longOrShortText}" @@ -2580,7 +2674,11 @@ msgstr "净率 / 1 小时" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Vest with GMX on Avalanche" -msgstr "在 Avalanche 上授权 GMX" +msgstr "" + +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "Change to {0}" +msgstr "" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Relayer request failed" @@ -2678,11 +2776,11 @@ msgstr "解除质押失败。" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Order cancelled" -msgstr "订单已取消" +msgstr "订单已取消<<<<<<< HEAD" #: src/components/SideNav/SideNav.tsx msgid "Collapse" -msgstr "折叠" +msgstr "折叠>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/ConfirmationBox.jsx msgid "Confirm Long" @@ -2714,7 +2812,7 @@ msgstr "输入最多 10 个币种" #: src/pages/PoolsDetails/PoolsDetails.tsx msgid "Exposure to Backing Tokens" -msgstr "对支撑代币的敞口" +msgstr "" #: src/components/Exchange/OrderEditor.jsx msgid "Minimum received" @@ -2953,10 +3051,16 @@ msgstr "交易" msgid "Adding referral code failed." msgstr "添加推荐代码失败。" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Updating" msgstr "" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx msgid "Max leverage without PnL: {0}x" msgstr "无 PnL 的最大杠杆:{0}x" @@ -3011,6 +3115,10 @@ msgstr "允许 {tokenSymbol} 被支出" msgid "Help us improve" msgstr "帮助我们改进" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Staking is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/pages/Home/Home.tsx msgid "An aggregate of high-quality price feeds determine when liquidations occur. This keeps positions safe from temporary wicks." msgstr "高质量价格馈送的聚合决定了清算发生的时间。这使仓位免受临时波动的影响。" @@ -3141,15 +3249,13 @@ msgid "Total Staked" msgstr "总质押" #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Network Fee" -msgstr "网络费用" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact." -msgstr "订单的预期执行价格,包括当前价格影响。" +msgstr "网络费用<<<<<<< HEAD=======" #: src/components/Exchange/ConfirmationBox.jsx #: src/components/Exchange/PositionEditor.jsx @@ -3167,12 +3273,16 @@ msgstr "杠杆" #: src/pages/Exchange/Exchange.tsx msgid "Enable orders sent." -msgstr "启用订单已发送。" +msgstr "启用订单已发送。<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Price below mark price" msgstr "" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdrawing..." +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims match the selected filters" msgstr "没有符合选定筛选条件的领取" @@ -3181,6 +3291,7 @@ msgstr "没有符合选定筛选条件的领取" msgid "Staking" msgstr "" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx msgid "Claiming" msgstr "" @@ -3205,12 +3316,15 @@ msgstr "市场" #: src/components/Exchange/PositionSeller.jsx msgid "Swap amount from {0} to {1} exceeds {2} acceptable amount. Can only receive {3}." -msgstr "从 {0} 到 {1} 的交换金额超过 {2} 可接受金额。只能接收 {3}。" +msgstr "从 {0} 到 {1} 的交换金额超过 {2} 可接受金额。只能接收 {3}。<<<<<<< HEAD=======" +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Enter referral code" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/PositionEditor.jsx msgid "Withdraw disabled, pending {0} upgrade" @@ -3224,12 +3338,21 @@ msgstr "阅读规则" msgid "Lev." msgstr "杠杆" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Available to Trade Assets" +msgstr "" + #: src/pages/Stake/StakeModal.tsx msgid "Stake failed." msgstr "质押失败。" #: src/components/Exchange/ConfirmationBox.jsx msgid "You can edit the default allowed slippage in the settings menu on the top right of the page.<0/><1/>Note that a low allowed slippage, e.g. less than {0}, may result in failed orders if prices are volatile." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Withdrawal" msgstr "" #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx @@ -3241,6 +3364,10 @@ msgstr "提交中..." msgid "App" msgstr "应用程序" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw exceeds the limit. Please try an amount smaller than {upperLimitFormatted}." +msgstr "" + #: src/components/Synthetics/GmAssetDropdown/GmAssetDropdown.tsx msgid "Add {marketName} to Wallet" msgstr "将 {marketName} 添加到钱包" @@ -3293,6 +3420,10 @@ msgstr "购买中..." msgid "Enter a new ratio or allowed slippage" msgstr "输入新比率或允许滑点" +#: src/components/Synthetics/PositionItem/PositionItem.tsx +msgid "Net value is the amount held in the position inclusive of Pnl, fees and net price impact at close." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Swap UI Fee" msgstr "交换 UI 费用" @@ -3310,6 +3441,10 @@ msgstr "累积正资金费用" msgid "Sender has withdrawn all tokens from Affiliate Vesting Vault" msgstr "发送者已从联盟授权金库提取所有代币" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need some {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/Stake/UnstakeModal.tsx msgid "Unstake submitted." msgstr "" @@ -3343,14 +3478,13 @@ msgstr "方向" #: src/pages/PoolsDetails/PoolsDetailsAbout.tsx msgid "GM can be sold for {0} and {1} for this market up to the specified selling caps. The remaining tokens in the pool are reserved for currently open positions." -msgstr "GM 可以为此市场出售 {0} 和 {1},上限为指定的出售上限。池中剩余代币保留用于当前开仓。" +msgstr "" #: src/components/Synthetics/GmList/GlvList.tsx #: src/components/Synthetics/GmList/GmList.tsx msgid "Graph showing performance vs benchmark over the selected period." msgstr "显示所选时期表现 vs 基准的图表。" -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts @@ -3450,12 +3584,12 @@ msgstr "限价 - 做空增加" #: src/components/Synthetics/StatusNotification/FeesSettlementStatusNotification.tsx msgid "Sending settle request" -msgstr "发送结算请求" +msgstr "发送结算请求<<<<<<< HEAD=======" #: src/components/Synthetics/PositionSeller/PositionSeller.tsx #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "Express params loading" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Order cannot be executed as the remaining position would be smaller than $5.00" @@ -3463,17 +3597,26 @@ msgstr "订单无法执行,因为剩余仓位将小于 5.00 美元" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/UserIncentiveDistributionList/ClaimableAmounts.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx #: src/pages/Stake/AffiliateClaimModal.tsx #: src/pages/Stake/ClaimModal.tsx msgid "Claiming..." -msgstr "领取中..." +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "All" +msgstr "领取中...>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Request Market Increase" msgstr "请求市场增加" +#: src/domain/multichain/SettlementChainWarningContainer.tsx +msgid "You switched your settlement network to {0}, but you still have {1} remaining in your {2} Deposit" +msgstr "" + #: src/components/Synthetics/OrderEditor/OrderEditor.tsx msgid "Edit {0}" msgstr "编辑 {0}" @@ -3518,7 +3661,11 @@ msgstr "该网站是社区部署和维护的开源 <0>GMX 前端 实例, #: src/components/Exchange/PositionEditor.jsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Deposit failed." -msgstr "存入失败。" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Enter withdrawal amount" +msgstr "存入失败。>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/AcceptablePriceImpactInputRow/AcceptablePriceImpactInputRow.tsx #: src/components/Synthetics/AllowedSwapSlippageInputRowImpl/AllowedSwapSlippageInputRowImpl.tsx @@ -3645,6 +3792,10 @@ msgstr "请求市场交换" msgid "Insufficient liquidity in the {0} market pool. Select a different pool for this market.{1}" msgstr "{0} 市场池流动性不足。请为此市场选择不同的池。{1}" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "The amount you are trying to withdraw is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + #: src/domain/synthetics/trade/utils/validation.ts msgid "App disabled, pending {0} upgrade" msgstr "应用程序禁用,待 {0} 升级" @@ -3678,15 +3829,19 @@ msgstr "更多选项" #: src/components/TokenCard/TokenCard.tsx msgid "GLV is the liquidity provider token for GMX V2 vaults. Consist of several GM tokens and accrues fees generated by them." -msgstr "GLV 是 GMX V2 金库的流动性提供者代币。由多个 GM 代币组成,并累积它们产生的费用。" +msgstr "" #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "Yes, GLV is fully liquid and permissionless. You can sell via the GMX interface to redeem for underlying assets, with low fees." -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/NetworkDropdown/NetworkDropdown.tsx msgid "Network" -msgstr "网络" +msgstr "网络>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" + +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx +msgid "Success claiming funding fees" +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {hours} hours{0}" @@ -3697,6 +3852,10 @@ msgstr "<0>每 {hours} 小时{0}" msgid "Fail External Swaps" msgstr "外部交换失败" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Repeat Transaction" +msgstr "" + #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High swap profit fee" msgstr "" @@ -3739,6 +3898,10 @@ msgstr "使用网络的本机代币 {0} 无法进行快速交易。请考虑使 msgid "Market Increase" msgstr "市场增加" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity" +msgstr "" + #: src/components/Synthetics/Claims/ClaimsHistory.tsx msgid "No claims yet" msgstr "暂无领取" @@ -3747,12 +3910,21 @@ msgstr "暂无领取" msgid "Cancel Order" msgstr "取消订单" +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees failed" +msgstr "" + #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/types.ts #: src/components/Synthetics/TradeHistory/keys.ts +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx #: src/pages/Stake/Vesting.tsx @@ -3771,7 +3943,8 @@ msgstr "可领取授权 GMX" msgid "Buy {nativeTokenSymbol}" msgstr "购买 {nativeTokenSymbol}" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "View in Explorer" msgstr "在浏览器中查看" @@ -3793,11 +3966,7 @@ msgstr "您有多个现有的增加 {longOrShortText} {0} 限价订单" #: src/lib/wallets/connecters/binanceW3W/binanceWallet.ts msgid "After you scan, a connection prompt will appear for you to connect your wallet." -msgstr "扫描后,将出现连接提示,您可以连接您的钱包。" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can transfer AVAX from other networks to Avalanche using any of the below options:" -msgstr "您可以使用以下任何选项将 AVAX 从其他网络转移到 Avalanche:" +msgstr "扫描后,将出现连接提示,您可以连接您的钱包。<<<<<<< HEAD=======" #: src/pages/Stake/Vesting.tsx msgid "Unsupported network" @@ -3809,6 +3978,10 @@ msgstr "不支持的网络" msgid "Opening..." msgstr "开仓中..." +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Fee" +msgstr "" + #: src/components/Referrals/AffiliatesStats.tsx msgid "Traders Referred on Avalanche" msgstr "在 Avalanche 上推荐的交易者" @@ -3940,6 +4113,10 @@ msgstr "领取后,esGMX 代币将在 7 天内空投到您所选网络的账户 msgid "Deposit amount is insufficient to bring leverage below the max allowed leverage of 100x." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Funding Activity" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapBoxHeader.tsx msgid "Buy GLV" msgstr "购买 GLV" @@ -3970,6 +4147,7 @@ msgstr "请求增加 {0} {longOrShortText}, +{1} USD,可接受价格:{2} {3} #: src/components/Exchange/SwapBox.jsx #: src/components/Exchange/SwapBox.jsx #: src/components/Synthetics/CollateralSelector/CollateralSelector.tsx +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx #: src/components/Synthetics/TradeBox/TradeBoxRows/CollateralSelectorRow.tsx msgid "Collateral In" msgstr "抵押品进入" @@ -4024,7 +4202,6 @@ msgstr "该账户作为交易者赚取的回扣。" #: src/components/Exchange/SwapBox.jsx #: src/components/SettingsModal/TradingSettings.tsx #: src/components/SettingsModal/TradingSettings.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx @@ -4203,7 +4380,7 @@ msgstr "联盟金库" #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a price" -msgstr "输入价格" +msgstr "" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Market Increase" @@ -4262,17 +4439,14 @@ msgstr "{daysConsidered} 天赚取费用" msgid "Fulfilling order request" msgstr "履行订单请求" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts msgid "Insufficient {0} balance to pay for gas" msgstr "{0} 余额不足以支付 gas" #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "You can currently vest a maximum of {0} esGMX tokens at a ratio of {1} {stakingToken} to 1 esGMX." -msgstr "您目前最多可以授权 {0} esGMX 代币,比例为 {1} {stakingToken} 到 1 esGMX。" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy AVAX directly to Avalanche or transfer it there." -msgstr "直接购买 AVAX 到 Avalanche 或转移到那里。" +msgstr "您目前最多可以授权 {0} esGMX 代币,比例为 {1} {stakingToken} 到 1 esGMX。<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Open Ocean" @@ -4290,6 +4464,10 @@ msgstr "准备交易错误。提供者未定义" msgid "Insufficient liquidity in GM Pool" msgstr "GM 池流动性不足" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "You're withdrawing {0}, your gas token. Gas is required for this withdrawal, so please keep at least {1} in {2} or switch your gas token in settings." +msgstr "" + #: src/components/Exchange/ExchangeBanner.jsx msgid "Trade on GMX and win <0>$250.000 in prizes! Live until November 30th, <1>click here to learn more." msgstr "在 GMX 上交易,赢取 <0>250,000 美元奖品!活动至 11 月 30 日,<1>点击这里 了解更多。" @@ -4311,7 +4489,8 @@ msgstr "累积借贷费用" msgid "Read more." msgstr "阅读更多。" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx #: src/components/Synthetics/TradeHistory/TradeHistory.tsx msgid "PnL Analysis" msgstr "PnL 分析" @@ -4344,7 +4523,7 @@ msgstr "<0>通知由 Notifi 提供,与 GMX 无关。通过订阅,您同意 #: src/components/TokenCard/TokenCard.tsx msgid "{arbitrumLink} and {avalancheLink} GLV Pools are <0>incentivized{sparkle}." -msgstr "{arbitrumLink} 和 {avalancheLink} GLV 池 <0>有激励{sparkle}。" +msgstr "" #: src/components/Synthetics/TradeInfoIcon/TradeInfoIcon.tsx msgid "{typeString} Long Limit: {0} a long position when the price is below the trigger price." @@ -4374,15 +4553,10 @@ msgstr "Gas 支付代币" #: src/components/DepthChart/DepthChartTooltip.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Price Impact" msgstr "价格影响" @@ -4485,13 +4659,18 @@ msgstr "GMX 技术公告" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Failed Stop Market" -msgstr "止损市价失败" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Address copied to your clipboard" +msgstr "" #: src/components/Header/AppHeaderLinks.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/NetworkDropdown/NetworkDropdown.tsx #: src/components/SettingsModal/SettingsModal.tsx #: src/components/SideNav/SettingsNavItem.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Settings" msgstr "设置" @@ -4548,8 +4727,15 @@ msgstr "转移已启动" msgid "Withdraw submitted." msgstr "提取已提交。" -#: src/components/Referrals/AddAffiliateCode.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts +msgid "Net Price Impact" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Enter a code" msgstr "输入代码" @@ -4557,6 +4743,10 @@ msgstr "输入代码" msgid "Details" msgstr "详情" +#: src/components/TVChartContainer/constants.ts +msgid "Market - Short Dec." +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Umami DAO" msgstr "Umami DAO" @@ -5023,6 +5213,10 @@ msgstr "无效的 NFT 地址" msgid "LIQ." msgstr "清算" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +msgid "Transfer Details" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GLP and GMX autocompounding vaults" msgstr "GLP 和 GMX 自动复合金库" @@ -5134,6 +5328,11 @@ msgstr "一键设置" msgid "GMX Announcements" msgstr "GMX 公告" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net price impact is the sum of the stored impact at increase and the impact at decrease action, which is only settled on position decrease. <0>Read more" +msgstr "" + #: src/components/Header/AppHeaderLinks.tsx #: src/components/SideNav/SideNav.tsx #: src/pages/Referrals/Referrals.tsx @@ -5196,6 +5395,7 @@ msgstr "" #: src/components/Synthetics/Claims/Claims.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/useShiftSubmitState.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx #: src/domain/synthetics/orders/getPositionOrderError.tsx @@ -5224,12 +5424,16 @@ msgstr "执行" #: src/pages/Exchange/Exchange.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx msgid "Trades" -msgstr "交易" +msgstr "交易<<<<<<< HEAD" #: src/components/Exchange/SwapBox.jsx msgid "Swapped {0} {1} for {2} {3}." msgstr "" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "No swap path available." msgstr "无可用交换路径。" @@ -5365,6 +5569,10 @@ msgstr "正在转移" msgid "GLP autocompounding vaults" msgstr "GLP 自动复合金库" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "Your deposit of from {sourceChainName} was not executed due to an error" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx msgid "TP/SL orders exceed the position" msgstr "TP/SL 订单超过头寸" @@ -5471,6 +5679,10 @@ msgstr "订单大小为 0" msgid "The buyable cap for the pool GM: {0} in {1} [{2}] has been reached. Please reduce the buy size, pick a different GM token, or shift the GM tokens to a different pool and try again." msgstr "池 GM: {0} 在 {1} [{2}] 的可买入上限已达到。请减少买入大小、选择不同的 GM 代币,或将 GM 代币转移到不同的池并重试。" +#: src/components/TokenSelector/MultichainTokenSelector.tsx +msgid "Available to Deposit" +msgstr "" + #: src/components/Exchange/PositionSeller.jsx msgid "Close {longOrShortText} {0}" msgstr "关闭 {longOrShortText} {0}" @@ -5494,7 +5706,12 @@ msgstr "TP/SL" msgid "Max {0} in" msgstr "最大 {0} 输入" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Asset" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Checking code" msgstr "" @@ -5546,6 +5763,10 @@ msgstr "" msgid "No open positions" msgstr "无开放头寸" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "To Wallet" +msgstr "" + #: src/components/DepthChart/DepthChart.tsx msgid "Size, $" msgstr "大小,$" @@ -5564,11 +5785,7 @@ msgstr "STIP.b 追溯奖金" #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code updated." -msgstr "" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "You can buy AVAX directly on <0>Avalanche using these options:" -msgstr "您可以使用这些选项直接在 <0>Avalanche 上购买 AVAX:" +msgstr "<<<<<<< HEAD=======" #: src/components/Exchange/NetValueTooltip.tsx msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Close Fee" @@ -5740,11 +5957,7 @@ msgstr "执行 TWAP 交换部分" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "<0>every {seconds} seconds" -msgstr "<0>每 {seconds} 秒" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer AVAX to Avalanche" -msgstr "购买或转移 AVAX 到 Avalanche" +msgstr "<0>每 {seconds} 秒<<<<<<< HEAD=======" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "TokenTerminal" @@ -5868,6 +6081,11 @@ msgstr "您有一个 <0>待处理的转移 到 {pendingReceiver}。" msgid "Limit size is required" msgstr "需要限价大小" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Network" +msgstr "" + #: src/pages/Buy/Buy.tsx #: src/pages/Home/Home.tsx msgid "Protocol Tokens" @@ -5877,10 +6095,15 @@ msgstr "协议代币" msgid "Collateral at Liquidation" msgstr "清算时的抵押品" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "You’ll need {formattedAmount} ({formattedUsd}) {nativeTokenSymbol} in your account to withdraw funds." +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "After claiming you will be able to vest a maximum of {0} esGMX at a ratio of {1} {stakingToken} to 1 esGMX." msgstr "领取后,您将能够以 {1} {stakingToken} 比 1 esGMX 的比例归属最多 {0} esGMX。" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Today" msgstr "今天" @@ -5958,6 +6181,10 @@ msgstr "层级 {0} ({currentTierDiscount}% 折扣)" msgid "This order using {collateralSymbol} as collateral will not be valid for the existing {longText} position using {symbol} as collateral." msgstr "使用 {collateralSymbol} 作为抵押品的此订单对使用 {symbol} 作为抵押品的现有 {longText} 头寸无效。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Pick an asset to deposit" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Generative Market eXplore - AIGMX Agent" msgstr "生成市场探索 - AIGMX 代理" @@ -6038,12 +6265,16 @@ msgstr "已提取!" #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx #: src/pages/LeaderboardPage/components/CompetitionPrizes.tsx msgid "3rd Place" -msgstr "第三名" +msgstr "第三名<<<<<<< HEAD" #: src/components/SettingsModal/TradingSettings.tsx msgid "Your wallet, your keys.<0/><1/>GMX executes transactions for you without individual signing, providing a seamless, CEX-like experience. Trades use GMX-sponsored premium RPCs for reliability, even during network congestion. Gas payments in USDC or WETH." msgstr "" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Enter deposit amount" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Stop Loss" msgstr "更新止损" @@ -6111,6 +6342,7 @@ msgstr "{formattedNetRate} / 1 小时" #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/GmDepositWithdrawalBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx #: src/components/Synthetics/GmSwap/GmSwapBox/GmShiftBox/GmShiftBox.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx msgid "Balance" msgstr "余额" @@ -6147,17 +6379,23 @@ msgstr "胜/负" msgid "Names could be separated by commas or spaces" msgstr "名称可以用逗号或空格分隔" +#: src/pages/BuyGMX/BuyGMX.tsx #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX from decentralized exchanges" msgstr "从去中心化交易所购买 GMX" #: src/components/NotifyModal/NotifyModal.tsx msgid "Powered by" -msgstr "由...提供支持" +msgstr "由...提供支持<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "The order's acceptable price includes the set acceptable price impact. The execution price must meet this condition for the order to be executed." -msgstr "订单的可接受价格包括设定的可接受价格影响。执行价格必须满足此条件才能执行订单。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Asset Balance" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No options available to transfer {nativeTokenSymbol} to {chainName}." +msgstr "=======" #: src/components/Synthetics/TwapRows/TwapRows.tsx msgid "This TWAP order will execute {numberOfParts} {0} {type} orders of {1} each over the next {2} for the {3} market." @@ -6189,6 +6427,7 @@ msgstr "下载交易历史 CSV 失败。" msgid "market" msgstr "市场" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Same as current active code" msgstr "与当前活跃代码相同" @@ -6235,16 +6474,16 @@ msgstr "GMX 社区,包含 NFT、交易和教育举措" #: src/components/NotifyModal/NotifyModal.tsx msgid "Liquidation Confirmations" -msgstr "清算确认" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the stop market order executes." -msgstr "止损市价订单执行后,包括当前价格影响的预期执行价格。" +msgstr "清算确认<<<<<<< HEAD=======" #: src/components/Glp/GlpSwap.jsx msgid "Acknowledge epoch is ending in {minutes} minutes" msgstr "确认时代将在 {minutes} 分钟内结束" +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +msgid "From Wallet" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmSwapWarningsRow.tsx msgid "High Price Impact" msgstr "高价格影响" @@ -6255,19 +6494,15 @@ msgstr "我们希望您的见解帮助改进 GMX。出于安全原因,我们 #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "Claim esGMX" -msgstr "领取 esGMX" +msgstr "领取 esGMX<<<<<<< HEAD" -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy or Transfer ETH to Arbitrum" -msgstr "购买或转移 ETH 到 Arbitrum" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Expected execution price for the order, including the current price impact, once the limit order executes." -msgstr "限价订单执行后,包括当前价格影响的预期执行价格。" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Vesting is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "tBTC LP Incentives" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "of open fee" @@ -6313,6 +6548,7 @@ msgstr "" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx #: src/components/NpsModal/NpsModal.tsx #: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/UserFeedbackModal/UserFeedbackModal.tsx msgid "Submit" msgstr "提交" @@ -6347,7 +6583,7 @@ msgid "Could not execute deposit into {0} {longOrShortText}." msgstr "" #: src/components/Exchange/TradeHistory.jsx -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts @@ -6369,6 +6605,7 @@ msgstr "复制" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx msgid "Amount" msgstr "金额" @@ -6397,6 +6634,8 @@ msgstr "触发价格" #: src/components/Referrals/ClaimAffiliatesModal/ClaimAffiliatesModal.tsx #: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/Claims/ClaimableCard.tsx #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx @@ -6408,15 +6647,9 @@ msgid "Claim" msgstr "领取" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx msgid "Price Impact / Fees" msgstr "价格影响 / 费用" -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts -#: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/position.ts msgid "Order execution price takes into account price impact." @@ -6424,16 +6657,44 @@ msgstr "订单执行价格考虑了价格影响。" #: src/pages/Buy/Buy.tsx msgid "Buy GLP or GMX" -msgstr "购买 GLP 或 GMX" +msgstr "" + +#: src/context/GmxAccountContext/GmxAccountContext.tsx +msgid "Source Base is now available on GMX" +msgstr "购买 GLP 或 GMX>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "GLV earns from trading fees (open, close, borrow, liquidations, swaps) and trader losses across GM pools, with auto-compounding for seamless growth (20-30% historical average annualized performance). View real-time earnings, performance, and portfolio value on the <0>Pools page." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +msgid "Deposit failed" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Deposit USDC or ETH" +msgstr "" + +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Referral code created." msgstr "" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Withdrawing Funds from GMX" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "Notifications" +msgstr "" + +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "No decentralized exchanges available for this network." +msgstr "" + #: src/components/Exchange/OrderEditor.jsx msgid "Price is below mark price" msgstr "" @@ -6468,15 +6729,15 @@ msgstr "" #: src/pages/Stake/UnstakeModal.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Enter an amount" -msgstr "输入金额" +msgstr "输入金额<<<<<<< HEAD" #: src/components/Exchange/OrderEditor.jsx msgid "Order update submitted." msgstr "" -#: src/components/Header/AppHeaderUser.tsx -msgid "Connect" -msgstr "连接" +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets are available for deposit" +msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/AffiliatesStats.tsx @@ -6526,6 +6787,13 @@ msgstr "未知的转移 GM 订单" msgid "Max leverage of 100x was exceeded, the remaining collateral after deducting losses and fees have been sent back to your account:" msgstr "超过 100x 的最大杠杆,扣除损失和费用后的剩余抵押品已发送回您的账户:" +#: src/components/Synthetics/CollateralSelector/PositionEditorCollateralSelector.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "GMX Balance" +msgstr "" + #: src/components/Synthetics/GmSwap/GmSwapBox/GmDepositWithdrawalBox/useGmSwapSubmitState.tsx msgid "Shifting {symbol}..." msgstr "正在转移 {symbol}..." @@ -6582,6 +6850,10 @@ msgstr "GM 空投" msgid "Save on Fees" msgstr "节省费用" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Approving" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Take Profit" msgstr "更新止盈" @@ -6746,7 +7018,7 @@ msgstr "开仓费用" msgid "Sell order executed." msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Looks like you don't have a referral code to share. <0/> Create one now and start earning rebates!" msgstr "看来您没有推荐代码可以分享。<0/> 现在创建一个,开始赚取回扣!" @@ -6789,11 +7061,21 @@ msgstr "您" msgid "Deactivate 1CT (One-Click Trading)" msgstr "停用 1CT (一键交易)" +#: src/components/AddressDropdown/AddressDropdownWithMultichain.tsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/keys.ts +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/PositionEditor/types.ts +#: src/components/Synthetics/TradeBox/hooks/useTradeButtonState.tsx #: src/components/Synthetics/TradeHistory/keys.ts +#: src/components/TokenSelector/MultichainTokenSelector.tsx +#: src/domain/multichain/useMultichainFundingToast.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/VesterDepositModal.tsx #: src/pages/Stake/Vesting.tsx @@ -7011,6 +7293,8 @@ msgid "Size per part" msgstr "每个部分的大小" #: src/components/Glp/GlpSwap.jsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts #: src/domain/synthetics/trade/utils/validation.ts @@ -7029,11 +7313,7 @@ msgstr "限价" #: src/components/Exchange/PositionSeller.jsx msgid "Initial collateral (collateral excluding borrow fee)." -msgstr "" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more." -msgstr "平仓的价格影响回扣可在领取选项卡下领取。<0>阅读更多。" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Sending order request" @@ -7058,7 +7338,7 @@ msgstr "最大网络费用包括额外订单的费用。如果它们未触发并 #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx msgid "Rebates" -msgstr "回扣" +msgstr "" #: src/pages/BuyGlp/BuyGlp.jsx msgid "GMX V1 markets are disabled and only allow for position closing. GLP is being phased out and no longer supports GMX V1 markets." @@ -7068,6 +7348,10 @@ msgstr "GMX V1 市场已禁用,仅允许平仓。GLP 正在逐步淘汰,不 msgid "Sell failed." msgstr "出售失败。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "Insufficient {nativeTokenSymbol} balance" +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update Limit" msgstr "更新限价" @@ -7078,6 +7362,10 @@ msgstr "更新限价" msgid "Edit order" msgstr "编辑订单" +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Error simulating withdrawal" +msgstr "" + #: src/pages/AccountDashboard/HistoricalLists.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx #: src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -7091,6 +7379,7 @@ msgstr "" #: src/components/Referrals/AffiliatesStats.tsx #: src/components/Referrals/TradersStats.tsx #: src/components/Synthetics/Claims/ClaimsHistory.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx #: src/components/Synthetics/UserIncentiveDistributionList/UserIncentiveDistributionList.tsx #: src/pages/AccountDashboard/DailyAndCumulativePnL.tsx @@ -7100,11 +7389,15 @@ msgstr "日期" #: src/pages/BuyGMX/BuyGMX.tsx msgid "Buy GMX using FIAT gateways:" -msgstr "使用 FIAT 网关购买 GMX:" +msgstr "" + +#: src/domain/multichain/toastEnableExpress.tsx +msgid "Express trading was enabled to allow the use of collateral from your GMX account balance. You can disable it in the <0>settings." +msgstr "" #: src/domain/tokens/approveTokens.tsx msgid "Approval failed." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Exchange/PositionSeller.jsx #: src/components/Synthetics/OrderEditor/OrderEditor.tsx @@ -7180,6 +7473,7 @@ msgid "Layer 1" msgstr "Layer 1" #: src/components/Exchange/PositionEditor.jsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx #: src/pages/Stake/VesterDepositModal.tsx msgid "Depositing" msgstr "" @@ -7205,6 +7499,12 @@ msgstr "超过最大 {0} 金额" msgid "Position close disabled, pending {0} upgrade" msgstr "仓位关闭已禁用,待 {0} 升级" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/SelectAssetToDepositView.tsx +msgid "No assets available for deposit on {0}" +msgstr "" + #: src/components/Exchange/ConfirmationBox.jsx msgid "Swapping..." msgstr "交换中..." @@ -7280,10 +7580,18 @@ msgstr "提取失败" msgid "Get fee discounts and earn rebates through the GMX referral program.<0/>For more information, please read the <1>referral program details." msgstr "通过 GMX 推荐程序获得费用折扣并赚取返利。<0/>更多信息,请阅读 <1>推荐程序详情。" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "Buy or Transfer {nativeTokenSymbol} to {chainName}" +msgstr "" + #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "Freeze" msgstr "冻结" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing Funds to GMX" +msgstr "" + #: src/components/Synthetics/PositionEditor/usePositionEditorButtonState.tsx msgid "Express params loading..." msgstr "快速参数加载中..." @@ -7357,7 +7665,7 @@ msgstr "选择支付代币" #: src/components/Synthetics/TVChart/components/AvailableLiquidityTooltip.tsx msgid "The available liquidity will be the lesser of the difference between the maximum value and the current value for both the reserve and open interest." -msgstr "可用流动性将是储备和未平仓利息的最大值与当前值之间差额的较小值。" +msgstr "" #: src/components/Synthetics/GmSwap/GmFees/GmFees.tsx msgid "shift" @@ -7404,6 +7712,11 @@ msgstr "此代码已被他人用于 {takenNetworkNames},您将无法从使用 msgid "Confirm Claim" msgstr "确认领取" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "GMX Account Balance" +msgstr "" + #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "GMX community discussion" msgstr "GMX 社区讨论" @@ -7502,6 +7815,14 @@ msgstr "<0>池子容量已达到 {0}。请使用其他代币购买 GLP。<1> msgid "GMX dashboards and analytics." msgstr "GMX 仪表板和分析。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +msgid "The amount you are trying to deposit is below the limit. Please try an amount larger than {lowerLimitFormatted}." +msgstr "" + +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames}. Please switch to {chainNames} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "External Swap {0} to {1}" msgstr "外部交换 {0} 到 {1}" @@ -7606,7 +7927,11 @@ msgstr "无效地址。请确保您输入了有效的以太坊地址" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Sender has withdrawn all tokens from GMX Vesting Vault" -msgstr "发送者已从 GMX 授权金库中提取所有代币" +msgstr "" + +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Claiming position price impact fees" +msgstr "发送者已从 GMX 授权金库中提取所有代币>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/Claims/ClaimHistoryRow/ClaimFundingFeesHistoryRow.tsx #: src/components/Synthetics/Claims/filters/ActionFilter.tsx @@ -7627,11 +7952,11 @@ msgstr "{increaseOrDecreaseText} {tokenText} 按 {sizeText}" #: src/components/Exchange/PositionSeller.jsx msgid "Neither collateral nor realized PnL is enough to cover pending fees. Please close a larger position amount." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/SettingsModal/ThemeSelector.tsx msgid "Dark" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Stake/UnstakeModal.tsx msgid "{0}<0>You will earn {1}% less rewards with this action." @@ -7717,9 +8042,10 @@ msgstr "接受触发订单的确认" msgid "Choose to buy from decentralized or centralized exchanges." msgstr "选择从去中心化或中心化交易所购买。" +#: src/components/Synthetics/GmxAccountModal/GmxAccountModal.tsx #: src/pages/AccountDashboard/AccountDashboard.tsx msgid "GMX Account" -msgstr "" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/Ecosystem.tsx msgid "GMX ecosystem pages." @@ -7731,6 +8057,10 @@ msgstr "{avalancheLink} GM 池子被 <0>激励{sparkle}。" #: src/components/Synthetics/StatusNotification/GmStatusNotification.tsx msgid "Shift order cancelled." +msgstr "<<<<<<< HEAD" + +#: src/components/Synthetics/ClaimablePositionPriceImpactRebateModal/ClaimablePositionPriceImpactRebateModal.tsx +msgid "Success claiming position price impact fees" msgstr "" #: src/lib/legacy.ts @@ -7752,7 +8082,11 @@ msgstr "总奖励" #: src/pages/NftWallet/NftWallet.jsx msgid "NFT ID" -msgstr "NFT ID" +msgstr "NFT ID<<<<<<< HEAD" + +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Select network" +msgstr "=======>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/lib/legacy.ts msgid "Decentralized Perpetual Exchange | GMX" @@ -7781,16 +8115,20 @@ msgstr "推荐条款" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter unique coins" -msgstr "输入唯一币种" +msgstr "输入唯一币种<<<<<<< HEAD=======" #: src/components/Synthetics/TradeHistory/TradeHistoryRow/utils/shared.ts msgid "The execution price didn't meet the acceptable price condition. The order will get filled when the condition is met." -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/Synthetics/GmList/FeeApyLabel.tsx msgid "Fee APY" msgstr "费用年利率" +#: src/components/Synthetics/GmxAccountModal/InsufficientWntBanner.tsx +msgid "Please <0>swap to get {nativeTokenSymbol}." +msgstr "" + #: src/components/MarketSelector/MarketSelector.tsx msgid "No markets matched." msgstr "无匹配市场。" @@ -7832,13 +8170,13 @@ msgstr "" msgid "Error occurred. Please try again" msgstr "发生错误。请重试" -#: src/components/Referrals/referralsHelper.js +#: src/components/Referrals/referralsHelper.ts msgid "Only letters, numbers and underscores are allowed." msgstr "仅允许字母、数字和下划线。" #: src/components/Synthetics/HighPriceImpactOrFeesWarningCard/HighPriceImpactOrFeesWarningCard.tsx msgid "High TWAP network fee" -msgstr "" +msgstr "<<<<<<< HEAD" #: src/components/Synthetics/MarketTokenSelector/MarketTokenSelector.tsx msgid "APY" @@ -7866,7 +8204,8 @@ msgid "Image generation error, please refresh and try again." msgstr "图像生成错误,请刷新并重试。" #: src/components/Synthetics/Claims/ClaimableCardUI.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx +#: src/components/Synthetics/PositionItem/PositionItem.tsx +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx msgid "Price Impact Rebates" msgstr "价格影响返利" @@ -7898,7 +8237,11 @@ msgstr "V1 返利" msgid "Invalid token indexToken: \"{0}\" collateralToken: \"{1}\"" msgstr "无效代币 indexToken: \"{0}\" collateralToken: \"{1}\"" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Withdraw Fee" +msgstr "" + +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx #: src/components/Header/AppHeaderLinks.tsx msgid "Alerts" msgstr "警报" @@ -7943,6 +8286,8 @@ msgstr "奖金年利率将作为 {airdropTokenTitle} 代币空投。<0>阅读更 #: src/components/Glp/GlpSwap.jsx #: src/components/Synthetics/GmList/GmListItem.tsx #: src/components/Synthetics/GmList/GmTokensTotalBalanceInfo.tsx +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +#: src/components/Synthetics/GmxAccountModal/TransferDetailsView.tsx #: src/pages/PoolsDetails/PoolsDetailsHeader.tsx #: src/pages/Stake/EscrowedGmxCard.tsx #: src/pages/Stake/GlpCard.tsx @@ -7953,11 +8298,7 @@ msgstr "钱包" #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "You have a pending transfer from {sender}." -msgstr "您有一个来自 {sender} 的待处理转移。" - -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Once the mark price hits the stop price, the order will attempt to execute." -msgstr "一旦标记价格达到止损价格,订单将尝试执行。" +msgstr "您有一个来自 {sender} 的待处理转移。<<<<<<< HEAD=======" #: src/domain/synthetics/trade/utils/validation.ts msgid "Enter a trigger price" @@ -8011,7 +8352,11 @@ msgstr "稳定协议" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Enter a valid coin names" -msgstr "输入有效的币种名称" +msgstr "" + +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "All assets" +msgstr "" #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx #: src/components/Synthetics/PoolSelector2/PoolSelector2.tsx @@ -8036,7 +8381,11 @@ msgstr "" #: src/components/Synthetics/TradeBox/TradeBoxRows/LimitAndTPSLRows.tsx msgid "Stop Loss PnL" -msgstr "止损盈亏" +msgstr "" + +#: src/components/TVChartContainer/constants.ts +msgid "Market - Long Dec." +msgstr "" #: src/components/Exchange/UsefulLinks.tsx #: src/components/Header/AppHeaderLinks.tsx @@ -8076,11 +8425,7 @@ msgstr "{prefix} <0>{text}" #: src/context/SubaccountContext/SubaccountContextProvider.tsx msgid "Failed to update settings" -msgstr "更新设置失败" - -#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx -msgid "Positive Price Impact / Fees" -msgstr "正价格影响 / 费用" +msgstr "更新设置失败<<<<<<< HEAD=======" #: src/components/Exchange/PositionShare.tsx msgid "Tweet" @@ -8119,18 +8464,18 @@ msgstr "止损失败" msgid "Daily Profit" msgstr "每日利润" +#: src/pages/BuyGMX/BuyGMX.tsx +msgid "You can buy {nativeTokenSymbol} directly on <0>{chainName} using these options:" +msgstr "" + #: src/pages/ClaimEsGmx/ClaimEsGmx.jsx msgid "The esGMX tokens can be staked or vested at any time." -msgstr "esGMX 代币可以随时质押或授权。" - -#: src/pages/BuyGMX/BuyGMX.tsx -msgid "Buy ETH directly on Arbitrum or transfer it there." -msgstr "直接在 Arbitrum 上购买 ETH 或转移到那里。" +msgstr "esGMX 代币可以随时质押或授权。<<<<<<< HEAD=======" #: src/components/Exchange/OrderEditor.jsx #: src/components/Exchange/OrderEditor.jsx msgid "Enter new price" -msgstr "" +msgstr ">>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/components/MissedCoinsModal/MissedCoinsModal.tsx msgid "Max 110 symbols exceeded" @@ -8162,8 +8507,9 @@ msgstr "第二名" #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx #: src/components/Synthetics/ChartTokenSelector/ChartTokenSelector.tsx msgid "LAST PRICE" -msgstr "最新价格" +msgstr "" +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx #: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx msgid "Re-sign" msgstr "重新签名" @@ -8184,6 +8530,11 @@ msgstr "<0>在领取前委托您未委托的 {0} GMX DAO 投票权。" msgid "Claim funds" msgstr "" +#: src/components/Synthetics/PositionSeller/rows/PositionSellerPriceImpactFeesRow.tsx +#: src/components/Synthetics/TradeBox/TradeBoxRows/PriceImpactFeesRow.tsx +msgid "Net Price Impact / Fees" +msgstr "" + #: src/components/Synthetics/TradeBox/hooks/useCollateralInTooltipContent.tsx msgid "You will be long {indexSymbol} from your long position, as well as from your {collateralSymbol} collateral. The liquidation price is higher compared to using a stablecoin as collateral since the worth of the collateral will change with its price." msgstr "您将从您的多头仓位以及 {collateralSymbol} 抵押品中做多 {indexSymbol}。与使用稳定币作为抵押品相比,清算价格更高,因为抵押品的价值会随其价格变化。" @@ -8203,7 +8554,6 @@ msgid "{0} required" msgstr "" #: src/components/DepthChart/DepthChartTooltip.tsx -#: src/components/Synthetics/ExecutionPriceRow.tsx #: src/components/Synthetics/TradeHistory/useDownloadAsCsv.tsx msgid "Execution Price" msgstr "执行价格" @@ -8237,7 +8587,7 @@ msgstr "费用值不包括激励。" msgid "For detailed stats" msgstr "" -#: src/components/Referrals/AddAffiliateCode.jsx +#: src/components/Referrals/AddAffiliateCode.tsx msgid "Generate Referral Code" msgstr "生成推荐代码" @@ -8273,6 +8623,7 @@ msgstr "存入 {0} USD 到 {1} {longOrShortText}" msgid "Distribution" msgstr "分配" +#: src/components/Referrals/JoinReferralCode.tsx #: src/components/Referrals/JoinReferralCode.tsx msgid "Referral code does not exist" msgstr "" @@ -8291,11 +8642,7 @@ msgstr "总用户" #: src/components/SettingsModal/TradingSettings.tsx msgid "The maximum allowed percentage difference between the mark price and the execution price for market orders." -msgstr "" - -#: src/components/Synthetics/PositionItem/PositionItem.tsx -msgid "Net Value: Initial Collateral + PnL - Borrow Fee - Negative Funding Fee - Close Fee" -msgstr "净值:初始抵押品 + 盈亏 - 借款费用 - 负资金费用 - 关闭费用" +msgstr "<<<<<<< HEAD=======" #: src/domain/synthetics/sidecarOrders/utils.ts msgid "Trigger price below lowest limit price" @@ -8315,7 +8662,13 @@ msgstr "分享仓位" msgid "Min leverage: 1.1x" msgstr "最小杠杆:1.1x" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more USDC." +msgstr "" + #: src/components/Exchange/FeesTooltip.tsx +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx msgid "Deposit Fee" msgstr "存款费用" @@ -8359,7 +8712,11 @@ msgstr "您在竞赛窗口期间没有任何符合条件的交易。" #: src/components/DepthChart/DepthChartTooltip.tsx msgid "Execution prices for increasing longs and<0/>decreasing shorts." -msgstr "增加多头和<0/>减少空头的执行价格。" +msgstr "" + +#: src/components/Referrals/JoinReferralCode.tsx +msgid "It will take a couple of minutes to be reflected. Please check back later." +msgstr "增加多头和<0/>减少空头的执行价格。>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/domain/synthetics/claims/useClaimFundsTransactionCallback.tsx msgid "Processing your claim…" @@ -8379,7 +8736,7 @@ msgstr "仪表板" msgid "Create TWAP {0} order" msgstr "创建 TWAP {0} 订单" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Address copied to your clipboard." msgstr "" @@ -8394,11 +8751,11 @@ msgstr "触发" #: src/components/Exchange/TradeHistory.jsx #: src/components/Exchange/TradeHistory.jsx msgid "Try increasing the \"Allowed Slippage\", under the settings menu on the top right." -msgstr "" +msgstr "<<<<<<< HEAD=======" #: src/components/Synthetics/DateRangeSelect/DateRangeSelect.tsx msgid "7d" -msgstr "7 天" +msgstr "7 天>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" #: src/pages/Ecosystem/ecosystemConstants.tsx msgid "Rage Trade" @@ -8416,10 +8773,6 @@ msgstr "" msgid "Claim GMX Rewards" msgstr "领取 GMX 奖励" -#: src/components/Referrals/JoinReferralCode.tsx -msgid "Enter Referral Code" -msgstr "输入推荐代码" - #: src/domain/synthetics/common/incentivesAirdropMessages.ts msgid "EIP-4844, 20-27 Mar" msgstr "EIP-4844, 3 月 20-27 日" @@ -8461,6 +8814,10 @@ msgstr "在 Explorer 中打开 {marketName}" msgid "Partial Liquidation" msgstr "部分清算" +#: src/components/Synthetics/GmxAccountModal/AvailableToTradeAssetsView.tsx +msgid "Gmx Account" +msgstr "" + #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/components/Synthetics/TVChart/ChartHeader.tsx #: src/pages/Dashboard/OverviewCard.tsx @@ -8498,6 +8855,10 @@ msgstr "启用存款已发送。" msgid "Collateral is not enough to cover pending fees. Please uncheck \"Keep Leverage\" to pay the fees with the realized PnL." msgstr "" +#: src/components/Synthetics/GmxAccountModal/MainView.tsx +msgid "No funding activity matching your search" +msgstr "" + #: src/components/Synthetics/StatusNotification/OrderStatusNotification.tsx msgid "Withdrawing {0} from {positionText}" msgstr "从 {positionText} 提取 {0}" @@ -8632,6 +8993,7 @@ msgstr "净率结合了资金费用和借款费用,但不包括开仓、交换 msgid "Accrued Price Impact Rebates" msgstr "已累积价格影响返利" +#: src/lib/dates.ts #: src/pages/AccountDashboard/GeneralPerformanceDetails.tsx msgid "Yesterday" msgstr "昨天" @@ -8665,6 +9027,8 @@ msgid "Anonymous chat with GMX" msgstr "与 GMX 匿名聊天" #: src/components/EmptyTableContent/EmptyTableContent.tsx +#: src/components/Referrals/JoinReferralCode.tsx +#: src/components/Synthetics/ClaimModal/ClaimModal.tsx #: src/components/Synthetics/PositionSeller/PositionSeller.tsx msgid "Loading" msgstr "" @@ -8683,16 +9047,21 @@ msgstr "限价" #: src/components/Synthetics/OrderItem/OrderItem.tsx msgid "You will receive at least {toAmountText} if this order is executed. This price is being updated in real time based on swap fees and price impact." -msgstr "如果此订单执行,您将至少收到 {toAmountText}。此价格基于交换费用和价格影响实时更新。" +msgstr "如果此订单执行,您将至少收到 {toAmountText}。此价格基于交换费用和价格影响实时更新。<<<<<<< HEAD" -#: src/components/Synthetics/ExecutionPriceRow.tsx -msgid "Acceptable price does not apply to stop loss orders, as they will be executed regardless of any price impact." -msgstr "可接受价格不适用于止损订单,因为无论任何价格影响,它们都会执行。" +#: src/domain/multichain/useMultichainFundingToast.tsx +msgid "Depositing and Withdrawing Funds to/from GMX" +msgstr "=======" #: src/components/InterviewModal/InterviewModal.tsx msgid "We'll then schedule a chat or interview with you. As a thank you, you'll receive <0>100 <1/> for providing your feedback." msgstr "然后我们将安排与您的聊天或访谈。作为感谢,您将收到 <0>100 <1/> 以提供您的反馈。" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Available:" +msgstr "" + #: src/components/Exchange/SwapBox.jsx msgid "There are more longs than shorts, borrow fees for shorting is currently zero." msgstr "" @@ -8768,6 +9137,10 @@ msgstr "{longOrShort} 仓位不支付资金费用,并支付 {borrowRate} 每 msgid "Increase active: {0}, executed: {1}, cancelled: {2}" msgstr "增加活跃度:{0}, 已执行:{1}, 已取消:{2}" +#: src/components/SwitchToSettlementChain/SwitchToSettlementChainWarning.tsx +msgid "Liquidity providing is only available on {chainNames} and {lastChainName}. Please switch to {chainNames} or {lastChainName} to access earning opportunities." +msgstr "" + #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx #: src/components/Synthetics/NetworkFeeRow/NetworkFeeRow.tsx msgid "Maximum network fee paid to the network. This fee is a blockchain cost not specific to GMX, and it does not impact your collateral." @@ -8785,18 +9158,27 @@ msgstr "{0} 需要作为抵押品。" msgid "Decentralized Options Protocol" msgstr "去中心化期权协议" +#: src/components/ExpressTradingOutOfGasBanner.ts/ExpressTradingOutOfGasBanner.tsx +#: src/components/Synthetics/TradeBox/ExpressTradingWarningCard.tsx +msgid "Insufficient gas balance, please deposit more ETH or USDC." +msgstr "" + #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Swap Part" msgstr "更新 TWAP 交换部分" #: src/components/Synthetics/TradeHistory/keys.ts msgid "Update TWAP Part" -msgstr "更新 TWAP 部分" +msgstr "" #: src/components/Synthetics/UserIncentiveDistributionList/AboutGlpIncident.tsx msgid "How does GLV earn yield, and where do I see my earnings?" msgstr "" +#: src/components/Referrals/AddAffiliateCode.tsx +msgid "Please switch to {0} to create your referral code. It will work across all other networks." +msgstr "" + #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx #: src/pages/CompleteAccountTransfer/CompleteAccountTransfer.jsx msgid "Complete Account Transfer" @@ -8806,9 +9188,9 @@ msgstr "完成账户转移" msgid "Claim Rewards" msgstr "领取奖励" -#: src/components/AddressDropdown/AddressDropdown.tsx +#: src/components/AddressDropdown/AddressDropdownWithoutMultichain.tsx msgid "Copy Address" -msgstr "复制地址" +msgstr "" #: src/pages/BeginAccountTransfer/BeginAccountTransfer.tsx msgid "Pending Transfer Approval" @@ -8856,10 +9238,19 @@ msgstr "支持组成" msgid "DeBank" msgstr "DeBank" +#: src/components/Synthetics/GmxAccountModal/DepositView.tsx +#: src/components/Synthetics/GmxAccountModal/WithdrawalView.tsx +msgid "Insufficient balance" +msgstr "" + #: src/components/OldSubaccountWithdraw/OldSubaccountWithdraw.tsx msgid "You have {balanceFormatted} remaining in your old version 1CT subaccount." msgstr "您的旧版 1CT 子账户中剩余 {balanceFormatted}。" #: src/pages/Stake/GmxAndVotingPowerCard.tsx msgid "Unstake GMX" -msgstr "取消质押 GMX" +msgstr "" + +#: src/components/Synthetics/TradeFeesRow/TradeFeesRow.tsx +msgid "Price impact rebates for closing trades are claimable under the claims tab. <0>Read more" +msgstr "取消质押 GMX>>>>>>> 1f735ef96b618467f7b393f560f9c21451108f11" diff --git a/src/pages/AccountDashboard/HistoricalLists.tsx b/src/pages/AccountDashboard/HistoricalLists.tsx index eb8a84fe6e..e673dc53be 100644 --- a/src/pages/AccountDashboard/HistoricalLists.tsx +++ b/src/pages/AccountDashboard/HistoricalLists.tsx @@ -21,6 +21,7 @@ import { AccountPositionsV1, usePositionsV1, } from "pages/Actions/ActionsV1/ActionsV1"; +import type { ContractsChainId } from "sdk/configs/chains"; import Badge, { BadgeIndicator } from "components/Badge/Badge"; import { ClaimsHistory } from "components/Synthetics/Claims/ClaimsHistory"; @@ -44,7 +45,7 @@ enum TabKeyV1 { } type Props = { - chainId: number; + chainId: ContractsChainId; account: Address; }; @@ -109,7 +110,7 @@ function useTabLabels(): Record { } function useTabLabelsV1( - chainId: number, + chainId: ContractsChainId, account: Address, signer: ethers.JsonRpcSigner | undefined, active: boolean diff --git a/src/pages/AccountDashboard/VersionNetworkSwitcherRow.tsx b/src/pages/AccountDashboard/VersionNetworkSwitcherRow.tsx index b50685e51d..aaf6feea1a 100644 --- a/src/pages/AccountDashboard/VersionNetworkSwitcherRow.tsx +++ b/src/pages/AccountDashboard/VersionNetworkSwitcherRow.tsx @@ -1,7 +1,7 @@ import cx from "classnames"; import { type Address } from "viem"; -import { CHAIN_NAMES_MAP, SUPPORTED_CHAIN_IDS } from "config/chains"; +import { CHAIN_NAMES_MAP, CONTRACTS_CHAIN_IDS } from "config/chains"; import { getIsV1Supported } from "config/features"; import { getIcon } from "config/icons"; @@ -24,7 +24,7 @@ export function VersionNetworkSwitcherRow({ function Options({ account, chainId, version }: { account?: Address; chainId: number; version: number }) { return (
- {SUPPORTED_CHAIN_IDS.map((supportedChainId) => { + {CONTRACTS_CHAIN_IDS.map((supportedChainId) => { const isActive = supportedChainId === chainId && version === 2; return (
@@ -91,102 +110,96 @@ export default function BuyGMX() {
- {isArbitrum ? ( -
-
-
- Buy or Transfer ETH to Arbitrum - {chainName} -
-
- Buy ETH directly on Arbitrum or transfer it there. -
+
+
+
+ + Buy or Transfer {nativeTokenSymbol} to {chainName} + + {chainName}
-
- ) : ( -
-
-
- Buy or Transfer AVAX to Avalanche - {chainName} -
-
- Buy AVAX directly to Avalanche or transfer it there. -
+
+ + Buy {nativeTokenSymbol} directly on {chainName} or transfer it there. +
- )} +
-
-
- {isArbitrum ? ( - - You can buy ETH directly on{" "} - Arbitrum using these options: - - ) : ( + {canBuyNativeToken ? ( +
+
- You can buy AVAX directly on{" "} - Avalanche using these options: + You can buy {nativeTokenSymbol} directly on{" "} + {chainName} using these options: - )} +
+
+ {BUY_NATIVE_TOKENS.filter((e) => chainId in e.links).map((exchange) => { + const icon = importImage(exchange.icon) || ""; + const link = exchange.links[chainId]; + return ( + + ); + })} +
-
- {BUY_NATIVE_TOKENS.filter((e) => chainId in e.links).map((exchange) => { - const icon = importImage(exchange.icon) || ""; - const link = exchange.links[chainId]; - return ( - - ); - })} + ) : ( +
+ + No options available to buy {nativeTokenSymbol} directly on {chainName}. +
-
+ )} -
- {isArbitrum ? ( -
- You can transfer ETH from other networks to Arbitrum using any of the below options: -
- ) : ( + {canTransferNativeToken ? ( +
- You can transfer AVAX from other networks to Avalanche using any of the below options: + You can transfer {nativeTokenSymbol} from other networks to {chainName} using any of the below + options:
- )} -
- {TRANSFER_EXCHANGES.filter((e) => chainId in e.links).map((exchange) => { - const icon = importImage(exchange.icon) || ""; - const link = exchange.links[chainId]; - return ( - - ); - })} +
+ {TRANSFER_EXCHANGES.filter((e) => chainId in e.links).map((exchange) => { + const icon = importImage(exchange.icon) || ""; + const link = exchange.links[chainId]; + return ( + + ); + })} +
-
+ ) : ( +
+ + No options available to transfer {nativeTokenSymbol} to {chainName}. + +
+ )}
@@ -195,8 +208,34 @@ export default function BuyGMX() { ); } -function DecentralisedExchanges({ chainId, externalLinks }) { +function DecentralisedExchanges({ + chainId, + externalLinks, +}: { + chainId: ContractsChainId; + externalLinks: { + networkWebsite: string; + buyGmx: { + uniswap?: string; + gmx?: string; + traderjoe?: string; + }; + }; +}) { const isArbitrum = chainId === ARBITRUM; + + const isEmpty = !Object.values(externalLinks.buyGmx).some((value) => value !== undefined); + + if (isEmpty) { + return ( + +
+ No decentralized exchanges available for this network. +
+
+ ); + } + return (
@@ -321,6 +360,18 @@ function DecentralisedExchanges({ chainId, externalLinks }) { } function CentralisedExchanges({ chainId }) { + const isEmpty = CENTRALISED_EXCHANGES.filter((e) => chainId in e.links).length === 0; + + if (isEmpty) { + return ( + +
+ No centralized exchanges available for this network. +
+
+ ); + } + return (
diff --git a/src/pages/BuyGMX/constants.ts b/src/pages/BuyGMX/constants.ts index 73f9e080a4..ea72b8809d 100644 --- a/src/pages/BuyGMX/constants.ts +++ b/src/pages/BuyGMX/constants.ts @@ -1,4 +1,4 @@ -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX } from "config/chains"; +import { ARBITRUM, ARBITRUM_SEPOLIA, AVALANCHE, AVALANCHE_FUJI, BOTANIX, ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; const ARBITRUM_GMX = getContract(ARBITRUM, "GMX").toLowerCase(); @@ -10,7 +10,17 @@ type Exchange = { links: { [key: number]: string }; }; -export const EXTERNAL_LINKS = { +export const EXTERNAL_LINKS: Record< + ContractsChainId, + { + networkWebsite: string; + buyGmx: { + uniswap?: string; + gmx?: string; + traderjoe?: string; + }; + } +> = { [ARBITRUM]: { networkWebsite: "https://arbitrum.io/", buyGmx: { @@ -30,6 +40,10 @@ export const EXTERNAL_LINKS = { traderjoe: `https://traderjoexyz.com/trade?outputCurrency=${AVALANCHE_GMX}`, }, }, + [ARBITRUM_SEPOLIA]: { + networkWebsite: "https://arbitrum.io/", + buyGmx: {}, + }, [BOTANIX]: { networkWebsite: "https://botanixlabs.com/", buyGmx: { @@ -119,6 +133,8 @@ export const TRANSFER_EXCHANGES: Exchange[] = [ icon: "ic_arbitrum_24.svg", links: { [ARBITRUM]: "https://bridge.arbitrum.io/", + [ARBITRUM_SEPOLIA]: + "https://bridge.arbitrum.io/?amount=0.1&sourceChain=sepolia&destinationChain=arbitrum-sepolia&tab=bridge", }, }, { diff --git a/src/pages/Dashboard/GlpCard.tsx b/src/pages/Dashboard/GlpCard.tsx index ef9f8c84fa..2eef7434b2 100644 --- a/src/pages/Dashboard/GlpCard.tsx +++ b/src/pages/Dashboard/GlpCard.tsx @@ -8,6 +8,7 @@ import { useInfoTokens } from "domain/tokens"; import { GLP_DECIMALS } from "lib/legacy"; import { formatAmount, formatAmountHuman } from "lib/numbers"; import useWallet from "lib/wallets/useWallet"; +import type { ContractsChainId } from "sdk/configs/chains"; import { TOKEN_COLOR_MAP, getWhitelistedV1Tokens } from "sdk/configs/tokens"; import { bigMath } from "sdk/utils/bigmath"; @@ -22,7 +23,7 @@ export function GlpCard({ glpMarketCap, adjustedUsdgSupply, }: { - chainId: number; + chainId: ContractsChainId; glpPrice: bigint; glpSupply: bigint | undefined; glpMarketCap: bigint | undefined; diff --git a/src/pages/Dashboard/GmCard.tsx b/src/pages/Dashboard/GmCard.tsx index 4250d642b5..ad44eab53d 100644 --- a/src/pages/Dashboard/GmCard.tsx +++ b/src/pages/Dashboard/GmCard.tsx @@ -10,7 +10,7 @@ import { useMarketTokensData, useMarketsInfoRequest, } from "domain/synthetics/markets"; -import { convertToUsd } from "domain/synthetics/tokens"; +import { convertToUsd, useTokensDataRequest } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; import { BN_ZERO, formatAmountHuman } from "lib/numbers"; import { EMPTY_OBJECT } from "lib/objects"; @@ -22,10 +22,11 @@ import Button from "components/Button/Button"; import InteractivePieChart from "components/InteractivePieChart/InteractivePieChart"; export function GmCard() { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const currentIcons = getIcons(chainId)!; - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: true, withGlv: false }); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: true, withGlv: false }); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const totalGMSupply = useMemo( () => diff --git a/src/pages/Dashboard/useDashboardChainStatsMulticall.ts b/src/pages/Dashboard/useDashboardChainStatsMulticall.ts index cc70ccb818..18c5e0abf8 100644 --- a/src/pages/Dashboard/useDashboardChainStatsMulticall.ts +++ b/src/pages/Dashboard/useDashboardChainStatsMulticall.ts @@ -4,12 +4,16 @@ import { getContract } from "config/contracts"; import { MulticallRequestConfig } from "lib/multicall/types"; import { useMulticall } from "lib/multicall/useMulticall"; import { FREQUENT_MULTICALL_REFRESH_INTERVAL } from "lib/timeConstants"; +import type { ContractsChainId } from "sdk/configs/chains"; import { getWhitelistedV1Tokens } from "sdk/configs/tokens"; -function buildDashboardRequest(chainId: number) { +function buildDashboardRequest(chainId: ContractsChainId) { const gmxAddress = getContract(chainId, "GMX"); const glpAddress = getContract(chainId, "GLP"); const usdgAddress = getContract(chainId, "USDG"); + const readerAddress = getContract(chainId, "Reader"); + const vaultAddress = getContract(chainId, "Vault"); + const glpManagerAddress = getContract(chainId, "GlpManager"); const tokensForSupplyQuery = [gmxAddress, glpAddress, usdgAddress]; @@ -17,37 +21,49 @@ function buildDashboardRequest(chainId: number) { return { glp: { - contractAddress: getContract(chainId, "GlpManager"), + contractAddress: glpManagerAddress, abiId: "GlpManager", calls: { - getAums: { - methodName: "getAums", - params: [], - }, + getAums: + glpManagerAddress === zeroAddress + ? undefined + : { + methodName: "getAums", + params: [], + }, }, }, reader: { - contractAddress: getContract(chainId, "Reader"), + contractAddress: readerAddress, abiId: "ReaderV2", calls: { - getTokenBalancesWithSupplies: { - methodName: "getTokenBalancesWithSupplies", - params: [zeroAddress, tokensForSupplyQuery], - }, - getFees: { - methodName: "getFees", - params: [getContract(chainId, "Vault"), whitelistedTokensAddresses], - }, + getTokenBalancesWithSupplies: + readerAddress === zeroAddress + ? undefined + : { + methodName: "getTokenBalancesWithSupplies", + params: [zeroAddress, tokensForSupplyQuery], + }, + getFees: + readerAddress === zeroAddress || vaultAddress === zeroAddress + ? undefined + : { + methodName: "getFees", + params: [vaultAddress, whitelistedTokensAddresses], + }, }, }, vault: { - contractAddress: getContract(chainId, "Vault"), + contractAddress: vaultAddress, abiId: "VaultV2", calls: { - totalTokenWeights: { - methodName: "totalTokenWeights", - params: [], - }, + totalTokenWeights: + vaultAddress === zeroAddress + ? undefined + : { + methodName: "totalTokenWeights", + params: [], + }, }, }, } satisfies MulticallRequestConfig; @@ -78,7 +94,7 @@ function parseDashboardResponse(result) { export type ChainStats = ReturnType; -export function useDashboardChainStatsMulticall(chainId: number) { +export function useDashboardChainStatsMulticall(chainId: ContractsChainId) { const { data } = useMulticall(chainId, `useDashboardChainStatsMulticall`, { key: [chainId], refreshInterval: FREQUENT_MULTICALL_REFRESH_INTERVAL, diff --git a/src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx b/src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx index 5e4f4b37d0..f97106b2eb 100644 --- a/src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx +++ b/src/pages/LeaderboardPage/components/LeaderboardAccountsTable.tsx @@ -11,9 +11,9 @@ import { } from "context/SyntheticsStateContext/hooks/leaderboardHooks"; import { CompetitionType, LeaderboardAccount, RemoteData } from "domain/synthetics/leaderboard"; import { MIN_COLLATERAL_USD_IN_LEADERBOARD } from "domain/synthetics/leaderboard/constants"; +import { useDebounce } from "lib/debounce/useDebounce"; import { useLocalStorageSerializeKey } from "lib/localStorage"; import { formatAmount, formatUsd } from "lib/numbers"; -import { useDebounce } from "lib/useDebounce"; import AddressView from "components/AddressView/AddressView"; import { BottomTablePagination } from "components/Pagination/BottomTablePagination"; diff --git a/src/pages/LeaderboardPage/components/LeaderboardPositionsTable.tsx b/src/pages/LeaderboardPage/components/LeaderboardPositionsTable.tsx index 4718675535..7ba20a38a2 100644 --- a/src/pages/LeaderboardPage/components/LeaderboardPositionsTable.tsx +++ b/src/pages/LeaderboardPage/components/LeaderboardPositionsTable.tsx @@ -16,9 +16,9 @@ import { LeaderboardPosition, RemoteData } from "domain/synthetics/leaderboard"; import { MIN_COLLATERAL_USD_IN_LEADERBOARD } from "domain/synthetics/leaderboard/constants"; import { getMarketIndexName, getMarketPoolName } from "domain/synthetics/markets"; import { getLiquidationPrice } from "domain/synthetics/positions"; +import { useDebounce } from "lib/debounce/useDebounce"; import { useLocalStorageSerializeKey } from "lib/localStorage"; import { formatAmount, formatUsd } from "lib/numbers"; -import { useDebounce } from "lib/useDebounce"; import AddressView from "components/AddressView/AddressView"; import { AmountWithUsdBalance } from "components/AmountWithUsd/AmountWithUsd"; @@ -242,6 +242,7 @@ const TableRow = memo( collateralUsd: position.collateralUsd, collateralAmount: position.collateralAmount, minCollateralUsd, + pendingImpactAmount: 0n, pendingBorrowingFeesUsd: position.unrealizedFees - position.closingFeeUsd, pendingFundingFeesUsd: 0n, isLong: position.isLong, diff --git a/src/pages/ParseTransaction/ParseTransaction.tsx b/src/pages/ParseTransaction/ParseTransaction.tsx index fededfa875..3645142299 100644 --- a/src/pages/ParseTransaction/ParseTransaction.tsx +++ b/src/pages/ParseTransaction/ParseTransaction.tsx @@ -1,26 +1,38 @@ import cx from "classnames"; +import invert from "lodash/invert"; +import mapValues from "lodash/mapValues"; import { useCallback, useMemo, useState } from "react"; import { Fragment } from "react/jsx-runtime"; import { BiCopy } from "react-icons/bi"; import { Link, useParams } from "react-router-dom"; import { useCopyToClipboard } from "react-use"; import useSWR from "swr"; -import { Hash, isHash, PublicClient } from "viem"; +import { Hash, PublicClient, isHash } from "viem"; import { usePublicClient } from "wagmi"; -import { ARBITRUM, AVALANCHE, AVALANCHE_FUJI, BOTANIX, UiContractsChain, getExplorerUrl } from "config/chains"; +import { + ARBITRUM, + ARBITRUM_SEPOLIA, + AVALANCHE, + AVALANCHE_FUJI, + BOTANIX, + ContractsChainId, + getExplorerUrl, +} from "config/chains"; import { getIcon } from "config/icons"; import { getGlvDisplayName, getMarketFullName, - useMarketsInfoRequest, useMarketTokensDataRequest, + useMarketsInfoRequest, } from "domain/synthetics/markets"; import { isGlvInfo } from "domain/synthetics/markets/glv"; import { useGlvMarketsInfo } from "domain/synthetics/markets/useGlvMarkets"; import { getOrderTypeLabel } from "domain/synthetics/orders"; import { useTokensDataRequest } from "domain/synthetics/tokens"; +import { CHAIN_ID_TO_TX_URL_BUILDER } from "lib/chains/blockExplorers"; import { formatFactor, formatUsd } from "lib/numbers"; +import { parseTxEvents } from "pages/ParseTransaction/parseTxEvents"; import AppPageLayout from "components/AppPageLayout/AppPageLayout"; import Loader from "components/Common/Loader"; @@ -51,29 +63,18 @@ import { formatRoleKey, formatSwapPath, } from "./formatting"; -import { parseTxEvents } from "./parseTxEvents"; import { LogEntryComponentProps } from "./types"; -const NETWORKS = { - arbitrum: ARBITRUM, - avalanche: AVALANCHE, - fuji: AVALANCHE_FUJI, - botanix: BOTANIX, -}; - -export const NETWORKS_BY_CHAIN_IDS: Record = { +export const NETWORKS_BY_CHAIN_IDS: Record = { [ARBITRUM]: "arbitrum", [AVALANCHE]: "avalanche", [AVALANCHE_FUJI]: "fuji", + // [BASE_MAINNET]: "base", + [ARBITRUM_SEPOLIA]: "arbitrum-sepolia", [BOTANIX]: "botanix", }; -const EXPLORER_TX_URLS: Record = { - [ARBITRUM]: getExplorerUrl(ARBITRUM) + "tx/", - [AVALANCHE]: getExplorerUrl(AVALANCHE) + "tx/", - [AVALANCHE_FUJI]: getExplorerUrl(AVALANCHE_FUJI) + "tx/", - [BOTANIX]: getExplorerUrl(BOTANIX) + "tx/", -}; +const NETWORKS = mapValues(invert(NETWORKS_BY_CHAIN_IDS), Number) as Record; export function ParseTransactionPage() { const { tx, network } = useParams<{ tx: string; network: string }>(); @@ -96,15 +97,15 @@ export function ParseTransactionPage() { const isDeposit = data ? data.some((event) => event.name.toLowerCase().includes("deposit")) : false; - const { tokensData } = useTokensDataRequest(chainId); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId, undefined); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const { glvData } = useGlvMarketsInfo(true, { marketsInfoData, tokensData, chainId, account: undefined, }); - const { marketTokensData } = useMarketTokensDataRequest(chainId, { + const { marketTokensData } = useMarketTokensDataRequest(chainId, undefined, { isDeposit, withGlv: true, glvData, @@ -140,7 +141,7 @@ export function ParseTransactionPage() {

- Transaction: {tx} + Transaction: {tx}

diff --git a/src/pages/ParseTransaction/formatting.tsx b/src/pages/ParseTransaction/formatting.tsx index 7ccd3c765c..e7c9f284dc 100644 --- a/src/pages/ParseTransaction/formatting.tsx +++ b/src/pages/ParseTransaction/formatting.tsx @@ -1,5 +1,6 @@ import { zeroAddress } from "viem"; +import { isGlvInfo } from "domain/synthetics/markets/glv"; import { Token } from "domain/tokens"; import { formatDateTime } from "lib/dates"; import { expandDecimals, formatBalanceAmount, formatUsdPrice } from "lib/numbers"; @@ -8,7 +9,6 @@ import { NATIVE_TOKENS_MAP } from "sdk/configs/tokens"; import { getMarketFullName } from "sdk/utils/markets"; import { LogEntryComponentProps } from "./types"; -import { isGlvInfo } from "../../domain/synthetics/markets/glv"; type Formatter = (t: bigint, props: LogEntryComponentProps) => string; type TokenGetter = (props: LogEntryComponentProps) => Token; diff --git a/src/pages/ParseTransaction/parseTxEvents.ts b/src/pages/ParseTransaction/parseTxEvents.ts index 049ab1bfff..e3bbfe2f94 100644 --- a/src/pages/ParseTransaction/parseTxEvents.ts +++ b/src/pages/ParseTransaction/parseTxEvents.ts @@ -2,10 +2,9 @@ import * as ethers from "ethers"; import { Abi, Hash, parseEventLogs, ParseEventLogsReturnType, PublicClient } from "viem"; import { expandDecimals } from "lib/numbers"; +import { LogEntry } from "pages/ParseTransaction/types"; import { abis } from "sdk/abis"; -import { LogEntry } from "./types"; - const PANIC_SIGNATURE4 = ethers.id("Panic(uint256)").slice(0, 10); const PANIC_MAP = { 0x00: "generic compiler inserted panics", diff --git a/src/pages/Pools/Pools.tsx b/src/pages/Pools/Pools.tsx index 40c37874d5..cf43bf334a 100644 --- a/src/pages/Pools/Pools.tsx +++ b/src/pages/Pools/Pools.tsx @@ -27,7 +27,7 @@ import { usePoolsIsMobilePage } from "./usePoolsIsMobilePage"; export default function Pools() { const { timeRange, setTimeRange } = usePoolsTimeRange(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const period = useMemo(() => convertPoolsTimeRangeToPeriod(timeRange), [timeRange]); @@ -39,10 +39,10 @@ export default function Pools() { glvTokensIncentiveAprData, marketsTokensLidoAprData, glvApyInfoData, - } = useGmMarketsApy(chainId, { period: apyPeriod }); + } = useGmMarketsApy(chainId, srcChainId, { period: apyPeriod }); - const { tokensData } = useTokensDataRequest(chainId); - const { marketsInfoData: onlyGmMarketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData: onlyGmMarketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const enabledGlv = isGlvEnabled(chainId); const account = useSelector(selectAccount); diff --git a/src/pages/PoolsDetails/PoolsDetailsHeader.tsx b/src/pages/PoolsDetails/PoolsDetailsHeader.tsx index 0f903b3dc8..31f06f01c4 100644 --- a/src/pages/PoolsDetails/PoolsDetailsHeader.tsx +++ b/src/pages/PoolsDetails/PoolsDetailsHeader.tsx @@ -31,7 +31,7 @@ type Props = { }; export function PoolsDetailsHeader({ glvOrMarketInfo, marketToken }: Props) { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const isGlv = glvOrMarketInfo && isGlvInfo(glvOrMarketInfo); const iconName = glvOrMarketInfo?.isSpotOnly ? getNormalizedTokenSymbol(glvOrMarketInfo.longToken.symbol) + @@ -47,7 +47,7 @@ export function PoolsDetailsHeader({ glvOrMarketInfo, marketToken }: Props) { const marketTotalSupply = marketToken?.totalSupply; const marketTotalSupplyUsd = convertToUsd(marketTotalSupply, marketToken?.decimals, marketPrice); - const userEarnings = useUserEarnings(chainId); + const userEarnings = useUserEarnings(chainId, srcChainId); const marketEarnings = getByKey(userEarnings?.byMarketAddress, marketToken?.address); const isMobile = usePoolsIsMobilePage(); diff --git a/src/pages/PriceImpactRebatesStats/hooks/usePriceImpactRebatesStats.ts b/src/pages/PriceImpactRebatesStats/hooks/usePriceImpactRebatesStats.ts index 898179182c..d5c252d5a2 100644 --- a/src/pages/PriceImpactRebatesStats/hooks/usePriceImpactRebatesStats.ts +++ b/src/pages/PriceImpactRebatesStats/hooks/usePriceImpactRebatesStats.ts @@ -4,7 +4,7 @@ import { useEffect, useState } from "react"; import { useLatest } from "react-use"; import { MarketInfo, useMarketsInfoRequest } from "domain/synthetics/markets"; -import { TokenData } from "domain/synthetics/tokens"; +import { TokenData, useTokensDataRequest } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; import { getByKey } from "lib/objects"; import { getSyntheticsGraphClient } from "lib/subgraph"; @@ -48,8 +48,9 @@ export const usePriceImpactRebateGroups = ( pageIndex: number, inclReviewed: boolean ): [hasMore: boolean, loadedPageIndex: number, data: RebateGroup[]] => { - const { chainId } = useChainId(); - const { marketsInfoData, tokensData } = useMarketsInfoRequest(chainId); + const { chainId, srcChainId } = useChainId(); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const marketsInfoDataLatest = useLatest(marketsInfoData); const tokensDataLatest = useLatest(tokensData); const [marketsReady, setMarketsReady] = useState(false); diff --git a/src/pages/Referrals/Referrals.tsx b/src/pages/Referrals/Referrals.tsx index 3efc4feca4..45d2976128 100644 --- a/src/pages/Referrals/Referrals.tsx +++ b/src/pages/Referrals/Referrals.tsx @@ -53,7 +53,7 @@ function Referrals() { } else { account = walletAccount; } - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const [activeTab, setActiveTab] = useLocalStorage(REFERRALS_SELECTED_TAB_KEY, TRADERS); const [recentlyAddedCodes, setRecentlyAddedCodes] = useLocalStorageSerializeKey( [chainId, "REFERRAL", account], @@ -74,7 +74,7 @@ function Referrals() { const { pendingTxns } = usePendingTxns(); const localizedTabOptionLabels = useLocalizedMap(TAB_OPTION_LABELS); - function handleCreateReferralCode(referralCode) { + function handleCreateReferralCode(referralCode: string) { return registerReferralCode(chainId, referralCode, signer, { sentMsg: t`Referral code submitted.`, failMsg: t`Referral code creation failed.`, @@ -99,6 +99,7 @@ function Referrals() { setRecentlyAddedCodes={setRecentlyAddedCodes} recentlyAddedCodes={recentlyAddedCodes} chainId={chainId} + srcChainId={srcChainId} /> ); } else { diff --git a/src/pages/Stake/AffiliateClaimModal.tsx b/src/pages/Stake/AffiliateClaimModal.tsx index e5478dd7de..e3eff18909 100644 --- a/src/pages/Stake/AffiliateClaimModal.tsx +++ b/src/pages/Stake/AffiliateClaimModal.tsx @@ -8,15 +8,18 @@ import { callContract } from "lib/contracts"; import { formatAmount } from "lib/numbers"; import { UncheckedJsonRpcSigner } from "lib/rpc/UncheckedJsonRpcSigner"; import { abis } from "sdk/abis"; +import type { ContractsChainId } from "sdk/configs/chains"; import Button from "components/Button/Button"; import Modal from "components/Modal/Modal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; export function AffiliateClaimModal(props: { isVisible: boolean; setIsVisible: (isVisible: boolean) => void; signer: UncheckedJsonRpcSigner | undefined; - chainId: number; + chainId: ContractsChainId; setPendingTxns: SetPendingTransactions; totalVesterRewards: bigint | undefined; }) { @@ -64,10 +67,13 @@ export function AffiliateClaimModal(props: {
+
- + + +
diff --git a/src/pages/Stake/AffiliateVesterWithdrawModal.tsx b/src/pages/Stake/AffiliateVesterWithdrawModal.tsx index e8f1057051..cae8d5e7bf 100644 --- a/src/pages/Stake/AffiliateVesterWithdrawModal.tsx +++ b/src/pages/Stake/AffiliateVesterWithdrawModal.tsx @@ -8,6 +8,8 @@ import { abis } from "sdk/abis"; import Button from "components/Button/Button"; import Modal from "components/Modal/Modal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; export function AffiliateVesterWithdrawModal(props) { const { isVisible, setIsVisible, chainId, signer, setPendingTxns } = props; @@ -51,10 +53,13 @@ export function AffiliateVesterWithdrawModal(props) {
+
- + + +
diff --git a/src/pages/Stake/ClaimModal.tsx b/src/pages/Stake/ClaimModal.tsx index cd7b2352e6..fc7ca366a0 100644 --- a/src/pages/Stake/ClaimModal.tsx +++ b/src/pages/Stake/ClaimModal.tsx @@ -3,7 +3,7 @@ import cx from "classnames"; import { ethers } from "ethers"; import React, { useCallback, useMemo, useState } from "react"; -import { ARBITRUM } from "config/chains"; +import { ARBITRUM, type ContractsChainId } from "config/chains"; import { getContract } from "config/contracts"; import { SetPendingTransactions } from "context/PendingTxnsContext/PendingTxnsContext"; import { useGovTokenAmount } from "domain/synthetics/governance/useGovTokenAmount"; @@ -23,6 +23,8 @@ import Button from "components/Button/Button"; import Checkbox from "components/Checkbox/Checkbox"; import ExternalLink from "components/ExternalLink/ExternalLink"; import ModalWithPortal from "components/Modal/ModalWithPortal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; import { GMX_DAO_LINKS } from "./constants"; @@ -31,7 +33,7 @@ export function ClaimModal(props: { setIsVisible: (isVisible: boolean) => void; rewardRouterAddress: string; signer: UncheckedJsonRpcSigner | undefined; - chainId: number; + chainId: ContractsChainId; setPendingTxns: SetPendingTransactions; totalGmxRewards: bigint | undefined; nativeTokenSymbol: string; @@ -270,10 +272,13 @@ export function ClaimModal(props: { ) : null} +
- + + +
); diff --git a/src/pages/Stake/EscrowedGmxCard.tsx b/src/pages/Stake/EscrowedGmxCard.tsx index 2f6c1a5720..a822a4335b 100644 --- a/src/pages/Stake/EscrowedGmxCard.tsx +++ b/src/pages/Stake/EscrowedGmxCard.tsx @@ -2,6 +2,7 @@ import { Trans } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { useMemo } from "react"; import useSWR from "swr"; +import { zeroAddress } from "viem"; import { ARBITRUM, getConstant } from "config/chains"; import { getContract } from "config/contracts"; @@ -47,7 +48,13 @@ export function EscrowedGmxCard({ const nativeTokenSymbol = getConstant(chainId, "nativeTokenSymbol"); const { data: esGmxSupply } = useSWR( - [`StakeV2:esGmxSupply:${active}`, chainId, readerAddress, "getTokenSupply", esGmxAddress], + readerAddress !== zeroAddress && [ + `StakeV2:esGmxSupply:${active}`, + chainId, + readerAddress, + "getTokenSupply", + esGmxAddress, + ], { fetcher: contractFetcher(signer, "ReaderV2", [excludedEsGmxAccounts]), } diff --git a/src/pages/Stake/Stake.tsx b/src/pages/Stake/Stake.tsx index 7e0eefdd2a..8ef2f1d4c6 100644 --- a/src/pages/Stake/Stake.tsx +++ b/src/pages/Stake/Stake.tsx @@ -39,7 +39,7 @@ import "./Stake.css"; function StakeContent() { const { active, signer, account } = useWallet(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const incentiveStats = useIncentiveStats(chainId); const { isLpInterviewModalVisible, setIsLpInterviewModalVisible } = useLpInterviewNotification(); @@ -92,10 +92,16 @@ function StakeContent() { const stakedGmxTrackerAddress = getContract(chainId, "StakedGmxTracker"); const feeGmxTrackerAddress = getContract(chainId, "FeeGmxTracker"); - const { marketTokensData } = useMarketTokensData(chainId, { isDeposit: false }); + const { marketTokensData } = useMarketTokensData(chainId, srcChainId, { isDeposit: false }); const { data: sbfGmxBalance } = useSWR( - [`StakeV2:sbfGmxBalance:${active}`, chainId, feeGmxTrackerAddress, "balanceOf", account ?? PLACEHOLDER_ACCOUNT], + feeGmxTrackerAddress !== zeroAddress && [ + `StakeV2:sbfGmxBalance:${active}`, + chainId, + feeGmxTrackerAddress, + "balanceOf", + account ?? PLACEHOLDER_ACCOUNT, + ], { fetcher: contractFetcher(undefined, "Token"), } diff --git a/src/pages/Stake/StakeModal.tsx b/src/pages/Stake/StakeModal.tsx index c9b01d82b5..bd5168c54f 100644 --- a/src/pages/Stake/StakeModal.tsx +++ b/src/pages/Stake/StakeModal.tsx @@ -3,7 +3,7 @@ import cx from "classnames"; import { ZeroAddress, ethers } from "ethers"; import { useCallback, useMemo, useState } from "react"; -import { ARBITRUM } from "config/chains"; +import { ARBITRUM, ContractsChainId } from "config/chains"; import { BASIS_POINTS_DIVISOR_BIGINT } from "config/factors"; import { getIcons } from "config/icons"; import { MAX_METAMASK_MOBILE_DECIMALS } from "config/ui"; @@ -27,13 +27,15 @@ import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import ExternalLink from "components/ExternalLink/ExternalLink"; import Modal from "components/Modal/Modal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; import { GMX_DAO_LINKS } from "./constants"; export function StakeModal(props: { isVisible: boolean; setIsVisible: (isVisible: boolean) => void; - chainId: number; + chainId: ContractsChainId; title: string; maxAmount: bigint | undefined; value: string; @@ -239,10 +241,13 @@ export function StakeModal(props: { ) : null} +
- + + +
diff --git a/src/pages/Stake/TotalRewardsCard.tsx b/src/pages/Stake/TotalRewardsCard.tsx index a7f3231edf..7c4eb44735 100644 --- a/src/pages/Stake/TotalRewardsCard.tsx +++ b/src/pages/Stake/TotalRewardsCard.tsx @@ -4,6 +4,7 @@ import { useCallback, useMemo, useState } from "react"; import { Link } from "react-router-dom"; import { toast } from "react-toastify"; import useSWR from "swr"; +import { zeroAddress } from "viem"; import { ARBITRUM, getConstant } from "config/chains"; import { getContract } from "config/contracts"; @@ -32,7 +33,7 @@ export function TotalRewardsCard({ showStakeGmxModal: () => void; }) { const { active, account, signer } = useWallet(); - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); const { openConnectModal } = useConnectModal(); const { setPendingTxns } = usePendingTxns(); @@ -54,7 +55,7 @@ export function TotalRewardsCard({ (processedData?.totalNativeTokenRewardsUsd ?? 0n) > 10n ** BigInt(USD_DECIMALS) / 100n; const { mutate: refetchBalances } = useSWR( - [ + readerAddress !== zeroAddress && [ `StakeV2:walletBalances:${active}`, chainId, readerAddress, @@ -83,7 +84,7 @@ export function TotalRewardsCard({ // glvTokensIncentiveAprData, // marketsTokensLidoAprData, // glvApyInfoData, - } = useGmMarketsApy(chainId, { period: "90d" }); + } = useGmMarketsApy(chainId, srcChainId, { period: "90d" }); const gmxMarketApyDataText = useMemo(() => { if (!gmxMarketAddress || chainId !== ARBITRUM) return; diff --git a/src/pages/Stake/UnstakeModal.tsx b/src/pages/Stake/UnstakeModal.tsx index 909d65ec67..31dcb4a4e1 100644 --- a/src/pages/Stake/UnstakeModal.tsx +++ b/src/pages/Stake/UnstakeModal.tsx @@ -17,6 +17,8 @@ import { AlertInfo } from "components/AlertInfo/AlertInfo"; import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import Modal from "components/Modal/Modal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; export function UnstakeModal(props: { isVisible: boolean; @@ -164,10 +166,13 @@ export function UnstakeModal(props: { )} +
- + + +
diff --git a/src/pages/Stake/VesterDepositModal.tsx b/src/pages/Stake/VesterDepositModal.tsx index 0f276fc262..d0f2fed60d 100644 --- a/src/pages/Stake/VesterDepositModal.tsx +++ b/src/pages/Stake/VesterDepositModal.tsx @@ -14,6 +14,8 @@ import Button from "components/Button/Button"; import BuyInputSection from "components/BuyInputSection/BuyInputSection"; import Modal from "components/Modal/Modal"; import StatsTooltipRow from "components/StatsTooltip/StatsTooltipRow"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; import { SyntheticsInfoRow } from "components/Synthetics/SyntheticsInfoRow"; import TooltipWithPortal from "components/Tooltip/TooltipWithPortal"; @@ -230,10 +232,13 @@ export function VesterDepositModal(props: { /> )} +
- + + +
diff --git a/src/pages/Stake/VesterWithdrawModal.tsx b/src/pages/Stake/VesterWithdrawModal.tsx index 06b95f9a16..adb11bcac6 100644 --- a/src/pages/Stake/VesterWithdrawModal.tsx +++ b/src/pages/Stake/VesterWithdrawModal.tsx @@ -9,6 +9,8 @@ import { abis } from "sdk/abis"; import Button from "components/Button/Button"; import Modal from "components/Modal/Modal"; +import { SwitchToSettlementChainButtons } from "components/SwitchToSettlementChain/SwitchToSettlementChainButtons"; +import { SwitchToSettlementChainWarning } from "components/SwitchToSettlementChain/SwitchToSettlementChainWarning"; export function VesterWithdrawModal(props: { isVisible: boolean; @@ -56,10 +58,13 @@ export function VesterWithdrawModal(props: {
+
- + + +
diff --git a/src/pages/Stake/Vesting.tsx b/src/pages/Stake/Vesting.tsx index 7d2f07b382..d6f9841e7d 100644 --- a/src/pages/Stake/Vesting.tsx +++ b/src/pages/Stake/Vesting.tsx @@ -2,6 +2,7 @@ import { Trans, t } from "@lingui/macro"; import { useConnectModal } from "@rainbow-me/rainbowkit"; import { useState } from "react"; import useSWR from "swr"; +import { zeroAddress } from "viem"; import { getContract } from "config/contracts"; import { getIcons } from "config/icons"; @@ -60,7 +61,13 @@ export function Vesting({ processedData }: { processedData: ProcessedData | unde const affiliateVesterAddress = getContract(chainId, "AffiliateVester"); const { data: sbfGmxBalance } = useSWR( - [`StakeV2:sbfGmxBalance:${active}`, chainId, feeGmxTrackerAddress, "balanceOf", account ?? PLACEHOLDER_ACCOUNT], + feeGmxTrackerAddress !== zeroAddress && [ + `StakeV2:sbfGmxBalance:${active}`, + chainId, + feeGmxTrackerAddress, + "balanceOf", + account ?? PLACEHOLDER_ACCOUNT, + ], { fetcher: contractFetcher(undefined, "Token"), } diff --git a/src/pages/Stake/useProcessedData.ts b/src/pages/Stake/useProcessedData.ts index 77a1dd7a50..dea306b564 100644 --- a/src/pages/Stake/useProcessedData.ts +++ b/src/pages/Stake/useProcessedData.ts @@ -1,5 +1,6 @@ import { useMemo } from "react"; import useSWR from "swr"; +import { zeroAddress } from "viem"; import { getServerUrl } from "config/backend"; import { ARBITRUM } from "config/chains"; @@ -73,14 +74,20 @@ export function useProcessedData() { const { gmxPrice } = useGmxPrice(chainId, { arbitrum: chainId === ARBITRUM ? signer : undefined }, active); const { data: stakedGmxSupply } = useSWR( - [`StakeV2:stakedGmxSupply:${active}`, chainId, gmxAddress, "balanceOf", stakedGmxTrackerAddress], + gmxAddress !== zeroAddress && [ + `StakeV2:stakedGmxSupply:${active}`, + chainId, + gmxAddress, + "balanceOf", + stakedGmxTrackerAddress, + ], { fetcher: contractFetcher(signer, "Token"), } ); const { data: aum } = useSWR( - [`processedData:getAums:${active}`, chainId, glpManagerAddress, "getAums"], + glpManagerAddress !== zeroAddress && [`processedData:getAums:${active}`, chainId, glpManagerAddress, "getAums"], { fetcher: async (key: any[]) => { const aums = await contractFetcher(signer, "GlpManager")(key); @@ -95,7 +102,13 @@ export function useProcessedData() { ); const { data: nativeTokenPrice } = useSWR( - [`StakeV2:nativeTokenPrice:${active}`, chainId, vaultAddress, "getMinPrice", nativeTokenAddress], + vaultAddress !== zeroAddress && [ + `StakeV2:nativeTokenPrice:${active}`, + chainId, + vaultAddress, + "getMinPrice", + nativeTokenAddress, + ], { fetcher: contractFetcher(signer, "Vault"), } @@ -106,7 +119,7 @@ export function useProcessedData() { }); const balanceAndSupplyQuery = useSWR>( - [ + readerAddress !== zeroAddress && [ `processedData:walletBalances:${active}`, chainId, readerAddress, @@ -124,7 +137,7 @@ export function useProcessedData() { const { balanceData, supplyData } = balanceAndSupplyQuery.data ?? {}; const { data: depositBalanceData } = useSWR>( - [ + rewardReaderAddress !== zeroAddress && [ `processedData:depositBalances:${active}`, chainId, rewardReaderAddress, @@ -143,7 +156,7 @@ export function useProcessedData() { ); const { data: stakingData } = useSWR>( - [ + rewardReaderAddress !== zeroAddress && [ `processedData:stakingInfo:${active}`, chainId, rewardReaderAddress, diff --git a/src/pages/SyntheticsPage/SyntheticsPage.tsx b/src/pages/SyntheticsPage/SyntheticsPage.tsx index d202e15f7e..8686e974e1 100644 --- a/src/pages/SyntheticsPage/SyntheticsPage.tsx +++ b/src/pages/SyntheticsPage/SyntheticsPage.tsx @@ -17,6 +17,8 @@ import { selectChainId, selectOrdersInfoData, selectPositionsInfoData, + selectSrcChainId, + selectSubaccountForChainAction, } from "context/SyntheticsStateContext/selectors/globalSelectors"; import { selectOrdersCount } from "context/SyntheticsStateContext/selectors/orderSelectors"; import { @@ -25,8 +27,7 @@ import { selectTradeboxState, selectTradeboxTradeFlags, } from "context/SyntheticsStateContext/selectors/tradeboxSelectors"; -import { useCalcSelector } from "context/SyntheticsStateContext/SyntheticsStateContextProvider"; -import { useSelector } from "context/SyntheticsStateContext/utils"; +import { useCalcSelector, useSelector } from "context/SyntheticsStateContext/utils"; import { estimateBatchExpressParams } from "domain/synthetics/express/expressOrderUtils"; import { useExternalSwapHandler } from "domain/synthetics/externalSwaps/useExternalSwapHandler"; import { OrderTypeFilterValue } from "domain/synthetics/orders/ordersFilters"; @@ -46,8 +47,10 @@ import { useLocalStorageSerializeKey } from "lib/localStorage"; import { useMeasureComponentMountTime } from "lib/metrics/useMeasureComponentMountTime"; import { formatUsdPrice } from "lib/numbers"; import { EMPTY_ARRAY, getByKey } from "lib/objects"; +import { useJsonRpcProvider } from "lib/rpc"; import { useEthersSigner } from "lib/wallets/useEthersSigner"; import useWallet from "lib/wallets/useWallet"; +import { ContractsChainId } from "sdk/configs/chains"; import { getTokenVisualMultiplier } from "sdk/configs/tokens"; import { getOrderKeys } from "sdk/utils/orders"; @@ -453,8 +456,10 @@ export function SyntheticsPage(p: Props) { } function useOrdersControl() { - const chainId = useSelector(selectChainId); + const chainId = useSelector(selectChainId) as ContractsChainId; + const srcChainId = useSelector(selectSrcChainId); const signer = useEthersSigner(); + const { provider } = useJsonRpcProvider(chainId); const [cancellingOrdersKeys, setCanellingOrdersKeys] = useCancellingOrdersKeysState(); const [selectedOrderKeys, setSelectedOrderKeys] = useState(EMPTY_ARRAY); @@ -466,10 +471,11 @@ function useOrdersControl() { const [orderTypesFilter, setOrderTypesFilter] = useState([]); const ordersInfoData = useSelector(selectOrdersInfoData); const globalExpressParams = useSelector(selectExpressGlobalParams); + const subaccount = useSelector(selectSubaccountForChainAction); const onCancelSelectedOrders = useCallback( async function cancelSelectedOrders() { - if (!signer) return; + if (!signer || !provider) return; const orders = selectedOrderKeys.map((key) => getByKey(ordersInfoData, key)).filter(defined) as OrderInfo[]; const orderKeys = orders.flatMap(getOrderKeys); setCanellingOrdersKeys((p) => uniq(p.concat(orderKeys))); @@ -487,7 +493,9 @@ function useOrdersControl() { globalExpressParams, requireValidations: true, estimationMethod: "approximate", - provider: undefined, + provider, + isGmxAccount: srcChainId !== undefined, + subaccount, }); sendBatchOrderTxn({ @@ -496,8 +504,9 @@ function useOrdersControl() { expressParams, batchParams, simulationParams: undefined, - noncesData: globalExpressParams?.noncesData, + provider, callback: makeOrderTxnCallback({}), + isGmxAccount: srcChainId !== undefined, }) .then(async (tx) => { const txnResult = await tx.wait(); @@ -514,15 +523,18 @@ function useOrdersControl() { globalExpressParams, makeOrderTxnCallback, ordersInfoData, + provider, selectedOrderKeys, setCanellingOrdersKeys, signer, + srcChainId, + subaccount, ] ); const onCancelOrder = useCallback( async function cancelOrder(key: string) { - if (!signer) return; + if (!signer || !provider) return; const order = getByKey(ordersInfoData, key); if (!order) return; @@ -543,23 +555,36 @@ function useOrdersControl() { globalExpressParams, requireValidations: true, estimationMethod: "approximate", - provider: undefined, + provider, + isGmxAccount: srcChainId !== undefined, + subaccount, }); sendBatchOrderTxn({ chainId, signer, + provider, expressParams, batchParams, simulationParams: undefined, - noncesData: globalExpressParams?.noncesData, callback: makeOrderTxnCallback({}), + isGmxAccount: srcChainId !== undefined, }).finally(() => { setCanellingOrdersKeys((prev) => prev.filter((k) => k !== key)); setSelectedOrderKeys((prev) => prev.filter((k) => k !== key)); }); }, - [chainId, globalExpressParams, makeOrderTxnCallback, ordersInfoData, setCanellingOrdersKeys, signer] + [ + chainId, + globalExpressParams, + makeOrderTxnCallback, + ordersInfoData, + provider, + setCanellingOrdersKeys, + signer, + srcChainId, + subaccount, + ] ); return { diff --git a/src/pages/SyntheticsStats/SyntheticsStats.tsx b/src/pages/SyntheticsStats/SyntheticsStats.tsx index e308c3ecb3..da70ddf369 100644 --- a/src/pages/SyntheticsStats/SyntheticsStats.tsx +++ b/src/pages/SyntheticsStats/SyntheticsStats.tsx @@ -23,7 +23,7 @@ import { } from "domain/synthetics/markets"; import { useKinkModelMarketsRates } from "domain/synthetics/markets/useKinkModelMarketsRates"; import { usePositionsConstantsRequest } from "domain/synthetics/positions"; -import { convertToUsd, getMidPrice } from "domain/synthetics/tokens"; +import { convertToUsd, getMidPrice, useTokensDataRequest } from "domain/synthetics/tokens"; import { useChainId } from "lib/chains"; import { CHART_PERIODS } from "lib/legacy"; import { expandDecimals, formatAmount, formatFactor, formatUsd, getPlusOrMinusSymbol, PRECISION } from "lib/numbers"; @@ -56,13 +56,14 @@ const CSV_EXCLUDED_FIELDS: (keyof MarketInfo)[] = [ ]; export function SyntheticsStats() { - const { chainId } = useChainId(); + const { chainId, srcChainId } = useChainId(); - const { marketsInfoData } = useMarketsInfoRequest(chainId); + const { tokensData } = useTokensDataRequest(chainId, srcChainId); + const { marketsInfoData } = useMarketsInfoRequest(chainId, { tokensData }); const { kinkMarketsBorrowingRatesData } = useKinkModelMarketsRates(chainId); - const { - positionsConstants: { minCollateralUsd, minPositionSizeUsd }, - } = usePositionsConstantsRequest(chainId); + const { positionsConstants } = usePositionsConstantsRequest(chainId); + const { minCollateralUsd, minPositionSizeUsd, claimableCollateralDelay, claimableCollateralReductionFactor } = + positionsConstants || {}; const markets = Object.values(marketsInfoData || {}); markets.sort((a, b) => { @@ -767,7 +768,7 @@ export function SyntheticsStats() { } function renderPositionImpactCell() { - const summaryPoolUsd = (longPoolUsd ?? 0n) + (shortPoolUsd ?? 0n); + const summaryPoolUsd = market.poolValueMax; const bonusApr = summaryPoolUsd > 0n @@ -778,7 +779,7 @@ export function SyntheticsStats() { ) * 100n : undefined; - const reservedPositivePriceImpactUsd = getPriceImpactUsd({ + const { priceImpactDeltaUsd: reservedPositivePriceImpactUsd } = getPriceImpactUsd({ currentLongUsd: market.longInterestUsd - market.shortInterestUsd, currentShortUsd: 0n, nextLongUsd: 0n, @@ -1054,6 +1055,26 @@ export function SyntheticsStats() { value={formatFactor(market.maxPositionImpactFactorForLiquidations)} showDollar={false} /> + + + +

@@ -1079,24 +1100,25 @@ export function SyntheticsStats() {
Fees factors

+ +
+ + )} /> diff --git a/src/typechain-types-stargate/IStargate.ts b/src/typechain-types-stargate/IStargate.ts new file mode 100644 index 0000000000..d363cff29e --- /dev/null +++ b/src/typechain-types-stargate/IStargate.ts @@ -0,0 +1,344 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type SendParamStruct = { + dstEid: BigNumberish; + to: BytesLike; + amountLD: BigNumberish; + minAmountLD: BigNumberish; + extraOptions: BytesLike; + composeMsg: BytesLike; + oftCmd: BytesLike; +}; + +export type SendParamStructOutput = [ + dstEid: bigint, + to: string, + amountLD: bigint, + minAmountLD: bigint, + extraOptions: string, + composeMsg: string, + oftCmd: string, +] & { + dstEid: bigint; + to: string; + amountLD: bigint; + minAmountLD: bigint; + extraOptions: string; + composeMsg: string; + oftCmd: string; +}; + +export type OFTLimitStruct = { + minAmountLD: BigNumberish; + maxAmountLD: BigNumberish; +}; + +export type OFTLimitStructOutput = [minAmountLD: bigint, maxAmountLD: bigint] & { + minAmountLD: bigint; + maxAmountLD: bigint; +}; + +export type OFTFeeDetailStruct = { + feeAmountLD: BigNumberish; + description: string; +}; + +export type OFTFeeDetailStructOutput = [feeAmountLD: bigint, description: string] & { + feeAmountLD: bigint; + description: string; +}; + +export type OFTReceiptStruct = { + amountSentLD: BigNumberish; + amountReceivedLD: BigNumberish; +}; + +export type OFTReceiptStructOutput = [amountSentLD: bigint, amountReceivedLD: bigint] & { + amountSentLD: bigint; + amountReceivedLD: bigint; +}; + +export type MessagingFeeStruct = { + nativeFee: BigNumberish; + lzTokenFee: BigNumberish; +}; + +export type MessagingFeeStructOutput = [nativeFee: bigint, lzTokenFee: bigint] & { + nativeFee: bigint; + lzTokenFee: bigint; +}; + +export type MessagingReceiptStruct = { + guid: BytesLike; + nonce: BigNumberish; + fee: MessagingFeeStruct; +}; + +export type MessagingReceiptStructOutput = [guid: string, nonce: bigint, fee: MessagingFeeStructOutput] & { + guid: string; + nonce: bigint; + fee: MessagingFeeStructOutput; +}; + +export type TicketStruct = { + ticketId: BigNumberish; + passengerBytes: BytesLike; +}; + +export type TicketStructOutput = [ticketId: bigint, passengerBytes: string] & { + ticketId: bigint; + passengerBytes: string; +}; + +export interface IStargateInterface extends Interface { + getFunction( + nameOrSignature: + | "approvalRequired" + | "oftVersion" + | "quoteOFT" + | "quoteSend" + | "send" + | "sendToken" + | "sharedDecimals" + | "stargateType" + | "token" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "OFTReceived" | "OFTSent"): EventFragment; + + encodeFunctionData(functionFragment: "approvalRequired", values?: undefined): string; + encodeFunctionData(functionFragment: "oftVersion", values?: undefined): string; + encodeFunctionData(functionFragment: "quoteOFT", values: [SendParamStruct]): string; + encodeFunctionData(functionFragment: "quoteSend", values: [SendParamStruct, boolean]): string; + encodeFunctionData(functionFragment: "send", values: [SendParamStruct, MessagingFeeStruct, AddressLike]): string; + encodeFunctionData(functionFragment: "sendToken", values: [SendParamStruct, MessagingFeeStruct, AddressLike]): string; + encodeFunctionData(functionFragment: "sharedDecimals", values?: undefined): string; + encodeFunctionData(functionFragment: "stargateType", values?: undefined): string; + encodeFunctionData(functionFragment: "token", values?: undefined): string; + + decodeFunctionResult(functionFragment: "approvalRequired", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oftVersion", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "quoteOFT", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "quoteSend", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "send", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sharedDecimals", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "stargateType", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "token", data: BytesLike): Result; +} + +export namespace OFTReceivedEvent { + export type InputTuple = [ + guid: BytesLike, + srcEid: BigNumberish, + toAddress: AddressLike, + amountReceivedLD: BigNumberish, + ]; + export type OutputTuple = [guid: string, srcEid: bigint, toAddress: string, amountReceivedLD: bigint]; + export interface OutputObject { + guid: string; + srcEid: bigint; + toAddress: string; + amountReceivedLD: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace OFTSentEvent { + export type InputTuple = [ + guid: BytesLike, + dstEid: BigNumberish, + fromAddress: AddressLike, + amountSentLD: BigNumberish, + amountReceivedLD: BigNumberish, + ]; + export type OutputTuple = [ + guid: string, + dstEid: bigint, + fromAddress: string, + amountSentLD: bigint, + amountReceivedLD: bigint, + ]; + export interface OutputObject { + guid: string; + dstEid: bigint; + fromAddress: string; + amountSentLD: bigint; + amountReceivedLD: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface IStargate extends BaseContract { + connect(runner?: ContractRunner | null): IStargate; + waitForDeployment(): Promise; + + interface: IStargateInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + approvalRequired: TypedContractMethod<[], [boolean], "view">; + + oftVersion: TypedContractMethod<[], [[string, bigint] & { interfaceId: string; version: bigint }], "view">; + + quoteOFT: TypedContractMethod< + [_sendParam: SendParamStruct], + [ + [OFTLimitStructOutput, OFTFeeDetailStructOutput[], OFTReceiptStructOutput] & { + oftFeeDetails: OFTFeeDetailStructOutput[]; + }, + ], + "view" + >; + + quoteSend: TypedContractMethod< + [_sendParam: SendParamStruct, _payInLzToken: boolean], + [MessagingFeeStructOutput], + "view" + >; + + send: TypedContractMethod< + [_sendParam: SendParamStruct, _fee: MessagingFeeStruct, _refundAddress: AddressLike], + [[MessagingReceiptStructOutput, OFTReceiptStructOutput]], + "payable" + >; + + sendToken: TypedContractMethod< + [_sendParam: SendParamStruct, _fee: MessagingFeeStruct, _refundAddress: AddressLike], + [ + [MessagingReceiptStructOutput, OFTReceiptStructOutput, TicketStructOutput] & { + msgReceipt: MessagingReceiptStructOutput; + oftReceipt: OFTReceiptStructOutput; + ticket: TicketStructOutput; + }, + ], + "payable" + >; + + sharedDecimals: TypedContractMethod<[], [bigint], "view">; + + stargateType: TypedContractMethod<[], [bigint], "view">; + + token: TypedContractMethod<[], [string], "view">; + + getFunction(key: string | FunctionFragment): T; + + getFunction(nameOrSignature: "approvalRequired"): TypedContractMethod<[], [boolean], "view">; + getFunction( + nameOrSignature: "oftVersion" + ): TypedContractMethod<[], [[string, bigint] & { interfaceId: string; version: bigint }], "view">; + getFunction(nameOrSignature: "quoteOFT"): TypedContractMethod< + [_sendParam: SendParamStruct], + [ + [OFTLimitStructOutput, OFTFeeDetailStructOutput[], OFTReceiptStructOutput] & { + oftFeeDetails: OFTFeeDetailStructOutput[]; + }, + ], + "view" + >; + getFunction( + nameOrSignature: "quoteSend" + ): TypedContractMethod<[_sendParam: SendParamStruct, _payInLzToken: boolean], [MessagingFeeStructOutput], "view">; + getFunction( + nameOrSignature: "send" + ): TypedContractMethod< + [_sendParam: SendParamStruct, _fee: MessagingFeeStruct, _refundAddress: AddressLike], + [[MessagingReceiptStructOutput, OFTReceiptStructOutput]], + "payable" + >; + getFunction(nameOrSignature: "sendToken"): TypedContractMethod< + [_sendParam: SendParamStruct, _fee: MessagingFeeStruct, _refundAddress: AddressLike], + [ + [MessagingReceiptStructOutput, OFTReceiptStructOutput, TicketStructOutput] & { + msgReceipt: MessagingReceiptStructOutput; + oftReceipt: OFTReceiptStructOutput; + ticket: TicketStructOutput; + }, + ], + "payable" + >; + getFunction(nameOrSignature: "sharedDecimals"): TypedContractMethod<[], [bigint], "view">; + getFunction(nameOrSignature: "stargateType"): TypedContractMethod<[], [bigint], "view">; + getFunction(nameOrSignature: "token"): TypedContractMethod<[], [string], "view">; + + getEvent( + key: "OFTReceived" + ): TypedContractEvent; + getEvent( + key: "OFTSent" + ): TypedContractEvent; + + filters: { + "OFTReceived(bytes32,uint32,address,uint256)": TypedContractEvent< + OFTReceivedEvent.InputTuple, + OFTReceivedEvent.OutputTuple, + OFTReceivedEvent.OutputObject + >; + OFTReceived: TypedContractEvent< + OFTReceivedEvent.InputTuple, + OFTReceivedEvent.OutputTuple, + OFTReceivedEvent.OutputObject + >; + + "OFTSent(bytes32,uint32,address,uint256,uint256)": TypedContractEvent< + OFTSentEvent.InputTuple, + OFTSentEvent.OutputTuple, + OFTSentEvent.OutputObject + >; + OFTSent: TypedContractEvent; + }; +} diff --git a/src/typechain-types-stargate/common.ts b/src/typechain-types-stargate/common.ts new file mode 100644 index 0000000000..e951924406 --- /dev/null +++ b/src/typechain-types-stargate/common.ts @@ -0,0 +1,92 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + FunctionFragment, + Typed, + EventFragment, + ContractTransaction, + ContractTransactionResponse, + DeferredTopicFilter, + EventLog, + TransactionRequest, + LogDescription, +} from "ethers"; + +export interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> extends DeferredTopicFilter {} + +export interface TypedContractEvent< + InputTuple extends Array = any, + OutputTuple extends Array = any, + OutputObject = any, +> { + (...args: Partial): TypedDeferredTopicFilter>; + name: string; + fragment: EventFragment; + getFragment(...args: Partial): EventFragment; +} + +type __TypechainAOutputTuple = T extends TypedContractEvent ? W : never; +type __TypechainOutputObject = T extends TypedContractEvent ? V : never; + +export interface TypedEventLog extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export interface TypedLogDescription extends Omit { + args: __TypechainAOutputTuple & __TypechainOutputObject; +} + +export type TypedListener = ( + ...listenerArg: [...__TypechainAOutputTuple, TypedEventLog, ...undefined[]] +) => void; + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; + +export type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; +export type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; + +export type StateMutability = "nonpayable" | "payable" | "view"; + +export type BaseOverrides = Omit; +export type NonPayableOverrides = Omit; +export type PayableOverrides = Omit; +export type ViewOverrides = Omit; +export type Overrides = S extends "nonpayable" + ? NonPayableOverrides + : S extends "payable" + ? PayableOverrides + : ViewOverrides; + +export type PostfixOverrides, S extends StateMutability> = A | [...A, Overrides]; +export type ContractMethodArgs, S extends StateMutability> = PostfixOverrides< + { [I in keyof A]-?: A[I] | Typed }, + S +>; + +export type DefaultReturnType = R extends Array ? R[0] : R; + +// export interface ContractMethod = Array, R = any, D extends R | ContractTransactionResponse = R | ContractTransactionResponse> { +export interface TypedContractMethod< + A extends Array = Array, + R = any, + S extends StateMutability = "payable", +> { + ( + ...args: ContractMethodArgs + ): S extends "view" ? Promise> : Promise; + + name: string; + + fragment: FunctionFragment; + + getFragment(...args: ContractMethodArgs): FunctionFragment; + + populateTransaction(...args: ContractMethodArgs): Promise; + staticCall(...args: ContractMethodArgs): Promise>; + send(...args: ContractMethodArgs): Promise; + estimateGas(...args: ContractMethodArgs): Promise; + staticCallResult(...args: ContractMethodArgs): Promise; +} diff --git a/src/typechain-types-stargate/factories/IStargate__factory.ts b/src/typechain-types-stargate/factories/IStargate__factory.ts new file mode 100644 index 0000000000..9d2ed2155c --- /dev/null +++ b/src/typechain-types-stargate/factories/IStargate__factory.ts @@ -0,0 +1,618 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { IStargate, IStargateInterface } from "../IStargate"; + +const _abi = [ + { + inputs: [], + name: "InvalidLocalDecimals", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + ], + name: "SlippageExceeded", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "guid", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint32", + name: "srcEid", + type: "uint32", + }, + { + indexed: true, + internalType: "address", + name: "toAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceivedLD", + type: "uint256", + }, + ], + name: "OFTReceived", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "guid", + type: "bytes32", + }, + { + indexed: false, + internalType: "uint32", + name: "dstEid", + type: "uint32", + }, + { + indexed: true, + internalType: "address", + name: "fromAddress", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amountSentLD", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amountReceivedLD", + type: "uint256", + }, + ], + name: "OFTSent", + type: "event", + }, + { + inputs: [], + name: "approvalRequired", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oftVersion", + outputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4", + }, + { + internalType: "uint64", + name: "version", + type: "uint64", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint32", + name: "dstEid", + type: "uint32", + }, + { + internalType: "bytes32", + name: "to", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + { + internalType: "bytes", + name: "extraOptions", + type: "bytes", + }, + { + internalType: "bytes", + name: "composeMsg", + type: "bytes", + }, + { + internalType: "bytes", + name: "oftCmd", + type: "bytes", + }, + ], + internalType: "struct SendParam", + name: "_sendParam", + type: "tuple", + }, + ], + name: "quoteOFT", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxAmountLD", + type: "uint256", + }, + ], + internalType: "struct OFTLimit", + name: "", + type: "tuple", + }, + { + components: [ + { + internalType: "int256", + name: "feeAmountLD", + type: "int256", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + ], + internalType: "struct OFTFeeDetail[]", + name: "oftFeeDetails", + type: "tuple[]", + }, + { + components: [ + { + internalType: "uint256", + name: "amountSentLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountReceivedLD", + type: "uint256", + }, + ], + internalType: "struct OFTReceipt", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint32", + name: "dstEid", + type: "uint32", + }, + { + internalType: "bytes32", + name: "to", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + { + internalType: "bytes", + name: "extraOptions", + type: "bytes", + }, + { + internalType: "bytes", + name: "composeMsg", + type: "bytes", + }, + { + internalType: "bytes", + name: "oftCmd", + type: "bytes", + }, + ], + internalType: "struct SendParam", + name: "_sendParam", + type: "tuple", + }, + { + internalType: "bool", + name: "_payInLzToken", + type: "bool", + }, + ], + name: "quoteSend", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "nativeFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "lzTokenFee", + type: "uint256", + }, + ], + internalType: "struct MessagingFee", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint32", + name: "dstEid", + type: "uint32", + }, + { + internalType: "bytes32", + name: "to", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + { + internalType: "bytes", + name: "extraOptions", + type: "bytes", + }, + { + internalType: "bytes", + name: "composeMsg", + type: "bytes", + }, + { + internalType: "bytes", + name: "oftCmd", + type: "bytes", + }, + ], + internalType: "struct SendParam", + name: "_sendParam", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "nativeFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "lzTokenFee", + type: "uint256", + }, + ], + internalType: "struct MessagingFee", + name: "_fee", + type: "tuple", + }, + { + internalType: "address", + name: "_refundAddress", + type: "address", + }, + ], + name: "send", + outputs: [ + { + components: [ + { + internalType: "bytes32", + name: "guid", + type: "bytes32", + }, + { + internalType: "uint64", + name: "nonce", + type: "uint64", + }, + { + components: [ + { + internalType: "uint256", + name: "nativeFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "lzTokenFee", + type: "uint256", + }, + ], + internalType: "struct MessagingFee", + name: "fee", + type: "tuple", + }, + ], + internalType: "struct MessagingReceipt", + name: "", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "amountSentLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountReceivedLD", + type: "uint256", + }, + ], + internalType: "struct OFTReceipt", + name: "", + type: "tuple", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "uint32", + name: "dstEid", + type: "uint32", + }, + { + internalType: "bytes32", + name: "to", + type: "bytes32", + }, + { + internalType: "uint256", + name: "amountLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountLD", + type: "uint256", + }, + { + internalType: "bytes", + name: "extraOptions", + type: "bytes", + }, + { + internalType: "bytes", + name: "composeMsg", + type: "bytes", + }, + { + internalType: "bytes", + name: "oftCmd", + type: "bytes", + }, + ], + internalType: "struct SendParam", + name: "_sendParam", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "nativeFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "lzTokenFee", + type: "uint256", + }, + ], + internalType: "struct MessagingFee", + name: "_fee", + type: "tuple", + }, + { + internalType: "address", + name: "_refundAddress", + type: "address", + }, + ], + name: "sendToken", + outputs: [ + { + components: [ + { + internalType: "bytes32", + name: "guid", + type: "bytes32", + }, + { + internalType: "uint64", + name: "nonce", + type: "uint64", + }, + { + components: [ + { + internalType: "uint256", + name: "nativeFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "lzTokenFee", + type: "uint256", + }, + ], + internalType: "struct MessagingFee", + name: "fee", + type: "tuple", + }, + ], + internalType: "struct MessagingReceipt", + name: "msgReceipt", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "amountSentLD", + type: "uint256", + }, + { + internalType: "uint256", + name: "amountReceivedLD", + type: "uint256", + }, + ], + internalType: "struct OFTReceipt", + name: "oftReceipt", + type: "tuple", + }, + { + components: [ + { + internalType: "uint72", + name: "ticketId", + type: "uint72", + }, + { + internalType: "bytes", + name: "passengerBytes", + type: "bytes", + }, + ], + internalType: "struct Ticket", + name: "ticket", + type: "tuple", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "sharedDecimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "stargateType", + outputs: [ + { + internalType: "enum StargateType", + name: "", + type: "uint8", + }, + ], + stateMutability: "pure", + type: "function", + }, + { + inputs: [], + name: "token", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class IStargate__factory { + static readonly abi = _abi; + static createInterface(): IStargateInterface { + return new Interface(_abi) as IStargateInterface; + } + static connect(address: string, runner?: ContractRunner | null): IStargate { + return new Contract(address, _abi, runner) as unknown as IStargate; + } +} diff --git a/src/typechain-types-stargate/factories/index.ts b/src/typechain-types-stargate/factories/index.ts new file mode 100644 index 0000000000..1b90f10d81 --- /dev/null +++ b/src/typechain-types-stargate/factories/index.ts @@ -0,0 +1,4 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { IStargate__factory } from "./IStargate__factory"; diff --git a/src/typechain-types-stargate/index.ts b/src/typechain-types-stargate/index.ts new file mode 100644 index 0000000000..ec0562c9eb --- /dev/null +++ b/src/typechain-types-stargate/index.ts @@ -0,0 +1,6 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { IStargate } from "./IStargate"; +export * as factories from "./factories"; +export { IStargate__factory } from "./factories/IStargate__factory"; diff --git a/src/typechain-types/DataStore.ts b/src/typechain-types/DataStore.ts index c44deca109..8af199053d 100644 --- a/src/typechain-types/DataStore.ts +++ b/src/typechain-types/DataStore.ts @@ -31,7 +31,8 @@ export interface DataStoreInterface extends Interface { | "addressValues" | "applyBoundedDeltaToUint" | "applyDeltaToInt" - | "applyDeltaToUint" + | "applyDeltaToUint(bytes32,int256,string)" + | "applyDeltaToUint(bytes32,uint256)" | "boolArrayValues" | "boolValues" | "bytes32ArrayValues" @@ -104,7 +105,11 @@ export interface DataStoreInterface extends Interface { encodeFunctionData(functionFragment: "addressValues", values: [BytesLike]): string; encodeFunctionData(functionFragment: "applyBoundedDeltaToUint", values: [BytesLike, BigNumberish]): string; encodeFunctionData(functionFragment: "applyDeltaToInt", values: [BytesLike, BigNumberish]): string; - encodeFunctionData(functionFragment: "applyDeltaToUint", values: [BytesLike, BigNumberish, string]): string; + encodeFunctionData( + functionFragment: "applyDeltaToUint(bytes32,int256,string)", + values: [BytesLike, BigNumberish, string] + ): string; + encodeFunctionData(functionFragment: "applyDeltaToUint(bytes32,uint256)", values: [BytesLike, BigNumberish]): string; encodeFunctionData(functionFragment: "boolArrayValues", values: [BytesLike, BigNumberish]): string; encodeFunctionData(functionFragment: "boolValues", values: [BytesLike]): string; encodeFunctionData(functionFragment: "bytes32ArrayValues", values: [BytesLike, BigNumberish]): string; @@ -176,7 +181,8 @@ export interface DataStoreInterface extends Interface { decodeFunctionResult(functionFragment: "addressValues", data: BytesLike): Result; decodeFunctionResult(functionFragment: "applyBoundedDeltaToUint", data: BytesLike): Result; decodeFunctionResult(functionFragment: "applyDeltaToInt", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "applyDeltaToUint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "applyDeltaToUint(bytes32,int256,string)", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "applyDeltaToUint(bytes32,uint256)", data: BytesLike): Result; decodeFunctionResult(functionFragment: "boolArrayValues", data: BytesLike): Result; decodeFunctionResult(functionFragment: "boolValues", data: BytesLike): Result; decodeFunctionResult(functionFragment: "bytes32ArrayValues", data: BytesLike): Result; @@ -289,12 +295,18 @@ export interface DataStore extends BaseContract { applyDeltaToInt: TypedContractMethod<[key: BytesLike, value: BigNumberish], [bigint], "nonpayable">; - applyDeltaToUint: TypedContractMethod< + "applyDeltaToUint(bytes32,int256,string)": TypedContractMethod< [key: BytesLike, value: BigNumberish, errorMessage: string], [bigint], "nonpayable" >; + "applyDeltaToUint(bytes32,uint256)": TypedContractMethod< + [key: BytesLike, value: BigNumberish], + [bigint], + "nonpayable" + >; + boolArrayValues: TypedContractMethod<[arg0: BytesLike, arg1: BigNumberish], [boolean], "view">; boolValues: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; @@ -451,8 +463,11 @@ export interface DataStore extends BaseContract { nameOrSignature: "applyDeltaToInt" ): TypedContractMethod<[key: BytesLike, value: BigNumberish], [bigint], "nonpayable">; getFunction( - nameOrSignature: "applyDeltaToUint" + nameOrSignature: "applyDeltaToUint(bytes32,int256,string)" ): TypedContractMethod<[key: BytesLike, value: BigNumberish, errorMessage: string], [bigint], "nonpayable">; + getFunction( + nameOrSignature: "applyDeltaToUint(bytes32,uint256)" + ): TypedContractMethod<[key: BytesLike, value: BigNumberish], [bigint], "nonpayable">; getFunction( nameOrSignature: "boolArrayValues" ): TypedContractMethod<[arg0: BytesLike, arg1: BigNumberish], [boolean], "view">; diff --git a/src/typechain-types/ERC20Permit.ts b/src/typechain-types/ERC20Permit.ts deleted file mode 100644 index f31858618d..0000000000 --- a/src/typechain-types/ERC20Permit.ts +++ /dev/null @@ -1,121 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ -import type { - BaseContract, - BigNumberish, - BytesLike, - FunctionFragment, - Result, - Interface, - AddressLike, - ContractRunner, - ContractMethod, - Listener, -} from "ethers"; -import type { - TypedContractEvent, - TypedDeferredTopicFilter, - TypedEventLog, - TypedListener, - TypedContractMethod, -} from "./common"; - -export interface ERC20PermitInterface extends Interface { - getFunction(nameOrSignature: "DOMAIN_SEPARATOR" | "nonces" | "permit" | "version" | "name"): FunctionFragment; - - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR", values?: undefined): string; - encodeFunctionData(functionFragment: "nonces", values: [AddressLike]): string; - encodeFunctionData( - functionFragment: "permit", - values: [AddressLike, AddressLike, BigNumberish, BigNumberish, BigNumberish, BytesLike, BytesLike] - ): string; - encodeFunctionData(functionFragment: "version", values?: undefined): string; - encodeFunctionData(functionFragment: "name", values?: undefined): string; - - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "nonces", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "permit", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; -} - -export interface ERC20Permit extends BaseContract { - connect(runner?: ContractRunner | null): ERC20Permit; - waitForDeployment(): Promise; - - interface: ERC20PermitInterface; - - queryFilter( - event: TCEvent, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>>; - queryFilter( - filter: TypedDeferredTopicFilter, - fromBlockOrBlockhash?: string | number | undefined, - toBlock?: string | number | undefined - ): Promise>>; - - on(event: TCEvent, listener: TypedListener): Promise; - on( - filter: TypedDeferredTopicFilter, - listener: TypedListener - ): Promise; - - once(event: TCEvent, listener: TypedListener): Promise; - once( - filter: TypedDeferredTopicFilter, - listener: TypedListener - ): Promise; - - listeners(event: TCEvent): Promise>>; - listeners(eventName?: string): Promise>; - removeAllListeners(event?: TCEvent): Promise; - - DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; - - nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - - permit: TypedContractMethod< - [ - owner: AddressLike, - spender: AddressLike, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - ], - [void], - "nonpayable" - >; - - version: TypedContractMethod<[], [string], "view">; - - name: TypedContractMethod<[], [string], "view">; - - getFunction(key: string | FunctionFragment): T; - - getFunction(nameOrSignature: "DOMAIN_SEPARATOR"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "nonces"): TypedContractMethod<[owner: AddressLike], [bigint], "view">; - getFunction( - nameOrSignature: "permit" - ): TypedContractMethod< - [ - owner: AddressLike, - spender: AddressLike, - value: BigNumberish, - deadline: BigNumberish, - v: BigNumberish, - r: BytesLike, - s: BytesLike, - ], - [void], - "nonpayable" - >; - getFunction(nameOrSignature: "version"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "name"): TypedContractMethod<[], [string], "view">; - - filters: {}; -} diff --git a/src/typechain-types/ExchangeRouter.ts b/src/typechain-types/ExchangeRouter.ts index 564d0c02ed..e8d299de6c 100644 --- a/src/typechain-types/ExchangeRouter.ts +++ b/src/typechain-types/ExchangeRouter.ts @@ -8,6 +8,7 @@ import type { FunctionFragment, Result, Interface, + EventFragment, AddressLike, ContractRunner, ContractMethod, @@ -17,12 +18,13 @@ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, + TypedLogDescription, TypedListener, TypedContractMethod, } from "./common"; -export declare namespace DepositUtils { - export type CreateDepositParamsStruct = { +export declare namespace IDepositUtils { + export type CreateDepositParamsAddressesStruct = { receiver: AddressLike; callbackContract: AddressLike; uiFeeReceiver: AddressLike; @@ -31,13 +33,9 @@ export declare namespace DepositUtils { initialShortToken: AddressLike; longTokenSwapPath: AddressLike[]; shortTokenSwapPath: AddressLike[]; - minMarketTokens: BigNumberish; - shouldUnwrapNativeToken: boolean; - executionFee: BigNumberish; - callbackGasLimit: BigNumberish; }; - export type CreateDepositParamsStructOutput = [ + export type CreateDepositParamsAddressesStructOutput = [ receiver: string, callbackContract: string, uiFeeReceiver: string, @@ -46,10 +44,6 @@ export declare namespace DepositUtils { initialShortToken: string, longTokenSwapPath: string[], shortTokenSwapPath: string[], - minMarketTokens: bigint, - shouldUnwrapNativeToken: boolean, - executionFee: bigint, - callbackGasLimit: bigint, ] & { receiver: string; callbackContract: string; @@ -59,10 +53,31 @@ export declare namespace DepositUtils { initialShortToken: string; longTokenSwapPath: string[]; shortTokenSwapPath: string[]; + }; + + export type CreateDepositParamsStruct = { + addresses: IDepositUtils.CreateDepositParamsAddressesStruct; + minMarketTokens: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateDepositParamsStructOutput = [ + addresses: IDepositUtils.CreateDepositParamsAddressesStructOutput, + minMarketTokens: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IDepositUtils.CreateDepositParamsAddressesStructOutput; minMarketTokens: bigint; shouldUnwrapNativeToken: boolean; executionFee: bigint; callbackGasLimit: bigint; + dataList: string[]; }; } @@ -135,6 +150,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: BytesLike; + dataList: BytesLike[]; }; export type CreateOrderParamsStructOutput = [ @@ -146,6 +162,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean, autoCancel: boolean, referralCode: string, + dataList: string[], ] & { addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; @@ -155,69 +172,73 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: string; + dataList: string[]; }; } -export declare namespace ShiftUtils { - export type CreateShiftParamsStruct = { +export declare namespace IShiftUtils { + export type CreateShiftParamsAddressesStruct = { receiver: AddressLike; callbackContract: AddressLike; uiFeeReceiver: AddressLike; fromMarket: AddressLike; toMarket: AddressLike; - minMarketTokens: BigNumberish; - executionFee: BigNumberish; - callbackGasLimit: BigNumberish; }; - export type CreateShiftParamsStructOutput = [ + export type CreateShiftParamsAddressesStructOutput = [ receiver: string, callbackContract: string, uiFeeReceiver: string, fromMarket: string, toMarket: string, - minMarketTokens: bigint, - executionFee: bigint, - callbackGasLimit: bigint, ] & { receiver: string; callbackContract: string; uiFeeReceiver: string; fromMarket: string; toMarket: string; + }; + + export type CreateShiftParamsStruct = { + addresses: IShiftUtils.CreateShiftParamsAddressesStruct; + minMarketTokens: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateShiftParamsStructOutput = [ + addresses: IShiftUtils.CreateShiftParamsAddressesStructOutput, + minMarketTokens: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IShiftUtils.CreateShiftParamsAddressesStructOutput; minMarketTokens: bigint; executionFee: bigint; callbackGasLimit: bigint; + dataList: string[]; }; } -export declare namespace WithdrawalUtils { - export type CreateWithdrawalParamsStruct = { +export declare namespace IWithdrawalUtils { + export type CreateWithdrawalParamsAddressesStruct = { receiver: AddressLike; callbackContract: AddressLike; uiFeeReceiver: AddressLike; market: AddressLike; longTokenSwapPath: AddressLike[]; shortTokenSwapPath: AddressLike[]; - minLongTokenAmount: BigNumberish; - minShortTokenAmount: BigNumberish; - shouldUnwrapNativeToken: boolean; - executionFee: BigNumberish; - callbackGasLimit: BigNumberish; }; - export type CreateWithdrawalParamsStructOutput = [ + export type CreateWithdrawalParamsAddressesStructOutput = [ receiver: string, callbackContract: string, uiFeeReceiver: string, market: string, longTokenSwapPath: string[], shortTokenSwapPath: string[], - minLongTokenAmount: bigint, - minShortTokenAmount: bigint, - shouldUnwrapNativeToken: boolean, - executionFee: bigint, - callbackGasLimit: bigint, ] & { receiver: string; callbackContract: string; @@ -225,11 +246,34 @@ export declare namespace WithdrawalUtils { market: string; longTokenSwapPath: string[]; shortTokenSwapPath: string[]; + }; + + export type CreateWithdrawalParamsStruct = { + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStruct; + minLongTokenAmount: BigNumberish; + minShortTokenAmount: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateWithdrawalParamsStructOutput = [ + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStructOutput, + minLongTokenAmount: bigint, + minShortTokenAmount: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStructOutput; minLongTokenAmount: bigint; minShortTokenAmount: bigint; shouldUnwrapNativeToken: boolean; executionFee: bigint; callbackGasLimit: bigint; + dataList: string[]; }; } @@ -318,6 +362,8 @@ export interface ExchangeRouterInterface extends Interface { | "withdrawalHandler" ): FunctionFragment; + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + encodeFunctionData(functionFragment: "cancelDeposit", values: [BytesLike]): string; encodeFunctionData(functionFragment: "cancelOrder", values: [BytesLike]): string; encodeFunctionData(functionFragment: "cancelShift", values: [BytesLike]): string; @@ -332,19 +378,19 @@ export interface ExchangeRouterInterface extends Interface { ): string; encodeFunctionData(functionFragment: "claimFundingFees", values: [AddressLike[], AddressLike[], AddressLike]): string; encodeFunctionData(functionFragment: "claimUiFees", values: [AddressLike[], AddressLike[], AddressLike]): string; - encodeFunctionData(functionFragment: "createDeposit", values: [DepositUtils.CreateDepositParamsStruct]): string; + encodeFunctionData(functionFragment: "createDeposit", values: [IDepositUtils.CreateDepositParamsStruct]): string; encodeFunctionData(functionFragment: "createOrder", values: [IBaseOrderUtils.CreateOrderParamsStruct]): string; - encodeFunctionData(functionFragment: "createShift", values: [ShiftUtils.CreateShiftParamsStruct]): string; + encodeFunctionData(functionFragment: "createShift", values: [IShiftUtils.CreateShiftParamsStruct]): string; encodeFunctionData( functionFragment: "createWithdrawal", - values: [WithdrawalUtils.CreateWithdrawalParamsStruct] + values: [IWithdrawalUtils.CreateWithdrawalParamsStruct] ): string; encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; encodeFunctionData(functionFragment: "depositHandler", values?: undefined): string; encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; encodeFunctionData( functionFragment: "executeAtomicWithdrawal", - values: [WithdrawalUtils.CreateWithdrawalParamsStruct, OracleUtils.SetPricesParamsStruct] + values: [IWithdrawalUtils.CreateWithdrawalParamsStruct, OracleUtils.SetPricesParamsStruct] ): string; encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; encodeFunctionData( @@ -439,6 +485,19 @@ export interface ExchangeRouterInterface extends Interface { decodeFunctionResult(functionFragment: "withdrawalHandler", data: BytesLike): Result; } +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + export interface ExchangeRouter extends BaseContract { connect(runner?: ContractRunner | null): ExchangeRouter; waitForDeployment(): Promise; @@ -474,22 +533,12 @@ export interface ExchangeRouter extends BaseContract { cancelDeposit: TypedContractMethod<[key: BytesLike], [void], "payable">; - /** - * Cancels the given order. The `cancelOrder()` feature must be enabled for the given order type. The caller must be the owner of the order, and the order must not be a market order. The order is cancelled by calling the `cancelOrder()` function in the `OrderUtils` contract. This function also records the starting gas amount and the reason for cancellation, which is passed to the `cancelOrder()` function. - * @param key The unique ID of the order to be cancelled - */ cancelOrder: TypedContractMethod<[key: BytesLike], [void], "payable">; cancelShift: TypedContractMethod<[key: BytesLike], [void], "payable">; cancelWithdrawal: TypedContractMethod<[key: BytesLike], [void], "payable">; - /** - * Claims affiliate rewards for the given markets and tokens on behalf of the caller, and sends the rewards to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimAffiliateReward()` function in the `ReferralUtils` contract is called to claim the rewards for the caller. - * @param markets An array of market addresses - * @param receiver The address to which the claimed rewards should be sent - * @param tokens An array of token addresses, corresponding to the given markets - */ claimAffiliateRewards: TypedContractMethod< [markets: AddressLike[], tokens: AddressLike[], receiver: AddressLike], [bigint[]], @@ -502,12 +551,6 @@ export interface ExchangeRouter extends BaseContract { "payable" >; - /** - * Claims funding fees for the given markets and tokens on behalf of the caller, and sends the fees to the specified receiver. The length of the `markets` and `tokens` arrays must be the same. For each market-token pair, the `claimFundingFees()` function in the `MarketUtils` contract is called to claim the fees for the caller. - * @param markets An array of market addresses - * @param receiver The address to which the claimed fees should be sent - * @param tokens An array of token addresses, corresponding to the given markets - */ claimFundingFees: TypedContractMethod< [markets: AddressLike[], tokens: AddressLike[], receiver: AddressLike], [bigint[]], @@ -520,13 +563,13 @@ export interface ExchangeRouter extends BaseContract { "payable" >; - createDeposit: TypedContractMethod<[params: DepositUtils.CreateDepositParamsStruct], [string], "payable">; + createDeposit: TypedContractMethod<[params: IDepositUtils.CreateDepositParamsStruct], [string], "payable">; createOrder: TypedContractMethod<[params: IBaseOrderUtils.CreateOrderParamsStruct], [string], "payable">; - createShift: TypedContractMethod<[params: ShiftUtils.CreateShiftParamsStruct], [string], "payable">; + createShift: TypedContractMethod<[params: IShiftUtils.CreateShiftParamsStruct], [string], "payable">; - createWithdrawal: TypedContractMethod<[params: WithdrawalUtils.CreateWithdrawalParamsStruct], [string], "payable">; + createWithdrawal: TypedContractMethod<[params: IWithdrawalUtils.CreateWithdrawalParamsStruct], [string], "payable">; dataStore: TypedContractMethod<[], [string], "view">; @@ -535,7 +578,7 @@ export interface ExchangeRouter extends BaseContract { eventEmitter: TypedContractMethod<[], [string], "view">; executeAtomicWithdrawal: TypedContractMethod< - [params: WithdrawalUtils.CreateWithdrawalParamsStruct, oracleParams: OracleUtils.SetPricesParamsStruct], + [params: IWithdrawalUtils.CreateWithdrawalParamsStruct, oracleParams: OracleUtils.SetPricesParamsStruct], [void], "payable" >; @@ -550,12 +593,9 @@ export interface ExchangeRouter extends BaseContract { refundReceivers: AddressLike[], ], [void], - "nonpayable" + "payable" >; - /** - * Receives and executes a batch of function calls on this contract. - */ multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; orderHandler: TypedContractMethod<[], [string], "view">; @@ -668,23 +708,23 @@ export interface ExchangeRouter extends BaseContract { ): TypedContractMethod<[markets: AddressLike[], tokens: AddressLike[], receiver: AddressLike], [bigint[]], "payable">; getFunction( nameOrSignature: "createDeposit" - ): TypedContractMethod<[params: DepositUtils.CreateDepositParamsStruct], [string], "payable">; + ): TypedContractMethod<[params: IDepositUtils.CreateDepositParamsStruct], [string], "payable">; getFunction( nameOrSignature: "createOrder" ): TypedContractMethod<[params: IBaseOrderUtils.CreateOrderParamsStruct], [string], "payable">; getFunction( nameOrSignature: "createShift" - ): TypedContractMethod<[params: ShiftUtils.CreateShiftParamsStruct], [string], "payable">; + ): TypedContractMethod<[params: IShiftUtils.CreateShiftParamsStruct], [string], "payable">; getFunction( nameOrSignature: "createWithdrawal" - ): TypedContractMethod<[params: WithdrawalUtils.CreateWithdrawalParamsStruct], [string], "payable">; + ): TypedContractMethod<[params: IWithdrawalUtils.CreateWithdrawalParamsStruct], [string], "payable">; getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "depositHandler"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "executeAtomicWithdrawal" ): TypedContractMethod< - [params: WithdrawalUtils.CreateWithdrawalParamsStruct, oracleParams: OracleUtils.SetPricesParamsStruct], + [params: IWithdrawalUtils.CreateWithdrawalParamsStruct, oracleParams: OracleUtils.SetPricesParamsStruct], [void], "payable" >; @@ -699,7 +739,7 @@ export interface ExchangeRouter extends BaseContract { refundReceivers: AddressLike[], ], [void], - "nonpayable" + "payable" >; getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; @@ -780,5 +820,24 @@ export interface ExchangeRouter extends BaseContract { >; getFunction(nameOrSignature: "withdrawalHandler"): TypedContractMethod<[], [string], "view">; - filters: {}; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; } diff --git a/src/typechain-types/GelatoRelayRouter.ts b/src/typechain-types/GelatoRelayRouter.ts index b0a31f266a..d53738e9c9 100644 --- a/src/typechain-types/GelatoRelayRouter.ts +++ b/src/typechain-types/GelatoRelayRouter.ts @@ -8,6 +8,7 @@ import type { FunctionFragment, Result, Interface, + EventFragment, AddressLike, ContractRunner, ContractMethod, @@ -17,153 +18,11 @@ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, + TypedLogDescription, TypedListener, TypedContractMethod, } from "./common"; -export type ExternalCallsStruct = { - sendTokens: AddressLike[]; - sendAmounts: BigNumberish[]; - externalCallTargets: AddressLike[]; - externalCallDataList: BytesLike[]; - refundTokens: AddressLike[]; - refundReceivers: AddressLike[]; -}; - -export type ExternalCallsStructOutput = [ - sendTokens: string[], - sendAmounts: bigint[], - externalCallTargets: string[], - externalCallDataList: string[], - refundTokens: string[], - refundReceivers: string[], -] & { - sendTokens: string[]; - sendAmounts: bigint[]; - externalCallTargets: string[]; - externalCallDataList: string[]; - refundTokens: string[]; - refundReceivers: string[]; -}; - -export type TokenPermitStruct = { - owner: AddressLike; - spender: AddressLike; - value: BigNumberish; - deadline: BigNumberish; - v: BigNumberish; - r: BytesLike; - s: BytesLike; - token: AddressLike; -}; - -export type TokenPermitStructOutput = [ - owner: string, - spender: string, - value: bigint, - deadline: bigint, - v: bigint, - r: string, - s: string, - token: string, -] & { - owner: string; - spender: string; - value: bigint; - deadline: bigint; - v: bigint; - r: string; - s: string; - token: string; -}; - -export type FeeParamsStruct = { - feeToken: AddressLike; - feeAmount: BigNumberish; - feeSwapPath: AddressLike[]; -}; - -export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { - feeToken: string; - feeAmount: bigint; - feeSwapPath: string[]; -}; - -export type RelayParamsStruct = { - oracleParams: OracleUtils.SetPricesParamsStruct; - externalCalls: ExternalCallsStruct; - tokenPermits: TokenPermitStruct[]; - fee: FeeParamsStruct; - userNonce: BigNumberish; - deadline: BigNumberish; - signature: BytesLike; -}; - -export type RelayParamsStructOutput = [ - oracleParams: OracleUtils.SetPricesParamsStructOutput, - externalCalls: ExternalCallsStructOutput, - tokenPermits: TokenPermitStructOutput[], - fee: FeeParamsStructOutput, - userNonce: bigint, - deadline: bigint, - signature: string, -] & { - oracleParams: OracleUtils.SetPricesParamsStructOutput; - externalCalls: ExternalCallsStructOutput; - tokenPermits: TokenPermitStructOutput[]; - fee: FeeParamsStructOutput; - userNonce: bigint; - deadline: bigint; - signature: string; -}; - -export type UpdateOrderParamsStruct = { - key: BytesLike; - sizeDeltaUsd: BigNumberish; - acceptablePrice: BigNumberish; - triggerPrice: BigNumberish; - minOutputAmount: BigNumberish; - validFromTime: BigNumberish; - autoCancel: boolean; - executionFeeIncrease: BigNumberish; -}; - -export type UpdateOrderParamsStructOutput = [ - key: string, - sizeDeltaUsd: bigint, - acceptablePrice: bigint, - triggerPrice: bigint, - minOutputAmount: bigint, - validFromTime: bigint, - autoCancel: boolean, - executionFeeIncrease: bigint, -] & { - key: string; - sizeDeltaUsd: bigint; - acceptablePrice: bigint; - triggerPrice: bigint; - minOutputAmount: bigint; - validFromTime: bigint; - autoCancel: boolean; - executionFeeIncrease: bigint; -}; - -export type BatchParamsStruct = { - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; - updateOrderParamsList: UpdateOrderParamsStruct[]; - cancelOrderKeys: BytesLike[]; -}; - -export type BatchParamsStructOutput = [ - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], - updateOrderParamsList: UpdateOrderParamsStructOutput[], - cancelOrderKeys: string[], -] & { - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; - updateOrderParamsList: UpdateOrderParamsStructOutput[]; - cancelOrderKeys: string[]; -}; - export declare namespace OracleUtils { export type SetPricesParamsStruct = { tokens: AddressLike[]; @@ -178,6 +37,154 @@ export declare namespace OracleUtils { }; } +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type UpdateOrderParamsStruct = { + key: BytesLike; + sizeDeltaUsd: BigNumberish; + acceptablePrice: BigNumberish; + triggerPrice: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + autoCancel: boolean; + executionFeeIncrease: BigNumberish; + }; + + export type UpdateOrderParamsStructOutput = [ + key: string, + sizeDeltaUsd: bigint, + acceptablePrice: bigint, + triggerPrice: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + autoCancel: boolean, + executionFeeIncrease: bigint, + ] & { + key: string; + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + autoCancel: boolean; + executionFeeIncrease: bigint; + }; + + export type BatchParamsStruct = { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStruct[]; + cancelOrderKeys: BytesLike[]; + }; + + export type BatchParamsStructOutput = [ + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[], + cancelOrderKeys: string[], + ] & { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[]; + cancelOrderKeys: string[]; + }; +} + export declare namespace IBaseOrderUtils { export type CreateOrderParamsAddressesStruct = { receiver: AddressLike; @@ -247,6 +254,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: BytesLike; + dataList: BytesLike[]; }; export type CreateOrderParamsStructOutput = [ @@ -258,6 +266,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean, autoCancel: boolean, referralCode: string, + dataList: string[], ] & { addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; @@ -267,66 +276,97 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: string; + dataList: string[]; }; } export interface GelatoRelayRouterInterface extends Interface { getFunction( nameOrSignature: - | "DOMAIN_SEPARATOR_NAME_HASH" - | "DOMAIN_SEPARATOR_TYPEHASH" - | "DOMAIN_SEPARATOR_VERSION_HASH" | "batch" | "cancelOrder" | "createOrder" | "dataStore" + | "digests" | "eventEmitter" | "externalHandler" + | "multicall" | "oracle" | "orderHandler" | "orderVault" + | "roleStore" | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "swapHandler" | "updateOrder" - | "userNonces" ): FunctionFragment; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_NAME_HASH", values?: undefined): string; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_TYPEHASH", values?: undefined): string; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_VERSION_HASH", values?: undefined): string; - encodeFunctionData(functionFragment: "batch", values: [RelayParamsStruct, AddressLike, BatchParamsStruct]): string; - encodeFunctionData(functionFragment: "cancelOrder", values: [RelayParamsStruct, AddressLike, BytesLike]): string; + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "batch", + values: [IRelayUtils.RelayParamsStruct, AddressLike, IRelayUtils.BatchParamsStruct] + ): string; + encodeFunctionData( + functionFragment: "cancelOrder", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BytesLike] + ): string; encodeFunctionData( functionFragment: "createOrder", - values: [RelayParamsStruct, AddressLike, IBaseOrderUtils.CreateOrderParamsStruct] + values: [IRelayUtils.RelayParamsStruct, AddressLike, IBaseOrderUtils.CreateOrderParamsStruct] ): string; encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; encodeFunctionData(functionFragment: "oracle", values?: undefined): string; encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; encodeFunctionData( functionFragment: "updateOrder", - values: [RelayParamsStruct, AddressLike, UpdateOrderParamsStruct] + values: [IRelayUtils.RelayParamsStruct, AddressLike, IRelayUtils.UpdateOrderParamsStruct] ): string; - encodeFunctionData(functionFragment: "userNonces", values: [AddressLike]): string; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_NAME_HASH", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_TYPEHASH", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_VERSION_HASH", data: BytesLike): Result; decodeFunctionResult(functionFragment: "batch", data: BytesLike): Result; decodeFunctionResult(functionFragment: "cancelOrder", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createOrder", data: BytesLike): Result; decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updateOrder", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "userNonces", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export interface GelatoRelayRouter extends BaseContract { @@ -362,89 +402,127 @@ export interface GelatoRelayRouter extends BaseContract { listeners(eventName?: string): Promise>; removeAllListeners(event?: TCEvent): Promise; - DOMAIN_SEPARATOR_NAME_HASH: TypedContractMethod<[], [string], "view">; - - DOMAIN_SEPARATOR_TYPEHASH: TypedContractMethod<[], [string], "view">; - - DOMAIN_SEPARATOR_VERSION_HASH: TypedContractMethod<[], [string], "view">; - batch: TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: BatchParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IRelayUtils.BatchParamsStruct], [string[]], "nonpayable" >; cancelOrder: TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, key: BytesLike], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, key: BytesLike], [void], "nonpayable" >; createOrder: TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: IBaseOrderUtils.CreateOrderParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IBaseOrderUtils.CreateOrderParamsStruct], [string], "nonpayable" >; dataStore: TypedContractMethod<[], [string], "view">; + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + eventEmitter: TypedContractMethod<[], [string], "view">; externalHandler: TypedContractMethod<[], [string], "view">; + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + oracle: TypedContractMethod<[], [string], "view">; orderHandler: TypedContractMethod<[], [string], "view">; orderVault: TypedContractMethod<[], [string], "view">; + roleStore: TypedContractMethod<[], [string], "view">; + router: TypedContractMethod<[], [string], "view">; + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + swapHandler: TypedContractMethod<[], [string], "view">; + updateOrder: TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: UpdateOrderParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IRelayUtils.UpdateOrderParamsStruct], [void], "nonpayable" >; - userNonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_NAME_HASH"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_TYPEHASH"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_VERSION_HASH"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "batch" ): TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: BatchParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IRelayUtils.BatchParamsStruct], [string[]], "nonpayable" >; getFunction( nameOrSignature: "cancelOrder" - ): TypedContractMethod<[relayParams: RelayParamsStruct, account: AddressLike, key: BytesLike], [void], "nonpayable">; + ): TypedContractMethod< + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, key: BytesLike], + [void], + "nonpayable" + >; getFunction( nameOrSignature: "createOrder" ): TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: IBaseOrderUtils.CreateOrderParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IBaseOrderUtils.CreateOrderParamsStruct], [string], "nonpayable" >; getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "updateOrder" ): TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, params: UpdateOrderParamsStruct], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, params: IRelayUtils.UpdateOrderParamsStruct], [void], "nonpayable" >; - getFunction(nameOrSignature: "userNonces"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; - filters: {}; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; } diff --git a/src/typechain-types/GlvReader.ts b/src/typechain-types/GlvReader.ts index 4802a48068..7eb24ff8b4 100644 --- a/src/typechain-types/GlvReader.ts +++ b/src/typechain-types/GlvReader.ts @@ -67,6 +67,7 @@ export declare namespace GlvDeposit { updatedAtTime: BigNumberish; executionFee: BigNumberish; callbackGasLimit: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -77,6 +78,7 @@ export declare namespace GlvDeposit { updatedAtTime: bigint, executionFee: bigint, callbackGasLimit: bigint, + srcChainId: bigint, ] & { marketTokenAmount: bigint; initialLongTokenAmount: bigint; @@ -85,6 +87,7 @@ export declare namespace GlvDeposit { updatedAtTime: bigint; executionFee: bigint; callbackGasLimit: bigint; + srcChainId: bigint; }; export type FlagsStruct = { @@ -101,16 +104,19 @@ export declare namespace GlvDeposit { addresses: GlvDeposit.AddressesStruct; numbers: GlvDeposit.NumbersStruct; flags: GlvDeposit.FlagsStruct; + _dataList: BytesLike[]; }; export type PropsStructOutput = [ addresses: GlvDeposit.AddressesStructOutput, numbers: GlvDeposit.NumbersStructOutput, flags: GlvDeposit.FlagsStructOutput, + _dataList: string[], ] & { addresses: GlvDeposit.AddressesStructOutput; numbers: GlvDeposit.NumbersStructOutput; flags: GlvDeposit.FlagsStructOutput; + _dataList: string[]; }; } @@ -153,6 +159,7 @@ export declare namespace GlvWithdrawal { updatedAtTime: BigNumberish; executionFee: BigNumberish; callbackGasLimit: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -162,6 +169,7 @@ export declare namespace GlvWithdrawal { updatedAtTime: bigint, executionFee: bigint, callbackGasLimit: bigint, + srcChainId: bigint, ] & { glvTokenAmount: bigint; minLongTokenAmount: bigint; @@ -169,6 +177,7 @@ export declare namespace GlvWithdrawal { updatedAtTime: bigint; executionFee: bigint; callbackGasLimit: bigint; + srcChainId: bigint; }; export type FlagsStruct = { shouldUnwrapNativeToken: boolean }; @@ -181,16 +190,19 @@ export declare namespace GlvWithdrawal { addresses: GlvWithdrawal.AddressesStruct; numbers: GlvWithdrawal.NumbersStruct; flags: GlvWithdrawal.FlagsStruct; + _dataList: BytesLike[]; }; export type PropsStructOutput = [ addresses: GlvWithdrawal.AddressesStructOutput, numbers: GlvWithdrawal.NumbersStructOutput, flags: GlvWithdrawal.FlagsStructOutput, + _dataList: string[], ] & { addresses: GlvWithdrawal.AddressesStructOutput; numbers: GlvWithdrawal.NumbersStructOutput; flags: GlvWithdrawal.FlagsStructOutput; + _dataList: string[]; }; } diff --git a/src/typechain-types/GlvRouter.ts b/src/typechain-types/GlvRouter.ts index 2f2a6e21ff..6780664333 100644 --- a/src/typechain-types/GlvRouter.ts +++ b/src/typechain-types/GlvRouter.ts @@ -8,6 +8,7 @@ import type { FunctionFragment, Result, Interface, + EventFragment, AddressLike, ContractRunner, ContractMethod, @@ -17,12 +18,13 @@ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, + TypedLogDescription, TypedListener, TypedContractMethod, } from "./common"; -export declare namespace GlvDepositUtils { - export type CreateGlvDepositParamsStruct = { +export declare namespace IGlvDepositUtils { + export type CreateGlvDepositParamsAddressesStruct = { glv: AddressLike; market: AddressLike; receiver: AddressLike; @@ -32,14 +34,9 @@ export declare namespace GlvDepositUtils { initialShortToken: AddressLike; longTokenSwapPath: AddressLike[]; shortTokenSwapPath: AddressLike[]; - minGlvTokens: BigNumberish; - executionFee: BigNumberish; - callbackGasLimit: BigNumberish; - shouldUnwrapNativeToken: boolean; - isMarketTokenDeposit: boolean; }; - export type CreateGlvDepositParamsStructOutput = [ + export type CreateGlvDepositParamsAddressesStructOutput = [ glv: string, market: string, receiver: string, @@ -49,11 +46,6 @@ export declare namespace GlvDepositUtils { initialShortToken: string, longTokenSwapPath: string[], shortTokenSwapPath: string[], - minGlvTokens: bigint, - executionFee: bigint, - callbackGasLimit: bigint, - shouldUnwrapNativeToken: boolean, - isMarketTokenDeposit: boolean, ] & { glv: string; market: string; @@ -64,16 +56,39 @@ export declare namespace GlvDepositUtils { initialShortToken: string; longTokenSwapPath: string[]; shortTokenSwapPath: string[]; + }; + + export type CreateGlvDepositParamsStruct = { + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStruct; + minGlvTokens: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + shouldUnwrapNativeToken: boolean; + isMarketTokenDeposit: boolean; + dataList: BytesLike[]; + }; + + export type CreateGlvDepositParamsStructOutput = [ + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStructOutput, + minGlvTokens: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + shouldUnwrapNativeToken: boolean, + isMarketTokenDeposit: boolean, + dataList: string[], + ] & { + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStructOutput; minGlvTokens: bigint; executionFee: bigint; callbackGasLimit: bigint; shouldUnwrapNativeToken: boolean; isMarketTokenDeposit: boolean; + dataList: string[]; }; } -export declare namespace GlvWithdrawalUtils { - export type CreateGlvWithdrawalParamsStruct = { +export declare namespace IGlvWithdrawalUtils { + export type CreateGlvWithdrawalParamsAddressesStruct = { receiver: AddressLike; callbackContract: AddressLike; uiFeeReceiver: AddressLike; @@ -81,14 +96,9 @@ export declare namespace GlvWithdrawalUtils { glv: AddressLike; longTokenSwapPath: AddressLike[]; shortTokenSwapPath: AddressLike[]; - minLongTokenAmount: BigNumberish; - minShortTokenAmount: BigNumberish; - shouldUnwrapNativeToken: boolean; - executionFee: BigNumberish; - callbackGasLimit: BigNumberish; }; - export type CreateGlvWithdrawalParamsStructOutput = [ + export type CreateGlvWithdrawalParamsAddressesStructOutput = [ receiver: string, callbackContract: string, uiFeeReceiver: string, @@ -96,11 +106,6 @@ export declare namespace GlvWithdrawalUtils { glv: string, longTokenSwapPath: string[], shortTokenSwapPath: string[], - minLongTokenAmount: bigint, - minShortTokenAmount: bigint, - shouldUnwrapNativeToken: boolean, - executionFee: bigint, - callbackGasLimit: bigint, ] & { receiver: string; callbackContract: string; @@ -109,11 +114,34 @@ export declare namespace GlvWithdrawalUtils { glv: string; longTokenSwapPath: string[]; shortTokenSwapPath: string[]; + }; + + export type CreateGlvWithdrawalParamsStruct = { + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStruct; + minLongTokenAmount: BigNumberish; + minShortTokenAmount: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateGlvWithdrawalParamsStructOutput = [ + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStructOutput, + minLongTokenAmount: bigint, + minShortTokenAmount: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStructOutput; minLongTokenAmount: bigint; minShortTokenAmount: bigint; shouldUnwrapNativeToken: boolean; executionFee: bigint; callbackGasLimit: bigint; + dataList: string[]; }; } @@ -157,7 +185,8 @@ export interface GlvRouterInterface extends Interface { | "dataStore" | "eventEmitter" | "externalHandler" - | "glvHandler" + | "glvDepositHandler" + | "glvWithdrawalHandler" | "makeExternalCalls" | "multicall" | "roleStore" @@ -171,20 +200,23 @@ export interface GlvRouterInterface extends Interface { | "simulateExecuteLatestGlvWithdrawal" ): FunctionFragment; + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + encodeFunctionData(functionFragment: "cancelGlvDeposit", values: [BytesLike]): string; encodeFunctionData(functionFragment: "cancelGlvWithdrawal", values: [BytesLike]): string; encodeFunctionData( functionFragment: "createGlvDeposit", - values: [GlvDepositUtils.CreateGlvDepositParamsStruct] + values: [IGlvDepositUtils.CreateGlvDepositParamsStruct] ): string; encodeFunctionData( functionFragment: "createGlvWithdrawal", - values: [GlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct] + values: [IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct] ): string; encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; - encodeFunctionData(functionFragment: "glvHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "glvDepositHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "glvWithdrawalHandler", values?: undefined): string; encodeFunctionData( functionFragment: "makeExternalCalls", values: [AddressLike[], BytesLike[], AddressLike[], AddressLike[]] @@ -219,7 +251,8 @@ export interface GlvRouterInterface extends Interface { decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "glvHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "glvDepositHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "glvWithdrawalHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "makeExternalCalls", data: BytesLike): Result; decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; @@ -233,6 +266,19 @@ export interface GlvRouterInterface extends Interface { decodeFunctionResult(functionFragment: "simulateExecuteLatestGlvWithdrawal", data: BytesLike): Result; } +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + export interface GlvRouter extends BaseContract { connect(runner?: ContractRunner | null): GlvRouter; waitForDeployment(): Promise; @@ -270,10 +316,10 @@ export interface GlvRouter extends BaseContract { cancelGlvWithdrawal: TypedContractMethod<[key: BytesLike], [void], "nonpayable">; - createGlvDeposit: TypedContractMethod<[params: GlvDepositUtils.CreateGlvDepositParamsStruct], [string], "payable">; + createGlvDeposit: TypedContractMethod<[params: IGlvDepositUtils.CreateGlvDepositParamsStruct], [string], "payable">; createGlvWithdrawal: TypedContractMethod< - [params: GlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct], + [params: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct], [string], "payable" >; @@ -284,7 +330,9 @@ export interface GlvRouter extends BaseContract { externalHandler: TypedContractMethod<[], [string], "view">; - glvHandler: TypedContractMethod<[], [string], "view">; + glvDepositHandler: TypedContractMethod<[], [string], "view">; + + glvWithdrawalHandler: TypedContractMethod<[], [string], "view">; makeExternalCalls: TypedContractMethod< [ @@ -294,7 +342,7 @@ export interface GlvRouter extends BaseContract { refundReceivers: AddressLike[], ], [void], - "nonpayable" + "payable" >; multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; @@ -339,14 +387,15 @@ export interface GlvRouter extends BaseContract { getFunction(nameOrSignature: "cancelGlvWithdrawal"): TypedContractMethod<[key: BytesLike], [void], "nonpayable">; getFunction( nameOrSignature: "createGlvDeposit" - ): TypedContractMethod<[params: GlvDepositUtils.CreateGlvDepositParamsStruct], [string], "payable">; + ): TypedContractMethod<[params: IGlvDepositUtils.CreateGlvDepositParamsStruct], [string], "payable">; getFunction( nameOrSignature: "createGlvWithdrawal" - ): TypedContractMethod<[params: GlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct], [string], "payable">; + ): TypedContractMethod<[params: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct], [string], "payable">; getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "glvHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "glvDepositHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "glvWithdrawalHandler"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "makeExternalCalls" ): TypedContractMethod< @@ -357,7 +406,7 @@ export interface GlvRouter extends BaseContract { refundReceivers: AddressLike[], ], [void], - "nonpayable" + "payable" >; getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; @@ -392,5 +441,24 @@ export interface GlvRouter extends BaseContract { nameOrSignature: "simulateExecuteLatestGlvWithdrawal" ): TypedContractMethod<[simulatedOracleParams: OracleUtils.SimulatePricesParamsStruct], [void], "payable">; - filters: {}; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; } diff --git a/src/typechain-types/GovToken.ts b/src/typechain-types/GovToken.ts index 1e782e54cf..1fae633be1 100644 --- a/src/typechain-types/GovToken.ts +++ b/src/typechain-types/GovToken.ts @@ -236,83 +236,44 @@ export interface GovToken extends BaseContract { listeners(eventName?: string): Promise>; removeAllListeners(event?: TCEvent): Promise; - /** - * Description of the clock - */ CLOCK_MODE: TypedContractMethod<[], [string], "view">; - /** - * See {IERC20Permit-DOMAIN_SEPARATOR}. - */ DOMAIN_SEPARATOR: TypedContractMethod<[], [string], "view">; - /** - * See {IERC20-allowance}. - */ allowance: TypedContractMethod<[owner: AddressLike, spender: AddressLike], [bigint], "view">; - /** - * See {IERC20-approve}. NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on `transferFrom`. This is semantically equivalent to an infinite approval. Requirements: - `spender` cannot be the zero address. - */ approve: TypedContractMethod<[spender: AddressLike, amount: BigNumberish], [boolean], "nonpayable">; - /** - * See {IERC20-balanceOf}. - */ balanceOf: TypedContractMethod<[account: AddressLike], [bigint], "view">; burn: TypedContractMethod<[account: AddressLike, amount: BigNumberish], [void], "nonpayable">; - /** - * Get the `pos`-th checkpoint for `account`. - */ checkpoints: TypedContractMethod< [account: AddressLike, pos: BigNumberish], [ERC20Votes.CheckpointStructOutput], "view" >; - /** - * Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting). - */ clock: TypedContractMethod<[], [bigint], "view">; - /** - * Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}. - */ decimals: TypedContractMethod<[], [bigint], "view">; - /** - * Atomically decreases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - `spender` must have allowance for the caller of at least `subtractedValue`. - */ decreaseAllowance: TypedContractMethod< [spender: AddressLike, subtractedValue: BigNumberish], [boolean], "nonpayable" >; - /** - * Delegate votes from the sender to `delegatee`. - */ delegate: TypedContractMethod<[delegatee: AddressLike], [void], "nonpayable">; - /** - * Delegates votes from signer to `delegatee` - */ delegateBySig: TypedContractMethod< [delegatee: AddressLike, nonce: BigNumberish, expiry: BigNumberish, v: BigNumberish, r: BytesLike, s: BytesLike], [void], "nonpayable" >; - /** - * Get the address `account` is currently delegating to. - */ delegates: TypedContractMethod<[account: AddressLike], [string], "view">; - /** - * See {EIP-5267}. _Available since v4.9._ - */ eip712Domain: TypedContractMethod< [], [ @@ -329,46 +290,22 @@ export interface GovToken extends BaseContract { "view" >; - /** - * Retrieve the `totalSupply` at the end of `timepoint`. Note, this value is the sum of all balances. It is NOT the sum of all the delegated votes! Requirements: - `timepoint` must be in the past - */ getPastTotalSupply: TypedContractMethod<[timepoint: BigNumberish], [bigint], "view">; - /** - * Retrieve the number of votes for `account` at the end of `timepoint`. Requirements: - `timepoint` must be in the past - */ getPastVotes: TypedContractMethod<[account: AddressLike, timepoint: BigNumberish], [bigint], "view">; - /** - * Gets the current votes balance for `account` - */ getVotes: TypedContractMethod<[account: AddressLike], [bigint], "view">; - /** - * Atomically increases the allowance granted to `spender` by the caller. This is an alternative to {approve} that can be used as a mitigation for problems described in {IERC20-approve}. Emits an {Approval} event indicating the updated allowance. Requirements: - `spender` cannot be the zero address. - */ increaseAllowance: TypedContractMethod<[spender: AddressLike, addedValue: BigNumberish], [boolean], "nonpayable">; mint: TypedContractMethod<[account: AddressLike, amount: BigNumberish], [void], "nonpayable">; - /** - * Returns the name of the token. - */ name: TypedContractMethod<[], [string], "view">; - /** - * See {IERC20Permit-nonces}. - */ nonces: TypedContractMethod<[owner: AddressLike], [bigint], "view">; - /** - * Get number of checkpoints for `account`. - */ numCheckpoints: TypedContractMethod<[account: AddressLike], [bigint], "view">; - /** - * See {IERC20Permit-permit}. - */ permit: TypedContractMethod< [ owner: AddressLike, @@ -385,24 +322,12 @@ export interface GovToken extends BaseContract { roleStore: TypedContractMethod<[], [string], "view">; - /** - * Returns the symbol of the token, usually a shorter version of the name. - */ symbol: TypedContractMethod<[], [string], "view">; - /** - * See {IERC20-totalSupply}. - */ totalSupply: TypedContractMethod<[], [bigint], "view">; - /** - * See {IERC20-transfer}. Requirements: - `to` cannot be the zero address. - the caller must have a balance of at least `amount`. - */ transfer: TypedContractMethod<[to: AddressLike, amount: BigNumberish], [boolean], "nonpayable">; - /** - * See {IERC20-transferFrom}. Emits an {Approval} event indicating the updated allowance. This is not required by the EIP. See the note at the beginning of {ERC20}. NOTE: Does not update the allowance if the current allowance is the maximum `uint256`. Requirements: - `from` and `to` cannot be the zero address. - `from` must have a balance of at least `amount`. - the caller must have allowance for ``from``'s tokens of at least `amount`. - */ transferFrom: TypedContractMethod< [from: AddressLike, to: AddressLike, amount: BigNumberish], [boolean], diff --git a/src/typechain-types/LayerZeroProvider.ts b/src/typechain-types/LayerZeroProvider.ts new file mode 100644 index 0000000000..f6450a2f6a --- /dev/null +++ b/src/typechain-types/LayerZeroProvider.ts @@ -0,0 +1,221 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace IRelayUtils { + export type BridgeOutParamsStruct = { + token: AddressLike; + amount: BigNumberish; + minAmountOut: BigNumberish; + provider: AddressLike; + data: BytesLike; + }; + + export type BridgeOutParamsStructOutput = [ + token: string, + amount: bigint, + minAmountOut: bigint, + provider: string, + data: string, + ] & { + token: string; + amount: bigint; + minAmountOut: bigint; + provider: string; + data: string; + }; +} + +export interface LayerZeroProviderInterface extends Interface { + getFunction( + nameOrSignature: + | "bridgeOut" + | "dataStore" + | "eventEmitter" + | "lzCompose" + | "multichainGlvRouter" + | "multichainGmRouter" + | "multichainOrderRouter" + | "multichainVault" + | "roleStore" + | "withdrawTokens" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "bridgeOut", + values: [AddressLike, BigNumberish, IRelayUtils.BridgeOutParamsStruct] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData( + functionFragment: "lzCompose", + values: [AddressLike, BytesLike, BytesLike, AddressLike, BytesLike] + ): string; + encodeFunctionData(functionFragment: "multichainGlvRouter", values?: undefined): string; + encodeFunctionData(functionFragment: "multichainGmRouter", values?: undefined): string; + encodeFunctionData(functionFragment: "multichainOrderRouter", values?: undefined): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "withdrawTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + + decodeFunctionResult(functionFragment: "bridgeOut", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "lzCompose", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainGlvRouter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainGmRouter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainOrderRouter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "withdrawTokens", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface LayerZeroProvider extends BaseContract { + connect(runner?: ContractRunner | null): LayerZeroProvider; + waitForDeployment(): Promise; + + interface: LayerZeroProviderInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + bridgeOut: TypedContractMethod< + [account: AddressLike, srcChainId: BigNumberish, params: IRelayUtils.BridgeOutParamsStruct], + [bigint], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + lzCompose: TypedContractMethod< + [from: AddressLike, arg1: BytesLike, message: BytesLike, arg3: AddressLike, arg4: BytesLike], + [void], + "payable" + >; + + multichainGlvRouter: TypedContractMethod<[], [string], "view">; + + multichainGmRouter: TypedContractMethod<[], [string], "view">; + + multichainOrderRouter: TypedContractMethod<[], [string], "view">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + withdrawTokens: TypedContractMethod< + [token: AddressLike, receiver: AddressLike, amount: BigNumberish], + [void], + "nonpayable" + >; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "bridgeOut" + ): TypedContractMethod< + [account: AddressLike, srcChainId: BigNumberish, params: IRelayUtils.BridgeOutParamsStruct], + [bigint], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "lzCompose" + ): TypedContractMethod< + [from: AddressLike, arg1: BytesLike, message: BytesLike, arg3: AddressLike, arg4: BytesLike], + [void], + "payable" + >; + getFunction(nameOrSignature: "multichainGlvRouter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multichainGmRouter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multichainOrderRouter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "withdrawTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "nonpayable">; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/Multicall.ts b/src/typechain-types/Multicall.ts index 46b3b04e5e..a9d100f7b5 100644 --- a/src/typechain-types/Multicall.ts +++ b/src/typechain-types/Multicall.ts @@ -21,7 +21,7 @@ import type { TypedContractMethod, } from "./common"; -export declare namespace Multicall2 { +export declare namespace Multicall3 { export type CallStruct = { target: AddressLike; callData: BytesLike }; export type CallStructOutput = [target: string, callData: string] & { @@ -29,56 +29,88 @@ export declare namespace Multicall2 { callData: string; }; + export type Call3Struct = { + target: AddressLike; + allowFailure: boolean; + callData: BytesLike; + }; + + export type Call3StructOutput = [target: string, allowFailure: boolean, callData: string] & { + target: string; + allowFailure: boolean; + callData: string; + }; + export type ResultStruct = { success: boolean; returnData: BytesLike }; export type ResultStructOutput = [success: boolean, returnData: string] & { success: boolean; returnData: string; }; + + export type Call3ValueStruct = { + target: AddressLike; + allowFailure: boolean; + value: BigNumberish; + callData: BytesLike; + }; + + export type Call3ValueStructOutput = [target: string, allowFailure: boolean, value: bigint, callData: string] & { + target: string; + allowFailure: boolean; + value: bigint; + callData: string; + }; } export interface MulticallInterface extends Interface { getFunction( nameOrSignature: | "aggregate" + | "aggregate3" + | "aggregate3Value" | "blockAndAggregate" + | "getBasefee" | "getBlockHash" | "getBlockNumber" + | "getChainId" | "getCurrentBlockCoinbase" - | "getCurrentBlockDifficulty" | "getCurrentBlockGasLimit" | "getCurrentBlockTimestamp" | "getEthBalance" - | "getL1BlockNumber" | "getLastBlockHash" | "tryAggregate" | "tryBlockAndAggregate" ): FunctionFragment; - encodeFunctionData(functionFragment: "aggregate", values: [Multicall2.CallStruct[]]): string; - encodeFunctionData(functionFragment: "blockAndAggregate", values: [Multicall2.CallStruct[]]): string; + encodeFunctionData(functionFragment: "aggregate", values: [Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: "aggregate3", values: [Multicall3.Call3Struct[]]): string; + encodeFunctionData(functionFragment: "aggregate3Value", values: [Multicall3.Call3ValueStruct[]]): string; + encodeFunctionData(functionFragment: "blockAndAggregate", values: [Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: "getBasefee", values?: undefined): string; encodeFunctionData(functionFragment: "getBlockHash", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "getBlockNumber", values?: undefined): string; + encodeFunctionData(functionFragment: "getChainId", values?: undefined): string; encodeFunctionData(functionFragment: "getCurrentBlockCoinbase", values?: undefined): string; - encodeFunctionData(functionFragment: "getCurrentBlockDifficulty", values?: undefined): string; encodeFunctionData(functionFragment: "getCurrentBlockGasLimit", values?: undefined): string; encodeFunctionData(functionFragment: "getCurrentBlockTimestamp", values?: undefined): string; encodeFunctionData(functionFragment: "getEthBalance", values: [AddressLike]): string; - encodeFunctionData(functionFragment: "getL1BlockNumber", values?: undefined): string; encodeFunctionData(functionFragment: "getLastBlockHash", values?: undefined): string; - encodeFunctionData(functionFragment: "tryAggregate", values: [boolean, Multicall2.CallStruct[]]): string; - encodeFunctionData(functionFragment: "tryBlockAndAggregate", values: [boolean, Multicall2.CallStruct[]]): string; + encodeFunctionData(functionFragment: "tryAggregate", values: [boolean, Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: "tryBlockAndAggregate", values: [boolean, Multicall3.CallStruct[]]): string; decodeFunctionResult(functionFragment: "aggregate", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "aggregate3", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "aggregate3Value", data: BytesLike): Result; decodeFunctionResult(functionFragment: "blockAndAggregate", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getBasefee", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getBlockHash", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getBlockNumber", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "getChainId", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getCurrentBlockCoinbase", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getCurrentBlockDifficulty", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getCurrentBlockGasLimit", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getCurrentBlockTimestamp", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getEthBalance", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "getL1BlockNumber", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getLastBlockHash", data: BytesLike): Result; decodeFunctionResult(functionFragment: "tryAggregate", data: BytesLike): Result; decodeFunctionResult(functionFragment: "tryBlockAndAggregate", data: BytesLike): Result; @@ -118,30 +150,40 @@ export interface Multicall extends BaseContract { removeAllListeners(event?: TCEvent): Promise; aggregate: TypedContractMethod< - [calls: Multicall2.CallStruct[]], + [calls: Multicall3.CallStruct[]], [[bigint, string[]] & { blockNumber: bigint; returnData: string[] }], - "nonpayable" + "payable" + >; + + aggregate3: TypedContractMethod<[calls: Multicall3.Call3Struct[]], [Multicall3.ResultStructOutput[]], "payable">; + + aggregate3Value: TypedContractMethod< + [calls: Multicall3.Call3ValueStruct[]], + [Multicall3.ResultStructOutput[]], + "payable" >; blockAndAggregate: TypedContractMethod< - [calls: Multicall2.CallStruct[]], + [calls: Multicall3.CallStruct[]], [ - [bigint, string, Multicall2.ResultStructOutput[]] & { + [bigint, string, Multicall3.ResultStructOutput[]] & { blockNumber: bigint; blockHash: string; - returnData: Multicall2.ResultStructOutput[]; + returnData: Multicall3.ResultStructOutput[]; }, ], - "nonpayable" + "payable" >; + getBasefee: TypedContractMethod<[], [bigint], "view">; + getBlockHash: TypedContractMethod<[blockNumber: BigNumberish], [string], "view">; getBlockNumber: TypedContractMethod<[], [bigint], "view">; - getCurrentBlockCoinbase: TypedContractMethod<[], [string], "view">; + getChainId: TypedContractMethod<[], [bigint], "view">; - getCurrentBlockDifficulty: TypedContractMethod<[], [bigint], "view">; + getCurrentBlockCoinbase: TypedContractMethod<[], [string], "view">; getCurrentBlockGasLimit: TypedContractMethod<[], [bigint], "view">; @@ -149,26 +191,24 @@ export interface Multicall extends BaseContract { getEthBalance: TypedContractMethod<[addr: AddressLike], [bigint], "view">; - getL1BlockNumber: TypedContractMethod<[], [bigint], "view">; - getLastBlockHash: TypedContractMethod<[], [string], "view">; tryAggregate: TypedContractMethod< - [requireSuccess: boolean, calls: Multicall2.CallStruct[]], - [Multicall2.ResultStructOutput[]], - "nonpayable" + [requireSuccess: boolean, calls: Multicall3.CallStruct[]], + [Multicall3.ResultStructOutput[]], + "payable" >; tryBlockAndAggregate: TypedContractMethod< - [requireSuccess: boolean, calls: Multicall2.CallStruct[]], + [requireSuccess: boolean, calls: Multicall3.CallStruct[]], [ - [bigint, string, Multicall2.ResultStructOutput[]] & { + [bigint, string, Multicall3.ResultStructOutput[]] & { blockNumber: bigint; blockHash: string; - returnData: Multicall2.ResultStructOutput[]; + returnData: Multicall3.ResultStructOutput[]; }, ], - "nonpayable" + "payable" >; getFunction(key: string | FunctionFragment): T; @@ -176,47 +216,53 @@ export interface Multicall extends BaseContract { getFunction( nameOrSignature: "aggregate" ): TypedContractMethod< - [calls: Multicall2.CallStruct[]], + [calls: Multicall3.CallStruct[]], [[bigint, string[]] & { blockNumber: bigint; returnData: string[] }], - "nonpayable" + "payable" >; + getFunction( + nameOrSignature: "aggregate3" + ): TypedContractMethod<[calls: Multicall3.Call3Struct[]], [Multicall3.ResultStructOutput[]], "payable">; + getFunction( + nameOrSignature: "aggregate3Value" + ): TypedContractMethod<[calls: Multicall3.Call3ValueStruct[]], [Multicall3.ResultStructOutput[]], "payable">; getFunction(nameOrSignature: "blockAndAggregate"): TypedContractMethod< - [calls: Multicall2.CallStruct[]], + [calls: Multicall3.CallStruct[]], [ - [bigint, string, Multicall2.ResultStructOutput[]] & { + [bigint, string, Multicall3.ResultStructOutput[]] & { blockNumber: bigint; blockHash: string; - returnData: Multicall2.ResultStructOutput[]; + returnData: Multicall3.ResultStructOutput[]; }, ], - "nonpayable" + "payable" >; + getFunction(nameOrSignature: "getBasefee"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getBlockHash"): TypedContractMethod<[blockNumber: BigNumberish], [string], "view">; getFunction(nameOrSignature: "getBlockNumber"): TypedContractMethod<[], [bigint], "view">; + getFunction(nameOrSignature: "getChainId"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getCurrentBlockCoinbase"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "getCurrentBlockDifficulty"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getCurrentBlockGasLimit"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getCurrentBlockTimestamp"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getEthBalance"): TypedContractMethod<[addr: AddressLike], [bigint], "view">; - getFunction(nameOrSignature: "getL1BlockNumber"): TypedContractMethod<[], [bigint], "view">; getFunction(nameOrSignature: "getLastBlockHash"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "tryAggregate" ): TypedContractMethod< - [requireSuccess: boolean, calls: Multicall2.CallStruct[]], - [Multicall2.ResultStructOutput[]], - "nonpayable" + [requireSuccess: boolean, calls: Multicall3.CallStruct[]], + [Multicall3.ResultStructOutput[]], + "payable" >; getFunction(nameOrSignature: "tryBlockAndAggregate"): TypedContractMethod< - [requireSuccess: boolean, calls: Multicall2.CallStruct[]], + [requireSuccess: boolean, calls: Multicall3.CallStruct[]], [ - [bigint, string, Multicall2.ResultStructOutput[]] & { + [bigint, string, Multicall3.ResultStructOutput[]] & { blockNumber: bigint; blockHash: string; - returnData: Multicall2.ResultStructOutput[]; + returnData: Multicall3.ResultStructOutput[]; }, ], - "nonpayable" + "payable" >; filters: {}; diff --git a/src/typechain-types/MultichainClaimsRouter.ts b/src/typechain-types/MultichainClaimsRouter.ts new file mode 100644 index 0000000000..c6940aa308 --- /dev/null +++ b/src/typechain-types/MultichainClaimsRouter.ts @@ -0,0 +1,464 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; +} + +export interface MultichainClaimsRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "claimAffiliateRewards" + | "claimCollateral" + | "claimFundingFees" + | "dataStore" + | "digests" + | "eventEmitter" + | "externalHandler" + | "multicall" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "swapHandler" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "claimAffiliateRewards", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, AddressLike[], AddressLike[], AddressLike] + ): string; + encodeFunctionData( + functionFragment: "claimCollateral", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + AddressLike[], + AddressLike[], + BigNumberish[], + AddressLike, + ] + ): string; + encodeFunctionData( + functionFragment: "claimFundingFees", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, AddressLike[], AddressLike[], AddressLike] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + + decodeFunctionResult(functionFragment: "claimAffiliateRewards", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "claimCollateral", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "claimFundingFees", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainClaimsRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainClaimsRouter; + waitForDeployment(): Promise; + + interface: MultichainClaimsRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + claimAffiliateRewards: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + + claimCollateral: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + timeKeys: BigNumberish[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + + claimFundingFees: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + swapHandler: TypedContractMethod<[], [string], "view">; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "claimAffiliateRewards" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + getFunction( + nameOrSignature: "claimCollateral" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + timeKeys: BigNumberish[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + getFunction( + nameOrSignature: "claimFundingFees" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + markets: AddressLike[], + tokens: AddressLike[], + receiver: AddressLike, + ], + [bigint[]], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainGlvRouter.ts b/src/typechain-types/MultichainGlvRouter.ts new file mode 100644 index 0000000000..be1882c54f --- /dev/null +++ b/src/typechain-types/MultichainGlvRouter.ts @@ -0,0 +1,581 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type TransferRequestsStruct = { + tokens: AddressLike[]; + receivers: AddressLike[]; + amounts: BigNumberish[]; + }; + + export type TransferRequestsStructOutput = [tokens: string[], receivers: string[], amounts: bigint[]] & { + tokens: string[]; + receivers: string[]; + amounts: bigint[]; + }; +} + +export declare namespace IGlvDepositUtils { + export type CreateGlvDepositParamsAddressesStruct = { + glv: AddressLike; + market: AddressLike; + receiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + initialLongToken: AddressLike; + initialShortToken: AddressLike; + longTokenSwapPath: AddressLike[]; + shortTokenSwapPath: AddressLike[]; + }; + + export type CreateGlvDepositParamsAddressesStructOutput = [ + glv: string, + market: string, + receiver: string, + callbackContract: string, + uiFeeReceiver: string, + initialLongToken: string, + initialShortToken: string, + longTokenSwapPath: string[], + shortTokenSwapPath: string[], + ] & { + glv: string; + market: string; + receiver: string; + callbackContract: string; + uiFeeReceiver: string; + initialLongToken: string; + initialShortToken: string; + longTokenSwapPath: string[]; + shortTokenSwapPath: string[]; + }; + + export type CreateGlvDepositParamsStruct = { + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStruct; + minGlvTokens: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + shouldUnwrapNativeToken: boolean; + isMarketTokenDeposit: boolean; + dataList: BytesLike[]; + }; + + export type CreateGlvDepositParamsStructOutput = [ + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStructOutput, + minGlvTokens: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + shouldUnwrapNativeToken: boolean, + isMarketTokenDeposit: boolean, + dataList: string[], + ] & { + addresses: IGlvDepositUtils.CreateGlvDepositParamsAddressesStructOutput; + minGlvTokens: bigint; + executionFee: bigint; + callbackGasLimit: bigint; + shouldUnwrapNativeToken: boolean; + isMarketTokenDeposit: boolean; + dataList: string[]; + }; +} + +export declare namespace IGlvWithdrawalUtils { + export type CreateGlvWithdrawalParamsAddressesStruct = { + receiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + market: AddressLike; + glv: AddressLike; + longTokenSwapPath: AddressLike[]; + shortTokenSwapPath: AddressLike[]; + }; + + export type CreateGlvWithdrawalParamsAddressesStructOutput = [ + receiver: string, + callbackContract: string, + uiFeeReceiver: string, + market: string, + glv: string, + longTokenSwapPath: string[], + shortTokenSwapPath: string[], + ] & { + receiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + glv: string; + longTokenSwapPath: string[]; + shortTokenSwapPath: string[]; + }; + + export type CreateGlvWithdrawalParamsStruct = { + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStruct; + minLongTokenAmount: BigNumberish; + minShortTokenAmount: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateGlvWithdrawalParamsStructOutput = [ + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStructOutput, + minLongTokenAmount: bigint, + minShortTokenAmount: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddressesStructOutput; + minLongTokenAmount: bigint; + minShortTokenAmount: bigint; + shouldUnwrapNativeToken: boolean; + executionFee: bigint; + callbackGasLimit: bigint; + dataList: string[]; + }; +} + +export interface MultichainGlvRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "createGlvDeposit" + | "createGlvWithdrawal" + | "dataStore" + | "digests" + | "eventEmitter" + | "externalHandler" + | "glvDepositHandler" + | "glvVault" + | "glvWithdrawalHandler" + | "multicall" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "swapHandler" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "createGlvDeposit", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + IRelayUtils.TransferRequestsStruct, + IGlvDepositUtils.CreateGlvDepositParamsStruct, + ] + ): string; + encodeFunctionData( + functionFragment: "createGlvWithdrawal", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + IRelayUtils.TransferRequestsStruct, + IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct, + ] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "glvDepositHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "glvVault", values?: undefined): string; + encodeFunctionData(functionFragment: "glvWithdrawalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + + decodeFunctionResult(functionFragment: "createGlvDeposit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createGlvWithdrawal", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "glvDepositHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "glvVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "glvWithdrawalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainGlvRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainGlvRouter; + waitForDeployment(): Promise; + + interface: MultichainGlvRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + createGlvDeposit: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IGlvDepositUtils.CreateGlvDepositParamsStruct, + ], + [string], + "nonpayable" + >; + + createGlvWithdrawal: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct, + ], + [string], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + glvDepositHandler: TypedContractMethod<[], [string], "view">; + + glvVault: TypedContractMethod<[], [string], "view">; + + glvWithdrawalHandler: TypedContractMethod<[], [string], "view">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + swapHandler: TypedContractMethod<[], [string], "view">; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "createGlvDeposit" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IGlvDepositUtils.CreateGlvDepositParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "createGlvWithdrawal" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IGlvWithdrawalUtils.CreateGlvWithdrawalParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "glvDepositHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "glvVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "glvWithdrawalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainGmRouter.ts b/src/typechain-types/MultichainGmRouter.ts new file mode 100644 index 0000000000..9aa7da5170 --- /dev/null +++ b/src/typechain-types/MultichainGmRouter.ts @@ -0,0 +1,673 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type TransferRequestsStruct = { + tokens: AddressLike[]; + receivers: AddressLike[]; + amounts: BigNumberish[]; + }; + + export type TransferRequestsStructOutput = [tokens: string[], receivers: string[], amounts: bigint[]] & { + tokens: string[]; + receivers: string[]; + amounts: bigint[]; + }; +} + +export declare namespace IDepositUtils { + export type CreateDepositParamsAddressesStruct = { + receiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + market: AddressLike; + initialLongToken: AddressLike; + initialShortToken: AddressLike; + longTokenSwapPath: AddressLike[]; + shortTokenSwapPath: AddressLike[]; + }; + + export type CreateDepositParamsAddressesStructOutput = [ + receiver: string, + callbackContract: string, + uiFeeReceiver: string, + market: string, + initialLongToken: string, + initialShortToken: string, + longTokenSwapPath: string[], + shortTokenSwapPath: string[], + ] & { + receiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + initialLongToken: string; + initialShortToken: string; + longTokenSwapPath: string[]; + shortTokenSwapPath: string[]; + }; + + export type CreateDepositParamsStruct = { + addresses: IDepositUtils.CreateDepositParamsAddressesStruct; + minMarketTokens: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateDepositParamsStructOutput = [ + addresses: IDepositUtils.CreateDepositParamsAddressesStructOutput, + minMarketTokens: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IDepositUtils.CreateDepositParamsAddressesStructOutput; + minMarketTokens: bigint; + shouldUnwrapNativeToken: boolean; + executionFee: bigint; + callbackGasLimit: bigint; + dataList: string[]; + }; +} + +export declare namespace IShiftUtils { + export type CreateShiftParamsAddressesStruct = { + receiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + fromMarket: AddressLike; + toMarket: AddressLike; + }; + + export type CreateShiftParamsAddressesStructOutput = [ + receiver: string, + callbackContract: string, + uiFeeReceiver: string, + fromMarket: string, + toMarket: string, + ] & { + receiver: string; + callbackContract: string; + uiFeeReceiver: string; + fromMarket: string; + toMarket: string; + }; + + export type CreateShiftParamsStruct = { + addresses: IShiftUtils.CreateShiftParamsAddressesStruct; + minMarketTokens: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateShiftParamsStructOutput = [ + addresses: IShiftUtils.CreateShiftParamsAddressesStructOutput, + minMarketTokens: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IShiftUtils.CreateShiftParamsAddressesStructOutput; + minMarketTokens: bigint; + executionFee: bigint; + callbackGasLimit: bigint; + dataList: string[]; + }; +} + +export declare namespace IWithdrawalUtils { + export type CreateWithdrawalParamsAddressesStruct = { + receiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + market: AddressLike; + longTokenSwapPath: AddressLike[]; + shortTokenSwapPath: AddressLike[]; + }; + + export type CreateWithdrawalParamsAddressesStructOutput = [ + receiver: string, + callbackContract: string, + uiFeeReceiver: string, + market: string, + longTokenSwapPath: string[], + shortTokenSwapPath: string[], + ] & { + receiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + longTokenSwapPath: string[]; + shortTokenSwapPath: string[]; + }; + + export type CreateWithdrawalParamsStruct = { + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStruct; + minLongTokenAmount: BigNumberish; + minShortTokenAmount: BigNumberish; + shouldUnwrapNativeToken: boolean; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + dataList: BytesLike[]; + }; + + export type CreateWithdrawalParamsStructOutput = [ + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStructOutput, + minLongTokenAmount: bigint, + minShortTokenAmount: bigint, + shouldUnwrapNativeToken: boolean, + executionFee: bigint, + callbackGasLimit: bigint, + dataList: string[], + ] & { + addresses: IWithdrawalUtils.CreateWithdrawalParamsAddressesStructOutput; + minLongTokenAmount: bigint; + minShortTokenAmount: bigint; + shouldUnwrapNativeToken: boolean; + executionFee: bigint; + callbackGasLimit: bigint; + dataList: string[]; + }; +} + +export interface MultichainGmRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "createDeposit" + | "createShift" + | "createWithdrawal" + | "dataStore" + | "depositHandler" + | "depositVault" + | "digests" + | "eventEmitter" + | "externalHandler" + | "multicall" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "shiftHandler" + | "shiftVault" + | "swapHandler" + | "withdrawalHandler" + | "withdrawalVault" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "createDeposit", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + IRelayUtils.TransferRequestsStruct, + IDepositUtils.CreateDepositParamsStruct, + ] + ): string; + encodeFunctionData( + functionFragment: "createShift", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + IRelayUtils.TransferRequestsStruct, + IShiftUtils.CreateShiftParamsStruct, + ] + ): string; + encodeFunctionData( + functionFragment: "createWithdrawal", + values: [ + IRelayUtils.RelayParamsStruct, + AddressLike, + BigNumberish, + IRelayUtils.TransferRequestsStruct, + IWithdrawalUtils.CreateWithdrawalParamsStruct, + ] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "depositHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "depositVault", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "shiftHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "shiftVault", values?: undefined): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "withdrawalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "withdrawalVault", values?: undefined): string; + + decodeFunctionResult(functionFragment: "createDeposit", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createShift", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createWithdrawal", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "depositHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "depositVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "shiftHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "shiftVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "withdrawalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "withdrawalVault", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainGmRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainGmRouter; + waitForDeployment(): Promise; + + interface: MultichainGmRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + createDeposit: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IDepositUtils.CreateDepositParamsStruct, + ], + [string], + "nonpayable" + >; + + createShift: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IShiftUtils.CreateShiftParamsStruct, + ], + [string], + "nonpayable" + >; + + createWithdrawal: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IWithdrawalUtils.CreateWithdrawalParamsStruct, + ], + [string], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + depositHandler: TypedContractMethod<[], [string], "view">; + + depositVault: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + shiftHandler: TypedContractMethod<[], [string], "view">; + + shiftVault: TypedContractMethod<[], [string], "view">; + + swapHandler: TypedContractMethod<[], [string], "view">; + + withdrawalHandler: TypedContractMethod<[], [string], "view">; + + withdrawalVault: TypedContractMethod<[], [string], "view">; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "createDeposit" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IDepositUtils.CreateDepositParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "createShift" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IShiftUtils.CreateShiftParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction( + nameOrSignature: "createWithdrawal" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + transferRequests: IRelayUtils.TransferRequestsStruct, + params: IWithdrawalUtils.CreateWithdrawalParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "depositHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "depositVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "shiftHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "shiftVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "withdrawalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "withdrawalVault"): TypedContractMethod<[], [string], "view">; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainOrderRouter.ts b/src/typechain-types/MultichainOrderRouter.ts new file mode 100644 index 0000000000..e32bc6cd0e --- /dev/null +++ b/src/typechain-types/MultichainOrderRouter.ts @@ -0,0 +1,638 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type UpdateOrderParamsStruct = { + key: BytesLike; + sizeDeltaUsd: BigNumberish; + acceptablePrice: BigNumberish; + triggerPrice: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + autoCancel: boolean; + executionFeeIncrease: BigNumberish; + }; + + export type UpdateOrderParamsStructOutput = [ + key: string, + sizeDeltaUsd: bigint, + acceptablePrice: bigint, + triggerPrice: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + autoCancel: boolean, + executionFeeIncrease: bigint, + ] & { + key: string; + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + autoCancel: boolean; + executionFeeIncrease: bigint; + }; + + export type BatchParamsStruct = { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStruct[]; + cancelOrderKeys: BytesLike[]; + }; + + export type BatchParamsStructOutput = [ + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[], + cancelOrderKeys: string[], + ] & { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[]; + cancelOrderKeys: string[]; + }; +} + +export declare namespace IBaseOrderUtils { + export type CreateOrderParamsAddressesStruct = { + receiver: AddressLike; + cancellationReceiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + market: AddressLike; + initialCollateralToken: AddressLike; + swapPath: AddressLike[]; + }; + + export type CreateOrderParamsAddressesStructOutput = [ + receiver: string, + cancellationReceiver: string, + callbackContract: string, + uiFeeReceiver: string, + market: string, + initialCollateralToken: string, + swapPath: string[], + ] & { + receiver: string; + cancellationReceiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + initialCollateralToken: string; + swapPath: string[]; + }; + + export type CreateOrderParamsNumbersStruct = { + sizeDeltaUsd: BigNumberish; + initialCollateralDeltaAmount: BigNumberish; + triggerPrice: BigNumberish; + acceptablePrice: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + }; + + export type CreateOrderParamsNumbersStructOutput = [ + sizeDeltaUsd: bigint, + initialCollateralDeltaAmount: bigint, + triggerPrice: bigint, + acceptablePrice: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + ] & { + sizeDeltaUsd: bigint; + initialCollateralDeltaAmount: bigint; + triggerPrice: bigint; + acceptablePrice: bigint; + executionFee: bigint; + callbackGasLimit: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + }; + + export type CreateOrderParamsStruct = { + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStruct; + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStruct; + orderType: BigNumberish; + decreasePositionSwapType: BigNumberish; + isLong: boolean; + shouldUnwrapNativeToken: boolean; + autoCancel: boolean; + referralCode: BytesLike; + dataList: BytesLike[]; + }; + + export type CreateOrderParamsStructOutput = [ + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput, + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput, + orderType: bigint, + decreasePositionSwapType: bigint, + isLong: boolean, + shouldUnwrapNativeToken: boolean, + autoCancel: boolean, + referralCode: string, + dataList: string[], + ] & { + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; + orderType: bigint; + decreasePositionSwapType: bigint; + isLong: boolean; + shouldUnwrapNativeToken: boolean; + autoCancel: boolean; + referralCode: string; + dataList: string[]; + }; +} + +export interface MultichainOrderRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "batch" + | "cancelOrder" + | "createOrder" + | "dataStore" + | "digests" + | "eventEmitter" + | "externalHandler" + | "multicall" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "referralStorage" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "setTraderReferralCode" + | "swapHandler" + | "updateOrder" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "batch", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, IRelayUtils.BatchParamsStruct] + ): string; + encodeFunctionData( + functionFragment: "cancelOrder", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "createOrder", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, IBaseOrderUtils.CreateOrderParamsStruct] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "referralStorage", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData( + functionFragment: "setTraderReferralCode", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, BytesLike] + ): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + encodeFunctionData( + functionFragment: "updateOrder", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, IRelayUtils.UpdateOrderParamsStruct] + ): string; + + decodeFunctionResult(functionFragment: "batch", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "cancelOrder", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createOrder", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "referralStorage", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "setTraderReferralCode", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "updateOrder", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainOrderRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainOrderRouter; + waitForDeployment(): Promise; + + interface: MultichainOrderRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + batch: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.BatchParamsStruct, + ], + [string[]], + "nonpayable" + >; + + cancelOrder: TypedContractMethod< + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, srcChainId: BigNumberish, key: BytesLike], + [void], + "nonpayable" + >; + + createOrder: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IBaseOrderUtils.CreateOrderParamsStruct, + ], + [string], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + referralStorage: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + setTraderReferralCode: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + referralCode: BytesLike, + ], + [void], + "nonpayable" + >; + + swapHandler: TypedContractMethod<[], [string], "view">; + + updateOrder: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.UpdateOrderParamsStruct, + ], + [void], + "nonpayable" + >; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "batch" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.BatchParamsStruct, + ], + [string[]], + "nonpayable" + >; + getFunction( + nameOrSignature: "cancelOrder" + ): TypedContractMethod< + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, srcChainId: BigNumberish, key: BytesLike], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "createOrder" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IBaseOrderUtils.CreateOrderParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "referralStorage"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "setTraderReferralCode" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + referralCode: BytesLike, + ], + [void], + "nonpayable" + >; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "updateOrder" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.UpdateOrderParamsStruct, + ], + [void], + "nonpayable" + >; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainSubaccountRouter.ts b/src/typechain-types/MultichainSubaccountRouter.ts new file mode 100644 index 0000000000..edbc3738e7 --- /dev/null +++ b/src/typechain-types/MultichainSubaccountRouter.ts @@ -0,0 +1,722 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export type SubaccountApprovalStruct = { + subaccount: AddressLike; + shouldAdd: boolean; + expiresAt: BigNumberish; + maxAllowedCount: BigNumberish; + actionType: BytesLike; + nonce: BigNumberish; + desChainId: BigNumberish; + deadline: BigNumberish; + integrationId: BytesLike; + signature: BytesLike; +}; + +export type SubaccountApprovalStructOutput = [ + subaccount: string, + shouldAdd: boolean, + expiresAt: bigint, + maxAllowedCount: bigint, + actionType: string, + nonce: bigint, + desChainId: bigint, + deadline: bigint, + integrationId: string, + signature: string, +] & { + subaccount: string; + shouldAdd: boolean; + expiresAt: bigint; + maxAllowedCount: bigint; + actionType: string; + nonce: bigint; + desChainId: bigint; + deadline: bigint; + integrationId: string; + signature: string; +}; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type UpdateOrderParamsStruct = { + key: BytesLike; + sizeDeltaUsd: BigNumberish; + acceptablePrice: BigNumberish; + triggerPrice: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + autoCancel: boolean; + executionFeeIncrease: BigNumberish; + }; + + export type UpdateOrderParamsStructOutput = [ + key: string, + sizeDeltaUsd: bigint, + acceptablePrice: bigint, + triggerPrice: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + autoCancel: boolean, + executionFeeIncrease: bigint, + ] & { + key: string; + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + autoCancel: boolean; + executionFeeIncrease: bigint; + }; + + export type BatchParamsStruct = { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStruct[]; + cancelOrderKeys: BytesLike[]; + }; + + export type BatchParamsStructOutput = [ + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[], + cancelOrderKeys: string[], + ] & { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[]; + cancelOrderKeys: string[]; + }; +} + +export declare namespace IBaseOrderUtils { + export type CreateOrderParamsAddressesStruct = { + receiver: AddressLike; + cancellationReceiver: AddressLike; + callbackContract: AddressLike; + uiFeeReceiver: AddressLike; + market: AddressLike; + initialCollateralToken: AddressLike; + swapPath: AddressLike[]; + }; + + export type CreateOrderParamsAddressesStructOutput = [ + receiver: string, + cancellationReceiver: string, + callbackContract: string, + uiFeeReceiver: string, + market: string, + initialCollateralToken: string, + swapPath: string[], + ] & { + receiver: string; + cancellationReceiver: string; + callbackContract: string; + uiFeeReceiver: string; + market: string; + initialCollateralToken: string; + swapPath: string[]; + }; + + export type CreateOrderParamsNumbersStruct = { + sizeDeltaUsd: BigNumberish; + initialCollateralDeltaAmount: BigNumberish; + triggerPrice: BigNumberish; + acceptablePrice: BigNumberish; + executionFee: BigNumberish; + callbackGasLimit: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + }; + + export type CreateOrderParamsNumbersStructOutput = [ + sizeDeltaUsd: bigint, + initialCollateralDeltaAmount: bigint, + triggerPrice: bigint, + acceptablePrice: bigint, + executionFee: bigint, + callbackGasLimit: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + ] & { + sizeDeltaUsd: bigint; + initialCollateralDeltaAmount: bigint; + triggerPrice: bigint; + acceptablePrice: bigint; + executionFee: bigint; + callbackGasLimit: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + }; + + export type CreateOrderParamsStruct = { + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStruct; + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStruct; + orderType: BigNumberish; + decreasePositionSwapType: BigNumberish; + isLong: boolean; + shouldUnwrapNativeToken: boolean; + autoCancel: boolean; + referralCode: BytesLike; + dataList: BytesLike[]; + }; + + export type CreateOrderParamsStructOutput = [ + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput, + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput, + orderType: bigint, + decreasePositionSwapType: bigint, + isLong: boolean, + shouldUnwrapNativeToken: boolean, + autoCancel: boolean, + referralCode: string, + dataList: string[], + ] & { + addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; + numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; + orderType: bigint; + decreasePositionSwapType: bigint; + isLong: boolean; + shouldUnwrapNativeToken: boolean; + autoCancel: boolean; + referralCode: string; + dataList: string[]; + }; +} + +export interface MultichainSubaccountRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "batch" + | "cancelOrder" + | "createOrder" + | "dataStore" + | "digests" + | "eventEmitter" + | "externalHandler" + | "multicall" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "removeSubaccount" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "subaccountApprovalNonces" + | "swapHandler" + | "updateOrder" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData( + functionFragment: "batch", + values: [ + IRelayUtils.RelayParamsStruct, + SubaccountApprovalStruct, + AddressLike, + BigNumberish, + AddressLike, + IRelayUtils.BatchParamsStruct, + ] + ): string; + encodeFunctionData( + functionFragment: "cancelOrder", + values: [IRelayUtils.RelayParamsStruct, SubaccountApprovalStruct, AddressLike, BigNumberish, AddressLike, BytesLike] + ): string; + encodeFunctionData( + functionFragment: "createOrder", + values: [ + IRelayUtils.RelayParamsStruct, + SubaccountApprovalStruct, + AddressLike, + BigNumberish, + AddressLike, + IBaseOrderUtils.CreateOrderParamsStruct, + ] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData( + functionFragment: "removeSubaccount", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, AddressLike] + ): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "subaccountApprovalNonces", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + encodeFunctionData( + functionFragment: "updateOrder", + values: [ + IRelayUtils.RelayParamsStruct, + SubaccountApprovalStruct, + AddressLike, + BigNumberish, + AddressLike, + IRelayUtils.UpdateOrderParamsStruct, + ] + ): string; + + decodeFunctionResult(functionFragment: "batch", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "cancelOrder", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "createOrder", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "removeSubaccount", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "subaccountApprovalNonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "updateOrder", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainSubaccountRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainSubaccountRouter; + waitForDeployment(): Promise; + + interface: MultichainSubaccountRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + batch: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IRelayUtils.BatchParamsStruct, + ], + [string[]], + "nonpayable" + >; + + cancelOrder: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + key: BytesLike, + ], + [void], + "nonpayable" + >; + + createOrder: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IBaseOrderUtils.CreateOrderParamsStruct, + ], + [string], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + removeSubaccount: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + ], + [void], + "nonpayable" + >; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + subaccountApprovalNonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + swapHandler: TypedContractMethod<[], [string], "view">; + + updateOrder: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IRelayUtils.UpdateOrderParamsStruct, + ], + [void], + "nonpayable" + >; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "batch" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IRelayUtils.BatchParamsStruct, + ], + [string[]], + "nonpayable" + >; + getFunction( + nameOrSignature: "cancelOrder" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + key: BytesLike, + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "createOrder" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IBaseOrderUtils.CreateOrderParamsStruct, + ], + [string], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "removeSubaccount" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + ], + [void], + "nonpayable" + >; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "subaccountApprovalNonces"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "updateOrder" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + subaccountApproval: SubaccountApprovalStruct, + account: AddressLike, + srcChainId: BigNumberish, + subaccount: AddressLike, + params: IRelayUtils.UpdateOrderParamsStruct, + ], + [void], + "nonpayable" + >; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainTransferRouter.ts b/src/typechain-types/MultichainTransferRouter.ts new file mode 100644 index 0000000000..b5f30a817d --- /dev/null +++ b/src/typechain-types/MultichainTransferRouter.ts @@ -0,0 +1,493 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export declare namespace MultichainRouter { + export type BaseConstructorParamsStruct = { + router: AddressLike; + roleStore: AddressLike; + dataStore: AddressLike; + eventEmitter: AddressLike; + oracle: AddressLike; + orderVault: AddressLike; + orderHandler: AddressLike; + swapHandler: AddressLike; + externalHandler: AddressLike; + multichainVault: AddressLike; + }; + + export type BaseConstructorParamsStructOutput = [ + router: string, + roleStore: string, + dataStore: string, + eventEmitter: string, + oracle: string, + orderVault: string, + orderHandler: string, + swapHandler: string, + externalHandler: string, + multichainVault: string, + ] & { + router: string; + roleStore: string; + dataStore: string; + eventEmitter: string; + oracle: string; + orderVault: string; + orderHandler: string; + swapHandler: string; + externalHandler: string; + multichainVault: string; + }; +} + +export declare namespace OracleUtils { + export type SetPricesParamsStruct = { + tokens: AddressLike[]; + providers: AddressLike[]; + data: BytesLike[]; + }; + + export type SetPricesParamsStructOutput = [tokens: string[], providers: string[], data: string[]] & { + tokens: string[]; + providers: string[]; + data: string[]; + }; +} + +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type BridgeOutParamsStruct = { + token: AddressLike; + amount: BigNumberish; + minAmountOut: BigNumberish; + provider: AddressLike; + data: BytesLike; + }; + + export type BridgeOutParamsStructOutput = [ + token: string, + amount: bigint, + minAmountOut: bigint, + provider: string, + data: string, + ] & { + token: string; + amount: bigint; + minAmountOut: bigint; + provider: string; + data: string; + }; +} + +export interface MultichainTransferRouterInterface extends Interface { + getFunction( + nameOrSignature: + | "bridgeIn" + | "bridgeOut" + | "bridgeOutFromController" + | "dataStore" + | "digests" + | "eventEmitter" + | "externalHandler" + | "initialize" + | "multicall" + | "multichainProvider" + | "multichainVault" + | "oracle" + | "orderHandler" + | "orderVault" + | "roleStore" + | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" + | "swapHandler" + | "transferOut" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "Initialized" | "TokenTransferReverted"): EventFragment; + + encodeFunctionData(functionFragment: "bridgeIn", values: [AddressLike, AddressLike]): string; + encodeFunctionData( + functionFragment: "bridgeOut", + values: [IRelayUtils.RelayParamsStruct, AddressLike, BigNumberish, IRelayUtils.BridgeOutParamsStruct] + ): string; + encodeFunctionData( + functionFragment: "bridgeOutFromController", + values: [AddressLike, BigNumberish, BigNumberish, BigNumberish, IRelayUtils.BridgeOutParamsStruct] + ): string; + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; + encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; + encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "initialize", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; + encodeFunctionData(functionFragment: "multichainProvider", values?: undefined): string; + encodeFunctionData(functionFragment: "multichainVault", values?: undefined): string; + encodeFunctionData(functionFragment: "oracle", values?: undefined): string; + encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "transferOut", values: [IRelayUtils.BridgeOutParamsStruct]): string; + + decodeFunctionResult(functionFragment: "bridgeIn", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "bridgeOut", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "bridgeOutFromController", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainProvider", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multichainVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "transferOut", data: BytesLike): Result; +} + +export namespace InitializedEvent { + export type InputTuple = [version: BigNumberish]; + export type OutputTuple = [version: bigint]; + export interface OutputObject { + version: bigint; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainTransferRouter extends BaseContract { + connect(runner?: ContractRunner | null): MultichainTransferRouter; + waitForDeployment(): Promise; + + interface: MultichainTransferRouterInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + bridgeIn: TypedContractMethod<[account: AddressLike, token: AddressLike], [void], "payable">; + + bridgeOut: TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.BridgeOutParamsStruct, + ], + [void], + "nonpayable" + >; + + bridgeOutFromController: TypedContractMethod< + [ + account: AddressLike, + srcChainId: BigNumberish, + desChainId: BigNumberish, + deadline: BigNumberish, + params: IRelayUtils.BridgeOutParamsStruct, + ], + [void], + "nonpayable" + >; + + dataStore: TypedContractMethod<[], [string], "view">; + + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + + eventEmitter: TypedContractMethod<[], [string], "view">; + + externalHandler: TypedContractMethod<[], [string], "view">; + + initialize: TypedContractMethod<[_multichainProvider: AddressLike], [void], "nonpayable">; + + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + + multichainProvider: TypedContractMethod<[], [string], "view">; + + multichainVault: TypedContractMethod<[], [string], "view">; + + oracle: TypedContractMethod<[], [string], "view">; + + orderHandler: TypedContractMethod<[], [string], "view">; + + orderVault: TypedContractMethod<[], [string], "view">; + + roleStore: TypedContractMethod<[], [string], "view">; + + router: TypedContractMethod<[], [string], "view">; + + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + swapHandler: TypedContractMethod<[], [string], "view">; + + transferOut: TypedContractMethod<[params: IRelayUtils.BridgeOutParamsStruct], [void], "nonpayable">; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "bridgeIn" + ): TypedContractMethod<[account: AddressLike, token: AddressLike], [void], "payable">; + getFunction( + nameOrSignature: "bridgeOut" + ): TypedContractMethod< + [ + relayParams: IRelayUtils.RelayParamsStruct, + account: AddressLike, + srcChainId: BigNumberish, + params: IRelayUtils.BridgeOutParamsStruct, + ], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "bridgeOutFromController" + ): TypedContractMethod< + [ + account: AddressLike, + srcChainId: BigNumberish, + desChainId: BigNumberish, + deadline: BigNumberish, + params: IRelayUtils.BridgeOutParamsStruct, + ], + [void], + "nonpayable" + >; + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "initialize" + ): TypedContractMethod<[_multichainProvider: AddressLike], [void], "nonpayable">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + getFunction(nameOrSignature: "multichainProvider"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multichainVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "transferOut" + ): TypedContractMethod<[params: IRelayUtils.BridgeOutParamsStruct], [void], "nonpayable">; + + getEvent( + key: "Initialized" + ): TypedContractEvent; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "Initialized(uint8)": TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + Initialized: TypedContractEvent< + InitializedEvent.InputTuple, + InitializedEvent.OutputTuple, + InitializedEvent.OutputObject + >; + + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/MultichainUtils.ts b/src/typechain-types/MultichainUtils.ts new file mode 100644 index 0000000000..412447a926 --- /dev/null +++ b/src/typechain-types/MultichainUtils.ts @@ -0,0 +1,96 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BytesLike, + FunctionFragment, + Result, + Interface, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface MultichainUtilsInterface extends Interface { + getFunction( + nameOrSignature: "getMultichainBalanceAmount" | "validateMultichainEndpoint" | "validateMultichainProvider" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "getMultichainBalanceAmount", + values: [AddressLike, AddressLike, AddressLike] + ): string; + encodeFunctionData(functionFragment: "validateMultichainEndpoint", values: [AddressLike, AddressLike]): string; + encodeFunctionData(functionFragment: "validateMultichainProvider", values: [AddressLike, AddressLike]): string; + + decodeFunctionResult(functionFragment: "getMultichainBalanceAmount", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "validateMultichainEndpoint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "validateMultichainProvider", data: BytesLike): Result; +} + +export interface MultichainUtils extends BaseContract { + connect(runner?: ContractRunner | null): MultichainUtils; + waitForDeployment(): Promise; + + interface: MultichainUtilsInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + getMultichainBalanceAmount: TypedContractMethod< + [dataStore: AddressLike, account: AddressLike, token: AddressLike], + [bigint], + "view" + >; + + validateMultichainEndpoint: TypedContractMethod<[dataStore: AddressLike, endpoint: AddressLike], [void], "view">; + + validateMultichainProvider: TypedContractMethod<[dataStore: AddressLike, provider: AddressLike], [void], "view">; + + getFunction(key: string | FunctionFragment): T; + + getFunction( + nameOrSignature: "getMultichainBalanceAmount" + ): TypedContractMethod<[dataStore: AddressLike, account: AddressLike, token: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "validateMultichainEndpoint" + ): TypedContractMethod<[dataStore: AddressLike, endpoint: AddressLike], [void], "view">; + getFunction( + nameOrSignature: "validateMultichainProvider" + ): TypedContractMethod<[dataStore: AddressLike, provider: AddressLike], [void], "view">; + + filters: {}; +} diff --git a/src/typechain-types/MultichainVault.ts b/src/typechain-types/MultichainVault.ts new file mode 100644 index 0000000000..10d4d35f73 --- /dev/null +++ b/src/typechain-types/MultichainVault.ts @@ -0,0 +1,177 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumberish, + BytesLike, + FunctionFragment, + Result, + Interface, + EventFragment, + AddressLike, + ContractRunner, + ContractMethod, + Listener, +} from "ethers"; +import type { + TypedContractEvent, + TypedDeferredTopicFilter, + TypedEventLog, + TypedLogDescription, + TypedListener, + TypedContractMethod, +} from "./common"; + +export interface MultichainVaultInterface extends Interface { + getFunction( + nameOrSignature: + | "dataStore" + | "recordTransferIn" + | "roleStore" + | "syncTokenBalance" + | "tokenBalances" + | "transferOut(address,address,uint256)" + | "transferOut(address,address,uint256,bool)" + | "transferOutNativeToken" + ): FunctionFragment; + + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + + encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "recordTransferIn", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; + encodeFunctionData(functionFragment: "syncTokenBalance", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "tokenBalances", values: [AddressLike]): string; + encodeFunctionData( + functionFragment: "transferOut(address,address,uint256)", + values: [AddressLike, AddressLike, BigNumberish] + ): string; + encodeFunctionData( + functionFragment: "transferOut(address,address,uint256,bool)", + values: [AddressLike, AddressLike, BigNumberish, boolean] + ): string; + encodeFunctionData(functionFragment: "transferOutNativeToken", values: [AddressLike, BigNumberish]): string; + + decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "recordTransferIn", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "syncTokenBalance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "tokenBalances", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "transferOut(address,address,uint256)", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "transferOut(address,address,uint256,bool)", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "transferOutNativeToken", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + +export interface MultichainVault extends BaseContract { + connect(runner?: ContractRunner | null): MultichainVault; + waitForDeployment(): Promise; + + interface: MultichainVaultInterface; + + queryFilter( + event: TCEvent, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + queryFilter( + filter: TypedDeferredTopicFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>>; + + on(event: TCEvent, listener: TypedListener): Promise; + on( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + once(event: TCEvent, listener: TypedListener): Promise; + once( + filter: TypedDeferredTopicFilter, + listener: TypedListener + ): Promise; + + listeners(event: TCEvent): Promise>>; + listeners(eventName?: string): Promise>; + removeAllListeners(event?: TCEvent): Promise; + + dataStore: TypedContractMethod<[], [string], "view">; + + recordTransferIn: TypedContractMethod<[token: AddressLike], [bigint], "nonpayable">; + + roleStore: TypedContractMethod<[], [string], "view">; + + syncTokenBalance: TypedContractMethod<[token: AddressLike], [bigint], "nonpayable">; + + tokenBalances: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + + "transferOut(address,address,uint256)": TypedContractMethod< + [token: AddressLike, receiver: AddressLike, amount: BigNumberish], + [void], + "nonpayable" + >; + + "transferOut(address,address,uint256,bool)": TypedContractMethod< + [token: AddressLike, receiver: AddressLike, amount: BigNumberish, shouldUnwrapNativeToken: boolean], + [void], + "nonpayable" + >; + + transferOutNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "nonpayable">; + + getFunction(key: string | FunctionFragment): T; + + getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "recordTransferIn"): TypedContractMethod<[token: AddressLike], [bigint], "nonpayable">; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "syncTokenBalance"): TypedContractMethod<[token: AddressLike], [bigint], "nonpayable">; + getFunction(nameOrSignature: "tokenBalances"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction( + nameOrSignature: "transferOut(address,address,uint256)" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "nonpayable">; + getFunction( + nameOrSignature: "transferOut(address,address,uint256,bool)" + ): TypedContractMethod< + [token: AddressLike, receiver: AddressLike, amount: BigNumberish, shouldUnwrapNativeToken: boolean], + [void], + "nonpayable" + >; + getFunction( + nameOrSignature: "transferOutNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "nonpayable">; + + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; +} diff --git a/src/typechain-types/ReferralStorage.ts b/src/typechain-types/ReferralStorage.ts index 850d83f422..e36984e909 100644 --- a/src/typechain-types/ReferralStorage.ts +++ b/src/typechain-types/ReferralStorage.ts @@ -27,16 +27,17 @@ export interface ReferralStorageInterface extends Interface { getFunction( nameOrSignature: | "BASIS_POINTS" + | "acceptOwnership" | "codeOwners" | "getTraderReferralInfo" | "gov" | "govSetCodeOwner" | "isHandler" + | "pendingGov" | "referrerDiscountShares" | "referrerTiers" | "registerCode" | "setCodeOwner" - | "setGov" | "setHandler" | "setReferrerDiscountShare" | "setReferrerTier" @@ -45,6 +46,7 @@ export interface ReferralStorageInterface extends Interface { | "setTraderReferralCodeByUser" | "tiers" | "traderReferralCodes" + | "transferOwnership" ): FunctionFragment; getEvent( @@ -52,6 +54,7 @@ export interface ReferralStorageInterface extends Interface { | "GovSetCodeOwner" | "RegisterCode" | "SetCodeOwner" + | "SetGov" | "SetHandler" | "SetReferrerDiscountShare" | "SetReferrerTier" @@ -60,16 +63,17 @@ export interface ReferralStorageInterface extends Interface { ): EventFragment; encodeFunctionData(functionFragment: "BASIS_POINTS", values?: undefined): string; + encodeFunctionData(functionFragment: "acceptOwnership", values?: undefined): string; encodeFunctionData(functionFragment: "codeOwners", values: [BytesLike]): string; encodeFunctionData(functionFragment: "getTraderReferralInfo", values: [AddressLike]): string; encodeFunctionData(functionFragment: "gov", values?: undefined): string; encodeFunctionData(functionFragment: "govSetCodeOwner", values: [BytesLike, AddressLike]): string; encodeFunctionData(functionFragment: "isHandler", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "pendingGov", values?: undefined): string; encodeFunctionData(functionFragment: "referrerDiscountShares", values: [AddressLike]): string; encodeFunctionData(functionFragment: "referrerTiers", values: [AddressLike]): string; encodeFunctionData(functionFragment: "registerCode", values: [BytesLike]): string; encodeFunctionData(functionFragment: "setCodeOwner", values: [BytesLike, AddressLike]): string; - encodeFunctionData(functionFragment: "setGov", values: [AddressLike]): string; encodeFunctionData(functionFragment: "setHandler", values: [AddressLike, boolean]): string; encodeFunctionData(functionFragment: "setReferrerDiscountShare", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "setReferrerTier", values: [AddressLike, BigNumberish]): string; @@ -78,18 +82,20 @@ export interface ReferralStorageInterface extends Interface { encodeFunctionData(functionFragment: "setTraderReferralCodeByUser", values: [BytesLike]): string; encodeFunctionData(functionFragment: "tiers", values: [BigNumberish]): string; encodeFunctionData(functionFragment: "traderReferralCodes", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "transferOwnership", values: [AddressLike]): string; decodeFunctionResult(functionFragment: "BASIS_POINTS", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "acceptOwnership", data: BytesLike): Result; decodeFunctionResult(functionFragment: "codeOwners", data: BytesLike): Result; decodeFunctionResult(functionFragment: "getTraderReferralInfo", data: BytesLike): Result; decodeFunctionResult(functionFragment: "gov", data: BytesLike): Result; decodeFunctionResult(functionFragment: "govSetCodeOwner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "isHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pendingGov", data: BytesLike): Result; decodeFunctionResult(functionFragment: "referrerDiscountShares", data: BytesLike): Result; decodeFunctionResult(functionFragment: "referrerTiers", data: BytesLike): Result; decodeFunctionResult(functionFragment: "registerCode", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setCodeOwner", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "setGov", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setReferrerDiscountShare", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setReferrerTier", data: BytesLike): Result; @@ -98,6 +104,7 @@ export interface ReferralStorageInterface extends Interface { decodeFunctionResult(functionFragment: "setTraderReferralCodeByUser", data: BytesLike): Result; decodeFunctionResult(functionFragment: "tiers", data: BytesLike): Result; decodeFunctionResult(functionFragment: "traderReferralCodes", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "transferOwnership", data: BytesLike): Result; } export namespace GovSetCodeOwnerEvent { @@ -140,6 +147,19 @@ export namespace SetCodeOwnerEvent { export type LogDescription = TypedLogDescription; } +export namespace SetGovEvent { + export type InputTuple = [prevGov: AddressLike, nextGov: AddressLike]; + export type OutputTuple = [prevGov: string, nextGov: string]; + export interface OutputObject { + prevGov: string; + nextGov: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + export namespace SetHandlerEvent { export type InputTuple = [handler: AddressLike, isActive: boolean]; export type OutputTuple = [handler: string, isActive: boolean]; @@ -241,6 +261,8 @@ export interface ReferralStorage extends BaseContract { BASIS_POINTS: TypedContractMethod<[], [bigint], "view">; + acceptOwnership: TypedContractMethod<[], [void], "nonpayable">; + codeOwners: TypedContractMethod<[arg0: BytesLike], [string], "view">; getTraderReferralInfo: TypedContractMethod<[_account: AddressLike], [[string, string]], "view">; @@ -251,6 +273,8 @@ export interface ReferralStorage extends BaseContract { isHandler: TypedContractMethod<[arg0: AddressLike], [boolean], "view">; + pendingGov: TypedContractMethod<[], [string], "view">; + referrerDiscountShares: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; referrerTiers: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; @@ -259,8 +283,6 @@ export interface ReferralStorage extends BaseContract { setCodeOwner: TypedContractMethod<[_code: BytesLike, _newAccount: AddressLike], [void], "nonpayable">; - setGov: TypedContractMethod<[_gov: AddressLike], [void], "nonpayable">; - setHandler: TypedContractMethod<[_handler: AddressLike, _isActive: boolean], [void], "nonpayable">; setReferrerDiscountShare: TypedContractMethod<[_discountShare: BigNumberish], [void], "nonpayable">; @@ -285,9 +307,12 @@ export interface ReferralStorage extends BaseContract { traderReferralCodes: TypedContractMethod<[arg0: AddressLike], [string], "view">; + transferOwnership: TypedContractMethod<[_newGov: AddressLike], [void], "nonpayable">; + getFunction(key: string | FunctionFragment): T; getFunction(nameOrSignature: "BASIS_POINTS"): TypedContractMethod<[], [bigint], "view">; + getFunction(nameOrSignature: "acceptOwnership"): TypedContractMethod<[], [void], "nonpayable">; getFunction(nameOrSignature: "codeOwners"): TypedContractMethod<[arg0: BytesLike], [string], "view">; getFunction( nameOrSignature: "getTraderReferralInfo" @@ -297,13 +322,13 @@ export interface ReferralStorage extends BaseContract { nameOrSignature: "govSetCodeOwner" ): TypedContractMethod<[_code: BytesLike, _newAccount: AddressLike], [void], "nonpayable">; getFunction(nameOrSignature: "isHandler"): TypedContractMethod<[arg0: AddressLike], [boolean], "view">; + getFunction(nameOrSignature: "pendingGov"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "referrerDiscountShares"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "referrerTiers"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; getFunction(nameOrSignature: "registerCode"): TypedContractMethod<[_code: BytesLike], [void], "nonpayable">; getFunction( nameOrSignature: "setCodeOwner" ): TypedContractMethod<[_code: BytesLike, _newAccount: AddressLike], [void], "nonpayable">; - getFunction(nameOrSignature: "setGov"): TypedContractMethod<[_gov: AddressLike], [void], "nonpayable">; getFunction( nameOrSignature: "setHandler" ): TypedContractMethod<[_handler: AddressLike, _isActive: boolean], [void], "nonpayable">; @@ -334,6 +359,7 @@ export interface ReferralStorage extends BaseContract { "view" >; getFunction(nameOrSignature: "traderReferralCodes"): TypedContractMethod<[arg0: AddressLike], [string], "view">; + getFunction(nameOrSignature: "transferOwnership"): TypedContractMethod<[_newGov: AddressLike], [void], "nonpayable">; getEvent( key: "GovSetCodeOwner" @@ -348,6 +374,9 @@ export interface ReferralStorage extends BaseContract { getEvent( key: "SetCodeOwner" ): TypedContractEvent; + getEvent( + key: "SetGov" + ): TypedContractEvent; getEvent( key: "SetHandler" ): TypedContractEvent; @@ -410,6 +439,13 @@ export interface ReferralStorage extends BaseContract { SetCodeOwnerEvent.OutputObject >; + "SetGov(address,address)": TypedContractEvent< + SetGovEvent.InputTuple, + SetGovEvent.OutputTuple, + SetGovEvent.OutputObject + >; + SetGov: TypedContractEvent; + "SetHandler(address,bool)": TypedContractEvent< SetHandlerEvent.InputTuple, SetHandlerEvent.OutputTuple, diff --git a/src/typechain-types/SubaccountGelatoRelayRouter.ts b/src/typechain-types/SubaccountGelatoRelayRouter.ts index f5629e26e3..0db76eca4f 100644 --- a/src/typechain-types/SubaccountGelatoRelayRouter.ts +++ b/src/typechain-types/SubaccountGelatoRelayRouter.ts @@ -8,6 +8,7 @@ import type { FunctionFragment, Result, Interface, + EventFragment, AddressLike, ContractRunner, ContractMethod, @@ -17,106 +18,11 @@ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, + TypedLogDescription, TypedListener, TypedContractMethod, } from "./common"; -export type ExternalCallsStruct = { - sendTokens: AddressLike[]; - sendAmounts: BigNumberish[]; - externalCallTargets: AddressLike[]; - externalCallDataList: BytesLike[]; - refundTokens: AddressLike[]; - refundReceivers: AddressLike[]; -}; - -export type ExternalCallsStructOutput = [ - sendTokens: string[], - sendAmounts: bigint[], - externalCallTargets: string[], - externalCallDataList: string[], - refundTokens: string[], - refundReceivers: string[], -] & { - sendTokens: string[]; - sendAmounts: bigint[]; - externalCallTargets: string[]; - externalCallDataList: string[]; - refundTokens: string[]; - refundReceivers: string[]; -}; - -export type TokenPermitStruct = { - owner: AddressLike; - spender: AddressLike; - value: BigNumberish; - deadline: BigNumberish; - v: BigNumberish; - r: BytesLike; - s: BytesLike; - token: AddressLike; -}; - -export type TokenPermitStructOutput = [ - owner: string, - spender: string, - value: bigint, - deadline: bigint, - v: bigint, - r: string, - s: string, - token: string, -] & { - owner: string; - spender: string; - value: bigint; - deadline: bigint; - v: bigint; - r: string; - s: string; - token: string; -}; - -export type FeeParamsStruct = { - feeToken: AddressLike; - feeAmount: BigNumberish; - feeSwapPath: AddressLike[]; -}; - -export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { - feeToken: string; - feeAmount: bigint; - feeSwapPath: string[]; -}; - -export type RelayParamsStruct = { - oracleParams: OracleUtils.SetPricesParamsStruct; - externalCalls: ExternalCallsStruct; - tokenPermits: TokenPermitStruct[]; - fee: FeeParamsStruct; - userNonce: BigNumberish; - deadline: BigNumberish; - signature: BytesLike; -}; - -export type RelayParamsStructOutput = [ - oracleParams: OracleUtils.SetPricesParamsStructOutput, - externalCalls: ExternalCallsStructOutput, - tokenPermits: TokenPermitStructOutput[], - fee: FeeParamsStructOutput, - userNonce: bigint, - deadline: bigint, - signature: string, -] & { - oracleParams: OracleUtils.SetPricesParamsStructOutput; - externalCalls: ExternalCallsStructOutput; - tokenPermits: TokenPermitStructOutput[]; - fee: FeeParamsStructOutput; - userNonce: bigint; - deadline: bigint; - signature: string; -}; - export type SubaccountApprovalStruct = { subaccount: AddressLike; shouldAdd: boolean; @@ -124,7 +30,9 @@ export type SubaccountApprovalStruct = { maxAllowedCount: BigNumberish; actionType: BytesLike; nonce: BigNumberish; + desChainId: BigNumberish; deadline: BigNumberish; + integrationId: BytesLike; signature: BytesLike; }; @@ -135,7 +43,9 @@ export type SubaccountApprovalStructOutput = [ maxAllowedCount: bigint, actionType: string, nonce: bigint, + desChainId: bigint, deadline: bigint, + integrationId: string, signature: string, ] & { subaccount: string; @@ -144,57 +54,12 @@ export type SubaccountApprovalStructOutput = [ maxAllowedCount: bigint; actionType: string; nonce: bigint; + desChainId: bigint; deadline: bigint; + integrationId: string; signature: string; }; -export type UpdateOrderParamsStruct = { - key: BytesLike; - sizeDeltaUsd: BigNumberish; - acceptablePrice: BigNumberish; - triggerPrice: BigNumberish; - minOutputAmount: BigNumberish; - validFromTime: BigNumberish; - autoCancel: boolean; - executionFeeIncrease: BigNumberish; -}; - -export type UpdateOrderParamsStructOutput = [ - key: string, - sizeDeltaUsd: bigint, - acceptablePrice: bigint, - triggerPrice: bigint, - minOutputAmount: bigint, - validFromTime: bigint, - autoCancel: boolean, - executionFeeIncrease: bigint, -] & { - key: string; - sizeDeltaUsd: bigint; - acceptablePrice: bigint; - triggerPrice: bigint; - minOutputAmount: bigint; - validFromTime: bigint; - autoCancel: boolean; - executionFeeIncrease: bigint; -}; - -export type BatchParamsStruct = { - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; - updateOrderParamsList: UpdateOrderParamsStruct[]; - cancelOrderKeys: BytesLike[]; -}; - -export type BatchParamsStructOutput = [ - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], - updateOrderParamsList: UpdateOrderParamsStructOutput[], - cancelOrderKeys: string[], -] & { - createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; - updateOrderParamsList: UpdateOrderParamsStructOutput[]; - cancelOrderKeys: string[]; -}; - export declare namespace OracleUtils { export type SetPricesParamsStruct = { tokens: AddressLike[]; @@ -209,6 +74,154 @@ export declare namespace OracleUtils { }; } +export declare namespace IRelayUtils { + export type ExternalCallsStruct = { + sendTokens: AddressLike[]; + sendAmounts: BigNumberish[]; + externalCallTargets: AddressLike[]; + externalCallDataList: BytesLike[]; + refundTokens: AddressLike[]; + refundReceivers: AddressLike[]; + }; + + export type ExternalCallsStructOutput = [ + sendTokens: string[], + sendAmounts: bigint[], + externalCallTargets: string[], + externalCallDataList: string[], + refundTokens: string[], + refundReceivers: string[], + ] & { + sendTokens: string[]; + sendAmounts: bigint[]; + externalCallTargets: string[]; + externalCallDataList: string[]; + refundTokens: string[]; + refundReceivers: string[]; + }; + + export type TokenPermitStruct = { + owner: AddressLike; + spender: AddressLike; + value: BigNumberish; + deadline: BigNumberish; + v: BigNumberish; + r: BytesLike; + s: BytesLike; + token: AddressLike; + }; + + export type TokenPermitStructOutput = [ + owner: string, + spender: string, + value: bigint, + deadline: bigint, + v: bigint, + r: string, + s: string, + token: string, + ] & { + owner: string; + spender: string; + value: bigint; + deadline: bigint; + v: bigint; + r: string; + s: string; + token: string; + }; + + export type FeeParamsStruct = { + feeToken: AddressLike; + feeAmount: BigNumberish; + feeSwapPath: AddressLike[]; + }; + + export type FeeParamsStructOutput = [feeToken: string, feeAmount: bigint, feeSwapPath: string[]] & { + feeToken: string; + feeAmount: bigint; + feeSwapPath: string[]; + }; + + export type RelayParamsStruct = { + oracleParams: OracleUtils.SetPricesParamsStruct; + externalCalls: IRelayUtils.ExternalCallsStruct; + tokenPermits: IRelayUtils.TokenPermitStruct[]; + fee: IRelayUtils.FeeParamsStruct; + userNonce: BigNumberish; + deadline: BigNumberish; + signature: BytesLike; + desChainId: BigNumberish; + }; + + export type RelayParamsStructOutput = [ + oracleParams: OracleUtils.SetPricesParamsStructOutput, + externalCalls: IRelayUtils.ExternalCallsStructOutput, + tokenPermits: IRelayUtils.TokenPermitStructOutput[], + fee: IRelayUtils.FeeParamsStructOutput, + userNonce: bigint, + deadline: bigint, + signature: string, + desChainId: bigint, + ] & { + oracleParams: OracleUtils.SetPricesParamsStructOutput; + externalCalls: IRelayUtils.ExternalCallsStructOutput; + tokenPermits: IRelayUtils.TokenPermitStructOutput[]; + fee: IRelayUtils.FeeParamsStructOutput; + userNonce: bigint; + deadline: bigint; + signature: string; + desChainId: bigint; + }; + + export type UpdateOrderParamsStruct = { + key: BytesLike; + sizeDeltaUsd: BigNumberish; + acceptablePrice: BigNumberish; + triggerPrice: BigNumberish; + minOutputAmount: BigNumberish; + validFromTime: BigNumberish; + autoCancel: boolean; + executionFeeIncrease: BigNumberish; + }; + + export type UpdateOrderParamsStructOutput = [ + key: string, + sizeDeltaUsd: bigint, + acceptablePrice: bigint, + triggerPrice: bigint, + minOutputAmount: bigint, + validFromTime: bigint, + autoCancel: boolean, + executionFeeIncrease: bigint, + ] & { + key: string; + sizeDeltaUsd: bigint; + acceptablePrice: bigint; + triggerPrice: bigint; + minOutputAmount: bigint; + validFromTime: bigint; + autoCancel: boolean; + executionFeeIncrease: bigint; + }; + + export type BatchParamsStruct = { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStruct[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStruct[]; + cancelOrderKeys: BytesLike[]; + }; + + export type BatchParamsStructOutput = [ + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[], + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[], + cancelOrderKeys: string[], + ] & { + createOrderParamsList: IBaseOrderUtils.CreateOrderParamsStructOutput[]; + updateOrderParamsList: IRelayUtils.UpdateOrderParamsStructOutput[]; + cancelOrderKeys: string[]; + }; +} + export declare namespace IBaseOrderUtils { export type CreateOrderParamsAddressesStruct = { receiver: AddressLike; @@ -278,6 +291,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: BytesLike; + dataList: BytesLike[]; }; export type CreateOrderParamsStructOutput = [ @@ -289,6 +303,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean, autoCancel: boolean, referralCode: string, + dataList: string[], ] & { addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; @@ -298,46 +313,55 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: string; + dataList: string[]; }; } export interface SubaccountGelatoRelayRouterInterface extends Interface { getFunction( nameOrSignature: - | "DOMAIN_SEPARATOR_NAME_HASH" - | "DOMAIN_SEPARATOR_TYPEHASH" - | "DOMAIN_SEPARATOR_VERSION_HASH" | "batch" | "cancelOrder" | "createOrder" | "dataStore" + | "digests" | "eventEmitter" | "externalHandler" + | "multicall" | "oracle" | "orderHandler" | "orderVault" | "removeSubaccount" + | "roleStore" | "router" + | "sendNativeToken" + | "sendTokens" + | "sendWnt" | "subaccountApprovalNonces" + | "swapHandler" | "updateOrder" - | "userNonces" ): FunctionFragment; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_NAME_HASH", values?: undefined): string; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_TYPEHASH", values?: undefined): string; - encodeFunctionData(functionFragment: "DOMAIN_SEPARATOR_VERSION_HASH", values?: undefined): string; + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + encodeFunctionData( functionFragment: "batch", - values: [RelayParamsStruct, SubaccountApprovalStruct, AddressLike, AddressLike, BatchParamsStruct] + values: [ + IRelayUtils.RelayParamsStruct, + SubaccountApprovalStruct, + AddressLike, + AddressLike, + IRelayUtils.BatchParamsStruct, + ] ): string; encodeFunctionData( functionFragment: "cancelOrder", - values: [RelayParamsStruct, SubaccountApprovalStruct, AddressLike, AddressLike, BytesLike] + values: [IRelayUtils.RelayParamsStruct, SubaccountApprovalStruct, AddressLike, AddressLike, BytesLike] ): string; encodeFunctionData( functionFragment: "createOrder", values: [ - RelayParamsStruct, + IRelayUtils.RelayParamsStruct, SubaccountApprovalStruct, AddressLike, AddressLike, @@ -345,40 +369,68 @@ export interface SubaccountGelatoRelayRouterInterface extends Interface { ] ): string; encodeFunctionData(functionFragment: "dataStore", values?: undefined): string; + encodeFunctionData(functionFragment: "digests", values: [BytesLike]): string; encodeFunctionData(functionFragment: "eventEmitter", values?: undefined): string; encodeFunctionData(functionFragment: "externalHandler", values?: undefined): string; + encodeFunctionData(functionFragment: "multicall", values: [BytesLike[]]): string; encodeFunctionData(functionFragment: "oracle", values?: undefined): string; encodeFunctionData(functionFragment: "orderHandler", values?: undefined): string; encodeFunctionData(functionFragment: "orderVault", values?: undefined): string; encodeFunctionData( functionFragment: "removeSubaccount", - values: [RelayParamsStruct, AddressLike, AddressLike] + values: [IRelayUtils.RelayParamsStruct, AddressLike, AddressLike] ): string; + encodeFunctionData(functionFragment: "roleStore", values?: undefined): string; encodeFunctionData(functionFragment: "router", values?: undefined): string; + encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "subaccountApprovalNonces", values: [AddressLike]): string; + encodeFunctionData(functionFragment: "swapHandler", values?: undefined): string; encodeFunctionData( functionFragment: "updateOrder", - values: [RelayParamsStruct, SubaccountApprovalStruct, AddressLike, AddressLike, UpdateOrderParamsStruct] + values: [ + IRelayUtils.RelayParamsStruct, + SubaccountApprovalStruct, + AddressLike, + AddressLike, + IRelayUtils.UpdateOrderParamsStruct, + ] ): string; - encodeFunctionData(functionFragment: "userNonces", values: [AddressLike]): string; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_NAME_HASH", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_TYPEHASH", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "DOMAIN_SEPARATOR_VERSION_HASH", data: BytesLike): Result; decodeFunctionResult(functionFragment: "batch", data: BytesLike): Result; decodeFunctionResult(functionFragment: "cancelOrder", data: BytesLike): Result; decodeFunctionResult(functionFragment: "createOrder", data: BytesLike): Result; decodeFunctionResult(functionFragment: "dataStore", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "digests", data: BytesLike): Result; decodeFunctionResult(functionFragment: "eventEmitter", data: BytesLike): Result; decodeFunctionResult(functionFragment: "externalHandler", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "multicall", data: BytesLike): Result; decodeFunctionResult(functionFragment: "oracle", data: BytesLike): Result; decodeFunctionResult(functionFragment: "orderHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "orderVault", data: BytesLike): Result; decodeFunctionResult(functionFragment: "removeSubaccount", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "roleStore", data: BytesLike): Result; decodeFunctionResult(functionFragment: "router", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; decodeFunctionResult(functionFragment: "subaccountApprovalNonces", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "swapHandler", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updateOrder", data: BytesLike): Result; - decodeFunctionResult(functionFragment: "userNonces", data: BytesLike): Result; +} + +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; } export interface SubaccountGelatoRelayRouter extends BaseContract { @@ -414,19 +466,13 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { listeners(eventName?: string): Promise>; removeAllListeners(event?: TCEvent): Promise; - DOMAIN_SEPARATOR_NAME_HASH: TypedContractMethod<[], [string], "view">; - - DOMAIN_SEPARATOR_TYPEHASH: TypedContractMethod<[], [string], "view">; - - DOMAIN_SEPARATOR_VERSION_HASH: TypedContractMethod<[], [string], "view">; - batch: TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, - params: BatchParamsStruct, + params: IRelayUtils.BatchParamsStruct, ], [string[]], "nonpayable" @@ -434,7 +480,7 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { cancelOrder: TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, @@ -446,7 +492,7 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { createOrder: TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, @@ -458,10 +504,14 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { dataStore: TypedContractMethod<[], [string], "view">; + digests: TypedContractMethod<[arg0: BytesLike], [boolean], "view">; + eventEmitter: TypedContractMethod<[], [string], "view">; externalHandler: TypedContractMethod<[], [string], "view">; + multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; + oracle: TypedContractMethod<[], [string], "view">; orderHandler: TypedContractMethod<[], [string], "view">; @@ -469,43 +519,48 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { orderVault: TypedContractMethod<[], [string], "view">; removeSubaccount: TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, subaccount: AddressLike], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, subaccount: AddressLike], [void], "nonpayable" >; + roleStore: TypedContractMethod<[], [string], "view">; + router: TypedContractMethod<[], [string], "view">; + sendNativeToken: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendTokens: TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + + sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + subaccountApprovalNonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + swapHandler: TypedContractMethod<[], [string], "view">; + updateOrder: TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, - params: UpdateOrderParamsStruct, + params: IRelayUtils.UpdateOrderParamsStruct, ], [void], "nonpayable" >; - userNonces: TypedContractMethod<[arg0: AddressLike], [bigint], "view">; - getFunction(key: string | FunctionFragment): T; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_NAME_HASH"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_TYPEHASH"): TypedContractMethod<[], [string], "view">; - getFunction(nameOrSignature: "DOMAIN_SEPARATOR_VERSION_HASH"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "batch" ): TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, - params: BatchParamsStruct, + params: IRelayUtils.BatchParamsStruct, ], [string[]], "nonpayable" @@ -514,7 +569,7 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { nameOrSignature: "cancelOrder" ): TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, @@ -527,7 +582,7 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { nameOrSignature: "createOrder" ): TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, @@ -537,34 +592,65 @@ export interface SubaccountGelatoRelayRouter extends BaseContract { "nonpayable" >; getFunction(nameOrSignature: "dataStore"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "digests"): TypedContractMethod<[arg0: BytesLike], [boolean], "view">; getFunction(nameOrSignature: "eventEmitter"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "externalHandler"): TypedContractMethod<[], [string], "view">; + getFunction(nameOrSignature: "multicall"): TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; getFunction(nameOrSignature: "oracle"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "orderHandler"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "orderVault"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "removeSubaccount" ): TypedContractMethod< - [relayParams: RelayParamsStruct, account: AddressLike, subaccount: AddressLike], + [relayParams: IRelayUtils.RelayParamsStruct, account: AddressLike, subaccount: AddressLike], [void], "nonpayable" >; + getFunction(nameOrSignature: "roleStore"): TypedContractMethod<[], [string], "view">; getFunction(nameOrSignature: "router"): TypedContractMethod<[], [string], "view">; + getFunction( + nameOrSignature: "sendNativeToken" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendTokens" + ): TypedContractMethod<[token: AddressLike, receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "sendWnt" + ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; getFunction(nameOrSignature: "subaccountApprovalNonces"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; + getFunction(nameOrSignature: "swapHandler"): TypedContractMethod<[], [string], "view">; getFunction( nameOrSignature: "updateOrder" ): TypedContractMethod< [ - relayParams: RelayParamsStruct, + relayParams: IRelayUtils.RelayParamsStruct, subaccountApproval: SubaccountApprovalStruct, account: AddressLike, subaccount: AddressLike, - params: UpdateOrderParamsStruct, + params: IRelayUtils.UpdateOrderParamsStruct, ], [void], "nonpayable" >; - getFunction(nameOrSignature: "userNonces"): TypedContractMethod<[arg0: AddressLike], [bigint], "view">; - filters: {}; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; } diff --git a/src/typechain-types/SubaccountRouter.ts b/src/typechain-types/SubaccountRouter.ts index d299e041a8..e46d98d4ef 100644 --- a/src/typechain-types/SubaccountRouter.ts +++ b/src/typechain-types/SubaccountRouter.ts @@ -8,6 +8,7 @@ import type { FunctionFragment, Result, Interface, + EventFragment, AddressLike, ContractRunner, ContractMethod, @@ -17,6 +18,7 @@ import type { TypedContractEvent, TypedDeferredTopicFilter, TypedEventLog, + TypedLogDescription, TypedListener, TypedContractMethod, } from "./common"; @@ -90,6 +92,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: BytesLike; + dataList: BytesLike[]; }; export type CreateOrderParamsStructOutput = [ @@ -101,6 +104,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean, autoCancel: boolean, referralCode: string, + dataList: string[], ] & { addresses: IBaseOrderUtils.CreateOrderParamsAddressesStructOutput; numbers: IBaseOrderUtils.CreateOrderParamsNumbersStructOutput; @@ -110,6 +114,7 @@ export declare namespace IBaseOrderUtils { shouldUnwrapNativeToken: boolean; autoCancel: boolean; referralCode: string; + dataList: string[]; }; } @@ -130,11 +135,15 @@ export interface SubaccountRouterInterface extends Interface { | "sendNativeToken" | "sendTokens" | "sendWnt" + | "setIntegrationId" | "setMaxAllowedSubaccountActionCount" | "setSubaccountAutoTopUpAmount" + | "setSubaccountExpiresAt" | "updateOrder" ): FunctionFragment; + getEvent(nameOrSignatureOrTopic: "TokenTransferReverted"): EventFragment; + encodeFunctionData(functionFragment: "addSubaccount", values: [AddressLike]): string; encodeFunctionData(functionFragment: "cancelOrder", values: [BytesLike]): string; encodeFunctionData( @@ -152,11 +161,16 @@ export interface SubaccountRouterInterface extends Interface { encodeFunctionData(functionFragment: "sendNativeToken", values: [AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "sendTokens", values: [AddressLike, AddressLike, BigNumberish]): string; encodeFunctionData(functionFragment: "sendWnt", values: [AddressLike, BigNumberish]): string; + encodeFunctionData(functionFragment: "setIntegrationId", values: [AddressLike, BytesLike]): string; encodeFunctionData( functionFragment: "setMaxAllowedSubaccountActionCount", values: [AddressLike, BytesLike, BigNumberish] ): string; encodeFunctionData(functionFragment: "setSubaccountAutoTopUpAmount", values: [AddressLike, BigNumberish]): string; + encodeFunctionData( + functionFragment: "setSubaccountExpiresAt", + values: [AddressLike, BytesLike, BigNumberish] + ): string; encodeFunctionData( functionFragment: "updateOrder", values: [BytesLike, BigNumberish, BigNumberish, BigNumberish, BigNumberish, BigNumberish, boolean] @@ -176,11 +190,26 @@ export interface SubaccountRouterInterface extends Interface { decodeFunctionResult(functionFragment: "sendNativeToken", data: BytesLike): Result; decodeFunctionResult(functionFragment: "sendTokens", data: BytesLike): Result; decodeFunctionResult(functionFragment: "sendWnt", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "setIntegrationId", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setMaxAllowedSubaccountActionCount", data: BytesLike): Result; decodeFunctionResult(functionFragment: "setSubaccountAutoTopUpAmount", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "setSubaccountExpiresAt", data: BytesLike): Result; decodeFunctionResult(functionFragment: "updateOrder", data: BytesLike): Result; } +export namespace TokenTransferRevertedEvent { + export type InputTuple = [reason: string, returndata: BytesLike]; + export type OutputTuple = [reason: string, returndata: string]; + export interface OutputObject { + reason: string; + returndata: string; + } + export type Event = TypedContractEvent; + export type Filter = TypedDeferredTopicFilter; + export type Log = TypedEventLog; + export type LogDescription = TypedLogDescription; +} + export interface SubaccountRouter extends BaseContract { connect(runner?: ContractRunner | null): SubaccountRouter; waitForDeployment(): Promise; @@ -228,9 +257,6 @@ export interface SubaccountRouter extends BaseContract { eventEmitter: TypedContractMethod<[], [string], "view">; - /** - * Receives and executes a batch of function calls on this contract. - */ multicall: TypedContractMethod<[data: BytesLike[]], [string[]], "payable">; orderHandler: TypedContractMethod<[], [string], "view">; @@ -249,6 +275,8 @@ export interface SubaccountRouter extends BaseContract { sendWnt: TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + setIntegrationId: TypedContractMethod<[subaccount: AddressLike, integrationId: BytesLike], [void], "payable">; + setMaxAllowedSubaccountActionCount: TypedContractMethod< [subaccount: AddressLike, actionType: BytesLike, maxAllowedCount: BigNumberish], [void], @@ -257,6 +285,12 @@ export interface SubaccountRouter extends BaseContract { setSubaccountAutoTopUpAmount: TypedContractMethod<[subaccount: AddressLike, amount: BigNumberish], [void], "payable">; + setSubaccountExpiresAt: TypedContractMethod< + [subaccount: AddressLike, actionType: BytesLike, expiresAt: BigNumberish], + [void], + "payable" + >; + updateOrder: TypedContractMethod< [ key: BytesLike, @@ -295,6 +329,9 @@ export interface SubaccountRouter extends BaseContract { getFunction( nameOrSignature: "sendWnt" ): TypedContractMethod<[receiver: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "setIntegrationId" + ): TypedContractMethod<[subaccount: AddressLike, integrationId: BytesLike], [void], "payable">; getFunction( nameOrSignature: "setMaxAllowedSubaccountActionCount" ): TypedContractMethod< @@ -305,6 +342,9 @@ export interface SubaccountRouter extends BaseContract { getFunction( nameOrSignature: "setSubaccountAutoTopUpAmount" ): TypedContractMethod<[subaccount: AddressLike, amount: BigNumberish], [void], "payable">; + getFunction( + nameOrSignature: "setSubaccountExpiresAt" + ): TypedContractMethod<[subaccount: AddressLike, actionType: BytesLike, expiresAt: BigNumberish], [void], "payable">; getFunction( nameOrSignature: "updateOrder" ): TypedContractMethod< @@ -321,5 +361,24 @@ export interface SubaccountRouter extends BaseContract { "payable" >; - filters: {}; + getEvent( + key: "TokenTransferReverted" + ): TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + + filters: { + "TokenTransferReverted(string,bytes)": TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + TokenTransferReverted: TypedContractEvent< + TokenTransferRevertedEvent.InputTuple, + TokenTransferRevertedEvent.OutputTuple, + TokenTransferRevertedEvent.OutputObject + >; + }; } diff --git a/src/typechain-types/SyntheticsReader.ts b/src/typechain-types/SyntheticsReader.ts index 565742dc62..31b0016df8 100644 --- a/src/typechain-types/SyntheticsReader.ts +++ b/src/typechain-types/SyntheticsReader.ts @@ -65,6 +65,7 @@ export declare namespace Order { minOutputAmount: BigNumberish; updatedAtTime: BigNumberish; validFromTime: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -79,6 +80,7 @@ export declare namespace Order { minOutputAmount: bigint, updatedAtTime: bigint, validFromTime: bigint, + srcChainId: bigint, ] & { orderType: bigint; decreasePositionSwapType: bigint; @@ -91,6 +93,7 @@ export declare namespace Order { minOutputAmount: bigint; updatedAtTime: bigint; validFromTime: bigint; + srcChainId: bigint; }; export type FlagsStruct = { @@ -116,16 +119,88 @@ export declare namespace Order { addresses: Order.AddressesStruct; numbers: Order.NumbersStruct; flags: Order.FlagsStruct; + _dataList: BytesLike[]; }; export type PropsStructOutput = [ addresses: Order.AddressesStructOutput, numbers: Order.NumbersStructOutput, flags: Order.FlagsStructOutput, + _dataList: string[], ] & { addresses: Order.AddressesStructOutput; numbers: Order.NumbersStructOutput; flags: Order.FlagsStructOutput; + _dataList: string[]; + }; +} + +export declare namespace ReaderUtils { + export type OrderInfoStruct = { + orderKey: BytesLike; + order: Order.PropsStruct; + }; + + export type OrderInfoStructOutput = [orderKey: string, order: Order.PropsStructOutput] & { + orderKey: string; + order: Order.PropsStructOutput; + }; + + export type BaseFundingValuesStruct = { + fundingFeeAmountPerSize: MarketUtils.PositionTypeStruct; + claimableFundingAmountPerSize: MarketUtils.PositionTypeStruct; + }; + + export type BaseFundingValuesStructOutput = [ + fundingFeeAmountPerSize: MarketUtils.PositionTypeStructOutput, + claimableFundingAmountPerSize: MarketUtils.PositionTypeStructOutput, + ] & { + fundingFeeAmountPerSize: MarketUtils.PositionTypeStructOutput; + claimableFundingAmountPerSize: MarketUtils.PositionTypeStructOutput; + }; + + export type VirtualInventoryStruct = { + virtualPoolAmountForLongToken: BigNumberish; + virtualPoolAmountForShortToken: BigNumberish; + virtualInventoryForPositions: BigNumberish; + }; + + export type VirtualInventoryStructOutput = [ + virtualPoolAmountForLongToken: bigint, + virtualPoolAmountForShortToken: bigint, + virtualInventoryForPositions: bigint, + ] & { + virtualPoolAmountForLongToken: bigint; + virtualPoolAmountForShortToken: bigint; + virtualInventoryForPositions: bigint; + }; + + export type MarketInfoStruct = { + market: Market.PropsStruct; + borrowingFactorPerSecondForLongs: BigNumberish; + borrowingFactorPerSecondForShorts: BigNumberish; + baseFunding: ReaderUtils.BaseFundingValuesStruct; + nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStruct; + virtualInventory: ReaderUtils.VirtualInventoryStruct; + isDisabled: boolean; + }; + + export type MarketInfoStructOutput = [ + market: Market.PropsStructOutput, + borrowingFactorPerSecondForLongs: bigint, + borrowingFactorPerSecondForShorts: bigint, + baseFunding: ReaderUtils.BaseFundingValuesStructOutput, + nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStructOutput, + virtualInventory: ReaderUtils.VirtualInventoryStructOutput, + isDisabled: boolean, + ] & { + market: Market.PropsStructOutput; + borrowingFactorPerSecondForLongs: bigint; + borrowingFactorPerSecondForShorts: bigint; + baseFunding: ReaderUtils.BaseFundingValuesStructOutput; + nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStructOutput; + virtualInventory: ReaderUtils.VirtualInventoryStructOutput; + isDisabled: boolean; }; } @@ -218,6 +293,7 @@ export declare namespace Position { sizeInUsd: BigNumberish; sizeInTokens: BigNumberish; collateralAmount: BigNumberish; + pendingImpactAmount: BigNumberish; borrowingFactor: BigNumberish; fundingFeeAmountPerSize: BigNumberish; longTokenClaimableFundingAmountPerSize: BigNumberish; @@ -230,6 +306,7 @@ export declare namespace Position { sizeInUsd: bigint, sizeInTokens: bigint, collateralAmount: bigint, + pendingImpactAmount: bigint, borrowingFactor: bigint, fundingFeeAmountPerSize: bigint, longTokenClaimableFundingAmountPerSize: bigint, @@ -240,6 +317,7 @@ export declare namespace Position { sizeInUsd: bigint; sizeInTokens: bigint; collateralAmount: bigint; + pendingImpactAmount: bigint; borrowingFactor: bigint; fundingFeeAmountPerSize: bigint; longTokenClaimableFundingAmountPerSize: bigint; @@ -460,18 +538,27 @@ export declare namespace PositionPricingUtils { export declare namespace ReaderPricingUtils { export type ExecutionPriceResultStruct = { priceImpactUsd: BigNumberish; - priceImpactDiffUsd: BigNumberish; executionPrice: BigNumberish; + balanceWasImproved: boolean; + proportionalPendingImpactUsd: BigNumberish; + totalImpactUsd: BigNumberish; + priceImpactDiffUsd: BigNumberish; }; export type ExecutionPriceResultStructOutput = [ priceImpactUsd: bigint, - priceImpactDiffUsd: bigint, executionPrice: bigint, + balanceWasImproved: boolean, + proportionalPendingImpactUsd: bigint, + totalImpactUsd: bigint, + priceImpactDiffUsd: bigint, ] & { priceImpactUsd: bigint; - priceImpactDiffUsd: bigint; executionPrice: bigint; + balanceWasImproved: boolean; + proportionalPendingImpactUsd: bigint; + totalImpactUsd: bigint; + priceImpactDiffUsd: bigint; }; } @@ -547,6 +634,7 @@ export declare namespace Deposit { updatedAtTime: BigNumberish; executionFee: BigNumberish; callbackGasLimit: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -556,6 +644,7 @@ export declare namespace Deposit { updatedAtTime: bigint, executionFee: bigint, callbackGasLimit: bigint, + srcChainId: bigint, ] & { initialLongTokenAmount: bigint; initialShortTokenAmount: bigint; @@ -563,6 +652,7 @@ export declare namespace Deposit { updatedAtTime: bigint; executionFee: bigint; callbackGasLimit: bigint; + srcChainId: bigint; }; export type FlagsStruct = { shouldUnwrapNativeToken: boolean }; @@ -575,16 +665,19 @@ export declare namespace Deposit { addresses: Deposit.AddressesStruct; numbers: Deposit.NumbersStruct; flags: Deposit.FlagsStruct; + _dataList: BytesLike[]; }; export type PropsStructOutput = [ addresses: Deposit.AddressesStructOutput, numbers: Deposit.NumbersStructOutput, flags: Deposit.FlagsStructOutput, + _dataList: string[], ] & { addresses: Deposit.AddressesStructOutput; numbers: Deposit.NumbersStructOutput; flags: Deposit.FlagsStructOutput; + _dataList: string[]; }; } @@ -604,65 +697,6 @@ export declare namespace Market { }; } -export declare namespace ReaderUtils { - export type BaseFundingValuesStruct = { - fundingFeeAmountPerSize: MarketUtils.PositionTypeStruct; - claimableFundingAmountPerSize: MarketUtils.PositionTypeStruct; - }; - - export type BaseFundingValuesStructOutput = [ - fundingFeeAmountPerSize: MarketUtils.PositionTypeStructOutput, - claimableFundingAmountPerSize: MarketUtils.PositionTypeStructOutput, - ] & { - fundingFeeAmountPerSize: MarketUtils.PositionTypeStructOutput; - claimableFundingAmountPerSize: MarketUtils.PositionTypeStructOutput; - }; - - export type VirtualInventoryStruct = { - virtualPoolAmountForLongToken: BigNumberish; - virtualPoolAmountForShortToken: BigNumberish; - virtualInventoryForPositions: BigNumberish; - }; - - export type VirtualInventoryStructOutput = [ - virtualPoolAmountForLongToken: bigint, - virtualPoolAmountForShortToken: bigint, - virtualInventoryForPositions: bigint, - ] & { - virtualPoolAmountForLongToken: bigint; - virtualPoolAmountForShortToken: bigint; - virtualInventoryForPositions: bigint; - }; - - export type MarketInfoStruct = { - market: Market.PropsStruct; - borrowingFactorPerSecondForLongs: BigNumberish; - borrowingFactorPerSecondForShorts: BigNumberish; - baseFunding: ReaderUtils.BaseFundingValuesStruct; - nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStruct; - virtualInventory: ReaderUtils.VirtualInventoryStruct; - isDisabled: boolean; - }; - - export type MarketInfoStructOutput = [ - market: Market.PropsStructOutput, - borrowingFactorPerSecondForLongs: bigint, - borrowingFactorPerSecondForShorts: bigint, - baseFunding: ReaderUtils.BaseFundingValuesStructOutput, - nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStructOutput, - virtualInventory: ReaderUtils.VirtualInventoryStructOutput, - isDisabled: boolean, - ] & { - market: Market.PropsStructOutput; - borrowingFactorPerSecondForLongs: bigint; - borrowingFactorPerSecondForShorts: bigint; - baseFunding: ReaderUtils.BaseFundingValuesStructOutput; - nextFunding: MarketUtils.GetNextFundingAmountPerSizeResultStructOutput; - virtualInventory: ReaderUtils.VirtualInventoryStructOutput; - isDisabled: boolean; - }; -} - export declare namespace MarketPoolValueInfo { export type PropsStruct = { poolValue: BigNumberish; @@ -676,6 +710,7 @@ export declare namespace MarketPoolValueInfo { totalBorrowingFees: BigNumberish; borrowingFeePoolFactor: BigNumberish; impactPoolAmount: BigNumberish; + lentImpactPoolAmount: BigNumberish; }; export type PropsStructOutput = [ @@ -690,6 +725,7 @@ export declare namespace MarketPoolValueInfo { totalBorrowingFees: bigint, borrowingFeePoolFactor: bigint, impactPoolAmount: bigint, + lentImpactPoolAmount: bigint, ] & { poolValue: bigint; longPnl: bigint; @@ -702,6 +738,7 @@ export declare namespace MarketPoolValueInfo { totalBorrowingFees: bigint; borrowingFeePoolFactor: bigint; impactPoolAmount: bigint; + lentImpactPoolAmount: bigint; }; } @@ -737,6 +774,7 @@ export declare namespace Shift { updatedAtTime: BigNumberish; executionFee: BigNumberish; callbackGasLimit: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -745,22 +783,30 @@ export declare namespace Shift { updatedAtTime: bigint, executionFee: bigint, callbackGasLimit: bigint, + srcChainId: bigint, ] & { marketTokenAmount: bigint; minMarketTokens: bigint; updatedAtTime: bigint; executionFee: bigint; callbackGasLimit: bigint; + srcChainId: bigint; }; export type PropsStruct = { addresses: Shift.AddressesStruct; numbers: Shift.NumbersStruct; + _dataList: BytesLike[]; }; - export type PropsStructOutput = [addresses: Shift.AddressesStructOutput, numbers: Shift.NumbersStructOutput] & { + export type PropsStructOutput = [ + addresses: Shift.AddressesStructOutput, + numbers: Shift.NumbersStructOutput, + _dataList: string[], + ] & { addresses: Shift.AddressesStructOutput; numbers: Shift.NumbersStructOutput; + _dataList: string[]; }; } @@ -827,6 +873,7 @@ export declare namespace Withdrawal { updatedAtTime: BigNumberish; executionFee: BigNumberish; callbackGasLimit: BigNumberish; + srcChainId: BigNumberish; }; export type NumbersStructOutput = [ @@ -836,6 +883,7 @@ export declare namespace Withdrawal { updatedAtTime: bigint, executionFee: bigint, callbackGasLimit: bigint, + srcChainId: bigint, ] & { marketTokenAmount: bigint; minLongTokenAmount: bigint; @@ -843,6 +891,7 @@ export declare namespace Withdrawal { updatedAtTime: bigint; executionFee: bigint; callbackGasLimit: bigint; + srcChainId: bigint; }; export type FlagsStruct = { shouldUnwrapNativeToken: boolean }; @@ -855,16 +904,19 @@ export declare namespace Withdrawal { addresses: Withdrawal.AddressesStruct; numbers: Withdrawal.NumbersStruct; flags: Withdrawal.FlagsStruct; + _dataList: BytesLike[]; }; export type PropsStructOutput = [ addresses: Withdrawal.AddressesStructOutput, numbers: Withdrawal.NumbersStructOutput, flags: Withdrawal.FlagsStructOutput, + _dataList: string[], ] & { addresses: Withdrawal.AddressesStructOutput; numbers: Withdrawal.NumbersStructOutput; flags: Withdrawal.FlagsStructOutput; + _dataList: string[]; }; } @@ -961,7 +1013,16 @@ export interface SyntheticsReaderInterface extends Interface { ): string; encodeFunctionData( functionFragment: "getExecutionPrice", - values: [AddressLike, AddressLike, Price.PropsStruct, BigNumberish, BigNumberish, BigNumberish, boolean] + values: [ + AddressLike, + AddressLike, + MarketUtils.MarketPricesStruct, + BigNumberish, + BigNumberish, + BigNumberish, + BigNumberish, + boolean, + ] ): string; encodeFunctionData(functionFragment: "getMarket", values: [AddressLike, AddressLike]): string; encodeFunctionData(functionFragment: "getMarketBySalt", values: [AddressLike, BytesLike]): string; @@ -1036,7 +1097,7 @@ export interface SyntheticsReaderInterface extends Interface { ): string; encodeFunctionData( functionFragment: "isPositionLiquidatable", - values: [AddressLike, AddressLike, BytesLike, Market.PropsStruct, MarketUtils.MarketPricesStruct, boolean] + values: [AddressLike, AddressLike, BytesLike, Market.PropsStruct, MarketUtils.MarketPricesStruct, boolean, boolean] ): string; decodeFunctionResult(functionFragment: "getAccountOrders", data: BytesLike): Result; @@ -1105,7 +1166,7 @@ export interface SyntheticsReader extends BaseContract { getAccountOrders: TypedContractMethod< [dataStore: AddressLike, account: AddressLike, start: BigNumberish, end: BigNumberish], - [Order.PropsStructOutput[]], + [ReaderUtils.OrderInfoStructOutput[]], "view" >; @@ -1157,10 +1218,11 @@ export interface SyntheticsReader extends BaseContract { [ dataStore: AddressLike, marketKey: AddressLike, - indexTokenPrice: Price.PropsStruct, + prices: MarketUtils.MarketPricesStruct, positionSizeInUsd: BigNumberish, positionSizeInTokens: BigNumberish, sizeDeltaUsd: BigNumberish, + pendingImpactAmount: BigNumberish, isLong: boolean, ], [ReaderPricingUtils.ExecutionPriceResultStructOutput], @@ -1354,6 +1416,7 @@ export interface SyntheticsReader extends BaseContract { market: Market.PropsStruct, prices: MarketUtils.MarketPricesStruct, shouldValidateMinCollateralUsd: boolean, + forLiquidation: boolean, ], [[boolean, string, PositionUtils.IsPositionLiquidatableInfoStructOutput]], "view" @@ -1365,7 +1428,7 @@ export interface SyntheticsReader extends BaseContract { nameOrSignature: "getAccountOrders" ): TypedContractMethod< [dataStore: AddressLike, account: AddressLike, start: BigNumberish, end: BigNumberish], - [Order.PropsStructOutput[]], + [ReaderUtils.OrderInfoStructOutput[]], "view" >; getFunction( @@ -1423,10 +1486,11 @@ export interface SyntheticsReader extends BaseContract { [ dataStore: AddressLike, marketKey: AddressLike, - indexTokenPrice: Price.PropsStruct, + prices: MarketUtils.MarketPricesStruct, positionSizeInUsd: BigNumberish, positionSizeInTokens: BigNumberish, sizeDeltaUsd: BigNumberish, + pendingImpactAmount: BigNumberish, isLong: boolean, ], [ReaderPricingUtils.ExecutionPriceResultStructOutput], @@ -1636,6 +1700,7 @@ export interface SyntheticsReader extends BaseContract { market: Market.PropsStruct, prices: MarketUtils.MarketPricesStruct, shouldValidateMinCollateralUsd: boolean, + forLiquidation: boolean, ], [[boolean, string, PositionUtils.IsPositionLiquidatableInfoStructOutput]], "view" diff --git a/src/typechain-types/factories/CustomErrors__factory.ts b/src/typechain-types/factories/CustomErrors__factory.ts index 97184dd814..faa236ff9b 100644 --- a/src/typechain-types/factories/CustomErrors__factory.ts +++ b/src/typechain-types/factories/CustomErrors__factory.ts @@ -319,11 +319,6 @@ const _abi = [ name: "EmptyAddressInMarketTokenBalanceValidation", type: "error", }, - { - inputs: [], - name: "EmptyChainlinkPaymentToken", - type: "error", - }, { inputs: [ { diff --git a/src/typechain-types/factories/DataStore__factory.ts b/src/typechain-types/factories/DataStore__factory.ts index 4f19eb773b..b6fd611725 100644 --- a/src/typechain-types/factories/DataStore__factory.ts +++ b/src/typechain-types/factories/DataStore__factory.ts @@ -207,6 +207,30 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "applyDeltaToUint", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { diff --git a/src/typechain-types/factories/ERC20Permit__factory.ts b/src/typechain-types/factories/ERC20Permit__factory.ts deleted file mode 100644 index 85e260228a..0000000000 --- a/src/typechain-types/factories/ERC20Permit__factory.ts +++ /dev/null @@ -1,120 +0,0 @@ -/* Autogenerated file. Do not edit manually. */ -/* tslint:disable */ -/* eslint-disable */ - -import { Contract, Interface, type ContractRunner } from "ethers"; -import type { ERC20Permit, ERC20PermitInterface } from "../ERC20Permit"; - -const _abi = [ - { - inputs: [], - name: "DOMAIN_SEPARATOR", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - ], - name: "nonces", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [ - { - internalType: "address", - name: "owner", - type: "address", - }, - { - internalType: "address", - name: "spender", - type: "address", - }, - { - internalType: "uint256", - name: "value", - type: "uint256", - }, - { - internalType: "uint256", - name: "deadline", - type: "uint256", - }, - { - internalType: "uint8", - name: "v", - type: "uint8", - }, - { - internalType: "bytes32", - name: "r", - type: "bytes32", - }, - { - internalType: "bytes32", - name: "s", - type: "bytes32", - }, - ], - name: "permit", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, - { - inputs: [], - name: "version", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "name", - outputs: [ - { - internalType: "string", - name: "", - type: "string", - }, - ], - stateMutability: "view", - type: "function", - }, -] as const; - -export class ERC20Permit__factory { - static readonly abi = _abi; - static createInterface(): ERC20PermitInterface { - return new Interface(_abi) as ERC20PermitInterface; - } - static connect(address: string, runner?: ContractRunner | null): ERC20Permit { - return new Contract(address, _abi, runner) as unknown as ERC20Permit; - } -} diff --git a/src/typechain-types/factories/ExchangeRouter__factory.ts b/src/typechain-types/factories/ExchangeRouter__factory.ts index f930bc4a33..bbef3dc8a5 100644 --- a/src/typechain-types/factories/ExchangeRouter__factory.ts +++ b/src/typechain-types/factories/ExchangeRouter__factory.ts @@ -147,22 +147,6 @@ const _abi = [ name: "EmptyTokenTranferGasLimit", type: "error", }, - { - inputs: [ - { - internalType: "uint256", - name: "marketsLength", - type: "uint256", - }, - { - internalType: "uint256", - name: "tokensLength", - type: "uint256", - }, - ], - name: "InvalidClaimAffiliateRewardsInput", - type: "error", - }, { inputs: [ { @@ -184,38 +168,6 @@ const _abi = [ name: "InvalidClaimCollateralInput", type: "error", }, - { - inputs: [ - { - internalType: "uint256", - name: "marketsLength", - type: "uint256", - }, - { - internalType: "uint256", - name: "tokensLength", - type: "uint256", - }, - ], - name: "InvalidClaimFundingFeesInput", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "marketsLength", - type: "uint256", - }, - { - internalType: "uint256", - name: "tokensLength", - type: "uint256", - }, - ], - name: "InvalidClaimUiFeesInput", - type: "error", - }, { inputs: [ { @@ -358,6 +310,25 @@ const _abi = [ name: "Unauthorized", type: "error", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, { inputs: [ { @@ -536,44 +507,51 @@ const _abi = [ { components: [ { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address", - name: "initialLongToken", - type: "address", - }, - { - internalType: "address", - name: "initialShortToken", - type: "address", - }, - { - internalType: "address[]", - name: "longTokenSwapPath", - type: "address[]", - }, - { - internalType: "address[]", - name: "shortTokenSwapPath", - type: "address[]", + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialLongToken", + type: "address", + }, + { + internalType: "address", + name: "initialShortToken", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IDepositUtils.CreateDepositParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -595,8 +573,13 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct DepositUtils.CreateDepositParams", + internalType: "struct IDepositUtils.CreateDepositParams", name: "params", type: "tuple", }, @@ -735,6 +718,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams", name: "params", @@ -757,29 +745,36 @@ const _abi = [ { components: [ { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "fromMarket", - type: "address", - }, - { - internalType: "address", - name: "toMarket", - type: "address", + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "fromMarket", + type: "address", + }, + { + internalType: "address", + name: "toMarket", + type: "address", + }, + ], + internalType: "struct IShiftUtils.CreateShiftParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -796,8 +791,13 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct ShiftUtils.CreateShiftParams", + internalType: "struct IShiftUtils.CreateShiftParams", name: "params", type: "tuple", }, @@ -818,34 +818,41 @@ const _abi = [ { components: [ { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address[]", - name: "longTokenSwapPath", - type: "address[]", - }, - { - internalType: "address[]", - name: "shortTokenSwapPath", - type: "address[]", + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -872,8 +879,13 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct WithdrawalUtils.CreateWithdrawalParams", + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", name: "params", type: "tuple", }, @@ -933,34 +945,41 @@ const _abi = [ { components: [ { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address[]", - name: "longTokenSwapPath", - type: "address[]", - }, - { - internalType: "address[]", - name: "shortTokenSwapPath", - type: "address[]", + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -987,8 +1006,13 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct WithdrawalUtils.CreateWithdrawalParams", + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", name: "params", type: "tuple", }, @@ -1058,7 +1082,7 @@ const _abi = [ ], name: "makeExternalCalls", outputs: [], - stateMutability: "nonpayable", + stateMutability: "payable", type: "function", }, { diff --git a/src/typechain-types/factories/GelatoRelayRouter__factory.ts b/src/typechain-types/factories/GelatoRelayRouter__factory.ts index f54cbad767..34e8a3d8dd 100644 --- a/src/typechain-types/factories/GelatoRelayRouter__factory.ts +++ b/src/typechain-types/factories/GelatoRelayRouter__factory.ts @@ -13,6 +13,11 @@ const _abi = [ name: "_router", type: "address", }, + { + internalType: "contract RoleStore", + name: "_roleStore", + type: "address", + }, { internalType: "contract DataStore", name: "_dataStore", @@ -24,7 +29,7 @@ const _abi = [ type: "address", }, { - internalType: "contract Oracle", + internalType: "contract IOracle", name: "_oracle", type: "address", }, @@ -38,6 +43,11 @@ const _abi = [ name: "_orderVault", type: "address", }, + { + internalType: "contract ISwapHandler", + name: "_swapHandler", + type: "address", + }, { internalType: "contract IExternalHandler", name: "_externalHandler", @@ -74,6 +84,11 @@ const _abi = [ name: "DisabledFeature", type: "error", }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, { inputs: [], name: "EmptyOrder", @@ -85,8 +100,14 @@ const _abi = [ type: "error", }, { - inputs: [], - name: "EmptyRelayFeeAddress", + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", type: "error", }, { @@ -105,6 +126,17 @@ const _abi = [ name: "InsufficientRelayFee", type: "error", }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, { inputs: [ { @@ -140,28 +172,23 @@ const _abi = [ { inputs: [ { - internalType: "string", - name: "signatureType", - type: "string", + internalType: "uint256", + name: "srcChainId", + type: "uint256", }, ], - name: "InvalidSignature", + name: "InvalidSrcChainId", type: "error", }, { inputs: [ { - internalType: "uint256", - name: "storedUserNonce", - type: "uint256", - }, - { - internalType: "uint256", - name: "userNonce", - type: "uint256", + internalType: "bytes32", + name: "digest", + type: "bytes32", }, ], - name: "InvalidUserNonce", + name: "InvalidUserDigest", type: "error", }, { @@ -185,20 +212,35 @@ const _abi = [ name: "NonEmptyExternalCallsForSubaccountOrder", type: "error", }, + { + inputs: [], + name: "RelayEmptyBatch", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, { inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, { internalType: "uint256", - name: "calldataLength", + name: "amount", type: "uint256", }, ], - name: "RelayCalldataTooLong", - type: "error", - }, - { - inputs: [], - name: "RelayEmptyBatch", + name: "TokenTransferError", type: "error", }, { @@ -250,43 +292,23 @@ const _abi = [ type: "error", }, { - inputs: [], - name: "DOMAIN_SEPARATOR_NAME_HASH", - outputs: [ + anonymous: false, + inputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + indexed: false, + internalType: "string", + name: "reason", + type: "string", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR_TYPEHASH", - outputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", }, ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR_VERSION_HASH", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", + name: "TokenTransferReverted", + type: "event", }, { inputs: [ @@ -347,7 +369,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -394,7 +416,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -416,7 +438,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -435,8 +457,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -568,6 +595,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams[]", name: "createOrderParamsList", @@ -616,7 +648,7 @@ const _abi = [ type: "uint256", }, ], - internalType: "struct UpdateOrderParams[]", + internalType: "struct IRelayUtils.UpdateOrderParams[]", name: "updateOrderParamsList", type: "tuple[]", }, @@ -626,7 +658,7 @@ const _abi = [ type: "bytes32[]", }, ], - internalType: "struct BatchParams", + internalType: "struct IRelayUtils.BatchParams", name: "params", type: "tuple", }, @@ -701,7 +733,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -748,7 +780,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -770,7 +802,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -789,8 +821,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -869,7 +906,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -916,7 +953,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -938,7 +975,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -957,8 +994,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -1088,6 +1130,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams", name: "params", @@ -1118,6 +1165,25 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "eventEmitter", @@ -1144,12 +1210,31 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, { inputs: [], name: "oracle", outputs: [ { - internalType: "contract Oracle", + internalType: "contract IOracle", name: "", type: "address", }, @@ -1183,6 +1268,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "router", @@ -1196,6 +1294,78 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -1255,7 +1425,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -1302,7 +1472,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -1324,7 +1494,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -1343,8 +1513,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -1396,7 +1571,7 @@ const _abi = [ type: "uint256", }, ], - internalType: "struct UpdateOrderParams", + internalType: "struct IRelayUtils.UpdateOrderParams", name: "params", type: "tuple", }, @@ -1406,25 +1581,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "userNonces", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, ] as const; export class GelatoRelayRouter__factory { diff --git a/src/typechain-types/factories/GlvReader__factory.ts b/src/typechain-types/factories/GlvReader__factory.ts index 67996945bd..7022c64f1f 100644 --- a/src/typechain-types/factories/GlvReader__factory.ts +++ b/src/typechain-types/factories/GlvReader__factory.ts @@ -148,6 +148,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvDeposit.Numbers", name: "numbers", @@ -170,6 +175,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvDeposit.Props[]", name: "", @@ -285,6 +295,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvWithdrawal.Numbers", name: "numbers", @@ -302,6 +317,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvWithdrawal.Props[]", name: "", @@ -504,6 +524,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvDeposit.Numbers", name: "numbers", @@ -526,6 +551,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvDeposit.Props", name: "", @@ -651,6 +681,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvDeposit.Numbers", name: "numbers", @@ -673,6 +708,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvDeposit.Props[]", name: "", @@ -1214,6 +1254,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvWithdrawal.Numbers", name: "numbers", @@ -1231,6 +1276,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvWithdrawal.Props", name: "", @@ -1341,6 +1391,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct GlvWithdrawal.Numbers", name: "numbers", @@ -1358,6 +1413,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct GlvWithdrawal.Props[]", name: "", diff --git a/src/typechain-types/factories/GlvRouter__factory.ts b/src/typechain-types/factories/GlvRouter__factory.ts index 009753ea24..963e73284c 100644 --- a/src/typechain-types/factories/GlvRouter__factory.ts +++ b/src/typechain-types/factories/GlvRouter__factory.ts @@ -29,8 +29,13 @@ const _abi = [ type: "address", }, { - internalType: "contract IGlvHandler", - name: "_glvHandler", + internalType: "contract IGlvDepositHandler", + name: "_glvDepositHandler", + type: "address", + }, + { + internalType: "contract IGlvWithdrawalHandler", + name: "_glvWithdrawalHandler", type: "address", }, { @@ -121,6 +126,25 @@ const _abi = [ name: "Unauthorized", type: "error", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, { inputs: [ { @@ -152,49 +176,56 @@ const _abi = [ { components: [ { - internalType: "address", - name: "glv", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "initialLongToken", - type: "address", - }, - { - internalType: "address", - name: "initialShortToken", - type: "address", - }, - { - internalType: "address[]", - name: "longTokenSwapPath", - type: "address[]", - }, - { - internalType: "address[]", - name: "shortTokenSwapPath", - type: "address[]", + components: [ + { + internalType: "address", + name: "glv", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "initialLongToken", + type: "address", + }, + { + internalType: "address", + name: "initialShortToken", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -221,8 +252,13 @@ const _abi = [ name: "isMarketTokenDeposit", type: "bool", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct GlvDepositUtils.CreateGlvDepositParams", + internalType: "struct IGlvDepositUtils.CreateGlvDepositParams", name: "params", type: "tuple", }, @@ -243,39 +279,46 @@ const _abi = [ { components: [ { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address", - name: "glv", - type: "address", - }, - { - internalType: "address[]", - name: "longTokenSwapPath", - type: "address[]", - }, - { - internalType: "address[]", - name: "shortTokenSwapPath", - type: "address[]", + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "glv", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", }, { internalType: "uint256", @@ -302,8 +345,13 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], - internalType: "struct GlvWithdrawalUtils.CreateGlvWithdrawalParams", + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", name: "params", type: "tuple", }, @@ -360,10 +408,23 @@ const _abi = [ }, { inputs: [], - name: "glvHandler", + name: "glvDepositHandler", outputs: [ { - internalType: "contract IGlvHandler", + internalType: "contract IGlvDepositHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvWithdrawalHandler", + outputs: [ + { + internalType: "contract IGlvWithdrawalHandler", name: "", type: "address", }, @@ -396,7 +457,7 @@ const _abi = [ ], name: "makeExternalCalls", outputs: [], - stateMutability: "nonpayable", + stateMutability: "payable", type: "function", }, { diff --git a/src/typechain-types/factories/LayerZeroProvider__factory.ts b/src/typechain-types/factories/LayerZeroProvider__factory.ts new file mode 100644 index 0000000000..c6a434a2a8 --- /dev/null +++ b/src/typechain-types/factories/LayerZeroProvider__factory.ts @@ -0,0 +1,387 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { LayerZeroProvider, LayerZeroProviderInterface } from "../LayerZeroProvider"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract DataStore", + name: "_dataStore", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "_roleStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "_eventEmitter", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "_multichainVault", + type: "address", + }, + { + internalType: "contract IMultichainGmRouter", + name: "_multichainGmRouter", + type: "address", + }, + { + internalType: "contract IMultichainGlvRouter", + name: "_multichainGlvRouter", + type: "address", + }, + { + internalType: "contract IMultichainOrderRouter", + name: "_multichainOrderRouter", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [], + name: "EmptyWithdrawalAmount", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "gas", + type: "uint256", + }, + { + internalType: "uint256", + name: "estimatedGasLimit", + type: "uint256", + }, + ], + name: "InsufficientGasLeft", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "InvalidBridgeOutToken", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "eid", + type: "uint256", + }, + ], + name: "InvalidEid", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountOut", + type: "uint256", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOut", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address", + }, + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + { + internalType: "bytes", + name: "message", + type: "bytes", + }, + { + internalType: "address", + name: "", + type: "address", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "lzCompose", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainGlvRouter", + outputs: [ + { + internalType: "contract IMultichainGlvRouter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainGmRouter", + outputs: [ + { + internalType: "contract IMultichainGmRouter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainOrderRouter", + outputs: [ + { + internalType: "contract IMultichainOrderRouter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "withdrawTokens", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class LayerZeroProvider__factory { + static readonly abi = _abi; + static createInterface(): LayerZeroProviderInterface { + return new Interface(_abi) as LayerZeroProviderInterface; + } + static connect(address: string, runner?: ContractRunner | null): LayerZeroProvider { + return new Contract(address, _abi, runner) as unknown as LayerZeroProvider; + } +} diff --git a/src/typechain-types/factories/Multicall__factory.ts b/src/typechain-types/factories/Multicall__factory.ts index 6e1d40130a..b14978276b 100644 --- a/src/typechain-types/factories/Multicall__factory.ts +++ b/src/typechain-types/factories/Multicall__factory.ts @@ -21,7 +21,7 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Call[]", + internalType: "struct Multicall3.Call[]", name: "calls", type: "tuple[]", }, @@ -39,7 +39,108 @@ const _abi = [ type: "bytes[]", }, ], - stateMutability: "nonpayable", + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool", + }, + { + internalType: "bytes", + name: "callData", + type: "bytes", + }, + ], + internalType: "struct Multicall3.Call3[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool", + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes", + }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address", + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "bytes", + name: "callData", + type: "bytes", + }, + ], + internalType: "struct Multicall3.Call3Value[]", + name: "calls", + type: "tuple[]", + }, + ], + name: "aggregate3Value", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool", + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes", + }, + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]", + }, + ], + stateMutability: "payable", type: "function", }, { @@ -57,7 +158,7 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Call[]", + internalType: "struct Multicall3.Call[]", name: "calls", type: "tuple[]", }, @@ -87,12 +188,25 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Result[]", + internalType: "struct Multicall3.Result[]", name: "returnData", type: "tuple[]", }, ], - stateMutability: "nonpayable", + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "getBasefee", + outputs: [ + { + internalType: "uint256", + name: "basefee", + type: "uint256", + }, + ], + stateMutability: "view", type: "function", }, { @@ -129,12 +243,12 @@ const _abi = [ }, { inputs: [], - name: "getCurrentBlockCoinbase", + name: "getChainId", outputs: [ { - internalType: "address", - name: "coinbase", - type: "address", + internalType: "uint256", + name: "chainid", + type: "uint256", }, ], stateMutability: "view", @@ -142,12 +256,12 @@ const _abi = [ }, { inputs: [], - name: "getCurrentBlockDifficulty", + name: "getCurrentBlockCoinbase", outputs: [ { - internalType: "uint256", - name: "difficulty", - type: "uint256", + internalType: "address", + name: "coinbase", + type: "address", }, ], stateMutability: "view", @@ -198,19 +312,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - inputs: [], - name: "getL1BlockNumber", - outputs: [ - { - internalType: "uint256", - name: "l1BlockNumber", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, { inputs: [], name: "getLastBlockHash", @@ -244,7 +345,7 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Call[]", + internalType: "struct Multicall3.Call[]", name: "calls", type: "tuple[]", }, @@ -264,12 +365,12 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Result[]", + internalType: "struct Multicall3.Result[]", name: "returnData", type: "tuple[]", }, ], - stateMutability: "nonpayable", + stateMutability: "payable", type: "function", }, { @@ -292,7 +393,7 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Call[]", + internalType: "struct Multicall3.Call[]", name: "calls", type: "tuple[]", }, @@ -322,12 +423,12 @@ const _abi = [ type: "bytes", }, ], - internalType: "struct Multicall2.Result[]", + internalType: "struct Multicall3.Result[]", name: "returnData", type: "tuple[]", }, ], - stateMutability: "nonpayable", + stateMutability: "payable", type: "function", }, ] as const; diff --git a/src/typechain-types/factories/MultichainClaimsRouter__factory.ts b/src/typechain-types/factories/MultichainClaimsRouter__factory.ts new file mode 100644 index 0000000000..72418d9137 --- /dev/null +++ b/src/typechain-types/factories/MultichainClaimsRouter__factory.ts @@ -0,0 +1,1285 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { + MultichainClaimsRouter, + MultichainClaimsRouterInterface, + MultichainRouter, +} from "../MultichainClaimsRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "adjustedClaimableAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "claimedAmount", + type: "uint256", + }, + ], + name: "CollateralAlreadyClaimed", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "market", + type: "address", + }, + ], + name: "DisabledMarket", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyAddressInMarketTokenBalanceValidation", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyMarket", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "marketsLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "tokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "timeKeysLength", + type: "uint256", + }, + ], + name: "InvalidClaimCollateralInput", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + ], + name: "InvalidClaimableFactor", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + { + internalType: "uint256", + name: "expectedMinBalance", + type: "uint256", + }, + ], + name: "InvalidMarketTokenBalance", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + { + internalType: "uint256", + name: "claimableFundingFeeAmount", + type: "uint256", + }, + ], + name: "InvalidMarketTokenBalanceForClaimableFunding", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + { + internalType: "uint256", + name: "collateralAmount", + type: "uint256", + }, + ], + name: "InvalidMarketTokenBalanceForCollateralAmount", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address[]", + name: "markets", + type: "address[]", + }, + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "claimAffiliateRewards", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address[]", + name: "markets", + type: "address[]", + }, + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "timeKeys", + type: "uint256[]", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "claimCollateral", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address[]", + name: "markets", + type: "address[]", + }, + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "claimFundingFees", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class MultichainClaimsRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainClaimsRouterInterface { + return new Interface(_abi) as MultichainClaimsRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainClaimsRouter { + return new Contract(address, _abi, runner) as unknown as MultichainClaimsRouter; + } +} diff --git a/src/typechain-types/factories/MultichainGlvRouter__factory.ts b/src/typechain-types/factories/MultichainGlvRouter__factory.ts new file mode 100644 index 0000000000..fd19c5c43e --- /dev/null +++ b/src/typechain-types/factories/MultichainGlvRouter__factory.ts @@ -0,0 +1,1165 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { MultichainGlvRouter, MultichainGlvRouterInterface, MultichainRouter } from "../MultichainGlvRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { + internalType: "contract IGlvDepositHandler", + name: "_glvDepositHandler", + type: "address", + }, + { + internalType: "contract IGlvWithdrawalHandler", + name: "_glvWithdrawalHandler", + type: "address", + }, + { + internalType: "contract GlvVault", + name: "_glvVault", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [], + name: "InvalidTransferRequestsLength", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "receivers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "glv", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "initialLongToken", + type: "address", + }, + { + internalType: "address", + name: "initialShortToken", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + internalType: "uint256", + name: "minGlvTokens", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "isMarketTokenDeposit", + type: "bool", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IGlvDepositUtils.CreateGlvDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvDeposit", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "receivers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "glv", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + internalType: "uint256", + name: "minLongTokenAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minShortTokenAmount", + type: "uint256", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IGlvWithdrawalUtils.CreateGlvWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createGlvWithdrawal", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvDepositHandler", + outputs: [ + { + internalType: "contract IGlvDepositHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvVault", + outputs: [ + { + internalType: "contract GlvVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "glvWithdrawalHandler", + outputs: [ + { + internalType: "contract IGlvWithdrawalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class MultichainGlvRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainGlvRouterInterface { + return new Interface(_abi) as MultichainGlvRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainGlvRouter { + return new Contract(address, _abi, runner) as unknown as MultichainGlvRouter; + } +} diff --git a/src/typechain-types/factories/MultichainGmRouter__factory.ts b/src/typechain-types/factories/MultichainGmRouter__factory.ts new file mode 100644 index 0000000000..3095c7fb33 --- /dev/null +++ b/src/typechain-types/factories/MultichainGmRouter__factory.ts @@ -0,0 +1,1464 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { MultichainGmRouter, MultichainGmRouterInterface, MultichainRouter } from "../MultichainGmRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { + internalType: "contract DepositVault", + name: "_depositVault", + type: "address", + }, + { + internalType: "contract IDepositHandler", + name: "_depositHandler", + type: "address", + }, + { + internalType: "contract WithdrawalVault", + name: "_withdrawalVault", + type: "address", + }, + { + internalType: "contract IWithdrawalHandler", + name: "_withdrawalHandler", + type: "address", + }, + { + internalType: "contract ShiftVault", + name: "_shiftVault", + type: "address", + }, + { + internalType: "contract IShiftHandler", + name: "_shiftHandler", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [], + name: "InvalidTransferRequestsLength", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "receivers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialLongToken", + type: "address", + }, + { + internalType: "address", + name: "initialShortToken", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IDepositUtils.CreateDepositParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + internalType: "uint256", + name: "minMarketTokens", + type: "uint256", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IDepositUtils.CreateDepositParams", + name: "params", + type: "tuple", + }, + ], + name: "createDeposit", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "receivers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "fromMarket", + type: "address", + }, + { + internalType: "address", + name: "toMarket", + type: "address", + }, + ], + internalType: "struct IShiftUtils.CreateShiftParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + internalType: "uint256", + name: "minMarketTokens", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IShiftUtils.CreateShiftParams", + name: "params", + type: "tuple", + }, + ], + name: "createShift", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "receivers", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]", + }, + ], + internalType: "struct IRelayUtils.TransferRequests", + name: "transferRequests", + type: "tuple", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address[]", + name: "longTokenSwapPath", + type: "address[]", + }, + { + internalType: "address[]", + name: "shortTokenSwapPath", + type: "address[]", + }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + internalType: "uint256", + name: "minLongTokenAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minShortTokenAmount", + type: "uint256", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IWithdrawalUtils.CreateWithdrawalParams", + name: "params", + type: "tuple", + }, + ], + name: "createWithdrawal", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "depositHandler", + outputs: [ + { + internalType: "contract IDepositHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "depositVault", + outputs: [ + { + internalType: "contract DepositVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "shiftHandler", + outputs: [ + { + internalType: "contract IShiftHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "shiftVault", + outputs: [ + { + internalType: "contract ShiftVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawalHandler", + outputs: [ + { + internalType: "contract IWithdrawalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawalVault", + outputs: [ + { + internalType: "contract WithdrawalVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, +] as const; + +export class MultichainGmRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainGmRouterInterface { + return new Interface(_abi) as MultichainGmRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainGmRouter { + return new Contract(address, _abi, runner) as unknown as MultichainGmRouter; + } +} diff --git a/src/typechain-types/factories/MultichainOrderRouter__factory.ts b/src/typechain-types/factories/MultichainOrderRouter__factory.ts new file mode 100644 index 0000000000..04b55da7d1 --- /dev/null +++ b/src/typechain-types/factories/MultichainOrderRouter__factory.ts @@ -0,0 +1,1835 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { MultichainOrderRouter, MultichainOrderRouterInterface, MultichainRouter } from "../MultichainOrderRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + { + internalType: "contract IReferralStorage", + name: "_referralStorage", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyOrder", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "RelayEmptyBatch", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "cancellationReceiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialCollateralToken", + type: "address", + }, + { + internalType: "address[]", + name: "swapPath", + type: "address[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "initialCollateralDeltaAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { + internalType: "enum Order.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { + internalType: "bool", + name: "isLong", + type: "bool", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "bytes32", + name: "referralCode", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFeeIncrease", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { + internalType: "bytes32[]", + name: "cancelOrderKeys", + type: "bytes32[]", + }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "cancellationReceiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialCollateralToken", + type: "address", + }, + { + internalType: "address[]", + name: "swapPath", + type: "address[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "initialCollateralDeltaAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { + internalType: "enum Order.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { + internalType: "bool", + name: "isLong", + type: "bool", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "bytes32", + name: "referralCode", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "referralStorage", + outputs: [ + { + internalType: "contract IReferralStorage", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "bytes32", + name: "referralCode", + type: "bytes32", + }, + ], + name: "setTraderReferralCode", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFeeIncrease", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class MultichainOrderRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainOrderRouterInterface { + return new Interface(_abi) as MultichainOrderRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainOrderRouter { + return new Contract(address, _abi, runner) as unknown as MultichainOrderRouter; + } +} diff --git a/src/typechain-types/factories/MultichainSubaccountRouter__factory.ts b/src/typechain-types/factories/MultichainSubaccountRouter__factory.ts new file mode 100644 index 0000000000..972f99f9b0 --- /dev/null +++ b/src/typechain-types/factories/MultichainSubaccountRouter__factory.ts @@ -0,0 +1,2088 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { + MultichainSubaccountRouter, + MultichainSubaccountRouterInterface, + MultichainRouter, +} from "../MultichainSubaccountRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyOrder", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "RelayEmptyBatch", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bool", + name: "shouldAdd", + type: "bool", + }, + { + internalType: "uint256", + name: "expiresAt", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxAllowedCount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "actionType", + type: "bytes32", + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + components: [ + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "cancellationReceiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialCollateralToken", + type: "address", + }, + { + internalType: "address[]", + name: "swapPath", + type: "address[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "initialCollateralDeltaAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { + internalType: "enum Order.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { + internalType: "bool", + name: "isLong", + type: "bool", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "bytes32", + name: "referralCode", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams[]", + name: "createOrderParamsList", + type: "tuple[]", + }, + { + components: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFeeIncrease", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams[]", + name: "updateOrderParamsList", + type: "tuple[]", + }, + { + internalType: "bytes32[]", + name: "cancelOrderKeys", + type: "bytes32[]", + }, + ], + internalType: "struct IRelayUtils.BatchParams", + name: "params", + type: "tuple", + }, + ], + name: "batch", + outputs: [ + { + internalType: "bytes32[]", + name: "", + type: "bytes32[]", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bool", + name: "shouldAdd", + type: "bool", + }, + { + internalType: "uint256", + name: "expiresAt", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxAllowedCount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "actionType", + type: "bytes32", + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "cancelOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bool", + name: "shouldAdd", + type: "bool", + }, + { + internalType: "uint256", + name: "expiresAt", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxAllowedCount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "actionType", + type: "bytes32", + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + components: [ + { + components: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "cancellationReceiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialCollateralToken", + type: "address", + }, + { + internalType: "address[]", + name: "swapPath", + type: "address[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsAddresses", + name: "addresses", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "initialCollateralDeltaAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParamsNumbers", + name: "numbers", + type: "tuple", + }, + { + internalType: "enum Order.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { + internalType: "bool", + name: "isLong", + type: "bool", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "bytes32", + name: "referralCode", + type: "bytes32", + }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, + ], + internalType: "struct IBaseOrderUtils.CreateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "createOrder", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address", + name: "subaccount", + type: "address", + }, + ], + name: "removeSubaccount", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "subaccountApprovalNonces", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bool", + name: "shouldAdd", + type: "bool", + }, + { + internalType: "uint256", + name: "expiresAt", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxAllowedCount", + type: "uint256", + }, + { + internalType: "bytes32", + name: "actionType", + type: "bytes32", + }, + { + internalType: "uint256", + name: "nonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + ], + internalType: "struct SubaccountApproval", + name: "subaccountApproval", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + components: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + { + internalType: "uint256", + name: "executionFeeIncrease", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.UpdateOrderParams", + name: "params", + type: "tuple", + }, + ], + name: "updateOrder", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class MultichainSubaccountRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainSubaccountRouterInterface { + return new Interface(_abi) as MultichainSubaccountRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainSubaccountRouter { + return new Contract(address, _abi, runner) as unknown as MultichainSubaccountRouter; + } +} diff --git a/src/typechain-types/factories/MultichainTransferRouter__factory.ts b/src/typechain-types/factories/MultichainTransferRouter__factory.ts new file mode 100644 index 0000000000..5c85b398e1 --- /dev/null +++ b/src/typechain-types/factories/MultichainTransferRouter__factory.ts @@ -0,0 +1,934 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { + MultichainTransferRouter, + MultichainTransferRouterInterface, + MultichainRouter, +} from "../MultichainTransferRouter"; + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "contract Router", + name: "router", + type: "address", + }, + { + internalType: "contract RoleStore", + name: "roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "dataStore", + type: "address", + }, + { + internalType: "contract EventEmitter", + name: "eventEmitter", + type: "address", + }, + { + internalType: "contract IOracle", + name: "oracle", + type: "address", + }, + { + internalType: "contract OrderVault", + name: "orderVault", + type: "address", + }, + { + internalType: "contract IOrderHandler", + name: "orderHandler", + type: "address", + }, + { + internalType: "contract ISwapHandler", + name: "swapHandler", + type: "address", + }, + { + internalType: "contract IExternalHandler", + name: "externalHandler", + type: "address", + }, + { + internalType: "contract MultichainVault", + name: "multichainVault", + type: "address", + }, + ], + internalType: "struct MultichainRouter.BaseConstructorParams", + name: "params", + type: "tuple", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [ + { + internalType: "uint256", + name: "currentTimestamp", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + ], + name: "DeadlinePassed", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "key", + type: "bytes32", + }, + ], + name: "DisabledFeature", + type: "error", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "requiredRelayFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "availableFeeAmount", + type: "uint256", + }, + ], + name: "InsufficientRelayFee", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + name: "InvalidDestinationChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "sendTokensLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "sendAmountsLength", + type: "uint256", + }, + ], + name: "InvalidExternalCalls", + type: "error", + }, + { + inputs: [], + name: "InvalidInitializer", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "provider", + type: "address", + }, + ], + name: "InvalidMultichainProvider", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "address", + name: "expectedSpender", + type: "address", + }, + ], + name: "InvalidPermitSpender", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + name: "InvalidSrcChainId", + type: "error", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "digest", + type: "bytes32", + }, + ], + name: "InvalidUserDigest", + type: "error", + }, + { + inputs: [ + { + internalType: "uint256", + name: "feeUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxFeeUsd", + type: "uint256", + }, + ], + name: "MaxRelayFeeSwapForSubaccountExceeded", + type: "error", + }, + { + inputs: [], + name: "NonEmptyExternalCallsForSubaccountOrder", + type: "error", + }, + { + inputs: [], + name: "TokenPermitsNotAllowedForMultichain", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnexpectedRelayFeeToken", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "address", + name: "expectedFeeToken", + type: "address", + }, + ], + name: "UnsupportedRelayFeeToken", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "version", + type: "uint8", + }, + ], + name: "Initialized", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "bridgeIn", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + components: [ + { + components: [ + { + internalType: "address[]", + name: "tokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "providers", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", + }, + { + components: [ + { + internalType: "address[]", + name: "sendTokens", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "sendAmounts", + type: "uint256[]", + }, + { + internalType: "address[]", + name: "externalCallTargets", + type: "address[]", + }, + { + internalType: "bytes[]", + name: "externalCallDataList", + type: "bytes[]", + }, + { + internalType: "address[]", + name: "refundTokens", + type: "address[]", + }, + { + internalType: "address[]", + name: "refundReceivers", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.ExternalCalls", + name: "externalCalls", + type: "tuple", + }, + { + components: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "value", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "uint8", + name: "v", + type: "uint8", + }, + { + internalType: "bytes32", + name: "r", + type: "bytes32", + }, + { + internalType: "bytes32", + name: "s", + type: "bytes32", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + internalType: "struct IRelayUtils.TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", + }, + { + components: [ + { + internalType: "address", + name: "feeToken", + type: "address", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address[]", + name: "feeSwapPath", + type: "address[]", + }, + ], + internalType: "struct IRelayUtils.FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + internalType: "bytes", + name: "signature", + type: "bytes", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + ], + internalType: "struct IRelayUtils.RelayParams", + name: "relayParams", + type: "tuple", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + components: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountOut", + type: "uint256", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, + { + internalType: "uint256", + name: "deadline", + type: "uint256", + }, + { + components: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountOut", + type: "uint256", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "bridgeOutFromController", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "eventEmitter", + outputs: [ + { + internalType: "contract EventEmitter", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "externalHandler", + outputs: [ + { + internalType: "contract IExternalHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_multichainProvider", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "multichainProvider", + outputs: [ + { + internalType: "contract IMultichainProvider", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "multichainVault", + outputs: [ + { + internalType: "contract MultichainVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract IOracle", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderHandler", + outputs: [ + { + internalType: "contract IOrderHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "orderVault", + outputs: [ + { + internalType: "contract OrderVault", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "router", + outputs: [ + { + internalType: "contract Router", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "uint256", + name: "minAmountOut", + type: "uint256", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + { + internalType: "bytes", + name: "data", + type: "bytes", + }, + ], + internalType: "struct IRelayUtils.BridgeOutParams", + name: "params", + type: "tuple", + }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, +] as const; + +export class MultichainTransferRouter__factory { + static readonly abi = _abi; + static createInterface(): MultichainTransferRouterInterface { + return new Interface(_abi) as MultichainTransferRouterInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainTransferRouter { + return new Contract(address, _abi, runner) as unknown as MultichainTransferRouter; + } +} diff --git a/src/typechain-types/factories/MultichainUtils__factory.ts b/src/typechain-types/factories/MultichainUtils__factory.ts new file mode 100644 index 0000000000..7c737bd85f --- /dev/null +++ b/src/typechain-types/factories/MultichainUtils__factory.ts @@ -0,0 +1,148 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { MultichainUtils, MultichainUtilsInterface } from "../MultichainUtils"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyMultichainTransferInAmount", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "uint256", + name: "balance", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "InsufficientMultichainBalance", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "endpoint", + type: "address", + }, + ], + name: "InvalidMultichainEndpoint", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "provider", + type: "address", + }, + ], + name: "InvalidMultichainProvider", + type: "error", + }, + { + inputs: [ + { + internalType: "contract DataStore", + name: "dataStore", + type: "DataStore", + }, + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "getMultichainBalanceAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract DataStore", + name: "dataStore", + type: "DataStore", + }, + { + internalType: "address", + name: "endpoint", + type: "address", + }, + ], + name: "validateMultichainEndpoint", + outputs: [], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "contract DataStore", + name: "dataStore", + type: "DataStore", + }, + { + internalType: "address", + name: "provider", + type: "address", + }, + ], + name: "validateMultichainProvider", + outputs: [], + stateMutability: "view", + type: "function", + }, +] as const; + +export class MultichainUtils__factory { + static readonly abi = _abi; + static createInterface(): MultichainUtilsInterface { + return new Interface(_abi) as MultichainUtilsInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainUtils { + return new Contract(address, _abi, runner) as unknown as MultichainUtils; + } +} diff --git a/src/typechain-types/factories/MultichainVault__factory.ts b/src/typechain-types/factories/MultichainVault__factory.ts new file mode 100644 index 0000000000..70a704ad0b --- /dev/null +++ b/src/typechain-types/factories/MultichainVault__factory.ts @@ -0,0 +1,290 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Interface, type ContractRunner } from "ethers"; +import type { MultichainVault, MultichainVaultInterface } from "../MultichainVault"; + +const _abi = [ + { + inputs: [ + { + internalType: "contract RoleStore", + name: "_roleStore", + type: "address", + }, + { + internalType: "contract DataStore", + name: "_dataStore", + type: "address", + }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, + { + inputs: [], + name: "EmptyReceiver", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + ], + name: "InvalidNativeTokenSender", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "SelfTransferNotSupported", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "TokenTransferError", + type: "error", + }, + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + { + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", + }, + ], + name: "TokenTransferReverted", + type: "event", + }, + { + inputs: [], + name: "dataStore", + outputs: [ + { + internalType: "contract DataStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "recordTransferIn", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "syncTokenBalance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "tokenBalances", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + ], + name: "transferOut", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferOutNativeToken", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, +] as const; + +export class MultichainVault__factory { + static readonly abi = _abi; + static createInterface(): MultichainVaultInterface { + return new Interface(_abi) as MultichainVaultInterface; + } + static connect(address: string, runner?: ContractRunner | null): MultichainVault { + return new Contract(address, _abi, runner) as unknown as MultichainVault; + } +} diff --git a/src/typechain-types/factories/ReferralStorage__factory.ts b/src/typechain-types/factories/ReferralStorage__factory.ts index d0cd39f705..208397afbd 100644 --- a/src/typechain-types/factories/ReferralStorage__factory.ts +++ b/src/typechain-types/factories/ReferralStorage__factory.ts @@ -6,6 +6,22 @@ import { Contract, Interface, type ContractRunner } from "ethers"; import type { ReferralStorage, ReferralStorageInterface } from "../ReferralStorage"; const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "msgSender", + type: "address", + }, + { + internalType: "string", + name: "role", + type: "string", + }, + ], + name: "Unauthorized", + type: "error", + }, { anonymous: false, inputs: [ @@ -69,6 +85,25 @@ const _abi = [ name: "SetCodeOwner", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "prevGov", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "nextGov", + type: "address", + }, + ], + name: "SetGov", + type: "event", + }, { anonymous: false, inputs: [ @@ -183,6 +218,13 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "acceptOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, { inputs: [ { @@ -276,6 +318,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "pendingGov", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -345,19 +400,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "address", - name: "_gov", - type: "address", - }, - ], - name: "setGov", - outputs: [], - stateMutability: "nonpayable", - type: "function", - }, { inputs: [ { @@ -504,6 +546,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "_newGov", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, ] as const; export class ReferralStorage__factory { diff --git a/src/typechain-types/factories/RelayParams__factory.ts b/src/typechain-types/factories/RelayParams__factory.ts index 8fefc8ce37..14f850683c 100644 --- a/src/typechain-types/factories/RelayParams__factory.ts +++ b/src/typechain-types/factories/RelayParams__factory.ts @@ -7,109 +7,146 @@ import type { RelayParams, RelayParamsInterface } from "../RelayParams"; const _abi = [ { - type: "tuple", components: [ { - type: "address[]", + internalType: "address[]", name: "tokens", + type: "address[]", }, { - type: "address[]", + internalType: "address[]", name: "providers", + type: "address[]", }, { - type: "bytes[]", + internalType: "bytes[]", name: "data", + type: "bytes[]", }, ], + internalType: "struct OracleUtils.SetPricesParams", + name: "oracleParams", + type: "tuple", }, { - type: "tuple", components: [ { - type: "address[]", + internalType: "address[]", name: "sendTokens", + type: "address[]", }, { - type: "uint256[]", + internalType: "uint256[]", name: "sendAmounts", + type: "uint256[]", }, { - type: "address[]", + internalType: "address[]", name: "externalCallTargets", + type: "address[]", }, { - type: "bytes[]", + internalType: "bytes[]", name: "externalCallDataList", + type: "bytes[]", }, { - type: "address[]", + internalType: "address[]", name: "refundTokens", + type: "address[]", }, { - type: "address[]", + internalType: "address[]", name: "refundReceivers", + type: "address[]", }, ], + internalType: "struct ExternalCalls", + name: "externalCalls", + type: "tuple", }, { - type: "tuple[]", components: [ { - type: "address", + internalType: "address", name: "owner", + type: "address", }, { - type: "address", + internalType: "address", name: "spender", + type: "address", }, { - type: "uint256", + internalType: "uint256", name: "value", + type: "uint256", }, { - type: "uint256", + internalType: "uint256", name: "deadline", + type: "uint256", }, { - type: "uint8", + internalType: "uint8", name: "v", + type: "uint8", }, { - type: "bytes32", + internalType: "bytes32", name: "r", + type: "bytes32", }, { - type: "bytes32", + internalType: "bytes32", name: "s", + type: "bytes32", }, { - type: "address", + internalType: "address", name: "token", + type: "address", }, ], + internalType: "struct TokenPermit[]", + name: "tokenPermits", + type: "tuple[]", }, { - type: "tuple", components: [ { - type: "address", + internalType: "address", name: "feeToken", + type: "address", }, { - type: "uint256", + internalType: "uint256", name: "feeAmount", + type: "uint256", }, { - type: "address[]", + internalType: "address[]", name: "feeSwapPath", + type: "address[]", }, ], + internalType: "struct FeeParams", + name: "fee", + type: "tuple", + }, + { + internalType: "uint256", + name: "userNonce", + type: "uint256", }, { + internalType: "uint256", + name: "deadline", type: "uint256", }, { + internalType: "uint256", + name: "desChainId", type: "uint256", }, ] as const; diff --git a/src/typechain-types/factories/SubaccountGelatoRelayRouter__factory.ts b/src/typechain-types/factories/SubaccountGelatoRelayRouter__factory.ts index bb2dcb2548..a6230e907f 100644 --- a/src/typechain-types/factories/SubaccountGelatoRelayRouter__factory.ts +++ b/src/typechain-types/factories/SubaccountGelatoRelayRouter__factory.ts @@ -13,6 +13,11 @@ const _abi = [ name: "_router", type: "address", }, + { + internalType: "contract RoleStore", + name: "_roleStore", + type: "address", + }, { internalType: "contract DataStore", name: "_dataStore", @@ -24,7 +29,7 @@ const _abi = [ type: "address", }, { - internalType: "contract Oracle", + internalType: "contract IOracle", name: "_oracle", type: "address", }, @@ -38,6 +43,11 @@ const _abi = [ name: "_orderVault", type: "address", }, + { + internalType: "contract ISwapHandler", + name: "_swapHandler", + type: "address", + }, { internalType: "contract IExternalHandler", name: "_externalHandler", @@ -74,6 +84,11 @@ const _abi = [ name: "DisabledFeature", type: "error", }, + { + inputs: [], + name: "EmptyHoldingAddress", + type: "error", + }, { inputs: [], name: "EmptyOrder", @@ -85,8 +100,14 @@ const _abi = [ type: "error", }, { - inputs: [], - name: "EmptyRelayFeeAddress", + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + ], + name: "EmptyTokenTranferGasLimit", type: "error", }, { @@ -108,17 +129,12 @@ const _abi = [ { inputs: [ { - internalType: "address", - name: "cancellationReceiver", - type: "address", - }, - { - internalType: "address", - name: "expectedCancellationReceiver", - type: "address", + internalType: "uint256", + name: "desChainId", + type: "uint256", }, ], - name: "InvalidCancellationReceiverForSubaccountOrder", + name: "InvalidDestinationChainId", type: "error", }, { @@ -155,61 +171,24 @@ const _abi = [ }, { inputs: [ - { - internalType: "address", - name: "receiver", - type: "address", - }, - ], - name: "InvalidReceiver", - type: "error", - }, - { - inputs: [ - { - internalType: "string", - name: "signatureType", - type: "string", - }, - ], - name: "InvalidSignature", - type: "error", - }, - { - inputs: [ - { - internalType: "uint256", - name: "storedNonce", - type: "uint256", - }, { internalType: "uint256", - name: "nonce", + name: "srcChainId", type: "uint256", }, ], - name: "InvalidSubaccountApprovalNonce", - type: "error", - }, - { - inputs: [], - name: "InvalidSubaccountApprovalSubaccount", + name: "InvalidSrcChainId", type: "error", }, { inputs: [ { - internalType: "uint256", - name: "storedUserNonce", - type: "uint256", - }, - { - internalType: "uint256", - name: "userNonce", - type: "uint256", + internalType: "bytes32", + name: "digest", + type: "bytes32", }, ], - name: "InvalidUserNonce", + name: "InvalidUserDigest", type: "error", }, { @@ -234,35 +213,34 @@ const _abi = [ type: "error", }, { - inputs: [ - { - internalType: "uint256", - name: "calldataLength", - type: "uint256", - }, - ], - name: "RelayCalldataTooLong", + inputs: [], + name: "RelayEmptyBatch", type: "error", }, { inputs: [], - name: "RelayEmptyBatch", + name: "TokenPermitsNotAllowedForMultichain", type: "error", }, { inputs: [ { - internalType: "uint256", - name: "currentTimestamp", - type: "uint256", + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", }, { internalType: "uint256", - name: "deadline", + name: "amount", type: "uint256", }, ], - name: "SubaccountApprovalDeadlinePassed", + name: "TokenTransferError", type: "error", }, { @@ -314,43 +292,23 @@ const _abi = [ type: "error", }, { - inputs: [], - name: "DOMAIN_SEPARATOR_NAME_HASH", - outputs: [ + anonymous: false, + inputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + indexed: false, + internalType: "string", + name: "reason", + type: "string", }, - ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR_TYPEHASH", - outputs: [ { - internalType: "bytes32", - name: "", - type: "bytes32", + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", }, ], - stateMutability: "view", - type: "function", - }, - { - inputs: [], - name: "DOMAIN_SEPARATOR_VERSION_HASH", - outputs: [ - { - internalType: "bytes32", - name: "", - type: "bytes32", - }, - ], - stateMutability: "view", - type: "function", + name: "TokenTransferReverted", + type: "event", }, { inputs: [ @@ -411,7 +369,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -458,7 +416,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -480,7 +438,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -499,8 +457,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -536,11 +499,21 @@ const _abi = [ name: "nonce", type: "uint256", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, { internalType: "uint256", name: "deadline", type: "uint256", }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, { internalType: "bytes", name: "signature", @@ -684,6 +657,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams[]", name: "createOrderParamsList", @@ -732,7 +710,7 @@ const _abi = [ type: "uint256", }, ], - internalType: "struct UpdateOrderParams[]", + internalType: "struct IRelayUtils.UpdateOrderParams[]", name: "updateOrderParamsList", type: "tuple[]", }, @@ -742,7 +720,7 @@ const _abi = [ type: "bytes32[]", }, ], - internalType: "struct BatchParams", + internalType: "struct IRelayUtils.BatchParams", name: "params", type: "tuple", }, @@ -817,7 +795,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -864,7 +842,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -886,7 +864,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -905,8 +883,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -942,11 +925,21 @@ const _abi = [ name: "nonce", type: "uint256", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, { internalType: "uint256", name: "deadline", type: "uint256", }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, { internalType: "bytes", name: "signature", @@ -1037,7 +1030,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -1084,7 +1077,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -1106,7 +1099,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -1125,8 +1118,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -1162,11 +1160,21 @@ const _abi = [ name: "nonce", type: "uint256", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, { internalType: "uint256", name: "deadline", type: "uint256", }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, { internalType: "bytes", name: "signature", @@ -1308,6 +1316,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams", name: "params", @@ -1338,6 +1351,25 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + name: "digests", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "eventEmitter", @@ -1364,12 +1396,31 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]", + }, + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]", + }, + ], + stateMutability: "payable", + type: "function", + }, { inputs: [], name: "oracle", outputs: [ { - internalType: "contract Oracle", + internalType: "contract IOracle", name: "", type: "address", }, @@ -1462,7 +1513,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -1509,7 +1560,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -1531,7 +1582,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -1550,8 +1601,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -1571,6 +1627,19 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + inputs: [], + name: "roleStore", + outputs: [ + { + internalType: "contract RoleStore", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [], name: "router", @@ -1584,6 +1653,65 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendNativeToken", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "token", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendTokens", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "sendWnt", + outputs: [], + stateMutability: "payable", + type: "function", + }, { inputs: [ { @@ -1603,6 +1731,19 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + inputs: [], + name: "swapHandler", + outputs: [ + { + internalType: "contract ISwapHandler", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, { inputs: [ { @@ -1662,7 +1803,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct ExternalCalls", + internalType: "struct IRelayUtils.ExternalCalls", name: "externalCalls", type: "tuple", }, @@ -1709,7 +1850,7 @@ const _abi = [ type: "address", }, ], - internalType: "struct TokenPermit[]", + internalType: "struct IRelayUtils.TokenPermit[]", name: "tokenPermits", type: "tuple[]", }, @@ -1731,7 +1872,7 @@ const _abi = [ type: "address[]", }, ], - internalType: "struct FeeParams", + internalType: "struct IRelayUtils.FeeParams", name: "fee", type: "tuple", }, @@ -1750,8 +1891,13 @@ const _abi = [ name: "signature", type: "bytes", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, ], - internalType: "struct RelayParams", + internalType: "struct IRelayUtils.RelayParams", name: "relayParams", type: "tuple", }, @@ -1787,11 +1933,21 @@ const _abi = [ name: "nonce", type: "uint256", }, + { + internalType: "uint256", + name: "desChainId", + type: "uint256", + }, { internalType: "uint256", name: "deadline", type: "uint256", }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, { internalType: "bytes", name: "signature", @@ -1855,7 +2011,7 @@ const _abi = [ type: "uint256", }, ], - internalType: "struct UpdateOrderParams", + internalType: "struct IRelayUtils.UpdateOrderParams", name: "params", type: "tuple", }, @@ -1865,25 +2021,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - inputs: [ - { - internalType: "address", - name: "", - type: "address", - }, - ], - name: "userNonces", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - stateMutability: "view", - type: "function", - }, ] as const; export class SubaccountGelatoRelayRouter__factory { diff --git a/src/typechain-types/factories/SubaccountRouter__factory.ts b/src/typechain-types/factories/SubaccountRouter__factory.ts index 64f743dd73..8dba6fb672 100644 --- a/src/typechain-types/factories/SubaccountRouter__factory.ts +++ b/src/typechain-types/factories/SubaccountRouter__factory.ts @@ -94,80 +94,41 @@ const _abi = [ inputs: [ { internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "expectedReceiver", - type: "address", - }, - ], - name: "InvalidReceiverForSubaccountOrder", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "account", + name: "token", type: "address", }, { internalType: "address", - name: "subaccount", + name: "receiver", type: "address", }, { internalType: "uint256", - name: "count", - type: "uint256", - }, - { - internalType: "uint256", - name: "maxCount", + name: "amount", type: "uint256", }, ], - name: "MaxSubaccountActionCountExceeded", + name: "TokenTransferError", type: "error", }, { + anonymous: false, inputs: [ { - internalType: "address", - name: "account", - type: "address", + indexed: false, + internalType: "string", + name: "reason", + type: "string", }, { - internalType: "address", - name: "subaccount", - type: "address", + indexed: false, + internalType: "bytes", + name: "returndata", + type: "bytes", }, ], - name: "SubaccountNotAuthorized", - type: "error", - }, - { - inputs: [ - { - internalType: "address", - name: "token", - type: "address", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "uint256", - name: "amount", - type: "uint256", - }, - ], - name: "TokenTransferError", - type: "error", + name: "TokenTransferReverted", + type: "event", }, { inputs: [ @@ -323,6 +284,11 @@ const _abi = [ name: "referralCode", type: "bytes32", }, + { + internalType: "bytes32[]", + name: "dataList", + type: "bytes32[]", + }, ], internalType: "struct IBaseOrderUtils.CreateOrderParams", name: "params", @@ -509,6 +475,24 @@ const _abi = [ stateMutability: "payable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bytes32", + name: "integrationId", + type: "bytes32", + }, + ], + name: "setIntegrationId", + outputs: [], + stateMutability: "payable", + type: "function", + }, { inputs: [ { @@ -550,6 +534,29 @@ const _abi = [ stateMutability: "payable", type: "function", }, + { + inputs: [ + { + internalType: "address", + name: "subaccount", + type: "address", + }, + { + internalType: "bytes32", + name: "actionType", + type: "bytes32", + }, + { + internalType: "uint256", + name: "expiresAt", + type: "uint256", + }, + ], + name: "setSubaccountExpiresAt", + outputs: [], + stateMutability: "payable", + type: "function", + }, { inputs: [ { diff --git a/src/typechain-types/factories/SyntheticsReader__factory.ts b/src/typechain-types/factories/SyntheticsReader__factory.ts index 76cb3c610c..a4383064c9 100644 --- a/src/typechain-types/factories/SyntheticsReader__factory.ts +++ b/src/typechain-types/factories/SyntheticsReader__factory.ts @@ -34,143 +34,165 @@ const _abi = [ { components: [ { - components: [ - { - internalType: "address", - name: "account", - type: "address", - }, - { - internalType: "address", - name: "receiver", - type: "address", - }, - { - internalType: "address", - name: "cancellationReceiver", - type: "address", - }, - { - internalType: "address", - name: "callbackContract", - type: "address", - }, - { - internalType: "address", - name: "uiFeeReceiver", - type: "address", - }, - { - internalType: "address", - name: "market", - type: "address", - }, - { - internalType: "address", - name: "initialCollateralToken", - type: "address", - }, - { - internalType: "address[]", - name: "swapPath", - type: "address[]", - }, - ], - internalType: "struct Order.Addresses", - name: "addresses", - type: "tuple", - }, - { - components: [ - { - internalType: "enum Order.OrderType", - name: "orderType", - type: "uint8", - }, - { - internalType: "enum Order.DecreasePositionSwapType", - name: "decreasePositionSwapType", - type: "uint8", - }, - { - internalType: "uint256", - name: "sizeDeltaUsd", - type: "uint256", - }, - { - internalType: "uint256", - name: "initialCollateralDeltaAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "triggerPrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "acceptablePrice", - type: "uint256", - }, - { - internalType: "uint256", - name: "executionFee", - type: "uint256", - }, - { - internalType: "uint256", - name: "callbackGasLimit", - type: "uint256", - }, - { - internalType: "uint256", - name: "minOutputAmount", - type: "uint256", - }, - { - internalType: "uint256", - name: "updatedAtTime", - type: "uint256", - }, - { - internalType: "uint256", - name: "validFromTime", - type: "uint256", - }, - ], - internalType: "struct Order.Numbers", - name: "numbers", - type: "tuple", + internalType: "bytes32", + name: "orderKey", + type: "bytes32", }, { components: [ { - internalType: "bool", - name: "isLong", - type: "bool", + components: [ + { + internalType: "address", + name: "account", + type: "address", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + { + internalType: "address", + name: "cancellationReceiver", + type: "address", + }, + { + internalType: "address", + name: "callbackContract", + type: "address", + }, + { + internalType: "address", + name: "uiFeeReceiver", + type: "address", + }, + { + internalType: "address", + name: "market", + type: "address", + }, + { + internalType: "address", + name: "initialCollateralToken", + type: "address", + }, + { + internalType: "address[]", + name: "swapPath", + type: "address[]", + }, + ], + internalType: "struct Order.Addresses", + name: "addresses", + type: "tuple", }, { - internalType: "bool", - name: "shouldUnwrapNativeToken", - type: "bool", + components: [ + { + internalType: "enum Order.OrderType", + name: "orderType", + type: "uint8", + }, + { + internalType: "enum Order.DecreasePositionSwapType", + name: "decreasePositionSwapType", + type: "uint8", + }, + { + internalType: "uint256", + name: "sizeDeltaUsd", + type: "uint256", + }, + { + internalType: "uint256", + name: "initialCollateralDeltaAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "triggerPrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "acceptablePrice", + type: "uint256", + }, + { + internalType: "uint256", + name: "executionFee", + type: "uint256", + }, + { + internalType: "uint256", + name: "callbackGasLimit", + type: "uint256", + }, + { + internalType: "uint256", + name: "minOutputAmount", + type: "uint256", + }, + { + internalType: "uint256", + name: "updatedAtTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "validFromTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, + ], + internalType: "struct Order.Numbers", + name: "numbers", + type: "tuple", }, { - internalType: "bool", - name: "isFrozen", - type: "bool", + components: [ + { + internalType: "bool", + name: "isLong", + type: "bool", + }, + { + internalType: "bool", + name: "shouldUnwrapNativeToken", + type: "bool", + }, + { + internalType: "bool", + name: "isFrozen", + type: "bool", + }, + { + internalType: "bool", + name: "autoCancel", + type: "bool", + }, + ], + internalType: "struct Order.Flags", + name: "flags", + type: "tuple", }, { - internalType: "bool", - name: "autoCancel", - type: "bool", + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", }, ], - internalType: "struct Order.Flags", - name: "flags", + internalType: "struct Order.Props", + name: "order", type: "tuple", }, ], - internalType: "struct Order.Props[]", + internalType: "struct ReaderUtils.OrderInfo[]", name: "", type: "tuple[]", }, @@ -324,6 +346,11 @@ const _abi = [ name: "collateralAmount", type: "uint256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "uint256", name: "borrowingFactor", @@ -651,12 +678,27 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDiffUsd", + name: "executionPrice", type: "uint256", }, + { + internalType: "bool", + name: "balanceWasImproved", + type: "bool", + }, + { + internalType: "int256", + name: "proportionalPendingImpactUsd", + type: "int256", + }, + { + internalType: "int256", + name: "totalImpactUsd", + type: "int256", + }, { internalType: "uint256", - name: "executionPrice", + name: "priceImpactDiffUsd", type: "uint256", }, ], @@ -754,6 +796,11 @@ const _abi = [ name: "collateralAmount", type: "uint256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "uint256", name: "borrowingFactor", @@ -1013,6 +1060,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct Deposit.Numbers", name: "numbers", @@ -1030,6 +1082,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct Deposit.Props", name: "", @@ -1183,18 +1240,59 @@ const _abi = [ { components: [ { - internalType: "uint256", - name: "min", - type: "uint256", + components: [ + { + internalType: "uint256", + name: "min", + type: "uint256", + }, + { + internalType: "uint256", + name: "max", + type: "uint256", + }, + ], + internalType: "struct Price.Props", + name: "indexTokenPrice", + type: "tuple", }, { - internalType: "uint256", - name: "max", - type: "uint256", + components: [ + { + internalType: "uint256", + name: "min", + type: "uint256", + }, + { + internalType: "uint256", + name: "max", + type: "uint256", + }, + ], + internalType: "struct Price.Props", + name: "longTokenPrice", + type: "tuple", + }, + { + components: [ + { + internalType: "uint256", + name: "min", + type: "uint256", + }, + { + internalType: "uint256", + name: "max", + type: "uint256", + }, + ], + internalType: "struct Price.Props", + name: "shortTokenPrice", + type: "tuple", }, ], - internalType: "struct Price.Props", - name: "indexTokenPrice", + internalType: "struct MarketUtils.MarketPrices", + name: "prices", type: "tuple", }, { @@ -1212,6 +1310,11 @@ const _abi = [ name: "sizeDeltaUsd", type: "int256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "bool", name: "isLong", @@ -1229,12 +1332,27 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDiffUsd", + name: "executionPrice", type: "uint256", }, + { + internalType: "bool", + name: "balanceWasImproved", + type: "bool", + }, + { + internalType: "int256", + name: "proportionalPendingImpactUsd", + type: "int256", + }, + { + internalType: "int256", + name: "totalImpactUsd", + type: "int256", + }, { internalType: "uint256", - name: "executionPrice", + name: "priceImpactDiffUsd", type: "uint256", }, ], @@ -2185,6 +2303,11 @@ const _abi = [ name: "impactPoolAmount", type: "uint256", }, + { + internalType: "uint256", + name: "lentImpactPoolAmount", + type: "uint256", + }, ], internalType: "struct MarketPoolValueInfo.Props", name: "", @@ -2507,6 +2630,11 @@ const _abi = [ name: "validFromTime", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct Order.Numbers", name: "numbers", @@ -2539,6 +2667,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct Order.Props", name: "", @@ -2798,6 +2931,11 @@ const _abi = [ name: "collateralAmount", type: "uint256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "uint256", name: "borrowingFactor", @@ -2995,6 +3133,11 @@ const _abi = [ name: "collateralAmount", type: "uint256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "uint256", name: "borrowingFactor", @@ -3322,12 +3465,27 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDiffUsd", + name: "executionPrice", type: "uint256", }, + { + internalType: "bool", + name: "balanceWasImproved", + type: "bool", + }, + { + internalType: "int256", + name: "proportionalPendingImpactUsd", + type: "int256", + }, + { + internalType: "int256", + name: "totalImpactUsd", + type: "int256", + }, { internalType: "uint256", - name: "executionPrice", + name: "priceImpactDiffUsd", type: "uint256", }, ], @@ -3490,6 +3648,11 @@ const _abi = [ name: "collateralAmount", type: "uint256", }, + { + internalType: "int256", + name: "pendingImpactAmount", + type: "int256", + }, { internalType: "uint256", name: "borrowingFactor", @@ -3817,12 +3980,27 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDiffUsd", + name: "executionPrice", type: "uint256", }, + { + internalType: "bool", + name: "balanceWasImproved", + type: "bool", + }, + { + internalType: "int256", + name: "proportionalPendingImpactUsd", + type: "int256", + }, + { + internalType: "int256", + name: "totalImpactUsd", + type: "int256", + }, { internalType: "uint256", - name: "executionPrice", + name: "priceImpactDiffUsd", type: "uint256", }, ], @@ -4059,11 +4237,21 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct Shift.Numbers", name: "numbers", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct Shift.Props", name: "", @@ -4408,6 +4596,11 @@ const _abi = [ name: "callbackGasLimit", type: "uint256", }, + { + internalType: "uint256", + name: "srcChainId", + type: "uint256", + }, ], internalType: "struct Withdrawal.Numbers", name: "numbers", @@ -4425,6 +4618,11 @@ const _abi = [ name: "flags", type: "tuple", }, + { + internalType: "bytes32[]", + name: "_dataList", + type: "bytes32[]", + }, ], internalType: "struct Withdrawal.Props", name: "", @@ -4665,6 +4863,11 @@ const _abi = [ name: "shouldValidateMinCollateralUsd", type: "bool", }, + { + internalType: "bool", + name: "forLiquidation", + type: "bool", + }, ], name: "isPositionLiquidatable", outputs: [ diff --git a/src/typechain-types/factories/index.ts b/src/typechain-types/factories/index.ts index f4a8954aa5..bcfc1bc6b6 100644 --- a/src/typechain-types/factories/index.ts +++ b/src/typechain-types/factories/index.ts @@ -16,8 +16,17 @@ export { GlvReader__factory } from "./GlvReader__factory"; export { GlvRouter__factory } from "./GlvRouter__factory"; export { GmxMigrator__factory } from "./GmxMigrator__factory"; export { GovToken__factory } from "./GovToken__factory"; +export { LayerZeroProvider__factory } from "./LayerZeroProvider__factory"; export { MintableBaseToken__factory } from "./MintableBaseToken__factory"; export { Multicall__factory } from "./Multicall__factory"; +export { MultichainClaimsRouter__factory } from "./MultichainClaimsRouter__factory"; +export { MultichainGlvRouter__factory } from "./MultichainGlvRouter__factory"; +export { MultichainGmRouter__factory } from "./MultichainGmRouter__factory"; +export { MultichainOrderRouter__factory } from "./MultichainOrderRouter__factory"; +export { MultichainSubaccountRouter__factory } from "./MultichainSubaccountRouter__factory"; +export { MultichainTransferRouter__factory } from "./MultichainTransferRouter__factory"; +export { MultichainUtils__factory } from "./MultichainUtils__factory"; +export { MultichainVault__factory } from "./MultichainVault__factory"; export { OrderBook__factory } from "./OrderBook__factory"; export { OrderBookReader__factory } from "./OrderBookReader__factory"; export { OrderExecutor__factory } from "./OrderExecutor__factory"; diff --git a/src/typechain-types/index.ts b/src/typechain-types/index.ts index c4be6eb639..9bd6199845 100644 --- a/src/typechain-types/index.ts +++ b/src/typechain-types/index.ts @@ -16,8 +16,17 @@ export type { GlvReader } from "./GlvReader"; export type { GlvRouter } from "./GlvRouter"; export type { GmxMigrator } from "./GmxMigrator"; export type { GovToken } from "./GovToken"; +export type { LayerZeroProvider } from "./LayerZeroProvider"; export type { MintableBaseToken } from "./MintableBaseToken"; export type { Multicall } from "./Multicall"; +export type { MultichainClaimsRouter } from "./MultichainClaimsRouter"; +export type { MultichainGlvRouter } from "./MultichainGlvRouter"; +export type { MultichainGmRouter } from "./MultichainGmRouter"; +export type { MultichainOrderRouter } from "./MultichainOrderRouter"; +export type { MultichainSubaccountRouter } from "./MultichainSubaccountRouter"; +export type { MultichainTransferRouter } from "./MultichainTransferRouter"; +export type { MultichainUtils } from "./MultichainUtils"; +export type { MultichainVault } from "./MultichainVault"; export type { OrderBook } from "./OrderBook"; export type { OrderBookReader } from "./OrderBookReader"; export type { OrderExecutor } from "./OrderExecutor"; @@ -67,8 +76,17 @@ export { GlvRouter__factory } from "./factories/GlvRouter__factory"; export { GMT__factory } from "./factories/GMT__factory"; export { GmxMigrator__factory } from "./factories/GmxMigrator__factory"; export { GovToken__factory } from "./factories/GovToken__factory"; +export { LayerZeroProvider__factory } from "./factories/LayerZeroProvider__factory"; export { MintableBaseToken__factory } from "./factories/MintableBaseToken__factory"; export { Multicall__factory } from "./factories/Multicall__factory"; +export { MultichainClaimsRouter__factory } from "./factories/MultichainClaimsRouter__factory"; +export { MultichainGlvRouter__factory } from "./factories/MultichainGlvRouter__factory"; +export { MultichainGmRouter__factory } from "./factories/MultichainGmRouter__factory"; +export { MultichainOrderRouter__factory } from "./factories/MultichainOrderRouter__factory"; +export { MultichainSubaccountRouter__factory } from "./factories/MultichainSubaccountRouter__factory"; +export { MultichainTransferRouter__factory } from "./factories/MultichainTransferRouter__factory"; +export { MultichainUtils__factory } from "./factories/MultichainUtils__factory"; +export { MultichainVault__factory } from "./factories/MultichainVault__factory"; export { OrderBook__factory } from "./factories/OrderBook__factory"; export { OrderBookReader__factory } from "./factories/OrderBookReader__factory"; export { OrderExecutor__factory } from "./factories/OrderExecutor__factory"; diff --git a/tailwind.config.ts b/tailwind.config.ts index 2902fc4234..c8b0bf0f30 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -98,7 +98,7 @@ function injectColorsPlugin({ addBase }: any) { }); } -function customUtilsPlugin({ addUtilities, addVariant }: any) { +function customUtilsPlugin({ addUtilities, addVariant, addComponents }: any) { addUtilities({ ".scrollbar-hide": { "scrollbar-width": "none", @@ -138,6 +138,19 @@ function customUtilsPlugin({ addUtilities, addVariant }: any) { whiteSpace: "nowrap", }, }); + + addVariant("not-group-gmx-hover", [ + `@media (hover: hover) {:merge(.group):not(:hover) &}`, + `@media (hover: none) {:merge(.group):not(:active) &}`, + ]); + addComponents({ + ".gmx-hover-gradient": { + "@apply gmx-hover:bg-gradient-to-r gmx-hover:from-[#23263B] gmx-hover:to-[#16182E]": {}, + }, + ".gmx-hover-gradient-to-l": { + "@apply gmx-hover:bg-gradient-to-l gmx-hover:from-[#23263B] gmx-hover:to-[#16182E]": {}, + }, + }); } function fontComponentsPlugin({ addComponents, addBase }: any) { diff --git a/tsconfig.json b/tsconfig.json index 70f2f72839..219264198a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -27,5 +27,5 @@ } }, "references": [{ "path": "./sdk" }], - "include": ["src", "scripts", "sdk/src/utils/twap/twap"] + "include": ["src", "scripts", "sdk/src/utils/trade/decrease.ts"] } diff --git a/vite.config.ts b/vite.config.ts index 296acfbbe1..477234ff4b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,13 +1,13 @@ /// -import { defineConfig, type PluginOption } from "vite"; -import { visualizer } from "rollup-plugin-visualizer"; +import { lingui } from "@lingui/vite-plugin"; import react from "@vitejs/plugin-react"; import path from "path"; +import { visualizer } from "rollup-plugin-visualizer"; +import { defineConfig, type PluginOption } from "vite"; +import { analyzer } from "vite-bundle-analyzer"; import svgr from "vite-plugin-svgr"; import tsconfigPaths from "vite-tsconfig-paths"; -import { lingui } from "@lingui/vite-plugin"; -import { analyzer } from "vite-bundle-analyzer"; export default defineConfig(({ mode }) => { return { @@ -50,7 +50,7 @@ export default defineConfig(({ mode }) => { build: { assetsInlineLimit: 0, outDir: "build", - sourcemap: true, + sourcemap: false, rollupOptions: { maxParallelFileOps: 2, output: { diff --git a/yarn.lock b/yarn.lock index 99fb9e957f..82a47aba84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12,13 +12,6 @@ __metadata: languageName: node linkType: hard -"@adraffy/ens-normalize@npm:1.10.0": - version: 1.10.0 - resolution: "@adraffy/ens-normalize@npm:1.10.0" - checksum: af0540f963a2632da2bbc37e36ea6593dcfc607b937857133791781e246d47f870d5e3d21fa70d5cfe94e772c284588c81ea3f5b7f4ea8fbb824369444e4dbcb - languageName: node - linkType: hard - "@adraffy/ens-normalize@npm:1.10.1": version: 1.10.1 resolution: "@adraffy/ens-normalize@npm:1.10.1" @@ -1648,16 +1641,7 @@ __metadata: languageName: node linkType: hard -"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": - version: 7.26.0 - resolution: "@babel/runtime@npm:7.26.0" - dependencies: - regenerator-runtime: ^0.14.0 - checksum: c8e2c0504ab271b3467a261a8f119bf2603eb857a0d71e37791f4e3fae00f681365073cc79f141ddaa90c6077c60ba56448004ad5429d07ac73532be9f7cf28a - languageName: node - linkType: hard - -"@babel/runtime@npm:^7.19.4, @babel/runtime@npm:^7.23.2": +"@babel/runtime@npm:^7.1.2, @babel/runtime@npm:^7.10.1, @babel/runtime@npm:^7.10.2, @babel/runtime@npm:^7.11.1, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.0, @babel/runtime@npm:^7.12.13, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.16.3, @babel/runtime@npm:^7.18.3, @babel/runtime@npm:^7.19.4, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.7, @babel/runtime@npm:^7.21.0, @babel/runtime@npm:^7.23.2, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.8.7, @babel/runtime@npm:^7.9.2": version: 7.28.2 resolution: "@babel/runtime@npm:7.28.2" checksum: 8673eb2311752929f5b0167f42cff4cc1d5fadddd0394baca27d06c1618680ffcf95e9f01061f5c4dc3f6a32b6bbf500e7762c02dc22bcd273c2947b9774ddad @@ -2491,405 +2475,405 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abi@npm:5.7.0, @ethersproject/abi@npm:^5.0.12, @ethersproject/abi@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abi@npm:5.7.0" +"@ethersproject/abi@npm:5.8.0, @ethersproject/abi@npm:^5.0.12, @ethersproject/abi@npm:^5.7.0, @ethersproject/abi@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/abi@npm:5.8.0" dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: bc6962bb6cb854e4d2a4d65b2c49c716477675b131b1363312234bdbb7e19badb7d9ce66f4ca2a70ae2ea84f7123dbc4e300a1bfe5d58864a7eafabc1466627e + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: cdab990d520fdbfd63d4a8829e78a2d2d2cc110dc3461895bd9014a49d3a9028c2005a11e2569c3fd620cb7780dcb5c71402630a8082a9ca5f85d4f8700d4549 languageName: node linkType: hard -"@ethersproject/abstract-provider@npm:5.7.0, @ethersproject/abstract-provider@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-provider@npm:5.7.0" +"@ethersproject/abstract-provider@npm:5.8.0, @ethersproject/abstract-provider@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/abstract-provider@npm:5.8.0" dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 - checksum: 74cf4696245cf03bb7cc5b6cbf7b4b89dd9a79a1c4688126d214153a938126d4972d42c93182198653ce1de35f2a2cad68be40337d4774b3698a39b28f0228a8 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/networks": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/web": ^5.8.0 + checksum: 4fd00d770552af53be297c676f31d938f5dc44d73c24970036a11237a53f114cc1c551fd95937b9eca790f77087da1ed3ec54f97071df088d5861f575fd4f9be languageName: node linkType: hard -"@ethersproject/abstract-signer@npm:5.7.0, @ethersproject/abstract-signer@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-signer@npm:5.7.0" +"@ethersproject/abstract-signer@npm:5.8.0, @ethersproject/abstract-signer@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/abstract-signer@npm:5.8.0" dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: a823dac9cfb761e009851050ebebd5b229d1b1cc4a75b125c2da130ff37e8218208f7f9d1386f77407705b889b23d4a230ad67185f8872f083143e0073cbfbe3 + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + checksum: 3f7a98caf7c01e58da45d879c08449d1443bced36ac81938789c90d8f9ff86a1993655bae9805fc7b31a723b7bd7b4f1f768a9ec65dff032d0ebdc93133c14f3 languageName: node linkType: hard -"@ethersproject/address@npm:5.7.0, @ethersproject/address@npm:^5.0.2, @ethersproject/address@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/address@npm:5.7.0" +"@ethersproject/address@npm:5.8.0, @ethersproject/address@npm:^5.0.2, @ethersproject/address@npm:^5.7.0, @ethersproject/address@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/address@npm:5.8.0" dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - checksum: 64ea5ebea9cc0e845c413e6cb1e54e157dd9fc0dffb98e239d3a3efc8177f2ff798cd4e3206cf3660ee8faeb7bef1a47dc0ebef0d7b132c32e61e550c7d4c843 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/rlp": ^5.8.0 + checksum: fa48e16403b656207f996ee7796f0978a146682f10f345b75aa382caa4a70fbfdc6ff585e9955e4779f4f15a31628929b665d288b895cea5df206c070266aea1 languageName: node linkType: hard -"@ethersproject/base64@npm:5.7.0, @ethersproject/base64@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/base64@npm:5.7.0" +"@ethersproject/base64@npm:5.8.0, @ethersproject/base64@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/base64@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - checksum: 7dd5d734d623582f08f665434f53685041a3d3b334a0e96c0c8afa8bbcaab934d50e5b6b980e826a8fde8d353e0b18f11e61faf17468177274b8e7c69cd9742b + "@ethersproject/bytes": ^5.8.0 + checksum: f0c2136c99b2fd2f93b7e110958eacc5990e88274b1f38eb73d8eaa31bdead75fc0c4608dac23cb5718ae455b965de9dc5023446b96de62ef1fa945cbf212096 languageName: node linkType: hard -"@ethersproject/basex@npm:5.7.0, @ethersproject/basex@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/basex@npm:5.7.0" +"@ethersproject/basex@npm:5.8.0, @ethersproject/basex@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/basex@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: 326087b7e1f3787b5fe6cd1cf2b4b5abfafbc355a45e88e22e5e9d6c845b613ffc5301d629b28d5c4d5e2bfe9ec424e6782c804956dff79be05f0098cb5817de + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + checksum: 7b502b91011d3aac9bf38d77aad113632440a1eab6a966ffbe2c23f9e3758a4dcb2a4189ab2948d6996250d0cb716d7445e7e2103d03b94097a77c0e128f9ab7 languageName: node linkType: hard -"@ethersproject/bignumber@npm:5.7.0, @ethersproject/bignumber@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bignumber@npm:5.7.0" +"@ethersproject/bignumber@npm:5.8.0, @ethersproject/bignumber@npm:^5.7.0, @ethersproject/bignumber@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/bignumber@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 bn.js: ^5.2.1 - checksum: 8c9a134b76f3feb4ec26a5a27379efb4e156b8fb2de0678a67788a91c7f4e30abe9d948638458e4b20f2e42380da0adacc7c9389d05fce070692edc6ae9b4904 + checksum: c87017f466b32d482e4b39370016cfc3edafc2feb89377011c54cd2e7dd011072ef4f275df59cd9fe080a187066082c1808b2682d97547c4fb9e6912331200c3 languageName: node linkType: hard -"@ethersproject/bytes@npm:5.7.0, @ethersproject/bytes@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bytes@npm:5.7.0" +"@ethersproject/bytes@npm:5.8.0, @ethersproject/bytes@npm:^5.7.0, @ethersproject/bytes@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/bytes@npm:5.8.0" dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 66ad365ceaab5da1b23b72225c71dce472cf37737af5118181fa8ab7447d696bea15ca22e3a0e8836fdd8cfac161afe321a7c67d0dde96f9f645ddd759676621 + "@ethersproject/logger": ^5.8.0 + checksum: 507e8ef1f1559590b4e78e3392a2b16090e96fb1091e0b08d3a8491df65976b313c29cdb412594454f68f9f04d5f77ea5a400b489d80a3e46a608156ef31b251 languageName: node linkType: hard -"@ethersproject/constants@npm:5.7.0, @ethersproject/constants@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/constants@npm:5.7.0" +"@ethersproject/constants@npm:5.8.0, @ethersproject/constants@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/constants@npm:5.8.0" dependencies: - "@ethersproject/bignumber": ^5.7.0 - checksum: 6d4b1355747cce837b3e76ec3bde70e4732736f23b04f196f706ebfa5d4d9c2be50904a390d4d40ce77803b98d03d16a9b6898418e04ba63491933ce08c4ba8a + "@ethersproject/bignumber": ^5.8.0 + checksum: 74830c44f4315a1058b905c73be7a9bb92850e45213cb28a957447b8a100f22a514f4500b0ea5ac7a995427cecef9918af39ae4e0e0ecf77aa4835b1ea5c3432 languageName: node linkType: hard -"@ethersproject/contracts@npm:5.7.0, @ethersproject/contracts@npm:^5.4.1, @ethersproject/contracts@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/contracts@npm:5.7.0" +"@ethersproject/contracts@npm:5.8.0, @ethersproject/contracts@npm:^5.4.1, @ethersproject/contracts@npm:^5.7.0": + version: 5.8.0 + resolution: "@ethersproject/contracts@npm:5.8.0" dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - checksum: 6ccf1121cba01b31e02f8c507cb971ab6bfed85706484a9ec09878ef1594a62215f43c4fdef8f4a4875b99c4a800bc95e3be69b1803f8ce479e07634b5a740c0 + "@ethersproject/abi": ^5.8.0 + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + checksum: cb181012bd55cc19c08f136e56e28e922f1ca66af66747a1b3f58a2aea5b3332bc7ecfe2d23fa14245e7fd45a4fdc4f3427a345c2e9873a9792838cdfe4c62d5 languageName: node linkType: hard -"@ethersproject/hash@npm:5.7.0, @ethersproject/hash@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hash@npm:5.7.0" +"@ethersproject/hash@npm:5.8.0, @ethersproject/hash@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/hash@npm:5.8.0" dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 6e9fa8d14eb08171cd32f17f98cc108ec2aeca74a427655f0d689c550fee0b22a83b3b400fad7fb3f41cf14d4111f87f170aa7905bcbcd1173a55f21b06262ef + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/base64": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: e1feb47a98c631548b0f98ef0b1eb1b964bc643d5dea12a0eeb533165004cfcfe6f1d2bb32f31941f0b91e6a82212ad5c8577d6d465fba62c38fc0c410941feb languageName: node linkType: hard -"@ethersproject/hdnode@npm:5.7.0, @ethersproject/hdnode@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hdnode@npm:5.7.0" +"@ethersproject/hdnode@npm:5.8.0, @ethersproject/hdnode@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/hdnode@npm:5.8.0" dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: bfe5ca2d89a42de73655f853170ef4766b933c5f481cddad709b3aca18823275b096e572f92d1602a052f80b426edde44ad6b9d028799775a7dad4a5bbed2133 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/basex": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/pbkdf2": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + "@ethersproject/signing-key": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/wordlists": ^5.8.0 + checksum: 72cc6bd218dbe3565b915f3fd8654562003b1b160a5ace8c8959e319333712a0951887641f6888ef91017a39bb804204fc09fb7e5064e3acf76ad701c2ff1266 languageName: node linkType: hard -"@ethersproject/json-wallets@npm:5.7.0, @ethersproject/json-wallets@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/json-wallets@npm:5.7.0" +"@ethersproject/json-wallets@npm:5.8.0, @ethersproject/json-wallets@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/json-wallets@npm:5.8.0" dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/hdnode": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/pbkdf2": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/random": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 aes-js: 3.0.0 scrypt-js: 3.0.1 - checksum: f583458d22db62efaaf94d38dd243482776a45bf90f9f3882fbad5aa0b8fd288b41eb7c1ff8ec0b99c9b751088e43d6173530db64dd33c59f9d8daa8d7ad5aa2 + checksum: 8e0f8529f683d0a3fab1c76173bfccf7fc03a27e291344c86797815872722770be787e91f8fa83c37b0abfc47d5f2a2d0eca0ab862effb5539ad545e317f8d83 languageName: node linkType: hard -"@ethersproject/keccak256@npm:5.7.0, @ethersproject/keccak256@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/keccak256@npm:5.7.0" +"@ethersproject/keccak256@npm:5.8.0, @ethersproject/keccak256@npm:^5.7.0, @ethersproject/keccak256@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/keccak256@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 + "@ethersproject/bytes": ^5.8.0 js-sha3: 0.8.0 - checksum: ff70950d82203aab29ccda2553422cbac2e7a0c15c986bd20a69b13606ed8bb6e4fdd7b67b8d3b27d4f841e8222cbaccd33ed34be29f866fec7308f96ed244c6 + checksum: af3621d2b18af6c8f5181dacad91e1f6da4e8a6065668b20e4c24684bdb130b31e45e0d4dbaed86d4f1314d01358aa119f05be541b696e455424c47849d81913 languageName: node linkType: hard -"@ethersproject/logger@npm:5.7.0, @ethersproject/logger@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/logger@npm:5.7.0" - checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d +"@ethersproject/logger@npm:5.8.0, @ethersproject/logger@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/logger@npm:5.8.0" + checksum: 6249885a7fd4a5806e4c8700b76ffcc8f1ff00d71f31aa717716a89fa6b391de19fbb0cb5ae2560b9f57ec0c2e8e0a11ebc2099124c73d3b42bc58e3eedc41d1 languageName: node linkType: hard -"@ethersproject/networks@npm:5.7.1, @ethersproject/networks@npm:^5.7.0": - version: 5.7.1 - resolution: "@ethersproject/networks@npm:5.7.1" +"@ethersproject/networks@npm:5.8.0, @ethersproject/networks@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/networks@npm:5.8.0" dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 0339f312304c17d9a0adce550edb825d4d2c8c9468c1634c44172c67a9ed256f594da62c4cda5c3837a0f28b7fabc03aca9b492f68ff1fdad337ee861b27bd5d + "@ethersproject/logger": ^5.8.0 + checksum: b1d43fdab13e32be74b5547968c7e54786915a1c3543025c628f634872038750171bef15db0cf42a27e568175b185ac9c185a9aae8f93839452942c5a867c908 languageName: node linkType: hard -"@ethersproject/pbkdf2@npm:5.7.0, @ethersproject/pbkdf2@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/pbkdf2@npm:5.7.0" +"@ethersproject/pbkdf2@npm:5.8.0, @ethersproject/pbkdf2@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/pbkdf2@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - checksum: b895adb9e35a8a127e794f7aadc31a2424ef355a70e51cde10d457e3e888bb8102373199a540cf61f2d6b9a32e47358f9c65b47d559f42bf8e596b5fd67901e9 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + checksum: 79e06ec6063e745a714c7c3f8ecfb7a8d2db2d19d45ad0e84e59526f685a2704f06e8c8fbfaf3aca85d15037bead7376d704529aac783985e1ff7b90c2d6e714 languageName: node linkType: hard -"@ethersproject/properties@npm:5.7.0, @ethersproject/properties@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/properties@npm:5.7.0" +"@ethersproject/properties@npm:5.8.0, @ethersproject/properties@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/properties@npm:5.8.0" dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 6ab0ccf0c3aadc9221e0cdc5306ce6cd0df7f89f77d77bccdd1277182c9ead0202cd7521329ba3acde130820bf8af299e17cf567d0d497c736ee918207bbf59f + "@ethersproject/logger": ^5.8.0 + checksum: 2bb0369a3c25a7c1999e990f73a9db149a5e514af253e3945c7728eaea5d864144da6a81661c0c414b97be75db7fb15c34f719169a3adb09e585a3286ea78b9c languageName: node linkType: hard -"@ethersproject/providers@npm:5.7.2, @ethersproject/providers@npm:^5.4.5, @ethersproject/providers@npm:^5.7.0": - version: 5.7.2 - resolution: "@ethersproject/providers@npm:5.7.2" +"@ethersproject/providers@npm:5.8.0, @ethersproject/providers@npm:^5.4.5, @ethersproject/providers@npm:^5.7.0": + version: 5.8.0 + resolution: "@ethersproject/providers@npm:5.8.0" dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/base64": ^5.8.0 + "@ethersproject/basex": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/networks": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/random": ^5.8.0 + "@ethersproject/rlp": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/web": ^5.8.0 bech32: 1.1.4 - ws: 7.4.6 - checksum: 1754c731a5ca6782ae9677f4a9cd8b6246c4ef21a966c9a01b133750f3c578431ec43ec254e699969c4a0f87e84463ded50f96b415600aabd37d2056aee58c19 + ws: 8.18.0 + checksum: 2970ee03fe61bc941555b57075d4a12fbb6342ee56181ad75250a75e9418403e85821bbea1b6e17b25ef35e9eaa1c2b2c564dad7d20af2c1f28ba6db9d0c7ce3 languageName: node linkType: hard -"@ethersproject/random@npm:5.7.0, @ethersproject/random@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/random@npm:5.7.0" +"@ethersproject/random@npm:5.8.0, @ethersproject/random@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/random@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 017829c91cff6c76470852855108115b0b52c611b6be817ed1948d56ba42d6677803ec2012aa5ae298a7660024156a64c11fcf544e235e239ab3f89f0fff7345 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + checksum: c3bec10516b433eca7ddbd5d97cf2c24153f8fb9615225ea2e3b7fab95a6d6434ab8af55ce55527c3aeb00546ee4363a43aecdc0b5a9970a207ab1551783ddef languageName: node linkType: hard -"@ethersproject/rlp@npm:5.7.0, @ethersproject/rlp@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/rlp@npm:5.7.0" +"@ethersproject/rlp@npm:5.8.0, @ethersproject/rlp@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/rlp@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: bce165b0f7e68e4d091c9d3cf47b247cac33252df77a095ca4281d32d5eeaaa3695d9bc06b2b057c5015353a68df89f13a4a54a72e888e4beeabbe56b15dda6e + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + checksum: 9d6f646072b3dd61de993210447d35744a851d24d4fe6262856e372f47a1e9d90976031a9fa28c503b1a4f39dd5ab7c20fc9b651b10507a09b40a33cb04a19f1 languageName: node linkType: hard -"@ethersproject/sha2@npm:5.7.0, @ethersproject/sha2@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/sha2@npm:5.7.0" +"@ethersproject/sha2@npm:5.8.0, @ethersproject/sha2@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/sha2@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 hash.js: 1.1.7 - checksum: 09321057c022effbff4cc2d9b9558228690b5dd916329d75c4b1ffe32ba3d24b480a367a7cc92d0f0c0b1c896814d03351ae4630e2f1f7160be2bcfbde435dbc + checksum: ef8916e3033502476fba9358ba1993722ac3bb99e756d5681e4effa3dfa0f0bf0c29d3fa338662830660b45dd359cccb06ba40bc7b62cfd44f4a177b25829404 languageName: node linkType: hard -"@ethersproject/signing-key@npm:5.7.0, @ethersproject/signing-key@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/signing-key@npm:5.7.0" +"@ethersproject/signing-key@npm:5.8.0, @ethersproject/signing-key@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/signing-key@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 bn.js: ^5.2.1 - elliptic: 6.5.4 + elliptic: 6.6.1 hash.js: 1.1.7 - checksum: 8f8de09b0aac709683bbb49339bc0a4cd2f95598f3546436c65d6f3c3a847ffa98e06d35e9ed2b17d8030bd2f02db9b7bd2e11c5cf8a71aad4537487ab4cf03a + checksum: 8c07741bc8275568130d97da5d37535c813c842240d0b3409d5e057321595eaf65660c207abdee62e2d7ba225d9b82f0b711ac0324c8c9ceb09a815b231b9f55 languageName: node linkType: hard -"@ethersproject/solidity@npm:5.7.0, @ethersproject/solidity@npm:^5.0.9": - version: 5.7.0 - resolution: "@ethersproject/solidity@npm:5.7.0" +"@ethersproject/solidity@npm:5.8.0, @ethersproject/solidity@npm:^5.0.9, @ethersproject/solidity@npm:^5.7.0": + version: 5.8.0 + resolution: "@ethersproject/solidity@npm:5.8.0" dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 9a02f37f801c96068c3e7721f83719d060175bc4e80439fe060e92bd7acfcb6ac1330c7e71c49f4c2535ca1308f2acdcb01e00133129aac00581724c2d6293f3 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: 305166f3f8e8c2f5ad7b0b03ab96d52082fc79b5136601175e1c76d7abd8fd8e3e4b56569dea745dfa2b7fcbfd180c5d824b03fea7e08dd53d515738a35e51dd languageName: node linkType: hard -"@ethersproject/strings@npm:5.7.0, @ethersproject/strings@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/strings@npm:5.7.0" +"@ethersproject/strings@npm:5.8.0, @ethersproject/strings@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/strings@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 5ff78693ae3fdf3cf23e1f6dc047a61e44c8197d2408c42719fef8cb7b7b3613a4eec88ac0ed1f9f5558c74fe0de7ae3195a29ca91a239c74b9f444d8e8b50df + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + checksum: 997396cf1b183ae66ebfd97b9f98fd50415489f9246875e7769e57270ffa1bffbb62f01430eaac3a0c9cb284e122040949efe632a0221012ee47de252a44a483 languageName: node linkType: hard -"@ethersproject/transactions@npm:5.7.0, @ethersproject/transactions@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/transactions@npm:5.7.0" +"@ethersproject/transactions@npm:5.8.0, @ethersproject/transactions@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/transactions@npm:5.8.0" dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - checksum: a31b71996d2b283f68486241bff0d3ea3f1ba0e8f1322a8fffc239ccc4f4a7eb2ea9994b8fd2f093283fd75f87bae68171e01b6265261f821369aca319884a79 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/rlp": ^5.8.0 + "@ethersproject/signing-key": ^5.8.0 + checksum: e867516ccc692c3642bfbd34eab6d2acecabb3b964d8e1cced8e450ec4fa490bcf2513efb6252637bc3157ecd5e0250dadd1a08d3ec3150c14478b9ec7715570 languageName: node linkType: hard -"@ethersproject/units@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/units@npm:5.7.0" +"@ethersproject/units@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/units@npm:5.8.0" dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 304714f848cd32e57df31bf545f7ad35c2a72adae957198b28cbc62166daa929322a07bff6e9c9ac4577ab6aa0de0546b065ed1b2d20b19e25748b7d475cb0fc + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + checksum: cc7180c85f695449c20572602971145346fc5c169ee32f23d79ac31cc8c9c66a2049e3ac852b940ddccbe39ab1db3b81e3e093b604d9ab7ab27639ecb933b270 languageName: node linkType: hard -"@ethersproject/wallet@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wallet@npm:5.7.0" +"@ethersproject/wallet@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/wallet@npm:5.8.0" dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/json-wallets": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: a4009bf7331eddab38e3015b5e9101ef92de7f705b00a6196b997db0e5635b6d83561674d46c90c6f77b87c0500fe4a6b0183ba13749efc22db59c99deb82fbd + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/hdnode": ^5.8.0 + "@ethersproject/json-wallets": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/random": ^5.8.0 + "@ethersproject/signing-key": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/wordlists": ^5.8.0 + checksum: d2921c3212c30a49048e0cba7a8287e0d53a5346ad5a15d46d9932991dc54e541a3da063c47addc1347a4b65142d7239f7056c8716d6f85c8ec4a1bf6b5d2f69 languageName: node linkType: hard -"@ethersproject/web@npm:5.7.1, @ethersproject/web@npm:^5.7.0": - version: 5.7.1 - resolution: "@ethersproject/web@npm:5.7.1" +"@ethersproject/web@npm:5.8.0, @ethersproject/web@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/web@npm:5.8.0" dependencies: - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 7028c47103f82fd2e2c197ce0eecfacaa9180ffeec7de7845b1f4f9b19d84081b7a48227aaddde05a4aaa526af574a9a0ce01cc0fc75e3e371f84b38b5b16b2b + "@ethersproject/base64": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: d8ca89bde8777ed1eec81527f8a989b939b4625b2f6c275eea90031637a802ad68bf46911fdd43c5e84ea2962b8a3cb4801ab51f5393ae401a163c17c774123f languageName: node linkType: hard -"@ethersproject/wordlists@npm:5.7.0, @ethersproject/wordlists@npm:^5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wordlists@npm:5.7.0" +"@ethersproject/wordlists@npm:5.8.0, @ethersproject/wordlists@npm:^5.8.0": + version: 5.8.0 + resolution: "@ethersproject/wordlists@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 30eb6eb0731f9ef5faa44bf9c0c6e950bcaaef61e4d2d9ce0ae6d341f4e2d6d1f4ab4f8880bfce03b7aac4b862fb740e1421170cfbf8e2aafc359277d49e6e97 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: ba24300927a3c9cb85ae8ace84a6be73f3c43aac6eab7a3abe58a7dfd3b168caf3f01a4528efa8193e269dd3d5efe9d4533bdf3b29d5c55743edcb2e864d25d9 languageName: node linkType: hard @@ -3150,6 +3134,22 @@ __metadata: languageName: node linkType: hard +"@layerzerolabs/lz-v2-utilities@npm:3.0.85": + version: 3.0.85 + resolution: "@layerzerolabs/lz-v2-utilities@npm:3.0.85" + dependencies: + "@ethersproject/abi": ^5.7.0 + "@ethersproject/address": ^5.7.0 + "@ethersproject/bignumber": ^5.7.0 + "@ethersproject/bytes": ^5.7.0 + "@ethersproject/keccak256": ^5.7.0 + "@ethersproject/solidity": ^5.7.0 + bs58: ^5.0.0 + tiny-invariant: ^1.3.1 + checksum: eeafd093dc90c83ca213cb5c52c89690a8615e2d0af06309845c0c670169a8174bd5bf13d61e4ba76194f7b55018a085c4749e56bc45a1b27aead33981ac2ac7 + languageName: node + linkType: hard + "@lingui/babel-plugin-extract-messages@npm:4.10.0": version: 4.10.0 resolution: "@lingui/babel-plugin-extract-messages@npm:4.10.0" @@ -3783,7 +3783,7 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.2.0, @noble/curves@npm:~1.2.0": +"@noble/curves@npm:1.2.0": version: 1.2.0 resolution: "@noble/curves@npm:1.2.0" dependencies: @@ -3801,16 +3801,16 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.6.0, @noble/curves@npm:^1.4.0, @noble/curves@npm:^1.6.0, @noble/curves@npm:~1.6.0": - version: 1.6.0 - resolution: "@noble/curves@npm:1.6.0" +"@noble/curves@npm:1.8.1, @noble/curves@npm:~1.8.1": + version: 1.8.1 + resolution: "@noble/curves@npm:1.8.1" dependencies: - "@noble/hashes": 1.5.0 - checksum: 258f3feb2a6098cf35521562ecb7d452fd728e8a008ff9f1ef435184f9d0c782ceb8f7b7fa8df3317c3be7a19f53995ee124cd05c8080b130bd42e3cb072f24d + "@noble/hashes": 1.7.1 + checksum: 4143f1248ed57c1ae46dfef5c692a91383e5830420b9c72d3ff1061aa9ebbf8999297da6d2aed8a9716fef8e6b1f5a45737feeab02abf55ca2a4f514bf9339ec languageName: node linkType: hard -"@noble/curves@npm:^1.9.1": +"@noble/curves@npm:^1.6.0, @noble/curves@npm:^1.9.1": version: 1.9.6 resolution: "@noble/curves@npm:1.9.6" dependencies: @@ -3833,21 +3833,21 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.0, @noble/hashes@npm:~1.3.2": +"@noble/hashes@npm:1.3.3, @noble/hashes@npm:~1.3.2": version: 1.3.3 resolution: "@noble/hashes@npm:1.3.3" checksum: 8a6496d1c0c64797339bc694ad06cdfaa0f9e56cd0c3f68ae3666cfb153a791a55deb0af9c653c7ed2db64d537aa3e3054629740d2f2338bb1dcb7ab60cd205b languageName: node linkType: hard -"@noble/hashes@npm:1.5.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:~1.5.0": - version: 1.5.0 - resolution: "@noble/hashes@npm:1.5.0" - checksum: 9cc031d5c888c455bfeef76af649b87f75380a4511405baea633c1e4912fd84aff7b61e99716f0231d244c9cfeda1fafd7d718963e6a0c674ed705e9b1b4f76b +"@noble/hashes@npm:1.7.1, @noble/hashes@npm:~1.7.1": + version: 1.7.1 + resolution: "@noble/hashes@npm:1.7.1" + checksum: 4f1b56428a10323feef17e4f437c9093556cb18db06f94d254043fadb69c3da8475f96eb3f8322d41e8670117d7486475a8875e68265c2839f60fd03edd6a616 languageName: node linkType: hard -"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.8.0": +"@noble/hashes@npm:1.8.0, @noble/hashes@npm:^1.3.1, @noble/hashes@npm:^1.4.0, @noble/hashes@npm:^1.5.0, @noble/hashes@npm:^1.8.0": version: 1.8.0 resolution: "@noble/hashes@npm:1.8.0" checksum: c94e98b941963676feaba62475b1ccfa8341e3f572adbb3b684ee38b658df44100187fa0ef4220da580b13f8d27e87d5492623c8a02ecc61f23fb9960c7918f5 @@ -4255,21 +4255,17 @@ __metadata: languageName: node linkType: hard -"@scure/base@npm:^1.1.3, @scure/base@npm:~1.1.0, @scure/base@npm:~1.1.2, @scure/base@npm:~1.1.4, @scure/base@npm:~1.1.7, @scure/base@npm:~1.1.8": - version: 1.1.9 - resolution: "@scure/base@npm:1.1.9" - checksum: 120820a37dfe9dfe4cab2b7b7460552d08e67dee8057ed5354eb68d8e3440890ae983ce3bee957d2b45684950b454a2b6d71d5ee77c1fd3fddc022e2a510337f +"@scure/base@npm:^1.1.3, @scure/base@npm:~1.2.2, @scure/base@npm:~1.2.4": + version: 1.2.4 + resolution: "@scure/base@npm:1.2.4" + checksum: db554eb550a1bd17684af9282e1ad751050a13d4add0e83ad61cc496680d7d1c1c1120ca780e72935a293bb59721c20a006a53a5eec6f6b5bdcd702cf27c8cae languageName: node linkType: hard -"@scure/bip32@npm:1.3.2": - version: 1.3.2 - resolution: "@scure/bip32@npm:1.3.2" - dependencies: - "@noble/curves": ~1.2.0 - "@noble/hashes": ~1.3.2 - "@scure/base": ~1.1.2 - checksum: c5ae84fae43490853693b481531132b89e056d45c945fc8b92b9d032577f753dfd79c5a7bbcbf0a7f035951006ff0311b6cf7a389e26c9ec6335e42b20c53157 +"@scure/base@npm:~1.1.4": + version: 1.1.9 + resolution: "@scure/base@npm:1.1.9" + checksum: 120820a37dfe9dfe4cab2b7b7460552d08e67dee8057ed5354eb68d8e3440890ae983ce3bee957d2b45684950b454a2b6d71d5ee77c1fd3fddc022e2a510337f languageName: node linkType: hard @@ -4284,24 +4280,14 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:1.5.0, @scure/bip32@npm:^1.5.0": - version: 1.5.0 - resolution: "@scure/bip32@npm:1.5.0" - dependencies: - "@noble/curves": ~1.6.0 - "@noble/hashes": ~1.5.0 - "@scure/base": ~1.1.7 - checksum: 2e119525cdffccc3aad7ca64aec22df2101233708111dfb551410f82aae85fe14acf39dc87cea1a535adc327451f9c3dea3c6a2dd22b859508025bc46a7a80ce - languageName: node - linkType: hard - -"@scure/bip39@npm:1.2.1": - version: 1.2.1 - resolution: "@scure/bip39@npm:1.2.1" +"@scure/bip32@npm:1.6.2, @scure/bip32@npm:^1.5.0": + version: 1.6.2 + resolution: "@scure/bip32@npm:1.6.2" dependencies: - "@noble/hashes": ~1.3.0 - "@scure/base": ~1.1.0 - checksum: c5bd6f1328fdbeae2dcdd891825b1610225310e5e62a4942714db51066866e4f7bef242c7b06a1b9dcc8043a4a13412cf5c5df76d3b10aa9e36b82e9b6e3eeaa + "@noble/curves": ~1.8.1 + "@noble/hashes": ~1.7.1 + "@scure/base": ~1.2.2 + checksum: e7586619f8a669e522267ce71a90b2d00c3a91da658f1f50e54072cf9f432ba26d2bb4d3d91a5d06932ab96612b8bd038bc31d885bbc048cebfb6509c4a790fc languageName: node linkType: hard @@ -4315,13 +4301,13 @@ __metadata: languageName: node linkType: hard -"@scure/bip39@npm:1.4.0, @scure/bip39@npm:^1.4.0": - version: 1.4.0 - resolution: "@scure/bip39@npm:1.4.0" +"@scure/bip39@npm:1.5.4, @scure/bip39@npm:^1.4.0": + version: 1.5.4 + resolution: "@scure/bip39@npm:1.5.4" dependencies: - "@noble/hashes": ~1.5.0 - "@scure/base": ~1.1.8 - checksum: 211f2c01361993bfe54c0e4949f290224381457c7f76d7cd51d6a983f3f4b6b9f85adfd0e623977d777ed80417a5fe729eb19dd34e657147810a0e58a8e7b9e0 + "@noble/hashes": ~1.7.1 + "@scure/base": ~1.2.4 + checksum: 744f302559ad05ee6ea4928572ac8f0b5443e8068fd53234c9c2e158814e910a043c54f0688d05546decadd2ff66e0d0c76355d10e103a28cb8f44efe140857a languageName: node linkType: hard @@ -4509,6 +4495,13 @@ __metadata: languageName: node linkType: hard +"@stargatefinance/stg-evm-sdk-v2@npm:1.1.12": + version: 1.1.12 + resolution: "@stargatefinance/stg-evm-sdk-v2@npm:1.1.12" + checksum: 191642ad9be358caeed0f57e9853861eba27caed7265fcfe1cba0d43f78f59ba4e5abd1ebc1f57ecaa9914ba1c18aeca04483f91a35eb191e770e434f88d51dd + languageName: node + linkType: hard + "@svgr/babel-plugin-add-jsx-attribute@npm:8.0.0": version: 8.0.0 resolution: "@svgr/babel-plugin-add-jsx-attribute@npm:8.0.0" @@ -6141,24 +6134,9 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.0": - version: 1.0.0 - resolution: "abitype@npm:1.0.0" - peerDependencies: - typescript: ">=5.0.4" - zod: ^3 >=3.22.0 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - checksum: ea2c0548c3ba58c37a6de7483d63389074da498e63d803b742bbe94eb4eaa1f51a35d000c424058b2583aef56698cf07c696eb3bc4dd0303bc20c6f0826a241a - languageName: node - linkType: hard - -"abitype@npm:1.0.6, abitype@npm:^1.0.6": - version: 1.0.6 - resolution: "abitype@npm:1.0.6" +"abitype@npm:1.0.8, abitype@npm:^1.0.6": + version: 1.0.8 + resolution: "abitype@npm:1.0.8" peerDependencies: typescript: ">=5.0.4" zod: ^3 >=3.22.0 @@ -6167,7 +6145,7 @@ __metadata: optional: true zod: optional: true - checksum: 0bf6ed5ec785f372746c3ec5d6c87bf4d8cf0b6db30867b8d24e86fbc66d9f6599ae3d463ccd49817e67eedec6deba7cdae317bcf4da85b02bc48009379b9f84 + checksum: 104bc2f6820ced8d2cb61521916f7f22c0981a846216f5b6144f69461265f7da137a4ae108bf4b84cd8743f2dd1e9fdadffc0f95371528e15a59e0a369e08438 languageName: node linkType: hard @@ -6431,16 +6409,6 @@ __metadata: languageName: node linkType: hard -"array-buffer-byte-length@npm:^1.0.0": - version: 1.0.0 - resolution: "array-buffer-byte-length@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - is-array-buffer: ^3.0.1 - checksum: 044e101ce150f4804ad19c51d6c4d4cfa505c5b2577bd179256e4aa3f3f6a0a5e9874c78cd428ee566ac574c8a04d7ce21af9fe52e844abfdccb82b33035a7c3 - languageName: node - linkType: hard - "array-buffer-byte-length@npm:^1.0.1, array-buffer-byte-length@npm:^1.0.2": version: 1.0.2 resolution: "array-buffer-byte-length@npm:1.0.2" @@ -6451,20 +6419,7 @@ __metadata: languageName: node linkType: hard -"array-includes@npm:^3.1.6, array-includes@npm:^3.1.7": - version: 3.1.7 - resolution: "array-includes@npm:3.1.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 - is-string: ^1.0.7 - checksum: 06f9e4598fac12a919f7c59a3f04f010ea07f0b7f0585465ed12ef528a60e45f374e79d1bddbb34cdd4338357d00023ddbd0ac18b0be36964f5e726e8965d7fc - languageName: node - linkType: hard - -"array-includes@npm:^3.1.8": +"array-includes@npm:^3.1.6, array-includes@npm:^3.1.8": version: 3.1.8 resolution: "array-includes@npm:3.1.8" dependencies: @@ -6485,19 +6440,6 @@ __metadata: languageName: node linkType: hard -"array.prototype.findlastindex@npm:^1.2.3": - version: 1.2.3 - resolution: "array.prototype.findlastindex@npm:1.2.3" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - es-shim-unscopables: ^1.0.0 - get-intrinsic: ^1.2.1 - checksum: 31f35d7b370c84db56484618132041a9af401b338f51899c2e78ef7690fbba5909ee7ca3c59a7192085b328cc0c68c6fd1f6d1553db01a689a589ae510f3966e - languageName: node - linkType: hard - "array.prototype.findlastindex@npm:^1.2.5": version: 1.2.6 resolution: "array.prototype.findlastindex@npm:1.2.6" @@ -6550,21 +6492,6 @@ __metadata: languageName: node linkType: hard -"arraybuffer.prototype.slice@npm:^1.0.2": - version: 1.0.2 - resolution: "arraybuffer.prototype.slice@npm:1.0.2" - dependencies: - array-buffer-byte-length: ^1.0.0 - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 - is-array-buffer: ^3.0.2 - is-shared-array-buffer: ^1.0.2 - checksum: c200faf437786f5b2c80d4564ff5481c886a16dee642ef02abdc7306c7edd523d1f01d1dd12b769c7eb42ac9bc53874510db19a92a2c035c0f6696172aafa5d3 - languageName: node - linkType: hard - "arraybuffer.prototype.slice@npm:^1.0.4": version: 1.0.4 resolution: "arraybuffer.prototype.slice@npm:1.0.4" @@ -6680,13 +6607,6 @@ __metadata: languageName: node linkType: hard -"available-typed-arrays@npm:^1.0.5": - version: 1.0.5 - resolution: "available-typed-arrays@npm:1.0.5" - checksum: 20eb47b3cefd7db027b9bbb993c658abd36d4edd3fe1060e83699a03ee275b0c9b216cc076ff3f2db29073225fb70e7613987af14269ac1fe2a19803ccc97f1a - languageName: node - linkType: hard - "available-typed-arrays@npm:^1.0.7": version: 1.0.7 resolution: "available-typed-arrays@npm:1.0.7" @@ -6845,6 +6765,13 @@ __metadata: languageName: node linkType: hard +"base-x@npm:^4.0.0": + version: 4.0.1 + resolution: "base-x@npm:4.0.1" + checksum: c9061e576f7376b2bc6b69eca131254bb16ebe1445b535a3f0d68f27524e724965b6c191dffd255bf80f9bdf5eb9d1c8d0320903e83116f2c3e09f81b5ecb6a2 + languageName: node + linkType: hard + "base64-js@npm:^1.3.1": version: 1.5.1 resolution: "base64-js@npm:1.5.1" @@ -6940,16 +6867,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.1, braces@npm:^3.0.2, braces@npm:~3.0.2": - version: 3.0.2 - resolution: "braces@npm:3.0.2" - dependencies: - fill-range: ^7.0.1 - checksum: e2a8e769a863f3d4ee887b5fe21f63193a891c68b612ddb4b68d82d1b5f3ff9073af066c343e9867a393fe4c2555dcb33e89b937195feb9c1613d259edfcd459 - languageName: node - linkType: hard - -"braces@npm:^3.0.3": +"braces@npm:^3.0.1, braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -6979,6 +6897,15 @@ __metadata: languageName: node linkType: hard +"bs58@npm:^5.0.0": + version: 5.0.0 + resolution: "bs58@npm:5.0.0" + dependencies: + base-x: ^4.0.0 + checksum: 2475cb0684e07077521aac718e604a13e0f891d58cff923d437a2f7e9e28703ab39fce9f84c7c703ab369815a675f11e3bd394d38643bfe8969fbe42e6833d45 + languageName: node + linkType: hard + "buffer@npm:6.0.3, buffer@npm:^6.0.3": version: 6.0.3 resolution: "buffer@npm:6.0.3" @@ -7053,20 +6980,7 @@ __metadata: languageName: node linkType: hard -"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.4, call-bind@npm:^1.0.5, call-bind@npm:^1.0.7": - version: 1.0.7 - resolution: "call-bind@npm:1.0.7" - dependencies: - es-define-property: ^1.0.0 - es-errors: ^1.3.0 - function-bind: ^1.1.2 - get-intrinsic: ^1.2.4 - set-function-length: ^1.2.1 - checksum: 295c0c62b90dd6522e6db3b0ab1ce26bdf9e7404215bda13cfee25b626b5ff1a7761324d58d38b1ef1607fc65aca2d06e44d2e18d0dfc6c14b465b00d8660029 - languageName: node - linkType: hard - -"call-bind@npm:^1.0.8": +"call-bind@npm:^1.0.0, call-bind@npm:^1.0.2, call-bind@npm:^1.0.7, call-bind@npm:^1.0.8": version: 1.0.8 resolution: "call-bind@npm:1.0.8" dependencies: @@ -7942,15 +7856,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:~4.3.1, debug@npm:~4.3.2": - version: 4.3.7 - resolution: "debug@npm:4.3.7" +"debug@npm:4, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.3, debug@npm:^4.3.4, debug@npm:^4.3.5, debug@npm:^4.4.0": + version: 4.4.0 + resolution: "debug@npm:4.4.0" dependencies: ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 + checksum: fb42df878dd0e22816fc56e1fdca9da73caa85212fbe40c868b1295a6878f9101ae684f4eeef516c13acfc700f5ea07f1136954f43d4cd2d477a811144136479 languageName: node linkType: hard @@ -7963,15 +7877,15 @@ __metadata: languageName: node linkType: hard -"debug@npm:^4.4.0": - version: 4.4.0 - resolution: "debug@npm:4.4.0" +"debug@npm:~4.3.1, debug@npm:~4.3.2": + version: 4.3.7 + resolution: "debug@npm:4.3.7" dependencies: ms: ^2.1.3 peerDependenciesMeta: supports-color: optional: true - checksum: fb42df878dd0e22816fc56e1fdca9da73caa85212fbe40c868b1295a6878f9101ae684f4eeef516c13acfc700f5ea07f1136954f43d4cd2d477a811144136479 + checksum: 822d74e209cd910ef0802d261b150314bbcf36c582ccdbb3e70f0894823c17e49a50d3e66d96b633524263975ca16b6a833f3e3b7e030c157169a5fabac63160 languageName: node linkType: hard @@ -8052,7 +7966,7 @@ __metadata: languageName: node linkType: hard -"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.2, define-data-property@npm:^1.1.4": +"define-data-property@npm:^1.0.1, define-data-property@npm:^1.1.4": version: 1.1.4 resolution: "define-data-property@npm:1.1.4" dependencies: @@ -8298,22 +8212,7 @@ __metadata: languageName: node linkType: hard -"elliptic@npm:6.5.4": - version: 6.5.4 - resolution: "elliptic@npm:6.5.4" - dependencies: - bn.js: ^4.11.9 - brorand: ^1.1.0 - hash.js: ^1.0.0 - hmac-drbg: ^1.0.1 - inherits: ^2.0.4 - minimalistic-assert: ^1.0.1 - minimalistic-crypto-utils: ^1.0.1 - checksum: d56d21fd04e97869f7ffcc92e18903b9f67f2d4637a23c860492fbbff5a3155fd9ca0184ce0c865dd6eb2487d234ce9551335c021c376cd2d3b7cb749c7d10f4 - languageName: node - linkType: hard - -"elliptic@npm:^6.5.7": +"elliptic@npm:6.6.1, elliptic@npm:^6.5.7": version: 6.6.1 resolution: "elliptic@npm:6.6.1" dependencies: @@ -8452,54 +8351,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.20.4, es-abstract@npm:^1.22.1": - version: 1.22.3 - resolution: "es-abstract@npm:1.22.3" - dependencies: - array-buffer-byte-length: ^1.0.0 - arraybuffer.prototype.slice: ^1.0.2 - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.5 - es-set-tostringtag: ^2.0.1 - es-to-primitive: ^1.2.1 - function.prototype.name: ^1.1.6 - get-intrinsic: ^1.2.2 - get-symbol-description: ^1.0.0 - globalthis: ^1.0.3 - gopd: ^1.0.1 - has-property-descriptors: ^1.0.0 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - hasown: ^2.0.0 - internal-slot: ^1.0.5 - is-array-buffer: ^3.0.2 - is-callable: ^1.2.7 - is-negative-zero: ^2.0.2 - is-regex: ^1.1.4 - is-shared-array-buffer: ^1.0.2 - is-string: ^1.0.7 - is-typed-array: ^1.1.12 - is-weakref: ^1.0.2 - object-inspect: ^1.13.1 - object-keys: ^1.1.1 - object.assign: ^4.1.4 - regexp.prototype.flags: ^1.5.1 - safe-array-concat: ^1.0.1 - safe-regex-test: ^1.0.0 - string.prototype.trim: ^1.2.8 - string.prototype.trimend: ^1.0.7 - string.prototype.trimstart: ^1.0.7 - typed-array-buffer: ^1.0.0 - typed-array-byte-length: ^1.0.0 - typed-array-byte-offset: ^1.0.0 - typed-array-length: ^1.0.4 - unbox-primitive: ^1.0.2 - which-typed-array: ^1.1.13 - checksum: b1bdc962856836f6e72be10b58dc128282bdf33771c7a38ae90419d920fc3b36cc5d2b70a222ad8016e3fc322c367bf4e9e89fc2bc79b7e933c05b218e83d79a - languageName: node - linkType: hard - -"es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.5, es-abstract@npm:^1.23.9": +"es-abstract@npm:^1.20.4, es-abstract@npm:^1.22.1, es-abstract@npm:^1.23.2, es-abstract@npm:^1.23.5, es-abstract@npm:^1.23.9": version: 1.23.9 resolution: "es-abstract@npm:1.23.9" dependencies: @@ -8558,16 +8410,7 @@ __metadata: languageName: node linkType: hard -"es-define-property@npm:^1.0.0": - version: 1.0.0 - resolution: "es-define-property@npm:1.0.0" - dependencies: - get-intrinsic: ^1.2.4 - checksum: f66ece0a887b6dca71848fa71f70461357c0e4e7249696f81bad0a1f347eed7b31262af4a29f5d726dc026426f085483b6b90301855e647aa8e21936f07293c6 - languageName: node - linkType: hard - -"es-define-property@npm:^1.0.1": +"es-define-property@npm:^1.0.0, es-define-property@npm:^1.0.1": version: 1.0.1 resolution: "es-define-property@npm:1.0.1" checksum: 0512f4e5d564021c9e3a644437b0155af2679d10d80f21adaf868e64d30efdfbd321631956f20f42d655fedb2e3a027da479fad3fa6048f768eb453a80a5f80a @@ -8612,18 +8455,7 @@ __metadata: languageName: node linkType: hard -"es-set-tostringtag@npm:^2.0.1": - version: 2.0.1 - resolution: "es-set-tostringtag@npm:2.0.1" - dependencies: - get-intrinsic: ^1.1.3 - has: ^1.0.3 - has-tostringtag: ^1.0.0 - checksum: ec416a12948cefb4b2a5932e62093a7cf36ddc3efd58d6c58ca7ae7064475ace556434b869b0bbeb0c365f1032a8ccd577211101234b69837ad83ad204fff884 - languageName: node - linkType: hard - -"es-set-tostringtag@npm:^2.1.0": +"es-set-tostringtag@npm:^2.0.1, es-set-tostringtag@npm:^2.1.0": version: 2.1.0 resolution: "es-set-tostringtag@npm:2.1.0" dependencies: @@ -8635,16 +8467,7 @@ __metadata: languageName: node linkType: hard -"es-shim-unscopables@npm:^1.0.0": - version: 1.0.0 - resolution: "es-shim-unscopables@npm:1.0.0" - dependencies: - has: ^1.0.3 - checksum: 83e95cadbb6ee44d3644dfad60dcad7929edbc42c85e66c3e99aefd68a3a5c5665f2686885cddb47dfeabfd77bd5ea5a7060f2092a955a729bbd8834f0d86fa1 - languageName: node - linkType: hard - -"es-shim-unscopables@npm:^1.1.0": +"es-shim-unscopables@npm:^1.0.0, es-shim-unscopables@npm:^1.1.0": version: 1.1.0 resolution: "es-shim-unscopables@npm:1.1.0" dependencies: @@ -8653,17 +8476,6 @@ __metadata: languageName: node linkType: hard -"es-to-primitive@npm:^1.2.1": - version: 1.2.1 - resolution: "es-to-primitive@npm:1.2.1" - dependencies: - is-callable: ^1.1.4 - is-date-object: ^1.0.1 - is-symbol: ^1.0.2 - checksum: 4ead6671a2c1402619bdd77f3503991232ca15e17e46222b0a41a5d81aebc8740a77822f5b3c965008e631153e9ef0580540007744521e72de8e33599fca2eed - languageName: node - linkType: hard - "es-to-primitive@npm:^1.3.0": version: 1.3.0 resolution: "es-to-primitive@npm:1.3.0" @@ -8916,9 +8728,9 @@ __metadata: linkType: hard "escalade@npm:^3.1.1, escalade@npm:^3.1.2": - version: 3.1.2 - resolution: "escalade@npm:3.1.2" - checksum: 1ec0977aa2772075493002bdbd549d595ff6e9393b1cb0d7d6fcaf78c750da0c158f180938365486f75cb69fba20294351caddfce1b46552a7b6c3cde52eaa02 + version: 3.2.0 + resolution: "escalade@npm:3.2.0" + checksum: 47b029c83de01b0d17ad99ed766347b974b0d628e848de404018f3abee728e987da0d2d370ad4574aa3d5b5bfc368754fd085d69a30f8e75903486ec4b5b709e languageName: node linkType: hard @@ -9091,18 +8903,6 @@ __metadata: languageName: node linkType: hard -"eslint-module-utils@npm:^2.8.0": - version: 2.8.0 - resolution: "eslint-module-utils@npm:2.8.0" - dependencies: - debug: ^3.2.7 - peerDependenciesMeta: - eslint: - optional: true - checksum: 74c6dfea7641ebcfe174be61168541a11a14aa8d72e515f5f09af55cd0d0862686104b0524aa4b8e0ce66418a44aa38a94d2588743db5fd07a6b49ffd16921d2 - languageName: node - linkType: hard - "eslint-plugin-babel@npm:^5.2.1": version: 5.3.1 resolution: "eslint-plugin-babel@npm:5.3.1" @@ -9141,7 +8941,7 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:2.31.0": +"eslint-plugin-import@npm:2.31.0, eslint-plugin-import@npm:^2.14.0, eslint-plugin-import@npm:^2.25.3": version: 2.31.0 resolution: "eslint-plugin-import@npm:2.31.0" dependencies: @@ -9170,36 +8970,9 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.14.0, eslint-plugin-import@npm:^2.25.3": - version: 2.29.0 - resolution: "eslint-plugin-import@npm:2.29.0" - dependencies: - array-includes: ^3.1.7 - array.prototype.findlastindex: ^1.2.3 - array.prototype.flat: ^1.3.2 - array.prototype.flatmap: ^1.3.2 - debug: ^3.2.7 - doctrine: ^2.1.0 - eslint-import-resolver-node: ^0.3.9 - eslint-module-utils: ^2.8.0 - hasown: ^2.0.0 - is-core-module: ^2.13.1 - is-glob: ^4.0.3 - minimatch: ^3.1.2 - object.fromentries: ^2.0.7 - object.groupby: ^1.0.1 - object.values: ^1.1.7 - semver: ^6.3.1 - tsconfig-paths: ^3.14.2 - peerDependencies: - eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 - checksum: 19ee541fb95eb7a796f3daebe42387b8d8262bbbcc4fd8a6e92f63a12035f3d2c6cb8bc0b6a70864fa14b1b50ed6b8e6eed5833e625e16cb6bb98b665beff269 - languageName: node - linkType: hard - -"eslint-plugin-jest@npm:^25.3.0": - version: 25.7.0 - resolution: "eslint-plugin-jest@npm:25.7.0" +"eslint-plugin-jest@npm:^25.3.0": + version: 25.7.0 + resolution: "eslint-plugin-jest@npm:25.7.0" dependencies: "@typescript-eslint/experimental-utils": ^5.0.0 peerDependencies: @@ -9664,40 +9437,40 @@ __metadata: linkType: hard "ethers@npm:^5.5.4": - version: 5.7.2 - resolution: "ethers@npm:5.7.2" - dependencies: - "@ethersproject/abi": 5.7.0 - "@ethersproject/abstract-provider": 5.7.0 - "@ethersproject/abstract-signer": 5.7.0 - "@ethersproject/address": 5.7.0 - "@ethersproject/base64": 5.7.0 - "@ethersproject/basex": 5.7.0 - "@ethersproject/bignumber": 5.7.0 - "@ethersproject/bytes": 5.7.0 - "@ethersproject/constants": 5.7.0 - "@ethersproject/contracts": 5.7.0 - "@ethersproject/hash": 5.7.0 - "@ethersproject/hdnode": 5.7.0 - "@ethersproject/json-wallets": 5.7.0 - "@ethersproject/keccak256": 5.7.0 - "@ethersproject/logger": 5.7.0 - "@ethersproject/networks": 5.7.1 - "@ethersproject/pbkdf2": 5.7.0 - "@ethersproject/properties": 5.7.0 - "@ethersproject/providers": 5.7.2 - "@ethersproject/random": 5.7.0 - "@ethersproject/rlp": 5.7.0 - "@ethersproject/sha2": 5.7.0 - "@ethersproject/signing-key": 5.7.0 - "@ethersproject/solidity": 5.7.0 - "@ethersproject/strings": 5.7.0 - "@ethersproject/transactions": 5.7.0 - "@ethersproject/units": 5.7.0 - "@ethersproject/wallet": 5.7.0 - "@ethersproject/web": 5.7.1 - "@ethersproject/wordlists": 5.7.0 - checksum: b7c08cf3e257185a7946117dbbf764433b7ba0e77c27298dec6088b3bc871aff711462b0621930c56880ff0a7ceb8b1d3a361ffa259f93377b48e34107f62553 + version: 5.8.0 + resolution: "ethers@npm:5.8.0" + dependencies: + "@ethersproject/abi": 5.8.0 + "@ethersproject/abstract-provider": 5.8.0 + "@ethersproject/abstract-signer": 5.8.0 + "@ethersproject/address": 5.8.0 + "@ethersproject/base64": 5.8.0 + "@ethersproject/basex": 5.8.0 + "@ethersproject/bignumber": 5.8.0 + "@ethersproject/bytes": 5.8.0 + "@ethersproject/constants": 5.8.0 + "@ethersproject/contracts": 5.8.0 + "@ethersproject/hash": 5.8.0 + "@ethersproject/hdnode": 5.8.0 + "@ethersproject/json-wallets": 5.8.0 + "@ethersproject/keccak256": 5.8.0 + "@ethersproject/logger": 5.8.0 + "@ethersproject/networks": 5.8.0 + "@ethersproject/pbkdf2": 5.8.0 + "@ethersproject/properties": 5.8.0 + "@ethersproject/providers": 5.8.0 + "@ethersproject/random": 5.8.0 + "@ethersproject/rlp": 5.8.0 + "@ethersproject/sha2": 5.8.0 + "@ethersproject/signing-key": 5.8.0 + "@ethersproject/solidity": 5.8.0 + "@ethersproject/strings": 5.8.0 + "@ethersproject/transactions": 5.8.0 + "@ethersproject/units": 5.8.0 + "@ethersproject/wallet": 5.8.0 + "@ethersproject/web": 5.8.0 + "@ethersproject/wordlists": 5.8.0 + checksum: fb107bf28dc3aedde4729f9553be066c699e0636346c095b4deeb5349a0c0c8538f48a58b5c8cbefced008706919739c5f7b8f4dd506bb471a31edee18cda228 languageName: node linkType: hard @@ -9848,20 +9621,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0": - version: 3.3.2 - resolution: "fast-glob@npm:3.3.2" - dependencies: - "@nodelib/fs.stat": ^2.0.2 - "@nodelib/fs.walk": ^1.2.3 - glob-parent: ^5.1.2 - merge2: ^1.3.0 - micromatch: ^4.0.4 - checksum: 900e4979f4dbc3313840078419245621259f349950411ca2fa445a2f9a1a6d98c3b5e7e0660c5ccd563aa61abe133a21765c6c0dec8e57da1ba71d8000b05ec1 - languageName: node - linkType: hard - -"fast-glob@npm:^3.3.2": +"fast-glob@npm:^3.2.9, fast-glob@npm:^3.3.0, fast-glob@npm:^3.3.2": version: 3.3.3 resolution: "fast-glob@npm:3.3.3" dependencies: @@ -9944,14 +9704,14 @@ __metadata: linkType: hard "fdir@npm:^6.4.3": - version: 6.4.3 - resolution: "fdir@npm:6.4.3" + version: 6.4.4 + resolution: "fdir@npm:6.4.4" peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: picomatch: optional: true - checksum: fa53e13c63e8c14add5b70fd47e28267dd5481ebbba4b47720ec25aae7d10a800ef0f2e33de350faaf63c10b3d7b64138925718832220d593f75e724846c736d + checksum: 79043610236579ffbd0647c508b43bd030a2d034a17c43cf96813a00e8e92e51acdb115c6ddecef3b5812cc2692b976155b4f6413e51e3761f1e772fa019a321 languageName: node linkType: hard @@ -9982,15 +9742,6 @@ __metadata: languageName: node linkType: hard -"fill-range@npm:^7.0.1": - version: 7.0.1 - resolution: "fill-range@npm:7.0.1" - dependencies: - to-regex-range: ^5.0.1 - checksum: cc283f4e65b504259e64fd969bcf4def4eb08d85565e906b7d36516e87819db52029a76b6363d0f02d0d532f0033c9603b9e2d943d56ee3b0d4f7ad3328ff917 - languageName: node - linkType: hard - "fill-range@npm:^7.1.1": version: 7.1.1 resolution: "fill-range@npm:7.1.1" @@ -10087,17 +9838,7 @@ __metadata: languageName: node linkType: hard -"follow-redirects@npm:^1.14.9": - version: 1.15.5 - resolution: "follow-redirects@npm:1.15.5" - peerDependenciesMeta: - debug: - optional: true - checksum: 5ca49b5ce6f44338cbfc3546823357e7a70813cecc9b7b768158a1d32c1e62e7407c944402a918ea8c38ae2e78266312d617dc68783fac502cbb55e1047b34ec - languageName: node - linkType: hard - -"follow-redirects@npm:^1.15.4": +"follow-redirects@npm:^1.14.9, follow-redirects@npm:^1.15.4": version: 1.15.9 resolution: "follow-redirects@npm:1.15.9" peerDependenciesMeta: @@ -10107,16 +9848,7 @@ __metadata: languageName: node linkType: hard -"for-each@npm:^0.3.3": - version: 0.3.3 - resolution: "for-each@npm:0.3.3" - dependencies: - is-callable: ^1.1.3 - checksum: 6c48ff2bc63362319c65e2edca4a8e1e3483a2fabc72fbe7feaf8c73db94fc7861bd53bc02c8a66a0c1dd709da6b04eec42e0abdd6b40ce47305ae92a25e5d28 - languageName: node - linkType: hard - -"for-each@npm:^0.3.5": +"for-each@npm:^0.3.3, for-each@npm:^0.3.5": version: 0.3.5 resolution: "for-each@npm:0.3.5" dependencies: @@ -10235,19 +9967,7 @@ __metadata: languageName: node linkType: hard -"function.prototype.name@npm:^1.1.5, function.prototype.name@npm:^1.1.6": - version: 1.1.6 - resolution: "function.prototype.name@npm:1.1.6" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - functions-have-names: ^1.2.3 - checksum: 7a3f9bd98adab09a07f6e1f03da03d3f7c26abbdeaeee15223f6c04a9fb5674792bdf5e689dac19b97ac71de6aad2027ba3048a9b883aa1b3173eed6ab07f479 - languageName: node - linkType: hard - -"function.prototype.name@npm:^1.1.8": +"function.prototype.name@npm:^1.1.6, function.prototype.name@npm:^1.1.8": version: 1.1.8 resolution: "function.prototype.name@npm:1.1.8" dependencies: @@ -10305,20 +10025,7 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2, get-intrinsic@npm:^1.2.3, get-intrinsic@npm:^1.2.4": - version: 1.2.4 - resolution: "get-intrinsic@npm:1.2.4" - dependencies: - es-errors: ^1.3.0 - function-bind: ^1.1.2 - has-proto: ^1.0.1 - has-symbols: ^1.0.3 - hasown: ^2.0.0 - checksum: 414e3cdf2c203d1b9d7d33111df746a4512a1aa622770b361dadddf8ed0b5aeb26c560f49ca077e24bfafb0acb55ca908d1f709216ccba33ffc548ec8a79a951 - languageName: node - linkType: hard - -"get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6, get-intrinsic@npm:^1.2.7, get-intrinsic@npm:^1.3.0": +"get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.4, get-intrinsic@npm:^1.2.5, get-intrinsic@npm:^1.2.6, get-intrinsic@npm:^1.2.7, get-intrinsic@npm:^1.3.0": version: 1.3.0 resolution: "get-intrinsic@npm:1.3.0" dependencies: @@ -10374,16 +10081,6 @@ __metadata: languageName: node linkType: hard -"get-symbol-description@npm:^1.0.0": - version: 1.0.0 - resolution: "get-symbol-description@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.1.1 - checksum: 9ceff8fe968f9270a37a1f73bf3f1f7bda69ca80f4f80850670e0e7b9444ff99323f7ac52f96567f8b5f5fbe7ac717a0d81d3407c7313e82810c6199446a5247 - languageName: node - linkType: hard - "get-symbol-description@npm:^1.1.0": version: 1.1.0 resolution: "get-symbol-description@npm:1.1.0" @@ -10395,7 +10092,7 @@ __metadata: languageName: node linkType: hard -"get-tsconfig@npm:^4.10.0": +"get-tsconfig@npm:^4.10.0, get-tsconfig@npm:^4.7.5": version: 4.10.0 resolution: "get-tsconfig@npm:4.10.0" dependencies: @@ -10404,15 +10101,6 @@ __metadata: languageName: node linkType: hard -"get-tsconfig@npm:^4.7.5": - version: 4.8.0 - resolution: "get-tsconfig@npm:4.8.0" - dependencies: - resolve-pkg-maps: ^1.0.0 - checksum: e8716cb4774747d73e1f2e32f9a01cd7aa55dcbdeadaae2d514b62f686a24d28681111d5ea4c238b80e7537fe6c95bb4800cd6123d6305966a2dd333e2a85720 - languageName: node - linkType: hard - "glob-parent@npm:^5.0.0, glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.0, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" @@ -10513,16 +10201,7 @@ __metadata: languageName: node linkType: hard -"globalthis@npm:^1.0.3": - version: 1.0.3 - resolution: "globalthis@npm:1.0.3" - dependencies: - define-properties: ^1.1.3 - checksum: fbd7d760dc464c886d0196166d92e5ffb4c84d0730846d6621a39fbbc068aeeb9c8d1421ad330e94b7bca4bb4ea092f5f21f3d36077812af5d098b4dc006c998 - languageName: node - linkType: hard - -"globalthis@npm:^1.0.4": +"globalthis@npm:^1.0.3, globalthis@npm:^1.0.4": version: 1.0.4 resolution: "globalthis@npm:1.0.4" dependencies: @@ -10567,6 +10246,7 @@ __metadata: "@gelatonetwork/relay-sdk": 5.6.0 "@gemini-wallet/rainbow": 0.2.0 "@headlessui/react": 1.7.19 + "@layerzerolabs/lz-v2-utilities": 3.0.85 "@lingui/cli": 4.10.0 "@lingui/core": 4.10.0 "@lingui/loader": 4.10.0 @@ -10574,6 +10254,7 @@ __metadata: "@lingui/react": 4.10.0 "@lingui/vite-plugin": 4.11.3 "@rainbow-me/rainbowkit": 2.2.0 + "@stargatefinance/stg-evm-sdk-v2": 1.1.12 "@tanstack/react-query": 5.25.0 "@taskworld.com/rereselect": 0.3.0 "@testing-library/jest-dom": 5.16.1 @@ -10651,13 +10332,13 @@ __metadata: rollup-plugin-visualizer: 5.12.0 sass: 1.55.0 shallowequal: 1.1.0 - swr: 2.2.1 + swr: 2.3.3 tailwindcss: 3.4.4 tsx: 4.19.0 typechain: 8.3.2 typescript: 5.4.2 use-context-selector: 1.4.1 - viem: 2.7.20 + viem: 2.26.2 vite: 5.4.0 vite-bundle-analyzer: 0.20.1 vite-plugin-svgr: 4.2.0 @@ -10678,16 +10359,7 @@ __metadata: languageName: node linkType: hard -"gopd@npm:^1.0.1": - version: 1.0.1 - resolution: "gopd@npm:1.0.1" - dependencies: - get-intrinsic: ^1.1.3 - checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 - languageName: node - linkType: hard - -"gopd@npm:^1.2.0": +"gopd@npm:^1.0.1, gopd@npm:^1.2.0": version: 1.2.0 resolution: "gopd@npm:1.2.0" checksum: cc6d8e655e360955bdccaca51a12a474268f95bb793fc3e1f2bdadb075f28bfd1fd988dab872daf77a61d78cbaf13744bc8727a17cfb1d150d76047d805375f3 @@ -10766,7 +10438,7 @@ __metadata: languageName: node linkType: hard -"has-bigints@npm:^1.0.1, has-bigints@npm:^1.0.2": +"has-bigints@npm:^1.0.2": version: 1.0.2 resolution: "has-bigints@npm:1.0.2" checksum: 390e31e7be7e5c6fe68b81babb73dfc35d413604d7ee5f56da101417027a4b4ce6a27e46eff97ad040c835b5d228676eae99a9b5c3bc0e23c8e81a49241ff45b @@ -10787,7 +10459,7 @@ __metadata: languageName: node linkType: hard -"has-property-descriptors@npm:^1.0.0, has-property-descriptors@npm:^1.0.1, has-property-descriptors@npm:^1.0.2": +"has-property-descriptors@npm:^1.0.0, has-property-descriptors@npm:^1.0.2": version: 1.0.2 resolution: "has-property-descriptors@npm:1.0.2" dependencies: @@ -10796,14 +10468,7 @@ __metadata: languageName: node linkType: hard -"has-proto@npm:^1.0.1": - version: 1.0.1 - resolution: "has-proto@npm:1.0.1" - checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e - languageName: node - linkType: hard - -"has-proto@npm:^1.2.0": +"has-proto@npm:^1.0.1, has-proto@npm:^1.2.0": version: 1.2.0 resolution: "has-proto@npm:1.2.0" dependencies: @@ -10812,30 +10477,14 @@ __metadata: languageName: node linkType: hard -"has-symbols@npm:^1.0.2, has-symbols@npm:^1.0.3": - version: 1.0.3 - resolution: "has-symbols@npm:1.0.3" - checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410 - languageName: node - linkType: hard - -"has-symbols@npm:^1.1.0": +"has-symbols@npm:^1.0.3, has-symbols@npm:^1.1.0": version: 1.1.0 resolution: "has-symbols@npm:1.1.0" checksum: b2316c7302a0e8ba3aaba215f834e96c22c86f192e7310bdf689dd0e6999510c89b00fbc5742571507cebf25764d68c988b3a0da217369a73596191ac0ce694b languageName: node linkType: hard -"has-tostringtag@npm:^1.0.0": - version: 1.0.0 - resolution: "has-tostringtag@npm:1.0.0" - dependencies: - has-symbols: ^1.0.2 - checksum: cc12eb28cb6ae22369ebaad3a8ab0799ed61270991be88f208d508076a1e99abe4198c965935ce85ea90b60c94ddda73693b0920b58e7ead048b4a391b502c1c - languageName: node - linkType: hard - -"has-tostringtag@npm:^1.0.2": +"has-tostringtag@npm:^1.0.0, has-tostringtag@npm:^1.0.2": version: 1.0.2 resolution: "has-tostringtag@npm:1.0.2" dependencies: @@ -10870,15 +10519,6 @@ __metadata: languageName: node linkType: hard -"hasown@npm:^2.0.0": - version: 2.0.0 - resolution: "hasown@npm:2.0.0" - dependencies: - function-bind: ^1.1.2 - checksum: 6151c75ca12554565098641c98a40f4cc86b85b0fd5b6fe92360967e4605a4f9610f7757260b4e8098dd1c2ce7f4b095f2006fe72a570e3b6d2d28de0298c176 - languageName: node - linkType: hard - "hasown@npm:^2.0.2": version: 2.0.2 resolution: "hasown@npm:2.0.2" @@ -11074,14 +10714,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.2.0": - version: 5.3.1 - resolution: "ignore@npm:5.3.1" - checksum: 71d7bb4c1dbe020f915fd881108cbe85a0db3d636a0ea3ba911393c53946711d13a9b1143c7e70db06d571a5822c0a324a6bcde5c9904e7ca5047f01f1bf8cd3 - languageName: node - linkType: hard - -"ignore@npm:^5.3.1": +"ignore@npm:^5.2.0, ignore@npm:^5.3.1": version: 5.3.2 resolution: "ignore@npm:5.3.2" checksum: 2acfd32a573260ea522ea0bfeff880af426d68f6831f973129e2ba7363f422923cf53aab62f8369cbf4667c7b25b6f8a3761b34ecdb284ea18e87a5262a865be @@ -11174,18 +10807,7 @@ __metadata: languageName: node linkType: hard -"internal-slot@npm:^1.0.3, internal-slot@npm:^1.0.5": - version: 1.0.5 - resolution: "internal-slot@npm:1.0.5" - dependencies: - get-intrinsic: ^1.2.0 - has: ^1.0.3 - side-channel: ^1.0.4 - checksum: 97e84046bf9e7574d0956bd98d7162313ce7057883b6db6c5c7b5e5f05688864b0978ba07610c726d15d66544ffe4b1050107d93f8a39ebc59b15d8b429b497a - languageName: node - linkType: hard - -"internal-slot@npm:^1.1.0": +"internal-slot@npm:^1.0.3, internal-slot@npm:^1.0.5, internal-slot@npm:^1.1.0": version: 1.1.0 resolution: "internal-slot@npm:1.1.0" dependencies: @@ -11203,7 +10825,7 @@ __metadata: languageName: node linkType: hard -"invariant@npm:2.2.4, invariant@npm:^2.2.4": +"invariant@npm:2.2.4": version: 2.2.4 resolution: "invariant@npm:2.2.4" dependencies: @@ -11253,17 +10875,6 @@ __metadata: languageName: node linkType: hard -"is-array-buffer@npm:^3.0.1, is-array-buffer@npm:^3.0.2": - version: 3.0.2 - resolution: "is-array-buffer@npm:3.0.2" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.2.0 - is-typed-array: ^1.1.10 - checksum: dcac9dda66ff17df9cabdc58214172bf41082f956eab30bb0d86bc0fab1e44b690fc8e1f855cf2481245caf4e8a5a006a982a71ddccec84032ed41f9d8da8c14 - languageName: node - linkType: hard - "is-array-buffer@npm:^3.0.4, is-array-buffer@npm:^3.0.5": version: 3.0.5 resolution: "is-array-buffer@npm:3.0.5" @@ -11298,15 +10909,6 @@ __metadata: languageName: node linkType: hard -"is-bigint@npm:^1.0.1": - version: 1.0.4 - resolution: "is-bigint@npm:1.0.4" - dependencies: - has-bigints: ^1.0.1 - checksum: c56edfe09b1154f8668e53ebe8252b6f185ee852a50f9b41e8d921cb2bed425652049fbe438723f6cb48a63ca1aa051e948e7e401e093477c99c84eba244f666 - languageName: node - linkType: hard - "is-bigint@npm:^1.1.0": version: 1.1.0 resolution: "is-bigint@npm:1.1.0" @@ -11325,16 +10927,6 @@ __metadata: languageName: node linkType: hard -"is-boolean-object@npm:^1.1.0": - version: 1.1.2 - resolution: "is-boolean-object@npm:1.1.2" - dependencies: - call-bind: ^1.0.2 - has-tostringtag: ^1.0.0 - checksum: c03b23dbaacadc18940defb12c1c0e3aaece7553ef58b162a0f6bba0c2a7e1551b59f365b91e00d2dbac0522392d576ef322628cb1d036a0fe51eb466db67222 - languageName: node - linkType: hard - "is-boolean-object@npm:^1.2.1": version: 1.2.2 resolution: "is-boolean-object@npm:1.2.2" @@ -11345,23 +10937,14 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": +"is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac languageName: node linkType: hard -"is-core-module@npm:^2.13.0, is-core-module@npm:^2.13.1, is-core-module@npm:^2.9.0": - version: 2.13.1 - resolution: "is-core-module@npm:2.13.1" - dependencies: - hasown: ^2.0.0 - checksum: 256559ee8a9488af90e4bad16f5583c6d59e92f0742e9e8bb4331e758521ee86b810b93bae44f390766ffbc518a0488b18d9dab7da9a5ff997d499efc9403f7c - languageName: node - linkType: hard - -"is-core-module@npm:^2.15.1": +"is-core-module@npm:^2.13.0, is-core-module@npm:^2.15.1, is-core-module@npm:^2.9.0": version: 2.16.1 resolution: "is-core-module@npm:2.16.1" dependencies: @@ -11381,16 +10964,7 @@ __metadata: languageName: node linkType: hard -"is-date-object@npm:^1.0.1, is-date-object@npm:^1.0.5": - version: 1.0.5 - resolution: "is-date-object@npm:1.0.5" - dependencies: - has-tostringtag: ^1.0.0 - checksum: baa9077cdf15eb7b58c79398604ca57379b2fc4cf9aa7a9b9e295278648f628c9b201400c01c5e0f7afae56507d741185730307cbe7cad3b9f90a77e5ee342fc - languageName: node - linkType: hard - -"is-date-object@npm:^1.1.0": +"is-date-object@npm:^1.0.5, is-date-object@npm:^1.1.0": version: 1.1.0 resolution: "is-date-object@npm:1.1.0" dependencies: @@ -11425,15 +10999,6 @@ __metadata: languageName: node linkType: hard -"is-finalizationregistry@npm:^1.0.2": - version: 1.0.2 - resolution: "is-finalizationregistry@npm:1.0.2" - dependencies: - call-bind: ^1.0.2 - checksum: 4f243a8e06228cd45bdab8608d2cb7abfc20f6f0189c8ac21ea8d603f1f196eabd531ce0bb8e08cbab047e9845ef2c191a3761c9a17ad5cabf8b35499c4ad35d - languageName: node - linkType: hard - "is-finalizationregistry@npm:^1.1.0": version: 1.1.1 resolution: "is-finalizationregistry@npm:1.1.1" @@ -11507,13 +11072,6 @@ __metadata: languageName: node linkType: hard -"is-map@npm:^2.0.1": - version: 2.0.2 - resolution: "is-map@npm:2.0.2" - checksum: ace3d0ecd667bbdefdb1852de601268f67f2db725624b1958f279316e13fecb8fa7df91fd60f690d7417b4ec180712f5a7ee967008e27c65cfd475cc84337728 - languageName: node - linkType: hard - "is-map@npm:^2.0.3": version: 2.0.3 resolution: "is-map@npm:2.0.3" @@ -11531,22 +11089,6 @@ __metadata: languageName: node linkType: hard -"is-negative-zero@npm:^2.0.2": - version: 2.0.2 - resolution: "is-negative-zero@npm:2.0.2" - checksum: f3232194c47a549da60c3d509c9a09be442507616b69454716692e37ae9f37c4dea264fb208ad0c9f3efd15a796a46b79df07c7e53c6227c32170608b809149a - languageName: node - linkType: hard - -"is-number-object@npm:^1.0.4": - version: 1.0.7 - resolution: "is-number-object@npm:1.0.7" - dependencies: - has-tostringtag: ^1.0.0 - checksum: d1e8d01bb0a7134c74649c4e62da0c6118a0bfc6771ea3c560914d52a627873e6920dd0fd0ebc0e12ad2ff4687eac4c308f7e80320b973b2c8a2c8f97a7524f7 - languageName: node - linkType: hard - "is-number-object@npm:^1.1.1": version: 1.1.1 resolution: "is-number-object@npm:1.1.1" @@ -11571,16 +11113,6 @@ __metadata: languageName: node linkType: hard -"is-regex@npm:^1.1.4": - version: 1.1.4 - resolution: "is-regex@npm:1.1.4" - dependencies: - call-bind: ^1.0.2 - has-tostringtag: ^1.0.0 - checksum: 362399b33535bc8f386d96c45c9feb04cf7f8b41c182f54174c1a45c9abbbe5e31290bbad09a458583ff6bf3b2048672cdb1881b13289569a7c548370856a652 - languageName: node - linkType: hard - "is-regex@npm:^1.2.1": version: 1.2.1 resolution: "is-regex@npm:1.2.1" @@ -11593,13 +11125,6 @@ __metadata: languageName: node linkType: hard -"is-set@npm:^2.0.1": - version: 2.0.2 - resolution: "is-set@npm:2.0.2" - checksum: b64343faf45e9387b97a6fd32be632ee7b269bd8183701f3b3f5b71a7cf00d04450ed8669d0bd08753e08b968beda96fca73a10fd0ff56a32603f64deba55a57 - languageName: node - linkType: hard - "is-set@npm:^2.0.3": version: 2.0.3 resolution: "is-set@npm:2.0.3" @@ -11607,15 +11132,6 @@ __metadata: languageName: node linkType: hard -"is-shared-array-buffer@npm:^1.0.2": - version: 1.0.2 - resolution: "is-shared-array-buffer@npm:1.0.2" - dependencies: - call-bind: ^1.0.2 - checksum: 9508929cf14fdc1afc9d61d723c6e8d34f5e117f0bffda4d97e7a5d88c3a8681f633a74f8e3ad1fe92d5113f9b921dc5ca44356492079612f9a247efbce7032a - languageName: node - linkType: hard - "is-shared-array-buffer@npm:^1.0.4": version: 1.0.4 resolution: "is-shared-array-buffer@npm:1.0.4" @@ -11639,16 +11155,7 @@ __metadata: languageName: node linkType: hard -"is-string@npm:^1.0.5, is-string@npm:^1.0.7": - version: 1.0.7 - resolution: "is-string@npm:1.0.7" - dependencies: - has-tostringtag: ^1.0.0 - checksum: 323b3d04622f78d45077cf89aab783b2f49d24dc641aa89b5ad1a72114cfeff2585efc8c12ef42466dff32bde93d839ad321b26884cf75e5a7892a938b089989 - languageName: node - linkType: hard - -"is-string@npm:^1.1.1": +"is-string@npm:^1.0.7, is-string@npm:^1.1.1": version: 1.1.1 resolution: "is-string@npm:1.1.1" dependencies: @@ -11667,15 +11174,6 @@ __metadata: languageName: node linkType: hard -"is-symbol@npm:^1.0.2, is-symbol@npm:^1.0.3": - version: 1.0.4 - resolution: "is-symbol@npm:1.0.4" - dependencies: - has-symbols: ^1.0.2 - checksum: 92805812ef590738d9de49d677cd17dfd486794773fb6fa0032d16452af46e9b91bb43ffe82c983570f015b37136f4b53b28b8523bfb10b0ece7a66c31a54510 - languageName: node - linkType: hard - "is-symbol@npm:^1.0.4, is-symbol@npm:^1.1.1": version: 1.1.1 resolution: "is-symbol@npm:1.1.1" @@ -11687,16 +11185,7 @@ __metadata: languageName: node linkType: hard -"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.12, is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.9": - version: 1.1.12 - resolution: "is-typed-array@npm:1.1.12" - dependencies: - which-typed-array: ^1.1.11 - checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 - languageName: node - linkType: hard - -"is-typed-array@npm:^1.1.13, is-typed-array@npm:^1.1.14, is-typed-array@npm:^1.1.15": +"is-typed-array@npm:^1.1.13, is-typed-array@npm:^1.1.14, is-typed-array@npm:^1.1.15, is-typed-array@npm:^1.1.3": version: 1.1.15 resolution: "is-typed-array@npm:1.1.15" dependencies: @@ -11712,13 +11201,6 @@ __metadata: languageName: node linkType: hard -"is-weakmap@npm:^2.0.1": - version: 2.0.1 - resolution: "is-weakmap@npm:2.0.1" - checksum: 1222bb7e90c32bdb949226e66d26cb7bce12e1e28e3e1b40bfa6b390ba3e08192a8664a703dff2a00a84825f4e022f9cd58c4599ff9981ab72b1d69479f4f7f6 - languageName: node - linkType: hard - "is-weakmap@npm:^2.0.2": version: 2.0.2 resolution: "is-weakmap@npm:2.0.2" @@ -11726,16 +11208,7 @@ __metadata: languageName: node linkType: hard -"is-weakref@npm:^1.0.2": - version: 1.0.2 - resolution: "is-weakref@npm:1.0.2" - dependencies: - call-bind: ^1.0.2 - checksum: 95bd9a57cdcb58c63b1c401c60a474b0f45b94719c30f548c891860f051bc2231575c290a6b420c6bc6e7ed99459d424c652bd5bf9a1d5259505dc35b4bf83de - languageName: node - linkType: hard - -"is-weakref@npm:^1.1.0": +"is-weakref@npm:^1.0.2, is-weakref@npm:^1.1.0": version: 1.1.1 resolution: "is-weakref@npm:1.1.1" dependencies: @@ -11744,16 +11217,6 @@ __metadata: languageName: node linkType: hard -"is-weakset@npm:^2.0.1": - version: 2.0.2 - resolution: "is-weakset@npm:2.0.2" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.1.1 - checksum: 5d8698d1fa599a0635d7ca85be9c26d547b317ed8fd83fc75f03efbe75d50001b5eececb1e9971de85fcde84f69ae6f8346bc92d20d55d46201d328e4c74a367 - languageName: node - linkType: hard - "is-weakset@npm:^2.0.3": version: 2.0.4 resolution: "is-weakset@npm:2.0.4" @@ -11828,15 +11291,6 @@ __metadata: languageName: node linkType: hard -"isows@npm:1.0.3": - version: 1.0.3 - resolution: "isows@npm:1.0.3" - peerDependencies: - ws: "*" - checksum: 9cacd5cf59f67deb51e825580cd445ab1725ecb05a67c704050383fb772856f3cd5e7da8ad08f5a3bd2823680d77d099459d0c6a7037972a74d6429af61af440 - languageName: node - linkType: hard - "isows@npm:1.0.6": version: 1.0.6 resolution: "isows@npm:1.0.6" @@ -12490,15 +11944,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^6.0.0": - version: 6.0.0 - resolution: "lru-cache@npm:6.0.0" - dependencies: - yallist: ^4.0.0 - checksum: f97f499f898f23e4585742138a22f22526254fdba6d75d41a1c2526b3b6cc5747ef59c5612ba7375f42aca4f8461950e925ba08c991ead0651b4918b7c978297 - languageName: node - linkType: hard - "lru-cache@npm:^7.7.1": version: 7.18.3 resolution: "lru-cache@npm:7.18.3" @@ -12615,17 +12060,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": - version: 4.0.5 - resolution: "micromatch@npm:4.0.5" - dependencies: - braces: ^3.0.2 - picomatch: ^2.3.1 - checksum: 02a17b671c06e8fefeeb6ef996119c1e597c942e632a21ef589154f23898c9c6a9858526246abb14f8bca6e77734aa9dcf65476fca47cedfb80d9577d52843fc - languageName: node - linkType: hard - -"micromatch@npm:^4.0.8": +"micromatch@npm:^4.0.4, micromatch@npm:^4.0.5, micromatch@npm:^4.0.8": version: 4.0.8 resolution: "micromatch@npm:4.0.8" dependencies: @@ -12704,16 +12139,7 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" - dependencies: - brace-expansion: ^2.0.1 - checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 - languageName: node - linkType: hard - -"minimatch@npm:^9.0.4": +"minimatch@npm:^9.0.1, minimatch@npm:^9.0.4": version: 9.0.5 resolution: "minimatch@npm:9.0.5" dependencies: @@ -13169,14 +12595,7 @@ __metadata: languageName: node linkType: hard -"object-inspect@npm:^1.12.0, object-inspect@npm:^1.13.1, object-inspect@npm:^1.9.0": - version: 1.13.1 - resolution: "object-inspect@npm:1.13.1" - checksum: 7d9fa9221de3311dcb5c7c307ee5dc011cdd31dc43624b7c184b3840514e118e05ef0002be5388304c416c0eb592feb46e983db12577fc47e47d5752fbbfb61f - languageName: node - linkType: hard - -"object-inspect@npm:^1.13.3": +"object-inspect@npm:^1.12.0, object-inspect@npm:^1.13.3": version: 1.13.4 resolution: "object-inspect@npm:1.13.4" checksum: 582810c6a8d2ef988ea0a39e69e115a138dad8f42dd445383b394877e5816eb4268489f316a6f74ee9c4e0a984b3eab1028e3e79d62b1ed67c726661d55c7a8b @@ -13200,19 +12619,7 @@ __metadata: languageName: node linkType: hard -"object.assign@npm:^4.1.4": - version: 4.1.4 - resolution: "object.assign@npm:4.1.4" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.1.4 - has-symbols: ^1.0.3 - object-keys: ^1.1.1 - checksum: 76cab513a5999acbfe0ff355f15a6a125e71805fcf53de4e9d4e082e1989bdb81d1e329291e1e4e0ae7719f0e4ef80e88fb2d367ae60500d79d25a6224ac8864 - languageName: node - linkType: hard - -"object.assign@npm:^4.1.7": +"object.assign@npm:^4.1.4, object.assign@npm:^4.1.7": version: 4.1.7 resolution: "object.assign@npm:4.1.7" dependencies: @@ -13237,18 +12644,7 @@ __metadata: languageName: node linkType: hard -"object.fromentries@npm:^2.0.6, object.fromentries@npm:^2.0.7": - version: 2.0.7 - resolution: "object.fromentries@npm:2.0.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: 7341ce246e248b39a431b87a9ddd331ff52a454deb79afebc95609f94b1f8238966cf21f52188f2a353f0fdf83294f32f1ebf1f7826aae915ebad21fd0678065 - languageName: node - linkType: hard - -"object.fromentries@npm:^2.0.8": +"object.fromentries@npm:^2.0.6, object.fromentries@npm:^2.0.8": version: 2.0.8 resolution: "object.fromentries@npm:2.0.8" dependencies: @@ -13260,18 +12656,6 @@ __metadata: languageName: node linkType: hard -"object.groupby@npm:^1.0.1": - version: 1.0.1 - resolution: "object.groupby@npm:1.0.1" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 - checksum: d7959d6eaaba358b1608066fc67ac97f23ce6f573dc8fc661f68c52be165266fcb02937076aedb0e42722fdda0bdc0bbf74778196ac04868178888e9fd3b78b5 - languageName: node - linkType: hard - "object.groupby@npm:^1.0.3": version: 1.0.3 resolution: "object.groupby@npm:1.0.3" @@ -13293,18 +12677,7 @@ __metadata: languageName: node linkType: hard -"object.values@npm:^1.1.6, object.values@npm:^1.1.7": - version: 1.1.7 - resolution: "object.values@npm:1.1.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: f3e4ae4f21eb1cc7cebb6ce036d4c67b36e1c750428d7b7623c56a0db90edced63d08af8a316d81dfb7c41a3a5fa81b05b7cc9426e98d7da986b1682460f0777 - languageName: node - linkType: hard - -"object.values@npm:^1.2.0": +"object.values@npm:^1.1.6, object.values@npm:^1.2.0": version: 1.2.1 resolution: "object.values@npm:1.2.1" dependencies: @@ -13452,9 +12825,9 @@ __metadata: languageName: node linkType: hard -"ox@npm:0.1.0": - version: 0.1.0 - resolution: "ox@npm:0.1.0" +"ox@npm:0.6.9": + version: 0.6.9 + resolution: "ox@npm:0.6.9" dependencies: "@adraffy/ens-normalize": ^1.10.1 "@noble/curves": ^1.6.0 @@ -13468,7 +12841,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 9018ad39ce3869c9ba6df7f4c0a35df5230014012a8fa28535e2a9b3282aaed5e314da84b7ee4357b79ab33eee3989cfa08ad5bb76c76282296102722566b6dd + checksum: 6f35c9710ab3edb8146f0d2a7c482517c8e1cb2adf0cfb7aba23a17209cf7171546ad017cce98dd9e0f60cee5d77ddaaa72961023e4456de093d985b5712c546 languageName: node linkType: hard @@ -13644,9 +13017,9 @@ __metadata: linkType: hard "picocolors@npm:^1.0.0, picocolors@npm:^1.0.1": - version: 1.0.1 - resolution: "picocolors@npm:1.0.1" - checksum: fa68166d1f56009fc02a34cdfd112b0dd3cf1ef57667ac57281f714065558c01828cdf4f18600ad6851cbe0093952ed0660b1e0156bddf2184b6aaf5817553a5 + version: 1.1.1 + resolution: "picocolors@npm:1.1.1" + checksum: e1cf46bf84886c79055fdfa9dcb3e4711ad259949e3565154b004b260cd356c5d54b31a1437ce9782624bf766272fe6b0154f5f0c744fb7af5d454d2b60db045 languageName: node linkType: hard @@ -14422,23 +13795,7 @@ __metadata: languageName: node linkType: hard -"react-remove-scroll-bar@npm:^2.3.3": - version: 2.3.6 - resolution: "react-remove-scroll-bar@npm:2.3.6" - dependencies: - react-style-singleton: ^2.2.1 - tslib: ^2.0.0 - peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: e793fe110e2ea60d5724d0b60f09de1f6cd1b080df00df9e68bb9a1b985895830e703194647059fdc22402a67a89b7673a5260773b89bcd98031fd99bc91aefa - languageName: node - linkType: hard - -"react-remove-scroll-bar@npm:^2.3.6": +"react-remove-scroll-bar@npm:^2.3.3, react-remove-scroll-bar@npm:^2.3.6": version: 2.3.8 resolution: "react-remove-scroll-bar@npm:2.3.8" dependencies: @@ -14569,24 +13926,7 @@ __metadata: languageName: node linkType: hard -"react-style-singleton@npm:^2.2.1": - version: 2.2.1 - resolution: "react-style-singleton@npm:2.2.1" - dependencies: - get-nonce: ^1.0.0 - invariant: ^2.2.4 - tslib: ^2.0.0 - peerDependencies: - "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - peerDependenciesMeta: - "@types/react": - optional: true - checksum: 7ee8ef3aab74c7ae1d70ff34a27643d11ba1a8d62d072c767827d9ff9a520905223e567002e0bf6c772929d8ea1c781a3ba0cc4a563e92b1e3dc2eaa817ecbe8 - languageName: node - linkType: hard - -"react-style-singleton@npm:^2.2.2": +"react-style-singleton@npm:^2.2.1, react-style-singleton@npm:^2.2.2": version: 2.2.3 resolution: "react-style-singleton@npm:2.2.3" dependencies: @@ -14819,21 +14159,7 @@ __metadata: languageName: node linkType: hard -"reflect.getprototypeof@npm:^1.0.4": - version: 1.0.4 - resolution: "reflect.getprototypeof@npm:1.0.4" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - get-intrinsic: ^1.2.1 - globalthis: ^1.0.3 - which-builtin-type: ^1.1.3 - checksum: 16e2361988dbdd23274b53fb2b1b9cefeab876c3941a2543b4cadac6f989e3db3957b07a44aac46cfceb3e06e2871785ec2aac992d824f76292f3b5ee87f66f2 - languageName: node - linkType: hard - -"reflect.getprototypeof@npm:^1.0.6, reflect.getprototypeof@npm:^1.0.9": +"reflect.getprototypeof@npm:^1.0.4, reflect.getprototypeof@npm:^1.0.6, reflect.getprototypeof@npm:^1.0.9": version: 1.0.10 resolution: "reflect.getprototypeof@npm:1.0.10" dependencies: @@ -14872,13 +14198,6 @@ __metadata: languageName: node linkType: hard -"regenerator-runtime@npm:^0.14.0": - version: 0.14.0 - resolution: "regenerator-runtime@npm:0.14.0" - checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 - languageName: node - linkType: hard - "regenerator-transform@npm:^0.15.1": version: 0.15.1 resolution: "regenerator-transform@npm:0.15.1" @@ -14888,18 +14207,7 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.1": - version: 1.5.1 - resolution: "regexp.prototype.flags@npm:1.5.1" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - set-function-name: ^2.0.0 - checksum: 869edff00288442f8d7fa4c9327f91d85f3b3acf8cbbef9ea7a220345cf23e9241b6def9263d2c1ebcf3a316b0aa52ad26a43a84aa02baca3381717b3e307f47 - languageName: node - linkType: hard - -"regexp.prototype.flags@npm:^1.5.3": +"regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.3": version: 1.5.4 resolution: "regexp.prototype.flags@npm:1.5.4" dependencies: @@ -15266,19 +14574,7 @@ __metadata: languageName: node linkType: hard -"safe-array-concat@npm:^1.0.1": - version: 1.0.1 - resolution: "safe-array-concat@npm:1.0.1" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.2.1 - has-symbols: ^1.0.3 - isarray: ^2.0.5 - checksum: 001ecf1d8af398251cbfabaf30ed66e3855127fbceee178179524b24160b49d15442f94ed6c0db0b2e796da76bb05b73bf3cc241490ec9c2b741b41d33058581 - languageName: node - linkType: hard - -"safe-array-concat@npm:^1.1.3": +"safe-array-concat@npm:^1.0.1, safe-array-concat@npm:^1.1.3": version: 1.1.3 resolution: "safe-array-concat@npm:1.1.3" dependencies: @@ -15315,17 +14611,6 @@ __metadata: languageName: node linkType: hard -"safe-regex-test@npm:^1.0.0": - version: 1.0.0 - resolution: "safe-regex-test@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.1.3 - is-regex: ^1.1.4 - checksum: bc566d8beb8b43c01b94e67de3f070fd2781685e835959bbbaaec91cc53381145ca91f69bd837ce6ec244817afa0a5e974fc4e40a2957f0aca68ac3add1ddd34 - languageName: node - linkType: hard - "safe-regex-test@npm:^1.1.0": version: 1.1.0 resolution: "safe-regex-test@npm:1.1.0" @@ -15416,18 +14701,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.4": - version: 7.6.0 - resolution: "semver@npm:7.6.0" - dependencies: - lru-cache: ^6.0.0 - bin: - semver: bin/semver.js - checksum: 7427f05b70786c696640edc29fdd4bc33b2acf3bbe1740b955029044f80575fc664e1a512e4113c3af21e767154a94b4aa214bf6cd6e42a1f6dba5914e0b208c - languageName: node - linkType: hard - -"semver@npm:^7.6.0": +"semver@npm:^7.3.5, semver@npm:^7.3.7, semver@npm:^7.3.8, semver@npm:^7.5.4, semver@npm:^7.6.0": version: 7.7.1 resolution: "semver@npm:7.7.1" bin: @@ -15443,20 +14717,6 @@ __metadata: languageName: node linkType: hard -"set-function-length@npm:^1.2.1": - version: 1.2.1 - resolution: "set-function-length@npm:1.2.1" - dependencies: - define-data-property: ^1.1.2 - es-errors: ^1.3.0 - function-bind: ^1.1.2 - get-intrinsic: ^1.2.3 - gopd: ^1.0.1 - has-property-descriptors: ^1.0.1 - checksum: 23742476d695f2eae86348c069bd164d4f25fa7c26546a46a2b5f370f1f84b98ec64366d2cd17785d5b41bbf16b95855da4b7eb188e7056fe3b0248d61f6afda - languageName: node - linkType: hard - "set-function-length@npm:^1.2.2": version: 1.2.2 resolution: "set-function-length@npm:1.2.2" @@ -15471,18 +14731,7 @@ __metadata: languageName: node linkType: hard -"set-function-name@npm:^2.0.0, set-function-name@npm:^2.0.1": - version: 2.0.1 - resolution: "set-function-name@npm:2.0.1" - dependencies: - define-data-property: ^1.0.1 - functions-have-names: ^1.2.3 - has-property-descriptors: ^1.0.0 - checksum: 4975d17d90c40168eee2c7c9c59d023429f0a1690a89d75656306481ece0c3c1fb1ebcc0150ea546d1913e35fbd037bace91372c69e543e51fc5d1f31a9fa126 - languageName: node - linkType: hard - -"set-function-name@npm:^2.0.2": +"set-function-name@npm:^2.0.1, set-function-name@npm:^2.0.2": version: 2.0.2 resolution: "set-function-name@npm:2.0.2" dependencies: @@ -15605,18 +14854,7 @@ __metadata: languageName: node linkType: hard -"side-channel@npm:^1.0.4": - version: 1.0.4 - resolution: "side-channel@npm:1.0.4" - dependencies: - call-bind: ^1.0.0 - get-intrinsic: ^1.0.2 - object-inspect: ^1.9.0 - checksum: 351e41b947079c10bd0858364f32bb3a7379514c399edb64ab3dce683933483fc63fb5e4efe0a15a2e8a7e3c436b6a91736ddb8d8c6591b0460a24bb4a1ee245 - languageName: node - linkType: hard - -"side-channel@npm:^1.1.0": +"side-channel@npm:^1.0.4, side-channel@npm:^1.1.0": version: 1.1.0 resolution: "side-channel@npm:1.1.0" dependencies: @@ -16042,28 +15280,6 @@ __metadata: languageName: node linkType: hard -"string.prototype.trim@npm:^1.2.8": - version: 1.2.8 - resolution: "string.prototype.trim@npm:1.2.8" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: 49eb1a862a53aba73c3fb6c2a53f5463173cb1f4512374b623bcd6b43ad49dd559a06fb5789bdec771a40fc4d2a564411c0a75d35fb27e76bbe738c211ecff07 - languageName: node - linkType: hard - -"string.prototype.trimend@npm:^1.0.7": - version: 1.0.7 - resolution: "string.prototype.trimend@npm:1.0.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: 2375516272fd1ba75992f4c4aa88a7b5f3c7a9ca308d963bcd5645adf689eba6f8a04ebab80c33e30ec0aefc6554181a3a8416015c38da0aa118e60ec896310c - languageName: node - linkType: hard - "string.prototype.trimend@npm:^1.0.8, string.prototype.trimend@npm:^1.0.9": version: 1.0.9 resolution: "string.prototype.trimend@npm:1.0.9" @@ -16076,17 +15292,6 @@ __metadata: languageName: node linkType: hard -"string.prototype.trimstart@npm:^1.0.7": - version: 1.0.7 - resolution: "string.prototype.trimstart@npm:1.0.7" - dependencies: - call-bind: ^1.0.2 - define-properties: ^1.2.0 - es-abstract: ^1.22.1 - checksum: 13d0c2cb0d5ff9e926fa0bec559158b062eed2b68cd5be777ffba782c96b2b492944e47057274e064549b94dd27cf81f48b27a31fee8af5b574cff253e7eb613 - languageName: node - linkType: hard - "string.prototype.trimstart@npm:^1.0.8": version: 1.0.8 resolution: "string.prototype.trimstart@npm:1.0.8" @@ -16265,15 +15470,15 @@ __metadata: languageName: node linkType: hard -"swr@npm:2.2.1": - version: 2.2.1 - resolution: "swr@npm:2.2.1" +"swr@npm:2.3.3": + version: 2.3.3 + resolution: "swr@npm:2.3.3" dependencies: - client-only: ^0.0.1 - use-sync-external-store: ^1.2.0 + dequal: ^2.0.3 + use-sync-external-store: ^1.4.0 peerDependencies: - react: ^16.11.0 || ^17.0.0 || ^18.0.0 - checksum: 62ff1b8132966fc977df192cf4452bab94c73dbea304a1438745f27041917154dad32448d8a65fb40d5e3de0b1751ef3fd57b1d71ba450e031517f009d0fc052 + react: ^16.11.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 25b2ab03d0149951e4612fae8458d333d6fbe912298684495969250553176b5b5b731be119f406ebadf6e9c5dc39726dd2492cca9684f448aa1734274e2a4919 languageName: node linkType: hard @@ -16593,18 +15798,6 @@ __metadata: languageName: node linkType: hard -"tsconfig-paths@npm:^3.14.2": - version: 3.14.2 - resolution: "tsconfig-paths@npm:3.14.2" - dependencies: - "@types/json5": ^0.0.29 - json5: ^1.0.2 - minimist: ^1.2.6 - strip-bom: ^3.0.0 - checksum: a6162eaa1aed680537f93621b82399c7856afd10ec299867b13a0675e981acac4e0ec00896860480efc59fc10fd0b16fdc928c0b885865b52be62cadac692447 - languageName: node - linkType: hard - "tsconfig-paths@npm:^3.15.0": version: 3.15.0 resolution: "tsconfig-paths@npm:3.15.0" @@ -16631,14 +15824,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.4.0": - version: 2.6.2 - resolution: "tslib@npm:2.6.2" - checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad - languageName: node - linkType: hard - -"tslib@npm:^2.3.1": +"tslib@npm:^2.0.0, tslib@npm:^2.0.3, tslib@npm:^2.1.0, tslib@npm:^2.3.0, tslib@npm:^2.3.1, tslib@npm:^2.4.0": version: 2.8.1 resolution: "tslib@npm:2.8.1" checksum: e4aba30e632b8c8902b47587fd13345e2827fa639e7c3121074d5ee0880723282411a8838f830b55100cbe4517672f84a2472667d355b81e8af165a55dc6203a @@ -16733,17 +15919,6 @@ __metadata: languageName: node linkType: hard -"typed-array-buffer@npm:^1.0.0": - version: 1.0.0 - resolution: "typed-array-buffer@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - get-intrinsic: ^1.2.1 - is-typed-array: ^1.1.10 - checksum: 3e0281c79b2a40cd97fe715db803884301993f4e8c18e8d79d75fd18f796e8cd203310fec8c7fdb5e6c09bedf0af4f6ab8b75eb3d3a85da69328f28a80456bd3 - languageName: node - linkType: hard - "typed-array-buffer@npm:^1.0.3": version: 1.0.3 resolution: "typed-array-buffer@npm:1.0.3" @@ -16755,18 +15930,6 @@ __metadata: languageName: node linkType: hard -"typed-array-byte-length@npm:^1.0.0": - version: 1.0.0 - resolution: "typed-array-byte-length@npm:1.0.0" - dependencies: - call-bind: ^1.0.2 - for-each: ^0.3.3 - has-proto: ^1.0.1 - is-typed-array: ^1.1.10 - checksum: b03db16458322b263d87a702ff25388293f1356326c8a678d7515767ef563ef80e1e67ce648b821ec13178dd628eb2afdc19f97001ceae7a31acf674c849af94 - languageName: node - linkType: hard - "typed-array-byte-length@npm:^1.0.3": version: 1.0.3 resolution: "typed-array-byte-length@npm:1.0.3" @@ -16780,19 +15943,6 @@ __metadata: languageName: node linkType: hard -"typed-array-byte-offset@npm:^1.0.0": - version: 1.0.0 - resolution: "typed-array-byte-offset@npm:1.0.0" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - for-each: ^0.3.3 - has-proto: ^1.0.1 - is-typed-array: ^1.1.10 - checksum: 04f6f02d0e9a948a95fbfe0d5a70b002191fae0b8fe0fe3130a9b2336f043daf7a3dda56a31333c35a067a97e13f539949ab261ca0f3692c41603a46a94e960b - languageName: node - linkType: hard - "typed-array-byte-offset@npm:^1.0.4": version: 1.0.4 resolution: "typed-array-byte-offset@npm:1.0.4" @@ -16808,17 +15958,6 @@ __metadata: languageName: node linkType: hard -"typed-array-length@npm:^1.0.4": - version: 1.0.4 - resolution: "typed-array-length@npm:1.0.4" - dependencies: - call-bind: ^1.0.2 - for-each: ^0.3.3 - is-typed-array: ^1.1.9 - checksum: 2228febc93c7feff142b8c96a58d4a0d7623ecde6c7a24b2b98eb3170e99f7c7eff8c114f9b283085cd59dcd2bd43aadf20e25bba4b034a53c5bb292f71f8956 - languageName: node - linkType: hard - "typed-array-length@npm:^1.0.7": version: 1.0.7 resolution: "typed-array-length@npm:1.0.7" @@ -16899,18 +16038,6 @@ __metadata: languageName: node linkType: hard -"unbox-primitive@npm:^1.0.2": - version: 1.0.2 - resolution: "unbox-primitive@npm:1.0.2" - dependencies: - call-bind: ^1.0.2 - has-bigints: ^1.0.2 - has-symbols: ^1.0.3 - which-boxed-primitive: ^1.0.2 - checksum: b7a1cf5862b5e4b5deb091672ffa579aa274f648410009c81cca63fed3b62b610c4f3b773f912ce545bb4e31edc3138975b5bc777fc6e4817dca51affb6380e9 - languageName: node - linkType: hard - "unbox-primitive@npm:^1.1.0": version: 1.1.0 resolution: "unbox-primitive@npm:1.1.0" @@ -17161,7 +16288,7 @@ __metadata: languageName: node linkType: hard -"use-sync-external-store@npm:1.2.0, use-sync-external-store@npm:^1.2.0": +"use-sync-external-store@npm:1.2.0": version: 1.2.0 resolution: "use-sync-external-store@npm:1.2.0" peerDependencies: @@ -17170,6 +16297,15 @@ __metadata: languageName: node linkType: hard +"use-sync-external-store@npm:^1.4.0": + version: 1.5.0 + resolution: "use-sync-external-store@npm:1.5.0" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + checksum: 5e639c9273200adb6985b512c96a3a02c458bc8ca1a72e91da9cdc6426144fc6538dca434b0f99b28fb1baabc82e1c383ba7900b25ccdcb43758fb058dc66c34 + languageName: node + linkType: hard + "utf-8-validate@npm:^5.0.2": version: 5.0.10 resolution: "utf-8-validate@npm:5.0.10" @@ -17272,46 +16408,45 @@ __metadata: languageName: node linkType: hard -"viem@npm:2.7.20": - version: 2.7.20 - resolution: "viem@npm:2.7.20" +"viem@npm:2.26.2": + version: 2.26.2 + resolution: "viem@npm:2.26.2" dependencies: - "@adraffy/ens-normalize": 1.10.0 - "@noble/curves": 1.2.0 - "@noble/hashes": 1.3.2 - "@scure/bip32": 1.3.2 - "@scure/bip39": 1.2.1 - abitype: 1.0.0 - isows: 1.0.3 - ws: 8.13.0 + "@noble/curves": 1.8.1 + "@noble/hashes": 1.7.1 + "@scure/bip32": 1.6.2 + "@scure/bip39": 1.5.4 + abitype: 1.0.8 + isows: 1.0.6 + ox: 0.6.9 + ws: 8.18.1 peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: 45eacff0e9f011d5d7d1a20615bbe12249bb701cec805ad5701da52ddd7132594355d9c6afb11dad4dadfbe9c474d321b2c09381c8f365d0d177619a83f27586 + checksum: b1d6f67979f3a2a0f9918af5b20aee42cbeb2662046eba3aac73aea260c29fa16898b9824afe2eea6a9fa1510329a141ef511b92cc45f1b7a224caffef24215b languageName: node linkType: hard "viem@npm:^2.1.1": - version: 2.21.43 - resolution: "viem@npm:2.21.43" - dependencies: - "@noble/curves": 1.6.0 - "@noble/hashes": 1.5.0 - "@scure/bip32": 1.5.0 - "@scure/bip39": 1.4.0 - abitype: 1.0.6 + version: 2.27.2 + resolution: "viem@npm:2.27.2" + dependencies: + "@noble/curves": 1.8.1 + "@noble/hashes": 1.7.1 + "@scure/bip32": 1.6.2 + "@scure/bip39": 1.5.4 + abitype: 1.0.8 isows: 1.0.6 - ox: 0.1.0 - webauthn-p256: 0.0.10 - ws: 8.18.0 + ox: 0.6.9 + ws: 8.18.1 peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: ec49a1744aad4326f28d22a9fbb7049694b30b8e95217c78dc16ab04ebc1d459e3ef76fe1d1b11ce80e7989baa02942709f9a91d495a8ec70ab923453617029e + checksum: dbf3c7bf8635de13a95aa353ee389ca753aed5fbbf9fee4da2000aea43747a8a35587dcedd8c07fcfac197350182854166a2298e469e2c2b82ec9d7f937fd3d6 languageName: node linkType: hard @@ -17495,16 +16630,6 @@ __metadata: languageName: node linkType: hard -"webauthn-p256@npm:0.0.10": - version: 0.0.10 - resolution: "webauthn-p256@npm:0.0.10" - dependencies: - "@noble/curves": ^1.4.0 - "@noble/hashes": ^1.4.0 - checksum: 0648a3d78451bfa7105b5151a34bd685ee60e193be9be1981fe73819ed5a92f410973bdeb72427ef03c8c2a848619f818cf3e66b94012d5127b462cb10c24f5d - languageName: node - linkType: hard - "webextension-polyfill@npm:>=0.10.0 <1.0, webextension-polyfill@npm:^0.10.0": version: 0.10.0 resolution: "webextension-polyfill@npm:0.10.0" @@ -17561,19 +16686,6 @@ __metadata: languageName: node linkType: hard -"which-boxed-primitive@npm:^1.0.2": - version: 1.0.2 - resolution: "which-boxed-primitive@npm:1.0.2" - dependencies: - is-bigint: ^1.0.1 - is-boolean-object: ^1.1.0 - is-number-object: ^1.0.4 - is-string: ^1.0.5 - is-symbol: ^1.0.3 - checksum: 53ce774c7379071729533922adcca47220228405e1895f26673bbd71bdf7fb09bee38c1d6399395927c6289476b5ae0629863427fd151491b71c4b6cb04f3a5e - languageName: node - linkType: hard - "which-boxed-primitive@npm:^1.1.0, which-boxed-primitive@npm:^1.1.1": version: 1.1.1 resolution: "which-boxed-primitive@npm:1.1.1" @@ -17587,26 +16699,6 @@ __metadata: languageName: node linkType: hard -"which-builtin-type@npm:^1.1.3": - version: 1.1.3 - resolution: "which-builtin-type@npm:1.1.3" - dependencies: - function.prototype.name: ^1.1.5 - has-tostringtag: ^1.0.0 - is-async-function: ^2.0.0 - is-date-object: ^1.0.5 - is-finalizationregistry: ^1.0.2 - is-generator-function: ^1.0.10 - is-regex: ^1.1.4 - is-weakref: ^1.0.2 - isarray: ^2.0.5 - which-boxed-primitive: ^1.0.2 - which-collection: ^1.0.1 - which-typed-array: ^1.1.9 - checksum: 43730f7d8660ff9e33d1d3f9f9451c4784265ee7bf222babc35e61674a11a08e1c2925019d6c03154fcaaca4541df43abe35d2720843b9b4cbcebdcc31408f36 - languageName: node - linkType: hard - "which-builtin-type@npm:^1.2.1": version: 1.2.1 resolution: "which-builtin-type@npm:1.2.1" @@ -17628,18 +16720,6 @@ __metadata: languageName: node linkType: hard -"which-collection@npm:^1.0.1": - version: 1.0.1 - resolution: "which-collection@npm:1.0.1" - dependencies: - is-map: ^2.0.1 - is-set: ^2.0.1 - is-weakmap: ^2.0.1 - is-weakset: ^2.0.1 - checksum: c815bbd163107ef9cb84f135e6f34453eaf4cca994e7ba85ddb0d27cea724c623fae2a473ceccfd5549c53cc65a5d82692de418166df3f858e1e5dc60818581c - languageName: node - linkType: hard - "which-collection@npm:^1.0.2": version: 1.0.2 resolution: "which-collection@npm:1.0.2" @@ -17659,20 +16739,7 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.13, which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": - version: 1.1.13 - resolution: "which-typed-array@npm:1.1.13" - dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.4 - for-each: ^0.3.3 - gopd: ^1.0.1 - has-tostringtag: ^1.0.0 - checksum: 3828a0d5d72c800e369d447e54c7620742a4cc0c9baf1b5e8c17e9b6ff90d8d861a3a6dd4800f1953dbf80e5e5cec954a289e5b4a223e3bee4aeb1f8c5f33309 - languageName: node - linkType: hard - -"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.18": +"which-typed-array@npm:^1.1.16, which-typed-array@npm:^1.1.18, which-typed-array@npm:^1.1.2": version: 1.1.19 resolution: "which-typed-array@npm:1.1.19" dependencies: @@ -17808,24 +16875,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:7.4.6": - version: 7.4.6 - resolution: "ws@npm:7.4.6" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 3a990b32ed08c72070d5e8913e14dfcd831919205be52a3ff0b4cdd998c8d554f167c9df3841605cde8b11d607768cacab3e823c58c96a5c08c987e093eb767a - languageName: node - linkType: hard - -"ws@npm:8.13.0": - version: 8.13.0 - resolution: "ws@npm:8.13.0" +"ws@npm:8.18.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -17834,13 +16886,13 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 53e991bbf928faf5dc6efac9b8eb9ab6497c69feeb94f963d648b7a3530a720b19ec2e0ec037344257e05a4f35bd9ad04d9de6f289615ffb133282031b18c61c + checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 languageName: node linkType: hard -"ws@npm:8.18.0": - version: 8.18.0 - resolution: "ws@npm:8.18.0" +"ws@npm:8.18.1, ws@npm:^8.18.0": + version: 8.18.1 + resolution: "ws@npm:8.18.1" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -17849,7 +16901,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 + checksum: 4658357185d891bc45cc2d42a84f9e192d047e8476fb5cba25b604f7d75ca87ca0dd54cd0b2cc49aeee57c79045a741cb7d0b14501953ac60c790cd105c42f23 languageName: node linkType: hard @@ -17883,21 +16935,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.18.0": - version: 8.18.1 - resolution: "ws@npm:8.18.1" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 4658357185d891bc45cc2d42a84f9e192d047e8476fb5cba25b604f7d75ca87ca0dd54cd0b2cc49aeee57c79045a741cb7d0b14501953ac60c790cd105c42f23 - languageName: node - linkType: hard - "ws@npm:~8.11.0": version: 8.11.0 resolution: "ws@npm:8.11.0"