Price Update Subscriptions
Subscribe to real-time share price changes.
Subscription Structureβ
subscription WatchPriceChanges(
$cursor: [share_price_changes_stream_cursor_input]!
$termId: String!
$batchSize: Int!
) {
share_price_changes_stream(
cursor: $cursor
batch_size: $batchSize
where: { term_id: { _eq: $termId } }
) {
term_id
curve_id
old_price
new_price
price_change
created_at
}
}
Best Practicesβ
- Filter by term_id for specific vault
- Use batch_size to control update frequency
- Calculate percentage change from old/new prices
- Update charts with new data points