models

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: MIT Imports: 3 Imported by: ? 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

View Source
const (
	DirectionBuy  = "buy"
	DirectionSell = "sell"
)

Direction direction, `buy` or `sell`

View Source
const (
	OrderStateOpen        = "open"
	OrderStateFilled      = "filled"
	OrderStateRejected    = "rejected"
	OrderStateCancelled   = "cancelled"
	OrderStateUntriggered = "untriggered"
)

OrderState order state, `"open"`, `"filled"`, `"rejected"`, `"cancelled"`, `"untriggered"`

View Source
const (
	OrderTypeLimit      = "limit"
	OrderTypeMarket     = "market"
	OrderTypeStopLimit  = "stop_limit"
	OrderTypeStopMarket = "stop_market"
)

OrderType order type, `"limit"`, `"market"`, `"stop_limit"`, `"stop_market"`

View Source
const (
	TriggerTypeIndexPrice = "index_price"
	TriggerTypeMarkPrice  = "mark_price"
	TriggerTypeLastPrice  = "last_price"
)

TriggerType trigger type, `"index_price"`, `"mark_price"`, `"last_price"`

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountSummary

type AccountSummary struct {
	AvailableFunds            decimal.Decimal `json:"available_funds"`
	AvailableWithdrawalFunds  decimal.Decimal `json:"available_withdrawal_funds"`
	Balance                   decimal.Decimal `json:"balance"`
	Currency                  string          `json:"currency"`
	DeltaTotal                decimal.Decimal `json:"delta_total"`
	DepositAddress            string          `json:"deposit_address"`
	Email                     string          `json:"email"`
	Equity                    decimal.Decimal `json:"equity"`
	FuturesPl                 decimal.Decimal `json:"futures_pl"`
	FuturesSessionRpl         decimal.Decimal `json:"futures_session_rpl"`
	FuturesSessionUpl         decimal.Decimal `json:"futures_session_upl"`
	ID                        int             `json:"id"`
	InitialMargin             decimal.Decimal `json:"initial_margin"`
	MaintenanceMargin         decimal.Decimal `json:"maintenance_margin"`
	MarginBalance             decimal.Decimal `json:"margin_balance"`
	OptionsDelta              decimal.Decimal `json:"options_delta"`
	OptionsGamma              decimal.Decimal `json:"options_gamma"`
	OptionsPl                 decimal.Decimal `json:"options_pl"`
	OptionsSessionRpl         decimal.Decimal `json:"options_session_rpl"`
	OptionsSessionUpl         decimal.Decimal `json:"options_session_upl"`
	OptionsTheta              decimal.Decimal `json:"options_theta"`
	OptionsVega               decimal.Decimal `json:"options_vega"`
	PortfolioMarginingEnabled bool            `json:"portfolio_margining_enabled"`
	SessionFunding            decimal.Decimal `json:"session_funding"`
	SessionRpl                decimal.Decimal `json:"session_rpl"`
	SessionUpl                decimal.Decimal `json:"session_upl"`
	SystemName                string          `json:"system_name"`
	TfaEnabled                bool            `json:"tfa_enabled"`
	TotalPl                   decimal.Decimal `json:"total_pl"`
	Type                      string          `json:"type"`
	Username                  string          `json:"username"`
}

type Announcement

type Announcement struct {
	Title           string `json:"title"`
	PublicationTime uint64 `json:"publication_time"`
	Important       bool   `json:"important"`
	ID              int64  `json:"id"`
	Body            string `json:"body"`
}

type AnnouncementsNotification

type AnnouncementsNotification struct {
	Action    string `json:"action"`
	Body      string `json:"body"`
	Date      uint64 `json:"date"`
	ID        int    `json:"id"`
	Important bool   `json:"important"`
	Number    int    `json:"number"`
	Title     string `json:"title"`
}

type AuthResponse

type AuthResponse struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    uint64 `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	TokenType    string `json:"token_type"`
}

type BookSummary

type BookSummary struct {
	AskPrice               *decimal.Decimal `json:"ask_price"`
	BaseCurrency           string           `json:"base_currency"`
	BidPrice               *decimal.Decimal `json:"bid_price"`
	CreationTimestamp      uint64           `json:"creation_timestamp"`
	CurrentFunding         decimal.Decimal  `json:"current_funding"`
	EstimatedDeliveryPrice decimal.Decimal  `json:"estimated_delivery_price"`
	Funding8H              decimal.Decimal  `json:"funding_8h"`
	High                   decimal.Decimal  `json:"high"`
	InstrumentName         string           `json:"instrument_name"`
	InterestRate           decimal.Decimal  `json:"interest_rate"`
	Last                   *decimal.Decimal `json:"last"`
	Low                    *decimal.Decimal `json:"low"`
	MarkPrice              decimal.Decimal  `json:"mark_price"`
	MidPrice               *decimal.Decimal `json:"mid_price"`
	OpenInterest           decimal.Decimal  `json:"open_interest"`
	PriceChange            *decimal.Decimal `json:"price_change"`
	QuoteCurrency          string           `json:"quote_currency"`
	UnderlyingIndex        string           `json:"underlying_index"`
	UnderlyingPrice        decimal.Decimal  `json:"underlying_price"`
	VolumeUsd              decimal.Decimal  `json:"volume_usd"`
	Volume                 decimal.Decimal  `json:"volume"`
}

type BuyParams

type BuyParams struct {
	InstrumentName string           `json:"instrument_name"`
	Amount         decimal.Decimal  `json:"amount"`
	Type           string           `json:"type,omitempty"`
	Label          string           `json:"label,omitempty"`
	Price          *decimal.Decimal `json:"price,omitempty"`
	TimeInForce    string           `json:"time_in_force,omitempty"`
	MaxShow        *decimal.Decimal `json:"max_show,omitempty"`
	PostOnly       bool             `json:"post_only,omitempty"`
	RejectPostOnly bool             `json:"reject_post_only,omitempty"`
	ReduceOnly     bool             `json:"reduce_only,omitempty"`
	TriggerPrice   *decimal.Decimal `json:"trigger_price,omitempty"`
	Trigger        string           `json:"trigger,omitempty"`
	Advanced       string           `json:"advanced,omitempty"`
	MMP            *bool            `json:"mmp,omitempty"`
}

type BuyResponse

type BuyResponse struct {
	Trades []Trade `json:"trades"`
	Order  Order   `json:"order"`
}

type CancelAllByCurrencyParams

type CancelAllByCurrencyParams struct {
	Currency string `json:"currency"`
	Kind     string `json:"kind,omitempty"`
	Type     string `json:"type,omitempty"`
}

type CancelAllByInstrumentParams

type CancelAllByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	Type           string `json:"type,omitempty"`
}

type CancelAllByLabelParams

type CancelAllByLabelParams struct {
	Label string `json:"label"`
}

type CancelParams

type CancelParams struct {
	OrderID string `json:"order_id"`
}

type CancelTransferByIDParams

type CancelTransferByIDParams struct {
	Currency string `json:"currency"`
	ID       int64  `json:"id"`
	Tfa      string `json:"tfa,omitempty"`
}

type CancelWithdrawalParams

type CancelWithdrawalParams struct {
	Currency string `json:"currency"`
	ID       int64  `json:"id"`
}

type ChangeSubaccountNameParams

type ChangeSubaccountNameParams struct {
	Sid  int    `json:"sid"`
	Name string `json:"name"`
}

type ClientCredentialsParams

type ClientCredentialsParams struct {
	GrantType    string `json:"grant_type"`
	ClientID     string `json:"client_id"`
	ClientSecret string `json:"client_secret"`
}

type ClosePositionParams

type ClosePositionParams struct {
	InstrumentName string           `json:"instrument_name"`
	Type           string           `json:"type"`
	Price          *decimal.Decimal `json:"price,omitempty"`
}

type ClosePositionResponse

type ClosePositionResponse struct {
	Trades []Trade `json:"trades"`
	Order  Order   `json:"order"`
}

type CreateDepositAddressParams

type CreateDepositAddressParams struct {
	Currency string `json:"currency"`
}

type Currency

type Currency struct {
	CoinType             string               `json:"coin_type"`
	Currency             string               `json:"currency"`
	CurrencyLong         string               `json:"currency_long"`
	FeePrecision         int                  `json:"fee_precision"`
	MinConfirmations     int                  `json:"min_confirmations"`
	MinWithdrawalFee     decimal.Decimal      `json:"min_withdrawal_fee"`
	WithdrawalFee        decimal.Decimal      `json:"withdrawal_fee"`
	WithdrawalPriorities []WithdrawalPriority `json:"withdrawal_priorities"`
}

type Deposit

type Deposit struct {
	Address           string          `json:"address"`
	Amount            decimal.Decimal `json:"amount"`
	Currency          string          `json:"currency"`
	ReceivedTimestamp uint64          `json:"received_timestamp"`
	State             string          `json:"state"`
	TransactionID     string          `json:"transaction_id"`
	UpdatedTimestamp  uint64          `json:"updated_timestamp"`
}

type DepositAddress

type DepositAddress struct {
	Address           string `json:"address"`
	CreationTimestamp uint64 `json:"creation_timestamp"`
	Currency          string `json:"currency"`
	Type              string `json:"type"`
}

type DeribitPriceIndexNotification

type DeribitPriceIndexNotification struct {
	Timestamp int64           `json:"timestamp"`
	Price     decimal.Decimal `json:"price"`
	IndexName string          `json:"index_name"`
}

type DeribitPriceRanking

type DeribitPriceRanking struct {
	Weight     decimal.Decimal `json:"weight"`
	Timestamp  uint64          `json:"timestamp"`
	Price      decimal.Decimal `json:"price"`
	Identifier string          `json:"identifier"`
	Enabled    bool            `json:"enabled"`
}

type DeribitPriceRankingNotification

type DeribitPriceRankingNotification []DeribitPriceRanking

type DisableTfaForSubaccountParams

type DisableTfaForSubaccountParams struct {
	Sid int `json:"sid"`
}

type EditByLabelParams

type EditByLabelParams struct {
	Label          string           `json:"label"`
	InstrumentName string           `json:"instrument_name"`
	Amount         decimal.Decimal  `json:"amount"`
	Price          *decimal.Decimal `json:"price,omitempty"`
	PostOnly       bool             `json:"post_only,omitempty"`
	ReduceOnly     bool             `json:"reduce_only,omitempty"`
	RejectPostOnly bool             `json:"reject_post_only,omitempty"`
	Advanced       string           `json:"advanced,omitempty"`
	TriggerPrice   *decimal.Decimal `json:"trigger_price,omitempty"`
	MMP            *bool            `json:"mmp,omitempty"`
}

type EditParams

type EditParams struct {
	OrderID        string           `json:"order_id"`
	Amount         decimal.Decimal  `json:"amount"`
	Price          *decimal.Decimal `json:"price,omitempty"`
	PostOnly       bool             `json:"post_only,omitempty"`
	ReduceOnly     bool             `json:"reduce_only,omitempty"`
	RejectPostOnly bool             `json:"reject_post_only,omitempty"`
	Advanced       string           `json:"advanced,omitempty"`
	TriggerPrice   *decimal.Decimal `json:"trigger_price,omitempty"`
	MMP            *bool            `json:"mmp,omitempty"`
}

type EditResponse

type EditResponse struct {
	Trades []Trade `json:"trades"`
	Order  Order   `json:"order"`
}

type EstimatedExpirationPriceNotification

type EstimatedExpirationPriceNotification struct {
	Seconds     uint64          `json:"seconds"`
	Price       decimal.Decimal `json:"price"`
	IsEstimated bool            `json:"is_estimated"`
}

type FundingChartData

type FundingChartData struct {
	IndexPrice decimal.Decimal `json:"index_price"`
	Interest8H decimal.Decimal `json:"interest_8h"`
	Timestamp  uint64          `json:"timestamp"`
}

type GetAccountSummaryParams

type GetAccountSummaryParams struct {
	Currency string `json:"currency"`
	Extended bool   `json:"extended,omitempty"`
}

type GetBookSummaryByCurrencyParams

type GetBookSummaryByCurrencyParams struct {
	Currency string `json:"currency"`
	Kind     string `json:"kind,omitempty"`
}

type GetBookSummaryByInstrumentParams

type GetBookSummaryByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
}

type GetContractSizeParams

type GetContractSizeParams struct {
	InstrumentName string `json:"instrument_name"`
}

type GetContractSizeResponse

type GetContractSizeResponse struct {
	ContractSize decimal.Decimal `json:"contract_size"`
}

type GetCurrentDepositAddressParams

type GetCurrentDepositAddressParams struct {
	Currency string `json:"currency"`
}

type GetDepositsParams

type GetDepositsParams struct {
	Currency string `json:"currency"`
	Count    int    `json:"count,omitempty"`
	Offset   int    `json:"offset,omitempty"`
}

type GetDepositsResponse

type GetDepositsResponse struct {
	Count int       `json:"count"`
	Data  []Deposit `json:"data"`
}

type GetFundingChartDataParams

type GetFundingChartDataParams struct {
	InstrumentName string `json:"instrument_name"`
	Length         string `json:"length,omitempty"`
}

type GetFundingChartDataResponse

type GetFundingChartDataResponse struct {
	CurrentInterest decimal.Decimal    `json:"current_interest"`
	Data            []FundingChartData `json:"data"`
	Interest8H      decimal.Decimal    `json:"interest_8h"`
}

type GetHistoricalVolatilityParams

type GetHistoricalVolatilityParams struct {
	Currency string `json:"currency"`
}

type GetHistoricalVolatilityResponse

type GetHistoricalVolatilityResponse []HistoricalVolatility

type GetIndexParams

type GetIndexParams struct {
	Currency string `json:"currency"`
}

type GetIndexResponse

type GetIndexResponse struct {
	BTC decimal.Decimal `json:"BTC"`
	ETH decimal.Decimal `json:"ETH"`
	Edp decimal.Decimal `json:"edp"`
}

type GetInstrumentsParams

type GetInstrumentsParams struct {
	Currency string `json:"currency"`
	Kind     string `json:"kind,omitempty"`
	Expired  bool   `json:"expired,omitempty"`
}

type GetLastSettlementsByCurrencyParams

type GetLastSettlementsByCurrencyParams struct {
	Currency             string `json:"currency"`
	Type                 string `json:"type,omitempty"`
	Count                uint64 `json:"count,omitempty"`
	Continuation         string `json:"continuation,omitempty"`
	SearchStartTimestamp uint64 `json:"search_start_timestamp,omitempty"`
}

type GetLastSettlementsByInstrumentParams

type GetLastSettlementsByInstrumentParams struct {
	InstrumentName       string `json:"instrument_name"`
	Type                 string `json:"type,omitempty"`
	Count                int    `json:"count,omitempty"`
	Continuation         string `json:"continuation,omitempty"`
	SearchStartTimestamp uint64 `json:"search_start_timestamp,omitempty"`
}

type GetLastSettlementsResponse

type GetLastSettlementsResponse struct {
	Settlements  []Settlement `json:"settlements"`
	Continuation string       `json:"continuation"`
}

type GetLastTradesByCurrencyAndTimeParams

type GetLastTradesByCurrencyAndTimeParams struct {
	Currency       string `json:"currency"`
	Kind           string `json:"kind,omitempty"`
	StartTimestamp uint64 `json:"start_timestamp"`
	EndTimestamp   uint64 `json:"end_timestamp"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetLastTradesByCurrencyParams

type GetLastTradesByCurrencyParams struct {
	Currency   string `json:"currency"`
	Kind       string `json:"kind,omitempty"`
	StartID    string `json:"start_id,omitempty"`
	EndID      string `json:"end_id,omitempty"`
	Count      int    `json:"count,omitempty"`
	IncludeOld bool   `json:"include_old,omitempty"`
	Sorting    string `json:"sorting,omitempty"`
}

type GetLastTradesByInstrumentAndTimeParams

type GetLastTradesByInstrumentAndTimeParams struct {
	InstrumentName string `json:"instrument_name"`
	StartTimestamp uint64 `json:"start_timestamp"`
	EndTimestamp   uint64 `json:"end_timestamp"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetLastTradesByInstrumentParams

type GetLastTradesByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	StartSeq       int64  `json:"start_seq,omitempty"`
	EndSeq         int64  `json:"end_seq,omitempty"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetLastTradesResponse

type GetLastTradesResponse struct {
	Trades  []Trade `json:"trades"`
	HasMore bool    `json:"has_more"`
}

type GetMarginsParams

type GetMarginsParams struct {
	InstrumentName string          `json:"instrument_name"`
	Amount         decimal.Decimal `json:"amount"`
	Price          decimal.Decimal `json:"price"`
}

type GetMarginsResponse

type GetMarginsResponse struct {
	Buy      decimal.Decimal `json:"buy"`
	MaxPrice decimal.Decimal `json:"max_price"`
	MinPrice decimal.Decimal `json:"min_price"`
	Sell     decimal.Decimal `json:"sell"`
}

type GetOpenOrdersByCurrencyParams

type GetOpenOrdersByCurrencyParams struct {
	Currency string `json:"currency"`
	Kind     string `json:"kind,omitempty"`
	Type     string `json:"type,omitempty"`
}

type GetOpenOrdersByInstrumentParams

type GetOpenOrdersByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	Type           string `json:"type,omitempty"`
}

type GetOrderBookParams

type GetOrderBookParams struct {
	InstrumentName string `json:"instrument_name"`
	Depth          int    `json:"depth,omitempty"`
}

type GetOrderBookResponse

type GetOrderBookResponse struct {
	Timestamp       uint64              `json:"timestamp"`
	Stats           Stats               `json:"stats"`
	State           string              `json:"state"`
	SettlementPrice decimal.Decimal     `json:"settlement_price"`
	MinPrice        decimal.Decimal     `json:"min_price"`
	MaxPrice        decimal.Decimal     `json:"max_price"`
	MarkPrice       decimal.Decimal     `json:"mark_price"`
	MarkIV          decimal.Decimal     `json:"mark_iv"`
	LastPrice       decimal.Decimal     `json:"last_price"`
	InstrumentName  string              `json:"instrument_name"`
	IndexPrice      decimal.Decimal     `json:"index_price"`
	Funding8H       decimal.Decimal     `json:"funding_8h"`
	CurrentFunding  decimal.Decimal     `json:"current_funding"`
	ChangeID        uint64              `json:"change_id"`
	BidIV           decimal.Decimal     `json:"bid_iv"`
	Bids            [][]decimal.Decimal `json:"bids"`
	BestBidPrice    decimal.Decimal     `json:"best_bid_price"`
	BestBidAmount   decimal.Decimal     `json:"best_bid_amount"`
	BestAskPrice    decimal.Decimal     `json:"best_ask_price"`
	BestAskAmount   decimal.Decimal     `json:"best_ask_amount"`
	AskIV           decimal.Decimal     `json:"ask_iv"`
	Asks            [][]decimal.Decimal `json:"asks"`
	DeliveryPrice   decimal.Decimal     `json:"delivery_price"`
	Greeks          Greeks              `json:"greeks"`
	InterestRate    decimal.Decimal     `json:"interest_rate"`
	OpenInterest    decimal.Decimal     `json:"open_interest"`
	UnderlyingIndex decimal.Decimal     `json:"underlying_index"`
	UnderlyingPrice decimal.Decimal     `json:"underlying_price"`
}

type GetOrderHistoryByCurrencyParams

type GetOrderHistoryByCurrencyParams struct {
	Currency        string `json:"currency"`
	Kind            string `json:"kind,omitempty"`
	Count           int    `json:"count,omitempty"`
	Offset          int    `json:"offset,omitempty"`
	IncludeOld      bool   `json:"include_old,omitempty"`
	IncludeUnfilled bool   `json:"include_unfilled,omitempty"`
}

type GetOrderHistoryByInstrumentParams

type GetOrderHistoryByInstrumentParams struct {
	InstrumentName  string `json:"instrument_name"`
	Count           int    `json:"count,omitempty"`
	Offset          int    `json:"offset,omitempty"`
	IncludeOld      bool   `json:"include_old,omitempty"`
	IncludeUnfilled bool   `json:"include_unfilled,omitempty"`
}

type GetOrderMarginByIDsParams

type GetOrderMarginByIDsParams struct {
	IDs []string `json:"ids"`
}

type GetOrderMarginByIDsResponse

type GetOrderMarginByIDsResponse []OrderMargin

type GetOrderStateParams

type GetOrderStateParams struct {
	OrderID string `json:"order_id"`
}

type GetPositionParams

type GetPositionParams struct {
	InstrumentName string `json:"instrument_name"`
}

type GetPositionsParams

type GetPositionsParams struct {
	Currency string `json:"currency"`
	Kind     string `json:"kind,omitempty"`
}

type GetSettlementHistoryByCurrencyParams

type GetSettlementHistoryByCurrencyParams struct {
	Currency             string `json:"currency"`
	Type                 string `json:"type,omitempty"`
	Count                int    `json:"count,omitempty"`
	Continuation         string `json:"continuation"`
	SearchStartTimestamp uint64 `json:"search_start_timestamp"`
}

type GetSettlementHistoryByInstrumentParams

type GetSettlementHistoryByInstrumentParams struct {
	InstrumentName       string `json:"instrument_name"`
	Type                 string `json:"type,omitempty"`
	Count                int    `json:"count,omitempty"`
	Continuation         string `json:"continuation"`
	SearchStartTimestamp uint64 `json:"search_start_timestamp"`
}

type GetSettlementHistoryResponse

type GetSettlementHistoryResponse struct {
	Settlements  []Settlement `json:"settlements"`
	Continuation string       `json:"continuation"`
}

type GetSubaccountsParams

type GetSubaccountsParams struct {
	WithPortfolio bool `json:"with_portfolio,omitempty"`
}

type GetTradeVolumesParams

type GetTradeVolumesParams struct {
	Extended bool `json:"extended"`
}

type GetTradeVolumesResponse

type GetTradeVolumesResponse []TradeVolume

type GetTradingviewChartDataParams

type GetTradingviewChartDataParams struct {
	InstrumentName string `json:"instrument_name"`
	StartTimestamp uint64 `json:"start_timestamp"`
	EndTimestamp   uint64 `json:"end_timestamp"`
	Resolution     string `json:"resolution"`
}

type GetTradingviewChartDataResponse

type GetTradingviewChartDataResponse struct {
	Volume []decimal.Decimal `json:"volume"`
	Ticks  []uint64          `json:"ticks"`
	Status string            `json:"status"`
	Open   []decimal.Decimal `json:"open"`
	Low    []decimal.Decimal `json:"low"`
	High   []decimal.Decimal `json:"high"`
	Cost   []decimal.Decimal `json:"cost"`
	Close  []decimal.Decimal `json:"close"`
}

type GetTransfersParams

type GetTransfersParams struct {
	Currency string `json:"currency"`
	Count    int    `json:"count,omitempty"`
	Offset   int    `json:"offset,omitempty"`
}

type GetTransfersResponse

type GetTransfersResponse struct {
	Count int        `json:"count"`
	Data  []Transfer `json:"data"`
}

type GetUserTradesByCurrencyAndTimeParams

type GetUserTradesByCurrencyAndTimeParams struct {
	Currency       string `json:"currency"`
	Kind           string `json:"kind,omitempty"`
	StartTimestamp int    `json:"start_timestamp"`
	EndTimestamp   int    `json:"end_timestamp"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetUserTradesByCurrencyParams

type GetUserTradesByCurrencyParams struct {
	Currency   string `json:"currency"`
	Kind       string `json:"kind,omitempty"`
	StartID    string `json:"start_id,omitempty"`
	EndID      string `json:"end_id,omitempty"`
	Count      int    `json:"count,omitempty"`
	IncludeOld bool   `json:"include_old,omitempty"`
	Sorting    string `json:"sorting,omitempty"`
}

type GetUserTradesByInstrumentAndTimeParams

type GetUserTradesByInstrumentAndTimeParams struct {
	InstrumentName string `json:"instrument_name"`
	StartTimestamp uint64 `json:"start_timestamp"`
	EndTimestamp   uint64 `json:"end_timestamp"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetUserTradesByInstrumentParams

type GetUserTradesByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	StartSeq       int64  `json:"start_seq,omitempty"`
	EndSeq         int64  `json:"end_seq,omitempty"`
	Count          int    `json:"count,omitempty"`
	IncludeOld     bool   `json:"include_old,omitempty"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetUserTradesByOrderParams

type GetUserTradesByOrderParams struct {
	OrderID string `json:"order_id"`
	Sorting string `json:"sorting,omitempty"`
}

type GetUserTradesResponse

type GetUserTradesResponse struct {
	Trades  []UserTrade `json:"trades"`
	HasMore bool        `json:"has_more"`
}

type GetWithdrawalsParams

type GetWithdrawalsParams struct {
	Currency string `json:"currency"`
	Count    int    `json:"count,omitempty"`
	Offset   int    `json:"offset,omitempty"`
}

type Greeks

type Greeks struct {
	Delta decimal.Decimal `json:"delta"`
	Gamma decimal.Decimal `json:"gamma"`
	RHO   decimal.Decimal `json:"rho"`
	Theta decimal.Decimal `json:"theta"`
	Vega  decimal.Decimal `json:"vega"`
}

type HelloParams

type HelloParams struct {
	ClientName    string `json:"client_name"`
	ClientVersion string `json:"client_version"`
}

type HelloResponse

type HelloResponse struct {
	Version string `json:"version"`
}

type HistoricalVolatility

type HistoricalVolatility struct {
	Timestamp uint64          `json:"timestamp"`
	Value     decimal.Decimal `json:"value"`
}

func (*HistoricalVolatility) UnmarshalJSON

func (h *HistoricalVolatility) UnmarshalJSON(buf []byte) error

type Instrument

type Instrument struct {
	TickSize             decimal.Decimal `json:"tick_size"`
	TakerCommission      decimal.Decimal `json:"taker_commission"`
	SettlementPeriod     string          `json:"settlement_period"`
	QuoteCurrency        string          `json:"quote_currency"`
	MinTradeAmount       decimal.Decimal `json:"min_trade_amount"`
	MakerCommission      decimal.Decimal `json:"maker_commission"`
	Leverage             int             `json:"leverage"`
	Kind                 string          `json:"kind"`
	IsActive             bool            `json:"is_active"`
	InstrumentName       string          `json:"instrument_name"`
	ExpirationTimestamp  uint64          `json:"expiration_timestamp"`
	CreationTimestamp    uint64          `json:"creation_timestamp"`
	ContractSize         decimal.Decimal `json:"contract_size"`
	BaseCurrency         string          `json:"base_currency"`
	BlockTradeCommission decimal.Decimal `json:"block_trade_commission"`
	OptionType           string          `json:"option_type"`
	Strike               decimal.Decimal `json:"strike"`
}

type MarkpriceOption

type MarkpriceOption struct {
	MarkPrice      decimal.Decimal `json:"mark_price"`
	Iv             decimal.Decimal `json:"iv"`
	InstrumentName string          `json:"instrument_name"`
}

type MarkpriceOptionsNotification

type MarkpriceOptionsNotification []MarkpriceOption

type Order

type Order struct {
	MMPCancelled        bool            `json:"mmp_cancelled"`
	OrderState          string          `json:"order_state"`
	MaxShow             decimal.Decimal `json:"max_show"`
	API                 bool            `json:"api"`
	Amount              decimal.Decimal `json:"amount"`
	Web                 bool            `json:"web"`
	InstrumentName      string          `json:"instrument_name"`
	Advanced            string          `json:"advanced,omitempty"`
	Triggered           bool            `json:"triggered,omitempty"`
	BlockTrade          bool            `json:"block_trade"`
	OriginalOrderType   string          `json:"original_order_type"`
	Price               decimal.Decimal `json:"price"`
	TimeInForce         string          `json:"time_in_force"`
	AutoReplaced        bool            `json:"auto_replaced"`
	LastUpdateTimestamp uint64          `json:"last_update_timestamp"`
	PostOnly            bool            `json:"post_only"`
	Replaced            bool            `json:"replaced"`
	FilledAmount        decimal.Decimal `json:"filled_amount"`
	AveragePrice        decimal.Decimal `json:"average_price"`
	OrderID             string          `json:"order_id"`
	ReduceOnly          bool            `json:"reduce_only"`
	Commission          decimal.Decimal `json:"commission"`
	AppName             string          `json:"app_name"`
	Label               string          `json:"label"`
	TriggerOrderID      string          `json:"trigger_order_id"`
	TriggedPrice        decimal.Decimal `json:"trigger_price"`
	CreationTimestamp   uint64          `json:"creation_timestamp"`
	Direction           string          `json:"direction"`
	IsLiquidation       bool            `json:"is_liquidation"`
	OrderType           string          `json:"order_type"`
	USD                 decimal.Decimal `json:"usd,omitempty"`
	ProfitLoss          decimal.Decimal `json:"profit_loss"`
	Implv               decimal.Decimal `json:"implv,omitempty"`
	Trigger             string          `json:"trigger"`
}

type OrderBookGroupNotification

type OrderBookGroupNotification struct {
	Timestamp      int64               `json:"timestamp"`
	InstrumentName string              `json:"instrument_name"`
	ChangeID       int64               `json:"change_id"`
	Bids           [][]decimal.Decimal `json:"bids"` // [price, amount]
	Asks           [][]decimal.Decimal `json:"asks"` // [price, amount]
}

type OrderBookNotification

type OrderBookNotification struct {
	Type           string                      `json:"type"`
	Timestamp      int64                       `json:"timestamp"`
	InstrumentName string                      `json:"instrument_name"`
	PrevChangeID   int64                       `json:"prev_change_id"`
	ChangeID       int64                       `json:"change_id"`
	Bids           []OrderBookNotificationItem `json:"bids"` // [action, price, amount]
	Asks           []OrderBookNotificationItem `json:"asks"` // [action, price, amount]
}

type OrderBookNotificationItem

type OrderBookNotificationItem struct {
	Action string          `json:"action"`
	Price  decimal.Decimal `json:"price"`
	Amount decimal.Decimal `json:"amount"`
}

OrderBookNotificationItem ... ["change",6947.0,82640.0] ["new",6942.5,6940.0] ["delete",6914.0,0.0]

func (*OrderBookNotificationItem) UnmarshalJSON

func (item *OrderBookNotificationItem) UnmarshalJSON(buf []byte) error

type OrderBookRawNotification

type OrderBookRawNotification struct {
	Timestamp      int64                       `json:"timestamp"`
	InstrumentName string                      `json:"instrument_name"`
	PrevChangeID   int64                       `json:"prev_change_id"`
	ChangeID       int64                       `json:"change_id"`
	Bids           []OrderBookNotificationItem `json:"bids"` // [action, price, amount]
	Asks           []OrderBookNotificationItem `json:"asks"` // [action, price, amount]
}

type OrderMargin

type OrderMargin struct {
	InitialMargin decimal.Decimal `json:"initial_margin"`
	OrderID       string          `json:"order_id"`
}

type PerpetualNotification

type PerpetualNotification struct {
	Timestamp  uint64          `json:"timestamp"`
	Interest   decimal.Decimal `json:"interest"`
	IndexPrice decimal.Decimal `json:"index_price"`
}

type Portfolio

type Portfolio struct {
	AvailableFunds           decimal.Decimal `json:"available_funds"`
	AvailableWithdrawalFunds decimal.Decimal `json:"available_withdrawal_funds"`
	Balance                  decimal.Decimal `json:"balance"`
	Currency                 string          `json:"currency"`
	Equity                   decimal.Decimal `json:"equity"`
	InitialMargin            int             `json:"initial_margin"`
	MaintenanceMargin        int             `json:"maintenance_margin"`
	MarginBalance            decimal.Decimal `json:"margin_balance"`
}

type PortfolioNotification

type PortfolioNotification struct {
	TotalPl                    decimal.Decimal `json:"total_pl"`
	SessionUpl                 decimal.Decimal `json:"session_upl"`
	SessionRpl                 decimal.Decimal `json:"session_rpl"`
	ProjectedMaintenanceMargin decimal.Decimal `json:"projected_maintenance_margin"`
	ProjectedInitialMargin     decimal.Decimal `json:"projected_initial_margin"`
	ProjectedDeltaTotal        decimal.Decimal `json:"projected_delta_total"`
	PortfolioMarginingEnabled  bool            `json:"portfolio_margining_enabled"`
	OptionsVega                decimal.Decimal `json:"options_vega"`
	OptionsValue               decimal.Decimal `json:"options_value"`
	OptionsTheta               decimal.Decimal `json:"options_theta"`
	OptionsSessionUpl          decimal.Decimal `json:"options_session_upl"`
	OptionsSessionRpl          decimal.Decimal `json:"options_session_rpl"`
	OptionsPl                  decimal.Decimal `json:"options_pl"`
	OptionsGamma               decimal.Decimal `json:"options_gamma"`
	OptionsDelta               decimal.Decimal `json:"options_delta"`
	MarginBalance              decimal.Decimal `json:"margin_balance"`
	MaintenanceMargin          decimal.Decimal `json:"maintenance_margin"`
	InitialMargin              decimal.Decimal `json:"initial_margin"`
	FuturesSessionUpl          decimal.Decimal `json:"futures_session_upl"`
	FuturesSessionRpl          decimal.Decimal `json:"futures_session_rpl"`
	FuturesPl                  decimal.Decimal `json:"futures_pl"`
	EstimatedLiquidationRatio  decimal.Decimal `json:"estimated_liquidation_ratio"`
	Equity                     decimal.Decimal `json:"equity"`
	DeltaTotal                 decimal.Decimal `json:"delta_total"`
	Currency                   string          `json:"currency"`
	Balance                    decimal.Decimal `json:"balance"`
	AvailableWithdrawalFunds   decimal.Decimal `json:"available_withdrawal_funds"`
	AvailableFunds             decimal.Decimal `json:"available_funds"`
}

type Position

type Position struct {
	AveragePrice              decimal.Decimal `json:"average_price"`
	AveragePriceUSD           decimal.Decimal `json:"average_price_usd"`
	Delta                     decimal.Decimal `json:"delta"`
	Direction                 string          `json:"direction"`
	EstimatedLiquidationPrice decimal.Decimal `json:"estimated_liquidation_price"`
	FloatingProfitLoss        decimal.Decimal `json:"floating_profit_loss"`
	FloatingProfitLossUSD     decimal.Decimal `json:"floating_profit_loss_usd"`
	Gamma                     decimal.Decimal `json:"gamma"`
	IndexPrice                decimal.Decimal `json:"index_price"`
	InitialMargin             decimal.Decimal `json:"initial_margin"`
	InstrumentName            string          `json:"instrument_name"`
	Kind                      string          `json:"kind"`
	Leverage                  int             `json:"leverage"`
	MaintenanceMargin         decimal.Decimal `json:"maintenance_margin"`
	MarkPrice                 decimal.Decimal `json:"mark_price"`
	OpenOrdersMargin          decimal.Decimal `json:"open_orders_margin"`
	RealizedFunding           decimal.Decimal `json:"realized_funding"`
	RealizedProfitLoss        decimal.Decimal `json:"realized_profit_loss"`
	SettlementPrice           decimal.Decimal `json:"settlement_price"`
	Size                      decimal.Decimal `json:"size"`
	SizeCurrency              decimal.Decimal `json:"size_currency"`
	Theta                     decimal.Decimal `json:"theta"`
	TotalProfitLoss           decimal.Decimal `json:"total_profit_loss"`
	Vega                      decimal.Decimal `json:"vega"`
}

type QuoteNotification

type QuoteNotification struct {
	Timestamp      uint64           `json:"timestamp"`
	InstrumentName string           `json:"instrument_name"`
	BestBidPrice   *decimal.Decimal `json:"best_bid_price"`
	BestBidAmount  decimal.Decimal  `json:"best_bid_amount"`
	BestAskPrice   *decimal.Decimal `json:"best_ask_price"`
	BestAskAmount  decimal.Decimal  `json:"best_ask_amount"`
}

type SellParams

type SellParams struct {
	InstrumentName string           `json:"instrument_name"`
	Amount         decimal.Decimal  `json:"amount"`
	Type           string           `json:"type,omitempty"`
	Label          string           `json:"label,omitempty"`
	Price          *decimal.Decimal `json:"price,omitempty"`
	TimeInForce    string           `json:"time_in_force,omitempty"`
	MaxShow        *decimal.Decimal `json:"max_show,omitempty"`
	PostOnly       bool             `json:"post_only,omitempty"`
	RejectPostOnly bool             `json:"reject_post_only,omitempty"`
	ReduceOnly     bool             `json:"reduce_only,omitempty"`
	TriggerPrice   *decimal.Decimal `json:"trigger_price,omitempty"`
	Trigger        string           `json:"trigger,omitempty"`
	Advanced       string           `json:"advanced,omitempty"`
	MMP            *bool            `json:"mmp,omitempty"`
}

type SellResponse

type SellResponse struct {
	Trades []Trade `json:"trades"`
	Order  Order   `json:"order"`
}

type SessionParams

type SessionParams struct {
	Scope string `json:"scope"`
}

type SetAnnouncementAsReadParams

type SetAnnouncementAsReadParams struct {
	AnnouncementID int `json:"announcement_id"`
}

type SetEmailForSubaccountParams

type SetEmailForSubaccountParams struct {
	Sid   int    `json:"sid"`
	Email string `json:"email"`
}

type SetEmailLanguageParams

type SetEmailLanguageParams struct {
	Language string `json:"language"`
}

type SetHeartbeatParams

type SetHeartbeatParams struct {
	Interval uint64 `json:"interval"`
}

type SetPasswordForSubaccountParams

type SetPasswordForSubaccountParams struct {
	Sid      int    `json:"sid"`
	Password string `json:"password"`
}

type Settlement

type Settlement struct {
	Funded            decimal.Decimal `json:"funded"`
	Funding           decimal.Decimal `json:"funding"`
	Type              string          `json:"type"`
	Timestamp         uint64          `json:"timestamp"`
	SessionProfitLoss decimal.Decimal `json:"session_profit_loss"`
	ProfitLoss        decimal.Decimal `json:"profit_loss"`
	Position          decimal.Decimal `json:"position"`
	MarkPrice         decimal.Decimal `json:"mark_price"`
	InstrumentName    string          `json:"instrument_name"`
	IndexPrice        decimal.Decimal `json:"index_price"`
	SessionBankrupcy  decimal.Decimal `json:"session_bankrupcy"`
	SessionTax        decimal.Decimal `json:"session_tax"`
	SessionTaxRate    decimal.Decimal `json:"session_tax_rate"`
	Socialized        decimal.Decimal `json:"socialized"`
}

type Stats

type Stats struct {
	Volume      decimal.Decimal  `json:"volume"`
	PriceChange *decimal.Decimal `json:"price_change"`
	Low         decimal.Decimal  `json:"low"`
	High        decimal.Decimal  `json:"high"`
}

type Subaccount

type Subaccount struct {
	Email        string `json:"email"`
	ID           int    `json:"id"`
	IsPassword   bool   `json:"is_password"`
	LoginEnabled bool   `json:"login_enabled"`
	Portfolio    struct {
		Eth Portfolio `json:"eth"`
		Btc Portfolio `json:"btc"`
	} `json:"portfolio"`
	ReceiveNotifications bool   `json:"receive_notifications"`
	SystemName           string `json:"system_name"`
	TfaEnabled           bool   `json:"tfa_enabled"`
	Type                 string `json:"type"`
	Username             string `json:"username"`
}

type SubscribeParams

type SubscribeParams struct {
	Channels []string `json:"channels"`
}

type SubscribeResponse

type SubscribeResponse []string

type TestResponse

type TestResponse struct {
	Version string `json:"version"`
}

type TickerNotification

type TickerNotification struct {
	Timestamp       uint64           `json:"timestamp"`
	Stats           Stats            `json:"stats"`
	State           string           `json:"state"`
	SettlementPrice decimal.Decimal  `json:"settlement_price"`
	OpenInterest    decimal.Decimal  `json:"open_interest"`
	MinPrice        decimal.Decimal  `json:"min_price"`
	MaxPrice        decimal.Decimal  `json:"max_price"`
	MarkPrice       decimal.Decimal  `json:"mark_price"`
	LastPrice       decimal.Decimal  `json:"last_price"`
	InstrumentName  string           `json:"instrument_name"`
	IndexPrice      decimal.Decimal  `json:"index_price"`
	Funding8H       decimal.Decimal  `json:"funding_8h"`
	CurrentFunding  decimal.Decimal  `json:"current_funding"`
	BestBidPrice    *decimal.Decimal `json:"best_bid_price"`
	BestBidAmount   decimal.Decimal  `json:"best_bid_amount"`
	BestAskPrice    *decimal.Decimal `json:"best_ask_price"`
	BestAskAmount   decimal.Decimal  `json:"best_ask_amount"`
}

type TickerParams

type TickerParams struct {
	InstrumentName string `json:"instrument_name"`
}

type TickerResponse

type TickerResponse struct {
	BestAskAmount   decimal.Decimal `json:"best_ask_amount"`
	BestAskPrice    decimal.Decimal `json:"best_ask_price"`
	BestBidAmount   decimal.Decimal `json:"best_bid_amount"`
	BestBidPrice    decimal.Decimal `json:"best_bid_price"`
	CurrentFunding  decimal.Decimal `json:"current_funding"`
	Funding8H       decimal.Decimal `json:"funding_8h"`
	IndexPrice      decimal.Decimal `json:"index_price"`
	InstrumentName  string          `json:"instrument_name"`
	LastPrice       decimal.Decimal `json:"last_price"`
	MarkPrice       decimal.Decimal `json:"mark_price"`
	MaxPrice        decimal.Decimal `json:"max_price"`
	MinPrice        decimal.Decimal `json:"min_price"`
	OpenInterest    decimal.Decimal `json:"open_interest"`
	SettlementPrice decimal.Decimal `json:"settlement_price"`
	State           string          `json:"state"`
	Stats           Stats           `json:"stats"`
	Timestamp       uint64          `json:"timestamp"`
}

type ToggleNotificationsFromSubaccountParams

type ToggleNotificationsFromSubaccountParams struct {
	Sid   int  `json:"sid"`
	State bool `json:"state"`
}

type ToggleSubaccountLoginParams

type ToggleSubaccountLoginParams struct {
	Sid   int    `json:"sid"`
	State string `json:"state"`
}

type Trade

type Trade struct {
	Amount         decimal.Decimal `json:"amount"`
	BlockTradeID   string          `json:"block_trade_id"`
	Direction      string          `json:"direction"`
	IndexPrice     decimal.Decimal `json:"index_price"`
	InstrumentName string          `json:"instrument_name"`
	IV             decimal.Decimal `json:"iv"`
	Liquidation    string          `json:"liquidation"`
	MarkPrice      decimal.Decimal `json:"mark_price"`
	Price          decimal.Decimal `json:"price"`
	TickDirection  int             `json:"tick_direction"`
	Timestamp      uint64          `json:"timestamp"`
	TradeID        string          `json:"trade_id"`
	TradeSeq       uint64          `json:"trade_seq"`
}

type TradeVolume

type TradeVolume struct {
	PutsVolume       decimal.Decimal `json:"puts_volume"`
	PutsVolume30D    decimal.Decimal `json:"puts_volume_30d"`
	PutsVolume7D     decimal.Decimal `json:"puts_volume_7d"`
	FuturesVolume    decimal.Decimal `json:"futures_volume"`
	FuturesVolume30D decimal.Decimal `json:"futures_volume_30d"`
	FuturesVolume7D  decimal.Decimal `json:"futures_volume_7d"`
	CurrencyPair     string          `json:"currency_pair"`
	CallsVolume      decimal.Decimal `json:"calls_volume"`
	CallsVolume30D   decimal.Decimal `json:"calls_volume_30d"`
	CallsVolume7D    decimal.Decimal `json:"calls_volume_7d"`
}

type TradesNotification

type TradesNotification []Trade

type Transfer

type Transfer struct {
	Amount           decimal.Decimal `json:"amount"`
	CreatedTimestamp uint64          `json:"created_timestamp"`
	Currency         string          `json:"currency"`
	Direction        string          `json:"direction"`
	ID               int             `json:"id"`
	OtherSide        string          `json:"other_side"`
	State            string          `json:"state"`
	Type             string          `json:"type"`
	UpdatedTimestamp uint64          `json:"updated_timestamp"`
}

type UnsubscribeParams

type UnsubscribeParams struct {
	Channels []string `json:"channels"`
}

type UnsubscribeResponse

type UnsubscribeResponse []string

type UserChangesNotification

type UserChangesNotification struct {
	InstrumentName string      `json:"instrument_name"`
	Trades         []UserTrade `json:"trades"`
	Positions      []Position  `json:"positions"`
	Orders         []Order     `json:"orders"`
}

type UserOrderNotification

type UserOrderNotification []Order

type UserTrade

type UserTrade struct {
	UnderlyingPrice decimal.Decimal `json:"underlying_price"`
	TradeSeq        uint64          `json:"trade_seq"`
	TradeID         string          `json:"trade_id"`
	Timestamp       uint64          `json:"timestamp"`
	TickDirection   int             `json:"tick_direction"`
	State           string          `json:"state"`
	SelfTrade       bool            `json:"self_trade"`
	ReduceOnly      bool            `json:"reduce_only"`
	ProfitLost      decimal.Decimal `json:"profit_lost"`
	Price           decimal.Decimal `json:"price"`
	PostOnly        bool            `json:"post_only"`
	OrderType       string          `json:"order_type"`
	OrderID         string          `json:"order_id"`
	MatchingID      *string         `json:"matching_id"`
	MarkPrice       decimal.Decimal `json:"mark_price"`
	Liquidity       string          `json:"liquidity"`
	Liquidation     string          `json:"liquidation"`
	Label           string          `json:"label"`
	IV              decimal.Decimal `json:"iv"`
	InstrumentName  string          `json:"instrument_name"`
	IndexPrice      decimal.Decimal `json:"index_price"`
	FeeCurrency     string          `json:"fee_currency"`
	Fee             decimal.Decimal `json:"fee"`
	Direction       string          `json:"direction"`
	Amount          decimal.Decimal `json:"amount"`
	BlockTradeID    string          `json:"block_trade_id"`
}

type UserTradesNotification

type UserTradesNotification []UserTrade

type WithdrawParams

type WithdrawParams struct {
	Currency string          `json:"currency"`
	Address  string          `json:"address"`
	Amount   decimal.Decimal `json:"amount"`
	Priority string          `json:"priority,omitempty"`
	Tfa      string          `json:"tfa,omitempty"`
}

type Withdrawal

type Withdrawal struct {
	Address            string          `json:"address"`
	Amount             decimal.Decimal `json:"amount"`
	ConfirmedTimestamp *uint64         `json:"confirmed_timestamp,omitempty"`
	CreatedTimestamp   uint64          `json:"created_timestamp"`
	Currency           string          `json:"currency"`
	Fee                decimal.Decimal `json:"fee"`
	ID                 uint64          `json:"id"`
	Priority           decimal.Decimal `json:"priority"`
	State              string          `json:"state"`
	TransactionID      *string         `json:"transaction_id,omitempty"`
	UpdatedTimestamp   uint64          `json:"updated_timestamp"`
}

type WithdrawalPriority

type WithdrawalPriority struct {
	Name  string          `json:"name"`
	Value decimal.Decimal `json:"value"`
}

Source Files

Jump to

Keyboard shortcuts

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