{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/layerhop-com/json-schema/layerhop-com-filler-stats-schema.json",
  "title": "FillerStats",
  "x-generated": "2026-11-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/layerhop-com-openapi.yaml#/components/schemas/FillerStats",
  "type": "object",
  "required": [
    "status",
    "window",
    "allTime",
    "days",
    "routes",
    "lostByBuilder",
    "skips",
    "recent"
  ],
  "properties": {
    "status": {
      "type": "object",
      "required": [
        "lastDecisionAt",
        "decisionsLastHour",
        "paused",
        "pausedReason"
      ],
      "properties": {
        "lastDecisionAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Newest live decision; null when the filler has never run live."
        },
        "decisionsLastHour": {
          "type": "integer"
        },
        "paused": {
          "type": "boolean",
          "description": "The filler's send switch (`filler_controls`)."
        },
        "pausedReason": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "window": {
      "$ref": "#/$defs/FillerTotals"
    },
    "allTime": {
      "$ref": "#/$defs/FillerTotals"
    },
    "days": {
      "type": "array",
      "description": "Per UTC day of the window, oldest first, days without bids as zeros.",
      "items": {
        "type": "object",
        "required": [
          "date",
          "fills",
          "lostBids",
          "volumeUsd",
          "netUsd"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "fills": {
            "type": "integer"
          },
          "lostBids": {
            "type": "integer"
          },
          "volumeUsd": {
            "type": "number"
          },
          "netUsd": {
            "type": "number"
          }
        }
      }
    },
    "routes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "srcChainId",
          "dstChainId",
          "kind",
          "fills",
          "lostBids",
          "volumeUsd",
          "netUsd"
        ],
        "properties": {
          "srcChainId": {
            "type": "integer"
          },
          "dstChainId": {
            "type": "integer"
          },
          "kind": {
            "type": "string",
            "description": "Token pair: `usdc`, `usdc>usdt`, `usdt>usdt` or `weth>weth`."
          },
          "fills": {
            "type": "integer"
          },
          "lostBids": {
            "type": "integer"
          },
          "volumeUsd": {
            "type": "number"
          },
          "netUsd": {
            "type": "number"
          }
        }
      }
    },
    "lostByBuilder": {
      "type": "array",
      "description": "Lost bids of the window by the builder of the winning block.",
      "items": {
        "type": "object",
        "required": [
          "builder",
          "count"
        ],
        "properties": {
          "builder": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      }
    },
    "skips": {
      "type": "array",
      "description": "Why orders were not bid on in the window, most frequent first.",
      "items": {
        "type": "object",
        "required": [
          "reason",
          "count"
        ],
        "properties": {
          "reason": {
            "type": "string"
          },
          "count": {
            "type": "integer"
          }
        }
      }
    },
    "recent": {
      "type": "array",
      "description": "The newest bids (won and lost), newest first, at most 50.",
      "items": {
        "type": "object",
        "required": [
          "decidedAt",
          "orderId",
          "srcChainId",
          "dstChainId",
          "kind",
          "sizeUsd",
          "result",
          "netUsd",
          "fillTxHash",
          "ourTipGwei",
          "winnerTipGwei",
          "builder"
        ],
        "properties": {
          "decidedAt": {
            "type": "string",
            "format": "date-time"
          },
          "orderId": {
            "type": "string"
          },
          "srcChainId": {
            "type": "integer"
          },
          "dstChainId": {
            "type": "integer"
          },
          "kind": {
            "type": "string"
          },
          "sizeUsd": {
            "type": "number"
          },
          "result": {
            "type": "string",
            "enum": [
              "won",
              "lost"
            ]
          },
          "netUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "fillTxHash": {
            "type": [
              "string",
              "null"
            ],
            "description": "The fill transaction of a won bid."
          },
          "ourTipGwei": {
            "type": [
              "number",
              "null"
            ]
          },
          "winnerTipGwei": {
            "type": [
              "number",
              "null"
            ]
          },
          "builder": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    }
  },
  "$defs": {
    "FillerTotals": {
      "type": "object",
      "required": [
        "ordersPriced",
        "fills",
        "lostBids",
        "winRate",
        "volumeUsd",
        "grossUsd",
        "gasUsd",
        "netUsd"
      ],
      "properties": {
        "ordersPriced": {
          "type": "integer",
          "description": "Orders the live filler priced."
        },
        "fills": {
          "type": "integer",
          "description": "Bids that landed."
        },
        "lostBids": {
          "type": "integer",
          "description": "Bids another relayer beat."
        },
        "winRate": {
          "type": [
            "number",
            "null"
          ],
          "description": "fills / (fills + lostBids), 4 decimals; null without bids."
        },
        "volumeUsd": {
          "type": "number",
          "description": "USD paid out by the fills."
        },
        "grossUsd": {
          "type": "number",
          "description": "Fees earned by the fills (repayment minus payout), estimated."
        },
        "gasUsd": {
          "type": "number",
          "description": "Destination gas of the fills, estimated at decision time."
        },
        "netUsd": {
          "type": "number",
          "description": "Expected profit of the fills after gas and the filler's internal capital and risk charges."
        }
      }
    }
  }
}