# README
GoCryptoTrader package Bitfinex

This bitfinex package is part of the GoCryptoTrader codebase.
This is still in active development
You can track ideas, planned features and what's in progress on our GoCryptoTrader Kanban board.
Join our slack to discuss all things related to GoCryptoTrader! GoCryptoTrader Slack
Bitfinex Exchange
Current Features
- REST Support
- Websocket Support
How to enable
-
Individual package example below:
// Exchanges will be abstracted out in further updates and examples will be
// supplied then
How to do REST public/private calls
- If enabled via "configuration".json file the exchange will be added to the
IBotExchange array in the
go var bot Bot
and you will only be able to use the wrapper interface functions for accessing exchange data. View routines.go for an example of integration usage with GoCryptoTrader. Rudimentary example below:
main.go
var b exchange.IBotExchange
for i := range bot.Exchanges {
if bot.Exchanges[i].GetName() == "Bitfinex" {
b = bot.Exchanges[i]
}
}
// Public calls - wrapper functions
// Fetches current ticker information
tick, err := b.UpdateTicker(...)
if err != nil {
// Handle error
}
// Fetches current orderbook information
ob, err := b.UpdateOrderbook(...)
if err != nil {
// Handle error
}
// Private calls - wrapper functions - make sure your APIKEY and APISECRET are
// set and AuthenticatedAPISupport is set to true
// Fetches current account information
accountInfo, err := b.GetAccountInfo()
if err != nil {
// Handle error
}
- If enabled via individually importing package, rudimentary example below:
// Public calls
// Fetches current ticker information
ticker, err := b.GetTicker()
if err != nil {
// Handle error
}
// Fetches current orderbook information
ob, err := b.GetOrderBook()
if err != nil {
// Handle error
}
// Private calls - make sure your APIKEY and APISECRET are set and
// AuthenticatedAPISupport is set to true
// GetUserInfo returns account info
accountInfo, err := b.GetUserInfo(...)
if err != nil {
// Handle error
}
// Submits an order and the exchange and returns its tradeID
tradeID, err := b.Trade(...)
if err != nil {
// Handle error
}
How to do Websocket public/private calls
// Exchanges will be abstracted out in further updates and examples will be
// supplied then
Please click GoDocs chevron above to view current GoDoc information for this package
Contribution
Please feel free to submit any pull requests or suggest any desired features to be added.
When submitting a PR, please abide by our coding guidelines:
- Code must adhere to the official Go formatting guidelines (i.e. uses gofmt).
- Code must be documented adhering to the official Go commentary guidelines.
- Code must adhere to our coding style.
- Pull requests need to be based on and opened against the
master
branch.
Donations

If this framework helped you in any way, or you would like to support the developers working on it, please donate Bitcoin to:
bc1qk0jareu4jytc0cfrhr5wgshsq8282awpavfahc
# Functions
GetRateLimit returns the rate limit for the exchange.
# Constants
CandlesPeriodKey configures the Candles aggregated period for MarginFunding in subscription.Subscription.Params.
Leaderboard keys.
Leaderboard keys.
Leaderboard keys.
Leaderboard keys.
# Variables
AcceptedOrderType defines the accepted market types, exchange strings denote non-contract order types.
AcceptedWalletNames defines different wallets supported by the exchange.
# Structs
AccountFees stores withdrawal account fee data from Bitfinex.
AccountInfo general account information with fees.
AccountInfoFees general account information with fees.
AccountInfoFull adds the error message to Account info.
AccountSummary holds account summary data.
AccountV2Data stores account v2 data.
Balance holds current balance data.
BalanceHistory holds balance history information.
Bitfinex is the overarching type across the bitfinex package.
Book holds the orderbook item.
CancelMultiOrderResponse holds v2 cancelled order data.
Candle holds OHLC data.
Currency is a sub-type for AccountSummary data.
Deposit holds the deposit address info.
DerivativeDataResponse stores data for queried derivative.
ErrorCapture is a simple type for returned errors from Bitfinex.
Fee holds fee data for a specified currency.
FundingBook holds current the full margin funding book.
FundingBookItem is a generalised sub-type to hold book information.
GenericResponse holds the result for a generic response.
KeyPermissions holds the key permissions for the API key set.
LeaderboardEntry holds leaderboard data.
Lendbook holds most recent funding data for a relevant currency.
Lends holds the lent information by currency.
MarginData holds wallet information for margin trading.
MarginFundingData stores data for margin funding.
MarginFundingDataV2 stores margin funding data.
MarginFunds holds active funding information used in a margin position.
MarginInfo holds metadata for margin information from bitfinex.
MarginInfoV2 stores V2 margin data.
MarginLimits holds limit data per pair.
MarginTotalTakenFunds holds position funding including sum of active backing as total swaps.
MarginV2FundingData stores margin funding data.
MovementHistory holds deposit and withdrawal history data.
Offer holds offer information.
Order holds order information when an order is in the market.
Orderbook holds orderbook information from bid and ask sides.
OrderMultiResponse holds order information on the executed orders.
Permission sub-type for KeyPermissions.
PlaceOrder is used for order placement.
Position holds position information.
Stat holds individual statistics from exchange.
Ticker holds ticker information.
Trade holds resp information.
TradeHistory holds trade history data.
WalletDataV2 stores wallet data for v2.
WalletTransfer holds status of wallet to wallet content transfer on exchange.
WebsocketBook holds booking information.
WebsocketHandshake defines the communication between the websocket API for initial connection.
WebsocketOrder holds order data.
WebsocketPosition holds position information.
WebsocketTicker holds ticker information.
WebsocketTradeData holds executed trade data.
WebsocketTradeExecuted holds executed trade data.
WebsocketWallet holds wallet information.
Withdrawal holds withdrawal status information.
WsAuthRequest container for WS auth request.
WsBalanceInfo the total and net assets in your account received via websocket.
WsCancelAllOrdersRequest cancel all orders request.
WsCancelGroupOrdersRequest cancel orders request...
WsCancelOfferRequest cancel offer request.
WsCancelOrderRequest cancel order request...
WsCredit credit details received via websocket.
WsFundingInfo account funding info received via websocket.
WsFundingOffer funding offer received via websocket.
WsFundingTrade recent funding trades received via websocket.
WsMarginInfoBase account margin info received via websocket.
WsNewOfferRequest new offer request.
WsNewOrderRequest new order request...
WsUpdateOrderRequest update order request...
WsWallet wallet update details received via websocket.