decibel

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2026 License: MIT Imports: 19 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

This section is empty.

Types

type Adapter

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

Adapter is the Decibel perpetual futures adapter.

func NewAdapter

func NewAdapter(ctx context.Context, opts Options) (*Adapter, error)

func (*Adapter) CancelAllOrders

func (a *Adapter) CancelAllOrders(context.Context, 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(context.Context) ([]exchanges.FundingRate, error)

func (*Adapter) FetchBalance

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

func (*Adapter) FetchFeeRate

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

func (*Adapter) FetchFundingRate

func (a *Adapter) FetchFundingRate(context.Context, string) (*exchanges.FundingRate, 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

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

func (*Adapter) FetchOrders

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(_ 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(context.Context, string, int) ([]exchanges.Trade, error)

func (*Adapter) FormatSymbol

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

func (*Adapter) PlaceOrder

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

func (*Adapter) SetLeverage

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

func (*Adapter) StopWatchKlines

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

func (*Adapter) StopWatchOrderBook

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

func (*Adapter) StopWatchOrders

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

func (*Adapter) StopWatchPositions

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

func (*Adapter) StopWatchTicker

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

func (*Adapter) StopWatchTrades

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

func (*Adapter) WatchOrderBook

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

func (*Adapter) WatchOrders

func (a *Adapter) WatchOrders(_ context.Context, cb exchanges.OrderUpdateCallback) error

func (*Adapter) WatchPositions

func (*Adapter) WatchTicker

func (*Adapter) WatchTrades

type Options

type Options struct {
	APIKey         string
	PrivateKey     string
	SubaccountAddr string
	QuoteCurrency  exchanges.QuoteCurrency
	Logger         exchanges.Logger
}

Options configures the Decibel perp 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(limit int) ([]exchanges.Level, []exchanges.Level)

func (*OrderBook) ProcessDepth

func (ob *OrderBook) ProcessDepth(msg decibelws.MarketDepthMessage)

func (*OrderBook) Timestamp

func (ob *OrderBook) Timestamp() int64

func (*OrderBook) ToAdapterOrderBook

func (ob *OrderBook) ToAdapterOrderBook(depth int) *exchanges.OrderBook

func (*OrderBook) WaitReady

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

Directories

Path Synopsis
sdk
ws

Jump to

Keyboard shortcuts

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