Documentation ¶
Index ¶
- Variables
- type AcceptQuote
- type AccountInfoData
- type AccountOptionsInfoData
- type AllWalletAccountData
- type Authenticate
- type AuthenticationData
- type BalancesData
- type CancelQuoteRequestData
- type CreateQuoteRequestData
- type DepositData
- type FTX
- func (f *FTX) AcceptOTCQuote(quoteID string) error
- func (f *FTX) AcceptQuote(quoteID string) ([]QuoteForQuoteData, error)
- func (f *FTX) AuthenticateWebsocket() error
- func (f *FTX) CalcPartialOBChecksum(data *WsOrderbookData) int64
- func (f *FTX) CalcUpdateOBChecksum(data *orderbook.Base) int64
- func (f *FTX) CancelAllOrders(orderCancellation *order.Cancel) (order.CancelAllResponse, error)
- func (f *FTX) CancelOrder(order *order.Cancel) error
- func (f *FTX) ChangeAccountLeverage(leverage float64) error
- func (f *FTX) CreateQuoteRequest(underlying, optionType, side string, expiry int64, requestExpiry string, ...) (CreateQuoteRequestData, error)
- func (f *FTX) DeleteMyQuote(quoteID string) ([]QuoteForQuoteData, error)
- func (f *FTX) DeleteOrder(orderID string) (string, error)
- func (f *FTX) DeleteOrderByClientID(clientID string) (string, error)
- func (f *FTX) DeleteQuote(requestID string) (CancelQuoteRequestData, error)
- func (f *FTX) DeleteTriggerOrder(orderID string) (string, error)
- func (f *FTX) FetchAccountInfo() (account.Holdings, error)
- func (f *FTX) FetchDepositAddress(coin string) (DepositData, error)
- func (f *FTX) FetchDepositHistory() ([]TransactionData, error)
- func (f *FTX) FetchOrderHistory(marketName string, startTime, endTime time.Time, limit string) ([]OrderData, error)
- func (f *FTX) FetchOrderbook(currency currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (f *FTX) FetchTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (f *FTX) FetchTradablePairs(a asset.Item) ([]string, error)
- func (f *FTX) FetchWithdrawalHistory() ([]TransactionData, error)
- func (f *FTX) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
- func (f *FTX) GetAccountInfo() (AccountInfoData, error)
- func (f *FTX) GetAccountOptionsInfo() (AccountOptionsInfoData, error)
- func (f *FTX) GetActiveOrders(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
- func (f *FTX) GetAllWalletBalances() (AllWalletAccountData, error)
- func (f *FTX) GetBalances() ([]BalancesData, error)
- func (f *FTX) GetCoins() ([]WalletCoinsData, error)
- func (f *FTX) GetDefaultConfig() (*config.ExchangeConfig, error)
- func (f *FTX) GetDepositAddress(cryptocurrency currency.Code, _ string) (string, error)
- func (f *FTX) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
- func (f *FTX) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (f *FTX) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
- func (f *FTX) GetFills(market, limit string, startTime, endTime time.Time) ([]FillsData, error)
- func (f *FTX) GetFundingHistory() ([]exchange.FundHistory, error)
- func (f *FTX) GetFundingPayments(startTime, endTime time.Time, future string) ([]FundingPaymentsData, error)
- func (f *FTX) GetFundingRates() ([]FundingRatesData, error)
- func (f *FTX) GetFuture(futureName string) (FuturesData, error)
- func (f *FTX) GetFutureStats(futureName string) (FutureStatsData, error)
- func (f *FTX) GetFutures() ([]FuturesData, error)
- func (f *FTX) GetHistoricCandles(p currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
- func (f *FTX) GetHistoricCandlesExtended(p currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
- func (f *FTX) GetHistoricalData(marketName, timeInterval, limit string, startTime, endTime time.Time) ([]OHLCVData, error)
- func (f *FTX) GetIndexWeights(index string) (IndexWeights, error)
- func (f *FTX) GetMarket(marketName string) (MarketData, error)
- func (f *FTX) GetMarkets() ([]MarketData, error)
- func (f *FTX) GetOTCQuoteStatus(marketName, quoteID string) ([]QuoteStatusData, error)
- func (f *FTX) GetOpenOrders(marketName string) ([]OrderData, error)
- func (f *FTX) GetOpenTriggerOrders(marketName, orderType string) ([]TriggerOrderData, error)
- func (f *FTX) GetOptionsFills(startTime, endTime time.Time, limit string) ([]OptionFillsData, error)
- func (f *FTX) GetOptionsPositions() ([]OptionsPositionsData, error)
- func (f *FTX) GetOrderHistory(getOrdersRequest *order.GetOrdersRequest) ([]order.Detail, error)
- func (b *FTX) GetOrderHistoryById(getOrdersRequest string) ([]order.Detail, error)
- func (f *FTX) GetOrderInfo(orderID string) (order.Detail, error)
- func (f *FTX) GetOrderStatus(orderID string) (OrderData, error)
- func (f *FTX) GetOrderStatusByClientID(clientOrderID string) (OrderData, error)
- func (f *FTX) GetOrderbook(marketName string, depth int64) (OrderbookData, error)
- func (f *FTX) GetPositions() ([]PositionData, error)
- func (f *FTX) GetPublicOptionsTrades(startTime, endTime time.Time, limit string) ([]OptionsTradesData, error)
- func (f *FTX) GetQuoteRequests() ([]QuoteRequestData, error)
- func (f *FTX) GetQuotesForYourQuote(requestID string) (QuoteForQuoteData, error)
- func (f *FTX) GetTokenInfo(tokenName string) ([]LeveragedTokensData, error)
- func (f *FTX) GetTrades(marketName string, startTime, endTime time.Time, limit int64) ([]TradeData, error)
- func (f *FTX) GetTriggerOrderHistory(marketName string, startTime, endTime time.Time, side, orderType, limit string) ([]TriggerOrderData, error)
- func (f *FTX) GetTriggerOrderTriggers(orderID string) ([]TriggerData, error)
- func (f *FTX) GetWebsocket() (*stream.Websocket, error)
- func (f *FTX) GetYourQuoteRequests() ([]PersonalQuotesData, error)
- func (f *FTX) ListLTBalances() ([]LTBalanceData, error)
- func (f *FTX) ListLTCreations() ([]LTCreationData, error)
- func (f *FTX) ListLTRedemptions() ([]LTRedemptionData, error)
- func (f *FTX) ListLeveragedTokens() ([]LeveragedTokensData, error)
- func (f *FTX) MakeQuote(requestID, price string) ([]QuoteForQuoteData, error)
- func (f *FTX) ModifyOrder(action *order.Modify) (string, error)
- func (f *FTX) ModifyOrderByClientID(clientOrderID, clientID string, price, size float64) (OrderData, error)
- func (f *FTX) ModifyPlacedOrder(orderID, clientID string, price, size float64) (OrderData, error)
- func (f *FTX) ModifyTriggerOrder(orderID, orderType string, size, triggerPrice, orderPrice, trailValue float64) (TriggerOrderData, error)
- func (f *FTX) MyQuotes() ([]QuoteForQuoteData, error)
- func (f *FTX) Order(marketName, side, orderType, reduceOnly, ioc, postOnly, clientID string, ...) (OrderData, error)
- func (f *FTX) RequestForQuotes(base, quote string, amount float64) (RequestQuoteData, error)
- func (f *FTX) RequestLTCreation(tokenName string, size float64) (RequestTokenCreationData, error)
- func (f *FTX) RequestLTRedemption(tokenName string, size float64) (LTRedemptionRequestData, error)
- func (f *FTX) Run()
- func (f *FTX) SendAuthHTTPRequest(method, path string, data, result interface{}) error
- func (f *FTX) SendHTTPRequest(path string, result interface{}) error
- func (f *FTX) SetDefaults()
- func (f *FTX) Setup(exch *config.ExchangeConfig) error
- func (f *FTX) Start(wg *sync.WaitGroup)
- func (f *FTX) SubmitOrder(s *order.Submit) (order.SubmitResponse, error)
- func (f *FTX) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
- func (f *FTX) SubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error
- func (f *FTX) TriggerOrder(marketName, side, orderType, reduceOnly, retryUntilFilled string, ...) (TriggerOrderData, error)
- func (f *FTX) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
- func (f *FTX) UnsubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error
- func (f *FTX) UpdateAccountInfo() (account.Holdings, error)
- func (f *FTX) UpdateOrderbook(p currency.Pair, assetType asset.Item) (*orderbook.Base, error)
- func (f *FTX) UpdateTicker(p currency.Pair, assetType asset.Item) (*ticker.Price, error)
- func (f *FTX) UpdateTradablePairs(forceUpdate bool) error
- func (f *FTX) ValidateCredentials() error
- func (f *FTX) Withdraw(coin, address, tag, password, code string, size float64) (TransactionData, error)
- func (f *FTX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (f *FTX) WithdrawFiatFunds(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (f *FTX) WithdrawFiatFundsToInternationalBank(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
- func (f *FTX) WsAuth() error
- func (f *FTX) WsConnect() error
- func (f *FTX) WsProcessPartialOB(data *WsOrderbookData, p currency.Pair, a asset.Item) error
- func (f *FTX) WsProcessUpdateOB(data *WsOrderbookData, p currency.Pair, a asset.Item) error
- type FillsData
- type FundingPaymentsData
- type FundingRatesData
- type FutureStatsData
- type FuturesData
- type IndexWeights
- type LTBalanceData
- type LTCreationData
- type LTRedemptionData
- type LTRedemptionRequestData
- type LeveragedTokensData
- type MarketData
- type OData
- type OHLCVData
- type OptionData
- type OptionFillsData
- type OptionsPositionsData
- type OptionsTradesData
- type OrderData
- type OrderVars
- type OrderbookData
- type PersonalQuotesData
- type PositionData
- type QuoteData
- type QuoteForQuoteData
- type QuoteRequestData
- type QuoteStatusData
- type RequestQuoteData
- type RequestTokenCreationData
- type TempOBData
- type TimeInterval
- type TradeData
- type TransactionData
- type TriggerData
- type TriggerOrderData
- type WSMarkets
- type WalletCoinsData
- type WsFills
- type WsFillsDataStore
- type WsMarketsData
- type WsMarketsDataStorage
- type WsMarketsFutureData
- type WsOrderDataStore
- type WsOrderbookData
- type WsOrderbookDataStore
- type WsOrders
- type WsResponseData
- type WsSub
- type WsTickerData
- type WsTickerDataStore
- type WsTradeData
- type WsTradeDataStore
Constants ¶
This section is empty.
Variables ¶
var ( TimeIntervalFifteenSeconds = TimeInterval("15") TimeIntervalMinute = TimeInterval("60") TimeIntervalFiveMinutes = TimeInterval("300") TimeIntervalFifteenMinutes = TimeInterval("900") TimeIntervalHour = TimeInterval("3600") TimeIntervalFourHours = TimeInterval("14400") TimeIntervalDay = TimeInterval("86400") )
Vars related to time intervals
Functions ¶
This section is empty.
Types ¶
type AcceptQuote ¶
type AcceptQuote struct {
Success bool `json:"success"`
}
AcceptQuote stores data of accepted quote
type AccountInfoData ¶
type AccountInfoData struct { BackstopProvider bool `json:"backstopProvider"` ChargeInterestOnNegativeUSD bool `json:"chargeInterestOnNegativeUsd"` Collateral float64 `json:"collateral"` FreeCollateral float64 `json:"freeCollateral"` InitialMarginRequirement float64 `json:"initialMarginRequirement"` Leverage float64 `json:"float64"` Liquidating bool `json:"liquidating"` MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"` MakerFee float64 `json:"makerFee"` MarginFraction float64 `json:"marginFraction"` OpenMarginFraction float64 `json:"openMarginFraction"` PositionLimit float64 `json:"positionLimit"` PositionLimitUsed float64 `json:"positionLimitUsed"` SpotLendingEnabled bool `json:"spotLendingEnabled"` SpotMarginEnabled bool `json:"spotMarginEnabled"` TakerFee float64 `json:"takerFee"` TotalAccountValue float64 `json:"totalAccountValue"` TotalPositionSize float64 `json:"totalPositionSize"` UseFTTCollateral bool `json:"useFttCollateral"` Username string `json:"username"` Positions []PositionData `json:"positions"` }
AccountInfoData stores account data
type AccountOptionsInfoData ¶
type AccountOptionsInfoData struct { USDBalance float64 `json:"usdBalance"` LiquidationPrice float64 `json:"liquidationPrice"` Liquidating bool `json:"liquidating"` }
AccountOptionsInfoData stores account's options' info data
type AllWalletAccountData ¶
type AllWalletAccountData struct { Main []BalancesData `json:"main"` BattleRoyale []BalancesData `json:"Battle Royale"` }
AllWalletAccountData stores account data on all WalletCoins
type Authenticate ¶
type Authenticate struct { Args AuthenticationData `json:"args"` Operation string `json:"op"` }
Authenticate stores authentication variables required
type AuthenticationData ¶
type AuthenticationData struct { Key string `json:"key"` Sign string `json:"sign"` Time int64 `json:"time"` }
AuthenticationData stores authentication variables required
type BalancesData ¶
type BalancesData struct { Coin string `json:"coin"` Free float64 `json:"free"` Total float64 `json:"total"` }
BalancesData stores balances data
type CancelQuoteRequestData ¶
type CancelQuoteRequestData struct { ID int64 `json:"id"` Option OptionData `json:"option"` RequestExpiry string `json:"requestExpiry"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` }
CancelQuoteRequestData stores cancel quote request data
type CreateQuoteRequestData ¶
type CreateQuoteRequestData struct { ID int64 `json:"id"` Expiry time.Time `json:"expiry"` Strike float64 `json:"strike"` OptionType string `json:"type"` Underlying string `json:"underlying"` RequestExpiry string `json:"requestExpiry"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` }
CreateQuoteRequestData stores quote data of the request sent
type DepositData ¶
DepositData stores deposit address data
type FTX ¶
FTX is the overarching type across this package
func (*FTX) AcceptOTCQuote ¶
AcceptOTCQuote requests for otc quotes
func (*FTX) AcceptQuote ¶
func (f *FTX) AcceptQuote(quoteID string) ([]QuoteForQuoteData, error)
AcceptQuote accepts the quote for quote
func (*FTX) AuthenticateWebsocket ¶
AuthenticateWebsocket sends an authentication message to the websocket
func (*FTX) CalcPartialOBChecksum ¶
func (f *FTX) CalcPartialOBChecksum(data *WsOrderbookData) int64
CalcPartialOBChecksum calculates checksum of partial OB data received from WS
func (*FTX) CalcUpdateOBChecksum ¶
CalcUpdateOBChecksum calculates checksum of update OB data received from WS
func (*FTX) CancelAllOrders ¶
CancelAllOrders cancels all orders associated with a currency pair
func (*FTX) CancelOrder ¶
CancelOrder cancels an order by its corresponding ID number
func (*FTX) ChangeAccountLeverage ¶
ChangeAccountLeverage changes default leverage used by account
func (*FTX) CreateQuoteRequest ¶
func (f *FTX) CreateQuoteRequest(underlying, optionType, side string, expiry int64, requestExpiry string, strike, size, limitPrice, counterParyID float64, hideLimitPrice bool) (CreateQuoteRequestData, error)
CreateQuoteRequest sends a request to create a quote
func (*FTX) DeleteMyQuote ¶
func (f *FTX) DeleteMyQuote(quoteID string) ([]QuoteForQuoteData, error)
DeleteMyQuote deletes my quote for quotes
func (*FTX) DeleteOrder ¶
DeleteOrder deletes an order
func (*FTX) DeleteOrderByClientID ¶
DeleteOrderByClientID deletes an order
func (*FTX) DeleteQuote ¶
func (f *FTX) DeleteQuote(requestID string) (CancelQuoteRequestData, error)
DeleteQuote sends request to cancel a quote
func (*FTX) DeleteTriggerOrder ¶
DeleteTriggerOrder deletes an order
func (*FTX) FetchAccountInfo ¶
FetchAccountInfo retrieves balances for all enabled currencies
func (*FTX) FetchDepositAddress ¶
func (f *FTX) FetchDepositAddress(coin string) (DepositData, error)
FetchDepositAddress gets deposit address for a given coin
func (*FTX) FetchDepositHistory ¶
func (f *FTX) FetchDepositHistory() ([]TransactionData, error)
FetchDepositHistory gets deposit history
func (*FTX) FetchOrderHistory ¶
func (f *FTX) FetchOrderHistory(marketName string, startTime, endTime time.Time, limit string) ([]OrderData, error)
FetchOrderHistory gets order history
func (*FTX) FetchOrderbook ¶
FetchOrderbook returns orderbook base on the currency pair
func (*FTX) FetchTicker ¶
FetchTicker returns the ticker for a currency pair
func (*FTX) FetchTradablePairs ¶
FetchTradablePairs returns a list of the exchanges tradable pairs
func (*FTX) FetchWithdrawalHistory ¶
func (f *FTX) FetchWithdrawalHistory() ([]TransactionData, error)
FetchWithdrawalHistory gets withdrawal history
func (*FTX) GenerateDefaultSubscriptions ¶
func (f *FTX) GenerateDefaultSubscriptions() ([]stream.ChannelSubscription, error)
GenerateDefaultSubscriptions generates default subscription
func (*FTX) GetAccountInfo ¶
func (f *FTX) GetAccountInfo() (AccountInfoData, error)
GetAccountInfo gets account info
func (*FTX) GetAccountOptionsInfo ¶
func (f *FTX) GetAccountOptionsInfo() (AccountOptionsInfoData, error)
GetAccountOptionsInfo gets account's options' info
func (*FTX) GetActiveOrders ¶
GetActiveOrders retrieves any orders that are active/open
func (*FTX) GetAllWalletBalances ¶
func (f *FTX) GetAllWalletBalances() (AllWalletAccountData, error)
GetAllWalletBalances gets all wallets' balances
func (*FTX) GetBalances ¶
func (f *FTX) GetBalances() ([]BalancesData, error)
GetBalances gets balances of the account
func (*FTX) GetCoins ¶
func (f *FTX) GetCoins() ([]WalletCoinsData, error)
GetCoins gets coins' data in the account wallet
func (*FTX) GetDefaultConfig ¶
func (f *FTX) GetDefaultConfig() (*config.ExchangeConfig, error)
GetDefaultConfig returns a default exchange config
func (*FTX) GetDepositAddress ¶
GetDepositAddress returns a deposit address for a specified currency
func (*FTX) GetExchangeHistory ¶
func (f *FTX) GetExchangeHistory(p currency.Pair, assetType asset.Item, timestampStart, timestampEnd time.Time) ([]exchange.TradeHistory, error)
GetExchangeHistory returns historic trade data within the timeframe provided.
func (*FTX) GetFee ¶
func (f *FTX) GetFee(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFee returns an estimate of fee based on type of transaction
func (*FTX) GetFeeByType ¶
func (f *FTX) GetFeeByType(feeBuilder *exchange.FeeBuilder) (float64, error)
GetFeeByType returns an estimate of fee based on the type of transaction
func (*FTX) GetFundingHistory ¶
func (f *FTX) GetFundingHistory() ([]exchange.FundHistory, error)
GetFundingHistory returns funding history, deposits and withdrawals
func (*FTX) GetFundingPayments ¶
func (f *FTX) GetFundingPayments(startTime, endTime time.Time, future string) ([]FundingPaymentsData, error)
GetFundingPayments gets funding payments
func (*FTX) GetFundingRates ¶
func (f *FTX) GetFundingRates() ([]FundingRatesData, error)
GetFundingRates gets data on funding rates
func (*FTX) GetFuture ¶
func (f *FTX) GetFuture(futureName string) (FuturesData, error)
GetFuture gets data on a given future
func (*FTX) GetFutureStats ¶
func (f *FTX) GetFutureStats(futureName string) (FutureStatsData, error)
GetFutureStats gets data on a given future's stats
func (*FTX) GetFutures ¶
func (f *FTX) GetFutures() ([]FuturesData, error)
GetFutures gets data on futures
func (*FTX) GetHistoricCandles ¶
func (f *FTX) GetHistoricCandles(p currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandles returns candles between a time period for a set time interval
func (*FTX) GetHistoricCandlesExtended ¶
func (f *FTX) GetHistoricCandlesExtended(p currency.Pair, a asset.Item, start, end time.Time, interval kline.Interval) (kline.Item, error)
GetHistoricCandlesExtended returns candles between a time period for a set time interval
func (*FTX) GetHistoricalData ¶
func (f *FTX) GetHistoricalData(marketName, timeInterval, limit string, startTime, endTime time.Time) ([]OHLCVData, error)
GetHistoricalData gets historical OHLCV data for a given market pair
func (*FTX) GetIndexWeights ¶
func (f *FTX) GetIndexWeights(index string) (IndexWeights, error)
GetIndexWeights gets index weights
func (*FTX) GetMarket ¶
func (f *FTX) GetMarket(marketName string) (MarketData, error)
GetMarket gets market data for a provided asset type
func (*FTX) GetMarkets ¶
func (f *FTX) GetMarkets() ([]MarketData, error)
GetMarkets gets market data
func (*FTX) GetOTCQuoteStatus ¶
func (f *FTX) GetOTCQuoteStatus(marketName, quoteID string) ([]QuoteStatusData, error)
GetOTCQuoteStatus gets quote status of a quote
func (*FTX) GetOpenOrders ¶
GetOpenOrders gets open orders
func (*FTX) GetOpenTriggerOrders ¶
func (f *FTX) GetOpenTriggerOrders(marketName, orderType string) ([]TriggerOrderData, error)
GetOpenTriggerOrders gets trigger orders that are currently open
func (*FTX) GetOptionsFills ¶
func (f *FTX) GetOptionsFills(startTime, endTime time.Time, limit string) ([]OptionFillsData, error)
GetOptionsFills gets fills data for options
func (*FTX) GetOptionsPositions ¶
func (f *FTX) GetOptionsPositions() ([]OptionsPositionsData, error)
GetOptionsPositions gets options' positions
func (*FTX) GetOrderHistory ¶
GetOrderHistory retrieves account order information Can Limit response to specific order status
func (*FTX) GetOrderHistoryById ¶
GetOrderHistoryById retrieves specified closed order information Can Limit response to specific order status
func (*FTX) GetOrderInfo ¶
GetOrderInfo returns information on a current open order
func (*FTX) GetOrderStatus ¶
GetOrderStatus gets the order status of a given orderID
func (*FTX) GetOrderStatusByClientID ¶
GetOrderStatusByClientID gets the order status of a given clientOrderID
func (*FTX) GetOrderbook ¶
func (f *FTX) GetOrderbook(marketName string, depth int64) (OrderbookData, error)
GetOrderbook gets orderbook for a given market with a given depth (default depth 20)
func (*FTX) GetPositions ¶
func (f *FTX) GetPositions() ([]PositionData, error)
GetPositions gets the users positions
func (*FTX) GetPublicOptionsTrades ¶
func (f *FTX) GetPublicOptionsTrades(startTime, endTime time.Time, limit string) ([]OptionsTradesData, error)
GetPublicOptionsTrades gets options' trades from public
func (*FTX) GetQuoteRequests ¶
func (f *FTX) GetQuoteRequests() ([]QuoteRequestData, error)
GetQuoteRequests gets a list of quote requests
func (*FTX) GetQuotesForYourQuote ¶
func (f *FTX) GetQuotesForYourQuote(requestID string) (QuoteForQuoteData, error)
GetQuotesForYourQuote gets a list of quotes for your quote
func (*FTX) GetTokenInfo ¶
func (f *FTX) GetTokenInfo(tokenName string) ([]LeveragedTokensData, error)
GetTokenInfo gets token info
func (*FTX) GetTrades ¶
func (f *FTX) GetTrades(marketName string, startTime, endTime time.Time, limit int64) ([]TradeData, error)
GetTrades gets trades based on the conditions specified
func (*FTX) GetTriggerOrderHistory ¶
func (f *FTX) GetTriggerOrderHistory(marketName string, startTime, endTime time.Time, side, orderType, limit string) ([]TriggerOrderData, error)
GetTriggerOrderHistory gets trigger orders that are currently open
func (*FTX) GetTriggerOrderTriggers ¶
func (f *FTX) GetTriggerOrderTriggers(orderID string) ([]TriggerData, error)
GetTriggerOrderTriggers gets trigger orders that are currently open
func (*FTX) GetWebsocket ¶
GetWebsocket returns a pointer to the exchange websocket
func (*FTX) GetYourQuoteRequests ¶
func (f *FTX) GetYourQuoteRequests() ([]PersonalQuotesData, error)
GetYourQuoteRequests gets a list of your quote requests
func (*FTX) ListLTBalances ¶
func (f *FTX) ListLTBalances() ([]LTBalanceData, error)
ListLTBalances gets leveraged tokens' balances
func (*FTX) ListLTCreations ¶
func (f *FTX) ListLTCreations() ([]LTCreationData, error)
ListLTCreations lists the leveraged tokens' creation requests
func (*FTX) ListLTRedemptions ¶
func (f *FTX) ListLTRedemptions() ([]LTRedemptionData, error)
ListLTRedemptions lists the leveraged tokens' redemption requests
func (*FTX) ListLeveragedTokens ¶
func (f *FTX) ListLeveragedTokens() ([]LeveragedTokensData, error)
ListLeveragedTokens lists leveraged tokens
func (*FTX) MakeQuote ¶
func (f *FTX) MakeQuote(requestID, price string) ([]QuoteForQuoteData, error)
MakeQuote makes a quote for a quote
func (*FTX) ModifyOrder ¶
ModifyOrder will allow of changing orderbook placement and limit to market conversion
func (*FTX) ModifyOrderByClientID ¶
func (f *FTX) ModifyOrderByClientID(clientOrderID, clientID string, price, size float64) (OrderData, error)
ModifyOrderByClientID modifies a placed order via clientOrderID
func (*FTX) ModifyPlacedOrder ¶
ModifyPlacedOrder modifies a placed order
func (*FTX) ModifyTriggerOrder ¶
func (f *FTX) ModifyTriggerOrder(orderID, orderType string, size, triggerPrice, orderPrice, trailValue float64) (TriggerOrderData, error)
ModifyTriggerOrder modifies an existing trigger order Choices for ordertype include stop, trailingStop, takeProfit
func (*FTX) MyQuotes ¶
func (f *FTX) MyQuotes() ([]QuoteForQuoteData, error)
MyQuotes gets a list of my quotes for quotes
func (*FTX) Order ¶
func (f *FTX) Order(marketName, side, orderType, reduceOnly, ioc, postOnly, clientID string, price, size float64) (OrderData, error)
Order places an order
func (*FTX) RequestForQuotes ¶
func (f *FTX) RequestForQuotes(base, quote string, amount float64) (RequestQuoteData, error)
RequestForQuotes requests for otc quotes
func (*FTX) RequestLTCreation ¶
func (f *FTX) RequestLTCreation(tokenName string, size float64) (RequestTokenCreationData, error)
RequestLTCreation sends a request to create a leveraged token
func (*FTX) RequestLTRedemption ¶
func (f *FTX) RequestLTRedemption(tokenName string, size float64) (LTRedemptionRequestData, error)
RequestLTRedemption sends a request to redeem a leveraged token
func (*FTX) SendAuthHTTPRequest ¶
SendAuthHTTPRequest sends an authenticated request
func (*FTX) SendHTTPRequest ¶
SendHTTPRequest sends an unauthenticated HTTP request
func (*FTX) Setup ¶
func (f *FTX) Setup(exch *config.ExchangeConfig) error
Setup takes in the supplied exchange configuration details and sets params
func (*FTX) SubmitOrder ¶
SubmitOrder submits a new order
func (*FTX) Subscribe ¶
func (f *FTX) Subscribe(channelsToSubscribe []stream.ChannelSubscription) error
Subscribe sends a websocket message to receive data from the channel
func (*FTX) SubscribeToWebsocketChannels ¶
func (f *FTX) SubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error
SubscribeToWebsocketChannels appends to ChannelsToSubscribe which lets websocket.manageSubscriptions handle subscribing
func (*FTX) TriggerOrder ¶
func (f *FTX) TriggerOrder(marketName, side, orderType, reduceOnly, retryUntilFilled string, size, triggerPrice, orderPrice, trailValue float64) (TriggerOrderData, error)
TriggerOrder places an order
func (*FTX) Unsubscribe ¶
func (f *FTX) Unsubscribe(channelsToUnsubscribe []stream.ChannelSubscription) error
Unsubscribe sends a websocket message to stop receiving data from the channel
func (*FTX) UnsubscribeToWebsocketChannels ¶
func (f *FTX) UnsubscribeToWebsocketChannels(channels []stream.ChannelSubscription) error
UnsubscribeToWebsocketChannels removes from ChannelsToSubscribe which lets websocket.manageSubscriptions handle unsubscribing
func (*FTX) UpdateAccountInfo ¶
UpdateAccountInfo retrieves balances for all enabled currencies
func (*FTX) UpdateOrderbook ¶
UpdateOrderbook updates and returns the orderbook for a currency pair
func (*FTX) UpdateTicker ¶
UpdateTicker updates and returns the ticker for a currency pair
func (*FTX) UpdateTradablePairs ¶
UpdateTradablePairs updates the exchanges available pairs and stores them in the exchanges config
func (*FTX) ValidateCredentials ¶
ValidateCredentials validates current credentials used for wrapper functionality
func (*FTX) Withdraw ¶
func (f *FTX) Withdraw(coin, address, tag, password, code string, size float64) (TransactionData, error)
Withdraw sends a withdrawal request
func (*FTX) WithdrawCryptocurrencyFunds ¶
func (f *FTX) WithdrawCryptocurrencyFunds(withdrawRequest *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawCryptocurrencyFunds returns a withdrawal ID when a withdrawal is submitted
func (*FTX) WithdrawFiatFunds ¶
WithdrawFiatFunds returns a withdrawal ID when a withdrawal is submitted
func (*FTX) WithdrawFiatFundsToInternationalBank ¶
func (f *FTX) WithdrawFiatFundsToInternationalBank(_ *withdraw.Request) (*withdraw.ExchangeResponse, error)
WithdrawFiatFundsToInternationalBank returns a withdrawal ID when a withdrawal is submitted
func (*FTX) WsProcessPartialOB ¶
WsProcessPartialOB creates an OB from websocket data
func (*FTX) WsProcessUpdateOB ¶
WsProcessUpdateOB processes an update on the orderbook
type FillsData ¶
type FillsData struct { Fee float64 `json:"fee"` FeeRate float64 `json:"feeRate"` Future string `json:"future"` ID string `json:"id"` Liquidity string `json:"liquidity"` Market string `json:"market"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` OrderID string `json:"orderID"` TradeID string `json:"tradeID"` Price float64 `json:"price"` Side string `json:"side"` Size float64 `json:"size"` Time time.Time `json:"time"` OrderType string `json:"type"` }
FillsData stores fills' data
type FundingPaymentsData ¶
type FundingPaymentsData struct { Future string `json:"future"` ID string `json:"id"` Payment float64 `json:"payment"` Time time.Time `json:"time"` Rate float64 `json:"rate"` }
FundingPaymentsData stores funding payments' data
type FundingRatesData ¶
type FundingRatesData struct { Future string `json:"future"` Rate float64 `json:"rate"` Time time.Time `json:"time"` }
FundingRatesData stores data on funding rates
type FutureStatsData ¶
type FutureStatsData struct { Volume float64 `json:"volume"` NextFundingRate float64 `json:"nextFundingRate"` NextFundingTime time.Time `json:"nextFundingTime"` ExpirationPrice float64 `json:"expirationPrice"` PredictedExpirationPrice float64 `json:"predictedExpirationPrice"` OpenInterest float64 `json:"openInterest"` StrikePrice float64 `json:"strikePrice"` }
FutureStatsData stores data on futures stats
type FuturesData ¶
type FuturesData struct { Ask float64 `json:"ask"` Bid float64 `json:"bid"` Change1h float64 `json:"change1h"` Change24h float64 `json:"change24h"` ChangeBod float64 `json:"changeBod"` VolumeUSD24h float64 `json:"volumeUsd24h"` Volume float64 `json:"volume"` Description string `json:"description"` Enabled bool `json:"enabled"` Expired bool `json:"expired"` Expiry time.Time `json:"expiry"` ExpiryDescription string `json:"expiryDescription"` Group string `json:"group"` Index float64 `json:"index"` IMFFactor float64 `json:"imfFactor"` Last float64 `json:"last"` LowerBound float64 `json:"lowerBound"` MarginPrice float64 `json:"marginPrice"` Mark float64 `json:"mark"` MoveStart interface{} `json:"moveStart"` Name string `json:"name"` Perpetual bool `json:"perpetual"` PositionLimitWeight float64 `json:"positionLimitWeight"` PostOnly bool `json:"postOnly"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` Underlying string `json:"underlying"` UpperBound float64 `json:"upperBound"` FutureType string `json:"type"` }
FuturesData stores data for futures
type IndexWeights ¶
IndexWeights stores index weights' data
type LTBalanceData ¶
LTBalanceData stores balances of leveraged tokens
type LTCreationData ¶
type LTCreationData struct { ID string `json:"id"` Token string `json:"token"` RequestedSize float64 `json:"requestedSize"` Pending bool `json:"pending"` CreatedSize float64 `json:"createdize"` Price float64 `json:"price"` Cost float64 `json:"cost"` Fee float64 `json:"fee"` RequestedAt time.Time `json:"requestedAt"` FulfilledAt time.Time `json:"fulfilledAt"` }
LTCreationData stores token creation requests' data
type LTRedemptionData ¶
type LTRedemptionData struct { ID int64 `json:"id"` Token string `json:"token"` Size float64 `json:"size"` Pending bool `json:"pending"` Price float64 `json:"price"` Proceeds float64 `json:"proceeds"` Fee float64 `json:"fee"` RequestedAt time.Time `json:"requestedAt"` FulfilledAt time.Time `json:"fulfilledAt"` }
LTRedemptionData stores data of the token redemption request
type LTRedemptionRequestData ¶
type LTRedemptionRequestData struct { ID string `json:"id"` Token string `json:"token"` Size float64 `json:"size"` ProjectedProceeds float64 `json:"projectedProceeds"` Pending bool `json:"pending"` RequestedAt time.Time `json:"requestedAt"` }
LTRedemptionRequestData stores redemption request data for a leveraged token
type LeveragedTokensData ¶
type LeveragedTokensData struct { Basket map[string]interface{} `json:"basket"` Bep2AssetName string `json:"bep2AssetName"` Name string `json:"name"` Description string `json:"description"` Underlying string `json:"underlying"` Leverage float64 `json:"leverage"` Outstanding float64 `json:"outstanding"` TargetComponents []string `json:"targetComponents"` TotalCollateral float64 `json:"totalCollateral"` UnderlyingMark float64 `json:"underlyingMark"` ContactAddress string `json:"contactAddress"` Change1h float64 `json:"change1h"` Change24h float64 `json:"change24h"` ChangeBod float64 `json:"changeBod"` }
LeveragedTokensData stores data of leveraged tokens
type MarketData ¶
type MarketData struct { Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` MarketType string `json:"type"` Underlying string `json:"underlying"` Change1h float64 `json:"change1h"` Change24h float64 `json:"change24h"` ChangeBod float64 `json:"changeBod"` QuoteVolume24h float64 `json:"quoteVolume24h"` Enabled bool `json:"enabled"` Ask float64 `json:"ask"` Bid float64 `json:"bid"` Last float64 `json:"last"` USDVolume24h float64 `json:"volumeUSD24h"` MinProvideSize float64 `json:"minProvideSize"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` Restricted bool `json:"restricted"` }
MarketData stores market data
type OHLCVData ¶
type OHLCVData struct { Close float64 `json:"close"` High float64 `json:"high"` Low float64 `json:"low"` Open float64 `json:"open"` StartTime time.Time `json:"startTime"` Time float64 `json:"time"` Volume float64 `json:"volume"` }
OHLCVData stores historical OHLCV data
type OptionData ¶
type OptionData struct { Underlying string `json:"underlying"` OptionType string `json:"type"` Strike float64 `json:"strike"` Expiry time.Time `json:"expiry"` }
OptionData stores options' data
type OptionFillsData ¶
type OptionFillsData struct { Fee float64 `json:"fee"` FeeRate float64 `json:"feeRate"` ID int64 `json:"id"` Liquidity string `json:"liquidity"` Option OptionData `json:"option"` Price float64 `json:"price"` QuoteID int64 `json:"quoteId"` Side string `json:"side"` Size float64 `json:"size"` Time string `json:"time"` }
OptionFillsData stores option's fills data
type OptionsPositionsData ¶
type OptionsPositionsData struct { EntryPrice float64 `json:"entryPrice"` NetSize float64 `json:"netSize"` Option OptionData `json:"option"` Side string `json:"side"` Size float64 `json:"size"` PessimisticValuation float64 `json:"pessimisticValuation,omitempty"` PessimisticIndexPrice float64 `json:"pessimisticIndexPrice,omitempty"` }
OptionsPositionsData stores options positions' data
type OptionsTradesData ¶
type OptionsTradesData struct { ID int64 `json:"id"` Option OptionData `json:"option"` Price float64 `json:"price"` Size float64 `json:"size"` Time time.Time `json:"time"` }
OptionsTradesData stores options' trades' data
type OrderData ¶
type OrderData struct { CreatedAt time.Time `json:"createdAt"` FilledSize float64 `json:"filledSize"` Future string `json:"future"` ID int64 `json:"id"` Market string `json:"market"` Price float64 `json:"price"` AvgFillPrice float64 `json:"avgFillPrice"` RemainingSize float64 `json:"remainingSize"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` OrderType string `json:"type"` ReduceOnly bool `json:"reduceOnly"` IOC bool `json:"ioc"` PostOnly bool `json:"postOnly"` ClientID string `json:"clientId"` }
OrderData stores open order data
type OrderbookData ¶
OrderbookData stores orderbook data
type PersonalQuotesData ¶
type PersonalQuotesData struct { ID int64 `json:"id"` Option OptionData `json:"option"` Side string `json:"side"` Size float64 `json:"size"` Time time.Time `json:"time"` RequestExpiry string `json:"requestExpiry"` Status string `json:"status"` HideLimitPrice bool `json:"hideLimitPrice"` LimitPrice float64 `json:"limitPrice"` Quotes []QuoteData `json:"quotes"` }
PersonalQuotesData stores data of your quotes
type PositionData ¶
type PositionData struct { Cost float64 `json:"cost"` EntryPrice float64 `json:"entryPrice"` Future string `json:"future"` InitialMarginRequirement float64 `json:"initialMarginRequirement"` LongOrderSize float64 `json:"longOrderSize"` MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"` NetSize float64 `json:"netSize"` OpenSize float64 `json:"openSize"` RealisedPnL float64 `json:"realisedPnL"` ShortOrderSide float64 `json:"shortOrderSide"` Side string `json:"side"` Size float64 `json:"size"` UnrealisedPnL float64 `json:"unrealisedPnL"` }
PositionData stores data of an open position
type QuoteData ¶
type QuoteData struct { Collateral float64 `json:"collateral"` ID int64 `json:"id"` Price float64 `json:"price"` QuoteExpiry string `json:"quoteExpiry"` Status string `json:"status"` Time time.Time `json:"time"` }
QuoteData stores quote's data
type QuoteForQuoteData ¶
type QuoteForQuoteData struct { Collateral float64 `json:"collateral"` ID int64 `json:"id"` Option OptionData `json:"option"` Price float64 `json:"price"` QuoteExpiry string `json:"quoteExpiry"` QuoterSide string `json:"quoterSide"` RequestID int64 `json:"requestID"` RequestSide string `json:"requestSide"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` }
QuoteForQuoteData gets quote data for your quote
type QuoteRequestData ¶
type QuoteRequestData struct { ID int64 `json:"id"` Option OptionData `json:"option"` Side string `json:"side"` Size float64 `json:"size"` Time time.Time `json:"time"` RequestExpiry string `json:"requestExpiry"` Status string `json:"status"` }
QuoteRequestData stores option's quote request data
type QuoteStatusData ¶
type QuoteStatusData struct { BaseCoin string `json:"baseCoin"` Cost float64 `json:"cost"` Expired bool `json:"expired"` Filled bool `json:"filled"` FromCoin string `json:"fromCoin"` ID int64 `json:"id"` Price float64 `json:"price"` Proceeds float64 `json:"proceeds"` QuoteCoin string `json:"quoteCoin"` Side string `json:"side"` ToCoin string `json:"toCoin"` }
QuoteStatusData stores data of quotes' status
type RequestQuoteData ¶
type RequestQuoteData struct {
QuoteID int64 `json:"quoteId"`
}
RequestQuoteData stores data on the requested quote
type RequestTokenCreationData ¶
type RequestTokenCreationData struct { ID string `json:"id"` Token string `json:"token"` RequestedSize float64 `json:"requestedSize"` Cost float64 `json:"cost"` Pending bool `json:"pending"` RequestedAt time.Time `json:"requestedAt"` }
RequestTokenCreationData stores data of the token creation requested
type TempOBData ¶
TempOBData stores orderbook data temporarily
type TradeData ¶
type TradeData struct { ID int64 `json:"id"` Liquidation bool `json:"liquidation"` Price float64 `json:"price"` Side string `json:"side"` Size float64 `json:"size"` Time time.Time `json:"time"` }
TradeData stores data from trades
type TransactionData ¶
type TransactionData struct { Coin string `json:"coin"` Confirmations int64 `json:"conformations"` ConfirmedTime time.Time `json:"confirmedTime"` Fee float64 `json:"fee"` ID int64 `json:"id"` SentTime time.Time `json:"sentTime"` Size float64 `json:"size"` Status string `json:"status"` Time time.Time `json:"time"` TxID string `json:"txid"` }
TransactionData stores data about deposit history
type TriggerData ¶
type TriggerData struct { Error string `json:"error"` FilledSize float64 `json:"filledSize"` OrderSize float64 `json:"orderSize"` OrderID int64 `json:"orderId"` Time time.Time `json:"time"` }
TriggerData stores trigger orders' trigger data
type TriggerOrderData ¶
type TriggerOrderData struct { CreatedAt time.Time `json:"createdAt"` Error string `json:"error"` Future string `json:"future"` ID int64 `json:"id"` Market string `json:"market"` OrderID int64 `json:"orderId"` OrderPrice float64 `json:"orderPrice"` ReduceOnly bool `json:"reduceOnly"` Side string `json:"side"` Size float64 `json:"size"` Status string `json:"status"` TrailStart float64 `json:"trailStart"` TrailValue float64 `json:"trailvalue"` TriggerPrice float64 `json:"triggerPrice"` TriggeredAt string `json:"triggeredAt"` OrderType string `json:"type"` MarketOrLimit string `json:"orderType"` FilledSize float64 `json:"filledSize"` AvgFillPrice float64 `json:"avgFillPrice"` RetryUntilFilled bool `json:"retryUntilFilled"` }
TriggerOrderData stores trigger order data
type WSMarkets ¶
type WSMarkets struct { Channel string `json:"channel"` MessageType string `json:"type"` Data WsMarketsData `json:"data"` Action string `json:"action"` }
WSMarkets stores websocket markets data
type WalletCoinsData ¶
type WalletCoinsData struct { Bep2Asset interface{} `json:"bep2Asset"` CanConvert bool `json:"canConvert"` CanDeposit bool `json:"canDeposit"` CanWithdraw bool `json:"canWithdraw"` Collateral bool `json:"collateral"` CollateralWeight float64 `json:"collateralWeight"` CreditTo interface{} `json:"creditTo"` ERC20Contract interface{} `json:"erc20Contract"` Fiat bool `json:"fiat"` HasTag bool `json:"hasTag"` Hidden bool `json:"hidden"` IsETF bool `json:"isEtf"` IsToken bool `json:"isToken"` Methods []interface{} ID string `json:"id"` Name string `json:"name"` }
WalletCoinsData stores data about wallet coins
type WsFills ¶
type WsFills struct { Fee float64 `json:"fee"` FeeRate float64 `json:"feeRate"` Future string `json:"future"` ID int64 `json:"id"` Liquidity string `json:"liquidity"` Market string `json:"market"` OrderID int64 `json:"int64"` TradeID int64 `json:"tradeID"` Price float64 `json:"price"` Side string `json:"side"` Size float64 `json:"size"` Time time.Time `json:"time"` OrderType string `json:"orderType"` }
WsFills stores websocket fills' data
type WsFillsDataStore ¶
type WsFillsDataStore struct { Channel string `json:"channel"` MessageType string `json:"type"` FillsData WsFills `json:"fills"` }
WsFillsDataStore stores ws fills' data
type WsMarketsData ¶
type WsMarketsData struct {
Data map[string]WsMarketsDataStorage `json:"data"`
}
WsMarketsData stores websocket markets data
type WsMarketsDataStorage ¶
type WsMarketsDataStorage struct { Name string `json:"name,omitempty"` Enabled bool `json:"enabled,omitempty"` PriceIncrement float64 `json:"priceIncrement,omitempty"` SizeIncrement float64 `json:"sizeIncrement,omitempty"` MarketType string `json:"marketType,omitempty"` BaseCurrency string `json:"baseCurrency,omitempty"` QuoteCurrency string `json:"quoteCurrency,omitempty"` Underlying string `json:"underlying,omitempty"` Restricted bool `json:"restricted,omitempty"` Future WsMarketsFutureData `json:"future,omitempty"` }
WsMarketsDataStorage stores websocket markets data
type WsMarketsFutureData ¶
type WsMarketsFutureData struct { Name string `json:"name,omitempty"` Underlying string `json:"underlying,omitempty"` Description string `json:"description,omitempty"` MarketType string `json:"type,omitempty"` Expiry time.Time `json:"expiry,omitempty"` Perpetual bool `json:"perpetual,omitempty"` Expired bool `json:"expired,omitempty"` Enabled bool `json:"enabled,omitempty"` PostOnly bool `json:"postOnly,omitempty"` IMFFactor float64 `json:"imfFactor,omitempty"` UnderlyingDescription string `json:"underlyingDescription,omitempty"` ExpiryDescription string `json:"expiryDescription,omitempty"` MoveStart string `json:"moveStart,omitempty"` PositionLimitWeight float64 `json:"positionLimitWeight,omitempty"` Group string `json:"group,omitempty"` }
WsMarketsFutureData stores websocket markets' future data
type WsOrderDataStore ¶
type WsOrderDataStore struct { Channel string `json:"channel"` MessageType string `json:"type"` OrderData WsOrders `json:"data"` }
WsOrderDataStore stores ws orders' data
type WsOrderbookData ¶
type WsOrderbookData struct { Action string `json:"action"` Bids [][2]float64 `json:"bids"` Asks [][2]float64 `json:"asks"` Time float64 `json:"time"` Checksum int64 `json:"checksum"` }
WsOrderbookData stores ws orderbook data
type WsOrderbookDataStore ¶
type WsOrderbookDataStore struct { Channel string `json:"channel"` Market string `json:"market"` MessageType string `json:"type"` OBData WsOrderbookData `json:"data"` }
WsOrderbookDataStore stores ws orderbook data
type WsOrders ¶
type WsOrders struct { ID int64 `json:"id"` ClientID string `json:"clientId"` Market string `json:"market"` OrderType string `json:"type"` Side string `json:"side"` Size float64 `json:"size"` Price float64 `json:"price"` ReduceOnly bool `json:"reduceOnly"` IOC bool `json:"ioc"` PostOnly bool `json:"postOnly"` Status string `json:"status"` FilledSize float64 `json:"filedSize"` RemainingSize float64 `json:"remainingSize"` AvgFillPrice float64 `json:"avgFillPrice"` }
WsOrders stores ws orders' data
type WsResponseData ¶
type WsResponseData struct { ResponseType string `json:"type"` Channel string `json:"channel"` Market string `json:"market"` Data interface{} `json:"data"` }
WsResponseData stores basic ws response data on being subscribed to a channel successfully
type WsSub ¶
type WsSub struct { Channel string `json:"channel,omitempty"` Market string `json:"market,omitempty"` Operation string `json:"op,omitempty"` }
WsSub has the data used to subscribe to a channel
type WsTickerData ¶
type WsTickerData struct { Bid float64 `json:"bid"` Ask float64 `json:"ask"` BidSize float64 `json:"bidSize"` AskSize float64 `json:"askSize"` Last float64 `json:"last"` Time float64 `json:"time"` }
WsTickerData stores ws ticker data
type WsTickerDataStore ¶
type WsTickerDataStore struct { Channel string `json:"channel"` Market string `json:"market"` MessageType string `json:"type"` Ticker WsTickerData `json:"data"` }
WsTickerDataStore stores ws ticker data
type WsTradeData ¶
type WsTradeData struct { ID int64 `json:"id"` Price float64 `json:"price"` Size float64 `json:"size"` Side string `json:"side"` Liquidation bool `json:"liquidation"` Time time.Time `json:"time"` }
WsTradeData stores ws trade data
type WsTradeDataStore ¶
type WsTradeDataStore struct { Channel string `json:"channel"` Market string `json:"market"` MessageType string `json:"type"` TradeData []WsTradeData `json:"data"` }
WsTradeDataStore stores ws trades' data