Skip to content

Instantly share code, notes, and snippets.

@GeorgeErickson
Created December 2, 2017 06:03
Show Gist options
  • Save GeorgeErickson/9d453148c7a68baba33cc06c247b965e to your computer and use it in GitHub Desktop.
Save GeorgeErickson/9d453148c7a68baba33cc06c247b965e to your computer and use it in GitHub Desktop.
schema
```json
{
// Currency pair.
// - Always uppercase
"pair": ["BTC", "USD"],
// decimal numbers are encoded as strings to avoid precision errors with floats.
// The best aggregated bid and ask price
// - I could also stream the full order book and return topN best bid ask if that would be usefull.
"bid": "333.98",
"ask": "333.99",
"price": "333.99",
"size": "0.193",
"volume": "5957.11914015",
// Timestamps
// - format: most likely RFC3339 or epoch ms
// - the deltas between these times can be used to gauge how trustworthy the data is.
// market_ts is the time returned by the exchange api.
// NOTE: not all exchanges provide this.
"market_ts": "2006-01-02T15:04:05Z07:00",
// server_ts is the time we received this data in the server.
// This should be well aligned across exchanges and probably the main ts you want to use.
"server_ts": "2006-01-02T15:04:05Z07:00",
// request_ts tracks when we started a http request.
// NOTE: Only provided if the exchange doesn't have a websocket api.
"request_ts": "2006-01-02T15:04:05Z07:00"
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment