[{"type": "constructor", "inputs": [{"name": "_pm", "type": "address", "internalType": "contract IPoolManager"}, {"name": "_oracle", "type": "address", "internalType": "address"}, {"name": "_usdc", "type": "address", "internalType": "contract ERC20"}, {"name": "_usdcKey", "type": "tuple", "internalType": "struct PoolKey", "components": [{"name": "currency0", "type": "address", "internalType": "Currency"}, {"name": "currency1", "type": "address", "internalType": "Currency"}, {"name": "fee", "type": "uint24", "internalType": "uint24"}, {"name": "tickSpacing", "type": "int24", "internalType": "int24"}, {"name": "hooks", "type": "address", "internalType": "contract IHooks"}]}, {"name": "_owner", "type": "address", "internalType": "address"}], "stateMutability": "nonpayable"}, {"type": "receive", "stateMutability": "payable"}, {"type": "function", "name": "BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "INIT_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "LIQ_BAND_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "LIQ_REWARD_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "MAINT_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "MAX_POSITION_DEPTH_X10", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "MIN_DEPTH_USD", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "OI_DEPTH_X", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "OPEN_BAND_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "OPEN_DEVIATION_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "OPEN_FEE_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "RESERVE_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "ROUTE_FEE_BPS", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "SQRT_102_MINUS_1_E7", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "WINDOW", "inputs": [], "outputs": [{"name": "", "type": "uint32", "internalType": "uint32"}], "stateMutability": "view"}, {"type": "function", "name": "accounted", "inputs": [{"name": "", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "addMargin", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}, {"name": "amount", "type": "uint256", "internalType": "uint256"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "borrowRate", "inputs": [{"name": "util", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "pure"}, {"type": "function", "name": "caps", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "maxLeverageBps", "type": "uint256", "internalType": "uint256"}, {"name": "maxNotionalUsd", "type": "uint256", "internalType": "uint256"}, {"name": "oiCapUsd", "type": "uint256", "internalType": "uint256"}, {"name": "depthUsd", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "close", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}, {"name": "limit", "type": "uint256", "internalType": "uint256"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "collectReserves", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "internalType": "bool"}, {"name": "to", "type": "address", "internalType": "address"}], "outputs": [{"name": "amount", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "globalPause", "inputs": [], "outputs": [{"name": "", "type": "bool", "internalType": "bool"}], "stateMutability": "view"}, {"type": "function", "name": "health", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "debt", "type": "uint256", "internalType": "uint256"}, {"name": "collateralUsd", "type": "uint256", "internalType": "uint256"}, {"name": "coverBps", "type": "uint256", "internalType": "uint256"}, {"name": "liquidatable", "type": "bool", "internalType": "bool"}], "stateMutability": "view"}, {"type": "function", "name": "liquidate", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "liquidateShortExact", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "payout", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "listMarket", "inputs": [{"name": "key", "type": "tuple", "internalType": "struct PoolKey", "components": [{"name": "currency0", "type": "address", "internalType": "Currency"}, {"name": "currency1", "type": "address", "internalType": "Currency"}, {"name": "fee", "type": "uint24", "internalType": "uint24"}, {"name": "tickSpacing", "type": "int24", "internalType": "int24"}, {"name": "hooks", "type": "address", "internalType": "contract IHooks"}]}, {"name": "feePips", "type": "uint24", "internalType": "uint24"}], "outputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "lister", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "address"}], "stateMutability": "view"}, {"type": "function", "name": "marketCount", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "marketInfo", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "coin", "type": "address", "internalType": "address"}, {"name": "poolId", "type": "bytes32", "internalType": "bytes32"}, {"name": "feePips", "type": "uint24", "internalType": "uint24"}, {"name": "paused", "type": "bool", "internalType": "bool"}, {"name": "oiLongUsd", "type": "uint256", "internalType": "uint256"}, {"name": "oiShortUsd", "type": "uint256", "internalType": "uint256"}, {"name": "listedAt", "type": "uint64", "internalType": "uint64"}], "stateMutability": "view"}, {"type": "function", "name": "marketKey", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "", "type": "tuple", "internalType": "struct PoolKey", "components": [{"name": "currency0", "type": "address", "internalType": "Currency"}, {"name": "currency1", "type": "address", "internalType": "Currency"}, {"name": "fee", "type": "uint24", "internalType": "uint24"}, {"name": "tickSpacing", "type": "int24", "internalType": "int24"}, {"name": "hooks", "type": "address", "internalType": "contract IHooks"}]}], "stateMutability": "view"}, {"type": "function", "name": "marketOfCoin", "inputs": [{"name": "", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "openLong", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "margin", "type": "uint256", "internalType": "uint256"}, {"name": "leverageBps", "type": "uint256", "internalType": "uint256"}, {"name": "minCoinOut", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "openPositionIds", "inputs": [], "outputs": [{"name": "", "type": "uint256[]", "internalType": "uint256[]"}], "stateMutability": "view"}, {"type": "function", "name": "openShort", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "margin", "type": "uint256", "internalType": "uint256"}, {"name": "leverageBps", "type": "uint256", "internalType": "uint256"}, {"name": "minUsdcOut", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "oracle", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "address"}], "stateMutability": "view"}, {"type": "function", "name": "owner", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "address"}], "stateMutability": "view"}, {"type": "function", "name": "poolInfo", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "internalType": "bool"}], "outputs": [{"name": "cash", "type": "uint256", "internalType": "uint256"}, {"name": "borrows", "type": "uint256", "internalType": "uint256"}, {"name": "totalShares", "type": "uint256", "internalType": "uint256"}, {"name": "reserves", "type": "uint256", "internalType": "uint256"}, {"name": "utilization", "type": "uint256", "internalType": "uint256"}, {"name": "borrowApr", "type": "uint256", "internalType": "uint256"}, {"name": "supplyApr", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "poolManager", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "contract IPoolManager"}], "stateMutability": "view"}, {"type": "function", "name": "position", "inputs": [{"name": "pid", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "", "type": "tuple", "internalType": "struct Markets.Position", "components": [{"name": "owner", "type": "address", "internalType": "address"}, {"name": "marketId", "type": "uint32", "internalType": "uint32"}, {"name": "isLong", "type": "bool", "internalType": "bool"}, {"name": "open", "type": "bool", "internalType": "bool"}, {"name": "exitBps", "type": "uint16", "internalType": "uint16"}, {"name": "collateral", "type": "uint256", "internalType": "uint256"}, {"name": "debtNorm", "type": "uint256", "internalType": "uint256"}, {"name": "notionalUsd", "type": "uint256", "internalType": "uint256"}, {"name": "marginUsd", "type": "uint256", "internalType": "uint256"}, {"name": "openedAt", "type": "uint64", "internalType": "uint64"}]}], "stateMutability": "view"}, {"type": "function", "name": "positionCount", "inputs": [], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "positionsOf", "inputs": [{"name": "user", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "uint256[]", "internalType": "uint256[]"}], "stateMutability": "view"}, {"type": "function", "name": "price", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "usdPerCoin", "type": "uint256", "internalType": "uint256"}, {"name": "tick", "type": "int24", "internalType": "int24"}], "stateMutability": "view"}, {"type": "function", "name": "setFee", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "feePips", "type": "uint24", "internalType": "uint24"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "setGlobalPause", "inputs": [{"name": "p", "type": "bool", "internalType": "bool"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "setLister", "inputs": [{"name": "l", "type": "address", "internalType": "address"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "setOwner", "inputs": [{"name": "o", "type": "address", "internalType": "address"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "setPaused", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "p", "type": "bool", "internalType": "bool"}], "outputs": [], "stateMutability": "nonpayable"}, {"type": "function", "name": "sharesOf", "inputs": [{"name": "", "type": "uint256", "internalType": "uint256"}, {"name": "", "type": "bool", "internalType": "bool"}, {"name": "", "type": "address", "internalType": "address"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "sharesValue", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "internalType": "bool"}, {"name": "shares", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "", "type": "uint256", "internalType": "uint256"}], "stateMutability": "view"}, {"type": "function", "name": "supply", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "internalType": "bool"}, {"name": "amount", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "shares", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "sweep", "inputs": [{"name": "token", "type": "address", "internalType": "address"}, {"name": "to", "type": "address", "internalType": "address"}], "outputs": [{"name": "amount", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "unlockCallback", "inputs": [{"name": "data", "type": "bytes", "internalType": "bytes"}], "outputs": [{"name": "", "type": "bytes", "internalType": "bytes"}], "stateMutability": "nonpayable"}, {"type": "function", "name": "usdc", "inputs": [], "outputs": [{"name": "", "type": "address", "internalType": "contract ERC20"}], "stateMutability": "view"}, {"type": "function", "name": "usdcKey", "inputs": [], "outputs": [{"name": "currency0", "type": "address", "internalType": "Currency"}, {"name": "currency1", "type": "address", "internalType": "Currency"}, {"name": "fee", "type": "uint24", "internalType": "uint24"}, {"name": "tickSpacing", "type": "int24", "internalType": "int24"}, {"name": "hooks", "type": "address", "internalType": "contract IHooks"}], "stateMutability": "view"}, {"type": "function", "name": "usdcPoolId", "inputs": [], "outputs": [{"name": "", "type": "bytes32", "internalType": "bytes32"}], "stateMutability": "view"}, {"type": "function", "name": "withdraw", "inputs": [{"name": "id", "type": "uint256", "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "internalType": "bool"}, {"name": "shares", "type": "uint256", "internalType": "uint256"}], "outputs": [{"name": "amount", "type": "uint256", "internalType": "uint256"}], "stateMutability": "nonpayable"}, {"type": "event", "name": "Closed", "inputs": [{"name": "positionId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "payoutUsd", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "payoutCoin", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "badDebt", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "event", "name": "GlobalPause", "inputs": [{"name": "paused", "type": "bool", "indexed": false, "internalType": "bool"}], "anonymous": false}, {"type": "event", "name": "Liquidated", "inputs": [{"name": "positionId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "liquidator", "type": "address", "indexed": true, "internalType": "address"}, {"name": "reward", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "payoutUsd", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "badDebt", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "event", "name": "ListerSet", "inputs": [{"name": "lister", "type": "address", "indexed": false, "internalType": "address"}], "anonymous": false}, {"type": "event", "name": "MarginAdded", "inputs": [{"name": "positionId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "event", "name": "MarketFee", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "feePips", "type": "uint24", "indexed": false, "internalType": "uint24"}], "anonymous": false}, {"type": "event", "name": "MarketListed", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "coin", "type": "address", "indexed": true, "internalType": "address"}, {"name": "poolId", "type": "bytes32", "indexed": false, "internalType": "bytes32"}, {"name": "feePips", "type": "uint24", "indexed": false, "internalType": "uint24"}], "anonymous": false}, {"type": "event", "name": "MarketPaused", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "paused", "type": "bool", "indexed": false, "internalType": "bool"}], "anonymous": false}, {"type": "event", "name": "Opened", "inputs": [{"name": "positionId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "owner", "type": "address", "indexed": true, "internalType": "address"}, {"name": "isLong", "type": "bool", "indexed": false, "internalType": "bool"}, {"name": "marginUsd", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "notionalUsd", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "collateral", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "debt", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "event", "name": "OwnerSet", "inputs": [{"name": "owner", "type": "address", "indexed": false, "internalType": "address"}], "anonymous": false}, {"type": "event", "name": "ReservesCollected", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "indexed": false, "internalType": "bool"}, {"name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "to", "type": "address", "indexed": false, "internalType": "address"}], "anonymous": false}, {"type": "event", "name": "Supplied", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "indexed": false, "internalType": "bool"}, {"name": "user", "type": "address", "indexed": true, "internalType": "address"}, {"name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "shares", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "event", "name": "Swept", "inputs": [{"name": "token", "type": "address", "indexed": true, "internalType": "address"}, {"name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "to", "type": "address", "indexed": false, "internalType": "address"}], "anonymous": false}, {"type": "event", "name": "Withdrawn", "inputs": [{"name": "marketId", "type": "uint256", "indexed": true, "internalType": "uint256"}, {"name": "coinSide", "type": "bool", "indexed": false, "internalType": "bool"}, {"name": "user", "type": "address", "indexed": true, "internalType": "address"}, {"name": "amount", "type": "uint256", "indexed": false, "internalType": "uint256"}, {"name": "shares", "type": "uint256", "indexed": false, "internalType": "uint256"}], "anonymous": false}, {"type": "error", "name": "BadPool", "inputs": []}, {"type": "error", "name": "Band", "inputs": []}, {"type": "error", "name": "Deviation", "inputs": []}, {"type": "error", "name": "Healthy", "inputs": []}, {"type": "error", "name": "Leverage", "inputs": []}, {"type": "error", "name": "Listed", "inputs": []}, {"type": "error", "name": "Locked", "inputs": []}, {"type": "error", "name": "NativeDebt", "inputs": []}, {"type": "error", "name": "NoLiquidity", "inputs": []}, {"type": "error", "name": "NotOpen", "inputs": []}, {"type": "error", "name": "NotOwner", "inputs": []}, {"type": "error", "name": "NotPoolManager", "inputs": []}, {"type": "error", "name": "NotPositionOwner", "inputs": []}, {"type": "error", "name": "OpenInterest", "inputs": []}, {"type": "error", "name": "Paused", "inputs": []}, {"type": "error", "name": "SelfOnly", "inputs": []}, {"type": "error", "name": "Shares", "inputs": []}, {"type": "error", "name": "Slippage", "inputs": []}, {"type": "error", "name": "TooLarge", "inputs": []}, {"type": "error", "name": "Undercollateralized", "inputs": []}, {"type": "error", "name": "Unhealthy", "inputs": []}, {"type": "error", "name": "UnknownMarket", "inputs": []}, {"type": "error", "name": "ZeroAmount", "inputs": []}]