{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trdefi-com/json-schema/trdefi-com-position-status-schema.json",
  "title": "PositionStatus",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trdefi-com-openapi.json#/components/schemas/PositionStatus",
  "type": "object",
  "required": [
    "data",
    "meta"
  ],
  "properties": {
    "data": {
      "type": "object",
      "required": [
        "positionId",
        "strategyHash",
        "status"
      ],
      "properties": {
        "positionId": {
          "type": "string",
          "description": "Same value as `strategyHash`. There is no second identifier."
        },
        "strategyHash": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "prepared",
            "shipped",
            "filled"
          ],
          "description": "`prepared` — nothing observed on-chain yet. `shipped` — the strategy is in the live catalogue, so your wallet signed and broadcast it. `filled` — it has settled volume. `signed` and `failed` are deliberately absent: neither is observable by us without claiming knowledge we do not have."
        },
        "chain": {
          "type": "string"
        },
        "chainId": {
          "type": "integer"
        },
        "wallet": {
          "type": "string"
        },
        "tokenA": {
          "type": "object",
          "additionalProperties": true
        },
        "tokenB": {
          "type": "object",
          "additionalProperties": true
        },
        "makerFeeBps": {
          "type": [
            "integer",
            "null"
          ]
        },
        "protocolFeeBps": {
          "type": "integer"
        },
        "observedOnChain": {
          "type": "boolean",
          "description": "True once we have seen the position in the live catalogue."
        },
        "volumeUsd": {
          "type": [
            "number",
            "null"
          ]
        },
        "preparedAt": {
          "type": "string",
          "format": "date-time"
        },
        "firstSeenOnChainAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When **we** first observed it on-chain, not necessarily when it happened."
        },
        "firstSeenFilledAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "signer": {
          "type": "string",
          "description": "Always the client. This endpoint has never signed or broadcast anything."
        }
      }
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    }
  },
  "$defs": {
    "Meta": {
      "type": "object",
      "required": [
        "requestId",
        "generatedAt",
        "apiVersion"
      ],
      "properties": {
        "requestId": {
          "type": "string"
        },
        "generatedAt": {
          "type": "string",
          "format": "date-time"
        },
        "apiVersion": {
          "type": "string"
        },
        "freshnessSeconds": {
          "type": [
            "integer",
            "null"
          ],
          "description": "How old the underlying roll-up is, in seconds. Null when not derived."
        },
        "cached": {
          "type": "boolean",
          "description": "True when this response was served from our short-lived cache."
        }
      }
    }
  }
}