trading

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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"`
	Trigger        string  `json:"trigger,omitempty"`
	Advanced       string  `json:"advanced,omitempty"`
}

type BuyResponse

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

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 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 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 GetOrderStateParams

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

type GetSettlementHistoryByCurrencyParams

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

type GetSettlementHistoryByInstrumentParams

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

type GetSettlementHistoryResponse

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

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"`
	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    int64  `json:"count,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"`
	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"`
	Sorting        string `json:"sorting,omitempty"`
}

type GetUserTradesResponse

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

type Order

type Order struct {
	RejectPostOnly        bool    `json:"reject_post_only,omitempty"`
	Label                 string  `json:"label"`
	OrderState            string  `json:"order_state"`
	Usd                   float64 `json:"usd,omitempty"`
	Implv                 float64 `json:"implv,omitempty"`
	TriggerReferencePrice float64 `json:"trigger_reference_price"`
	OriginalOrderType     string  `json:"original_order_type"`
	BlockTrade            bool    `json:"block_trade,omitempty"`
	TriggerPrice          float64 `json:"trigger_price,omitempty"`
	API                   bool    `json:"api"`
	MMP                   bool    `json:"mmp"`
	TriggerOrderId        string  `json:"trigger_order_id"`
	CancelReason          string  `json:"cancel_reason"`
	RiskReducing          bool    `json:"risk_reducing"`
	FilledAmount          float64 `json:"filled_amount"`
	InstrumentName        string  `json:"instrument_name"`
	MaxShow               float64 `json:"max_show"`
	AppName               string  `json:"app_name"`
	MMPCancelled          bool    `json:"mmp_cancelled"`
	Direction             string  `json:"direction"`
	LastUpdateTimestamp   int64   `json:"last_update_timestamp"`
	TriggerOffset         float64 `json:"trigger_offset"`
	Price                 Price   `json:"price"`
	IsLiquidation         bool    `json:"is_liquidation,omitempty"`
	ReduceOnly            bool    `json:"reduce_only,omitempty"`
	Amount                float64 `json:"amount"`
	PostOnly              bool    `json:"post_only,omitempty"`
	Mobile                bool    `json:"mobile"`
	Triggered             bool    `json:"triggered"`
	OrderId               string  `json:"order_id"`
	Replaced              bool    `json:"replaced"`
	OrderType             string  `json:"order_type"`
	TimeInForce           string  `json:"time_in_force"`
	AutoReplaced          bool    `json:"auto_replaced"`
	Trigger               string  `json:"trigger"`
	Web                   bool    `json:"web"`
	CreationTimestamp     int64   `json:"creation_timestamp"`
	AveragePrice          float64 `json:"average_price"`
	Advanced              string  `json:"advanced"`
}

type Price

type Price float64

func (*Price) ToFloat64

func (p *Price) ToFloat64() float64

func (*Price) UnmarshalJSON

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

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"`
	Trigger        string  `json:"trigger,omitempty"`
	Advanced       string  `json:"advanced,omitempty"`
}

type SellResponse

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

type Settlement

type Settlement struct {
	IndexPrice        float64 `json:"index_price"`
	InstrumentName    string  `json:"instrument_name"`
	MarkPrice         float64 `json:"mark_price"`
	Position          float64 `json:"position"`
	ProfitLoss        float64 `json:"profit_loss"`
	SessionBankrupcy  float64 `json:"session_bankrupcy"`
	SessionProfitLoss float64 `json:"session_profit_loss"`
	SessionTax        float64 `json:"session_tax"`
	SessionTaxRate    float64 `json:"session_tax_rate"`
	Socialized        float64 `json:"socialized"`
	Timestamp         int64   `json:"timestamp"`
	Type              string  `json:"type"`
}

type Trade

type Trade struct {
	Advanced        string  `json:"advanced"`
	Amount          float64 `json:"amount"`
	API             bool    `json:"api"`
	BlockTradeId    string  `json:"block_trade_id"`
	Direction       string  `json:"direction"`
	Fee             float64 `json:"fee"`
	FeeCurrency     string  `json:"fee_currency"`
	IndexPrice      float64 `json:"index_price"`
	InstrumentName  string  `json:"instrument_name"`
	IV              float64 `json:"iv,omitempty"`
	Label           string  `json:"label"`
	Liquidation     string  `json:"liquidation"`
	Liquidity       string  `json:"liquidity"`
	MarkPrice       float64 `json:"mark_price"`
	MMP             bool    `json:"mmp"`
	OrderId         string  `json:"order_id"`
	OrderType       string  `json:"order_type"`
	Price           float64 `json:"price"`
	ProfitLoss      float64 `json:"profit_loss"`
	State           string  `json:"state"`
	Timestamp       int64   `json:"timestamp"`
	TradeID         string  `json:"trade_id"`
	TradeSeq        int64   `json:"trade_seq"`
	UnderlyingPrice float64 `json:"underlying_price,omitempty"`
}

Jump to

Keyboard shortcuts

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