diff --git a/sdk/constants/futures.ts b/sdk/constants/futures.ts index e29e870e39..add17aa5a5 100644 --- a/sdk/constants/futures.ts +++ b/sdk/constants/futures.ts @@ -10,7 +10,7 @@ export const DEFAULT_NUMBER_OF_TRADES = 16; export const FUTURES_ENDPOINT_OP_MAINNET = `https://subgraph.satsuma-prod.com/${process.env.NEXT_PUBLIC_SATSUMA_API_KEY}/kwenta/optimism-perps/api`; export const FUTURES_ENDPOINT_OP_GOERLI = - 'https://api.thegraph.com/subgraphs/name/tburm/optimism-goerli-perps'; + 'https://api.thegraph.com/subgraphs/name/kwenta/optimism-goerli-perps'; export const MAIN_ENDPOINT_MAINNET = `https://gateway.thegraph.com/api/${process.env.NEXT_PUBLIC_THEGRAPH_API_KEY}/subgraphs/id/HLy7PdmPJuVGjjmPNz1vW5RCCRpqzRWony2fSn7UKpf9`; diff --git a/sdk/contracts/abis/PerpsV2Market.json b/sdk/contracts/abis/PerpsV2Market.json index 0755895dcd..f4a68eec8d 100644 --- a/sdk/contracts/abis/PerpsV2Market.json +++ b/sdk/contracts/abis/PerpsV2Market.json @@ -202,6 +202,37 @@ "name": "PerpsTracking", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "flagger", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "name": "PositionFlagged", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -238,7 +269,19 @@ { "indexed": false, "internalType": "uint256", - "name": "fee", + "name": "flaggerFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "liquidatorFee", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stakersFee", "type": "uint256" } ], @@ -295,6 +338,12 @@ "internalType": "uint256", "name": "fee", "type": "uint256" + }, + { + "indexed": false, + "internalType": "int256", + "name": "skew", + "type": "int256" } ], "name": "PositionModified", @@ -443,7 +492,7 @@ "inputs": [ { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" } ], @@ -458,7 +507,7 @@ "inputs": [ { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" }, { @@ -528,7 +577,7 @@ }, { "internalType": "uint128", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint128" }, { @@ -606,6 +655,62 @@ "stateMutability": "payable", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "int256", + "name": "sizeDelta", + "type": "int256" + } + ], + "name": "fillPrice", + "outputs": [ + { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "invalid", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "flagPosition", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "forceLiquidatePosition", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": true, "inputs": [], @@ -621,6 +726,21 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "fundingRateLastRecomputed", + "outputs": [ + { + "internalType": "int128", + "name": "fundingRate", + "type": "int128" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -657,6 +777,27 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "isFlagged", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [ @@ -814,7 +955,7 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" } ], @@ -834,7 +975,7 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" }, { @@ -1082,6 +1223,51 @@ "stateMutability": "view", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "desiredTimeDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "desiredFillPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "submitCloseDelayedOrderWithTracking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "desiredFillPrice", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "trackingCode", + "type": "bytes32" + } + ], + "name": "submitCloseOffchainDelayedOrderWithTracking", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -1092,12 +1278,12 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredTimeDelta", "type": "uint256" }, { "internalType": "uint256", - "name": "desiredTimeDelta", + "name": "desiredFillPrice", "type": "uint256" } ], @@ -1117,12 +1303,12 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredTimeDelta", "type": "uint256" }, { "internalType": "uint256", - "name": "desiredTimeDelta", + "name": "desiredFillPrice", "type": "uint256" }, { @@ -1147,7 +1333,7 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" } ], @@ -1167,7 +1353,7 @@ }, { "internalType": "uint256", - "name": "priceImpactDelta", + "name": "desiredFillPrice", "type": "uint256" }, { diff --git a/sdk/contracts/abis/PerpsV2MarketData.json b/sdk/contracts/abis/PerpsV2MarketData.json index 9f226b1b97..31cfd964ae 100644 --- a/sdk/contracts/abis/PerpsV2MarketData.json +++ b/sdk/contracts/abis/PerpsV2MarketData.json @@ -99,11 +99,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -208,11 +203,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -248,12 +238,12 @@ }, { "internalType": "uint256", - "name": "liquidationBufferRatio", + "name": "minKeeperFee", "type": "uint256" }, { "internalType": "uint256", - "name": "minKeeperFee", + "name": "maxKeeperFee", "type": "uint256" } ], @@ -325,11 +315,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -495,11 +480,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -700,11 +680,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -815,11 +790,6 @@ "internalType": "uint256", "name": "makerFeeOffchainDelayedOrder", "type": "uint256" - }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" } ], "internalType": "struct PerpsV2MarketData.FeeRates", @@ -859,11 +829,6 @@ "name": "makerFee", "type": "uint256" }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" - }, { "internalType": "uint256", "name": "takerFeeDelayedOrder", @@ -943,6 +908,26 @@ "internalType": "uint256", "name": "offchainPriceDivergence", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationPremiumMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBufferRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPD", + "type": "uint256" } ], "internalType": "struct IPerpsV2MarketSettings.Parameters", diff --git a/sdk/contracts/abis/PerpsV2MarketSettings.json b/sdk/contracts/abis/PerpsV2MarketSettings.json index b51d9beafa..92af95e8f6 100644 --- a/sdk/contracts/abis/PerpsV2MarketSettings.json +++ b/sdk/contracts/abis/PerpsV2MarketSettings.json @@ -35,6 +35,19 @@ "name": "CacheUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "keeperFee", + "type": "uint256" + } + ], + "name": "KeeperLiquidationFeeUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -61,6 +74,19 @@ "name": "LiquidationFeeRatioUpdated", "type": "event" }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "sUSD", + "type": "uint256" + } + ], + "name": "MaxKeeperFeeUpdated", + "type": "event" + }, { "anonymous": false, "inputs": [ @@ -169,6 +195,21 @@ "name": "ParameterUpdatedBytes32", "type": "event" }, + { + "constant": true, + "inputs": [], + "name": "CONTRACT_NAME", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": false, "inputs": [], @@ -217,6 +258,27 @@ { "constant": true, "inputs": [], + "name": "keeperLiquidationFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + } + ], "name": "liquidationBufferRatio", "outputs": [ { @@ -244,6 +306,27 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + } + ], + "name": "liquidationPremiumMultiplier", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -349,6 +432,21 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [], + "name": "maxKeeperFee", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -370,6 +468,27 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + } + ], + "name": "maxLiquidationDelta", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -391,6 +510,27 @@ "stateMutability": "view", "type": "function" }, + { + "constant": true, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + } + ], + "name": "maxPD", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, { "constant": true, "inputs": [ @@ -577,27 +717,6 @@ "stateMutability": "view", "type": "function" }, - { - "constant": true, - "inputs": [ - { - "internalType": "bytes32", - "name": "_marketKey", - "type": "bytes32" - } - ], - "name": "overrideCommitFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "payable": false, - "stateMutability": "view", - "type": "function" - }, { "constant": true, "inputs": [], @@ -636,11 +755,6 @@ "name": "makerFee", "type": "uint256" }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" - }, { "internalType": "uint256", "name": "takerFeeDelayedOrder", @@ -720,6 +834,26 @@ "internalType": "uint256", "name": "offchainPriceDivergence", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationPremiumMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBufferRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPD", + "type": "uint256" } ], "internalType": "struct IPerpsV2MarketSettings.Parameters", @@ -793,6 +927,26 @@ { "constant": false, "inputs": [ + { + "internalType": "uint256", + "name": "_keeperFee", + "type": "uint256" + } + ], + "name": "setKeeperLiquidationFee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + }, { "internalType": "uint256", "name": "_ratio", @@ -820,6 +974,26 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_liquidationPremiumMultiplier", + "type": "uint256" + } + ], + "name": "setLiquidationPremiumMultiplier", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -920,6 +1094,21 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "uint256", + "name": "_sUSD", + "type": "uint256" + } + ], + "name": "setMaxKeeperFee", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -940,6 +1129,26 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_maxLiquidationDelta", + "type": "uint256" + } + ], + "name": "setMaxLiquidationDelta", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -960,6 +1169,26 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "constant": false, + "inputs": [ + { + "internalType": "bytes32", + "name": "_marketKey", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "_maxPD", + "type": "uint256" + } + ], + "name": "setMaxPD", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, { "constant": false, "inputs": [ @@ -1110,26 +1339,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "constant": false, - "inputs": [ - { - "internalType": "bytes32", - "name": "_marketKey", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_overrideCommitFee", - "type": "uint256" - } - ], - "name": "setOverrideCommitFee", - "outputs": [], - "payable": false, - "stateMutability": "nonpayable", - "type": "function" - }, { "constant": false, "inputs": [ @@ -1150,11 +1359,6 @@ "name": "makerFee", "type": "uint256" }, - { - "internalType": "uint256", - "name": "overrideCommitFee", - "type": "uint256" - }, { "internalType": "uint256", "name": "takerFeeDelayedOrder", @@ -1234,6 +1438,26 @@ "internalType": "uint256", "name": "offchainPriceDivergence", "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationPremiumMultiplier", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "liquidationBufferRatio", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxLiquidationDelta", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxPD", + "type": "uint256" } ], "internalType": "struct IPerpsV2MarketSettings.Parameters", diff --git a/sdk/contracts/constants.ts b/sdk/contracts/constants.ts index 5d99e294ec..6b2b589622 100644 --- a/sdk/contracts/constants.ts +++ b/sdk/contracts/constants.ts @@ -44,12 +44,12 @@ export const ADDRESSES: Record> = { 420: '0x0dde87714C3bdACB93bB1d38605aFff209a85998', }, PerpsV2MarketData: { - 10: '0xF7D3D05cCeEEcC9d77864Da3DdE67Ce9a0215A9D', - 420: '0x0D9eFa310a4771c444233B10bfB57e5b991ad529', + 10: '0x58e6227510F83d3F45B339F2f7A05a699fDEE6D4', + 420: '0xcE2dC389fc8Be231beECED1D900881e38596d7b2', }, PerpsV2MarketSettings: { - 10: '0xd442Dc2Ac1f3cA1C86C8329246e47Ca0C91D0471', - 420: '0x14fA3376E2ffa41708A0636009A35CAE8D8E2bc7', + 10: '0x649F44CAC3276557D03223Dbf6395Af65b11c11c', + 420: '0xedf10514EF611e3808622f24e236b83cB9E51dCe', }, Pyth: { 10: '0xff1a0f4744e8582DF1aE09D5611b887B6a12925C', diff --git a/sdk/contracts/types/DappMaintenance.ts b/sdk/contracts/types/DappMaintenance.ts new file mode 100644 index 0000000000..80d7f2951a --- /dev/null +++ b/sdk/contracts/types/DappMaintenance.ts @@ -0,0 +1,383 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + BaseContract, + BigNumber, + BytesLike, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, + Signer, + utils, +} from "ethers"; +import type { + FunctionFragment, + Result, + EventFragment, +} from "@ethersproject/abi"; +import type { Listener, Provider } from "@ethersproject/providers"; +import type { + TypedEventFilter, + TypedEvent, + TypedListener, + OnEvent, + PromiseOrValue, +} from "./common"; + +export interface DappMaintenanceInterface extends utils.Interface { + functions: { + "acceptOwnership()": FunctionFragment; + "isPausedSX()": FunctionFragment; + "isPausedStaking()": FunctionFragment; + "nominateNewOwner(address)": FunctionFragment; + "nominatedOwner()": FunctionFragment; + "owner()": FunctionFragment; + "setMaintenanceModeAll(bool)": FunctionFragment; + "setMaintenanceModeSX(bool)": FunctionFragment; + "setMaintenanceModeStaking(bool)": FunctionFragment; + }; + + getFunction( + nameOrSignatureOrTopic: + | "acceptOwnership" + | "isPausedSX" + | "isPausedStaking" + | "nominateNewOwner" + | "nominatedOwner" + | "owner" + | "setMaintenanceModeAll" + | "setMaintenanceModeSX" + | "setMaintenanceModeStaking" + ): FunctionFragment; + + encodeFunctionData( + functionFragment: "acceptOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isPausedSX", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "isPausedStaking", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "nominateNewOwner", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "nominatedOwner", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "owner", values?: undefined): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeAll", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeSX", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "setMaintenanceModeStaking", + values: [PromiseOrValue] + ): string; + + decodeFunctionResult( + functionFragment: "acceptOwnership", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "isPausedSX", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "isPausedStaking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominateNewOwner", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "nominatedOwner", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeAll", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeSX", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "setMaintenanceModeStaking", + data: BytesLike + ): Result; + + events: { + "OwnerChanged(address,address)": EventFragment; + "OwnerNominated(address)": EventFragment; + "SXMaintenance(bool)": EventFragment; + "StakingMaintenance(bool)": EventFragment; + }; + + getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnerNominated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "SXMaintenance"): EventFragment; + getEvent(nameOrSignatureOrTopic: "StakingMaintenance"): EventFragment; +} + +export interface OwnerChangedEventObject { + oldOwner: string; + newOwner: string; +} +export type OwnerChangedEvent = TypedEvent< + [string, string], + OwnerChangedEventObject +>; + +export type OwnerChangedEventFilter = TypedEventFilter; + +export interface OwnerNominatedEventObject { + newOwner: string; +} +export type OwnerNominatedEvent = TypedEvent< + [string], + OwnerNominatedEventObject +>; + +export type OwnerNominatedEventFilter = TypedEventFilter; + +export interface SXMaintenanceEventObject { + isPaused: boolean; +} +export type SXMaintenanceEvent = TypedEvent< + [boolean], + SXMaintenanceEventObject +>; + +export type SXMaintenanceEventFilter = TypedEventFilter; + +export interface StakingMaintenanceEventObject { + isPaused: boolean; +} +export type StakingMaintenanceEvent = TypedEvent< + [boolean], + StakingMaintenanceEventObject +>; + +export type StakingMaintenanceEventFilter = + TypedEventFilter; + +export interface DappMaintenance extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + + interface: DappMaintenanceInterface; + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined + ): Promise>; + + listeners( + eventFilter?: TypedEventFilter + ): Array>; + listeners(eventName?: string): Array; + removeAllListeners( + eventFilter: TypedEventFilter + ): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + + functions: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isPausedSX(overrides?: CallOverrides): Promise<[boolean]>; + + isPausedStaking(overrides?: CallOverrides): Promise<[boolean]>; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise<[string]>; + + owner(overrides?: CallOverrides): Promise<[string]>; + + setMaintenanceModeAll( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeSX( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeStaking( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isPausedSX(overrides?: CallOverrides): Promise; + + isPausedStaking(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMaintenanceModeAll( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeSX( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeStaking( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + acceptOwnership(overrides?: CallOverrides): Promise; + + isPausedSX(overrides?: CallOverrides): Promise; + + isPausedStaking(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMaintenanceModeAll( + isPaused: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setMaintenanceModeSX( + isPaused: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + setMaintenanceModeStaking( + isPaused: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + }; + + filters: { + "OwnerChanged(address,address)"( + oldOwner?: null, + newOwner?: null + ): OwnerChangedEventFilter; + OwnerChanged(oldOwner?: null, newOwner?: null): OwnerChangedEventFilter; + + "OwnerNominated(address)"(newOwner?: null): OwnerNominatedEventFilter; + OwnerNominated(newOwner?: null): OwnerNominatedEventFilter; + + "SXMaintenance(bool)"(isPaused?: null): SXMaintenanceEventFilter; + SXMaintenance(isPaused?: null): SXMaintenanceEventFilter; + + "StakingMaintenance(bool)"(isPaused?: null): StakingMaintenanceEventFilter; + StakingMaintenance(isPaused?: null): StakingMaintenanceEventFilter; + }; + + estimateGas: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isPausedSX(overrides?: CallOverrides): Promise; + + isPausedStaking(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMaintenanceModeAll( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeSX( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeStaking( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + acceptOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + isPausedSX(overrides?: CallOverrides): Promise; + + isPausedStaking(overrides?: CallOverrides): Promise; + + nominateNewOwner( + _owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + nominatedOwner(overrides?: CallOverrides): Promise; + + owner(overrides?: CallOverrides): Promise; + + setMaintenanceModeAll( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeSX( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + setMaintenanceModeStaking( + isPaused: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; +} diff --git a/sdk/contracts/types/KwentaArrakisVault.ts b/sdk/contracts/types/KwentaArrakisVault.ts index 4ed2df2e3a..1b4b661a2a 100644 --- a/sdk/contracts/types/KwentaArrakisVault.ts +++ b/sdk/contracts/types/KwentaArrakisVault.ts @@ -9,7 +9,6 @@ import type { CallOverrides, ContractTransaction, Overrides, - PayableOverrides, PopulatedTransaction, Signer, utils, @@ -30,97 +29,575 @@ import type { export interface KwentaArrakisVaultInterface extends utils.Interface { functions: { - "proxyAdmin()": FunctionFragment; - "supportsInterface(bytes4)": FunctionFragment; - "transferProxyAdmin(address)": FunctionFragment; - "upgradeTo(address)": FunctionFragment; - "upgradeToAndCall(address,bytes)": FunctionFragment; + "GELATO()": FunctionFragment; + "RESTRICTED_MINT_ENABLED()": FunctionFragment; + "allowance(address,address)": FunctionFragment; "approve(address,uint256)": FunctionFragment; + "arrakisBalance0()": FunctionFragment; + "arrakisBalance1()": FunctionFragment; + "arrakisFeeBPS()": FunctionFragment; + "arrakisTreasury()": FunctionFragment; + "balanceOf(address)": FunctionFragment; + "burn(uint256,address)": FunctionFragment; + "decimals()": FunctionFragment; + "decreaseAllowance(address,uint256)": FunctionFragment; + "executiveRebalance(int24,int24,uint160,uint256,bool)": FunctionFragment; + "gelatoRebalanceBPS()": FunctionFragment; + "gelatoSlippageBPS()": FunctionFragment; + "gelatoSlippageInterval()": FunctionFragment; + "getMintAmounts(uint256,uint256)": FunctionFragment; + "getPositionID()": FunctionFragment; + "getUnderlyingBalances()": FunctionFragment; + "getUnderlyingBalancesAtPrice(uint160)": FunctionFragment; + "increaseAllowance(address,uint256)": FunctionFragment; + "initialize(string,string,address,uint16,int24,int24,address)": FunctionFragment; + "lowerTick()": FunctionFragment; + "manager()": FunctionFragment; + "managerBalance0()": FunctionFragment; + "managerBalance1()": FunctionFragment; + "managerFeeBPS()": FunctionFragment; + "managerTreasury()": FunctionFragment; + "mint(uint256,address)": FunctionFragment; + "name()": FunctionFragment; + "pool()": FunctionFragment; + "rebalance(uint160,uint256,bool,uint256,address)": FunctionFragment; + "renounceOwnership()": FunctionFragment; + "restrictedMintToggle()": FunctionFragment; + "symbol()": FunctionFragment; + "toggleRestrictMint()": FunctionFragment; + "token0()": FunctionFragment; + "token1()": FunctionFragment; + "totalSupply()": FunctionFragment; + "transfer(address,uint256)": FunctionFragment; + "transferFrom(address,address,uint256)": FunctionFragment; + "transferOwnership(address)": FunctionFragment; + "uniswapV3MintCallback(uint256,uint256,bytes)": FunctionFragment; + "uniswapV3SwapCallback(int256,int256,bytes)": FunctionFragment; + "updateManagerParams(int16,address,int16,int16,int32)": FunctionFragment; + "upperTick()": FunctionFragment; + "version()": FunctionFragment; + "withdrawArrakisBalance()": FunctionFragment; + "withdrawManagerBalance()": FunctionFragment; }; getFunction( nameOrSignatureOrTopic: - | "proxyAdmin" - | "supportsInterface" - | "transferProxyAdmin" - | "upgradeTo" - | "upgradeToAndCall" + | "GELATO" + | "RESTRICTED_MINT_ENABLED" + | "allowance" | "approve" + | "arrakisBalance0" + | "arrakisBalance1" + | "arrakisFeeBPS" + | "arrakisTreasury" + | "balanceOf" + | "burn" + | "decimals" + | "decreaseAllowance" + | "executiveRebalance" + | "gelatoRebalanceBPS" + | "gelatoSlippageBPS" + | "gelatoSlippageInterval" + | "getMintAmounts" + | "getPositionID" + | "getUnderlyingBalances" + | "getUnderlyingBalancesAtPrice" + | "increaseAllowance" + | "initialize" + | "lowerTick" + | "manager" + | "managerBalance0" + | "managerBalance1" + | "managerFeeBPS" + | "managerTreasury" + | "mint" + | "name" + | "pool" + | "rebalance" + | "renounceOwnership" + | "restrictedMintToggle" + | "symbol" + | "toggleRestrictMint" + | "token0" + | "token1" + | "totalSupply" + | "transfer" + | "transferFrom" + | "transferOwnership" + | "uniswapV3MintCallback" + | "uniswapV3SwapCallback" + | "updateManagerParams" + | "upperTick" + | "version" + | "withdrawArrakisBalance" + | "withdrawManagerBalance" ): FunctionFragment; + encodeFunctionData(functionFragment: "GELATO", values?: undefined): string; encodeFunctionData( - functionFragment: "proxyAdmin", + functionFragment: "RESTRICTED_MINT_ENABLED", values?: undefined ): string; encodeFunctionData( - functionFragment: "supportsInterface", - values: [PromiseOrValue] + functionFragment: "allowance", + values: [PromiseOrValue, PromiseOrValue] ): string; encodeFunctionData( - functionFragment: "transferProxyAdmin", - values: [PromiseOrValue] + functionFragment: "approve", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "arrakisBalance0", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "arrakisBalance1", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "arrakisFeeBPS", + values?: undefined ): string; encodeFunctionData( - functionFragment: "upgradeTo", + functionFragment: "arrakisTreasury", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "balanceOf", values: [PromiseOrValue] ): string; encodeFunctionData( - functionFragment: "upgradeToAndCall", - values: [PromiseOrValue, PromiseOrValue] + functionFragment: "burn", + values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData(functionFragment: "decimals", values?: undefined): string; encodeFunctionData( - functionFragment: "approve", + functionFragment: "decreaseAllowance", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "executiveRebalance", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "gelatoRebalanceBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "gelatoSlippageBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "gelatoSlippageInterval", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getMintAmounts", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "getPositionID", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getUnderlyingBalances", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "getUnderlyingBalancesAtPrice", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "increaseAllowance", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "initialize", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData(functionFragment: "lowerTick", values?: undefined): string; + encodeFunctionData(functionFragment: "manager", values?: undefined): string; + encodeFunctionData( + functionFragment: "managerBalance0", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerBalance1", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerFeeBPS", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "managerTreasury", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "mint", + values: [PromiseOrValue, PromiseOrValue] + ): string; + encodeFunctionData(functionFragment: "name", values?: undefined): string; + encodeFunctionData(functionFragment: "pool", values?: undefined): string; + encodeFunctionData( + functionFragment: "rebalance", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "renounceOwnership", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "restrictedMintToggle", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "symbol", values?: undefined): string; + encodeFunctionData( + functionFragment: "toggleRestrictMint", + values?: undefined + ): string; + encodeFunctionData(functionFragment: "token0", values?: undefined): string; + encodeFunctionData(functionFragment: "token1", values?: undefined): string; + encodeFunctionData( + functionFragment: "totalSupply", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "transfer", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "transferFrom", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "transferOwnership", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "uniswapV3MintCallback", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "uniswapV3SwapCallback", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "updateManagerParams", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData(functionFragment: "upperTick", values?: undefined): string; + encodeFunctionData(functionFragment: "version", values?: undefined): string; + encodeFunctionData( + functionFragment: "withdrawArrakisBalance", + values?: undefined + ): string; + encodeFunctionData( + functionFragment: "withdrawManagerBalance", + values?: undefined + ): string; - decodeFunctionResult(functionFragment: "proxyAdmin", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "GELATO", data: BytesLike): Result; decodeFunctionResult( - functionFragment: "supportsInterface", + functionFragment: "RESTRICTED_MINT_ENABLED", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "allowance", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; decodeFunctionResult( - functionFragment: "transferProxyAdmin", + functionFragment: "arrakisBalance0", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "upgradeTo", data: BytesLike): Result; decodeFunctionResult( - functionFragment: "upgradeToAndCall", + functionFragment: "arrakisBalance1", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "arrakisFeeBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "arrakisTreasury", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "balanceOf", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "burn", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "decimals", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "decreaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "executiveRebalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoRebalanceBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoSlippageBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "gelatoSlippageInterval", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getMintAmounts", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getPositionID", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUnderlyingBalances", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "getUnderlyingBalancesAtPrice", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "increaseAllowance", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "initialize", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "lowerTick", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "manager", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "managerBalance0", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerBalance1", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerFeeBPS", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "managerTreasury", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "mint", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "name", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "pool", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "rebalance", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "renounceOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "restrictedMintToggle", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "symbol", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "toggleRestrictMint", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "token0", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "token1", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "totalSupply", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "transfer", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "transferFrom", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "transferOwnership", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapV3MintCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "uniswapV3SwapCallback", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "updateManagerParams", + data: BytesLike + ): Result; + decodeFunctionResult(functionFragment: "upperTick", data: BytesLike): Result; + decodeFunctionResult(functionFragment: "version", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "withdrawArrakisBalance", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "withdrawManagerBalance", data: BytesLike ): Result; - decodeFunctionResult(functionFragment: "approve", data: BytesLike): Result; events: { - "ProxyAdminTransferred(address,address)": EventFragment; - "ProxyImplementationUpdated(address,address)": EventFragment; + "Approval(address,address,uint256)": EventFragment; + "Burned(address,uint256,uint256,uint256,uint128)": EventFragment; + "FeesEarned(uint256,uint256)": EventFragment; + "Minted(address,uint256,uint256,uint256,uint128)": EventFragment; + "OwnershipTransferred(address,address)": EventFragment; + "Rebalance(int24,int24,uint128,uint128)": EventFragment; + "Transfer(address,address,uint256)": EventFragment; + "UpdateManagerParams(uint16,address,uint16,uint16,uint32)": EventFragment; }; - getEvent(nameOrSignatureOrTopic: "ProxyAdminTransferred"): EventFragment; - getEvent(nameOrSignatureOrTopic: "ProxyImplementationUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Approval"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Burned"): EventFragment; + getEvent(nameOrSignatureOrTopic: "FeesEarned"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Minted"): EventFragment; + getEvent(nameOrSignatureOrTopic: "OwnershipTransferred"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Rebalance"): EventFragment; + getEvent(nameOrSignatureOrTopic: "Transfer"): EventFragment; + getEvent(nameOrSignatureOrTopic: "UpdateManagerParams"): EventFragment; } -export interface ProxyAdminTransferredEventObject { - previousAdmin: string; - newAdmin: string; +export interface ApprovalEventObject { + owner: string; + spender: string; + value: BigNumber; } -export type ProxyAdminTransferredEvent = TypedEvent< - [string, string], - ProxyAdminTransferredEventObject +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +>; + +export type ApprovalEventFilter = TypedEventFilter; + +export interface BurnedEventObject { + receiver: string; + burnAmount: BigNumber; + amount0Out: BigNumber; + amount1Out: BigNumber; + liquidityBurned: BigNumber; +} +export type BurnedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, BigNumber], + BurnedEventObject +>; + +export type BurnedEventFilter = TypedEventFilter; + +export interface FeesEarnedEventObject { + feesEarned0: BigNumber; + feesEarned1: BigNumber; +} +export type FeesEarnedEvent = TypedEvent< + [BigNumber, BigNumber], + FeesEarnedEventObject +>; + +export type FeesEarnedEventFilter = TypedEventFilter; + +export interface MintedEventObject { + receiver: string; + mintAmount: BigNumber; + amount0In: BigNumber; + amount1In: BigNumber; + liquidityMinted: BigNumber; +} +export type MintedEvent = TypedEvent< + [string, BigNumber, BigNumber, BigNumber, BigNumber], + MintedEventObject >; -export type ProxyAdminTransferredEventFilter = - TypedEventFilter; +export type MintedEventFilter = TypedEventFilter; -export interface ProxyImplementationUpdatedEventObject { - previousImplementation: string; - newImplementation: string; +export interface OwnershipTransferredEventObject { + previousManager: string; + newManager: string; } -export type ProxyImplementationUpdatedEvent = TypedEvent< +export type OwnershipTransferredEvent = TypedEvent< [string, string], - ProxyImplementationUpdatedEventObject + OwnershipTransferredEventObject +>; + +export type OwnershipTransferredEventFilter = + TypedEventFilter; + +export interface RebalanceEventObject { + lowerTick_: number; + upperTick_: number; + liquidityBefore: BigNumber; + liquidityAfter: BigNumber; +} +export type RebalanceEvent = TypedEvent< + [number, number, BigNumber, BigNumber], + RebalanceEventObject +>; + +export type RebalanceEventFilter = TypedEventFilter; + +export interface TransferEventObject { + from: string; + to: string; + value: BigNumber; +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +>; + +export type TransferEventFilter = TypedEventFilter; + +export interface UpdateManagerParamsEventObject { + managerFeeBPS: number; + managerTreasury: string; + gelatoRebalanceBPS: number; + gelatoSlippageBPS: number; + gelatoSlippageInterval: number; +} +export type UpdateManagerParamsEvent = TypedEvent< + [number, string, number, number, number], + UpdateManagerParamsEventObject >; -export type ProxyImplementationUpdatedEventFilter = - TypedEventFilter; +export type UpdateManagerParamsEventFilter = + TypedEventFilter; export interface KwentaArrakisVault extends BaseContract { connect(signerOrProvider: Signer | Provider | string): this; @@ -149,174 +626,1136 @@ export interface KwentaArrakisVault extends BaseContract { removeListener: OnEvent; functions: { - proxyAdmin(overrides?: CallOverrides): Promise<[string]>; + GELATO(overrides?: CallOverrides): Promise<[string]>; - supportsInterface( - id: PromiseOrValue, + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise<[number]>; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, overrides?: CallOverrides - ): Promise<[boolean]>; + ): Promise<[BigNumber]>; - transferProxyAdmin( - newAdmin: PromiseOrValue, + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - upgradeTo( - newImplementation: PromiseOrValue, + arrakisBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; + + arrakisFeeBPS(overrides?: CallOverrides): Promise<[number]>; + + arrakisTreasury(overrides?: CallOverrides): Promise<[string]>; + + balanceOf( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + + burn( + burnAmount: PromiseOrValue, + receiver: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; + decimals(overrides?: CallOverrides): Promise<[number]>; - approve( + decreaseAllowance( spender: PromiseOrValue, - value: PromiseOrValue, + subtractedValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - }; - - proxyAdmin(overrides?: CallOverrides): Promise; - - supportsInterface( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - - transferProxyAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; + executiveRebalance( + newLowerTick: PromiseOrValue, + newUpperTick: PromiseOrValue, + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; + gelatoRebalanceBPS(overrides?: CallOverrides): Promise<[number]>; - approve( - spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; + gelatoSlippageBPS(overrides?: CallOverrides): Promise<[number]>; - callStatic: { - proxyAdmin(overrides?: CallOverrides): Promise; + gelatoSlippageInterval(overrides?: CallOverrides): Promise<[number]>; - supportsInterface( - id: PromiseOrValue, + getMintAmounts( + amount0Max: PromiseOrValue, + amount1Max: PromiseOrValue, overrides?: CallOverrides - ): Promise; + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; - transferProxyAdmin( - newAdmin: PromiseOrValue, + getPositionID( overrides?: CallOverrides - ): Promise; + ): Promise<[string] & { positionID: string }>; - upgradeTo( - newImplementation: PromiseOrValue, + getUnderlyingBalances( overrides?: CallOverrides - ): Promise; + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, + getUnderlyingBalancesAtPrice( + sqrtRatioX96: PromiseOrValue, overrides?: CallOverrides - ): Promise; + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; - approve( + increaseAllowance( spender: PromiseOrValue, - value: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - }; + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; - filters: { - "ProxyAdminTransferred(address,address)"( - previousAdmin?: PromiseOrValue | null, - newAdmin?: PromiseOrValue | null - ): ProxyAdminTransferredEventFilter; - ProxyAdminTransferred( - previousAdmin?: PromiseOrValue | null, - newAdmin?: PromiseOrValue | null - ): ProxyAdminTransferredEventFilter; - - "ProxyImplementationUpdated(address,address)"( - previousImplementation?: PromiseOrValue | null, - newImplementation?: PromiseOrValue | null - ): ProxyImplementationUpdatedEventFilter; - ProxyImplementationUpdated( - previousImplementation?: PromiseOrValue | null, - newImplementation?: PromiseOrValue | null - ): ProxyImplementationUpdatedEventFilter; - }; + initialize( + _name: PromiseOrValue, + _symbol: PromiseOrValue, + _pool: PromiseOrValue, + _managerFeeBPS: PromiseOrValue, + _lowerTick: PromiseOrValue, + _upperTick: PromiseOrValue, + _manager_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; - estimateGas: { - proxyAdmin(overrides?: CallOverrides): Promise; + lowerTick(overrides?: CallOverrides): Promise<[number]>; - supportsInterface( - id: PromiseOrValue, - overrides?: CallOverrides - ): Promise; + manager(overrides?: CallOverrides): Promise<[string]>; - transferProxyAdmin( - newAdmin: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; + managerBalance0(overrides?: CallOverrides): Promise<[BigNumber]>; - upgradeTo( - newImplementation: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; + managerBalance1(overrides?: CallOverrides): Promise<[BigNumber]>; - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } - ): Promise; + managerFeeBPS(overrides?: CallOverrides): Promise<[number]>; - approve( - spender: PromiseOrValue, - value: PromiseOrValue, + managerTreasury(overrides?: CallOverrides): Promise<[string]>; + + mint( + mintAmount: PromiseOrValue, + receiver: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - }; + ): Promise; - populateTransaction: { - proxyAdmin(overrides?: CallOverrides): Promise; + name(overrides?: CallOverrides): Promise<[string]>; - supportsInterface( - id: PromiseOrValue, + pool(overrides?: CallOverrides): Promise<[string]>; + + rebalance( + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + feeAmount: PromiseOrValue, + paymentToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise<[number]>; + + symbol(overrides?: CallOverrides): Promise<[string]>; + + toggleRestrictMint( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + token0(overrides?: CallOverrides): Promise<[string]>; + + token1(overrides?: CallOverrides): Promise<[string]>; + + totalSupply(overrides?: CallOverrides): Promise<[BigNumber]>; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: PromiseOrValue, + amount1Owed: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: PromiseOrValue, + amount1Delta: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: PromiseOrValue, + newManagerTreasury: PromiseOrValue, + newRebalanceBPS: PromiseOrValue, + newSlippageBPS: PromiseOrValue, + newSlippageInterval: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise<[number]>; + + version(overrides?: CallOverrides): Promise<[string]>; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + burn( + burnAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + executiveRebalance( + newLowerTick: PromiseOrValue, + newUpperTick: PromiseOrValue, + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: PromiseOrValue, + amount1Max: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + initialize( + _name: PromiseOrValue, + _symbol: PromiseOrValue, + _pool: PromiseOrValue, + _managerFeeBPS: PromiseOrValue, + _lowerTick: PromiseOrValue, + _upperTick: PromiseOrValue, + _manager_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + feeAmount: PromiseOrValue, + paymentToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: PromiseOrValue, + amount1Owed: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: PromiseOrValue, + amount1Delta: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: PromiseOrValue, + newManagerTreasury: PromiseOrValue, + newRebalanceBPS: PromiseOrValue, + newSlippageBPS: PromiseOrValue, + newSlippageInterval: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + callStatic: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + burn( + burnAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityBurned: BigNumber; + } + >; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + executiveRebalance( + newLowerTick: PromiseOrValue, + newUpperTick: PromiseOrValue, + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: PromiseOrValue, + amount1Max: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + mintAmount: BigNumber; + } + >; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber] & { + amount0Current: BigNumber; + amount1Current: BigNumber; + } + >; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + initialize( + _name: PromiseOrValue, + _symbol: PromiseOrValue, + _pool: PromiseOrValue, + _managerFeeBPS: PromiseOrValue, + _lowerTick: PromiseOrValue, + _upperTick: PromiseOrValue, + _manager_: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: CallOverrides + ): Promise< + [BigNumber, BigNumber, BigNumber] & { + amount0: BigNumber; + amount1: BigNumber; + liquidityMinted: BigNumber; + } + >; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + feeAmount: PromiseOrValue, + paymentToken: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + renounceOwnership(overrides?: CallOverrides): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint(overrides?: CallOverrides): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapV3MintCallback( + amount0Owed: PromiseOrValue, + amount1Owed: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: PromiseOrValue, + amount1Delta: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + updateManagerParams( + newManagerFeeBPS: PromiseOrValue, + newManagerTreasury: PromiseOrValue, + newRebalanceBPS: PromiseOrValue, + newSlippageBPS: PromiseOrValue, + newSlippageInterval: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance(overrides?: CallOverrides): Promise; + + withdrawManagerBalance(overrides?: CallOverrides): Promise; + }; + + filters: { + "Approval(address,address,uint256)"( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null + ): ApprovalEventFilter; + Approval( + owner?: PromiseOrValue | null, + spender?: PromiseOrValue | null, + value?: null + ): ApprovalEventFilter; + + "Burned(address,uint256,uint256,uint256,uint128)"( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null + ): BurnedEventFilter; + Burned( + receiver?: null, + burnAmount?: null, + amount0Out?: null, + amount1Out?: null, + liquidityBurned?: null + ): BurnedEventFilter; + + "FeesEarned(uint256,uint256)"( + feesEarned0?: null, + feesEarned1?: null + ): FeesEarnedEventFilter; + FeesEarned(feesEarned0?: null, feesEarned1?: null): FeesEarnedEventFilter; + + "Minted(address,uint256,uint256,uint256,uint128)"( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null + ): MintedEventFilter; + Minted( + receiver?: null, + mintAmount?: null, + amount0In?: null, + amount1In?: null, + liquidityMinted?: null + ): MintedEventFilter; + + "OwnershipTransferred(address,address)"( + previousManager?: PromiseOrValue | null, + newManager?: PromiseOrValue | null + ): OwnershipTransferredEventFilter; + OwnershipTransferred( + previousManager?: PromiseOrValue | null, + newManager?: PromiseOrValue | null + ): OwnershipTransferredEventFilter; + + "Rebalance(int24,int24,uint128,uint128)"( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null + ): RebalanceEventFilter; + Rebalance( + lowerTick_?: null, + upperTick_?: null, + liquidityBefore?: null, + liquidityAfter?: null + ): RebalanceEventFilter; + + "Transfer(address,address,uint256)"( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null + ): TransferEventFilter; + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + value?: null + ): TransferEventFilter; + + "UpdateManagerParams(uint16,address,uint16,uint16,uint32)"( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null + ): UpdateManagerParamsEventFilter; + UpdateManagerParams( + managerFeeBPS?: null, + managerTreasury?: null, + gelatoRebalanceBPS?: null, + gelatoSlippageBPS?: null, + gelatoSlippageInterval?: null + ): UpdateManagerParamsEventFilter; + }; + + estimateGas: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED(overrides?: CallOverrides): Promise; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + burn( + burnAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + executiveRebalance( + newLowerTick: PromiseOrValue, + newUpperTick: PromiseOrValue, + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + gelatoRebalanceBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval(overrides?: CallOverrides): Promise; + + getMintAmounts( + amount0Max: PromiseOrValue, + amount1Max: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances(overrides?: CallOverrides): Promise; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseAllowance( + spender: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + initialize( + _name: PromiseOrValue, + _symbol: PromiseOrValue, + _pool: PromiseOrValue, + _managerFeeBPS: PromiseOrValue, + _lowerTick: PromiseOrValue, + _upperTick: PromiseOrValue, + _manager_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + feeAmount: PromiseOrValue, + paymentToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + restrictedMintToggle(overrides?: CallOverrides): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: PromiseOrValue, + amount1Owed: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: PromiseOrValue, + amount1Delta: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: PromiseOrValue, + newManagerTreasury: PromiseOrValue, + newRebalanceBPS: PromiseOrValue, + newSlippageBPS: PromiseOrValue, + newSlippageInterval: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdrawManagerBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + }; + + populateTransaction: { + GELATO(overrides?: CallOverrides): Promise; + + RESTRICTED_MINT_ENABLED( + overrides?: CallOverrides + ): Promise; + + allowance( + owner: PromiseOrValue, + spender: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + approve( + spender: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + arrakisBalance0(overrides?: CallOverrides): Promise; + + arrakisBalance1(overrides?: CallOverrides): Promise; + + arrakisFeeBPS(overrides?: CallOverrides): Promise; + + arrakisTreasury(overrides?: CallOverrides): Promise; + + balanceOf( + account: PromiseOrValue, overrides?: CallOverrides ): Promise; - transferProxyAdmin( - newAdmin: PromiseOrValue, + burn( + burnAmount: PromiseOrValue, + receiver: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - upgradeTo( - newImplementation: PromiseOrValue, + decimals(overrides?: CallOverrides): Promise; + + decreaseAllowance( + spender: PromiseOrValue, + subtractedValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - upgradeToAndCall( - newImplementation: PromiseOrValue, - data: PromiseOrValue, - overrides?: PayableOverrides & { from?: PromiseOrValue } + executiveRebalance( + newLowerTick: PromiseOrValue, + newUpperTick: PromiseOrValue, + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - approve( + gelatoRebalanceBPS( + overrides?: CallOverrides + ): Promise; + + gelatoSlippageBPS(overrides?: CallOverrides): Promise; + + gelatoSlippageInterval( + overrides?: CallOverrides + ): Promise; + + getMintAmounts( + amount0Max: PromiseOrValue, + amount1Max: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + getPositionID(overrides?: CallOverrides): Promise; + + getUnderlyingBalances( + overrides?: CallOverrides + ): Promise; + + getUnderlyingBalancesAtPrice( + sqrtRatioX96: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + increaseAllowance( spender: PromiseOrValue, - value: PromiseOrValue, + addedValue: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + initialize( + _name: PromiseOrValue, + _symbol: PromiseOrValue, + _pool: PromiseOrValue, + _managerFeeBPS: PromiseOrValue, + _lowerTick: PromiseOrValue, + _upperTick: PromiseOrValue, + _manager_: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + lowerTick(overrides?: CallOverrides): Promise; + + manager(overrides?: CallOverrides): Promise; + + managerBalance0(overrides?: CallOverrides): Promise; + + managerBalance1(overrides?: CallOverrides): Promise; + + managerFeeBPS(overrides?: CallOverrides): Promise; + + managerTreasury(overrides?: CallOverrides): Promise; + + mint( + mintAmount: PromiseOrValue, + receiver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + name(overrides?: CallOverrides): Promise; + + pool(overrides?: CallOverrides): Promise; + + rebalance( + swapThresholdPrice: PromiseOrValue, + swapAmountBPS: PromiseOrValue, + zeroForOne: PromiseOrValue, + feeAmount: PromiseOrValue, + paymentToken: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + restrictedMintToggle( + overrides?: CallOverrides + ): Promise; + + symbol(overrides?: CallOverrides): Promise; + + toggleRestrictMint( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + token0(overrides?: CallOverrides): Promise; + + token1(overrides?: CallOverrides): Promise; + + totalSupply(overrides?: CallOverrides): Promise; + + transfer( + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferFrom( + sender: PromiseOrValue, + recipient: PromiseOrValue, + amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3MintCallback( + amount0Owed: PromiseOrValue, + amount1Owed: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + uniswapV3SwapCallback( + amount0Delta: PromiseOrValue, + amount1Delta: PromiseOrValue, + arg2: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + updateManagerParams( + newManagerFeeBPS: PromiseOrValue, + newManagerTreasury: PromiseOrValue, + newRebalanceBPS: PromiseOrValue, + newSlippageBPS: PromiseOrValue, + newSlippageInterval: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + upperTick(overrides?: CallOverrides): Promise; + + version(overrides?: CallOverrides): Promise; + + withdrawArrakisBalance( + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + withdrawManagerBalance( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; }; diff --git a/sdk/contracts/types/PerpsV2Market.ts b/sdk/contracts/types/PerpsV2Market.ts index b5c31873e3..d305793c88 100644 --- a/sdk/contracts/types/PerpsV2Market.ts +++ b/sdk/contracts/types/PerpsV2Market.ts @@ -32,7 +32,7 @@ export declare namespace IPerpsV2MarketConsolidated { export type DelayedOrderStruct = { isOffchain: PromiseOrValue; sizeDelta: PromiseOrValue; - priceImpactDelta: PromiseOrValue; + desiredFillPrice: PromiseOrValue; targetRoundId: PromiseOrValue; commitDeposit: PromiseOrValue; keeperDeposit: PromiseOrValue; @@ -54,7 +54,7 @@ export declare namespace IPerpsV2MarketConsolidated { ] & { isOffchain: boolean; sizeDelta: BigNumber; - priceImpactDelta: BigNumber; + desiredFillPrice: BigNumber; targetRoundId: BigNumber; commitDeposit: BigNumber; keeperDeposit: BigNumber; @@ -102,9 +102,14 @@ export interface PerpsV2MarketInterface extends utils.Interface { "delayedOrders(address)": FunctionFragment; "executeDelayedOrder(address)": FunctionFragment; "executeOffchainDelayedOrder(address,bytes[])": FunctionFragment; + "fillPrice(int256)": FunctionFragment; + "flagPosition(address)": FunctionFragment; + "forceLiquidatePosition(address)": FunctionFragment; "fundingLastRecomputed()": FunctionFragment; + "fundingRateLastRecomputed()": FunctionFragment; "fundingSequence(uint256)": FunctionFragment; "fundingSequenceLength()": FunctionFragment; + "isFlagged(address)": FunctionFragment; "liquidatePosition(address)": FunctionFragment; "liquidationFee(address)": FunctionFragment; "liquidationPrice(address)": FunctionFragment; @@ -122,6 +127,8 @@ export interface PerpsV2MarketInterface extends utils.Interface { "profitLoss(address)": FunctionFragment; "recomputeFunding()": FunctionFragment; "remainingMargin(address)": FunctionFragment; + "submitCloseDelayedOrderWithTracking(uint256,uint256,bytes32)": FunctionFragment; + "submitCloseOffchainDelayedOrderWithTracking(uint256,bytes32)": FunctionFragment; "submitDelayedOrder(int256,uint256,uint256)": FunctionFragment; "submitDelayedOrderWithTracking(int256,uint256,uint256,bytes32)": FunctionFragment; "submitOffchainDelayedOrder(int256,uint256)": FunctionFragment; @@ -147,9 +154,14 @@ export interface PerpsV2MarketInterface extends utils.Interface { | "delayedOrders" | "executeDelayedOrder" | "executeOffchainDelayedOrder" + | "fillPrice" + | "flagPosition" + | "forceLiquidatePosition" | "fundingLastRecomputed" + | "fundingRateLastRecomputed" | "fundingSequence" | "fundingSequenceLength" + | "isFlagged" | "liquidatePosition" | "liquidationFee" | "liquidationPrice" @@ -167,6 +179,8 @@ export interface PerpsV2MarketInterface extends utils.Interface { | "profitLoss" | "recomputeFunding" | "remainingMargin" + | "submitCloseDelayedOrderWithTracking" + | "submitCloseOffchainDelayedOrderWithTracking" | "submitDelayedOrder" | "submitDelayedOrderWithTracking" | "submitOffchainDelayedOrder" @@ -229,10 +243,26 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "executeOffchainDelayedOrder", values: [PromiseOrValue, PromiseOrValue[]] ): string; + encodeFunctionData( + functionFragment: "fillPrice", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "flagPosition", + values: [PromiseOrValue] + ): string; + encodeFunctionData( + functionFragment: "forceLiquidatePosition", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "fundingLastRecomputed", values?: undefined ): string; + encodeFunctionData( + functionFragment: "fundingRateLastRecomputed", + values?: undefined + ): string; encodeFunctionData( functionFragment: "fundingSequence", values: [PromiseOrValue] @@ -241,6 +271,10 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "fundingSequenceLength", values?: undefined ): string; + encodeFunctionData( + functionFragment: "isFlagged", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "liquidatePosition", values: [PromiseOrValue] @@ -315,6 +349,18 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "remainingMargin", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "submitCloseDelayedOrderWithTracking", + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ] + ): string; + encodeFunctionData( + functionFragment: "submitCloseOffchainDelayedOrderWithTracking", + values: [PromiseOrValue, PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "submitDelayedOrder", values: [ @@ -407,10 +453,23 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "executeOffchainDelayedOrder", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "fillPrice", data: BytesLike): Result; + decodeFunctionResult( + functionFragment: "flagPosition", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "forceLiquidatePosition", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "fundingLastRecomputed", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "fundingRateLastRecomputed", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "fundingSequence", data: BytesLike @@ -419,6 +478,7 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "fundingSequenceLength", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "isFlagged", data: BytesLike): Result; decodeFunctionResult( functionFragment: "liquidatePosition", data: BytesLike @@ -466,6 +526,14 @@ export interface PerpsV2MarketInterface extends utils.Interface { functionFragment: "remainingMargin", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "submitCloseDelayedOrderWithTracking", + data: BytesLike + ): Result; + decodeFunctionResult( + functionFragment: "submitCloseOffchainDelayedOrderWithTracking", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "submitDelayedOrder", data: BytesLike @@ -501,8 +569,9 @@ export interface PerpsV2MarketInterface extends utils.Interface { "FundingRecomputed(int256,int256,uint256,uint256)": EventFragment; "MarginTransferred(address,int256)": EventFragment; "PerpsTracking(bytes32,bytes32,bytes32,int256,uint256)": EventFragment; - "PositionLiquidated(uint256,address,address,int256,uint256,uint256)": EventFragment; - "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)": EventFragment; + "PositionFlagged(uint256,address,address,uint256)": EventFragment; + "PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)": EventFragment; + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)": EventFragment; }; getEvent(nameOrSignatureOrTopic: "DelayedOrderRemoved"): EventFragment; @@ -510,6 +579,7 @@ export interface PerpsV2MarketInterface extends utils.Interface { getEvent(nameOrSignatureOrTopic: "FundingRecomputed"): EventFragment; getEvent(nameOrSignatureOrTopic: "MarginTransferred"): EventFragment; getEvent(nameOrSignatureOrTopic: "PerpsTracking"): EventFragment; + getEvent(nameOrSignatureOrTopic: "PositionFlagged"): EventFragment; getEvent(nameOrSignatureOrTopic: "PositionLiquidated"): EventFragment; getEvent(nameOrSignatureOrTopic: "PositionModified"): EventFragment; } @@ -610,16 +680,40 @@ export type PerpsTrackingEvent = TypedEvent< export type PerpsTrackingEventFilter = TypedEventFilter; +export interface PositionFlaggedEventObject { + id: BigNumber; + account: string; + flagger: string; + timestamp: BigNumber; +} +export type PositionFlaggedEvent = TypedEvent< + [BigNumber, string, string, BigNumber], + PositionFlaggedEventObject +>; + +export type PositionFlaggedEventFilter = TypedEventFilter; + export interface PositionLiquidatedEventObject { id: BigNumber; account: string; liquidator: string; size: BigNumber; price: BigNumber; - fee: BigNumber; + flaggerFee: BigNumber; + liquidatorFee: BigNumber; + stakersFee: BigNumber; } export type PositionLiquidatedEvent = TypedEvent< - [BigNumber, string, string, BigNumber, BigNumber, BigNumber], + [ + BigNumber, + string, + string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, + BigNumber + ], PositionLiquidatedEventObject >; @@ -635,6 +729,7 @@ export interface PositionModifiedEventObject { lastPrice: BigNumber; fundingIndex: BigNumber; fee: BigNumber; + skew: BigNumber; } export type PositionModifiedEvent = TypedEvent< [ @@ -645,6 +740,7 @@ export type PositionModifiedEvent = TypedEvent< BigNumber, BigNumber, BigNumber, + BigNumber, BigNumber ], PositionModifiedEventObject @@ -714,12 +810,12 @@ export interface PerpsV2Market extends BaseContract { ): Promise; closePosition( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; closePositionWithTracking( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -748,10 +844,29 @@ export interface PerpsV2Market extends BaseContract { overrides?: PayableOverrides & { from?: PromiseOrValue } ): Promise; + fillPrice( + sizeDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceLiquidatePosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + fundingLastRecomputed( overrides?: CallOverrides ): Promise<[number] & { timestamp: number }>; + fundingRateLastRecomputed( + overrides?: CallOverrides + ): Promise<[BigNumber] & { fundingRate: BigNumber }>; + fundingSequence( index: PromiseOrValue, overrides?: CallOverrides @@ -761,6 +876,11 @@ export interface PerpsV2Market extends BaseContract { overrides?: CallOverrides ): Promise<[BigNumber] & { length: BigNumber }>; + isFlagged( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[boolean]>; + liquidatePosition( account: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -796,13 +916,13 @@ export interface PerpsV2Market extends BaseContract { modifyPosition( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; modifyPositionWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -856,30 +976,43 @@ export interface PerpsV2Market extends BaseContract { [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } >; + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + submitDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -932,12 +1065,12 @@ export interface PerpsV2Market extends BaseContract { ): Promise; closePosition( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; closePositionWithTracking( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -962,8 +1095,25 @@ export interface PerpsV2Market extends BaseContract { overrides?: PayableOverrides & { from?: PromiseOrValue } ): Promise; + fillPrice( + sizeDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceLiquidatePosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + fundingLastRecomputed(overrides?: CallOverrides): Promise; + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + fundingSequence( index: PromiseOrValue, overrides?: CallOverrides @@ -971,6 +1121,11 @@ export interface PerpsV2Market extends BaseContract { fundingSequenceLength(overrides?: CallOverrides): Promise; + isFlagged( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + liquidatePosition( account: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1002,13 +1157,13 @@ export interface PerpsV2Market extends BaseContract { modifyPosition( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; modifyPositionWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1062,30 +1217,43 @@ export interface PerpsV2Market extends BaseContract { [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } >; + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + submitDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1138,12 +1306,12 @@ export interface PerpsV2Market extends BaseContract { ): Promise; closePosition( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: CallOverrides ): Promise; closePositionWithTracking( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1168,8 +1336,25 @@ export interface PerpsV2Market extends BaseContract { overrides?: CallOverrides ): Promise; + fillPrice( + sizeDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber, boolean] & { price: BigNumber; invalid: boolean }>; + + flagPosition( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + forceLiquidatePosition( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + fundingLastRecomputed(overrides?: CallOverrides): Promise; + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + fundingSequence( index: PromiseOrValue, overrides?: CallOverrides @@ -1177,6 +1362,11 @@ export interface PerpsV2Market extends BaseContract { fundingSequenceLength(overrides?: CallOverrides): Promise; + isFlagged( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + liquidatePosition( account: PromiseOrValue, overrides?: CallOverrides @@ -1208,13 +1398,13 @@ export interface PerpsV2Market extends BaseContract { modifyPosition( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: CallOverrides ): Promise; modifyPositionWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1266,30 +1456,43 @@ export interface PerpsV2Market extends BaseContract { [BigNumber, boolean] & { marginRemaining: BigNumber; invalid: boolean } >; + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + submitDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: CallOverrides ): Promise; submitDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: CallOverrides ): Promise; submitOffchainDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: CallOverrides ): Promise; submitOffchainDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1388,13 +1591,28 @@ export interface PerpsV2Market extends BaseContract { fee?: null ): PerpsTrackingEventFilter; - "PositionLiquidated(uint256,address,address,int256,uint256,uint256)"( + "PositionFlagged(uint256,address,address,uint256)"( + id?: null, + account?: null, + flagger?: null, + timestamp?: null + ): PositionFlaggedEventFilter; + PositionFlagged( + id?: null, + account?: null, + flagger?: null, + timestamp?: null + ): PositionFlaggedEventFilter; + + "PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)"( id?: null, account?: null, liquidator?: null, size?: null, price?: null, - fee?: null + flaggerFee?: null, + liquidatorFee?: null, + stakersFee?: null ): PositionLiquidatedEventFilter; PositionLiquidated( id?: null, @@ -1402,10 +1620,12 @@ export interface PerpsV2Market extends BaseContract { liquidator?: null, size?: null, price?: null, - fee?: null + flaggerFee?: null, + liquidatorFee?: null, + stakersFee?: null ): PositionLiquidatedEventFilter; - "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256)"( + "PositionModified(uint256,address,uint256,int256,int256,uint256,uint256,uint256,int256)"( id?: PromiseOrValue | null, account?: PromiseOrValue | null, margin?: null, @@ -1413,7 +1633,8 @@ export interface PerpsV2Market extends BaseContract { tradeSize?: null, lastPrice?: null, fundingIndex?: null, - fee?: null + fee?: null, + skew?: null ): PositionModifiedEventFilter; PositionModified( id?: PromiseOrValue | null, @@ -1423,7 +1644,8 @@ export interface PerpsV2Market extends BaseContract { tradeSize?: null, lastPrice?: null, fundingIndex?: null, - fee?: null + fee?: null, + skew?: null ): PositionModifiedEventFilter; }; @@ -1458,12 +1680,12 @@ export interface PerpsV2Market extends BaseContract { ): Promise; closePosition( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; closePositionWithTracking( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1488,8 +1710,25 @@ export interface PerpsV2Market extends BaseContract { overrides?: PayableOverrides & { from?: PromiseOrValue } ): Promise; + fillPrice( + sizeDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + flagPosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceLiquidatePosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + fundingLastRecomputed(overrides?: CallOverrides): Promise; + fundingRateLastRecomputed(overrides?: CallOverrides): Promise; + fundingSequence( index: PromiseOrValue, overrides?: CallOverrides @@ -1497,6 +1736,11 @@ export interface PerpsV2Market extends BaseContract { fundingSequenceLength(overrides?: CallOverrides): Promise; + isFlagged( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + liquidatePosition( account: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1524,13 +1768,13 @@ export interface PerpsV2Market extends BaseContract { modifyPosition( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; modifyPositionWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1573,30 +1817,43 @@ export interface PerpsV2Market extends BaseContract { overrides?: CallOverrides ): Promise; + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + submitDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1644,12 +1901,12 @@ export interface PerpsV2Market extends BaseContract { ): Promise; closePosition( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; closePositionWithTracking( - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1678,10 +1935,29 @@ export interface PerpsV2Market extends BaseContract { overrides?: PayableOverrides & { from?: PromiseOrValue } ): Promise; + fillPrice( + sizeDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + + flagPosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + forceLiquidatePosition( + account: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + fundingLastRecomputed( overrides?: CallOverrides ): Promise; + fundingRateLastRecomputed( + overrides?: CallOverrides + ): Promise; + fundingSequence( index: PromiseOrValue, overrides?: CallOverrides @@ -1691,6 +1967,11 @@ export interface PerpsV2Market extends BaseContract { overrides?: CallOverrides ): Promise; + isFlagged( + account: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + liquidatePosition( account: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } @@ -1718,13 +1999,13 @@ export interface PerpsV2Market extends BaseContract { modifyPosition( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; modifyPositionWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1767,30 +2048,43 @@ export interface PerpsV2Market extends BaseContract { overrides?: CallOverrides ): Promise; + submitCloseDelayedOrderWithTracking( + desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + + submitCloseOffchainDelayedOrderWithTracking( + desiredFillPrice: PromiseOrValue, + trackingCode: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + submitDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, desiredTimeDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrder( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; submitOffchainDelayedOrderWithTracking( sizeDelta: PromiseOrValue, - priceImpactDelta: PromiseOrValue, + desiredFillPrice: PromiseOrValue, trackingCode: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; diff --git a/sdk/contracts/types/PerpsV2MarketData.ts b/sdk/contracts/types/PerpsV2MarketData.ts index 3aa80d98eb..fdeca34a22 100644 --- a/sdk/contracts/types/PerpsV2MarketData.ts +++ b/sdk/contracts/types/PerpsV2MarketData.ts @@ -29,7 +29,6 @@ export declare namespace PerpsV2MarketData { makerFeeDelayedOrder: PromiseOrValue; takerFeeOffchainDelayedOrder: PromiseOrValue; makerFeeOffchainDelayedOrder: PromiseOrValue; - overrideCommitFee: PromiseOrValue; }; export type FeeRatesStructOutput = [ @@ -38,7 +37,6 @@ export declare namespace PerpsV2MarketData { BigNumber, BigNumber, BigNumber, - BigNumber, BigNumber ] & { takerFee: BigNumber; @@ -47,7 +45,6 @@ export declare namespace PerpsV2MarketData { makerFeeDelayedOrder: BigNumber; takerFeeOffchainDelayedOrder: BigNumber; makerFeeOffchainDelayedOrder: BigNumber; - overrideCommitFee: BigNumber; }; export type MarketSummaryStruct = { @@ -93,8 +90,8 @@ export declare namespace PerpsV2MarketData { export type FuturesGlobalsStruct = { minInitialMargin: PromiseOrValue; liquidationFeeRatio: PromiseOrValue; - liquidationBufferRatio: PromiseOrValue; minKeeperFee: PromiseOrValue; + maxKeeperFee: PromiseOrValue; }; export type FuturesGlobalsStructOutput = [ @@ -105,8 +102,8 @@ export declare namespace PerpsV2MarketData { ] & { minInitialMargin: BigNumber; liquidationFeeRatio: BigNumber; - liquidationBufferRatio: BigNumber; minKeeperFee: BigNumber; + maxKeeperFee: BigNumber; }; export type MarketLimitsStruct = { @@ -235,7 +232,6 @@ export declare namespace IPerpsV2MarketSettings { export type ParametersStruct = { takerFee: PromiseOrValue; makerFee: PromiseOrValue; - overrideCommitFee: PromiseOrValue; takerFeeDelayedOrder: PromiseOrValue; makerFeeDelayedOrder: PromiseOrValue; takerFeeOffchainDelayedOrder: PromiseOrValue; @@ -252,6 +248,10 @@ export declare namespace IPerpsV2MarketSettings { offchainDelayedOrderMaxAge: PromiseOrValue; offchainMarketKey: PromiseOrValue; offchainPriceDivergence: PromiseOrValue; + liquidationPremiumMultiplier: PromiseOrValue; + liquidationBufferRatio: PromiseOrValue; + maxLiquidationDelta: PromiseOrValue; + maxPD: PromiseOrValue; }; export type ParametersStructOutput = [ @@ -271,13 +271,15 @@ export declare namespace IPerpsV2MarketSettings { BigNumber, BigNumber, BigNumber, - BigNumber, string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, BigNumber ] & { takerFee: BigNumber; makerFee: BigNumber; - overrideCommitFee: BigNumber; takerFeeDelayedOrder: BigNumber; makerFeeDelayedOrder: BigNumber; takerFeeOffchainDelayedOrder: BigNumber; @@ -294,6 +296,10 @@ export declare namespace IPerpsV2MarketSettings { offchainDelayedOrderMaxAge: BigNumber; offchainMarketKey: string; offchainPriceDivergence: BigNumber; + liquidationPremiumMultiplier: BigNumber; + liquidationBufferRatio: BigNumber; + maxLiquidationDelta: BigNumber; + maxPD: BigNumber; }; } diff --git a/sdk/contracts/types/PerpsV2MarketSettings.ts b/sdk/contracts/types/PerpsV2MarketSettings.ts index 82b391a7da..b5d1ce08b4 100644 --- a/sdk/contracts/types/PerpsV2MarketSettings.ts +++ b/sdk/contracts/types/PerpsV2MarketSettings.ts @@ -31,7 +31,6 @@ export declare namespace IPerpsV2MarketSettings { export type ParametersStruct = { takerFee: PromiseOrValue; makerFee: PromiseOrValue; - overrideCommitFee: PromiseOrValue; takerFeeDelayedOrder: PromiseOrValue; makerFeeDelayedOrder: PromiseOrValue; takerFeeOffchainDelayedOrder: PromiseOrValue; @@ -48,6 +47,10 @@ export declare namespace IPerpsV2MarketSettings { offchainDelayedOrderMaxAge: PromiseOrValue; offchainMarketKey: PromiseOrValue; offchainPriceDivergence: PromiseOrValue; + liquidationPremiumMultiplier: PromiseOrValue; + liquidationBufferRatio: PromiseOrValue; + maxLiquidationDelta: PromiseOrValue; + maxPD: PromiseOrValue; }; export type ParametersStructOutput = [ @@ -67,13 +70,15 @@ export declare namespace IPerpsV2MarketSettings { BigNumber, BigNumber, BigNumber, - BigNumber, string, + BigNumber, + BigNumber, + BigNumber, + BigNumber, BigNumber ] & { takerFee: BigNumber; makerFee: BigNumber; - overrideCommitFee: BigNumber; takerFeeDelayedOrder: BigNumber; makerFeeDelayedOrder: BigNumber; takerFeeOffchainDelayedOrder: BigNumber; @@ -90,23 +95,33 @@ export declare namespace IPerpsV2MarketSettings { offchainDelayedOrderMaxAge: BigNumber; offchainMarketKey: string; offchainPriceDivergence: BigNumber; + liquidationPremiumMultiplier: BigNumber; + liquidationBufferRatio: BigNumber; + maxLiquidationDelta: BigNumber; + maxPD: BigNumber; }; } export interface PerpsV2MarketSettingsInterface extends utils.Interface { functions: { + "CONTRACT_NAME()": FunctionFragment; "acceptOwnership()": FunctionFragment; "delayedOrderConfirmWindow(bytes32)": FunctionFragment; "isResolverCached()": FunctionFragment; - "liquidationBufferRatio()": FunctionFragment; + "keeperLiquidationFee()": FunctionFragment; + "liquidationBufferRatio(bytes32)": FunctionFragment; "liquidationFeeRatio()": FunctionFragment; + "liquidationPremiumMultiplier(bytes32)": FunctionFragment; "makerFee(bytes32)": FunctionFragment; "makerFeeDelayedOrder(bytes32)": FunctionFragment; "makerFeeOffchainDelayedOrder(bytes32)": FunctionFragment; "maxDelayTimeDelta(bytes32)": FunctionFragment; "maxFundingVelocity(bytes32)": FunctionFragment; + "maxKeeperFee()": FunctionFragment; "maxLeverage(bytes32)": FunctionFragment; + "maxLiquidationDelta(bytes32)": FunctionFragment; "maxMarketValue(bytes32)": FunctionFragment; + "maxPD(bytes32)": FunctionFragment; "minDelayTimeDelta(bytes32)": FunctionFragment; "minInitialMargin()": FunctionFragment; "minKeeperFee()": FunctionFragment; @@ -117,22 +132,26 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { "offchainDelayedOrderMinAge(bytes32)": FunctionFragment; "offchainMarketKey(bytes32)": FunctionFragment; "offchainPriceDivergence(bytes32)": FunctionFragment; - "overrideCommitFee(bytes32)": FunctionFragment; "owner()": FunctionFragment; "parameters(bytes32)": FunctionFragment; "rebuildCache()": FunctionFragment; "resolver()": FunctionFragment; "resolverAddressesRequired()": FunctionFragment; "setDelayedOrderConfirmWindow(bytes32,uint256)": FunctionFragment; - "setLiquidationBufferRatio(uint256)": FunctionFragment; + "setKeeperLiquidationFee(uint256)": FunctionFragment; + "setLiquidationBufferRatio(bytes32,uint256)": FunctionFragment; "setLiquidationFeeRatio(uint256)": FunctionFragment; + "setLiquidationPremiumMultiplier(bytes32,uint256)": FunctionFragment; "setMakerFee(bytes32,uint256)": FunctionFragment; "setMakerFeeDelayedOrder(bytes32,uint256)": FunctionFragment; "setMakerFeeOffchainDelayedOrder(bytes32,uint256)": FunctionFragment; "setMaxDelayTimeDelta(bytes32,uint256)": FunctionFragment; "setMaxFundingVelocity(bytes32,uint256)": FunctionFragment; + "setMaxKeeperFee(uint256)": FunctionFragment; "setMaxLeverage(bytes32,uint256)": FunctionFragment; + "setMaxLiquidationDelta(bytes32,uint256)": FunctionFragment; "setMaxMarketValue(bytes32,uint256)": FunctionFragment; + "setMaxPD(bytes32,uint256)": FunctionFragment; "setMinDelayTimeDelta(bytes32,uint256)": FunctionFragment; "setMinInitialMargin(uint256)": FunctionFragment; "setMinKeeperFee(uint256)": FunctionFragment; @@ -141,8 +160,7 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { "setOffchainDelayedOrderMinAge(bytes32,uint256)": FunctionFragment; "setOffchainMarketKey(bytes32,bytes32)": FunctionFragment; "setOffchainPriceDivergence(bytes32,uint256)": FunctionFragment; - "setOverrideCommitFee(bytes32,uint256)": FunctionFragment; - "setParameters(bytes32,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes32,uint256))": FunctionFragment; + "setParameters(bytes32,(uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,bytes32,uint256,uint256,uint256,uint256,uint256))": FunctionFragment; "setSkewScale(bytes32,uint256)": FunctionFragment; "setTakerFee(bytes32,uint256)": FunctionFragment; "setTakerFeeDelayedOrder(bytes32,uint256)": FunctionFragment; @@ -155,18 +173,24 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { getFunction( nameOrSignatureOrTopic: + | "CONTRACT_NAME" | "acceptOwnership" | "delayedOrderConfirmWindow" | "isResolverCached" + | "keeperLiquidationFee" | "liquidationBufferRatio" | "liquidationFeeRatio" + | "liquidationPremiumMultiplier" | "makerFee" | "makerFeeDelayedOrder" | "makerFeeOffchainDelayedOrder" | "maxDelayTimeDelta" | "maxFundingVelocity" + | "maxKeeperFee" | "maxLeverage" + | "maxLiquidationDelta" | "maxMarketValue" + | "maxPD" | "minDelayTimeDelta" | "minInitialMargin" | "minKeeperFee" @@ -177,22 +201,26 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { | "offchainDelayedOrderMinAge" | "offchainMarketKey" | "offchainPriceDivergence" - | "overrideCommitFee" | "owner" | "parameters" | "rebuildCache" | "resolver" | "resolverAddressesRequired" | "setDelayedOrderConfirmWindow" + | "setKeeperLiquidationFee" | "setLiquidationBufferRatio" | "setLiquidationFeeRatio" + | "setLiquidationPremiumMultiplier" | "setMakerFee" | "setMakerFeeDelayedOrder" | "setMakerFeeOffchainDelayedOrder" | "setMaxDelayTimeDelta" | "setMaxFundingVelocity" + | "setMaxKeeperFee" | "setMaxLeverage" + | "setMaxLiquidationDelta" | "setMaxMarketValue" + | "setMaxPD" | "setMinDelayTimeDelta" | "setMinInitialMargin" | "setMinKeeperFee" @@ -201,7 +229,6 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { | "setOffchainDelayedOrderMinAge" | "setOffchainMarketKey" | "setOffchainPriceDivergence" - | "setOverrideCommitFee" | "setParameters" | "setSkewScale" | "setTakerFee" @@ -213,6 +240,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { | "takerFeeOffchainDelayedOrder" ): FunctionFragment; + encodeFunctionData( + functionFragment: "CONTRACT_NAME", + values?: undefined + ): string; encodeFunctionData( functionFragment: "acceptOwnership", values?: undefined @@ -226,13 +257,21 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { values?: undefined ): string; encodeFunctionData( - functionFragment: "liquidationBufferRatio", + functionFragment: "keeperLiquidationFee", values?: undefined ): string; + encodeFunctionData( + functionFragment: "liquidationBufferRatio", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "liquidationFeeRatio", values?: undefined ): string; + encodeFunctionData( + functionFragment: "liquidationPremiumMultiplier", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "makerFee", values: [PromiseOrValue] @@ -253,14 +292,26 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "maxFundingVelocity", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "maxKeeperFee", + values?: undefined + ): string; encodeFunctionData( functionFragment: "maxLeverage", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "maxLiquidationDelta", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "maxMarketValue", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "maxPD", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "minDelayTimeDelta", values: [PromiseOrValue] @@ -301,10 +352,6 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "offchainPriceDivergence", values: [PromiseOrValue] ): string; - encodeFunctionData( - functionFragment: "overrideCommitFee", - values: [PromiseOrValue] - ): string; encodeFunctionData(functionFragment: "owner", values?: undefined): string; encodeFunctionData( functionFragment: "parameters", @@ -324,13 +371,21 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { values: [PromiseOrValue, PromiseOrValue] ): string; encodeFunctionData( - functionFragment: "setLiquidationBufferRatio", + functionFragment: "setKeeperLiquidationFee", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setLiquidationBufferRatio", + values: [PromiseOrValue, PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "setLiquidationFeeRatio", values: [PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setLiquidationPremiumMultiplier", + values: [PromiseOrValue, PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "setMakerFee", values: [PromiseOrValue, PromiseOrValue] @@ -351,14 +406,26 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setMaxFundingVelocity", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setMaxKeeperFee", + values: [PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "setMaxLeverage", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setMaxLiquidationDelta", + values: [PromiseOrValue, PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "setMaxMarketValue", values: [PromiseOrValue, PromiseOrValue] ): string; + encodeFunctionData( + functionFragment: "setMaxPD", + values: [PromiseOrValue, PromiseOrValue] + ): string; encodeFunctionData( functionFragment: "setMinDelayTimeDelta", values: [PromiseOrValue, PromiseOrValue] @@ -391,10 +458,6 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setOffchainPriceDivergence", values: [PromiseOrValue, PromiseOrValue] ): string; - encodeFunctionData( - functionFragment: "setOverrideCommitFee", - values: [PromiseOrValue, PromiseOrValue] - ): string; encodeFunctionData( functionFragment: "setParameters", values: [PromiseOrValue, IPerpsV2MarketSettings.ParametersStruct] @@ -432,6 +495,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { values: [PromiseOrValue] ): string; + decodeFunctionResult( + functionFragment: "CONTRACT_NAME", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "acceptOwnership", data: BytesLike @@ -444,6 +511,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "isResolverCached", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "keeperLiquidationFee", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "liquidationBufferRatio", data: BytesLike @@ -452,6 +523,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "liquidationFeeRatio", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "liquidationPremiumMultiplier", + data: BytesLike + ): Result; decodeFunctionResult(functionFragment: "makerFee", data: BytesLike): Result; decodeFunctionResult( functionFragment: "makerFeeDelayedOrder", @@ -469,14 +544,23 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "maxFundingVelocity", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "maxKeeperFee", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "maxLeverage", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "maxLiquidationDelta", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "maxMarketValue", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "maxPD", data: BytesLike): Result; decodeFunctionResult( functionFragment: "minDelayTimeDelta", data: BytesLike @@ -517,10 +601,6 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "offchainPriceDivergence", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "overrideCommitFee", - data: BytesLike - ): Result; decodeFunctionResult(functionFragment: "owner", data: BytesLike): Result; decodeFunctionResult(functionFragment: "parameters", data: BytesLike): Result; decodeFunctionResult( @@ -536,6 +616,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setDelayedOrderConfirmWindow", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setKeeperLiquidationFee", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setLiquidationBufferRatio", data: BytesLike @@ -544,6 +628,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setLiquidationFeeRatio", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setLiquidationPremiumMultiplier", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setMakerFee", data: BytesLike @@ -564,14 +652,23 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setMaxFundingVelocity", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setMaxKeeperFee", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setMaxLeverage", data: BytesLike ): Result; + decodeFunctionResult( + functionFragment: "setMaxLiquidationDelta", + data: BytesLike + ): Result; decodeFunctionResult( functionFragment: "setMaxMarketValue", data: BytesLike ): Result; + decodeFunctionResult(functionFragment: "setMaxPD", data: BytesLike): Result; decodeFunctionResult( functionFragment: "setMinDelayTimeDelta", data: BytesLike @@ -604,10 +701,6 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { functionFragment: "setOffchainPriceDivergence", data: BytesLike ): Result; - decodeFunctionResult( - functionFragment: "setOverrideCommitFee", - data: BytesLike - ): Result; decodeFunctionResult( functionFragment: "setParameters", data: BytesLike @@ -641,8 +734,10 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { events: { "CacheUpdated(bytes32,address)": EventFragment; + "KeeperLiquidationFeeUpdated(uint256)": EventFragment; "LiquidationBufferRatioUpdated(uint256)": EventFragment; "LiquidationFeeRatioUpdated(uint256)": EventFragment; + "MaxKeeperFeeUpdated(uint256)": EventFragment; "MinInitialMarginUpdated(uint256)": EventFragment; "MinKeeperFeeUpdated(uint256)": EventFragment; "OwnerChanged(address,address)": EventFragment; @@ -652,10 +747,14 @@ export interface PerpsV2MarketSettingsInterface extends utils.Interface { }; getEvent(nameOrSignatureOrTopic: "CacheUpdated"): EventFragment; + getEvent( + nameOrSignatureOrTopic: "KeeperLiquidationFeeUpdated" + ): EventFragment; getEvent( nameOrSignatureOrTopic: "LiquidationBufferRatioUpdated" ): EventFragment; getEvent(nameOrSignatureOrTopic: "LiquidationFeeRatioUpdated"): EventFragment; + getEvent(nameOrSignatureOrTopic: "MaxKeeperFeeUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "MinInitialMarginUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "MinKeeperFeeUpdated"): EventFragment; getEvent(nameOrSignatureOrTopic: "OwnerChanged"): EventFragment; @@ -675,6 +774,17 @@ export type CacheUpdatedEvent = TypedEvent< export type CacheUpdatedEventFilter = TypedEventFilter; +export interface KeeperLiquidationFeeUpdatedEventObject { + keeperFee: BigNumber; +} +export type KeeperLiquidationFeeUpdatedEvent = TypedEvent< + [BigNumber], + KeeperLiquidationFeeUpdatedEventObject +>; + +export type KeeperLiquidationFeeUpdatedEventFilter = + TypedEventFilter; + export interface LiquidationBufferRatioUpdatedEventObject { bps: BigNumber; } @@ -697,6 +807,17 @@ export type LiquidationFeeRatioUpdatedEvent = TypedEvent< export type LiquidationFeeRatioUpdatedEventFilter = TypedEventFilter; +export interface MaxKeeperFeeUpdatedEventObject { + sUSD: BigNumber; +} +export type MaxKeeperFeeUpdatedEvent = TypedEvent< + [BigNumber], + MaxKeeperFeeUpdatedEventObject +>; + +export type MaxKeeperFeeUpdatedEventFilter = + TypedEventFilter; + export interface MinInitialMarginUpdatedEventObject { minMargin: BigNumber; } @@ -793,6 +914,8 @@ export interface PerpsV2MarketSettings extends BaseContract { removeListener: OnEvent; functions: { + CONTRACT_NAME(overrides?: CallOverrides): Promise<[string]>; + acceptOwnership( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -804,10 +927,20 @@ export interface PerpsV2MarketSettings extends BaseContract { isResolverCached(overrides?: CallOverrides): Promise<[boolean]>; - liquidationBufferRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + keeperLiquidationFee(overrides?: CallOverrides): Promise<[BigNumber]>; + + liquidationBufferRatio( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; liquidationFeeRatio(overrides?: CallOverrides): Promise<[BigNumber]>; + liquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + makerFee( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -833,16 +966,28 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise<[BigNumber]>; + maxKeeperFee(overrides?: CallOverrides): Promise<[BigNumber]>; + maxLeverage( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise<[BigNumber]>; + maxLiquidationDelta( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + maxMarketValue( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise<[BigNumber]>; + maxPD( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise<[BigNumber]>; + minDelayTimeDelta( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -884,11 +1029,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise<[BigNumber]>; - overrideCommitFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise<[BigNumber]>; - owner(overrides?: CallOverrides): Promise<[string]>; parameters( @@ -912,7 +1052,13 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setKeeperLiquidationFee( + _keeperFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setLiquidationBufferRatio( + _marketKey: PromiseOrValue, _ratio: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -922,6 +1068,12 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setLiquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + _liquidationPremiumMultiplier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMakerFee( _marketKey: PromiseOrValue, _makerFee: PromiseOrValue, @@ -952,18 +1104,35 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxKeeperFee( + _sUSD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxLeverage( _marketKey: PromiseOrValue, _maxLeverage: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxLiquidationDelta( + _marketKey: PromiseOrValue, + _maxLiquidationDelta: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxMarketValue( _marketKey: PromiseOrValue, _maxMarketValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxPD( + _marketKey: PromiseOrValue, + _maxPD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMinDelayTimeDelta( _marketKey: PromiseOrValue, _minDelayTimeDelta: PromiseOrValue, @@ -1010,12 +1179,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - setOverrideCommitFee( - _marketKey: PromiseOrValue, - _overrideCommitFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - setParameters( _marketKey: PromiseOrValue, _parameters: IPerpsV2MarketSettings.ParametersStruct, @@ -1067,6 +1230,8 @@ export interface PerpsV2MarketSettings extends BaseContract { ): Promise<[BigNumber]>; }; + CONTRACT_NAME(overrides?: CallOverrides): Promise; + acceptOwnership( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1078,10 +1243,20 @@ export interface PerpsV2MarketSettings extends BaseContract { isResolverCached(overrides?: CallOverrides): Promise; - liquidationBufferRatio(overrides?: CallOverrides): Promise; + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; liquidationFeeRatio(overrides?: CallOverrides): Promise; + liquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + makerFee( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1107,16 +1282,28 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + maxKeeperFee(overrides?: CallOverrides): Promise; + maxLeverage( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxLiquidationDelta( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + maxMarketValue( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxPD( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + minDelayTimeDelta( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1158,11 +1345,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; - overrideCommitFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - owner(overrides?: CallOverrides): Promise; parameters( @@ -1184,7 +1366,13 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setKeeperLiquidationFee( + _keeperFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setLiquidationBufferRatio( + _marketKey: PromiseOrValue, _ratio: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1194,6 +1382,12 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setLiquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + _liquidationPremiumMultiplier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMakerFee( _marketKey: PromiseOrValue, _makerFee: PromiseOrValue, @@ -1224,18 +1418,35 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxKeeperFee( + _sUSD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxLeverage( _marketKey: PromiseOrValue, _maxLeverage: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxLiquidationDelta( + _marketKey: PromiseOrValue, + _maxLiquidationDelta: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxMarketValue( _marketKey: PromiseOrValue, _maxMarketValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxPD( + _marketKey: PromiseOrValue, + _maxPD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMinDelayTimeDelta( _marketKey: PromiseOrValue, _minDelayTimeDelta: PromiseOrValue, @@ -1282,12 +1493,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - setOverrideCommitFee( - _marketKey: PromiseOrValue, - _overrideCommitFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - setParameters( _marketKey: PromiseOrValue, _parameters: IPerpsV2MarketSettings.ParametersStruct, @@ -1339,6 +1544,8 @@ export interface PerpsV2MarketSettings extends BaseContract { ): Promise; callStatic: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + acceptOwnership(overrides?: CallOverrides): Promise; delayedOrderConfirmWindow( @@ -1348,10 +1555,20 @@ export interface PerpsV2MarketSettings extends BaseContract { isResolverCached(overrides?: CallOverrides): Promise; - liquidationBufferRatio(overrides?: CallOverrides): Promise; + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; liquidationFeeRatio(overrides?: CallOverrides): Promise; + liquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + makerFee( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1377,16 +1594,28 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + maxKeeperFee(overrides?: CallOverrides): Promise; + maxLeverage( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxLiquidationDelta( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + maxMarketValue( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxPD( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + minDelayTimeDelta( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1428,11 +1657,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; - overrideCommitFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - owner(overrides?: CallOverrides): Promise; parameters( @@ -1452,7 +1676,13 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + setKeeperLiquidationFee( + _keeperFee: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + setLiquidationBufferRatio( + _marketKey: PromiseOrValue, _ratio: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1462,6 +1692,12 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + setLiquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + _liquidationPremiumMultiplier: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + setMakerFee( _marketKey: PromiseOrValue, _makerFee: PromiseOrValue, @@ -1492,18 +1728,35 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + setMaxKeeperFee( + _sUSD: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + setMaxLeverage( _marketKey: PromiseOrValue, _maxLeverage: PromiseOrValue, overrides?: CallOverrides ): Promise; + setMaxLiquidationDelta( + _marketKey: PromiseOrValue, + _maxLiquidationDelta: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + setMaxMarketValue( _marketKey: PromiseOrValue, _maxMarketValue: PromiseOrValue, overrides?: CallOverrides ): Promise; + setMaxPD( + _marketKey: PromiseOrValue, + _maxPD: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + setMinDelayTimeDelta( _marketKey: PromiseOrValue, _minDelayTimeDelta: PromiseOrValue, @@ -1550,12 +1803,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; - setOverrideCommitFee( - _marketKey: PromiseOrValue, - _overrideCommitFee: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - setParameters( _marketKey: PromiseOrValue, _parameters: IPerpsV2MarketSettings.ParametersStruct, @@ -1614,6 +1861,13 @@ export interface PerpsV2MarketSettings extends BaseContract { ): CacheUpdatedEventFilter; CacheUpdated(name?: null, destination?: null): CacheUpdatedEventFilter; + "KeeperLiquidationFeeUpdated(uint256)"( + keeperFee?: null + ): KeeperLiquidationFeeUpdatedEventFilter; + KeeperLiquidationFeeUpdated( + keeperFee?: null + ): KeeperLiquidationFeeUpdatedEventFilter; + "LiquidationBufferRatioUpdated(uint256)"( bps?: null ): LiquidationBufferRatioUpdatedEventFilter; @@ -1628,6 +1882,9 @@ export interface PerpsV2MarketSettings extends BaseContract { bps?: null ): LiquidationFeeRatioUpdatedEventFilter; + "MaxKeeperFeeUpdated(uint256)"(sUSD?: null): MaxKeeperFeeUpdatedEventFilter; + MaxKeeperFeeUpdated(sUSD?: null): MaxKeeperFeeUpdatedEventFilter; + "MinInitialMarginUpdated(uint256)"( minMargin?: null ): MinInitialMarginUpdatedEventFilter; @@ -1671,6 +1928,8 @@ export interface PerpsV2MarketSettings extends BaseContract { }; estimateGas: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + acceptOwnership( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1682,10 +1941,20 @@ export interface PerpsV2MarketSettings extends BaseContract { isResolverCached(overrides?: CallOverrides): Promise; - liquidationBufferRatio(overrides?: CallOverrides): Promise; + keeperLiquidationFee(overrides?: CallOverrides): Promise; + + liquidationBufferRatio( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; liquidationFeeRatio(overrides?: CallOverrides): Promise; + liquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + makerFee( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1711,16 +1980,28 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + maxKeeperFee(overrides?: CallOverrides): Promise; + maxLeverage( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxLiquidationDelta( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + maxMarketValue( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxPD( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + minDelayTimeDelta( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1762,11 +2043,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; - overrideCommitFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - owner(overrides?: CallOverrides): Promise; parameters( @@ -1788,7 +2064,13 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setKeeperLiquidationFee( + _keeperFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setLiquidationBufferRatio( + _marketKey: PromiseOrValue, _ratio: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1798,6 +2080,12 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setLiquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + _liquidationPremiumMultiplier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMakerFee( _marketKey: PromiseOrValue, _makerFee: PromiseOrValue, @@ -1828,18 +2116,35 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxKeeperFee( + _sUSD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxLeverage( _marketKey: PromiseOrValue, _maxLeverage: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxLiquidationDelta( + _marketKey: PromiseOrValue, + _maxLiquidationDelta: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxMarketValue( _marketKey: PromiseOrValue, _maxMarketValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxPD( + _marketKey: PromiseOrValue, + _maxPD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMinDelayTimeDelta( _marketKey: PromiseOrValue, _minDelayTimeDelta: PromiseOrValue, @@ -1886,12 +2191,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - setOverrideCommitFee( - _marketKey: PromiseOrValue, - _overrideCommitFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - setParameters( _marketKey: PromiseOrValue, _parameters: IPerpsV2MarketSettings.ParametersStruct, @@ -1944,6 +2243,8 @@ export interface PerpsV2MarketSettings extends BaseContract { }; populateTransaction: { + CONTRACT_NAME(overrides?: CallOverrides): Promise; + acceptOwnership( overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -1955,7 +2256,12 @@ export interface PerpsV2MarketSettings extends BaseContract { isResolverCached(overrides?: CallOverrides): Promise; + keeperLiquidationFee( + overrides?: CallOverrides + ): Promise; + liquidationBufferRatio( + _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; @@ -1963,6 +2269,11 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + liquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + makerFee( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -1988,16 +2299,28 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; + maxKeeperFee(overrides?: CallOverrides): Promise; + maxLeverage( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxLiquidationDelta( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + maxMarketValue( _marketKey: PromiseOrValue, overrides?: CallOverrides ): Promise; + maxPD( + _marketKey: PromiseOrValue, + overrides?: CallOverrides + ): Promise; + minDelayTimeDelta( _marketKey: PromiseOrValue, overrides?: CallOverrides @@ -2039,11 +2362,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: CallOverrides ): Promise; - overrideCommitFee( - _marketKey: PromiseOrValue, - overrides?: CallOverrides - ): Promise; - owner(overrides?: CallOverrides): Promise; parameters( @@ -2067,7 +2385,13 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setKeeperLiquidationFee( + _keeperFee: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setLiquidationBufferRatio( + _marketKey: PromiseOrValue, _ratio: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; @@ -2077,6 +2401,12 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setLiquidationPremiumMultiplier( + _marketKey: PromiseOrValue, + _liquidationPremiumMultiplier: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMakerFee( _marketKey: PromiseOrValue, _makerFee: PromiseOrValue, @@ -2107,18 +2437,35 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxKeeperFee( + _sUSD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxLeverage( _marketKey: PromiseOrValue, _maxLeverage: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxLiquidationDelta( + _marketKey: PromiseOrValue, + _maxLiquidationDelta: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMaxMarketValue( _marketKey: PromiseOrValue, _maxMarketValue: PromiseOrValue, overrides?: Overrides & { from?: PromiseOrValue } ): Promise; + setMaxPD( + _marketKey: PromiseOrValue, + _maxPD: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue } + ): Promise; + setMinDelayTimeDelta( _marketKey: PromiseOrValue, _minDelayTimeDelta: PromiseOrValue, @@ -2165,12 +2512,6 @@ export interface PerpsV2MarketSettings extends BaseContract { overrides?: Overrides & { from?: PromiseOrValue } ): Promise; - setOverrideCommitFee( - _marketKey: PromiseOrValue, - _overrideCommitFee: PromiseOrValue, - overrides?: Overrides & { from?: PromiseOrValue } - ): Promise; - setParameters( _marketKey: PromiseOrValue, _parameters: IPerpsV2MarketSettings.ParametersStruct, diff --git a/sdk/contracts/types/factories/CrossMarginAccountFactory__factory.ts b/sdk/contracts/types/factories/CrossMarginAccountFactory__factory.ts index 110af0ec3e..b187e36d88 100644 --- a/sdk/contracts/types/factories/CrossMarginAccountFactory__factory.ts +++ b/sdk/contracts/types/factories/CrossMarginAccountFactory__factory.ts @@ -151,7 +151,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class CrossMarginAccountFactory__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/CrossMarginBaseSettings__factory.ts b/sdk/contracts/types/factories/CrossMarginBaseSettings__factory.ts index 5408e05169..4dbe295172 100644 --- a/sdk/contracts/types/factories/CrossMarginBaseSettings__factory.ts +++ b/sdk/contracts/types/factories/CrossMarginBaseSettings__factory.ts @@ -260,7 +260,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class CrossMarginBaseSettings__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/CrossMarginBase__factory.ts b/sdk/contracts/types/factories/CrossMarginBase__factory.ts index e706db8657..07a110da66 100644 --- a/sdk/contracts/types/factories/CrossMarginBase__factory.ts +++ b/sdk/contracts/types/factories/CrossMarginBase__factory.ts @@ -878,7 +878,7 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, -] as const; +]; export class CrossMarginBase__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/DappMaintenance__factory.ts b/sdk/contracts/types/factories/DappMaintenance__factory.ts new file mode 100644 index 0000000000..043bf124ef --- /dev/null +++ b/sdk/contracts/types/factories/DappMaintenance__factory.ts @@ -0,0 +1,225 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Contract, Signer, utils } from "ethers"; +import type { Provider } from "@ethersproject/providers"; +import type { + DappMaintenance, + DappMaintenanceInterface, +} from "../DappMaintenance"; + +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oldOwner", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerChanged", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnerNominated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "SXMaintenance", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "StakingMaintenance", + type: "event", + }, + { + constant: false, + inputs: [], + name: "acceptOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isPausedSX", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "isPausedStaking", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "_owner", + type: "address", + }, + ], + name: "nominateNewOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: true, + inputs: [], + name: "nominatedOwner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeSX", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bool", + name: "isPaused", + type: "bool", + }, + ], + name: "setMaintenanceModeStaking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, +]; + +export class DappMaintenance__factory { + static readonly abi = _abi; + static createInterface(): DappMaintenanceInterface { + return new utils.Interface(_abi) as DappMaintenanceInterface; + } + static connect( + address: string, + signerOrProvider: Signer | Provider + ): DappMaintenance { + return new Contract(address, _abi, signerOrProvider) as DappMaintenance; + } +} diff --git a/sdk/contracts/types/factories/ERC20__factory.ts b/sdk/contracts/types/factories/ERC20__factory.ts index 04ea74421d..612cce66fe 100644 --- a/sdk/contracts/types/factories/ERC20__factory.ts +++ b/sdk/contracts/types/factories/ERC20__factory.ts @@ -341,7 +341,7 @@ const _abi = [ name: "Approval", type: "event", }, -] as const; +]; export class ERC20__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/ExchangeRates__factory.ts b/sdk/contracts/types/factories/ExchangeRates__factory.ts index 9ec13deee9..9814fa44f7 100644 --- a/sdk/contracts/types/factories/ExchangeRates__factory.ts +++ b/sdk/contracts/types/factories/ExchangeRates__factory.ts @@ -1091,7 +1091,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class ExchangeRates__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/Exchanger__factory.ts b/sdk/contracts/types/factories/Exchanger__factory.ts index 17edb53e7b..b3a780b352 100644 --- a/sdk/contracts/types/factories/Exchanger__factory.ts +++ b/sdk/contracts/types/factories/Exchanger__factory.ts @@ -776,7 +776,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class Exchanger__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/FuturesMarketData__factory.ts b/sdk/contracts/types/factories/FuturesMarketData__factory.ts index beb3ecd82c..1db76577ef 100644 --- a/sdk/contracts/types/factories/FuturesMarketData__factory.ts +++ b/sdk/contracts/types/factories/FuturesMarketData__factory.ts @@ -921,7 +921,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class FuturesMarketData__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/FuturesMarketSettings__factory.ts b/sdk/contracts/types/factories/FuturesMarketSettings__factory.ts index 54e5e0677e..15be97c642 100644 --- a/sdk/contracts/types/factories/FuturesMarketSettings__factory.ts +++ b/sdk/contracts/types/factories/FuturesMarketSettings__factory.ts @@ -873,7 +873,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class FuturesMarketSettings__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/FuturesMarket__factory.ts b/sdk/contracts/types/factories/FuturesMarket__factory.ts index d7b990df4a..91594662c8 100644 --- a/sdk/contracts/types/factories/FuturesMarket__factory.ts +++ b/sdk/contracts/types/factories/FuturesMarket__factory.ts @@ -1114,7 +1114,7 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, -] as const; +]; export class FuturesMarket__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/KwentaArrakisVault__factory.ts b/sdk/contracts/types/factories/KwentaArrakisVault__factory.ts index e196b4fc83..c53e927b2a 100644 --- a/sdk/contracts/types/factories/KwentaArrakisVault__factory.ts +++ b/sdk/contracts/types/factories/KwentaArrakisVault__factory.ts @@ -12,24 +12,137 @@ import type { const _abi = [ { inputs: [ + { + internalType: "address payable", + name: "_gelato", + type: "address", + }, { internalType: "address", - name: "implementationAddress", + name: "_arrakisTreasury", type: "address", }, + ], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ { + indexed: true, internalType: "address", - name: "adminAddress", + name: "owner", type: "address", }, { - internalType: "bytes", - name: "data", - type: "bytes", + indexed: true, + internalType: "address", + name: "spender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", }, ], - stateMutability: "payable", - type: "constructor", + name: "Approval", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "receiver", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "burnAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0Out", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1Out", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityBurned", + type: "uint128", + }, + ], + name: "Burned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "feesEarned0", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "feesEarned1", + type: "uint256", + }, + ], + name: "FeesEarned", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "receiver", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount0In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount1In", + type: "uint256", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityMinted", + type: "uint128", + }, + ], + name: "Minted", + type: "event", }, { anonymous: false, @@ -37,17 +150,48 @@ const _abi = [ { indexed: true, internalType: "address", - name: "previousAdmin", + name: "previousManager", type: "address", }, { indexed: true, internalType: "address", - name: "newAdmin", + name: "newManager", type: "address", }, ], - name: "ProxyAdminTransferred", + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "int24", + name: "lowerTick_", + type: "int24", + }, + { + indexed: false, + internalType: "int24", + name: "upperTick_", + type: "int24", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityBefore", + type: "uint128", + }, + { + indexed: false, + internalType: "uint128", + name: "liquidityAfter", + type: "uint128", + }, + ], + name: "Rebalance", type: "event", }, { @@ -56,45 +200,126 @@ const _abi = [ { indexed: true, internalType: "address", - name: "previousImplementation", + name: "from", type: "address", }, { indexed: true, internalType: "address", - name: "newImplementation", + name: "to", type: "address", }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256", + }, ], - name: "ProxyImplementationUpdated", + name: "Transfer", type: "event", }, { - stateMutability: "payable", - type: "fallback", + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint16", + name: "managerFeeBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "address", + name: "managerTreasury", + type: "address", + }, + { + indexed: false, + internalType: "uint16", + name: "gelatoRebalanceBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "uint16", + name: "gelatoSlippageBPS", + type: "uint16", + }, + { + indexed: false, + internalType: "uint32", + name: "gelatoSlippageInterval", + type: "uint32", + }, + ], + name: "UpdateManagerParams", + type: "event", }, { inputs: [], - name: "proxyAdmin", + name: "GELATO", outputs: [ { - internalType: "address", + internalType: "address payable", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "RESTRICTED_MINT_ENABLED", + outputs: [ + { + internalType: "uint16", name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address", + }, + { + internalType: "address", + name: "spender", type: "address", }, ], + name: "allowance", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], stateMutability: "view", type: "function", }, { inputs: [ { - internalType: "bytes4", - name: "id", - type: "bytes4", + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", }, ], - name: "supportsInterface", + name: "approve", outputs: [ { internalType: "bool", @@ -102,55 +327,128 @@ const _abi = [ type: "bool", }, ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "arrakisBalance0", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], stateMutability: "view", type: "function", }, { - inputs: [ + inputs: [], + name: "arrakisBalance1", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "arrakisFeeBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "arrakisTreasury", + outputs: [ { internalType: "address", - name: "newAdmin", + name: "", type: "address", }, ], - name: "transferProxyAdmin", - outputs: [], - stateMutability: "nonpayable", + stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", - name: "newImplementation", + name: "account", type: "address", }, ], - name: "upgradeTo", - outputs: [], - stateMutability: "nonpayable", + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", type: "function", }, { inputs: [ + { + internalType: "uint256", + name: "burnAmount", + type: "uint256", + }, { internalType: "address", - name: "newImplementation", + name: "receiver", type: "address", }, + ], + name: "burn", + outputs: [ { - internalType: "bytes", - name: "data", - type: "bytes", + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint128", + name: "liquidityBurned", + type: "uint128", }, ], - name: "upgradeToAndCall", - outputs: [], - stateMutability: "payable", + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "decimals", + outputs: [ + { + internalType: "uint8", + name: "", + type: "uint8", + }, + ], + stateMutability: "view", type: "function", }, { - constant: false, inputs: [ { internalType: "address", @@ -159,11 +457,11 @@ const _abi = [ }, { internalType: "uint256", - name: "value", + name: "subtractedValue", type: "uint256", }, ], - name: "approve", + name: "decreaseAllowance", outputs: [ { internalType: "bool", @@ -171,15 +469,673 @@ const _abi = [ type: "bool", }, ], - payable: false, stateMutability: "nonpayable", type: "function", }, { - stateMutability: "payable", - type: "receive", + inputs: [ + { + internalType: "int24", + name: "newLowerTick", + type: "int24", + }, + { + internalType: "int24", + name: "newUpperTick", + type: "int24", + }, + { + internalType: "uint160", + name: "swapThresholdPrice", + type: "uint160", + }, + { + internalType: "uint256", + name: "swapAmountBPS", + type: "uint256", + }, + { + internalType: "bool", + name: "zeroForOne", + type: "bool", + }, + ], + name: "executiveRebalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "gelatoRebalanceBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gelatoSlippageBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "gelatoSlippageInterval", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Max", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Max", + type: "uint256", + }, + ], + name: "getMintAmounts", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getPositionID", + outputs: [ + { + internalType: "bytes32", + name: "positionID", + type: "bytes32", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getUnderlyingBalances", + outputs: [ + { + internalType: "uint256", + name: "amount0Current", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Current", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint160", + name: "sqrtRatioX96", + type: "uint160", + }, + ], + name: "getUnderlyingBalancesAtPrice", + outputs: [ + { + internalType: "uint256", + name: "amount0Current", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Current", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "spender", + type: "address", + }, + { + internalType: "uint256", + name: "addedValue", + type: "uint256", + }, + ], + name: "increaseAllowance", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "string", + name: "_symbol", + type: "string", + }, + { + internalType: "address", + name: "_pool", + type: "address", + }, + { + internalType: "uint16", + name: "_managerFeeBPS", + type: "uint16", + }, + { + internalType: "int24", + name: "_lowerTick", + type: "int24", + }, + { + internalType: "int24", + name: "_upperTick", + type: "int24", + }, + { + internalType: "address", + name: "_manager_", + type: "address", + }, + ], + name: "initialize", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "lowerTick", + outputs: [ + { + internalType: "int24", + name: "", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "manager", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerBalance0", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerBalance1", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerFeeBPS", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "managerTreasury", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "mintAmount", + type: "uint256", + }, + { + internalType: "address", + name: "receiver", + type: "address", + }, + ], + name: "mint", + outputs: [ + { + internalType: "uint256", + name: "amount0", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1", + type: "uint256", + }, + { + internalType: "uint128", + name: "liquidityMinted", + type: "uint128", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "pool", + outputs: [ + { + internalType: "contract IUniswapV3Pool", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint160", + name: "swapThresholdPrice", + type: "uint160", + }, + { + internalType: "uint256", + name: "swapAmountBPS", + type: "uint256", + }, + { + internalType: "bool", + name: "zeroForOne", + type: "bool", + }, + { + internalType: "uint256", + name: "feeAmount", + type: "uint256", + }, + { + internalType: "address", + name: "paymentToken", + type: "address", + }, + ], + name: "rebalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "restrictedMintToggle", + outputs: [ + { + internalType: "uint16", + name: "", + type: "uint16", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "symbol", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "toggleRestrictMint", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "token0", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "token1", + outputs: [ + { + internalType: "contract IERC20", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "totalSupply", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transfer", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address", + }, + { + internalType: "address", + name: "recipient", + type: "address", + }, + { + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "transferFrom", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "amount0Owed", + type: "uint256", + }, + { + internalType: "uint256", + name: "amount1Owed", + type: "uint256", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "uniswapV3MintCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int256", + name: "amount0Delta", + type: "int256", + }, + { + internalType: "int256", + name: "amount1Delta", + type: "int256", + }, + { + internalType: "bytes", + name: "", + type: "bytes", + }, + ], + name: "uniswapV3SwapCallback", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "int16", + name: "newManagerFeeBPS", + type: "int16", + }, + { + internalType: "address", + name: "newManagerTreasury", + type: "address", + }, + { + internalType: "int16", + name: "newRebalanceBPS", + type: "int16", + }, + { + internalType: "int16", + name: "newSlippageBPS", + type: "int16", + }, + { + internalType: "int32", + name: "newSlippageInterval", + type: "int32", + }, + ], + name: "updateManagerParams", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "upperTick", + outputs: [ + { + internalType: "int24", + name: "", + type: "int24", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "version", + outputs: [ + { + internalType: "string", + name: "", + type: "string", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "withdrawArrakisBalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [], + name: "withdrawManagerBalance", + outputs: [], + stateMutability: "nonpayable", + type: "function", }, -] as const; +]; export class KwentaArrakisVault__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/KwentaStakingRewards__factory.ts b/sdk/contracts/types/factories/KwentaStakingRewards__factory.ts index e58d01b4fd..bd2d0658af 100644 --- a/sdk/contracts/types/factories/KwentaStakingRewards__factory.ts +++ b/sdk/contracts/types/factories/KwentaStakingRewards__factory.ts @@ -705,7 +705,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class KwentaStakingRewards__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/MultipleMerkleDistributor__factory.ts b/sdk/contracts/types/factories/MultipleMerkleDistributor__factory.ts index e1759c2f52..c3fcb48524 100644 --- a/sdk/contracts/types/factories/MultipleMerkleDistributor__factory.ts +++ b/sdk/contracts/types/factories/MultipleMerkleDistributor__factory.ts @@ -321,7 +321,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class MultipleMerkleDistributor__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/PerpsV2MarketData__factory.ts b/sdk/contracts/types/factories/PerpsV2MarketData__factory.ts index 5354907dab..6b55a48dfb 100644 --- a/sdk/contracts/types/factories/PerpsV2MarketData__factory.ts +++ b/sdk/contracts/types/factories/PerpsV2MarketData__factory.ts @@ -111,11 +111,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -220,11 +215,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -259,12 +249,12 @@ const _abi = [ }, { internalType: "uint256", - name: "liquidationBufferRatio", + name: "minKeeperFee", type: "uint256", }, { internalType: "uint256", - name: "minKeeperFee", + name: "maxKeeperFee", type: "uint256", }, ], @@ -337,11 +327,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -507,11 +492,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -712,11 +692,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -827,11 +802,6 @@ const _abi = [ name: "makerFeeOffchainDelayedOrder", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, ], internalType: "struct PerpsV2MarketData.FeeRates", name: "feeRates", @@ -870,11 +840,6 @@ const _abi = [ name: "makerFee", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, { internalType: "uint256", name: "takerFeeDelayedOrder", @@ -955,6 +920,26 @@ const _abi = [ name: "offchainPriceDivergence", type: "uint256", }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, ], internalType: "struct IPerpsV2MarketSettings.Parameters", name: "", @@ -1170,7 +1155,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class PerpsV2MarketData__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/PerpsV2MarketSettings__factory.ts b/sdk/contracts/types/factories/PerpsV2MarketSettings__factory.ts index 85b0e68f53..808e9055a9 100644 --- a/sdk/contracts/types/factories/PerpsV2MarketSettings__factory.ts +++ b/sdk/contracts/types/factories/PerpsV2MarketSettings__factory.ts @@ -46,6 +46,19 @@ const _abi = [ name: "CacheUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "keeperFee", + type: "uint256", + }, + ], + name: "KeeperLiquidationFeeUpdated", + type: "event", + }, { anonymous: false, inputs: [ @@ -72,6 +85,19 @@ const _abi = [ name: "LiquidationFeeRatioUpdated", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "sUSD", + type: "uint256", + }, + ], + name: "MaxKeeperFeeUpdated", + type: "event", + }, { anonymous: false, inputs: [ @@ -180,6 +206,21 @@ const _abi = [ name: "ParameterUpdatedBytes32", type: "event", }, + { + constant: true, + inputs: [], + name: "CONTRACT_NAME", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: false, inputs: [], @@ -228,6 +269,27 @@ const _abi = [ { constant: true, inputs: [], + name: "keeperLiquidationFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], name: "liquidationBufferRatio", outputs: [ { @@ -255,6 +317,27 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "liquidationPremiumMultiplier", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: true, inputs: [ @@ -360,6 +443,21 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [], + name: "maxKeeperFee", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: true, inputs: [ @@ -381,6 +479,27 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxLiquidationDelta", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: true, inputs: [ @@ -402,6 +521,27 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + ], + name: "maxPD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: true, inputs: [ @@ -588,27 +728,6 @@ const _abi = [ stateMutability: "view", type: "function", }, - { - constant: true, - inputs: [ - { - internalType: "bytes32", - name: "_marketKey", - type: "bytes32", - }, - ], - name: "overrideCommitFee", - outputs: [ - { - internalType: "uint256", - name: "", - type: "uint256", - }, - ], - payable: false, - stateMutability: "view", - type: "function", - }, { constant: true, inputs: [], @@ -647,11 +766,6 @@ const _abi = [ name: "makerFee", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, { internalType: "uint256", name: "takerFeeDelayedOrder", @@ -732,6 +846,26 @@ const _abi = [ name: "offchainPriceDivergence", type: "uint256", }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, ], internalType: "struct IPerpsV2MarketSettings.Parameters", name: "", @@ -804,6 +938,26 @@ const _abi = [ { constant: false, inputs: [ + { + internalType: "uint256", + name: "_keeperFee", + type: "uint256", + }, + ], + name: "setKeeperLiquidationFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, { internalType: "uint256", name: "_ratio", @@ -831,6 +985,26 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_liquidationPremiumMultiplier", + type: "uint256", + }, + ], + name: "setLiquidationPremiumMultiplier", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: false, inputs: [ @@ -931,6 +1105,21 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "_sUSD", + type: "uint256", + }, + ], + name: "setMaxKeeperFee", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: false, inputs: [ @@ -951,6 +1140,26 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxLiquidationDelta", + type: "uint256", + }, + ], + name: "setMaxLiquidationDelta", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: false, inputs: [ @@ -971,6 +1180,26 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "_marketKey", + type: "bytes32", + }, + { + internalType: "uint256", + name: "_maxPD", + type: "uint256", + }, + ], + name: "setMaxPD", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: false, inputs: [ @@ -1121,26 +1350,6 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, - { - constant: false, - inputs: [ - { - internalType: "bytes32", - name: "_marketKey", - type: "bytes32", - }, - { - internalType: "uint256", - name: "_overrideCommitFee", - type: "uint256", - }, - ], - name: "setOverrideCommitFee", - outputs: [], - payable: false, - stateMutability: "nonpayable", - type: "function", - }, { constant: false, inputs: [ @@ -1161,11 +1370,6 @@ const _abi = [ name: "makerFee", type: "uint256", }, - { - internalType: "uint256", - name: "overrideCommitFee", - type: "uint256", - }, { internalType: "uint256", name: "takerFeeDelayedOrder", @@ -1246,6 +1450,26 @@ const _abi = [ name: "offchainPriceDivergence", type: "uint256", }, + { + internalType: "uint256", + name: "liquidationPremiumMultiplier", + type: "uint256", + }, + { + internalType: "uint256", + name: "liquidationBufferRatio", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxLiquidationDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxPD", + type: "uint256", + }, ], internalType: "struct IPerpsV2MarketSettings.Parameters", name: "_parameters", @@ -1422,7 +1646,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class PerpsV2MarketSettings__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/PerpsV2Market__factory.ts b/sdk/contracts/types/factories/PerpsV2Market__factory.ts index d688e157fd..2f73812bd3 100644 --- a/sdk/contracts/types/factories/PerpsV2Market__factory.ts +++ b/sdk/contracts/types/factories/PerpsV2Market__factory.ts @@ -210,6 +210,37 @@ const _abi = [ name: "PerpsTracking", type: "event", }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "account", + type: "address", + }, + { + indexed: false, + internalType: "address", + name: "flagger", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "timestamp", + type: "uint256", + }, + ], + name: "PositionFlagged", + type: "event", + }, { anonymous: false, inputs: [ @@ -246,7 +277,19 @@ const _abi = [ { indexed: false, internalType: "uint256", - name: "fee", + name: "flaggerFee", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "liquidatorFee", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "stakersFee", type: "uint256", }, ], @@ -304,6 +347,12 @@ const _abi = [ name: "fee", type: "uint256", }, + { + indexed: false, + internalType: "int256", + name: "skew", + type: "int256", + }, ], name: "PositionModified", type: "event", @@ -451,7 +500,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, ], @@ -466,7 +515,7 @@ const _abi = [ inputs: [ { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, { @@ -536,7 +585,7 @@ const _abi = [ }, { internalType: "uint128", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint128", }, { @@ -614,6 +663,62 @@ const _abi = [ stateMutability: "payable", type: "function", }, + { + constant: true, + inputs: [ + { + internalType: "int256", + name: "sizeDelta", + type: "int256", + }, + ], + name: "fillPrice", + outputs: [ + { + internalType: "uint256", + name: "price", + type: "uint256", + }, + { + internalType: "bool", + name: "invalid", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "flagPosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "forceLiquidatePosition", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: true, inputs: [], @@ -629,6 +734,21 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [], + name: "fundingRateLastRecomputed", + outputs: [ + { + internalType: "int128", + name: "fundingRate", + type: "int128", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: true, inputs: [ @@ -665,6 +785,27 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "account", + type: "address", + }, + ], + name: "isFlagged", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool", + }, + ], + payable: false, + stateMutability: "view", + type: "function", + }, { constant: false, inputs: [ @@ -822,7 +963,7 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, ], @@ -842,7 +983,7 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, { @@ -1090,6 +1231,51 @@ const _abi = [ stateMutability: "view", type: "function", }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredTimeDelta", + type: "uint256", + }, + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitCloseDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "desiredFillPrice", + type: "uint256", + }, + { + internalType: "bytes32", + name: "trackingCode", + type: "bytes32", + }, + ], + name: "submitCloseOffchainDelayedOrderWithTracking", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function", + }, { constant: false, inputs: [ @@ -1100,12 +1286,12 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredTimeDelta", type: "uint256", }, { internalType: "uint256", - name: "desiredTimeDelta", + name: "desiredFillPrice", type: "uint256", }, ], @@ -1125,12 +1311,12 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredTimeDelta", type: "uint256", }, { internalType: "uint256", - name: "desiredTimeDelta", + name: "desiredFillPrice", type: "uint256", }, { @@ -1155,7 +1341,7 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, ], @@ -1175,7 +1361,7 @@ const _abi = [ }, { internalType: "uint256", - name: "priceImpactDelta", + name: "desiredFillPrice", type: "uint256", }, { @@ -1234,7 +1420,7 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, -] as const; +]; export class PerpsV2Market__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/Pyth__factory.ts b/sdk/contracts/types/factories/Pyth__factory.ts index 7b5560e72c..8fd18a962c 100644 --- a/sdk/contracts/types/factories/Pyth__factory.ts +++ b/sdk/contracts/types/factories/Pyth__factory.ts @@ -476,7 +476,7 @@ const _abi = [ stateMutability: "payable", type: "function", }, -] as const; +]; export class Pyth__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/ReverseRecords__factory.ts b/sdk/contracts/types/factories/ReverseRecords__factory.ts index a3621db7f5..4dc5c9eb8b 100644 --- a/sdk/contracts/types/factories/ReverseRecords__factory.ts +++ b/sdk/contracts/types/factories/ReverseRecords__factory.ts @@ -40,7 +40,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class ReverseRecords__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/RewardEscrow__factory.ts b/sdk/contracts/types/factories/RewardEscrow__factory.ts index 735698c0ce..d364ac3e57 100644 --- a/sdk/contracts/types/factories/RewardEscrow__factory.ts +++ b/sdk/contracts/types/factories/RewardEscrow__factory.ts @@ -667,7 +667,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class RewardEscrow__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/StakingRewards__factory.ts b/sdk/contracts/types/factories/StakingRewards__factory.ts index f83039634d..65087957dd 100644 --- a/sdk/contracts/types/factories/StakingRewards__factory.ts +++ b/sdk/contracts/types/factories/StakingRewards__factory.ts @@ -660,7 +660,7 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, -] as const; +]; export class StakingRewards__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SupplySchedule__factory.ts b/sdk/contracts/types/factories/SupplySchedule__factory.ts index 67e0bbae89..60f63dff88 100644 --- a/sdk/contracts/types/factories/SupplySchedule__factory.ts +++ b/sdk/contracts/types/factories/SupplySchedule__factory.ts @@ -647,7 +647,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class SupplySchedule__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SynthRedeemer__factory.ts b/sdk/contracts/types/factories/SynthRedeemer__factory.ts index d33d0b0dad..11130e62ba 100644 --- a/sdk/contracts/types/factories/SynthRedeemer__factory.ts +++ b/sdk/contracts/types/factories/SynthRedeemer__factory.ts @@ -307,7 +307,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class SynthRedeemer__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SynthSwap__factory.ts b/sdk/contracts/types/factories/SynthSwap__factory.ts index ed9e6d6e7f..3e4e214263 100644 --- a/sdk/contracts/types/factories/SynthSwap__factory.ts +++ b/sdk/contracts/types/factories/SynthSwap__factory.ts @@ -321,7 +321,7 @@ const _abi = [ stateMutability: "payable", type: "receive", }, -] as const; +]; export class SynthSwap__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SynthUtil__factory.ts b/sdk/contracts/types/factories/SynthUtil__factory.ts index 640e7cf4d0..da4f373efe 100644 --- a/sdk/contracts/types/factories/SynthUtil__factory.ts +++ b/sdk/contracts/types/factories/SynthUtil__factory.ts @@ -136,7 +136,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class SynthUtil__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/Synth__factory.ts b/sdk/contracts/types/factories/Synth__factory.ts index 7a9411a1c5..a977738e27 100644 --- a/sdk/contracts/types/factories/Synth__factory.ts +++ b/sdk/contracts/types/factories/Synth__factory.ts @@ -800,7 +800,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class Synth__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/Synthetix__factory.ts b/sdk/contracts/types/factories/Synthetix__factory.ts index 8992e24beb..6431c5ee3b 100644 --- a/sdk/contracts/types/factories/Synthetix__factory.ts +++ b/sdk/contracts/types/factories/Synthetix__factory.ts @@ -1896,7 +1896,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class Synthetix__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SystemSettings__factory.ts b/sdk/contracts/types/factories/SystemSettings__factory.ts index 723fd00b3c..efaa00107e 100644 --- a/sdk/contracts/types/factories/SystemSettings__factory.ts +++ b/sdk/contracts/types/factories/SystemSettings__factory.ts @@ -2130,7 +2130,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class SystemSettings__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/SystemStatus__factory.ts b/sdk/contracts/types/factories/SystemStatus__factory.ts index 55d7c02f4c..ed8008393f 100644 --- a/sdk/contracts/types/factories/SystemStatus__factory.ts +++ b/sdk/contracts/types/factories/SystemStatus__factory.ts @@ -1279,7 +1279,7 @@ const _abi = [ stateMutability: "nonpayable", type: "function", }, -] as const; +]; export class SystemStatus__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/VKwentaRedeemer__factory.ts b/sdk/contracts/types/factories/VKwentaRedeemer__factory.ts index b845b05363..94bf5eadb8 100644 --- a/sdk/contracts/types/factories/VKwentaRedeemer__factory.ts +++ b/sdk/contracts/types/factories/VKwentaRedeemer__factory.ts @@ -78,7 +78,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class VKwentaRedeemer__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/VeKwentaRedeemer__factory.ts b/sdk/contracts/types/factories/VeKwentaRedeemer__factory.ts index 0f70b6c656..06fc8a40bd 100644 --- a/sdk/contracts/types/factories/VeKwentaRedeemer__factory.ts +++ b/sdk/contracts/types/factories/VeKwentaRedeemer__factory.ts @@ -146,7 +146,7 @@ const _abi = [ stateMutability: "view", type: "function", }, -] as const; +]; export class VeKwentaRedeemer__factory { static readonly abi = _abi; diff --git a/sdk/contracts/types/factories/index.ts b/sdk/contracts/types/factories/index.ts index 927b7e03e7..5e7050da8a 100644 --- a/sdk/contracts/types/factories/index.ts +++ b/sdk/contracts/types/factories/index.ts @@ -5,6 +5,7 @@ export { BatchClaimer__factory } from "./BatchClaimer__factory"; export { CrossMarginAccountFactory__factory } from "./CrossMarginAccountFactory__factory"; export { CrossMarginBase__factory } from "./CrossMarginBase__factory"; export { CrossMarginBaseSettings__factory } from "./CrossMarginBaseSettings__factory"; +export { DappMaintenance__factory } from "./DappMaintenance__factory"; export { ERC20__factory } from "./ERC20__factory"; export { ExchangeRates__factory } from "./ExchangeRates__factory"; export { Exchanger__factory } from "./Exchanger__factory"; diff --git a/sdk/contracts/types/index.ts b/sdk/contracts/types/index.ts index b4b40775df..b18e9ba879 100644 --- a/sdk/contracts/types/index.ts +++ b/sdk/contracts/types/index.ts @@ -5,6 +5,7 @@ export type { BatchClaimer } from "./BatchClaimer"; export type { CrossMarginAccountFactory } from "./CrossMarginAccountFactory"; export type { CrossMarginBase } from "./CrossMarginBase"; export type { CrossMarginBaseSettings } from "./CrossMarginBaseSettings"; +export type { DappMaintenance } from "./DappMaintenance"; export type { ERC20 } from "./ERC20"; export type { ExchangeRates } from "./ExchangeRates"; export type { Exchanger } from "./Exchanger"; @@ -37,6 +38,7 @@ export { BatchClaimer__factory } from "./factories/BatchClaimer__factory"; export { CrossMarginAccountFactory__factory } from "./factories/CrossMarginAccountFactory__factory"; export { CrossMarginBase__factory } from "./factories/CrossMarginBase__factory"; export { CrossMarginBaseSettings__factory } from "./factories/CrossMarginBaseSettings__factory"; +export { DappMaintenance__factory } from "./factories/DappMaintenance__factory"; export { ERC20__factory } from "./factories/ERC20__factory"; export { Exchanger__factory } from "./factories/Exchanger__factory"; export { ExchangeRates__factory } from "./factories/ExchangeRates__factory"; diff --git a/sdk/services/futures.ts b/sdk/services/futures.ts index d1d3ede31a..7b06fe066a 100644 --- a/sdk/services/futures.ts +++ b/sdk/services/futures.ts @@ -16,7 +16,7 @@ import { import { Period, PERIOD_IN_HOURS, PERIOD_IN_SECONDS } from 'sdk/constants/period'; import { getContractsByNetwork, getPerpsV2MarketMulticall } from 'sdk/contracts'; import CrossMarginBaseABI from 'sdk/contracts/abis/CrossMarginBase.json'; -import FuturesMarketABI from 'sdk/contracts/abis/FuturesMarket.json'; +import PerpsMarketABI from 'sdk/contracts/abis/PerpsV2Market.json'; import FuturesMarketInternal from 'sdk/contracts/FuturesMarketInternal'; import { CrossMarginBase__factory, @@ -247,7 +247,7 @@ export default class FuturesService { address: string, // Cross margin or EOA address futuresMarkets: { asset: FuturesMarketAsset; marketKey: FuturesMarketKey; address: string }[] ) { - const marketDataContract = this.sdk.context.multicallContracts.FuturesMarketData; + const marketDataContract = this.sdk.context.multicallContracts.PerpsV2MarketData; if (!this.sdk.context.isL2 || !marketDataContract) { throw new Error(UNSUPPORTED_NETWORK); @@ -260,7 +260,7 @@ export default class FuturesService { positionCalls.push( marketDataContract.positionDetailsForMarketKey(formatBytes32String(marketKey), address) ); - const marketContract = new EthCallContract(marketAddress, FuturesMarketABI); + const marketContract = new EthCallContract(marketAddress, PerpsMarketABI); liquidationCalls.push(marketContract.canLiquidate(address)); } @@ -526,6 +526,13 @@ export default class FuturesService { }); } + public async getIsFlagged(account: string, marketAddress: string) { + const market = PerpsV2Market__factory.connect(marketAddress, this.sdk.context.provider); + // TODO: Remove this catch after all markets have been upgraded + const isFlagged = await market.isFlagged(account).catch((_) => null); + return isFlagged; + } + public async getIsolatedTradePreview( marketAddress: string, orderType: ContractOrderType, diff --git a/sdk/types/futures.ts b/sdk/types/futures.ts index 54409ad0d9..b73325205f 100644 --- a/sdk/types/futures.ts +++ b/sdk/types/futures.ts @@ -286,7 +286,7 @@ export type DelayedOrder = { submittedAtTimestamp: number; executableAtTimestamp: number; isOffchain: boolean; - priceImpactDelta: T; + desiredFillPrice: T; targetRoundId: T | null; orderType: FuturesOrderTypeDisplay; side: PositionSide; diff --git a/sdk/utils/futures.ts b/sdk/utils/futures.ts index 6cf5a2590f..07f9b16b4f 100644 --- a/sdk/utils/futures.ts +++ b/sdk/utils/futures.ts @@ -305,7 +305,7 @@ export const formatDelayedOrder = ( const { isOffchain, sizeDelta, - priceImpactDelta, + desiredFillPrice, targetRoundId, commitDeposit, keeperDeposit, @@ -322,7 +322,7 @@ export const formatDelayedOrder = ( submittedAtTimestamp: intentionTime.toNumber() * 1000, executableAtTimestamp: executableAtTime.toNumber() * 1000, isOffchain: isOffchain, - priceImpactDelta: wei(priceImpactDelta), + desiredFillPrice: wei(desiredFillPrice), targetRoundId: wei(targetRoundId), orderType: isOffchain ? 'Delayed Market' : 'Delayed', side: wei(sizeDelta).gt(0) ? PositionSide.LONG : PositionSide.SHORT, diff --git a/sections/exchange/MobileSwap/SwapInfoBox.tsx b/sections/exchange/MobileSwap/SwapInfoBox.tsx index dcc6a1c18b..9fff666b44 100644 --- a/sections/exchange/MobileSwap/SwapInfoBox.tsx +++ b/sections/exchange/MobileSwap/SwapInfoBox.tsx @@ -85,7 +85,6 @@ const FeeRow = () => { const GasPriceRow = () => { const { t } = useTranslation(); - const gasSpeed = useAppSelector(selectGasSpeed); const customGasPrice = useAppSelector(selectGasPrice); const isL2 = useIsL2(); const isMainnet = useIsL1(); diff --git a/sections/futures/MobileTrade/UserTabs/TradesTab.tsx b/sections/futures/MobileTrade/UserTabs/TradesTab.tsx index 3460428389..1a911ea269 100644 --- a/sections/futures/MobileTrade/UserTabs/TradesTab.tsx +++ b/sections/futures/MobileTrade/UserTabs/TradesTab.tsx @@ -20,7 +20,7 @@ import { import { useAppSelector, useFetchAction } from 'state/hooks'; import { FetchStatus } from 'state/types'; import { selectWallet } from 'state/wallet/selectors'; -import { formatCryptoCurrency, suggestedDecimals } from 'utils/formatters/number'; +import { formatCryptoCurrency } from 'utils/formatters/number'; import TradeDrawer from '../drawers/TradeDrawer'; diff --git a/state/futures/actions.ts b/state/futures/actions.ts index 57a25a4249..483372fc70 100644 --- a/state/futures/actions.ts +++ b/state/futures/actions.ts @@ -111,6 +111,8 @@ import { selectCrossMarginBalanceInfo, selectIsolatedMarginOpenOrders, selectPriceImpactOrDesiredFill, + selectIsolatedPriceImpact, + selectDesiredTradeFillPrice, } from './selectors'; import { CancelDelayedOrderInputs, @@ -992,11 +994,19 @@ export const modifyIsolatedPosition = createAsyncThunk< >( 'futures/modifyIsolatedPosition', async ({ sizeDelta, delayed, offchain }, { getState, dispatch, extra: { sdk } }) => { + const account = selectFuturesAccount(getState()); const marketInfo = selectMarketInfo(getState()); - const priceImpact = selectPriceImpactOrDesiredFill(getState()); + const priceImpact = selectIsolatedPriceImpact(getState()); + const desiredFill = selectDesiredTradeFillPrice(getState()); if (!marketInfo) throw new Error('Market info not found'); + if (!account) throw new Error('Account not connected'); try { + const isFlagged = await sdk.futures.getIsFlagged(account, marketInfo.market); + + // TODO: Remove this dynamic logic when the markets are upgraded + const priceImpactOrFill = isFlagged == null ? priceImpact : desiredFill; + dispatch( setTransaction({ status: TransactionStatus.AwaitingExecution, @@ -1007,7 +1017,7 @@ export const modifyIsolatedPosition = createAsyncThunk< const tx = await sdk.futures.modifyIsolatedMarginPosition( marketInfo.market, wei(sizeDelta), - priceImpact, + priceImpactOrFill, { delayed, offchain, diff --git a/state/futures/types.ts b/state/futures/types.ts index 5d285f0135..0899e998e0 100644 --- a/state/futures/types.ts +++ b/state/futures/types.ts @@ -286,7 +286,7 @@ export type DelayedOrderWithDetails = { submittedAtTimestamp: number; executableAtTimestamp: number; isOffchain: boolean; - priceImpactDelta: T; + desiredFillPrice: T; targetRoundId: T | null; orderType: FuturesOrderTypeDisplay; side: PositionSide; diff --git a/utils/futures.ts b/utils/futures.ts index 571acf7e8d..21e6d630fb 100644 --- a/utils/futures.ts +++ b/utils/futures.ts @@ -483,7 +483,7 @@ export const serializeDelayedOrder = ( size: order.size.toString(), commitDeposit: order.commitDeposit.toString(), keeperDeposit: order.keeperDeposit.toString(), - priceImpactDelta: order.priceImpactDelta.toString(), + desiredFillPrice: order.desiredFillPrice.toString(), targetRoundId: order.targetRoundId?.toString() ?? '', }); @@ -498,7 +498,7 @@ export const unserializeDelayedOrder = ( size: wei(order.size), commitDeposit: wei(order.commitDeposit), keeperDeposit: wei(order.keeperDeposit), - priceImpactDelta: wei(order.priceImpactDelta), + desiredFillPrice: wei(order.desiredFillPrice), targetRoundId: wei(order.targetRoundId), });