> For the complete documentation index, see [llms.txt](https://docs.bv7x.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bv7x.ai/use-the-signal/read-the-forecast/on-chain.md).

# On-Chain Oracle

The on-chain oracle API provides access to EAS attestation records. All endpoints are public.

***

## Endpoints

| Method | Path                                   | Description                          |
| ------ | -------------------------------------- | ------------------------------------ |
| GET    | `/api/bv7x/onchain-oracle/latest`      | Most recent attestation              |
| GET    | `/api/bv7x/onchain-oracle/history`     | Full attestation history             |
| GET    | `/api/bv7x/onchain-oracle/verify/:uid` | Verify a specific attestation by UID |
| GET    | `/api/bv7x/onchain-oracle/stats`       | Attestation statistics               |

**Authentication**: None (all public)

***

## GET /api/bv7x/onchain-oracle/latest

Returns the most recent prediction attestation.

```json
{
  "uid": "0xabc123...",
  "date": "2026-03-28",
  "signal": "SELL",
  "direction": "DOWN",
  "confidence": 0.615,
  "btcPrice": 66027,
  "modelVersion": "5.6.7",
  "txHash": "0xdef456...",
  "timestamp": "2026-03-28T21:38:00Z",
  "type": "prediction"
}
```

***

## GET /api/bv7x/onchain-oracle/history

Returns all attestations ordered by date (newest first).

```json
{
  "attestations": [
    {
      "uid": "0xabc123...",
      "date": "2026-03-28",
      "type": "prediction",
      "signal": "SELL",
      "direction": "DOWN",
      "confidence": 0.615,
      "btcPrice": 66027,
      "txHash": "0xdef456..."
    },
    {
      "uid": "0x789abc...",
      "date": "2026-03-21",
      "type": "resolution",
      "signal": "BUY",
      "direction": "UP",
      "outcome": "WIN",
      "btcAtSignal": 64500,
      "btcAtResolution": 67200,
      "txHash": "0xghi789..."
    }
  ],
  "total": 284
}
```

Attestations have two types:

* `prediction` -- created at signal time (before outcome is known)
* `resolution` -- created when the 7-day outcome resolves

***

## GET /api/bv7x/onchain-oracle/verify/:uid

Verify a single attestation by its UID. Returns the full attestation data plus on-chain verification status.

```bash
curl https://bv7x.ai/api/bv7x/onchain-oracle/verify/0xabc123...
```

```json
{
  "uid": "0xabc123...",
  "verified": true,
  "onChain": true,
  "date": "2026-03-28",
  "type": "prediction",
  "signal": "SELL",
  "direction": "DOWN",
  "confidence": 0.615,
  "btcPrice": 66027,
  "attester": "0xd8B71d23e1a8da9867497C0E757A1143B94C3e1e",
  "txHash": "0xdef456...",
  "easscanUrl": "https://base.easscan.org/attestation/view/0xabc123..."
}
```

***

## GET /api/bv7x/onchain-oracle/stats

Aggregate statistics across all attestations.

```json
{
  "totalAttestations": 284,
  "predictions": 142,
  "resolutions": 142,
  "firstAttestation": "2025-10-01",
  "latestAttestation": "2026-03-28",
  "chain": "Base",
  "attester": "0xd8B71d23e1a8da9867497C0E757A1143B94C3e1e"
}
```

***

## Next

* [Verify a Prediction](/on-chain/verify.md) -- step-by-step verification guide
* [EAS Attestations](/on-chain/attestations.md) -- how the attestation system works
