[
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "bytes32",
            "name": "moduleKey",
            "type": "bytes32"
          },
          {
            "internalType": "address",
            "name": "moduleAddress",
            "type": "address"
          }
        ],
        "internalType": "struct FlatcoinStructs.AuthorizedModule",
        "name": "_module",
        "type": "tuple"
      }
    ],
    "name": "addAuthorizedModule",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "bytes32",
            "name": "moduleKey",
            "type": "bytes32"
          },
          {
            "internalType": "address",
            "name": "moduleAddress",
            "type": "address"
          }
        ],
        "internalType": "struct FlatcoinStructs.AuthorizedModule[]",
        "name": "_modules",
        "type": "tuple[]"
      }
    ],
    "name": "addAuthorizedModules",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "depositAmount",
        "type": "uint256"
      }
    ],
    "name": "checkCollateralCap",
    "outputs": [],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "additionalSkew",
        "type": "uint256"
      }
    ],
    "name": "checkSkewMax",
    "outputs": [],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "collateral",
    "outputs": [
      {
        "internalType": "contract IERC20Upgradeable",
        "name": "collateral",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "cumulativeFundingRate",
    "outputs": [
      {
        "internalType": "int256",
        "name": "cumulativeFundingRate",
        "type": "int256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_tokenId",
        "type": "uint256"
      }
    ],
    "name": "deletePosition",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "getCurrentFundingRate",
    "outputs": [
      {
        "internalType": "int256",
        "name": "fundingRate",
        "type": "int256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "getCurrentSkew",
    "outputs": [
      {
        "internalType": "int256",
        "name": "skew",
        "type": "int256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "getGlobalPositions",
    "outputs": [
      {
        "components": [
          {
            "internalType": "uint256",
            "name": "marginDepositedTotal",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "lastPrice",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "sizeOpenedTotal",
            "type": "uint256"
          }
        ],
        "internalType": "struct FlatcoinStructs.GlobalPositions",
        "name": "_globalPositions",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "_tokenId",
        "type": "uint256"
      }
    ],
    "name": "getPosition",
    "outputs": [
      {
        "components": [
          {
            "internalType": "uint256",
            "name": "lastPrice",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "marginDeposited",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "additionalSize",
            "type": "uint256"
          },
          {
            "internalType": "int256",
            "name": "entryCumulativeFunding",
            "type": "int256"
          }
        ],
        "internalType": "struct FlatcoinStructs.Position",
        "name": "position",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "getVaultSummary",
    "outputs": [
      {
        "components": [
          {
            "internalType": "int256",
            "name": "marketSkew",
            "type": "int256"
          },
          {
            "internalType": "int256",
            "name": "cumulativeFundingRate",
            "type": "int256"
          },
          {
            "internalType": "int256",
            "name": "lastRecomputedFundingRate",
            "type": "int256"
          },
          {
            "internalType": "uint64",
            "name": "lastRecomputedFundingTimestamp",
            "type": "uint64"
          },
          {
            "internalType": "uint256",
            "name": "stableCollateralTotal",
            "type": "uint256"
          },
          {
            "components": [
              {
                "internalType": "uint256",
                "name": "marginDepositedTotal",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "lastPrice",
                "type": "uint256"
              },
              {
                "internalType": "uint256",
                "name": "sizeOpenedTotal",
                "type": "uint256"
              }
            ],
            "internalType": "struct FlatcoinStructs.GlobalPositions",
            "name": "globalPositions",
            "type": "tuple"
          }
        ],
        "internalType": "struct FlatcoinStructs.VaultSummary",
        "name": "_vaultSummary",
        "type": "tuple"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_address",
        "type": "address"
      }
    ],
    "name": "isAuthorizedModule",
    "outputs": [
      {
        "internalType": "bool",
        "name": "status",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bytes32",
        "name": "moduleKey",
        "type": "bytes32"
      }
    ],
    "name": "isModulePaused",
    "outputs": [
      {
        "internalType": "bool",
        "name": "paused",
        "type": "bool"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "lastRecomputedFundingRate",
    "outputs": [
      {
        "internalType": "int256",
        "name": "lastRecomputedFundingRate",
        "type": "int256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "lastRecomputedFundingTimestamp",
    "outputs": [
      {
        "internalType": "uint64",
        "name": "lastRecomputedFundingTimestamp",
        "type": "uint64"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxExecutabilityAge",
    "outputs": [
      {
        "internalType": "uint64",
        "name": "maxExecutabilityAge",
        "type": "uint64"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxFundingVelocity",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "maxFundingVelocity",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "maxVelocitySkew",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "maxVelocitySkew",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "minExecutabilityAge",
    "outputs": [
      {
        "internalType": "uint64",
        "name": "minExecutabilityAge",
        "type": "uint64"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bytes32",
        "name": "_moduleKey",
        "type": "bytes32"
      }
    ],
    "name": "moduleAddress",
    "outputs": [
      {
        "internalType": "address",
        "name": "moduleAddress",
        "type": "address"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "bytes32",
        "name": "_moduleKey",
        "type": "bytes32"
      }
    ],
    "name": "removeAuthorizedModule",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "to",
        "type": "address"
      },
      {
        "internalType": "uint256",
        "name": "amount",
        "type": "uint256"
      }
    ],
    "name": "sendCollateral",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "components": [
          {
            "internalType": "uint256",
            "name": "lastPrice",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "marginDeposited",
            "type": "uint256"
          },
          {
            "internalType": "uint256",
            "name": "additionalSize",
            "type": "uint256"
          },
          {
            "internalType": "int256",
            "name": "entryCumulativeFunding",
            "type": "int256"
          }
        ],
        "internalType": "struct FlatcoinStructs.Position",
        "name": "_position",
        "type": "tuple"
      },
      {
        "internalType": "uint256",
        "name": "_tokenId",
        "type": "uint256"
      }
    ],
    "name": "setPosition",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "settleFundingFees",
    "outputs": [
      {
        "internalType": "int256",
        "name": "fundingFees",
        "type": "int256"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "skewFractionMax",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "skewFractionMax",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "stableCollateralCap",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "collateralCap",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "stableCollateralTotal",
    "outputs": [
      {
        "internalType": "uint256",
        "name": "totalAmount",
        "type": "uint256"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "price",
        "type": "uint256"
      },
      {
        "internalType": "int256",
        "name": "marginDelta",
        "type": "int256"
      },
      {
        "internalType": "int256",
        "name": "additionalSizeDelta",
        "type": "int256"
      }
    ],
    "name": "updateGlobalPositionData",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "int256",
        "name": "_stableCollateralAdjustment",
        "type": "int256"
      }
    ],
    "name": "updateStableCollateralTotal",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]
