standx

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CustomParseLevels

func CustomParseLevels(raw [][]string) []exchanges.Level

func NewAdapter

func NewAdapter(ctx context.Context, opts Options) (exchanges.Exchange, error)

Types

type Adapter

type Adapter struct {
	*exchanges.BaseAdapter
	// contains filtered or unexported fields
}

func (*Adapter) CancelAllOrders

func (a *Adapter) CancelAllOrders(ctx context.Context, symbol string) error

func (*Adapter) CancelOrder

func (a *Adapter) CancelOrder(ctx context.Context, orderID, symbol string) error

func (*Adapter) Close

func (a *Adapter) Close() error

func (*Adapter) ExtractSymbol

func (a *Adapter) ExtractSymbol(symbol string) string

func (*Adapter) FetchAccount

func (a *Adapter) FetchAccount(ctx context.Context) (*exchanges.Account, error)

func (*Adapter) FetchAllFundingRates

func (a *Adapter) FetchAllFundingRates(ctx context.Context) ([]exchanges.FundingRate, error)

GetAllFundingRates returns all funding rates

func (*Adapter) FetchBalance

func (a *Adapter) FetchBalance(ctx context.Context) (decimal.Decimal, error)

func (*Adapter) FetchFeeRate

func (a *Adapter) FetchFeeRate(ctx context.Context, symbol string) (*exchanges.FeeRate, error)

func (*Adapter) FetchFundingRate

func (a *Adapter) FetchFundingRate(ctx context.Context, symbol string) (*exchanges.FundingRate, error)

GetFundingRate returns the specific funding rate for a symbol

func (*Adapter) FetchKlines

func (a *Adapter) FetchKlines(ctx context.Context, symbol string, interval exchanges.Interval, opts *exchanges.KlineOpts) ([]exchanges.Kline, error)

func (*Adapter) FetchOpenOrders

func (a *Adapter) FetchOpenOrders(ctx context.Context, symbol string) ([]exchanges.Order, error)

func (*Adapter) FetchOrderBook

func (a *Adapter) FetchOrderBook(ctx context.Context, symbol string, limit int) (*exchanges.OrderBook, error)

func (*Adapter) FetchOrderByID added in v0.2.0

func (a *Adapter) FetchOrderByID(ctx context.Context, orderID, symbol string) (*exchanges.Order, error)

func (*Adapter) FetchOrders added in v0.2.0

func (a *Adapter) FetchOrders(ctx context.Context, symbol string) ([]exchanges.Order, error)

func (*Adapter) FetchPositions

func (a *Adapter) FetchPositions(ctx context.Context) ([]exchanges.Position, error)

func (*Adapter) FetchSymbolDetails

func (a *Adapter) FetchSymbolDetails(ctx context.Context, symbol string) (*exchanges.SymbolDetails, error)

func (*Adapter) FetchTicker

func (a *Adapter) FetchTicker(ctx context.Context, symbol string) (*exchanges.Ticker, error)

func (*Adapter) FetchTrades

func (a *Adapter) FetchTrades(ctx context.Context, symbol string, limit int) ([]exchanges.Trade, error)

func (*Adapter) FormatSymbol

func (a *Adapter) FormatSymbol(symbol string) string

func (*Adapter) GetLocalOrderBook

func (a *Adapter) GetLocalOrderBook(symbol string, depth int) *exchanges.OrderBook

func (*Adapter) ModifyOrder

func (a *Adapter) ModifyOrder(ctx context.Context, orderID, symbol string, params *exchanges.ModifyOrderParams) (*exchanges.Order, error)

func (*Adapter) PlaceOrder

func (a *Adapter) PlaceOrder(ctx context.Context, params *exchanges.OrderParams) (*exchanges.Order, error)

func (*Adapter) RefreshSymbolDetails

func (a *Adapter) RefreshSymbolDetails(ctx context.Context) error

func (*Adapter) SetLeverage

func (a *Adapter) SetLeverage(ctx context.Context, symbol string, leverage int) error

func (*Adapter) StopWatchKlines

func (a *Adapter) StopWatchKlines(ctx context.Context, symbol string, interval exchanges.Interval) error

func (*Adapter) StopWatchOrderBook

func (a *Adapter) StopWatchOrderBook(ctx context.Context, symbol string) error

func (*Adapter) StopWatchOrders

func (a *Adapter) StopWatchOrders(ctx context.Context) error

Unsubscribes

func (*Adapter) StopWatchPositions

func (a *Adapter) StopWatchPositions(ctx context.Context) error

func (*Adapter) StopWatchTicker

func (a *Adapter) StopWatchTicker(ctx context.Context, symbol string) error

func (*Adapter) StopWatchTrades

func (a *Adapter) StopWatchTrades(ctx context.Context, symbol string) error

func (*Adapter) WaitOrderBookReady

func (a *Adapter) WaitOrderBookReady(ctx context.Context, symbol string) error

func (*Adapter) WatchKlines

func (a *Adapter) WatchKlines(ctx context.Context, symbol string, interval exchanges.Interval, callback exchanges.KlineCallback) error

func (*Adapter) WatchOrderBook

func (a *Adapter) WatchOrderBook(ctx context.Context, symbol string, callback exchanges.OrderBookCallback) error

WatchOrderBook subscribes to orderbook updates and waits for the book to be ready.

func (*Adapter) WatchOrders

func (a *Adapter) WatchOrders(ctx context.Context, callback exchanges.OrderUpdateCallback) error

func (*Adapter) WatchPositions

func (a *Adapter) WatchPositions(ctx context.Context, callback exchanges.PositionUpdateCallback) error

func (*Adapter) WatchTicker

func (a *Adapter) WatchTicker(ctx context.Context, symbol string, callback exchanges.TickerCallback) error

func (*Adapter) WatchTrades

func (a *Adapter) WatchTrades(ctx context.Context, symbol string, callback exchanges.TradeCallback) error

func (*Adapter) WsAccountConnected

func (a *Adapter) WsAccountConnected(ctx context.Context) error

func (*Adapter) WsMarketConnected

func (a *Adapter) WsMarketConnected(ctx context.Context) error

func (*Adapter) WsOrderConnected

func (a *Adapter) WsOrderConnected(ctx context.Context) error

type Options

type Options struct {
	PrivateKey    string
	QuoteCurrency exchanges.QuoteCurrency // "DUSD" (only supported)
	Logger        exchanges.Logger
}

Options configures a StandX adapter.

type OrderBook

type OrderBook struct {
	// contains filtered or unexported fields
}

func NewOrderBook

func NewOrderBook(symbol string) *OrderBook

func (*OrderBook) GetDepth

func (ob *OrderBook) GetDepth(depth int) ([]exchanges.Level, []exchanges.Level)

GetDepth satisfies the LocalOrderBook interface

func (*OrderBook) Snapshot

func (ob *OrderBook) Snapshot() *exchanges.OrderBook

func (*OrderBook) Timestamp

func (ob *OrderBook) Timestamp() int64

Timestamp satisfies the LocalOrderBook interface

func (*OrderBook) UpdateSnapshot

func (ob *OrderBook) UpdateSnapshot(data standx.WSDepthData) *exchanges.OrderBook

func (*OrderBook) WaitReady

func (ob *OrderBook) WaitReady(ctx context.Context, timeout time.Duration) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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