Skip to main content
WSS

Overview

  • Dataset ID: 0411 - Liquidity Pool Yields
  • Description: Rolling yield/ROI predictions per pool over fixed horizons (1D, 3D, 7D, 14D, 30D, 90D, 365D), based on historical swap fees (blockdb_evm.b0303_liquidity_pools_swap_fees_v1) and current reserves (latest blockdb_evm.b0301_liquidity_pools_reserves_v1 snapshot).
  • Sample: Hugging Face Sample

Subscription Parameters

chain_id
number
required
Target EVM network. See the Chain enumeration for supported values.
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.
exchange_id
number
Exchange/DEX identifier.
type_id
number
Pool type identifier.
block_number
number
Block height of the prediction anchor.
block_time
string
Block time (ISO-8601).
tx_index
number
Transaction index.
log_index
number
Log index.
target_period_days
number
Target horizon in days.
observed_period_days
number
History actually used (must be > 0 and <= target_period_days).
is_full_period
boolean
true when observed_period_days == target_period_days.
is_extrapolated
boolean
true when the row is scaled from shorter history.
extrapolation_factor
string
Scaling factor applied when extrapolating (string to preserve precision).
window_start_time
string
Start time of the observed window.
window_end_time
string
End time of the observed window.
tokens
string[]
Pool token addresses (aligned arrays index by this order).
current_reserves
string[]
Current reserves per token (decimals-adjusted).
volume_observed
string[]
Observed traded volume per token in the window.
volume_predicted
string[]
Predicted traded volume per token for the target horizon.
user_fees_observed
string[]
Observed user/LP fees per token in the window.
user_fees_predicted
string[]
Predicted user/LP fees per token for the target horizon.
roi_predicted
string[]
Predicted ROI fraction per token for the target horizon.
_tracing_id
string
Row-level lineage hash for correlation.
_parent_tracing_ids
string[]
Parent lineage ids (hex).
_created_at
string
Record creation time (ISO-8601).
_updated_at
string
Record last update time (ISO-8601).

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",
    "exchange_id": 1,
    "type_id": 201,
    "block_number": 19001234,
    "block_time": "2025-12-20T12:34:56Z",
    "tx_index": 7,
    "log_index": 12,
    "target_period_days": 30,
    "observed_period_days": 30,
    "is_full_period": true,
    "is_extrapolated": false,
    "extrapolation_factor": "1.000000",
    "window_start_time": "2025-11-20T12:34:56Z",
    "window_end_time": "2025-12-20T12:34:56Z",
    "tokens": [
      "c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
      "a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
    ],
    "current_reserves": [
      "1250.000000000000000000",
      "3950000.000000000000000000"
    ],
    "volume_observed": [
      "12000.000000000000000000",
      "0.000000000000000000"
    ],
    "volume_predicted": [
      "12000.000000000000000000",
      "0.000000000000000000"
    ],
    "user_fees_observed": [
      "36.000000000000000000",
      "0.000000000000000000"
    ],
    "user_fees_predicted": [
      "36.000000000000000000",
      "0.000000000000000000"
    ],
    "roi_predicted": [
      "0.028800000000000000",
      "0.000000000000000000"
    ],
    "_tracing_id": "0411c0ffee000000000000000000000000000000000000000000000000000001",
    "_parent_tracing_ids": [
      "0303c0ffee000000000000000000000000000000000000000000000000000001",
      "0301c0ffee000000000000000000000000000000000000000000000000000001"
    ],
    "_created_at": "2025-12-20T12:35:01Z",
    "_updated_at": "2025-12-20T12:35:01Z"
  }
}
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object
Last modified on April 6, 2026