Value Channel
CHANNELvalue
The value channel provides real-time value updates for indices.
Subscribe Request
- Subscribe Schema
- Example
- Subsecond Example
- Verification Example
MESSAGE BODY
subscribevaluePER_SECOND, PER_200MS] Controls the time resolution of updates received. Use PER_200MS to receive all ticks
including those between second boundaries. Defaults to PER_SECOND, which returns only
values at second boundaries. For indices that do not publish at 200ms frequency,
PER_200MS is accepted but has no additional effect.
Set to true to include available on-chain verification data in the initial value and
subsequent updates. Defaults to false. Values without verification data are still sent,
with the verification field omitted. Can be combined with either maxResolution setting.
{
"type": "subscribe",
"id": "BRTI",
"stream": "value"
}
{
"type": "subscribe",
"id": "BRTI",
"stream": "value",
"maxResolution": "PER_200MS"
}
{
"type": "subscribe",
"id": "BRTI",
"stream": "value",
"includeVerification": true
}
Responses
- Update Response Schema
- Update Example 1
- Update Example 2
- Update Example 3
- Failed Subscribe Schema
- Failed Subscribe Example
No ack response if successful. The most recent value will be sent, and subsequent values until the unsubscribe command is sent.
MESSAGE BODY
valueContains cfbDaV1Value, with the expected, payload and signature arguments for
ICfbVerifier.verifyValue. The object has the same format as verification data in
REST API Values. Use the arguments from the same message together;
see the Oracle usage guide for integration details.
true{
"type": "value",
"id": "BRTI",
"value": "8835.56",
"time": 1579264280000
}
{
"type": "value",
"id": "BRR",
"value": "57260.71",
"time": 1620313200000,
"amendTime": 1620313300000,
"repeatOfPreviousValue": true
}
With includeVerification: true and verification data available, an update includes the
following object. The payload and signature below are abbreviated placeholders.
{
"type": "value",
"id": "BRTI",
"value": "65000.00",
"time": 1750000000000,
"verification": {
"cfbDaV1Value": {
"expected": {
"feedId": "values/BRTI",
"timeMillis": "1750000000000",
"negative": false,
"magnitude": "65000000000000000000000",
"commitmentNonce": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
"payload": "0x...",
"signature": "0x..."
}
}
}
Returned if you specified an unknown stream ID.
MESSAGE BODY
subscribevaluefalseError description
{
"type": "subscribe",
"id": "BRR",
"stream": "value",
"success": false,
"reason": "Unrecognised id"
}
Unsubscribe Request
- Unsubscribe Schema
- Unsubscribe Example
No direct response if successful. Messages for the subscription will cease.
MESSAGE BODY
unsubscribevalue{
"type": "unsubscribe",
"id": "BRTI",
"stream": "value"
}