In contrast with HTTP request/response connections, websockets give the ability to send and receive data from and to our API in rapid succession.

For trading, speed is important and for this reason eosfinex’ API supports both http and websockets.

In order to receive data, you need to subscribe to channels. We provide a guide on how to do this.

Public Channels

eosfinex uses the public channels from Bitfinex:

Public URL

wss://api-pub.bitfinex.com/ws/2

Rate Limit

The rate limit for the wss://api-pub.bitfinex.com/ domain is set at 20 connections per minute.

Connecting to a public channel

Use a subscription message to subscribe to a channel:

{
   "event": "subscribe",
   "channel": CHANNEL_NAME
}

The following public channels are available:

For more information on public channels see:
https://docs.bitfinex.com/docs/ws-public

For the list of available pairs see Symbols

Private Channels

Private URL

wss://api.eosfinex.com/ws/

Connecting to private channels

After a WebSocket connection to wss://api.eosfinex.com/ws/ has been established, the client needs to log in by sending an authentication message.

There are two ways to do this:

  • The secure way, send an auth message with a signed transaction in the meta field.
{
  "event": "auth",
  "account": "<EOS_account_name>",
  "meta": <signed_EOS_transaction>
}

Secure Example:

{
  "event": "auth",
  "account": "eosfinex1113",
  "meta": {
    "expiration": "2020-12-17T17:46:44.000",
    "ref_block_num": 4489,
    "ref_block_prefix": 3002988496,
    "max_net_usage_words": 0,
    "max_cpu_usage_ms": 0,
    "delay_sec": 0,
    "context_free_actions": [],
    "actions": [
      {
        "account": "eosfinextest",
        "name": "validate",
        "authorization": [{ "actor": "eosfinex1113", "permission": "active" }],
        "data": "3042085D4DB73055"
      }
    ],
    "transaction_extensions": [],
    "signatures": [
"SIG_K1_K8sXoXTpCsvghy3SVtqF4tTHq2fayfHT7iuA5yHUKsJEqZUUYarScsCJEYACrTAsX6Zsx52RtFirPzTB6S7q46Fdqesqxh"
    ]
  }
}

  • The unsecure way, send a simple authentication message
{
  "event": "auth",
  "account": "<EOS_account_name>",
  "secret": "<secret_key>"
}

❗️

secret_key

This is the secret key for you EOS account. We do not store it. But it is extremely unsafe to use the secret key directly

After you successful logged in, you will automatically receive information about your wallet balance and open orders. Now your connection is ready to place and cancel orders.

The following private channels are available:

The API Reference can be found here:
https://eosfinex.readme.io/reference