Skip to content

Instantly share code, notes, and snippets.

@qrpike
Created February 13, 2019 02:05
Show Gist options
  • Save qrpike/18e1564ad059a4ce3d2429181a8e123f to your computer and use it in GitHub Desktop.
Save qrpike/18e1564ad059a4ce3d2429181a8e123f to your computer and use it in GitHub Desktop.
Polygon.io crypto posts
// Crypto QUOTE:
const QUOTE = {
"ev": "XQ", // Event Type
"pair": "BTC-USD", // Crpyto Pair
"lp": 6001.20, // Last Trade Price
"ls": 1.05 // Last Trade Size
"bp": 6001.09, // Bid Price
"bs": 1.0003, // Bid Size
"ap": 6001.115, // Ask Price
"as": 3.0204005, // Ask Size
"t": 1342342342342, // Exchange Timestamp Unix ( ms )
"x": 3, // Exchange ID
"r": 1234134124123 // Received @ Polygon Timestamp
}
// Crypto TRADE:
const TRADE = {
"ev": "XT", // Event Type
"pair": "BTC-USD", // Crypto Pair
"p": 6006.4, // Price
"t": 1342342342342, // Timestamp Unix ( ms )
"s": 3.15, // Size
"c": [0], // Condition
"i": "someid" // Trade ID ( Optional )
"x": 3, // Exchange ID
"r": 1234134124123 // Received @ Polygon Timestamp
}
// Crypto AGGREGATE:
const AGGREGATE = {
"ev": "XA", // Event Type
"pair": "BTC-USD", // Crypto Pair
"o": 6443.517, // Open Price
"ox": 2, // Open Exchange
"h": 6446.0196, // High Price
"hx": 7, // High Exchange
"l": 6282.72, // Low Price
"lx": 6, // Low Exchange
"c": 6442.74, // Close Price
"cx": 4, // Close Exchange
"v": 70.3761311, // Volume of Trades in Tick
"s": 1542098700000 // Tick Start Timestamp
"e": 1542098760000 // Tick End Timestamp
}
// Crypto SIP ( NBBO ):
const SIP = {
"ev": "XS", // Event Type
"pair": "BTC-USD", // Crypto Pair
"as": 1.94892535, // Ask Size
"ap": 6277.91, // Ask Price
"ax": 6, // Ask Exchange
"bs": 0.01555, // Bid Size
"bp": 6446.17, // Bid Price
"bx": 10, // Bid Exchange
"t": 1542098700000 // Tick Start Timestamp
}
// Crypto LEVEL2:
const LEVEL2 = {
"ev": "XL2", // Event Type
"pair": "BTC-USD", // Crypto Pair
"b": [[ 6001.00, 1.432 ], // Bid Prices ( 100 depth cap )
[ 6000.98, 4.665 ], // [ Price, Size ]
[ 5999.30, .432434 ]],
"a": [[ 6001.10, 2.2 ], // Ask Prices ( 100 depth cap )
[ 6001.45, 1.405 ], // [ Price, Size ]
[ 6002.10, 10.43 ]],
"t": 1342342342342, // Timestamp Unix ( ms )
"x": 11, // Exchange ID
"r": 1234134124123 // Tick Received @ Polygon Timestamp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment