Skip to main content

Bitfinex Trade Connector

Features

crypto-bitfinexConnector Key
Instruments
FXFUTURE
Request Types
SUBMITCANCELREPLACE
Order Types
MARKETLIMITSTOPSTOP_LIMIT
Time In Force
GTCIOCFOK
Order ID Mapper
SEQUENCE
Order Status Request
Cancel On Disconnect
Commission
Post Only
Fast Cancel
Fast Replace

Notes

Price Rounding

IMPORTANT

Bitfinex silently rounds order prices if they are not adjusted to the price increment.
It is very important to always adjust order price according its increment/precision.

Cancel/Replace

Bitfinex does not support In-Flight Mitigation:
the feature that allows submitting cancel/replace messages to prevent overfilling in the event that the original order is filled while the cancel/replace message is "in-flight" during processing.

warning

Although the connector formally supports order replaces, in-flight trades can lead to overfills. Therefore it is not recommended to use replace functionality.

Symbology

https://docs.bitfinex.com/docs/rest-general#supported-pairs

All pairs available in the platform are supported.
A symbol can be a trading pair or a margin currency.
All symbols are in uppercase (i.e. btcusd is invalid, BTCUSD is valid).

Trading pairs are prepended by a t before the pair (e.g. tBTCUSD, tETHUSD, ...).
Margin currencies are prepended by an f before the currency (e.g. fUSD, fBTC, ...).

Lists of available currencies and pairs can be retrieved through the Configs endpoint.

For a list of all currencies on the platform, look to:
https://api-pub.bitfinex.com/v2/conf/pub:list:currency

For a list of all trading pairs on the platform, look to:
https://api-pub.bitfinex.com/v2/conf/pub:list:pair:exchange

For a list of all margin trading pairs on the platform, look to:
https://api-pub.bitfinex.com/v2/conf/pub:list:pair:margin

Configuration

Connector settings

ParameterDefault ValueDescription
tradingTypeEXCHANGEOrder kind. Valid values: EXCHANGE, MARGIN
cancelOnDisconnecttrueDead-Man-Switch flag. When websocket is closed, cancel all account orders.
leverage1Leverage. For Futures only.
useTradeEventWithoutFeefalseSwitches between handling trade execution update (tu - with fees) event and trade executed (te - without fees) one.
logHeartbeatfalseEnables heartbeat logging.

Supported order attributes

KeyDescription
186 value used for post only orders submission.

Config sample

connectors {
BITFINEX: ${template.connector.crypto.bitfinex} {
settings {
restUrl = "https://api.bitfinex.com"
websocketUrl = "wss://api.bitfinex.com/ws/2"

tradingType = EXCHANGE
useTradeEventWithoutFee = false

apiKeys: [
{
apiKey = "<API_KEY>"
apiSecret = "<API_SECRET>"
}
]
}
}
}