Why Delta APIs?
When monitoring hundreds of prediction market contracts, fetching complete snapshots every 30 seconds is wasteful. Most prices haven't changed. The Delta API solves this by returning only what's different.
How It Works
- You make an initial request and receive a full snapshot plus a cursor (timestamp or sequence number)
- Subsequent requests include the cursor:
GET /api/delta?since=cursor - The API returns only markets where price, volume, or status changed since that cursor
- You update your local state with the deltas
Benefits
- Lower bandwidth: A delta response for 500 markets might be 2KB instead of 200KB
- Faster processing: Only process changed data
- Lower rate limit usage: Fewer heavy requests
- Real-time feel: Poll every 5 seconds without performance issues
Delta API in SimpleFunctions
The heartbeat engine uses the Delta API internally to monitor market prices efficiently. Instead of fetching every market's full orderbook on each heartbeat, it pulls deltas and only re-evaluates theses when relevant prices change.
For API Users
If you're building custom tooling on top of SimpleFunctions, the Delta API is the recommended way to stay synchronized. It's especially useful for dashboards, monitoring scripts, and external alert systems.