Skip to content

Commit 0f9b6b5

Browse files
docs: update to show missing price fields as absent instead of null
- Changed JSON example to show fields as absent rather than null - Updated callouts to reflect that fields are missing/absent - Clarified that price fields may be omitted from response when not computable Co-Authored-By: Nidhi Singh <[email protected]>
1 parent 85c8a88 commit 0f9b6b5

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

pages/lazer/payload-reference.mdx

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,8 @@ Here's what a typical StreamUpdated response that contains a PriceFeed looks lik
8080
},
8181
{
8282
"priceFeedId": 3,
83-
"price": null,
84-
"bestBidPrice": null,
85-
"bestAskPrice": null,
8683
"publisherCount": 5,
87-
"exponent": -8,
88-
"confidence": null
84+
"exponent": -8
8985
}
9086
]
9187
},
@@ -97,9 +93,10 @@ Here's what a typical StreamUpdated response that contains a PriceFeed looks lik
9793
```
9894

9995
<Callout type="info">
100-
In the example above, the third price feed shows `"price": null`, indicating
101-
that the price could not be computed. When you encounter null values, use the
102-
last valid price or wait for the next update.
96+
In the example above, the third price feed has the `price`, `bestBidPrice`,
97+
`bestAskPrice`, and `confidence` fields absent, indicating that these values
98+
could not be computed. When you encounter missing price fields, use the last
99+
valid price or wait for the next update.
103100
</Callout>
104101

105102
<Callout type="warning">
@@ -131,12 +128,11 @@ Main aggregate price calculated from all contributing publishers
131128
- **Invariants**: Non-zero when present (null values filtered out)
132129

133130
<Callout type="warning">
134-
**Null Price Values**: In some cases, you may receive a `null` value for the
135-
`price` field (shown as `"price": null` in JSON). This indicates that the
136-
price could not be computed at that moment. When this occurs, you should
137-
either use the last valid price you received or wait for a fresh update with a
138-
valid price. Note that you may not always receive a price update in the
139-
response if no valid price is available.
131+
**Missing Price Fields**: In some cases, the `price` field (and related
132+
optional fields like `bestBidPrice`, `bestAskPrice`, and `confidence`) may be
133+
absent from the response. This indicates that the price could not be computed
134+
at that moment. When this occurs, you should either use the last valid price
135+
you received or wait for a fresh update with a valid price.
140136
</Callout>
141137

142138
#### Data Publisher Count - `publisher_count`

0 commit comments

Comments
 (0)