{
    "contractName": "P1InverseOrders",
    "abi": [
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "perpetualV1",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "chainId",
                    "type": "uint256"
                }
            ],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "constructor"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "maker",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "bytes32",
                    "name": "orderHash",
                    "type": "bytes32"
                }
            ],
            "name": "LogOrderApproved",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "maker",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "bytes32",
                    "name": "orderHash",
                    "type": "bytes32"
                }
            ],
            "name": "LogOrderCanceled",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "bytes32",
                    "name": "orderHash",
                    "type": "bytes32"
                },
                {
                    "indexed": false,
                    "internalType": "bytes32",
                    "name": "flags",
                    "type": "bytes32"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "triggerPrice",
                    "type": "uint256"
                },
                {
                    "components": [
                        {
                            "internalType": "uint256",
                            "name": "amount",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "price",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "fee",
                            "type": "uint256"
                        },
                        {
                            "internalType": "bool",
                            "name": "isNegativeFee",
                            "type": "bool"
                        }
                    ],
                    "indexed": false,
                    "internalType": "struct P1InverseOrders.Fill",
                    "name": "fill",
                    "type": "tuple"
                }
            ],
            "name": "LogOrderFilled",
            "type": "event"
        },
        {
            "constant": true,
            "inputs": [],
            "name": "_EIP712_DOMAIN_HASH_",
            "outputs": [
                {
                    "internalType": "bytes32",
                    "name": "",
                    "type": "bytes32"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "internalType": "bytes32",
                    "name": "",
                    "type": "bytes32"
                }
            ],
            "name": "_FILLED_AMOUNT_",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [],
            "name": "_PERPETUAL_V1_",
            "outputs": [
                {
                    "internalType": "address",
                    "name": "",
                    "type": "address"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "internalType": "bytes32",
                    "name": "",
                    "type": "bytes32"
                }
            ],
            "name": "_STATUS_",
            "outputs": [
                {
                    "internalType": "enum P1InverseOrders.OrderStatus",
                    "name": "",
                    "type": "uint8"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "internalType": "address",
                    "name": "sender",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "maker",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "taker",
                    "type": "address"
                },
                {
                    "internalType": "uint256",
                    "name": "price",
                    "type": "uint256"
                },
                {
                    "internalType": "bytes",
                    "name": "data",
                    "type": "bytes"
                },
                {
                    "internalType": "bytes32",
                    "name": "",
                    "type": "bytes32"
                }
            ],
            "name": "trade",
            "outputs": [
                {
                    "components": [
                        {
                            "internalType": "uint256",
                            "name": "marginAmount",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "positionAmount",
                            "type": "uint256"
                        },
                        {
                            "internalType": "bool",
                            "name": "isBuy",
                            "type": "bool"
                        },
                        {
                            "internalType": "bytes32",
                            "name": "traderFlags",
                            "type": "bytes32"
                        }
                    ],
                    "internalType": "struct P1Types.TradeResult",
                    "name": "",
                    "type": "tuple"
                }
            ],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "components": [
                        {
                            "internalType": "bytes32",
                            "name": "flags",
                            "type": "bytes32"
                        },
                        {
                            "internalType": "uint256",
                            "name": "amount",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "limitPrice",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "triggerPrice",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "limitFee",
                            "type": "uint256"
                        },
                        {
                            "internalType": "address",
                            "name": "maker",
                            "type": "address"
                        },
                        {
                            "internalType": "address",
                            "name": "taker",
                            "type": "address"
                        },
                        {
                            "internalType": "uint256",
                            "name": "expiration",
                            "type": "uint256"
                        }
                    ],
                    "internalType": "struct P1InverseOrders.Order",
                    "name": "order",
                    "type": "tuple"
                }
            ],
            "name": "approveOrder",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "components": [
                        {
                            "internalType": "bytes32",
                            "name": "flags",
                            "type": "bytes32"
                        },
                        {
                            "internalType": "uint256",
                            "name": "amount",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "limitPrice",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "triggerPrice",
                            "type": "uint256"
                        },
                        {
                            "internalType": "uint256",
                            "name": "limitFee",
                            "type": "uint256"
                        },
                        {
                            "internalType": "address",
                            "name": "maker",
                            "type": "address"
                        },
                        {
                            "internalType": "address",
                            "name": "taker",
                            "type": "address"
                        },
                        {
                            "internalType": "uint256",
                            "name": "expiration",
                            "type": "uint256"
                        }
                    ],
                    "internalType": "struct P1InverseOrders.Order",
                    "name": "order",
                    "type": "tuple"
                }
            ],
            "name": "cancelOrder",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "internalType": "bytes32[]",
                    "name": "orderHashes",
                    "type": "bytes32[]"
                }
            ],
            "name": "getOrdersStatus",
            "outputs": [
                {
                    "components": [
                        {
                            "internalType": "enum P1InverseOrders.OrderStatus",
                            "name": "status",
                            "type": "uint8"
                        },
                        {
                            "internalType": "uint256",
                            "name": "filledAmount",
                            "type": "uint256"
                        }
                    ],
                    "internalType": "struct P1InverseOrders.OrderQueryOutput[]",
                    "name": "",
                    "type": "tuple[]"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        }
    ],
    "networks": {
        "WETH-PUSD": {
            "1": {
                "links": {},
                "address": "0x1d3ccceEE6d9f9c3b79ed5fAdD98E32B5d48b22E",
                "transactionHash": "0x16eed01238b1cb21dd3b7d262af31a575df9bf3e70fa0aa24aaf5e9b5c09318e"
            }
        },
        "PBTC-USDC": {},
        "PLINK-USDC": {}
    }
}