Documentation
¶
Index ¶
- type AcctSummaryIn
- type AcctSummaryOut
- type AuthOut
- type BkSummaryByCcyIn
- type BkSummaryByInstrmtIn
- type BkSummaryOut
- type BookIn
- type BookOut
- type CancelAllByCcyIn
- type CancelAllByInstrmtIn
- type CancelOrderIn
- type ClientCredentials
- type CntrctSzIn
- type CntrctSzOut
- type Currency
- type DrbtPrcRnk
- type EditIn
- type Heartbeat
- type HistVolIn
- type IndxIn
- type IndxOut
- type InstrumentIn
- type InstrumentOut
- type LastTradesOut
- type MrkPrcOptn
- type NtfctnAnncmnt
- type NtfctnDrbtPrcIndx
- type NtfctnDrbtPrcRnk
- type NtfctnEstmtdExprtnPrc
- type NtfctnItmOrdrBk
- type NtfctnMrkPrcOptns
- type NtfctnOrdrBk
- type NtfctnOrdrBkGrp
- type NtfctnOrdrBkRaw
- type NtfctnPrptl
- type NtfctnPrtflio
- type NtfctnQut
- type NtfctnTckr
- type NtfctnTrades
- type NtfctnUserChgs
- type NtfctnUserOrdr
- type NtfctnUserTrades
- type OpnOrdrsByCcyIn
- type OpnOrdrsByInstrmtIn
- type Order
- type OrderIn
- type OrderOut
- type Portfolio
- type PosnCcyIn
- type PosnInstrmtIn
- type PosnOut
- type Price
- type RateLimits
- type Rates
- type StopOrder
- type StopOrderHistoryIn
- type StopOrderHistoryOut
- type SubscribeIn
- type SubscribeOut
- type TckrIn
- type TckrOut
- type TckrStats
- type TestOut
- type Trade
- type TradesByCcyAndTmIn
- type TradesByCcyIn
- type TradesByInstrmtAndTmIn
- type TradesByInstrmtIn
- type UserTrade
- type UserTradesOut
- type WithdrawalPriority
- type XferSubAcctIn
- type XferSubAcctOut
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AcctSummaryIn ¶
type AcctSummaryIn struct {
Ccy string `json:"currency"`
Extended bool `json:"extended,omitempty"`
}
AcctSummaryIn is arguments to query for account summary
type AcctSummaryOut ¶
type AcctSummaryOut struct {
AvailableFunds float64 `json:"available_funds"`
AvailableWdrFunds float64 `json:"available_withdrawal_funds"`
Blnc float64 `json:"balance"`
Ccy string `json:"currency"`
DeltaTotal float64 `json:"delta_total"`
DepositAddr 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"`
InitMrgn float64 `json:"initial_margin"`
Limits RateLimits `json:"limits"`
MntcMrgn float64 `json:"maintenance_margin"`
MrgnBlnc float64 `json:"margin_balance"`
OptnsDelta float64 `json:"options_delta"`
OptnsGamma float64 `json:"options_gamma"`
OptnsPl float64 `json:"options_pl"`
OptnsSessionRpl float64 `json:"options_session_rpl"`
OptnsSessionUpl float64 `json:"options_session_upl"`
OptnsTheta float64 `json:"options_theta"`
OptnsVega float64 `json:"options_vega"`
PrtflioMrgnEnbld bool `json:"portfolio_margining_enabled"`
SessionFunding float64 `json:"session_funding"`
SessionRpl float64 `json:"session_rpl"`
SessionUpl float64 `json:"session_upl"`
SysName string `json:"system_name"`
TfaEnbld bool `json:"tfa_enabled"`
TotalPl float64 `json:"total_pl"`
Type string `json:"type"`
UserName string `json:"username"`
}
AcctSummaryOut contains info about your account
type BkSummaryByCcyIn ¶
type BkSummaryByInstrmtIn ¶
type BkSummaryByInstrmtIn struct {
Instrument string `json:"instrument_name"`
}
type BkSummaryOut ¶
type BkSummaryOut struct {
Volume float64 `json:"volume"`
UndrlyngPrc float64 `json:"underlying_price"`
UndrlyngIndx string `json:"underlying_index"`
QutCcy string `json:"quote_currency"`
OpnIntrst float64 `json:"open_interest"`
Mid float64 `json:"mid_price"`
Mark float64 `json:"mark_price"`
Low float64 `json:"low"`
Last float64 `json:"last"`
IntRate float64 `json:"interest_rate"`
Instrument string `json:"instrument_name"`
High float64 `json:"high"`
CreatnTmStmp int64 `json:"creation_timestamp"`
Bid float64 `json:"bid_price"`
BaseCcy string `json:"base_currency"`
Ask float64 `json:"ask_price"`
}
type BookOut ¶
type BookOut struct {
TmStmp int64 `json:"timestamp"`
Stats TckrStats `json:"stats"`
State string `json:"state"`
StlmntPrc float64 `json:"settlement_price"`
OpnIntrst float64 `json:"open_interest"`
MinPrc float64 `json:"min_price"`
MaxPrc float64 `json:"max_price"`
Mark float64 `json:"mark_price"`
Last float64 `json:"last_price"`
Instrument string `json:"instrument_name"`
IndxPrc float64 `json:"index_price"`
Funding8h float64 `json:"funding_8h"`
CurrentFunding float64 `json:"current_funding"`
ChgId int `json:"change_id"`
Bids [][]float64 `json:"bids"`
BestBid float64 `json:"best_bid_price"`
BestBidAmt float64 `json:"best_bid_amount"`
BestAsk float64 `json:"best_ask_price"`
BestAskAmt float64 `json:"best_ask_amount"`
Asks [][]float64 `json:"asks"`
}
type CancelAllByCcyIn ¶
type CancelAllByInstrmtIn ¶
type CancelOrderIn ¶
type CancelOrderIn struct {
OrderID string `json:"order_id"`
}
type ClientCredentials ¶
type CntrctSzIn ¶
type CntrctSzIn struct {
Instrument string `json:"instrument_name"`
}
type CntrctSzOut ¶
type CntrctSzOut struct {
CntrctSz float64 `json:"contract_size"`
}
type Currency ¶
type Currency struct {
CoinType string `json:"coin_type"`
Ccy string `json:"currency"`
CcyLong 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 DrbtPrcRnk ¶
type InstrumentIn ¶
type InstrumentOut ¶
type InstrumentOut struct {
BaseCcy string `json:"base_currency"`
ContractSz float64 `json:"contract_size"`
CreatnTmStmp int64 `json:"creation_timestamp"`
ExprtnTmStmp int64 `json:"expiration_timestamp"`
Kind string `json:"kind"`
Instrument string `json:"instrument_name"`
IsActive bool `json:"is_active"`
MakerCommission float64 `json:"maker_commission"`
MinTrdAmt float64 `json:"min_trade_amount"`
OptnType string `json:"option_type"`
QutCcy string `json:"quote_currency"`
StlmntPrd string `json:"settlement_period"`
Strike float64 `json:"strike"`
TakerCommission float64 `json:"taker_commission"`
TckSz float64 `json:"tick_size"`
}
InstrumentOut is the output argument for instrument queries
type LastTradesOut ¶
type MrkPrcOptn ¶
type NtfctnAnncmnt ¶
type NtfctnDrbtPrcIndx ¶
type NtfctnDrbtPrcRnk ¶
type NtfctnDrbtPrcRnk []DrbtPrcRnk
type NtfctnEstmtdExprtnPrc ¶
type NtfctnItmOrdrBk ¶
type NtfctnItmOrdrBk struct {
Actn string `json:"action"`
Prc float64 `json:"price"`
Amt float64 `json:"amount"`
}
NtfctnItmOrdrBk ... ["change",6947.0,82640.0] ["new",6942.5,6940.0] ["delete",6914.0,0.0]
func (*NtfctnItmOrdrBk) UnmarshalJSON ¶
func (item *NtfctnItmOrdrBk) UnmarshalJSON(b []byte) error
type NtfctnMrkPrcOptns ¶
type NtfctnMrkPrcOptns []MrkPrcOptn
type NtfctnOrdrBk ¶
type NtfctnOrdrBk struct {
Type string `json:"type"`
TmStmp int64 `json:"timestamp"`
Instrument string `json:"instrument_name"`
PrvChgID int64 `json:"prev_change_id"`
ChgID int64 `json:"change_id"`
Bids []NtfctnItmOrdrBk `json:"bids"` // [action, price, amount]
Asks []NtfctnItmOrdrBk `json:"asks"` // [action, price, amount]
}
type NtfctnOrdrBkGrp ¶
type NtfctnOrdrBkRaw ¶
type NtfctnOrdrBkRaw struct {
TmStmp int64 `json:"timestamp"`
Instrument string `json:"instrument_name"`
PrvChgID int64 `json:"prev_change_id"`
ChgID int64 `json:"change_id"`
Bids []NtfctnItmOrdrBk `json:"bids"` // [action, price, amount]
Asks []NtfctnItmOrdrBk `json:"asks"` // [action, price, amount]
}
type NtfctnPrptl ¶
type NtfctnPrptl struct {
Interest float64 `json:"interest"`
}
type NtfctnPrtflio ¶
type NtfctnPrtflio struct {
TotalPl float64 `json:"total_pl"`
SessionUpl float64 `json:"session_upl"`
SessionRpl float64 `json:"session_rpl"`
SessionFunding float64 `json:"session_funding"`
PrtflioMrgnEnbld bool `json:"portfolio_margining_enabled"`
OptnsVega float64 `json:"options_vega"`
OptnsTheta float64 `json:"options_theta"`
OptnsSessionUpl float64 `json:"options_session_upl"`
OptnsSessionRpl float64 `json:"options_session_rpl"`
OptnsPl float64 `json:"options_pl"`
OptnsGamma float64 `json:"options_gamma"`
OptnsDelta float64 `json:"options_delta"`
MrgnBal float64 `json:"margin_balance"`
MaintMrgn float64 `json:"maintenance_margin"`
InitMrgn 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"`
Ccy string `json:"currency"`
Bal float64 `json:"balance"`
AvailableWdrFunds float64 `json:"available_withdrawal_funds"`
AvailableFunds float64 `json:"available_funds"`
}
type NtfctnTckr ¶
type NtfctnTckr struct {
TmStmp int64 `json:"timestamp"`
Stats struct {
Volume float64 `json:"volume"`
Low float64 `json:"low"`
High float64 `json:"high"`
} `json:"stats"`
State string `json:"state"`
SttlmntPrc float64 `json:"settlement_price"`
OpnIntrst float64 `json:"open_interest"`
MinPrc float64 `json:"min_price"`
MaxPrc float64 `json:"max_price"`
Mark float64 `json:"mark_price"`
Last float64 `json:"last_price"`
Instrument string `json:"instrument_name"`
IndxPrc float64 `json:"index_price"`
Funding8H float64 `json:"funding_8h"`
CurrentFunding float64 `json:"current_funding"`
BestBid float64 `json:"best_bid_price"`
BestBidAmt float64 `json:"best_bid_amount"`
BestAsk float64 `json:"best_ask_price"`
BestAskAmt float64 `json:"best_ask_amount"`
}
type NtfctnTrades ¶
type NtfctnTrades []Trade
type NtfctnUserChgs ¶
type NtfctnUserOrdr ¶
type NtfctnUserOrdr []Order
type NtfctnUserTrades ¶
type NtfctnUserTrades []UserTrade
type OpnOrdrsByCcyIn ¶
type OpnOrdrsByInstrmtIn ¶
type Order ¶
type Order struct {
Advanced string `json:"advanced,omitempty"`
Amt float64 `json:"amount"`
API bool `json:"api"`
AvgPrc float64 `json:"average_price"`
Commission float64 `json:"commission"`
CreatnTmStmp int64 `json:"creation_timestamp"`
Drctn string `json:"direction"`
FilledAmt float64 `json:"filled_amount"`
Implv float64 `json:"implv,omitempty"`
Instrument string `json:"instrument_name"`
IsLiquidation bool `json:"is_liquidation"`
Label string `json:"label"`
LstUpdtTmStmp int64 `json:"last_update_timestamp"`
OrderID string `json:"order_id"`
OrderState string `json:"order_state"`
OrderType string `json:"order_type"`
MaxShow float64 `json:"max_show"`
PostOnly bool `json:"post_only"`
Prc Price `json:"price"`
ProfitLoss float64 `json:"profit_loss"`
RdcOnly bool `json:"reduce_only"`
TmInFrc string `json:"time_in_force"`
StopPrc float64 `json:"stop_price,omitempty"`
Triggered bool `json:"triggered,omitempty"`
USD float64 `json:"usd,omitempty"`
}
Order contains the information for a submitted order
type OrderIn ¶
type OrderIn struct {
Instrument string `json:"instrument_name"`
Amt float64 `json:"amount"`
Type string `json:"type,omitempty"`
Label string `json:"label,omitempty"`
Prc float64 `json:"price,omitempty"`
TmInFrc string `json:"time_in_force,omitempty"`
MaxShow *float64 `json:"max_show,omitempty"`
PostOnly bool `json:"post_only,omitempty"`
RdcOnly bool `json:"reduce_only,omitempty"`
StopPrc float64 `json:"stop_price,omitempty"`
Trigger string `json:"trigger,omitempty"`
Advanced string `json:"advanced,omitempty"`
}
type Portfolio ¶
type Portfolio struct {
AvailableFunds int `json:"available_funds"`
AvailableWdrFunds int `json:"available_withdrawal_funds"`
Bal int `json:"balance"`
Ccy string `json:"currency"`
Equity int `json:"equity"`
InitMrgn int `json:"initial_margin"`
MntcMrgn int `json:"maintenance_margin"`
MrgnBal int `json:"margin_balance"`
}
Portfolio contains portolio information
type PosnInstrmtIn ¶
type PosnInstrmtIn struct {
Instrument string `json:"instrument_name"`
}
type PosnOut ¶
type PosnOut struct {
AvgPrc float64 `json:"average_price"`
Delta float64 `json:"delta"`
Drctn string `json:"direction"`
EstdLqdtnPrc float64 `json:"estimated_liquidation_price"`
FltngPl float64 `json:"floating_profit_loss"`
IndxPrc float64 `json:"index_price"`
InitMrgn float64 `json:"initial_margin"`
Instrument string `json:"instrument_name"`
Kind string `json:"kind"`
Leverage float64 `json:"leverage"`
MaintMrgn float64 `json:"maintenance_margin"`
Mark float64 `json:"mark_price"`
OpnOrdrsMrgn float64 `json:"open_orders_margin"`
RlzdPl float64 `json:"realized_profit_loss"`
StlmntPrc float64 `json:"settlement_price"`
Sz float64 `json:"size"`
SzCcy float64 `json:"size_currency"`
TotalPl float64 `json:"total_profit_loss"`
}
type RateLimits ¶
type StopOrder ¶ added in v1.2.0
type StopOrder struct {
Trigger string `json:"trigger"`
TmStmp int64 `json:"timestamp"`
StopPrice float64 `json:"stop_price"`
StopID string `json:"stop_id"`
OrderState string `json:"order_state"`
Request string `json:"request"`
Prc float64 `json:"price"`
OrderID string `json:"order_id"`
Offset int `json:"offset"`
Instrument string `json:"instrument_name"`
Amt float64 `json:"amount"`
Drctn string `json:"direction"`
}
StopOrder contains info for a submitted stop order
type StopOrderHistoryIn ¶ added in v1.2.0
type StopOrderHistoryIn struct {
Ccy string `json:"currency"`
Instrument string `json:"instrument_name,omitempty"`
Count int `json:"count,omitempty"`
Continuation string `json:"continuation,omitempty"`
}
StopOrderHistoryIn is the input parameter for GetStopOrderHistory
type StopOrderHistoryOut ¶ added in v1.2.0
type SubscribeIn ¶
type SubscribeIn struct {
Channels []string `json:"channels"`
}
type SubscribeOut ¶
type SubscribeOut []string
type TckrOut ¶
type TckrOut struct {
BestAskAmt float64 `json:"best_ask_amount"`
BestAsk float64 `json:"best_ask_price"`
BestBidAmt float64 `json:"best_bid_amount"`
BestBid float64 `json:"best_bid_price"`
CurrentFunding float64 `json:"current_funding"`
Funding8h float64 `json:"funding_8h"`
IndxPrc float64 `json:"index_price"`
Instrument string `json:"instrument_name"`
Last float64 `json:"last_price"`
Mark float64 `json:"mark_price"`
MaxPrc float64 `json:"max_price"`
MinPrc float64 `json:"min_price"`
OpnIntrst float64 `json:"open_interest"`
StlmntPrc float64 `json:"settlement_price"`
State string `json:"state"`
Stats TckrStats `json:"stats"`
TmStmp int64 `json:"timestamp"`
}
type Trade ¶
type Trade struct {
Amt float64 `json:"amount"`
Drctn string `json:"direction"`
IndxPrc float64 `json:"index_price"`
Instrument string `json:"instrument_name"`
IV float64 `json:"iv"`
Liquidation string `json:"liquidation"`
Prc float64 `json:"price"`
TckDrctn int `json:"tick_direction"`
TmStmp int64 `json:"timestamp"`
TradeID string `json:"trade_id"`
TrdSqnc int `json:"trade_seq"`
}
type TradesByCcyAndTmIn ¶
type TradesByCcyAndTmIn struct {
Ccy string `json:"currency"`
Kind string `json:"kind,omitempty"`
StartTmStmp int64 `json:"start_timestamp"`
EndTmStmp int64 `json:"end_timestamp"`
Count int `json:"count,omitempty"`
IncludeOld bool `json:"include_old,omitempty"`
Sorting string `json:"sorting,omitempty"`
}
type TradesByCcyIn ¶
type TradesByInstrmtAndTmIn ¶
type TradesByInstrmtIn ¶
type UserTrade ¶
type UserTrade struct {
Amt float64 `json:"amount"`
Drctn string `json:"direction"`
Fee float64 `json:"fee"`
FeeCcy string `json:"fee_currency"`
IndxPrc float64 `json:"index_price"`
Instrument string `json:"instrument_name"`
IV string `json:"iv"`
Label string `json:"label"`
Liquidity string `json:"liquidity"`
MatchingID interface{} `json:"matching_id"`
OrderID string `json:"order_id"`
OrderType string `json:"order_type"`
PostOnly bool `json:"post_only"`
Prc float64 `json:"price"`
RdcOnly bool `json:"reduce_only"`
SelfTrd bool `json:"self_trade"`
State string `json:"state"`
TckDrctn int `json:"tick_direction"`
TmStmp int64 `json:"timestamp"`
TradeID string `json:"trade_id"`
TrdSqnc int `json:"trade_seq"`
UndPrc float64 `json:"underlying_price"`
}
type UserTradesOut ¶
type WithdrawalPriority ¶
type XferSubAcctIn ¶
type XferSubAcctIn struct {
Amt string `json:"amount"`
Ccy string `json:"currency"`
Dst int `json:"destination"`
}
XferSubAcctIn is the argument struct for the inputs to posting a request for a transfer between (sub) accounts
type XferSubAcctOut ¶
type XferSubAcctOut struct {
Amt float64 `json:"amount"`
CreatedTmStmp 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"`
UpdatedTmStmp int64 `json:"updated_timestamp"`
}
XferSubAcctOut is the struct containing the result form a transfer request