UNPKG

@quantara/sdk

Version:

JavaScript/TypeScript SDK for interacting with Quantara Protocol on Neura Testnet

1,166 lines (1,165 loc) 34.1 kB
{ "_format": "hh-sol-artifact-1", "contractName": "PositionManager", "sourceName": "contracts/core/PositionManager.sol", "abi": [ { "inputs": [ { "internalType": "address", "name": "_vault", "type": "address" }, { "internalType": "address", "name": "_router", "type": "address" }, { "internalType": "address", "name": "_weth", "type": "address" }, { "internalType": "uint256", "name": "_depositFee", "type": "uint256" }, { "internalType": "address", "name": "_orderBook", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "sizeDelta", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "marginFeeBasisPoints", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "referralCode", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "referrer", "type": "address" } ], "name": "DecreasePositionReferral", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "sizeDelta", "type": "uint256" }, { "indexed": false, "internalType": "uint256", "name": "marginFeeBasisPoints", "type": "uint256" }, { "indexed": false, "internalType": "bytes32", "name": "referralCode", "type": "bytes32" }, { "indexed": false, "internalType": "address", "name": "referrer", "type": "address" } ], "name": "IncreasePositionReferral", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "admin", "type": "address" } ], "name": "SetAdmin", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "depositFee", "type": "uint256" } ], "name": "SetDepositFee", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bool", "name": "inLegacyMode", "type": "bool" } ], "name": "SetInLegacyMode", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint256", "name": "increasePositionBufferBps", "type": "uint256" } ], "name": "SetIncreasePositionBufferBps", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "isActive", "type": "bool" } ], "name": "SetLiquidator", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address[]", "name": "tokens", "type": "address[]" }, { "indexed": false, "internalType": "uint256[]", "name": "longSizes", "type": "uint256[]" }, { "indexed": false, "internalType": "uint256[]", "name": "shortSizes", "type": "uint256[]" } ], "name": "SetMaxGlobalSizes", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "isActive", "type": "bool" } ], "name": "SetOrderKeeper", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "account", "type": "address" }, { "indexed": false, "internalType": "bool", "name": "isActive", "type": "bool" } ], "name": "SetPartner", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "referralStorage", "type": "address" } ], "name": "SetReferralStorage", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "bool", "name": "shouldValidateIncreaseOrder", "type": "bool" } ], "name": "SetShouldValidateIncreaseOrder", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "address", "name": "token", "type": "address" }, { "indexed": false, "internalType": "address", "name": "receiver", "type": "address" }, { "indexed": false, "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "WithdrawFees", "type": "event" }, { "inputs": [], "name": "BASIS_POINTS_DIVISOR", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "admin", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_spender", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "approve", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_collateralToken", "type": "address" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_collateralDelta", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "address", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_price", "type": "uint256" } ], "name": "decreasePosition", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "_path", "type": "address[]" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_collateralDelta", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "address", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_price", "type": "uint256" }, { "internalType": "uint256", "name": "_minOut", "type": "uint256" } ], "name": "decreasePositionAndSwap", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "_path", "type": "address[]" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_collateralDelta", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "address payable", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_price", "type": "uint256" }, { "internalType": "uint256", "name": "_minOut", "type": "uint256" } ], "name": "decreasePositionAndSwapETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_collateralToken", "type": "address" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_collateralDelta", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "address payable", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_price", "type": "uint256" } ], "name": "decreasePositionETH", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "depositFee", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_orderIndex", "type": "uint256" }, { "internalType": "address payable", "name": "_feeReceiver", "type": "address" } ], "name": "executeDecreaseOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_orderIndex", "type": "uint256" }, { "internalType": "address payable", "name": "_feeReceiver", "type": "address" } ], "name": "executeIncreaseOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "uint256", "name": "_orderIndex", "type": "uint256" }, { "internalType": "address payable", "name": "_feeReceiver", "type": "address" } ], "name": "executeSwapOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "feeReserves", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "gov", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "inLegacyMode", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "_path", "type": "address[]" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "_minOut", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "uint256", "name": "_price", "type": "uint256" } ], "name": "increasePosition", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "increasePositionBufferBps", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "_path", "type": "address[]" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "uint256", "name": "_minOut", "type": "uint256" }, { "internalType": "uint256", "name": "_sizeDelta", "type": "uint256" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "uint256", "name": "_price", "type": "uint256" } ], "name": "increasePositionETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "isLiquidator", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "isOrderKeeper", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "isPartner", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "address", "name": "_collateralToken", "type": "address" }, { "internalType": "address", "name": "_indexToken", "type": "address" }, { "internalType": "bool", "name": "_isLong", "type": "bool" }, { "internalType": "address", "name": "_feeReceiver", "type": "address" } ], "name": "liquidatePosition", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "maxGlobalLongSizes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "", "type": "address" } ], "name": "maxGlobalShortSizes", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "orderBook", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "referralStorage", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "router", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address payable", "name": "_receiver", "type": "address" }, { "internalType": "uint256", "name": "_amount", "type": "uint256" } ], "name": "sendValue", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_admin", "type": "address" } ], "name": "setAdmin", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_depositFee", "type": "uint256" } ], "name": "setDepositFee", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_gov", "type": "address" } ], "name": "setGov", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bool", "name": "_inLegacyMode", "type": "bool" } ], "name": "setInLegacyMode", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "uint256", "name": "_increasePositionBufferBps", "type": "uint256" } ], "name": "setIncreasePositionBufferBps", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "bool", "name": "_isActive", "type": "bool" } ], "name": "setLiquidator", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address[]", "name": "_tokens", "type": "address[]" }, { "internalType": "uint256[]", "name": "_longSizes", "type": "uint256[]" }, { "internalType": "uint256[]", "name": "_shortSizes", "type": "uint256[]" } ], "name": "setMaxGlobalSizes", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "bool", "name": "_isActive", "type": "bool" } ], "name": "setOrderKeeper", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_account", "type": "address" }, { "internalType": "bool", "name": "_isActive", "type": "bool" } ], "name": "setPartner", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_referralStorage", "type": "address" } ], "name": "setReferralStorage", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [ { "internalType": "bool", "name": "_shouldValidateIncreaseOrder", "type": "bool" } ], "name": "setShouldValidateIncreaseOrder", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "shouldValidateIncreaseOrder", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "vault", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "weth", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "_token", "type": "address" }, { "internalType": "address", "name": "_receiver", "type": "address" } ], "name": "withdrawFees", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ], "linkReferences": {}, "deployedLinkReferences": {} }