[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "trustedForwarder",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "authority",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "cancelOrder",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IOrdersManager.CancelOrderParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "orderId",
            "type": "uint40",
            "internalType": "RestingOrderId"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "cancelOrders",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "orderIds",
        "type": "uint40[]",
        "internalType": "RestingOrderId[]"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "crossTakeover",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "ensureMarketUnlocked",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "executeADL",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsRiskManagement.ADLParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "account",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "counterparties",
            "type": "tuple[]",
            "internalType": "struct IPerpsRiskManagement.ADLCounterparty[]",
            "components": [
              {
                "name": "account",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "size",
                "type": "uint128",
                "internalType": "uint128"
              }
            ]
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "executeVaultOtc",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "makerAccount",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "takerAccount",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "side",
        "type": "uint8",
        "internalType": "enum IOrdersManager.OrderSide"
      },
      {
        "name": "size",
        "type": "uint128",
        "internalType": "uint128"
      },
      {
        "name": "price",
        "type": "uint128",
        "internalType": "uint128"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "getActiveCrossMarkets",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256[]",
        "internalType": "uint256[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getActiveIsolatedMarkets",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256[]",
        "internalType": "uint256[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getActiveMarkets",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256[]",
        "internalType": "uint256[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getCollateralManager",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract ICollateralManager"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getCrossMarginBalance",
    "inputs": [
      {
        "name": "totalTokenBalanceInUSD",
        "type": "int256",
        "internalType": "int256"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "int256",
        "internalType": "int256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getFeeManager",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IFeeManager"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getFreeCrossMarginBalance",
    "inputs": [
      {
        "name": "totalTokenBalanceInUSD",
        "type": "int256",
        "internalType": "int256"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getFundingRate",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IFundingRate"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getLeverage",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint128",
        "internalType": "uint128"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getMarketConfig",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
        "components": [
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "quote",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "unlocked",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "maxLeverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "maintenanceMarginFactor",
            "type": "uint80",
            "internalType": "uint80"
          },
          {
            "name": "minOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "maxOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "oiLimitSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "stepSize",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "stepPrice",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getOpenInterest",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getOpenInterestUpperBound",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getOpenOrders",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "startIndex",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint40[]",
        "internalType": "RestingOrderId[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getOrdersManager",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IOrdersManager"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getPosition",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct IPerpsAccount.Position",
        "components": [
          {
            "name": "size",
            "type": "int128",
            "internalType": "int128"
          },
          {
            "name": "quoteAmount",
            "type": "int128",
            "internalType": "int128"
          },
          {
            "name": "lastFundingPayment",
            "type": "int128",
            "internalType": "int128"
          },
          {
            "name": "leverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "marginMode",
            "type": "uint8",
            "internalType": "enum IPerpsAccount.MarginMode"
          },
          {
            "name": "isolatedUsdcBalance",
            "type": "uint112",
            "internalType": "uint112"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getProjectedRealizedPnl",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "int256",
        "internalType": "int256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getRisexAuthorization",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IRISExAuthorization"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getRisexOracle",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IRISExOracle"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalCrossFundingFee",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "int256",
        "internalType": "int256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalCrossInitialMargin",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalCrossMaintenanceMargin",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalCrossUnsettledUsdc",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "int256",
        "internalType": "int256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalIsolatedMarginUsage",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalMarginAccountableOrderNotional",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalMarginAccountableOrderUnfilledSize",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalMarkets",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getTotalOpenOrders",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "authority",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "_fundingRate",
        "type": "address",
        "internalType": "contract IFundingRate"
      },
      {
        "name": "_feeManager",
        "type": "address",
        "internalType": "contract IFeeManager"
      },
      {
        "name": "_risexAuthorization",
        "type": "address",
        "internalType": "contract IRISExAuthorization"
      },
      {
        "name": "_collateralManager",
        "type": "address",
        "internalType": "contract ICollateralManager"
      },
      {
        "name": "_ordersManager",
        "type": "address",
        "internalType": "contract IOrdersManager"
      },
      {
        "name": "_risexOracle",
        "type": "address",
        "internalType": "contract IRISExOracle"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "isAllowed",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isConsumingScheduledOp",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isTrustedForwarder",
    "inputs": [
      {
        "name": "forwarder",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "isolatedTakeover",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "liquidate",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsRiskManagement.LiquidateParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "account",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "expectedPrice",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "expectedSize",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "positionSide",
            "type": "uint8",
            "internalType": "enum IOrdersManager.OrderSide"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "migrateAccount",
    "inputs": [
      {
        "name": "newAccount",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "onAddToBook",
    "inputs": [
      {
        "name": "orderId",
        "type": "uint40",
        "internalType": "RestingOrderId"
      },
      {
        "name": "unfilledSize",
        "type": "uint128",
        "internalType": "uint128"
      },
      {
        "name": "orderPrice",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "onMatch",
    "inputs": [
      {
        "name": "makerCtx",
        "type": "tuple",
        "internalType": "struct IOrderBookHooks.MakerContext",
        "components": [
          {
            "name": "makerOrderId",
            "type": "uint40",
            "internalType": "RestingOrderId"
          },
          {
            "name": "matchedSize",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "matchedQuoteAmount",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "tick",
            "type": "uint24",
            "internalType": "Tick"
          },
          {
            "name": "makerFeeBps",
            "type": "int16",
            "internalType": "int16"
          },
          {
            "name": "makerBuilderFeeBps",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "makerFullyFilled",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "makerBuilderId",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "onRemoveFromBook",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "orderId",
        "type": "uint40",
        "internalType": "RestingOrderId"
      },
      {
        "name": "unfilledSize",
        "type": "uint128",
        "internalType": "uint128"
      },
      {
        "name": "orderPrice",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "onSettleMakerChunk",
    "inputs": [
      {
        "name": "chunkCtx",
        "type": "tuple",
        "internalType": "struct IOrderBookHooks.MakerChunkContext",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "makerOrderId",
            "type": "uint40",
            "internalType": "RestingOrderId"
          },
          {
            "name": "claimSize",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "claimQuoteAmount",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "tick",
            "type": "uint24",
            "internalType": "Tick"
          },
          {
            "name": "makerFeeBps",
            "type": "int16",
            "internalType": "int16"
          },
          {
            "name": "takerFeeBps",
            "type": "int16",
            "internalType": "int16"
          },
          {
            "name": "makerBuilderFeeBps",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "makerBuilderId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "matchSeq",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "fundingSnapshotX128",
            "type": "int128",
            "internalType": "int128"
          },
          {
            "name": "makerFullyClaimed",
            "type": "bool",
            "internalType": "bool"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "onTakeLevel",
    "inputs": [
      {
        "name": "takeCtx",
        "type": "tuple",
        "internalType": "struct IOrderBookHooks.TakeLevelContext",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "matchedSize",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "matchedQuoteAmount",
            "type": "uint128",
            "internalType": "uint128"
          },
          {
            "name": "tick",
            "type": "uint24",
            "internalType": "Tick"
          },
          {
            "name": "matchSeq",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "openMarket",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsMarketConfig.OpenMarketParams",
        "components": [
          {
            "name": "perpsConfig",
            "type": "tuple",
            "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
            "components": [
              {
                "name": "name",
                "type": "string",
                "internalType": "string"
              },
              {
                "name": "quote",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "unlocked",
                "type": "bool",
                "internalType": "bool"
              },
              {
                "name": "maxLeverage",
                "type": "uint8",
                "internalType": "uint8"
              },
              {
                "name": "maintenanceMarginFactor",
                "type": "uint80",
                "internalType": "uint80"
              },
              {
                "name": "minOrderStep",
                "type": "uint32",
                "internalType": "uint32"
              },
              {
                "name": "maxOrderStep",
                "type": "uint32",
                "internalType": "uint32"
              },
              {
                "name": "oiLimitSteps",
                "type": "uint32",
                "internalType": "uint32"
              },
              {
                "name": "stepSize",
                "type": "uint64",
                "internalType": "uint64"
              },
              {
                "name": "stepPrice",
                "type": "uint64",
                "internalType": "uint64"
              }
            ]
          },
          {
            "name": "bookConfig",
            "type": "tuple",
            "internalType": "struct IOrdersManager.Config",
            "components": [
              {
                "name": "stepSize",
                "type": "uint64",
                "internalType": "uint64"
              },
              {
                "name": "stepPrice",
                "type": "uint64",
                "internalType": "uint64"
              }
            ]
          },
          {
            "name": "markPriceId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "indexPriceId",
            "type": "bytes32",
            "internalType": "bytes32"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "pause",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "pauseFunction",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "paused",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "pausedFunction",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "placeOrder",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IOrdersManager.PlaceOrderParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "sizeSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "priceTicks",
            "type": "uint24",
            "internalType": "uint24"
          },
          {
            "name": "ttlUnits",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "side",
            "type": "uint8",
            "internalType": "enum IOrdersManager.OrderSide"
          },
          {
            "name": "stpMode",
            "type": "uint8",
            "internalType": "enum IOrdersManager.STPMode"
          },
          {
            "name": "orderType",
            "type": "uint8",
            "internalType": "enum IOrdersManager.OrderType"
          },
          {
            "name": "postOnly",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "reduceOnly",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "timeInForce",
            "type": "uint8",
            "internalType": "enum IOrdersManager.TimeInForce"
          },
          {
            "name": "headerVersion",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "builderId",
            "type": "uint16",
            "internalType": "uint16"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "orderId",
        "type": "uint56",
        "internalType": "WideOrderId"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setAuthority",
    "inputs": [
      {
        "name": "newAuthority",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setMarketLock",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "unlocked",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setOpenInterestLimit",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "limit",
        "type": "uint32",
        "internalType": "uint32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "trustedForwarder",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "unpause",
    "inputs": [],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "unpauseFunction",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "updateIsolatedPositionMarginBalance",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsIsolatedMargin.UpdateIsolatedPositionMarginBalanceParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "amount",
            "type": "int256",
            "internalType": "int256"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "updateLeverage",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsAccount.UpdateLeverageParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "leverage",
            "type": "uint8",
            "internalType": "uint8"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "updateMarginMode",
    "inputs": [
      {
        "name": "params",
        "type": "tuple",
        "internalType": "struct IPerpsAccount.UpdateMarginModeParams",
        "components": [
          {
            "name": "marketId",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "marginMode",
            "type": "uint8",
            "internalType": "enum IPerpsAccount.MarginMode"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "updateMarketConfig",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "perpsConfig",
        "type": "tuple",
        "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
        "components": [
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "quote",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "unlocked",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "maxLeverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "maintenanceMarginFactor",
            "type": "uint80",
            "internalType": "uint80"
          },
          {
            "name": "minOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "maxOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "oiLimitSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "stepSize",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "stepPrice",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "ADL",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "counterparties",
        "type": "address[]",
        "indexed": false,
        "internalType": "address[]"
      },
      {
        "name": "sizes",
        "type": "uint256[]",
        "indexed": false,
        "internalType": "uint256[]"
      },
      {
        "name": "price",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "AccountMigrated",
    "inputs": [
      {
        "name": "oldAccount",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newAccount",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "AddCollateral",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "AuthorityUpdated",
    "inputs": [
      {
        "name": "authority",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "version",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Liquidate",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "liquidator",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": false,
        "internalType": "uint16"
      },
      {
        "name": "orderId",
        "type": "uint56",
        "indexed": false,
        "internalType": "WideOrderId"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MatchOtcOrder",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "maker",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "taker",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "makerSide",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum IOrdersManager.OrderSide"
      },
      {
        "name": "size",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "price",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "fees",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Fees",
        "components": [
          {
            "name": "maker",
            "type": "int256",
            "internalType": "int256"
          },
          {
            "name": "taker",
            "type": "int256",
            "internalType": "int256"
          },
          {
            "name": "liquidation",
            "type": "int256",
            "internalType": "int256"
          }
        ]
      },
      {
        "name": "accumulatedFundingPayment",
        "type": "int128",
        "indexed": false,
        "internalType": "int128"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OnMatch",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "makerOrderId",
        "type": "uint40",
        "indexed": true,
        "internalType": "RestingOrderId"
      },
      {
        "name": "takerOrderId",
        "type": "uint56",
        "indexed": true,
        "internalType": "WideOrderId"
      },
      {
        "name": "tickLevel",
        "type": "uint24",
        "indexed": false,
        "internalType": "Tick"
      },
      {
        "name": "matchedSize",
        "type": "uint128",
        "indexed": false,
        "internalType": "uint128"
      },
      {
        "name": "fees",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct Fees",
        "components": [
          {
            "name": "maker",
            "type": "int256",
            "internalType": "int256"
          },
          {
            "name": "taker",
            "type": "int256",
            "internalType": "int256"
          },
          {
            "name": "liquidation",
            "type": "int256",
            "internalType": "int256"
          }
        ]
      },
      {
        "name": "accumulatedFundingPayment",
        "type": "int128",
        "indexed": false,
        "internalType": "int128"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OnSettleMakerChunk",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "makerOrderId",
        "type": "uint40",
        "indexed": true,
        "internalType": "RestingOrderId"
      },
      {
        "name": "tickLevel",
        "type": "uint24",
        "indexed": false,
        "internalType": "Tick"
      },
      {
        "name": "claimSize",
        "type": "uint128",
        "indexed": false,
        "internalType": "uint128"
      },
      {
        "name": "makerFee",
        "type": "int256",
        "indexed": false,
        "internalType": "int256"
      },
      {
        "name": "accumulatedFundingPayment",
        "type": "int128",
        "indexed": false,
        "internalType": "int128"
      },
      {
        "name": "makerFullyClaimed",
        "type": "bool",
        "indexed": false,
        "internalType": "bool"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OnTakeLevel",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "takerOrderId",
        "type": "uint56",
        "indexed": true,
        "internalType": "WideOrderId"
      },
      {
        "name": "tickLevel",
        "type": "uint24",
        "indexed": false,
        "internalType": "Tick"
      },
      {
        "name": "matchedSize",
        "type": "uint128",
        "indexed": false,
        "internalType": "uint128"
      },
      {
        "name": "takerFee",
        "type": "int256",
        "indexed": false,
        "internalType": "int256"
      },
      {
        "name": "liquidationFee",
        "type": "int256",
        "indexed": false,
        "internalType": "int256"
      },
      {
        "name": "accumulatedFundingPayment",
        "type": "int128",
        "indexed": false,
        "internalType": "int128"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "OpenMarket",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "perpsConfig",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
        "components": [
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "quote",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "unlocked",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "maxLeverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "maintenanceMarginFactor",
            "type": "uint80",
            "internalType": "uint80"
          },
          {
            "name": "minOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "maxOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "oiLimitSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "stepSize",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "stepPrice",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Pause",
    "inputs": [],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Paused",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "PausedFunction",
    "inputs": [
      {
        "name": "by",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "selector",
        "type": "bytes4",
        "indexed": true,
        "internalType": "bytes4"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "SetMarketLock",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "unlocked",
        "type": "bool",
        "indexed": false,
        "internalType": "bool"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "SetOpenInterestLimit",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "oldLimit",
        "type": "uint32",
        "indexed": false,
        "internalType": "uint32"
      },
      {
        "name": "newLimit",
        "type": "uint32",
        "indexed": false,
        "internalType": "uint32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Takeover",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "rlp",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketIds",
        "type": "uint16[]",
        "indexed": false,
        "internalType": "uint16[]"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Unpause",
    "inputs": [],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Unpaused",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UnpausedFunction",
    "inputs": [
      {
        "name": "by",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "selector",
        "type": "bytes4",
        "indexed": true,
        "internalType": "bytes4"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UpdateIsolatedPositionMarginBalance",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "oldBalance",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "newBalance",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UpdateLeverage",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "oldLeverage",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "newLeverage",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UpdateMarginMode",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "oldMarginMode",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum IPerpsAccount.MarginMode"
      },
      {
        "name": "newMarginMode",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum IPerpsAccount.MarginMode"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "UpdateMarketConfig",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "indexed": true,
        "internalType": "uint16"
      },
      {
        "name": "oldConfig",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
        "components": [
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "quote",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "unlocked",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "maxLeverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "maintenanceMarginFactor",
            "type": "uint80",
            "internalType": "uint80"
          },
          {
            "name": "minOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "maxOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "oiLimitSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "stepSize",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "stepPrice",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      },
      {
        "name": "newConfig",
        "type": "tuple",
        "indexed": false,
        "internalType": "struct IPerpsMarketConfig.PerpsMarketConfig",
        "components": [
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "quote",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "unlocked",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "maxLeverage",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "maintenanceMarginFactor",
            "type": "uint80",
            "internalType": "uint80"
          },
          {
            "name": "minOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "maxOrderStep",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "oiLimitSteps",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "stepSize",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "stepPrice",
            "type": "uint64",
            "internalType": "uint64"
          }
        ]
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "ADLZeroSize",
    "inputs": []
  },
  {
    "type": "error",
    "name": "AccessManagedInvalidAuthority",
    "inputs": [
      {
        "name": "authority",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "AccessManagedRequiredDelay",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "delay",
        "type": "uint32",
        "internalType": "uint32"
      }
    ]
  },
  {
    "type": "error",
    "name": "AccessManagedUnauthorized",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "AccountMustBeTakenOverByRLP",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "AccountNotEligibleForRLPTakeover",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "AlreadyBankrupted",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "BelowMinOrderSize",
    "inputs": [
      {
        "name": "size",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "CollateralAlreadyAdded",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "EnforcedPause",
    "inputs": []
  },
  {
    "type": "error",
    "name": "EnforcedPauseFunction",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ]
  },
  {
    "type": "error",
    "name": "ExpectedPause",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ExpectedPauseFunction",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ]
  },
  {
    "type": "error",
    "name": "FailedToWithdraw",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "token",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "amount",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "HealthyAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "HealthyPosition",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ]
  },
  {
    "type": "error",
    "name": "InsufficientCollateralMarginBalance",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      },
      {
        "name": "required",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InsufficientCrossMarginBalance",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      },
      {
        "name": "required",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InsufficientIsolatedMarginBalance",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      },
      {
        "name": "required",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InsufficientMargin",
    "inputs": [
      {
        "name": "available",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "required",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidInitialization",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidLeverage",
    "inputs": [
      {
        "name": "leverage",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidMarginMode",
    "inputs": [
      {
        "name": "expected",
        "type": "uint8",
        "internalType": "enum IPerpsAccount.MarginMode"
      },
      {
        "name": "actual",
        "type": "uint8",
        "internalType": "enum IPerpsAccount.MarginMode"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidMaxOrderSize",
    "inputs": [
      {
        "name": "maxOrderSize",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "minOrderSize",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidMigrationTarget",
    "inputs": [
      {
        "name": "newAccount",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidOrderSize",
    "inputs": [
      {
        "name": "size",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidOtcPrice",
    "inputs": [
      {
        "name": "price",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidQuote",
    "inputs": [
      {
        "name": "quote",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidSelector",
    "inputs": [
      {
        "name": "selector",
        "type": "bytes4",
        "internalType": "bytes4"
      }
    ]
  },
  {
    "type": "error",
    "name": "InvalidTimeInForceForReduceOnlyOrder",
    "inputs": [
      {
        "name": "timeInForce",
        "type": "uint8",
        "internalType": "enum IOrdersManager.TimeInForce"
      }
    ]
  },
  {
    "type": "error",
    "name": "MarginModeUnchanged",
    "inputs": [
      {
        "name": "marginMode",
        "type": "uint8",
        "internalType": "enum IPerpsAccount.MarginMode"
      }
    ]
  },
  {
    "type": "error",
    "name": "MarketIdOverflow",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ]
  },
  {
    "type": "error",
    "name": "NegativeCrossMarginBalance",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "NegativeIsolatedMarginBalance",
    "inputs": [
      {
        "name": "balance",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "NotAllowed",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "NotCollateral",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "NotInitializing",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotOrdersManager",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "NotOrdersManager",
    "inputs": [
      {
        "name": "caller",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "OpenInterestLimitExceeded",
    "inputs": [
      {
        "name": "currentOI",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "OpenOrdersExceedsLimit",
    "inputs": [
      {
        "name": "numOpenOrders",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "OpenOrdersExist",
    "inputs": [
      {
        "name": "numOpenOrders",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "OpenOrdersExistForMarginMode",
    "inputs": [
      {
        "name": "numOpenOrders",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "OpenPositionExists",
    "inputs": [
      {
        "name": "positionSize",
        "type": "int256",
        "internalType": "int256"
      }
    ]
  },
  {
    "type": "error",
    "name": "OtcSamePartyAddress",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OtcSameSide",
    "inputs": []
  },
  {
    "type": "error",
    "name": "PendingOpenInterestUnderflow",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "pending",
        "type": "uint128",
        "internalType": "uint128"
      },
      {
        "name": "consumed",
        "type": "uint128",
        "internalType": "uint128"
      }
    ]
  },
  {
    "type": "error",
    "name": "PendingSettlementNotCompleted",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "PositionMustBeTakenOverByRLP",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ]
  },
  {
    "type": "error",
    "name": "PositionNotEligibleForRLPTakeover",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ]
  },
  {
    "type": "error",
    "name": "ReduceOnlyOrderNotReducingPosition",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ReentrancyGuardReentrantCall",
    "inputs": []
  },
  {
    "type": "error",
    "name": "SizeExceedsMaxOrderSize",
    "inputs": [
      {
        "name": "size",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "maxOrderSize",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "TotalMarginAccountableOrderNotionalNotCleared",
    "inputs": [
      {
        "name": "isolatedOrderNotional",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "TotalMarginAccountableOrderUnfilledSizeNotCleared",
    "inputs": [
      {
        "name": "totalOrderUnfilledSize",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "UnauthorizedVault",
    "inputs": [
      {
        "name": "vault",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "UnhealthyAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "UnhealthySourceAccount",
    "inputs": [
      {
        "name": "account",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "UnsupportedMarket",
    "inputs": [
      {
        "name": "marketId",
        "type": "uint16",
        "internalType": "uint16"
      }
    ]
  },
  {
    "type": "error",
    "name": "UpdateIsolatedPositionMarginBalanceInCross",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UpdateIsolatedPositionMarginBalanceInsufficientFreeCrossUsdc",
    "inputs": [
      {
        "name": "available",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "required",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "UpdateIsolatedPositionMarginBalanceInsufficientFreeIsolatedMarginBalance",
    "inputs": [
      {
        "name": "available",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "required",
        "type": "uint256",
        "internalType": "uint256"
      }
    ]
  },
  {
    "type": "error",
    "name": "UpdateIsolatedPositionMarginBalanceNotOpen",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UpdateIsolatedPositionMarginBalanceZeroAmount",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ZeroAddress",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ZeroPositionSize",
    "inputs": []
  }
]
