[
  {
    "type": "constructor",
    "inputs": [
      { "name": "_router", "type": "address" },
      { "name": "_sequencerUptimeFeed", "type": "address" },
      { "name": "_maxPriceAge", "type": "uint256" }
    ]
  },
  {
    "type": "function",
    "name": "placeOrder",
    "stateMutability": "nonpayable",
    "inputs": [
      { "name": "tokenIn", "type": "address" },
      { "name": "tokenOut", "type": "address" },
      { "name": "priceFeed", "type": "address" },
      { "name": "amountIn", "type": "uint256" },
      { "name": "minAmountOut", "type": "uint256" },
      { "name": "triggerPrice", "type": "int256" },
      { "name": "triggerDir", "type": "uint8" },
      { "name": "orderType", "type": "uint8" },
      { "name": "interval", "type": "uint64" },
      { "name": "runs", "type": "uint32" },
      { "name": "expiry", "type": "uint64" }
    ],
    "outputs": [{ "name": "id", "type": "uint256" }]
  },
  {
    "type": "function",
    "name": "executeOrder",
    "stateMutability": "nonpayable",
    "inputs": [
      { "name": "id", "type": "uint256" },
      { "name": "path", "type": "address[]" }
    ],
    "outputs": [{ "name": "amountOut", "type": "uint256" }]
  },
  {
    "type": "function",
    "name": "cancelOrder",
    "stateMutability": "nonpayable",
    "inputs": [{ "name": "id", "type": "uint256" }],
    "outputs": []
  },
  {
    "type": "function",
    "name": "canExecute",
    "stateMutability": "view",
    "inputs": [{ "name": "id", "type": "uint256" }],
    "outputs": [
      { "name": "ok", "type": "bool" },
      { "name": "reason", "type": "string" }
    ]
  },
  {
    "type": "function",
    "name": "orders",
    "stateMutability": "view",
    "inputs": [{ "name": "id", "type": "uint256" }],
    "outputs": [
      { "name": "owner", "type": "address" },
      { "name": "tokenIn", "type": "address" },
      { "name": "tokenOut", "type": "address" },
      { "name": "priceFeed", "type": "address" },
      { "name": "amountIn", "type": "uint256" },
      { "name": "minAmountOut", "type": "uint256" },
      { "name": "triggerPrice", "type": "int256" },
      { "name": "interval", "type": "uint64" },
      { "name": "nextExecAt", "type": "uint64" },
      { "name": "expiry", "type": "uint64" },
      { "name": "remainingRuns", "type": "uint32" },
      { "name": "orderType", "type": "uint8" },
      { "name": "triggerDir", "type": "uint8" },
      { "name": "active", "type": "bool" }
    ]
  },
  {
    "type": "function",
    "name": "nextOrderId",
    "stateMutability": "view",
    "inputs": [],
    "outputs": [{ "name": "", "type": "uint256" }]
  },
  {
    "type": "function",
    "name": "router",
    "stateMutability": "view",
    "inputs": [],
    "outputs": [{ "name": "", "type": "address" }]
  },
  {
    "type": "function",
    "name": "sequencerUptimeFeed",
    "stateMutability": "view",
    "inputs": [],
    "outputs": [{ "name": "", "type": "address" }]
  },
  {
    "type": "function",
    "name": "maxPriceAge",
    "stateMutability": "view",
    "inputs": [],
    "outputs": [{ "name": "", "type": "uint256" }]
  },
  {
    "type": "event",
    "name": "OrderPlaced",
    "inputs": [
      { "name": "id", "type": "uint256", "indexed": true },
      { "name": "owner", "type": "address", "indexed": true },
      { "name": "tokenIn", "type": "address", "indexed": false },
      { "name": "tokenOut", "type": "address", "indexed": false },
      { "name": "orderType", "type": "uint8", "indexed": false },
      { "name": "amountIn", "type": "uint256", "indexed": false }
    ]
  },
  {
    "type": "event",
    "name": "OrderExecuted",
    "inputs": [
      { "name": "id", "type": "uint256", "indexed": true },
      { "name": "keeper", "type": "address", "indexed": true },
      { "name": "amountIn", "type": "uint256", "indexed": false },
      { "name": "amountOut", "type": "uint256", "indexed": false },
      { "name": "remainingRuns", "type": "uint32", "indexed": false }
    ]
  },
  {
    "type": "event",
    "name": "OrderCancelled",
    "inputs": [{ "name": "id", "type": "uint256", "indexed": true }]
  },
  {
    "type": "error",
    "name": "InvalidOrder",
    "inputs": [{ "name": "reason", "type": "string" }]
  },
  { "type": "error", "name": "NotOwner", "inputs": [] },
  {
    "type": "error",
    "name": "NotExecutable",
    "inputs": [{ "name": "reason", "type": "string" }]
  },
  { "type": "error", "name": "Reentrancy", "inputs": [] }
]
