{
  "_format": "hh-sol-artifact-1",
  "contractName": "IClearingHouse",
  "sourceName": "src/interface/IClearingHouse.sol",
  "abi": [
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_addedMargin",
          "type": "tuple"
        }
      ],
      "name": "addMargin",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_quoteAssetAmountLimit",
          "type": "tuple"
        }
      ],
      "name": "closePosition",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_trader",
          "type": "address"
        }
      ],
      "name": "getMarginRatio",
      "outputs": [
        {
          "components": [
            {
              "internalType": "int256",
              "name": "d",
              "type": "int256"
            }
          ],
          "internalType": "struct SignedDecimal.signedDecimal",
          "name": "",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_trader",
          "type": "address"
        }
      ],
      "name": "getPosition",
      "outputs": [
        {
          "components": [
            {
              "components": [
                {
                  "internalType": "int256",
                  "name": "d",
                  "type": "int256"
                }
              ],
              "internalType": "struct SignedDecimal.signedDecimal",
              "name": "size",
              "type": "tuple"
            },
            {
              "components": [
                {
                  "internalType": "uint256",
                  "name": "d",
                  "type": "uint256"
                }
              ],
              "internalType": "struct Decimal.decimal",
              "name": "margin",
              "type": "tuple"
            },
            {
              "components": [
                {
                  "internalType": "uint256",
                  "name": "d",
                  "type": "uint256"
                }
              ],
              "internalType": "struct Decimal.decimal",
              "name": "openNotional",
              "type": "tuple"
            },
            {
              "components": [
                {
                  "internalType": "int256",
                  "name": "d",
                  "type": "int256"
                }
              ],
              "internalType": "struct SignedDecimal.signedDecimal",
              "name": "lastUpdatedCumulativePremiumFraction",
              "type": "tuple"
            },
            {
              "internalType": "uint256",
              "name": "liquidityHistoryIndex",
              "type": "uint256"
            },
            {
              "internalType": "uint256",
              "name": "blockNumber",
              "type": "uint256"
            }
          ],
          "internalType": "struct IClearingHouse.Position",
          "name": "",
          "type": "tuple"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "_trader",
          "type": "address"
        }
      ],
      "name": "liquidate",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "internalType": "enum IClearingHouse.Side",
          "name": "_side",
          "type": "uint8"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_quoteAssetAmount",
          "type": "tuple"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_leverage",
          "type": "tuple"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_baseAssetAmountLimit",
          "type": "tuple"
        }
      ],
      "name": "openPosition",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        }
      ],
      "name": "payFunding",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        },
        {
          "components": [
            {
              "internalType": "uint256",
              "name": "d",
              "type": "uint256"
            }
          ],
          "internalType": "struct Decimal.decimal",
          "name": "_removedMargin",
          "type": "tuple"
        }
      ],
      "name": "removeMargin",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "contract IAmm",
          "name": "_amm",
          "type": "address"
        }
      ],
      "name": "settlePosition",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "bytecode": "0x",
  "deployedBytecode": "0x",
  "linkReferences": {},
  "deployedLinkReferences": {}
}
