{
    "contractName": "P1Orders",
    "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 P1Orders.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 P1Orders.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 P1Orders.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 P1Orders.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 P1Orders.OrderStatus",
                            "name": "status",
                            "type": "uint8"
                        },
                        {
                            "internalType": "uint256",
                            "name": "filledAmount",
                            "type": "uint256"
                        }
                    ],
                    "internalType": "struct P1Orders.OrderQueryOutput[]",
                    "name": "",
                    "type": "tuple[]"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        }
    ],
    "networks": {
        "PBTC-USDC": {
            "1": {
                "links": {},
                "address": "0x3ea6F88eC8F7b24Bb3Ad206fa80124210e8e28F3",
                "transactionHash": "0xc7ba3cbde3a89f4a34e0f7a323ffb6439a86e2431c3011d0a01ce5aebd7b5d66"
            }
        },
        "PLINK-USDC": {
            "1": {
                "links": {},
                "address": "0xaC14B70adBf42bedE4E4c7Ef67E8CB618b0D4506",
                "transactionHash": "0x233dcd04401b7d70d0f21ae0d5f785f92bb6e6f2a93abfb0abd8ba327b9d55d2"
            }
        },
        "WETH-PUSD": {}
    }
}