Skip to content

Instantly share code, notes, and snippets.

@hiimivantang
Created November 6, 2017 17:30
Show Gist options
  • Save hiimivantang/a055b5536aadcba7212b24ee5a47ef62 to your computer and use it in GitHub Desktop.
Save hiimivantang/a055b5536aadcba7212b24ee5a47ef62 to your computer and use it in GitHub Desktop.
kafka producer for gdax api
import gdax
class OrderBookProducer(gdax.WebsocketClient):
def on_open(self):
self.products = ["ETH-BTC"]
self.channels = ["level2"]
def on_message(self, msg):
if msg['type'] == 'snapshot':
print(msg)
def on_close(self):
print("-- Goodbye! --")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment