Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Websocket subscription, not streaming #1

Closed
SimonVillage opened this issue Feb 24, 2020 · 2 comments
Closed

Websocket subscription, not streaming #1

SimonVillage opened this issue Feb 24, 2020 · 2 comments

Comments

@SimonVillage
Copy link

I tried following the readme example but it does not stream from the websocket. Only the last 10 trades are shown.

➜  project git:(master) ✗ rails c
Running via Spring preloader in process 68646
Loading development environment (Rails 6.0.2.1)
irb(main):001:0> client = Deribit::Client.new
irb(main):002:1* client.trades do |trade|
irb(main):003:1*   puts trade
irb(main):004:0> end
#<Hashie::Mash amount=40.0 direction="buy" indexPrice=9752.33 instrument="BTC-27MAR20" price=9942.5 quantity=4 tickDirection=1 timeStamp=1582552602072 tradeId=62823772 tradeSeq=2533026>
#<Hashie::Mash amount=2990.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.5 quantity=299 tickDirection=1 timeStamp=1582552602005 tradeId=62823771 tradeSeq=38286547>
#<Hashie::Mash amount=770.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.5 quantity=77 tickDirection=1 timeStamp=1582552602005 tradeId=62823770 tradeSeq=38286546>
#<Hashie::Mash amount=20.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.5 quantity=2 tickDirection=1 timeStamp=1582552602005 tradeId=62823769 tradeSeq=38286545>
#<Hashie::Mash amount=10.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.5 quantity=1 tickDirection=0 timeStamp=1582552602005 tradeId=62823768 tradeSeq=38286544>
#<Hashie::Mash amount=10.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.0 quantity=1 tickDirection=1 timeStamp=1582552602005 tradeId=62823767 tradeSeq=38286543>
#<Hashie::Mash amount=10.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.0 quantity=1 tickDirection=1 timeStamp=1582552602005 tradeId=62823766 tradeSeq=38286542>
#<Hashie::Mash amount=30.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.0 quantity=3 tickDirection=1 timeStamp=1582552602005 tradeId=62823765 tradeSeq=38286541>
#<Hashie::Mash amount=10.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9764.0 quantity=1 tickDirection=0 timeStamp=1582552602005 tradeId=62823764 tradeSeq=38286540>
#<Hashie::Mash amount=50.0 direction="buy" indexPrice=9752.33 instrument="BTC-PERPETUAL" price=9763.5 quantity=5 tickDirection=1 timeStamp=1582552602005 tradeId=62823763 tradeSeq=38286539>
@icostan
Copy link
Owner

icostan commented Apr 9, 2020

@SimonHausdorf I will take care of it these days, it seems that I need to update the library to work with Deribit API v2.
Old V1 API is still live but does not really work anymore, lots of tests are red.

@icostan
Copy link
Owner

icostan commented Apr 23, 2020

Finally done, the API 2.0 has changed quite a bit (in the worst if you ask me, its auto generated and only uses GET requests even for order creation/closing) and it took more time than expected.

See bin/whales-watching.rb for a streaming example.

@icostan icostan closed this as completed Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants