{
  "schema_version": "1.0.0",
  "id": "market-data-checkpoint",
  "status": "reference_examples",
  "title": "Two Market Data Feeds Disagree: Which Should You Refresh?",
  "featured_example": {
    "id": "one_stale_source",
    "input": {
      "decision_time": "2026-11-24T12:00:00Z",
      "max_age_seconds": 90,
      "snapshots": [
        {
          "source": "feed-a",
          "chain_id": "demo:chain-a",
          "asset_id": "demo:asset-a",
          "quote_unit": "USD",
          "metric": "spot_mid",
          "observed_at": "2026-11-24T11:59:50Z"
        },
        {
          "source": "feed-b",
          "chain_id": "demo:chain-a",
          "asset_id": "demo:asset-a",
          "quote_unit": "USD",
          "metric": "spot_mid",
          "observed_at": "2026-11-24T11:52:00Z"
        }
      ]
    },
    "outcome": "Refresh only Feed B.",
    "snapshot_ages_seconds": [
      10,
      480
    ],
    "result": {
      "next_action": "REQUERY_SOURCES",
      "requery_sources": [
        "feed-b"
      ],
      "mismatched_fields": []
    }
  },
  "offline_replay": {
    "download_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint/examples/one_stale_source/replay.mjs",
    "source_repository_url": "https://github.com/solucience/deo-market-data-requery-replay",
    "command": "node replay.mjs",
    "runtime": "Node.js 18+; no packages, network, wallet, or API key required to replay",
    "scope": "Fixed synthetic comparison of planned refresh calls. This does not measure live network or trading outcomes."
  },
  "page_url": "https://agentdecisiongate.com/workflows/market-data-checkpoint",
  "guide_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint",
  "payment_required": false,
  "evaluation_endpoint": null,
  "workflow": [
    "watch a scheduled interval or data-change event",
    "fetch market snapshots",
    "check identity and freshness locally",
    "compare values, refresh the affected source, or hold"
  ],
  "search_intents": [
    "two market data feeds disagree which should I refresh",
    "stale market data before agent decision",
    "market feed timestamp missing",
    "same token symbol different chain",
    "which market data source should I refresh"
  ],
  "search_anchors": [
    {
      "anchor": "stale-feed",
      "question": "Two market data feeds disagree: which source should I refresh?",
      "answer": "Refresh only Feed B. Both feeds describe the same asset and metric. Feed A is 10 seconds old; Feed B is 8 minutes old and exceeds the 90-second limit.",
      "example_id": "one_stale_source",
      "page_url": "https://agentdecisiongate.com/workflows/market-data-checkpoint#stale-feed",
      "example_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint/examples/one_stale_source"
    },
    {
      "anchor": "missing-timestamp",
      "question": "Market data timestamp missing: can I still use the quote?",
      "answer": "Do not substitute the HTTP response time for the quote's observation time. In this example, requery Feed B only and hold its quote if its observation time is still unknown.",
      "example_id": "timestamp_missing",
      "page_url": "https://agentdecisiongate.com/workflows/market-data-checkpoint#missing-timestamp",
      "example_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint/examples/timestamp_missing"
    },
    {
      "anchor": "same-symbol-different-chain",
      "question": "Same token symbol on different chains: can I compare prices?",
      "answer": "Hold the comparison. A shared symbol and fresh timestamps do not establish that two feeds refer to the same asset. Resolve the chain and asset identifiers first.",
      "example_id": "different_chain",
      "page_url": "https://agentdecisiongate.com/workflows/market-data-checkpoint#same-symbol-different-chain",
      "example_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint/examples/different_chain"
    }
  ],
  "local_integration": {
    "match_fields": [
      "chain_id",
      "asset_id",
      "quote_unit",
      "metric"
    ],
    "freshness_fields": [
      "observed_at",
      "decision_time",
      "max_age_seconds"
    ],
    "rule": "Check identity first. Refresh only sources whose observation time is missing, invalid, in the future, or older than the caller's limit. Never infer freshness from HTTP receipt time.",
    "if_fresh_values_disagree": "Compare the metric and session definitions and examine source provenance separately. This check does not pick the correct quote or recommend a blanket refresh."
  },
  "run_local_check_when": [
    "New snapshots arrive from multiple sources.",
    "The same snapshots crossed the caller's freshness threshold.",
    "The market identity or metric definition changed."
  ],
  "skip_recheck_when": [
    "The inputs and policy are unchanged and the prior result is still within its freshness window."
  ],
  "boundary": "Synthetic reference only. No live quotes, source verification, caller-data evaluation API, trade recommendation, or order execution. Passing this step only permits a separate value check.",
  "next_steps": {
    "PROCEED_TO_VALUE_CHECK": "Compare the actual values under the caller's policy. Fresh compatible metadata does not make a quote correct.",
    "REQUERY_SOURCES": "Refresh only the listed sources; if data is still missing, apply a local retry cap.",
    "HOLD_COMPARISON": "Resolve the identity or metric mismatch before comparing values."
  },
  "linked_live_gate": {
    "metadata_url": "https://agentdecisiongate.com/v1/gates/mission",
    "new_evidence_guide_url": "https://agentdecisiongate.com/gates/mission#retry-limit-new-evidence",
    "use_when": "A separate reversible investigation keeps repeating, local limits do not decide, and new evidence could justify one more step. Not a market-data validation API."
  },
  "access": {
    "free": {
      "payment_required": false,
      "market_data_examples_url": "https://agentdecisiongate.com/v1/workflows/market-data-checkpoint",
      "mission_examples_url": "https://agentdecisiongate.com/v1/gates/mission/examples",
      "next_step": "Run source identity and freshness checks locally. Do not buy an evaluation just to compare, refresh, or hold a market snapshot."
    },
    "optional_free": {
      "product": "Mission Gate",
      "metadata_url": "https://agentdecisiongate.com/v1/gates/mission",
      "request_schema_url": "https://agentdecisiongate.com/schemas/branch-evaluation-request.schema.json",
      "evaluation": {
        "method": "POST",
        "url": "https://agentdecisiongate.com/v1/branches/evaluate",
        "policy_ref": {
          "policy_id": "policy_mission_gate",
          "version": "1.0.0",
          "policy_hash": "4080101123480f526528b64a90097c4802f553436bbd01e6a85bd4961d848ef7"
        }
      },
      "checkout": {
        "payment_required": false,
        "protocol": "none",
        "currency": "USDC",
        "unit_price_usdc": "0",
        "network": null,
        "pricing_url": "https://agentdecisiongate.com/v1/pricing",
        "unsigned_response": {
          "status": 200,
          "header": "",
          "settlement": false
        },
        "execution_notice": "Valid inputs are evaluated for free. No wallet, signature, payment, or feedback required. Read /v1/case-observation-policy; X-ADG-Observation: none disables case capture."
      },
      "call_when": [
        "A reversible mission branch is repeating, and new evidence could justify one more bounded step."
      ],
      "do_not_call_when": [
        "A local retry, time, or spending limit already decides.",
        "The next action is payment, tool execution, publishing, or irreversible.",
        "Market identity, timestamp, or quote validation is all that is needed."
      ],
      "returns": "An execution recommendation and a decision receipt for the submitted branch, not a quote check or trade authorization.",
      "repeat_use": {
        "when": "The same run and branch have new evidence and need another runtime decision.",
        "previous_receipt_field": "previous_receipt_hash",
        "from_result": "receipt.integrity_hash",
        "guide_url": "https://agentdecisiongate.com/v1/recurring-checkpoints"
      }
    }
  },
  "examples": [
    {
      "id": "fresh_comparable",
      "input": {
        "decision_time": "2026-11-24T12:00:00Z",
        "max_age_seconds": 90,
        "snapshots": [
          {
            "source": "feed-a",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:50Z"
          },
          {
            "source": "feed-b",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:40Z"
          }
        ]
      },
      "result": {
        "next_action": "PROCEED_TO_VALUE_CHECK",
        "requery_sources": [],
        "mismatched_fields": []
      }
    },
    {
      "id": "one_stale_source",
      "input": {
        "decision_time": "2026-11-24T12:00:00Z",
        "max_age_seconds": 90,
        "snapshots": [
          {
            "source": "feed-a",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:50Z"
          },
          {
            "source": "feed-b",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:52:00Z"
          }
        ]
      },
      "result": {
        "next_action": "REQUERY_SOURCES",
        "requery_sources": [
          "feed-b"
        ],
        "mismatched_fields": []
      }
    },
    {
      "id": "different_chain",
      "input": {
        "decision_time": "2026-11-24T12:00:00Z",
        "max_age_seconds": 90,
        "snapshots": [
          {
            "source": "feed-a",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:50Z"
          },
          {
            "source": "feed-b",
            "chain_id": "demo:chain-b",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:40Z"
          }
        ]
      },
      "result": {
        "next_action": "HOLD_COMPARISON",
        "requery_sources": [],
        "mismatched_fields": [
          "chain_id"
        ]
      }
    },
    {
      "id": "timestamp_missing",
      "input": {
        "decision_time": "2026-11-24T12:00:00Z",
        "max_age_seconds": 90,
        "snapshots": [
          {
            "source": "feed-a",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": "2026-11-24T11:59:50Z"
          },
          {
            "source": "feed-b",
            "chain_id": "demo:chain-a",
            "asset_id": "demo:asset-a",
            "quote_unit": "USD",
            "metric": "spot_mid",
            "observed_at": null
          }
        ]
      },
      "result": {
        "next_action": "REQUERY_SOURCES",
        "requery_sources": [
          "feed-b"
        ],
        "mismatched_fields": []
      }
    }
  ]
}