Skip to content

Bitfinex

HaasOnline connects to Bitfinex spot trading. The key needs the read permissions and Create and cancel orders, and it should be restricted to HaasOnline's IP addresses.

If you don't have a Bitfinex account yet, sign up at Bitfinex.

Danger

Create a separate key for HaasOnline. Bitfinex keys can't be shared between programs: each request carries an increasing number (nonce), so two programs using the same key reject each other's requests.

Obtaining the API Key

Log in to Bitfinex, open the account menu at the top right and click API Keys.

Bitfinex account menu with API Keys.

On the API page, click New API key.

Bitfinex API page with the New API key button and an empty My API keys list.

Label and IP restriction

The Create a new API key dialog opens. Fill it in:

  • Label: any name that identifies the key (for example HaasOnline API).
  • Expiry date: the key stops working on this date, and HaasOnline can't trade after it. Pick a date far enough ahead.
  • IP Access restrictions: choose Restrict access by IP and paste the IP addresses shown in HaasOnline, separated by commas.

Bitfinex Create a new API key dialog with a label, expiry date, and Restrict access by IP selected.

Info

For the IP restriction:

  • On HaasOnline TradeServer Cloud, paste the addresses shown under IP addresses to whitelist in the HaasOnline account setup form (use its copy icon).
  • On a self-hosted TradeServer license, use the public IP address of your machine or server.

Click Next.

Read permissions

Click Allow all, then Next. Read permissions can't move funds. HaasOnline uses Get historical balances entries and trade information, Get orders and statuses and Get wallet balances and addresses; the others do no harm.

Bitfinex Read permissions with every permission switched on.

Write permissions

Switch on Create and cancel orders. Without it, HaasOnline can read your account but can't place or cancel orders.

Leave Create a new withdrawal and Transfer between your wallets off, along with Edit account information, Write account settings and Offer, cancel and close funding. Claim a position, switched on in the screenshot, is only used for margin positions and isn't needed: HaasOnline trades Bitfinex spot.

Bitfinex Write permissions with Create and cancel orders and Claim a position on, and withdrawals and wallet transfers off.

Danger

Do not enable Create a new withdrawal. HaasOnline never needs it to trade for you, and a trading-only key limits what a leaked key could do.

Click Generate API key.

Confirm

Enter the 6-digit code from your 2FA app.

Bitfinex Two-Factor Authentication dialog asking for the 2FA token.

Bitfinex then asks you to check your email. Open the email from Bitfinex and confirm the new key there.

Bitfinex Check your email dialog: confirm the new API key from the email.

Copy the keys

My new API key shows the new key:

Bitfinex My new API key panel with the API Key, API key secret and a QR code.

  • API Key: goes in the HaasOnline Public key field.
  • API key secret: goes in the HaasOnline Private key field.

Danger

Copy both now. Bitfinex shows the key only once ("Your API key will NOT be shown again"). If you lose it, delete the key and create a new one.

Adding the API to HaasOnline TradeServer Cloud

Log in to HaasOnline TradeServer Cloud and open Exchange Accounts from the user menu in the top right. The Adding an API to the Platform guide shows these first steps with screenshots.

  1. Click the + button at the bottom of the accounts list (on an empty page it reads Add account)
  2. Select Exchange account
  3. In Connect an exchange account, click Bitfinex. It has one market, so the setup form opens next
  4. Enter an Account name, then paste the values from Bitfinex:

    • Public key → the Bitfinex API Key
    • Private key → the Bitfinex API key secret

    Bitfinex account setup form with the IP whitelist, account name, public key and private key fields.

    Info

    Check for spaces at the start and end of each value after you paste it. Stray spaces are a common cause of a failed key test.

  5. Click Test keys. When the test passes, click Save account

If the test fails, check that Create and cancel orders is on, that the IP restriction matches the addresses shown in HaasOnline, and that the key hasn't passed its expiry date. If it still fails, contact Support.