bitfinex

package
v0.0.0-...-5d5b4e6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BTCUSD   = "BTCUSD"
	BTCFUSTF = "BTCF0:USTF0"
	BTCEUR   = "BTCEUR"
	BTCJPY   = "BTCJPY"
	LTCUSD   = "LTCUSD"
	LTCBTC   = "LTCBTC"
	ETHUSD   = "ETHUSD"
	ETHFUSTF = "ETHF0:USTF0"
	ETHBTC   = "ETHBTC"
	ETHEUR   = "ETHEUR"
	ETHJPY   = "ETHJPY"
	ETHGBP   = "ETHGBP"
	ETHUST   = "ETHUST"
	ETCUSD   = "ETCUSD"
	ETCBTC   = "ETCBTC"
	ZECUSD   = "ZECUSD"
	ZECBTC   = "ZECBTC"
	XMRUSD   = "XMRUSD"
	XMRBTC   = "XMRBTC"
	RRTUSD   = "RRTUSD"
	RRTBTC   = "RRTBTC"
	XRPUSD   = "XRPUSD"
	XRPBTC   = "XRPBTC"
	EOSETH   = "EOSETH"
	EOSUSD   = "EOSUSD"
	EOSBTC   = "EOSBTC"
	EOSEUR   = "EOSEUR"
	EOSJPY   = "EOSJPY"
	EOSGBP   = "EOSGBP"
	NEOUSD   = "NEOUSD"
	NEOBTC   = "NEOBTC"
	NEOETH   = "NEOETH"
	TRXUSD   = "TRXUSD"
	TRXBTC   = "TRXBTC"
	TRXETH   = "TRXETH"
	IOTUSD   = "IOTUSD"
	IOTBTC   = "IOTBTC"
	IOTETH   = "IOTETH"
	IOTEUR   = "IOTEUR"
	IOTJPY   = "IOTJPY"
	IOTGBP   = "IOTGBP"
	LEOUSD   = "LEOUSD"
	LEOBTC   = "LEOBTC"
	LEOUST   = "LEOUST"
	LEOEOS   = "LEOEOS"
	LEOETH   = "LEOETH"
)
View Source
const (
	FundingPrefix = "f"
	TradingPrefix = "t"
)

Prefixes for available pairs

View Source
const (
	PermissionRead  = "r"
	PermissionWrite = "w"
)
View Source
const (
	Dec_s     int = 9
	Time_s    int = 32
	Timestamp int = 32768
	Seq_all   int = 65536
	Checksum  int = 131072
)
View Source
const (
	// FrequencyRealtime book frequency gives updates as they occur in real-time.
	FrequencyRealtime BookFrequency = "F0"
	// FrequencyTwoPerSecond delivers two book updates per second.
	FrequencyTwoPerSecond BookFrequency = "F1"
	// PriceLevelDefault provides a constant default price level for book subscriptions.
	PriceLevelDefault int = 25
)
View Source
const (
	OrderFlagHidden   int = 64
	OrderFlagClose    int = 512
	OrderFlagPostOnly int = 4096
	OrderFlagOCO      int = 16384
)
View Source
const (
	OrderTypeMarket               = "MARKET"
	OrderTypeExchangeMarket       = "EXCHANGE MARKET"
	OrderTypeLimit                = "LIMIT"
	OrderTypeExchangeLimit        = "EXCHANGE LIMIT"
	OrderTypeStop                 = "STOP"
	OrderTypeExchangeStop         = "EXCHANGE STOP"
	OrderTypeTrailingStop         = "TRAILING STOP"
	OrderTypeExchangeTrailingStop = "EXCHANGE TRAILING STOP"
	OrderTypeFOK                  = "FOK"
	OrderTypeExchangeFOK          = "EXCHANGE FOK"
	OrderTypeStopLimit            = "STOP LIMIT"
	OrderTypeExchangeStopLimit    = "EXCHANGE STOP LIMIT"
)

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func F64Slice

func F64Slice(in []interface{}) ([]float64, error)

func IsRawBook

func IsRawBook(precision string) bool

func NewMarginInfoFromRaw

func NewMarginInfoFromRaw(raw []interface{}) (o interface{}, err error)

marginInfoFromRaw returns either a MarginInfoBase or MarginInfoUpdate, since the Margin Info is split up into a base and per symbol parts.

func ToFloat64Array

func ToFloat64Array(i [][]interface{}) ([][]float64, error)

func ToFloat64Slice

func ToFloat64Slice(slice []interface{}) []float64

func ToInterface

func ToInterface(flt []float64) []interface{}

func ToInterfaceArray

func ToInterfaceArray(i []interface{}) [][]interface{}

Types

type BalanceInfo

type BalanceInfo struct {
	TotalAUM float64
	NetAUM   float64
}

func NewBalanceInfoFromRaw

func NewBalanceInfoFromRaw(raw []interface{}) (o *BalanceInfo, err error)

type BalanceUpdate

type BalanceUpdate BalanceInfo

type BookAction

type BookAction bookAction

BookAction represents a new/update or removal for a book entry.

const (
	//BookUpdateEntry represents a new or updated book entry.
	BookUpdateEntry BookAction = 0
	//BookRemoveEntry represents a removal of a book entry.
	BookRemoveEntry BookAction = 1
)

type BookFrequency

type BookFrequency bookFrequency

BookFrequency provides a typed book frequency.

type BookPrecision

type BookPrecision bookPrecision

BookPrecision provides a typed book precision level.

const (
	// Aggregate precision levels
	Precision0 BookPrecision = "P0"
	Precision2 BookPrecision = "P2"
	Precision1 BookPrecision = "P1"
	Precision3 BookPrecision = "P3"
	// Raw precision
	PrecisionRawBook BookPrecision = "R0"
)

Book precision levels

type BookUpdate

type BookUpdate struct {
	ID          int64       // the book update ID, optional
	Symbol      string      // book symbol
	Price       float64     // updated price
	PriceJsNum  json.Number // update price as json.Number
	Count       int64       // updated count, optional
	Amount      float64     // updated amount
	AmountJsNum json.Number // update amount as json.Number
	Side        OrderSide   // side
	Action      BookAction  // action (add/remove)
}

BookUpdate represents an order book price update.

func NewBookUpdateFromRaw

func NewBookUpdateFromRaw(symbol, precision string, data []interface{}, raw_numbers interface{}) (b *BookUpdate, err error)

NewBookUpdateFromRaw creates a new book update object from raw data. Precision determines how to interpret the side (baked into Count versus Amount) raw book updates [ID, price, qty], aggregated book updates [price, amount, count]

type BookUpdateSnapshot

type BookUpdateSnapshot struct {
	Snapshot []*BookUpdate
}

func NewBookUpdateSnapshotFromRaw

func NewBookUpdateSnapshotFromRaw(symbol, precision string, raw [][]float64, raw_numbers interface{}) (*BookUpdateSnapshot, error)

type Candle

type Candle struct {
	Symbol     string
	Resolution CandleResolution
	MTS        int64
	Open       float64
	Close      float64
	High       float64
	Low        float64
	Volume     float64
}

func NewCandleFromRaw

func NewCandleFromRaw(symbol string, resolution CandleResolution, raw []interface{}) (c *Candle, err error)

type CandleResolution

type CandleResolution candleResolution

CandleResolution provides a typed set of resolutions for candle subscriptions.

const (
	OneMinute      CandleResolution = "1m"
	FiveMinutes    CandleResolution = "5m"
	FifteenMinutes CandleResolution = "15m"
	ThirtyMinutes  CandleResolution = "30m"
	OneHour        CandleResolution = "1h"
	ThreeHours     CandleResolution = "3h"
	SixHours       CandleResolution = "6h"
	TwelveHours    CandleResolution = "12h"
	OneDay         CandleResolution = "1D"
	OneWeek        CandleResolution = "7D"
	TwoWeeks       CandleResolution = "14D"
	OneMonth       CandleResolution = "1M"
)

Candle resolutions

func CandleResolutionFromString

func CandleResolutionFromString(str string) (CandleResolution, error)

type CandleSnapshot

type CandleSnapshot struct {
	Snapshot []*Candle
}

func NewCandleSnapshotFromRaw

func NewCandleSnapshotFromRaw(symbol string, resolution CandleResolution, raw [][]float64) (*CandleSnapshot, error)

type Credit

type Credit struct {
	ID            int64
	Symbol        string
	Side          string
	MTSCreated    int64
	MTSUpdated    int64
	Amout         float64
	Flags         interface{}
	Status        CreditStatus
	Rate          float64
	Period        int64
	MTSOpened     int64
	MTSLastPayout int64
	Notify        bool
	Hidden        bool
	Insure        bool
	Renew         bool
	RateReal      float64
	NoClose       bool
	PositionPair  string
}

func NewCreditFromRaw

func NewCreditFromRaw(raw []interface{}) (o *Credit, err error)

type CreditStatus

type CreditStatus string
const (
	CreditStatusActive          CreditStatus = "ACTIVE"
	CreditStatusExecuted        CreditStatus = "EXECUTED"
	CreditStatusPartiallyFilled CreditStatus = "PARTIALLY FILLED"
	CreditStatusCanceled        CreditStatus = "CANCELED"
)

type CurrencyConf

type CurrencyConf struct {
	Currency  string
	Label     string
	Symbol    string
	Pairs     []string
	Pools     []string
	Explorers ExplorerConf
	Unit      string
}

func NewCurrencyConfFromRaw

func NewCurrencyConfFromRaw(raw []RawCurrencyConf) ([]CurrencyConf, error)

type CurrencyConfigMapping

type CurrencyConfigMapping string
const (
	CurrencyLabelMap    CurrencyConfigMapping = "pub:map:currency:label"
	CurrencySymbolMap   CurrencyConfigMapping = "pub:map:currency:sym"
	CurrencyUnitMap     CurrencyConfigMapping = "pub:map:currency:unit"
	CurrencyExplorerMap CurrencyConfigMapping = "pub:map:currency:explorer"
	CurrencyExchangeMap CurrencyConfigMapping = "pub:list:pair:exchange"
)

type DerivativeStatus

type DerivativeStatus struct {
	Symbol               string
	MTS                  int64
	Price                float64
	SpotPrice            float64
	InsuranceFundBalance float64
	FundingAccrued       float64
	FundingStep          float64
}

func NewDerivativeStatusFromRaw

func NewDerivativeStatusFromRaw(raw []interface{}) (*DerivativeStatus, error)

func NewDerivativeStatusFromWsRaw

func NewDerivativeStatusFromWsRaw(symbol string, raw []interface{}) (*DerivativeStatus, error)

type DerivativeStatusSnapshot

type DerivativeStatusSnapshot struct {
	Snapshot []*DerivativeStatus
}

func NewDerivativeSnapshotFromRaw

func NewDerivativeSnapshotFromRaw(raw [][]interface{}) (*DerivativeStatusSnapshot, error)

type ExplorerConf

type ExplorerConf struct {
	BaseUri        string
	AddressUri     string
	TransactionUri string
}

type FundingCreditCancel

type FundingCreditCancel Credit

type FundingCreditNew

type FundingCreditNew Credit

type FundingCreditSnapshot

type FundingCreditSnapshot struct {
	Snapshot []*Credit
}

func NewFundingCreditSnapshotFromRaw

func NewFundingCreditSnapshotFromRaw(raw []interface{}) (snap *FundingCreditSnapshot, err error)

type FundingCreditUpdate

type FundingCreditUpdate Credit

type FundingInfo

type FundingInfo struct {
	Symbol       string
	YieldLoan    float64
	YieldLend    float64
	DurationLoan float64
	DurationLend float64
}

func NewFundingInfoFromRaw

func NewFundingInfoFromRaw(raw []interface{}) (o *FundingInfo, err error)

type FundingLoanCancel

type FundingLoanCancel Loan

type FundingLoanNew

type FundingLoanNew Loan

type FundingLoanSnapshot

type FundingLoanSnapshot struct {
	Snapshot []*Loan
}

func NewFundingLoanSnapshotFromRaw

func NewFundingLoanSnapshotFromRaw(raw []interface{}) (snap *FundingLoanSnapshot, err error)

type FundingLoanUpdate

type FundingLoanUpdate Loan

type FundingOfferCancel

type FundingOfferCancel Offer

type FundingOfferNew

type FundingOfferNew Offer

type FundingOfferSnapshot

type FundingOfferSnapshot struct {
	Snapshot []*Offer
}

func NewFundingOfferSnapshotFromRaw

func NewFundingOfferSnapshotFromRaw(raw []interface{}) (snap *FundingOfferSnapshot, err error)

type FundingOfferUpdate

type FundingOfferUpdate Offer

type FundingTrade

type FundingTrade struct {
	ID         int64
	Symbol     string
	MTSCreated int64
	OfferID    int64
	Amount     float64
	Rate       float64
	Period     int64
	Maker      int64
}

func NewFundingTradeFromRaw

func NewFundingTradeFromRaw(raw []interface{}) (o *FundingTrade, err error)

type FundingTradeExecution

type FundingTradeExecution FundingTrade

type FundingTradeSnapshot

type FundingTradeSnapshot struct {
	Snapshot []*FundingTrade
}

func NewFundingTradeSnapshotFromRaw

func NewFundingTradeSnapshotFromRaw(raw []interface{}) (snap *FundingTradeSnapshot, err error)

type FundingTradeUpdate

type FundingTradeUpdate FundingTrade

type Heartbeat

type Heartbeat struct {
}

type HistoricalCredit

type HistoricalCredit Credit

type HistoricalFundingTradeSnapshot

type HistoricalFundingTradeSnapshot FundingTradeSnapshot

type HistoricalLoan

type HistoricalLoan Loan

type HistoricalOffer

type HistoricalOffer Offer

type HistoricalTradeSnapshot

type HistoricalTradeSnapshot TradeExecutionUpdateSnapshot

type Ledger

type Ledger struct {
	ID          int64
	Currency    string
	Nil1        float64
	MTS         int64
	Nil2        float64
	Amount      float64
	Balance     float64
	Nil3        float64
	Description string
}

func NewLedgerFromRaw

func NewLedgerFromRaw(raw []interface{}) (o *Ledger, err error)

NewLedgerFromRaw takes the raw list of values as returned from the websocket service and tries to convert it into an Ledger.

type LedgerSnapshot

type LedgerSnapshot struct {
	Snapshot []*Ledger
}

func NewLedgerSnapshotFromRaw

func NewLedgerSnapshotFromRaw(raw []interface{}) (s *LedgerSnapshot, err error)

LedgerSnapshotFromRaw takes a raw list of values as returned from the websocket service and tries to convert it into an LedgerSnapshot.

type Loan

type Loan struct {
	ID            int64
	Symbol        string
	Side          string
	MTSCreated    int64
	MTSUpdated    int64
	Amout         float64
	Flags         interface{}
	Status        LoanStatus
	Rate          float64
	Period        int64
	MTSOpened     int64
	MTSLastPayout int64
	Notify        bool
	Hidden        bool
	Insure        bool
	Renew         bool
	RateReal      float64
	NoClose       bool
}

func NewLoanFromRaw

func NewLoanFromRaw(raw []interface{}) (o *Loan, err error)

type LoanStatus

type LoanStatus string
const (
	LoanStatusActive          LoanStatus = "ACTIVE"
	LoanStatusExecuted        LoanStatus = "EXECUTED"
	LoanStatusPartiallyFilled LoanStatus = "PARTIALLY FILLED"
	LoanStatusCanceled        LoanStatus = "CANCELED"
)

type MarginInfoBase

type MarginInfoBase struct {
	UserProfitLoss float64
	UserSwaps      float64
	MarginBalance  float64
	MarginNet      float64
}

func NewMarginInfoBaseFromRaw

func NewMarginInfoBaseFromRaw(raw []interface{}) (o *MarginInfoBase, err error)

type MarginInfoUpdate

type MarginInfoUpdate struct {
	Symbol          string
	TradableBalance float64
}

func NewMarginInfoUpdateFromRaw

func NewMarginInfoUpdateFromRaw(symbol string, raw []interface{}) (o *MarginInfoUpdate, err error)

type Mts

type Mts int64

type Notification

type Notification struct {
	MTS        int64
	Type       string
	MessageID  int64
	NotifyInfo interface{}
	Code       int64
	Status     string
	Text       string
}

func NewNotificationFromRaw

func NewNotificationFromRaw(raw []interface{}) (o *Notification, err error)

type Offer

type Offer struct {
	ID         int64
	Symbol     string
	MTSCreated int64
	MTSUpdated int64
	Amout      float64
	AmountOrig float64
	Type       string
	Flags      interface{}
	Status     OfferStatus
	Rate       float64
	Period     int64
	Notify     bool
	Hidden     bool
	Insure     bool
	Renew      bool
	RateReal   float64
}

func NewOfferFromRaw

func NewOfferFromRaw(raw []interface{}) (o *Offer, err error)

type OfferStatus

type OfferStatus string
const (
	OfferStatusActive          OfferStatus = "ACTIVE"
	OfferStatusExecuted        OfferStatus = "EXECUTED"
	OfferStatusPartiallyFilled OfferStatus = "PARTIALLY FILLED"
	OfferStatusCanceled        OfferStatus = "CANCELED"
)

type Order

type Order struct {
	ID            int64
	GID           int64
	CID           int64
	Symbol        string
	MTSCreated    int64
	MTSUpdated    int64
	Amount        float64
	AmountOrig    float64
	Type          string
	TypePrev      string
	MTSTif        int64
	Flags         int64
	Status        OrderStatus
	Price         float64
	PriceAvg      float64
	PriceTrailing float64
	PriceAuxLimit float64
	Notify        bool
	Hidden        bool
	PlacedID      int64
}

Order as returned from the bitfinex websocket service.

func NewOrderFromRaw

func NewOrderFromRaw(raw []interface{}) (o *Order, err error)

NewOrderFromRaw takes the raw list of values as returned from the websocket service and tries to convert it into an Order.

type OrderCancel

type OrderCancel Order

OrderCancel gets sent out after an Order was cancelled successfully.

type OrderCancelRequest

type OrderCancelRequest struct {
	ID      int64  `json:"id,omitempty"`
	CID     int64  `json:"cid,omitempty"`
	CIDDate string `json:"cid_date,omitempty"`
}

OrderCancelRequest represents an order cancel request. An order can be cancelled using the internal ID or a combination of Client ID (CID) and the daten for the given CID.

func (*OrderCancelRequest) MarshalJSON

func (o *OrderCancelRequest) MarshalJSON() ([]byte, error)

MarshalJSON converts the order cancel object into the format required by the bitfinex websocket service.

type OrderNew

type OrderNew Order

OrderNew gets sent out after an Order was created successfully.

type OrderNewRequest

type OrderNewRequest struct {
	GID           int64   `json:"gid"`
	CID           int64   `json:"cid"`
	Type          string  `json:"type"`
	Symbol        string  `json:"symbol"`
	Amount        float64 `json:"amount,string"`
	Price         float64 `json:"price,string"`
	PriceTrailing float64 `json:"price_trailing,string,omitempty"`
	PriceAuxLimit float64 `json:"price_aux_limit,string,omitempty"`
	PriceOcoStop  float64 `json:"price_oco_stop,string,omitempty"`
	Hidden        bool    `json:"hidden,omitempty"`
	PostOnly      bool    `json:"postonly,omitempty"`
	Close         bool    `json:"close,omitempty"`
	OcoOrder      bool    `json:"oco_order,omitempty"`
	TimeInForce   string  `json:"tif,omitempty"`
}

OrderNewRequest represents an order to be posted to the bitfinex websocket service.

func (*OrderNewRequest) MarshalJSON

func (o *OrderNewRequest) MarshalJSON() ([]byte, error)

MarshalJSON converts the order object into the format required by the bitfinex websocket service.

type OrderSide

type OrderSide orderSide

OrderSide provides a typed set of order sides.

const (
	Bid   OrderSide = 1
	Ask   OrderSide = 2
	Long  OrderSide = 1
	Short OrderSide = 2
)

Order sides

type OrderSnapshot

type OrderSnapshot struct {
	Snapshot []*Order
}

OrderSnapshot is a collection of Orders that would usually be sent on inital connection.

func NewOrderSnapshotFromRaw

func NewOrderSnapshotFromRaw(raw []interface{}) (s *OrderSnapshot, err error)

OrderSnapshotFromRaw takes a raw list of values as returned from the websocket service and tries to convert it into an OrderSnapshot.

type OrderStatus

type OrderStatus string

OrderStatus represents the possible statuses an order can be in.

const (
	OrderStatusActive          OrderStatus = "ACTIVE"
	OrderStatusExecuted        OrderStatus = "EXECUTED"
	OrderStatusPartiallyFilled OrderStatus = "PARTIALLY FILLED"
	OrderStatusCanceled        OrderStatus = "CANCELED"
)

type OrderType

type OrderType string

OrderType represents the types orders the bitfinex platform can handle.

type OrderUpdate

type OrderUpdate Order

OrderUpdate is an Order that gets sent out after every change to an order.

type OrderUpdateRequest

type OrderUpdateRequest struct {
	ID            int64   `json:"id"`
	GID           int64   `json:"gid,omitempty"`
	Price         float64 `json:"price,string,omitempty"`
	Amount        float64 `json:"amount,string,omitempty"`
	Delta         float64 `json:"delta,string,omitempty"`
	PriceTrailing float64 `json:"price_trailing,string,omitempty"`
	PriceAuxLimit float64 `json:"price_aux_limit,string,omitempty"`
	Hidden        bool    `json:"hidden,omitempty"`
	PostOnly      bool    `json:"postonly,omitempty"`
	TimeInForce   string  `json:"tif,omitempty"`
}

func (*OrderUpdateRequest) MarshalJSON

func (o *OrderUpdateRequest) MarshalJSON() ([]byte, error)

MarshalJSON converts the order object into the format required by the bitfinex websocket service.

type PermissionType

type PermissionType string

type Position

type Position struct {
	Symbol               string
	Status               PositionStatus
	Amount               float64
	BasePrice            float64
	MarginFunding        float64
	MarginFundingType    int64
	ProfitLoss           float64
	ProfitLossPercentage float64
	LiquidationPrice     float64
	Leverage             float64
}

func NewPositionFromRaw

func NewPositionFromRaw(raw []interface{}) (o *Position, err error)

type PositionCancel

type PositionCancel Position

type PositionNew

type PositionNew Position

type PositionSnapshot

type PositionSnapshot struct {
	Snapshot []*Position
}

func NewPositionSnapshotFromRaw

func NewPositionSnapshotFromRaw(raw []interface{}) (s *PositionSnapshot, err error)

type PositionStatus

type PositionStatus string
const (
	PositionStatusActive PositionStatus = "ACTIVE"
	PositionStatusClosed PositionStatus = "CLOSED"
)

type PositionUpdate

type PositionUpdate Position

type QueryLimit

type QueryLimit int
const QueryLimitMax QueryLimit = 1000

type RawCurrencyConf

type RawCurrencyConf struct {
	Mapping string
	Data    interface{}
}

type SortOrder

type SortOrder int
const (
	OldestFirst SortOrder = 1
	NewestFirst SortOrder = -1
)

type Stat

type Stat struct {
	Period int64
	Volume float64
}

type StatKey

type StatKey string
const (
	FundingSizeKey   StatKey = "funding.size"
	CreditSizeKey    StatKey = "credits.size"
	CreditSizeSymKey StatKey = "credits.size.sym"
	PositionSizeKey  StatKey = "pos.size"
)

type StatusType

type StatusType string
const (
	DerivativeStatusType StatusType = "deriv"
)

type Ticker

type Ticker struct {
	Symbol          string
	Bid             float64
	BidPeriod       int64
	BidSize         float64
	Ask             float64
	AskPeriod       int64
	AskSize         float64
	DailyChange     float64
	DailyChangePerc float64
	LastPrice       float64
	Volume          float64
	High            float64
	Low             float64
	FRR             float64
}

func NewTickerFromRaw

func NewTickerFromRaw(symbol string, raw []interface{}) (t *Ticker, err error)

func NewTickerFromRestRaw

func NewTickerFromRestRaw(raw []interface{}) (t *Ticker, err error)

type TickerSnapshot

type TickerSnapshot struct {
	Snapshot []*Ticker
}

func NewTickerSnapshotFromRaw

func NewTickerSnapshotFromRaw(symbol string, raw [][]float64) (*TickerSnapshot, error)

type TickerUpdate

type TickerUpdate Ticker

type Trade

type Trade struct {
	Pair   string
	ID     int64
	MTS    int64
	Amount float64
	Price  float64
	Side   OrderSide
}

Trade represents a trade on the public data feed.

func NewTradeFromRaw

func NewTradeFromRaw(pair string, raw []interface{}) (o *Trade, err error)

type TradeExecution

type TradeExecution struct {
	ID         int64
	Pair       string
	MTS        int64
	OrderID    int64
	Amount     float64
	Price      float64
	OrderType  string
	OrderPrice float64
	Maker      int
}

TradeExecution represents the first message receievd for a trade on the private data feed.

func NewTradeExecutionFromRaw

func NewTradeExecutionFromRaw(raw []interface{}) (o *TradeExecution, err error)

type TradeExecutionUpdate

type TradeExecutionUpdate struct {
	ID          int64
	Pair        string
	MTS         int64
	OrderID     int64
	ExecAmount  float64
	ExecPrice   float64
	OrderType   string
	OrderPrice  float64
	Maker       int
	Fee         float64
	FeeCurrency string
}

TradeExecutionUpdate represents a full update to a trade on the private data feed. Following a TradeExecution, TradeExecutionUpdates include additional details, e.g. the trade's execution ID (TradeID).

func NewTradeExecutionUpdateFromRaw

func NewTradeExecutionUpdateFromRaw(raw []interface{}) (o *TradeExecutionUpdate, err error)

public trade update just looks like a trade

type TradeExecutionUpdateSnapshot

type TradeExecutionUpdateSnapshot struct {
	Snapshot []*TradeExecutionUpdate
}

func NewTradeExecutionUpdateSnapshotFromRaw

func NewTradeExecutionUpdateSnapshotFromRaw(raw []interface{}) (s *TradeExecutionUpdateSnapshot, err error)

type TradeSnapshot

type TradeSnapshot struct {
	Snapshot []*Trade
}

func NewTradeSnapshotFromRaw

func NewTradeSnapshotFromRaw(pair string, raw [][]float64) (*TradeSnapshot, error)

type Wallet

type Wallet struct {
	Type              string
	Currency          string
	Balance           float64
	UnsettledInterest float64
	BalanceAvailable  float64
}

func NewWalletFromRaw

func NewWalletFromRaw(raw []interface{}) (o *Wallet, err error)

type WalletSnapshot

type WalletSnapshot struct {
	Snapshot []*Wallet
}

func NewWalletSnapshotFromRaw

func NewWalletSnapshotFromRaw(raw []interface{}) (s *WalletSnapshot, err error)

type WalletUpdate

type WalletUpdate Wallet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL