{
    "contractName": "P1Deleveraging",
    "abi": [
        {
            "inputs": [
                {
                    "internalType": "address",
                    "name": "perpetualV1",
                    "type": "address"
                },
                {
                    "internalType": "address",
                    "name": "deleveragingOperator",
                    "type": "address"
                }
            ],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "constructor"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "maker",
                    "type": "address"
                },
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "taker",
                    "type": "address"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "amount",
                    "type": "uint256"
                },
                {
                    "indexed": false,
                    "internalType": "bool",
                    "name": "isBuy",
                    "type": "bool"
                },
                {
                    "indexed": false,
                    "internalType": "uint256",
                    "name": "oraclePrice",
                    "type": "uint256"
                }
            ],
            "name": "LogDeleveraged",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": false,
                    "internalType": "address",
                    "name": "deleveragingOperator",
                    "type": "address"
                }
            ],
            "name": "LogDeleveragingOperatorSet",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "account",
                    "type": "address"
                }
            ],
            "name": "LogMarkedForDeleveraging",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "account",
                    "type": "address"
                }
            ],
            "name": "LogUnmarkedForDeleveraging",
            "type": "event"
        },
        {
            "anonymous": false,
            "inputs": [
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "previousOwner",
                    "type": "address"
                },
                {
                    "indexed": true,
                    "internalType": "address",
                    "name": "newOwner",
                    "type": "address"
                }
            ],
            "name": "OwnershipTransferred",
            "type": "event"
        },
        {
            "constant": true,
            "inputs": [],
            "name": "DELEVERAGING_TIMELOCK_S",
            "outputs": [
                {
                    "internalType": "uint256",
                    "name": "",
                    "type": "uint256"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [],
            "name": "_DELEVERAGING_OPERATOR_",
            "outputs": [
                {
                    "internalType": "address",
                    "name": "",
                    "type": "address"
                }
            ],
            "payable": false,
            "stateMutability": "view",
            "type": "function"
        },
        {
            "constant": true,
            "inputs": [
                {
                    "internalType": "address",
                    "name": "",
                    "type": "address"
                }
            ],
            "name": "_MARKED_TIMESTAMP_",
            "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": [],
            "name": "isOwner",
            "outputs": [
                {
                    "internalType": "bool",
                    "name": "",
                    "type": "bool"
                }
            ],
            "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": [],
            "name": "renounceOwnership",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "internalType": "address",
                    "name": "newOwner",
                    "type": "address"
                }
            ],
            "name": "transferOwnership",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "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": "traderFlags",
                    "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": [
                {
                    "internalType": "address",
                    "name": "account",
                    "type": "address"
                }
            ],
            "name": "mark",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "internalType": "address",
                    "name": "account",
                    "type": "address"
                }
            ],
            "name": "unmark",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        },
        {
            "constant": false,
            "inputs": [
                {
                    "internalType": "address",
                    "name": "newOperator",
                    "type": "address"
                }
            ],
            "name": "setDeleveragingOperator",
            "outputs": [],
            "payable": false,
            "stateMutability": "nonpayable",
            "type": "function"
        }
    ],
    "networks": {
        "PBTC-USDC": {
            "1": {
                "links": {},
                "address": "0xa4e4A9ae84882BE5049E450A3500ba1CD012F0C5",
                "transactionHash": "0xfbbd02bccef8f30c6e60edfd8323b30e76e24d2ec8e52213d8393f433d616b00"
            }
        },
        "PLINK-USDC": {
            "1": {
                "links": {},
                "address": "0x5f428e427096D5085D8d95D64d90f3e7c13C92Fb",
                "transactionHash": "0x8e74ca4d6044af90143ef7bd8fde5f0e10f8964b73ff940828eecc45f8f7d251"
            }
        },
        "WETH-PUSD": {
            "1": {
                "links": {},
                "address": "0xb9689e3F25c16173a552a7ac0dD5c1F6D47FCC88",
                "transactionHash": "0xc477fee2f71b4350c1409f867f06908315c8be14f767e65f24406d220ab1fb76"
            }
        }
    }
}