models

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: MIT Imports: 6 Imported by: 0

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

type Announcement

type Announcement struct {
	Title           string `json:"title"`
	PublicationTime int64  `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      int64  `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    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	State        string `json:"state"`
	TokenType    string `json:"token_type"`
}

type BookSummary

type BookSummary struct {
	Volume            float64 `json:"volume"`
	UnderlyingPrice   float64 `json:"underlying_price"`
	UnderlyingIndex   string  `json:"underlying_index"`
	QuoteCurrency     string  `json:"quote_currency"`
	OpenInterest      float64 `json:"open_interest"`
	MidPrice          float64 `json:"mid_price"`
	MarkPrice         float64 `json:"mark_price"`
	Low               float64 `json:"low"`
	Last              float64 `json:"last"`
	InterestRate      float64 `json:"interest_rate"`
	InstrumentName    string  `json:"instrument_name"`
	High              float64 `json:"high"`
	CreationTimestamp int64   `json:"creation_timestamp"`
	BidPrice          float64 `json:"bid_price"`
	BaseCurrency      string  `json:"base_currency"`
	AskPrice          float64 `json:"ask_price"`
}

type BuyParams

type BuyParams struct {
	InstrumentName string   `json:"instrument_name"`
	Amount         float64  `json:"amount"`
	Type           string   `json:"type,omitempty"`
	Label          string   `json:"label,omitempty"`
	Price          float64  `json:"price,omitempty"`
	TimeInForce    string   `json:"time_in_force,omitempty"`
	MaxShow        *float64 `json:"max_show,omitempty"`
	PostOnly       bool     `json:"post_only,omitempty"`
	ReduceOnly     bool     `json:"reduce_only,omitempty"`
	StopPrice      float64  `json:"stop_price,omitempty"`
	Trigger        string   `json:"trigger,omitempty"`
	Advanced       string   `json:"advanced,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 CancelParams

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

type CancelTransferByIDParams

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

type CancelWithdrawalParams

type CancelWithdrawalParams struct {
	Currency string `json:"currency"`
	ID       int    `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          float64 `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"`
	DisabledDepositAddressCreation bool                 `json:"disabled_deposit_address_creation"`
	FeePrecision                   int                  `json:"fee_precision"`
	MinConfirmations               int                  `json:"min_confirmations"`
	MinWithdrawalFee               float64              `json:"min_withdrawal_fee"`
	WithdrawalFee                  float64              `json:"withdrawal_fee"`
	WithdrawalPriorities           []WithdrawalPriority `json:"withdrawal_priorities"`
}

type Deposit

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

type DepositAddress

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

type DeribitPriceIndexNotification

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

type DeribitPriceRanking

type DeribitPriceRanking struct {
	Weight     float64 `json:"weight"`
	Timestamp  int64   `json:"timestamp"`
	Price      float64 `json:"price"`
	Identifier string  `json:"identifier"`
	Enabled    bool    `json:"enabled"`
}

type DeribitPriceRankingNotification

type DeribitPriceRankingNotification []DeribitPriceRanking

type DeribitVolatilityIndexNotification added in v1.0.6

type DeribitVolatilityIndexNotification struct {
	Timestamp         int64   `json:"timestamp"`
	IndexName         string  `json:"index_name"`
	Volatility        float64 `json:"volatility"`
	EstimatedDelivery float64 `json:"estimated_delivery"`
}

func (DeribitVolatilityIndexNotification) DailyVolatility added in v1.0.6

func (dvol DeribitVolatilityIndexNotification) DailyVolatility() float64

type DisableTfaForSubaccountParams

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

type EditParams

type EditParams struct {
	OrderID   string  `json:"order_id"`
	Amount    float64 `json:"amount"`
	Price     float64 `json:"price"`
	PostOnly  bool    `json:"post_only,omitempty"`
	Advanced  string  `json:"advanced,omitempty"`
	StopPrice float64 `json:"stop_price,omitempty"`
}

type EditResponse

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

type EstimatedExpirationPriceNotification

type EstimatedExpirationPriceNotification struct {
	Seconds     int     `json:"seconds"`
	Price       float64 `json:"price"`
	IsEstimated bool    `json:"is_estimated"`
}

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 int `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 float64     `json:"current_interest"`
	Data            [][]float64 `json:"data"`
	IndexPrice      float64     `json:"index_price"`
	Interest8H      float64     `json:"interest_8h"`
	Max             float64     `json:"max"`
}

type GetHistoricalVolatilityParams

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

type GetHistoricalVolatilityResponse

type GetHistoricalVolatilityResponse [][]float64

type GetIndexParams

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

type GetIndexResponse

type GetIndexResponse struct {
	BTC float64 `json:"BTC"`
	ETH float64 `json:"ETH"`
	Edp float64 `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                int    `json:"count,omitempty"`
	Continuation         string `json:"continuation,omitempty"`
	SearchStartTimestamp int    `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 int    `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 int64  `json:"start_timestamp"`
	EndTimestamp   int64  `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 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 GetLastTradesByInstrumentParams

type GetLastTradesByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	StartSeq       int    `json:"start_seq,omitempty"`
	EndSeq         int    `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         float64 `json:"amount"`
	Price          float64 `json:"price"`
}

type GetMarginsResponse

type GetMarginsResponse struct {
	Buy      float64 `json:"buy"`
	MaxPrice float64 `json:"max_price"`
	MinPrice float64 `json:"min_price"`
	Sell     float64 `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 int64 `json:"timestamp"`
	Stats     struct {
		Volume float64 `json:"volume"`
		Low    float64 `json:"low"`
		High   float64 `json:"high"`
	} `json:"stats"`
	State           string      `json:"state"`
	SettlementPrice float64     `json:"settlement_price"`
	OpenInterest    float64     `json:"open_interest"`
	MinPrice        float64     `json:"min_price"`
	MaxPrice        float64     `json:"max_price"`
	MarkPrice       float64     `json:"mark_price"`
	LastPrice       float64     `json:"last_price"`
	InstrumentName  string      `json:"instrument_name"`
	IndexPrice      float64     `json:"index_price"`
	Funding8H       float64     `json:"funding_8h"`
	CurrentFunding  float64     `json:"current_funding"`
	ChangeID        int         `json:"change_id"`
	Bids            [][]float64 `json:"bids"`
	BestBidPrice    float64     `json:"best_bid_price"`
	BestBidAmount   float64     `json:"best_bid_amount"`
	BestAskPrice    float64     `json:"best_ask_price"`
	BestAskAmount   float64     `json:"best_ask_amount"`
	Asks            [][]float64 `json:"asks"`
}

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"`
}

type GetSettlementHistoryByInstrumentParams

type GetSettlementHistoryByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	Type           string `json:"type,omitempty"`
	Count          int    `json:"count,omitempty"`
}

type GetSettlementHistoryResponse

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

type GetStopOrderHistoryParams

type GetStopOrderHistoryParams struct {
	Currency       string `json:"currency"`
	InstrumentName string `json:"instrument_name"`
	Count          int    `json:"count,omitempty"`
	Continuation   string `json:"continuation,omitempty"`
}

type GetStopOrderHistoryResponse

type GetStopOrderHistoryResponse struct {
	Entries      []StopOrder `json:"entries"`
	Continuation string      `json:"continuation"`
}

type GetSubaccountsParams

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

type GetTradeVolumesResponse

type GetTradeVolumesResponse []TradeVolume

type GetTradingviewChartDataParams

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

type GetTradingviewChartDataResponse

type GetTradingviewChartDataResponse struct {
	Volume []float64 `json:"volume"`
	Ticks  []int64   `json:"ticks"`
	Status string    `json:"status"`
	Open   []float64 `json:"open"`
	Low    []float64 `json:"low"`
	High   []float64 `json:"high"`
	Close  []float64 `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 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 GetUserTradesByInstrumentParams

type GetUserTradesByInstrumentParams struct {
	InstrumentName string `json:"instrument_name"`
	StartSeq       int    `json:"start_seq,omitempty"`
	EndSeq         int    `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 HelloParams

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

type HelloResponse

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

type Instrument

type Instrument struct {
	TickSize            float64 `json:"tick_size"`
	Strike              float64 `json:"strike"`
	SettlementPeriod    string  `json:"settlement_period"`
	QuoteCurrency       string  `json:"quote_currency"`
	OptionType          string  `json:"option_type"`
	MinTradeAmount      float64 `json:"min_trade_amount"`
	Kind                string  `json:"kind"`
	IsActive            bool    `json:"is_active"`
	InstrumentName      string  `json:"instrument_name"`
	ExpirationTimestamp int64   `json:"expiration_timestamp"`
	CreationTimestamp   int64   `json:"creation_timestamp"`
	ContractSize        float64 `json:"contract_size"`
	BaseCurrency        string  `json:"base_currency"`
}

type MarkpriceOption

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

type MarkpriceOptionsNotification

type MarkpriceOptionsNotification []MarkpriceOption

type Order

type Order struct {
	Advanced            string  `json:"advanced,omitempty"`
	Amount              float64 `json:"amount"`
	API                 bool    `json:"api"`
	TimeInForce         string  `json:"time_in_force"`
	ReduceOnly          bool    `json:"reduce_only"`
	ProfitLoss          float64 `json:"profit_loss"`
	Price               Price   `json:"price"`
	PostOnly            bool    `json:"post_only"`
	StopPrice           float64 `json:"stop_price,omitempty"`
	Triggered           bool    `json:"triggered,omitempty"`
	OrderType           string  `json:"order_type"`
	OrderState          string  `json:"order_state"`
	OrderID             string  `json:"order_id"`
	MaxShow             float64 `json:"max_show"`
	LastUpdateTimestamp int64   `json:"last_update_timestamp"`
	Label               string  `json:"label"`
	IsLiquidation       bool    `json:"is_liquidation"`
	InstrumentName      string  `json:"instrument_name"`
	FilledAmount        float64 `json:"filled_amount"`
	Direction           string  `json:"direction"`
	CreationTimestamp   int64   `json:"creation_timestamp"`
	Commission          float64 `json:"commission"`
	AveragePrice        float64 `json:"average_price"`
	Implv               float64 `json:"implv,omitempty"`
	Usd                 float64 `json:"usd,omitempty"`
}

type OrderBookGroupNotification

type OrderBookGroupNotification struct {
	Timestamp      int64       `json:"timestamp"`
	InstrumentName string      `json:"instrument_name"`
	ChangeID       int64       `json:"change_id"`
	Bids           [][]float64 `json:"bids"` // [price, amount]
	Asks           [][]float64 `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  float64 `json:"price"`
	Amount float64 `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(b []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 float64 `json:"initial_margin"`
	OrderID       string  `json:"order_id"`
}

type PerpetualNotification

type PerpetualNotification struct {
	Interest float64 `json:"interest"`
}

type Portfolio

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

type PortfolioNotification

type PortfolioNotification struct {
	TotalPl                   float64 `json:"total_pl"`
	SessionUpl                float64 `json:"session_upl"`
	SessionRpl                float64 `json:"session_rpl"`
	SessionFunding            float64 `json:"session_funding"`
	PortfolioMarginingEnabled bool    `json:"portfolio_margining_enabled"`
	OptionsVega               float64 `json:"options_vega"`
	OptionsTheta              float64 `json:"options_theta"`
	OptionsSessionUpl         float64 `json:"options_session_upl"`
	OptionsSessionRpl         float64 `json:"options_session_rpl"`
	OptionsPl                 float64 `json:"options_pl"`
	OptionsGamma              float64 `json:"options_gamma"`
	OptionsDelta              float64 `json:"options_delta"`
	MarginBalance             float64 `json:"margin_balance"`
	MaintenanceMargin         float64 `json:"maintenance_margin"`
	InitialMargin             float64 `json:"initial_margin"`
	FuturesSessionUpl         float64 `json:"futures_session_upl"`
	FuturesSessionRpl         float64 `json:"futures_session_rpl"`
	FuturesPl                 float64 `json:"futures_pl"`
	Equity                    float64 `json:"equity"`
	DeltaTotal                float64 `json:"delta_total"`
	Currency                  string  `json:"currency"`
	Balance                   float64 `json:"balance"`
	AvailableWithdrawalFunds  float64 `json:"available_withdrawal_funds"`
	AvailableFunds            float64 `json:"available_funds"`
}

type Position

type Position struct {
	AveragePrice              float64 `json:"average_price"`
	Delta                     float64 `json:"delta"`
	Direction                 string  `json:"direction"`
	EstimatedLiquidationPrice float64 `json:"estimated_liquidation_price"`
	FloatingProfitLoss        float64 `json:"floating_profit_loss"`
	IndexPrice                float64 `json:"index_price"`
	InitialMargin             float64 `json:"initial_margin"`
	InstrumentName            string  `json:"instrument_name"`
	Kind                      string  `json:"kind"`
	MaintenanceMargin         float64 `json:"maintenance_margin"`
	MarkPrice                 float64 `json:"mark_price"`
	OpenOrdersMargin          float64 `json:"open_orders_margin"`
	RealizedProfitLoss        float64 `json:"realized_profit_loss"`
	SettlementPrice           float64 `json:"settlement_price"`
	Size                      float64 `json:"size"`
	SizeCurrency              float64 `json:"size_currency"`
	TotalProfitLoss           float64 `json:"total_profit_loss"`
}

type Price

type Price float64

func (*Price) ToFloat64

func (p *Price) ToFloat64() float64

func (*Price) UnmarshalJSON

func (p *Price) UnmarshalJSON(data []byte) (err error)

type QuoteNotification

type QuoteNotification struct {
	Timestamp      int64   `json:"timestamp"`
	InstrumentName string  `json:"instrument_name"`
	BestBidPrice   float64 `json:"best_bid_price"`
	BestBidAmount  float64 `json:"best_bid_amount"`
	BestAskPrice   float64 `json:"best_ask_price"`
	BestAskAmount  float64 `json:"best_ask_amount"`
}

func (QuoteNotification) MidPrice

func (qn QuoteNotification) MidPrice() float64

func (QuoteNotification) Spread

func (qn QuoteNotification) Spread() float64

func (QuoteNotification) Time added in v1.0.6

func (qn QuoteNotification) Time() time.Time

type SellParams

type SellParams struct {
	InstrumentName string   `json:"instrument_name"`
	Amount         float64  `json:"amount"`
	Type           string   `json:"type,omitempty"`
	Label          string   `json:"label,omitempty"`
	Price          float64  `json:"price,omitempty"`
	TimeInForce    string   `json:"time_in_force,omitempty"`
	MaxShow        *float64 `json:"max_show,omitempty"`
	PostOnly       bool     `json:"post_only,omitempty"`
	ReduceOnly     bool     `json:"reduce_only,omitempty"`
	StopPrice      float64  `json:"stop_price,omitempty"`
	Trigger        string   `json:"trigger,omitempty"`
	Advanced       string   `json:"advanced,omitempty"`
}

type SellResponse

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

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 float64 `json:"interval"`
}

type SetPasswordForSubaccountParams

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

type Settlement

type Settlement struct {
	Type              string  `json:"type"`
	Timestamp         int64   `json:"timestamp"`
	SessionProfitLoss float64 `json:"session_profit_loss"`
	ProfitLoss        float64 `json:"profit_loss"`
	Position          float64 `json:"position"`
	MarkPrice         float64 `json:"mark_price"`
	InstrumentName    string  `json:"instrument_name"`
	IndexPrice        float64 `json:"index_price"`
}

type StopOrder

type StopOrder struct {
	Trigger        string  `json:"trigger"`
	Timestamp      int64   `json:"timestamp"`
	StopPrice      float64 `json:"stop_price"`
	StopID         string  `json:"stop_id"`
	OrderState     string  `json:"order_state"`
	Request        string  `json:"request"`
	Price          Price   `json:"price"`
	OrderID        string  `json:"order_id"`
	Offset         float64 `json:"offset"`
	InstrumentName string  `json:"instrument_name"`
	Amount         float64 `json:"amount"`
	Direction      string  `json:"direction"`
}

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 int64 `json:"timestamp"`
	Stats     struct {
		Volume float64 `json:"volume"`
		Low    float64 `json:"low"`
		High   float64 `json:"high"`
	} `json:"stats"`
	State           string  `json:"state"`
	SettlementPrice float64 `json:"settlement_price"`
	OpenInterest    float64 `json:"open_interest"`
	MinPrice        float64 `json:"min_price"`
	MaxPrice        float64 `json:"max_price"`
	MarkPrice       float64 `json:"mark_price"`
	LastPrice       float64 `json:"last_price"`
	InstrumentName  string  `json:"instrument_name"`
	IndexPrice      float64 `json:"index_price"`
	Funding8H       float64 `json:"funding_8h"`
	CurrentFunding  float64 `json:"current_funding"`
	BestBidPrice    float64 `json:"best_bid_price"`
	BestBidAmount   float64 `json:"best_bid_amount"`
	BestAskPrice    float64 `json:"best_ask_price"`
	BestAskAmount   float64 `json:"best_ask_amount"`
}

func (TickerNotification) Time added in v1.0.6

func (t TickerNotification) Time() time.Time

type TickerParams

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

type TickerResponse

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

type TickerStats

type TickerStats struct {
	Volume float64 `json:"volume"`
	Low    float64 `json:"low"`
	High   float64 `json:"high"`
}

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 {
	TradeSeq       int     `json:"trade_seq"`
	TradeID        string  `json:"trade_id"`
	Timestamp      int64   `json:"timestamp"`
	TickDirection  int     `json:"tick_direction"`
	Price          float64 `json:"price"`
	Iv             float64 `json:"iv"`
	InstrumentName string  `json:"instrument_name"`
	IndexPrice     float64 `json:"index_price"`
	Direction      string  `json:"direction"`
	Amount         float64 `json:"amount"`
}

func (Trade) Time added in v1.0.6

func (t Trade) Time() time.Time

type TradeVolume

type TradeVolume struct {
	PutsVolume    float64 `json:"puts_volume"`
	FuturesVolume float64 `json:"futures_volume"`
	CurrencyPair  string  `json:"currency_pair"`
	CallsVolume   float64 `json:"calls_volume"`
}

type TradesNotification

type TradesNotification []Trade

func (TradesNotification) Amount added in v1.0.5

func (tn TradesNotification) Amount() float64

func (TradesNotification) Count

func (tn TradesNotification) Count() int

func (TradesNotification) Direction

func (tn TradesNotification) Direction() string

func (TradesNotification) FirstTrade

func (tn TradesNotification) FirstTrade() Trade

func (TradesNotification) Gap

func (tn TradesNotification) Gap() float64

func (TradesNotification) High

func (tn TradesNotification) High() float64

func (TradesNotification) InstrumentName

func (tn TradesNotification) InstrumentName() string

func (TradesNotification) LastTrade

func (tn TradesNotification) LastTrade() Trade

func (TradesNotification) Low

func (tn TradesNotification) Low() float64

func (TradesNotification) Timestamp

func (tn TradesNotification) Timestamp() int64

func (TradesNotification) VWAP

func (tn TradesNotification) VWAP() float64

type Transfer

type Transfer struct {
	Amount           float64 `json:"amount"`
	CreatedTimestamp int64   `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 int64   `json:"updated_timestamp"`
}

type UnsubscribeParams

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

type UnsubscribeResponse

type UnsubscribeResponse []string

type UserChangesNotification

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

type UserOrderNotification

type UserOrderNotification []Order

type UserTrade

type UserTrade struct {
	TradeSeq       int         `json:"trade_seq"`
	TradeID        string      `json:"trade_id"`
	Timestamp      int64       `json:"timestamp"`
	TickDirection  int         `json:"tick_direction"`
	State          string      `json:"state"`
	SelfTrade      bool        `json:"self_trade"`
	Price          float64     `json:"price"`
	OrderType      string      `json:"order_type"`
	OrderID        string      `json:"order_id"`
	MatchingID     interface{} `json:"matching_id"`
	Liquidity      string      `json:"liquidity"`
	InstrumentName string      `json:"instrument_name"`
	IndexPrice     float64     `json:"index_price"`
	FeeCurrency    string      `json:"fee_currency"`
	Fee            float64     `json:"fee"`
	Direction      string      `json:"direction"`
	Amount         float64     `json:"amount"`
}

type UserTradesNotification

type UserTradesNotification []UserTrade

type WithdrawParams

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

type Withdrawal

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

type WithdrawalPriority

type WithdrawalPriority struct {
	Name  string  `json:"name"`
	Value float64 `json:"value"`
}

Source Files

Jump to

Keyboard shortcuts

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