Documentation
¶
Index ¶
- Constants
- type APIError
- type AccountOverview
- type AccountPosition
- type Client
- func (c *Client) GetAccountOverview(ctx context.Context, account string) (*AccountOverview, error)
- func (c *Client) GetAccountPositions(ctx context.Context, account string) ([]AccountPosition, error)
- func (c *Client) GetMarkets(ctx context.Context) ([]Market, error)
- func (c *Client) GetOpenOrders(ctx context.Context, account string, limit int, offset int) (*OpenOrdersResponse, error)
- func (c *Client) GetOrder(ctx context.Context, account string, market string, orderID string, ...) (*OrderResponse, error)
- func (c *Client) GetOrderBook(ctx context.Context, market string, limit int) (*OrderBookSnapshot, error)
- func (c *Client) GetOrderByID(ctx context.Context, account, orderID string) (*OpenOrder, error)
- func (c *Client) GetOrderHistory(ctx context.Context, account string, limit int, offset int) (*OpenOrdersResponse, error)
- func (c *Client) GetTicker(ctx context.Context, market string) (*Ticker, error)
- type Market
- type OpenOrder
- type OpenOrdersResponse
- type OrderBookLevel
- type OrderBookSnapshot
- type OrderResponse
- type Ticker
Constants ¶
View Source
const ( MainnetBaseURL = "https://api.mainnet.aptoslabs.com/decibel" TestnetBaseURL = "https://api.testnet.aptoslabs.com/decibel" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type AccountOverview ¶
type AccountPosition ¶
type AccountPosition struct {
Market string `json:"market"`
User string `json:"user"`
Side string `json:"side"`
Size decimal.Decimal `json:"size"`
EntryPrice decimal.Decimal `json:"entry_price"`
EstimatedLiquidationPrice decimal.Decimal `json:"estimated_liquidation_price"`
UnrealizedFunding decimal.Decimal `json:"unrealized_funding"`
UserLeverage decimal.Decimal `json:"user_leverage"`
}
type Client ¶
func (*Client) GetAccountOverview ¶
func (*Client) GetAccountPositions ¶
func (*Client) GetOpenOrders ¶
func (*Client) GetOrderBook ¶
func (*Client) GetOrderByID ¶
func (*Client) GetOrderHistory ¶
type Market ¶
type Market struct {
LotSize decimal.Decimal `json:"lot_size"`
MarketAddr string `json:"market_addr"`
MarketName string `json:"market_name"`
MaxLeverage decimal.Decimal `json:"max_leverage"`
MaxOpenInterest decimal.Decimal `json:"max_open_interest"`
MinSize decimal.Decimal `json:"min_size"`
Mode string `json:"mode"`
PxDecimals int32 `json:"px_decimals"`
SzDecimals int32 `json:"sz_decimals"`
TickSize decimal.Decimal `json:"tick_size"`
UnrealizedPnLHaircutBps int64 `json:"unrealized_pnl_haircut_bps"`
}
type OpenOrder ¶
type OpenOrder struct {
ClientOrderID string `json:"client_order_id"`
Market string `json:"market"`
OrderID string `json:"order_id"`
OrderType string `json:"order_type"`
OrderDirection string `json:"order_direction"`
Side string `json:"side"`
IsBuy bool `json:"is_buy"`
Status string `json:"status"`
Details string `json:"details"`
CancellationReason string `json:"cancellation_reason"`
IsReduceOnly bool `json:"is_reduce_only"`
UnixMS int64 `json:"unix_ms"`
OrigSize decimal.Decimal `json:"orig_size"`
Price decimal.Decimal `json:"price"`
RemainingSize decimal.Decimal `json:"remaining_size"`
SizeDelta decimal.Decimal `json:"size_delta"`
}
type OpenOrdersResponse ¶
type OrderBookLevel ¶
type OrderBookSnapshot ¶
type OrderBookSnapshot struct {
Market string `json:"market"`
Bids []OrderBookLevel `json:"bids"`
Asks []OrderBookLevel `json:"asks"`
Timestamp int64 `json:"timestamp"`
}
type OrderResponse ¶
Click to show internal directories.
Click to hide internal directories.