Documentation ¶
Index ¶
- Constants
- type Account
- type AccountService
- type Candle
- type Client
- type GetHistoricalPrices
- type GetOrderBookOptions
- type GetTradesOptions
- type Market
- type MarketService
- func (s *MarketService) All() ([]Market, error)
- func (s *MarketService) Get(name string) (*Market, error)
- func (s *MarketService) GetHistoricalPrices(name string, opts *GetHistoricalPrices) ([]Candle, error)
- func (s *MarketService) GetOrderBook(name string, opts *GetOrderBookOptions) (*OrderBook, error)
- func (s *MarketService) GetTrades(name string, opts *GetTradesOptions) ([]Trade, error)
- type Option
- type OrderBook
- type Position
- type RequestLeverage
- type Response
- type Trade
Constants ¶
View Source
const ( Leverage1X = 1 Leverage3X = 3 Leverage5X = 5 Leverage10X = 10 Leverage20X = 20 Leverage50X = 50 Leverage100X = 100 Leverage101X = 101 )
View Source
const ( HeaderKey = "FTX-KEY" HeaderSign = "FTX-SIGN" HeaderTS = "FTX-TS" HeaderSubaccount = "FTX-SUBACCOUNT" )
View Source
const ( Resolution15s = 15 Resolution1m = 60 Resolution5m = 300 Resolution15m = 900 Resolution1h = 3600 Resolution4h = 14400 Resolution1d = 86400 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { BackstopProvider bool `json:"backstopProvider"` Collateral float64 `json:"collateral"` FreeCollateral float64 `json:"freeCollateral"` InitialMarginRequirement float64 `json:"initialMarginRequirement"` Leverage float64 `json:"leverage"` Liquidating bool `json:"liquidating"` MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"` MakerFee float64 `json:"makerFee"` MarginFraction float64 `json:"marginFraction"` OpenMarginFraction float64 `json:"openMarginFraction"` TakerFee float64 `json:"takerFee"` TotalAccountValue float64 `json:"totalAccountValue"` TotalPositionSize float64 `json:"totalPositionSize"` Username string `json:"username"` Positions []Position }
type AccountService ¶
type AccountService service
func (*AccountService) GetInformation ¶
func (s *AccountService) GetInformation() (*Account, error)
GetInformation FTX API docs: https://docs.ftx.com/#get-account-information
func (*AccountService) GetPositions ¶
func (s *AccountService) GetPositions() ([]Position, error)
GetPositions FTX API docs: https://docs.ftx.com/#get-positions
func (*AccountService) SetLeverage ¶
func (s *AccountService) SetLeverage(x int) error
SetLeverage FTX API docs: https://docs.ftx.com/#change-account-leverage
type Client ¶
type Client struct { Accounts *AccountService Markets *MarketService // contains filtered or unexported fields }
type GetHistoricalPrices ¶
type GetOrderBookOptions ¶
type GetOrderBookOptions struct {
Depth int `url:"depth"`
}
type GetTradesOptions ¶
type Market ¶
type Market struct { Name string `json:"name"` BaseCurrency string `json:"baseCurrency"` QuoteCurrency string `json:"quoteCurrency"` Type string `json:"type"` Underlying string `json:"underlying"` Enabled bool `json:"enabled"` Ask float64 `json:"ask"` Bid float64 `json:"bid"` Last float64 `json:"last"` PostOnly bool `json:"postOnly"` PriceIncrement float64 `json:"priceIncrement"` SizeIncrement float64 `json:"sizeIncrement"` Restricted bool `json:"restricted"` }
type MarketService ¶
type MarketService service
func (*MarketService) All ¶
func (s *MarketService) All() ([]Market, error)
All FTX API docs: https://docs.ftx.com/#get-markets
func (*MarketService) Get ¶
func (s *MarketService) Get(name string) (*Market, error)
Get FTX API docs: https://docs.ftx.com/#get-single-market
func (*MarketService) GetHistoricalPrices ¶
func (s *MarketService) GetHistoricalPrices(name string, opts *GetHistoricalPrices) ([]Candle, error)
GetHistoricalPrices FTX API docs: https://docs.ftx.com/#get-historical-prices
func (*MarketService) GetOrderBook ¶
func (s *MarketService) GetOrderBook(name string, opts *GetOrderBookOptions) (*OrderBook, error)
GetOrderBook FTX API docs: https://docs.ftx.com/#get-orderbook
func (*MarketService) GetTrades ¶
func (s *MarketService) GetTrades(name string, opts *GetTradesOptions) ([]Trade, error)
GetTrades FTX API docs: https://docs.ftx.com/#get-trades
type Position ¶
type Position struct { Cost float64 `json:"cost"` EntryPrice float64 `json:"entryPrice"` EstimatedLiquidationPrice float64 `json:"estimatedLiquidationPrice,omitempty"` Future string `json:"future"` InitialMarginRequirement float64 `json:"initialMarginRequirement"` LongOrderSize float64 `json:"longOrderSize"` MaintenanceMarginRequirement float64 `json:"maintenanceMarginRequirement"` NetSize float64 `json:"netSize"` OpenSize float64 `json:"openSize"` RealizedPnl float64 `json:"realizedPnl"` ShortOrderSize float64 `json:"shortOrderSize"` Side string `json:"side"` Size float64 `json:"size"` UnrealizedPnl float64 `json:"unrealizedPnl"` CollateralUsed float64 `json:"collateralUsed,omitempty"` }
type RequestLeverage ¶
type RequestLeverage struct {
Leverage int `json:"leverage"`
}
Click to show internal directories.
Click to hide internal directories.