Skip to main content
WSS
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object

Description

The Yields stream delivers real-time updates to rolling yield/ROI predictions across fixed time horizons. Use this stream to monitor pool performance and ranking signals as they evolve with each block.

Subscription Parameters

chain_id
number
required
Target EVM network.
target_period_days
number
Target horizon in days (e.g., 1, 7, 30).
pool_uids
string[]
Filter updates to specific BlockDB pool identifiers.

Message Fields

pool_uid
string
BlockDB pool identifier.
target_period_days
number
Target horizon in days.
roi_predicted
string[]
Predicted ROI fractions per token for the target horizon.
current_reserves
string[]
Current reserves per token used for the ROI denominator.
block_number
number
Block height of the prediction anchor.
_tracing_id
string
Row-level lineage hash for correlation.

Subscription Example

# Use wscat to connect and subscribe
wscat -c wss://api.blockdb.io/v1/evm/ \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -x '{"action": "subscribe", "dataset_id": "0411", "chain_id": 1, "params": {"target_period_days": 7}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0411",
  "is_reorg": false,
  "data": {
    "pool_uid": "88e6a0c2ddd26feeb64f039a2c41296fcb3f5640000000000000000000000000",
    "block_number": 19001234,
    "target_period_days": 30,
    "tokens": [
      "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
    ],
    "current_reserves": [
      "1250.000000000000000000",
      "3950000.000000000000000000"
    ],
    "roi_predicted": [
      "0.028800000000000000",
      "0.000000000000000000"
    ],
    "_tracing_id": "0411c0ffee0000000000000000000000000000000000000000000000000001",
    "_created_at": "2025-12-20T12:35:01Z"
  }
}