[
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_priceFeed",
                "type": "address"
            },
            {
                "internalType": "address",
                "name": "_clearingHouse",
                "type": "address"
            },
            {
                "internalType": "address",
                "name": "_poolFactory",
                "type": "address"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "constructor"
    },
    {
        "inputs": [],
        "name": "AlreadyInitialized",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "BAD_DEBT",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "FUNDING_INTERVAL_NOT_PASSED",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "INACTIVE",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "INSUFFICIENT_MARGIN",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "INVALID_FUNDING_PERIOD",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "INVALID_RATIO",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "INVALID_WEIGHT",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "LEVERAGE_TOO_HIGH",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "LIQUIDATABLE",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NOT_ACTIVE_POOL",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NOT_CLEARING_HOUSE",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NOT_LIQUIDATABLE",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NOT_LP",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NOT_POSITION_MANAGER",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NO_POOL_IN_RANGE",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NewOwnerIsZeroAddress",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "NoHandoverRequest",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "POOL_ALREADY_SET",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "PRICE_OVER_FLUCTUATION_LIMIT",
        "type": "error"
    },
    {
        "inputs": [],
        "name": "Unauthorized",
        "type": "error"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "newAMMFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "AMMFeeRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [],
        "name": "Activated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "contract IPool",
                "name": "newPool",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "newIndex",
                "type": "uint256"
            }
        ],
        "name": "ActivePoolChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "newFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "BaseFeeRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "maxSize",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "openInterestNotionalCap",
                "type": "uint256"
            }
        ],
        "name": "CapChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [],
        "name": "Deactivated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "ratio",
                "type": "uint256"
            }
        ],
        "name": "FluctuationLimitRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "fundingPeriod",
                "type": "uint256"
            }
        ],
        "name": "FundingPeriodChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "int256",
                "name": "fundingRate",
                "type": "int256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "price",
                "type": "uint256"
            }
        ],
        "name": "FundingRateUpdated",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "ratio",
                "type": "uint256"
            }
        ],
        "name": "InitMarginRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint8",
                "name": "version",
                "type": "uint8"
            }
        ],
        "name": "Initialized",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "newKeeperFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "KeeperFeeRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "newLiquidatorFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "LimitMakerFeeRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "ratio",
                "type": "uint256"
            }
        ],
        "name": "LiquidationFeeRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "maker",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "addedMargin",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "addedNotional",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256[]",
                "name": "poolsIds",
                "type": "uint256[]"
            }
        ],
        "name": "LiquidityAdded",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "maker",
                "type": "address"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "removedMargin",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "removedNotional",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256[]",
                "name": "poolIds",
                "type": "uint256[]"
            }
        ],
        "name": "LiquidityRemoved",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "ratio",
                "type": "uint256"
            }
        ],
        "name": "MaintenanceMarginRatioChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "maxSize",
                "type": "uint256"
            }
        ],
        "name": "MaxSizeSet",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "contract IPool",
                "name": "pool",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "uint256",
                "name": "id",
                "type": "uint256"
            }
        ],
        "name": "NewPool",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "markPrice",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "timestamp",
                "type": "uint256"
            }
        ],
        "name": "NewPriceSnapshot",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "openInterestCap",
                "type": "uint256"
            }
        ],
        "name": "OpenInterestCapSet",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "pendingOwner",
                "type": "address"
            }
        ],
        "name": "OwnershipHandoverCanceled",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "pendingOwner",
                "type": "address"
            }
        ],
        "name": "OwnershipHandoverRequested",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": true,
                "internalType": "address",
                "name": "oldOwner",
                "type": "address"
            },
            {
                "indexed": true,
                "internalType": "address",
                "name": "newOwner",
                "type": "address"
            }
        ],
        "name": "OwnershipTransferred",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "address",
                "name": "newPoolLogic",
                "type": "address"
            }
        ],
        "name": "PoolLogicContractChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "markPriceWeight",
                "type": "uint256"
            },
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "indexPriceWeight",
                "type": "uint256"
            }
        ],
        "name": "PriceWeightsChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "tickSpacing",
                "type": "uint256"
            }
        ],
        "name": "TickSpacingChanged",
        "type": "event"
    },
    {
        "anonymous": false,
        "inputs": [
            {
                "indexed": false,
                "internalType": "uint256",
                "name": "twapInterval",
                "type": "uint256"
            }
        ],
        "name": "TwapIntervalChanged",
        "type": "event"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            },
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "index",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "margin",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "leverage",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct LiquidityAddData[]",
                "name": "liquidityAddData",
                "type": "tuple[]"
            }
        ],
        "name": "addLiquidity",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "contract IPool",
                        "name": "pool",
                        "type": "address"
                    },
                    {
                        "internalType": "uint256",
                        "name": "shares",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "quote",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "base",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct LiquidityAddReturnData[]",
                "name": "returnData",
                "type": "tuple[]"
            },
            {
                "internalType": "uint256",
                "name": "marginAdded",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "cancelOwnershipHandover",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "clearingHouse",
        "outputs": [
            {
                "internalType": "address",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "pendingOwner",
                "type": "address"
            }
        ],
        "name": "completeOwnershipHandover",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getAMMFee",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getActiveIndex",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getActivePool",
        "outputs": [
            {
                "internalType": "contract IPool",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getBaseFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "targetPrice",
                "type": "uint256"
            }
        ],
        "name": "getBaseToFill",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfQuote",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "quoteAmount",
                "type": "uint256"
            }
        ],
        "name": "getBaseValue",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getFeeRatios",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "baseFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "ammFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "limitMakerFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "keeperFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "liquidationFeeRatio",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct FeeRatios",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getFluctuationLimitRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getFullMakerImpermanentPosition",
        "outputs": [
            {
                "internalType": "int256",
                "name": "size",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "openNotional",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getFundingPeriod",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getFundingRate",
        "outputs": [
            {
                "internalType": "int256",
                "name": "",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getIndexPrice",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getLastSettledFundingTime",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getLiquidationFeeRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getLiquidationPrice",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            },
            {
                "internalType": "uint256[]",
                "name": "poolIndexes",
                "type": "uint256[]"
            }
        ],
        "name": "getMakerImpermanentPosition",
        "outputs": [
            {
                "internalType": "int256",
                "name": "size",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "openNotional",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getMakerPools",
        "outputs": [
            {
                "internalType": "contract IPool[]",
                "name": "",
                "type": "address[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getMakerPositionData",
        "outputs": [
            {
                "internalType": "int256",
                "name": "size",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "openNotional",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "margin",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "pendingFees",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "pendingFundingPayment",
                "type": "int256"
            },
            {
                "components": [
                    {
                        "internalType": "contract IPool",
                        "name": "pool",
                        "type": "address"
                    },
                    {
                        "internalType": "uint256",
                        "name": "shares",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "quote",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "base",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct PoolPosition[]",
                "name": "poolInfo",
                "type": "tuple[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getMakerProfile",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "margin",
                        "type": "uint256"
                    },
                    {
                        "internalType": "contract IPool[]",
                        "name": "pools",
                        "type": "address[]"
                    }
                ],
                "internalType": "struct MakerProfile",
                "name": "",
                "type": "tuple"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getMarginRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getMarkPrice",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfBase",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "baseAmount",
                "type": "uint256"
            }
        ],
        "name": "getMarkPriceAfterClose",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "markPriceAfter",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfQuote",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "quoteAmount",
                "type": "uint256"
            }
        ],
        "name": "getMarkPriceAfterOpen",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "markPriceAfter",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "interval",
                "type": "uint256"
            }
        ],
        "name": "getMarkTwap",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getMaxSize",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getNextFundingTime",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getOpenInterestCap",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getOpenMarginRatio",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getPendingMakerFees",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "totalFees",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "getPendingMakerFundingPayment",
        "outputs": [
            {
                "internalType": "int256",
                "name": "fundingPayment",
                "type": "int256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_index",
                "type": "uint256"
            }
        ],
        "name": "getPool",
        "outputs": [
            {
                "internalType": "contract IPool",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getPoolsInRange",
        "outputs": [
            {
                "internalType": "contract IPool[]",
                "name": "",
                "type": "address[]"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getPriceWeights",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "markWeight",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "indexWeight",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "targetPrice",
                "type": "uint256"
            }
        ],
        "name": "getQuoteToFill",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfBase",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "baseAmount",
                "type": "uint256"
            }
        ],
        "name": "getQuoteValue",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getReserves",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "quoteReserve",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "baseReserve",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getTickSpacing",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "getTwapInterval",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "components": [
                    {
                        "internalType": "address",
                        "name": "owner",
                        "type": "address"
                    },
                    {
                        "internalType": "uint256",
                        "name": "fundingPeriod",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "tradeLimitRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "fluctuationLimitRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "openMarginRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "maintenanceMarginRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "maxSizeCap",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "openInterestCap",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "indexPriceWeight",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "twapInterval",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "baseFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "ammFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "limitMakerFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "keeperFeeRatio",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "liquidatorFeeRatio",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct AMMParams",
                "name": "params",
                "type": "tuple"
            }
        ],
        "name": "initialize",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "isActive",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "isMakerLiquidatable",
        "outputs": [
            {
                "internalType": "bool",
                "name": "",
                "type": "bool"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            }
        ],
        "name": "liquidateMaker",
        "outputs": [
            {
                "internalType": "int256",
                "name": "size",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "openNotional",
                "type": "uint256"
            },
            {
                "internalType": "int256",
                "name": "margin",
                "type": "int256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "owner",
        "outputs": [
            {
                "internalType": "address",
                "name": "result",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "pendingOwner",
                "type": "address"
            }
        ],
        "name": "ownershipHandoverExpiresAt",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "result",
                "type": "uint256"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "poolFactory",
        "outputs": [
            {
                "internalType": "contract IPoolFactory",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "priceFeed",
        "outputs": [
            {
                "internalType": "contract IPriceFeed",
                "name": "",
                "type": "address"
            }
        ],
        "stateMutability": "view",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "maker",
                "type": "address"
            },
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "index",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "shares",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct LiquidityRemoveData[]",
                "name": "liquidityRemoveData",
                "type": "tuple[]"
            }
        ],
        "name": "removeLiquidity",
        "outputs": [
            {
                "internalType": "int256",
                "name": "size",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "openNotional",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "marginRemoved",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "renounceOwnership",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "requestOwnershipHandover",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_ammFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "setAMMFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "bool",
                "name": "_active",
                "type": "bool"
            }
        ],
        "name": "setActive",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_baseFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "setBaseFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_fluctuationLimitRatio",
                "type": "uint256"
            }
        ],
        "name": "setFluctuationLimitRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_fundingPeriod",
                "type": "uint256"
            }
        ],
        "name": "setFundingPeriod",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_indexPriceWeight",
                "type": "uint256"
            }
        ],
        "name": "setIndexPriceWeight",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_initMarginRatio",
                "type": "uint256"
            }
        ],
        "name": "setInitMarginRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_keeperFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "setKeeperFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_limitMakerFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "setLimitMakerFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_liquidationFeeRatio",
                "type": "uint256"
            }
        ],
        "name": "setLiquidationFeeRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_maintenanceMarginRatio",
                "type": "uint256"
            }
        ],
        "name": "setMaintenanceMarginRatio",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_maxSize",
                "type": "uint256"
            }
        ],
        "name": "setMaxSize",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_openInterestNotionalCap",
                "type": "uint256"
            }
        ],
        "name": "setOpenInterestCap",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "_poolLogic",
                "type": "address"
            }
        ],
        "name": "setPoolLogicContract",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "id",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "upperBound",
                        "type": "uint256"
                    },
                    {
                        "internalType": "uint256",
                        "name": "lowerBound",
                        "type": "uint256"
                    }
                ],
                "internalType": "struct PoolParams[]",
                "name": "poolsToSet",
                "type": "tuple[]"
            },
            {
                "internalType": "uint256",
                "name": "activeID",
                "type": "uint256"
            }
        ],
        "name": "setPools",
        "outputs": [
            {
                "components": [
                    {
                        "internalType": "uint256",
                        "name": "id",
                        "type": "uint256"
                    },
                    {
                        "internalType": "contract IPool",
                        "name": "pool",
                        "type": "address"
                    }
                ],
                "internalType": "struct Pool[]",
                "name": "poolsCreated",
                "type": "tuple[]"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "spacing",
                "type": "uint256"
            }
        ],
        "name": "setTickSpacing",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "uint256",
                "name": "_twapInterval",
                "type": "uint256"
            }
        ],
        "name": "setTwapInterval",
        "outputs": [],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [],
        "name": "settleFunding",
        "outputs": [
            {
                "internalType": "int256",
                "name": "premiumFraction",
                "type": "int256"
            },
            {
                "internalType": "uint256",
                "name": "mark",
                "type": "uint256"
            },
            {
                "internalType": "uint256",
                "name": "indexPrice",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfBase",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "baseAmount",
                "type": "uint256"
            }
        ],
        "name": "swapClose",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "quoteAmount",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "enum Dir",
                "name": "dirOfQuote",
                "type": "uint8"
            },
            {
                "internalType": "uint256",
                "name": "quoteAmount",
                "type": "uint256"
            }
        ],
        "name": "swapOpen",
        "outputs": [
            {
                "internalType": "uint256",
                "name": "baseAmount",
                "type": "uint256"
            }
        ],
        "stateMutability": "nonpayable",
        "type": "function"
    },
    {
        "inputs": [
            {
                "internalType": "address",
                "name": "newOwner",
                "type": "address"
            }
        ],
        "name": "transferOwnership",
        "outputs": [],
        "stateMutability": "payable",
        "type": "function"
    }
]
