From sgcWebSockets 2022.6.0 OKX Crypto Broker is supported, OKX, formerly known as OKEx, is one of the largest crypto spot and derivatives trading exchanges. OKX is a Seychelles-based cryptocurrency exchange that provides a platform for trading various instruments such as spot and derivative. Some of the exchange's core features include spot and derivative trading.
sgcWebSockets supports the WebSocket API including the Public and Private Channels. Placing orders is also supported.
Configuration
WebSocket channels are divided into two categories: public and private channels.
- Public channels: include tickers channel, K-Line channel, limit price channel, order book channel, and mark price channel, etc -- do not require log in.
- Private channels: including account channel, order channel, and position channel, etc -- require log in.
You can configure the following properties in the OKS property.
- ApiKey: you can request a new api key in your OKX account, just copy the value to this property.
- ApiSecret: it's the secret value of the api.
- Passphrase: it's the custom string defined when creating a new api key.
- IsDemo: if enabled, will connect to the OKX Demo account (disabled by default).
- IsPrivate: if enabled, you will be able to connect to private channels (disabled by default).
Connection
When the client successfully connects to OKX servers, the event OnOKXConnect is fired. If there is any error while trying to connect, the event OnOKXError will be fired with the error details.
After the event OnOKXConnect is fired, then you can start to send and receive messages from OKX servers.
Subscribe to Channels
The websocket feed provides real-time market data updates for orders and trades. The websocket feed has some public channels like ticker, trades...
Place Orders
You can place an order only if you have sufficient funds.