25 Aug API Improvements
Dear Bitfinex User,
Bitfinex is growing faster than ever, and we are pleased that our platform, trading engine and APIs have remained reliable and performant during these exciting times.
In order to continue to be able to accommodate current demand and future scaling however, the Bitfinex REST and WebSocket APIs will be upgraded on Thursday, August 31st.
In order to continue to be able to handle spikes in platform load, we need to make adjustments to how we return historical snapshot messages when authenticating to the WebSocket APIs. Currently `hos`, `hts`, `hfts`, `hfos`, `hfls`, `hfcs` snapshots are returned in the WebSocket feed after authenticating. These snapshots will no longer be returned via the WebSocket feed (both V1 and V2) after August 31 and equivalent REST endpoints are available as replacement. As a result, all update messages will remain unchanged.
If your API application relies on these historical snapshots, these changes may affect your application. As a result, please take the time to review the following and make sure to properly update your code if needed.
The changes, expanded upon below, will work to ensure optimal API performance, therefore minimising latency, to the benefit of our users.
Changes with immediate effect: These changes are preparations for the changes that will be made on August 31.
- new restV1: /v1/orders/hist (limited to last 3 days and last 1000 results)
- restV1 Authenticated historical orders query (can be called only once per minute)
- https://docs.bitfinex.com/v1/reference#rest-auth-orders-history
- new restV1: /v1/offers/hist (limited to last 3 days and last 1000 results)
- restV1 Authenticated historical offers query (can be called only once per minute)
- https://docs.bitfinex.com/v1/reference#rest-auth-offers-hist
- New restV1: /v1/mytrades_funding
- restV1 Authenticated historical margin funding trades
- https://docs.bitfinex.com/v1/reference#rest-auth-mytrades-funding
- new restV2: /v2/platform/status
- Status of the platform
- `[0]` Maintenance mode: trading engine pause / resync (after event 20060 is triggered)
- `[1]` Active: normal operations (after event 20061 is triggered)
- https://docs.bitfinex.com/v2/reference#rest-public-platform-status
- Status of the platform
- restV2 ERR_MAINT will be returned by all API endpoints during the maintenance period.
- new restV2: /v2/auth/r/funding/credits
- Active funding credits (funds used in positions)
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-credits
- new restV2: /v2/auth/r/funding/credits/hist
- Inactive funding credits (funds used in positions)
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-credits-hist
- new restV2: /v2/auth/r/funding/loans
- Active funding loans
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-loans
- new restV2: /v2/auth/r/funding/loans/hist
- Inactive funding loans
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-loans-hist
- new restV2: /v2/auth/r/funding/offers
- Active funding offers
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-offers
- new restV2: /v2/auth/r/funding/offers/hist (limited to 3 days)
- Historical funding offers
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-offers-hist
- new restV2: /v2/auth/r/funding/offers/SYMBOL/hist (limited to last 3 days)
- Historical funding offers by symbol
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-offers-hist
- new restV2: /v2/auth/r/funding/trades/hist (limited to last 15 days)
- Historical funding trades
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-trades
- new restV2: /v2/auth/r/funding/trades/SYMBOL/hist (limited to last 15 days)
- Historical funding trades by symbol
- https://docs.bitfinex.com/v2/reference#rest-auth-funding-trades
- new restV2: /v2/auth/r/orders
- Active orders
- https://docs.bitfinex.com/v2/reference#rest-auth-orders
- new restV2: /v2/auth/r/orders/hist (limited to 3 days)
- Historical orders
- https://docs.bitfinex.com/v2/reference#rest-auth-orders-hist
- new restV2: /v2/auth/r/orders/SYMBOL/hist (limited to last 3 days)
- Historical orders by symbol
- https://docs.bitfinex.com/v2/reference#rest-auth-orders-hist
- new restV2: /v2/auth/r/trades/hist (limited to 7 days)
- Historical trades
- https://docs.bitfinex.com/v2/reference#rest-auth-trades-hist
- new restV2: /v2/auth/r/trades/SYMBOL/hist (limited to last 7 days)
- Historical trades by symbol
- https://docs.bitfinex.com/v2/reference#rest-auth-trades-hist
- new restV2: /v2/auth/r/movements/hist (limited to last 90 days)
- Historical movements (deposits/withdrawals) history
- new restV2: /v2/auth/r/movements/CURRENCY/hist (limited to 90 days)
- Historical movements (deposits/withdrawals) history by currency
- Websocket event code 20060 now means: Maintenance start
- Pause trading is suggested until receiving 20061
- Note that there is no change in the behaviour, this is just a more meaningful description
- Websocket event code 20061 now means: Maintenance end.
Changes to be deployed on 31/08/2017:
Some of these change can result in backward compatibility issues. Please subsequently make sure to adjust your code to prevent unexpected behaviour of your application.
- Websocket books (v1 and v2): drop support for F2, F3 frequencies
- Endpoint restV2: /v2/auth/r/offers renamed to: /v2/auth/r/funding/offers
- Endpoint restV2: /v2/auth/r/funding renamed to: /v2/auth/r/info/funding
- Endpoint restV2: /v2/auth/r/trading renamed to: /v2/auth/r/info/trading
- Endpoint restV1 /v1/book “timestamp” field will now contain the timestamp at the moment of calculation of the book
- The “timestamp” field is deprecated and will be removed in a future update
- Endpoint restV1 /v1/lendbook “timestamp” field will now contain the timestamp at the moment of calculation of the book
- The “timestamp” field is deprecated and will be removed in a future update
- WebSocket v1 and v2 authenticated: historical snapshots `hos`, `hts` removed:
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-orders
Only snapshot `hos` will be removed, while updates `on`, `ou` , `oc` will flow as usual. Historic Order Snapshot can be retrieved via REST calls:- WS V1 users: use /v1/orders/hist
- WS V2 users: use /v2/auth/r/orders/hist
or /v2/auth/r/orders/SYMBOL/hist (to filter on specific pair)
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-orders
- https://docs.bitfinex.com/v2/reference#ws-auth-trades
Only snapshot `hts` will be removed, while updates `te`, `tu` will flow as usual.
Historic Trades Snapshot can be retrieved via REST calls:- WS V1 users: use restV1 /v1/mytrades
- WS V2 users: use restV2 /v2/auth/r/trades/hist instead,
or /v2/auth/r/trades/SYMBOL/hist (to filter on specific pair)
Please note that there is no change in snapshots for public WebSocket channels and for all the other messages: `ps`, `pn`, `pu`, `pc`, `wu`, `ws`. These will remain unchanged for both WebSocket v1 and v2.
- WebSocket v2 authenticated: historical snapshots `hfts`, `hfos`, `hfls`, `hfcs` removed:
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-offers
Only snapshot `htos` will be removed, while updates ‘fon‘, ‘fou‘, ‘foc‘ will flow as usual. Historic Funding Offers Snapshot can be retrieved via REST calls:- RestV2: /v2/auth/r/funding/offers/SYMBOL/hist
or /v2/auth/r/funding/offers/SYMBOL/hist (to filter on specific currency)
- RestV2: /v2/auth/r/funding/offers/SYMBOL/hist
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-credits
Only snapshot `hfcs` will be removed, while updates ‘fcn‘, ‘fcu‘, ‘fcc‘ will flow as usual. Historic Credits Snapshot can be retrieved via REST calls:- RestV2: /v2/auth/r/funding/credits/hist
or /v2/auth/r/funding/credits/SYMBOL/hist (to filter on specific currency)
- RestV2: /v2/auth/r/funding/credits/hist
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-loans
Only snapshot `hfls` will be removed, while updates ‘fln‘, ‘flu‘, ‘flc‘ will flow as usual. Historic Credits Snapshot can be retrieved via REST calls:- RestV2: /v2/auth/r/funding/hist
or /v2/auth/r/funding/loans/SYMBOL/hist (to filter on specific currency)
- RestV2: /v2/auth/r/funding/hist
- https://docs.bitfinex.com/v2/reference#ws-auth-funding-trades
Only snapshot `hfts` will be removed, while updates `fte`, `ftu` will flow as usual. Historic Trades Snapshot can be retrieved via REST calls:- RestV2: /v2/auth/r/funding/trades/hist
or /v2/auth/r/funding/trades/SYMBOL/hist (to filter on specific currency)
- RestV2: /v2/auth/r/funding/trades/hist
- https://docs.bitfinex.com/v2/reference#ws-auth-historical-offers