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

OKEX/OKCoin WebSocket API added to CCXT Pro 0.0.80+ #6638

Closed
kroitor opened this issue Mar 18, 2020 · 3 comments
Closed

OKEX/OKCoin WebSocket API added to CCXT Pro 0.0.80+ #6638

kroitor opened this issue Mar 18, 2020 · 3 comments
Assignees
Labels
announcement new exchange ws Websockets (a.k.a. PRO)

Comments

@kroitor
Copy link
Member

kroitor commented Mar 18, 2020

Hi everyone!

Good news) We have added the support for OKEX and OKCoin in CCXT Pro version 0.0.80+.

ccxt-pro-banner-black


A note on the private WS API in this implementation:

Depending on the type of the trading account (spot/margin/future/swap/etc), OKEX WS API wants a currency code or an instrument symbol or id for the watchBalance(). It will default to spot account just like the okex implementation in CCXT.

This is made configurable, and you can watch the balance by setting various options:

ccxtpro = import ccxtpro
exchange = ccxtpro.okex({
    'enableRateLimit': True,
    'apiKey': 'YOUR_API_KEY',
    'secret': 'YOUR_SECRET',
    'password': 'YOUR_PASSWORD',  # apiKey password
    'options': {
        'watchBalance': 'spot', # spot, margin, futures, swap
    },
})

Or you can also override it with params, of course:

# unified currency code
balance = await exchange.watch_balance ({'code': 'ETH'})  
# exchange-specific currency id
balance = await exchange.watch_balance ({'currency': 'ETH'})  
# exchange-specific instrument id
balance = await exchange.watch_balance ({'instrument_id': 'ETH-BTC'})  
# unified market symbol
balance = await exchange.watch_balance ({'symbol': 'ETH/BTC'})  

Thank you for using CCXT Pro!

CCXT Pro

@kroitor kroitor added announcement new exchange ws Websockets (a.k.a. PRO) labels Mar 18, 2020
@kroitor kroitor self-assigned this Mar 18, 2020
@kroitor kroitor changed the title OKEX/OKCoin added to CCXT Pro 0.0.80+ OKEX/OKCoin WS API added to CCXT Pro 0.0.80+ Mar 18, 2020
@kroitor kroitor changed the title OKEX/OKCoin WS API added to CCXT Pro 0.0.80+ OKEX/OKCoin WebSocket API added to CCXT Pro 0.0.80+ Mar 18, 2020
@icytrader
Copy link

will you add their real-time tick by tick orderbook channel please?
the channel is: {"op": "subscribe", "args": ["futures/depth_l2_tbt:BTC-USD-200327"]}

@kroitor
Copy link
Member Author

kroitor commented Mar 21, 2020

@icytrader yes, will add that shortly.

@kroitor
Copy link
Member Author

kroitor commented Mar 24, 2020

@icytrader we added the support for depth_l2_tbt and this is actually the default for OKEX/OKCoin as of version 0.1.7+. Thx for using CCXT Pro! Your feedback is welcome!

@kroitor kroitor pinned this issue Mar 24, 2020
@kroitor kroitor closed this as completed Mar 29, 2020
@kroitor kroitor unpinned this issue Mar 29, 2020
kroitor added a commit that referenced this issue Apr 24, 2020
#6638

Implement cancelUnifiedOrder and fetchUnifiedOrder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
announcement new exchange ws Websockets (a.k.a. PRO)
Projects
None yet
Development

No branches or pull requests

2 participants