Documentation ¶
Index ¶
- Constants
- func NewError(code int, msg string) error
- func NewIndexChannel(sym exchange.Symbol) exchange.Channel
- func NewOrderBookChannel(sym exchange.Symbol) exchange.Channel
- type AuthParam
- type AuthResult
- type AuthToken
- type BookData
- type ChIndex
- type ChOrderBook
- type Client
- func (c *Client) Auth(ctx context.Context) error
- func (c *Client) CancelOrder(ctx context.Context, order *exchange.Order) (*exchange.Order, error)
- func (c *Client) CreateOrder(ctx context.Context, req *exchange.OrderRequest, ...) (*exchange.Order, error)
- func (c *Client) Exchange() string
- func (c *Client) FetchOrder(ctx context.Context, order *exchange.Order) (*exchange.Order, error)
- func (c *Client) Handle(ctx context.Context, notify *rpc.Notify)
- func (c *Client) NewOptionSymbol(index string, st time.Time, strike float64, typ exchange.OptionType) exchange.OptionSymbol
- func (c *Client) NewSpotSymbol(base, quote string) exchange.SpotSymbol
- func (c *Client) OptionFetchInstruments(ctx context.Context, currency string) ([]InstrumentResult, error)
- func (c *Client) OptionSymbols(ctx context.Context, currency string) ([]exchange.OptionSymbol, error)
- func (c *Client) ParseOptionSymbol(val string) (exchange.OptionSymbol, error)
- func (c *Client) ParseSpotSymbol(sym string) (exchange.SpotSymbol, error)
- func (c *Client) Subscribe(ctx context.Context, chs ...exchange.Channel) error
- func (c *Client) UnSubscribe(ctx context.Context, chs ...exchange.Channel) error
- type Codec
- type Error
- type IndexResult
- type InstrumentResult
- type JRPCError
- type Notify
- type OptionSymbol
- type Order
- type OrderID
- type Request
- type Response
- type SpotSymbol
- type Token
Constants ¶
View Source
const ( WSAddr = "wss://www.deribit.com/ws/api/v2/" WSTestAddr = "wss://test.deribit.com/ws/api/v2/" )
View Source
const ( OptionTypeCall = "call" OptionTypePut = "put" )
View Source
const (
JsonRPCVersion = "2.0"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthResult ¶
type ChOrderBook ¶ added in v0.3.0
type ChOrderBook struct {
// contains filtered or unexported fields
}
func (*ChOrderBook) String ¶ added in v0.3.0
func (co *ChOrderBook) String() string
type Client ¶
func NewTestWSClient ¶ added in v0.3.0
func NewWSClient ¶ added in v0.3.0
func (*Client) CancelOrder ¶ added in v0.3.0
func (*Client) CreateOrder ¶ added in v0.3.0
func (c *Client) CreateOrder(ctx context.Context, req *exchange.OrderRequest, opts ...exchange.OrderReqOption) (*exchange.Order, error)
func (*Client) FetchOrder ¶ added in v0.3.0
func (*Client) NewOptionSymbol ¶
func (c *Client) NewOptionSymbol(index string, st time.Time, strike float64, typ exchange.OptionType) exchange.OptionSymbol
func (*Client) NewSpotSymbol ¶
func (c *Client) NewSpotSymbol(base, quote string) exchange.SpotSymbol
func (*Client) OptionFetchInstruments ¶
func (*Client) OptionSymbols ¶ added in v0.3.0
func (*Client) ParseOptionSymbol ¶
func (c *Client) ParseOptionSymbol(val string) (exchange.OptionSymbol, error)
func (*Client) ParseSpotSymbol ¶
func (c *Client) ParseSpotSymbol(sym string) (exchange.SpotSymbol, error)
type IndexResult ¶
type InstrumentResult ¶
type InstrumentResult struct { TickSize float64 `json:"tick_size"` TakerCommision float64 `json:"taker_commision"` MakerCommision float64 `json:"maker_commision"` Strike float64 `json:"strike"` SettlementPeriod string `json:"settlement_period"` QuoteCurrency string `json:"quote_currency"` BaseCurreny string `json:"base_currency"` MinTradeAmount float64 `json:"min_trade_amount"` Kind string `json:"kind"` IsActive bool `json:"is_active"` InstrumentName string `json:"instrument_name"` ExpirationTimestamp int64 `json:"expeiration_timestamp"` CreationTimestamp int64 `json:"creation_timestamp"` ContractSize float64 `json:"contract_size"` OptionType string `json:"option_type"` }
type Notify ¶
type Notify struct { Data json.RawMessage `json:"data"` Channel string `json:"channel"` }
type OptionSymbol ¶
type OptionSymbol struct {
*exchange.BaseOptionSymbol
}
func (*OptionSymbol) String ¶
func (sym *OptionSymbol) String() string
type Order ¶
type Order struct { Price decimal.Decimal `json:"price"` Amount decimal.Decimal `json:"amount"` AveragePrice decimal.Decimal `json:"average_price"` OrderState string `json:"order_state"` OrderID string `json:"order_id"` LastUpdatedTimestamp int64 `json:"last_update_timestamp"` CreationTimestamp int64 `json:"creation_timestamp"` Commision decimal.Decimal `json:"commision"` Direction string `json:"direction"` FilledAmont decimal.Decimal `json:"filled_amount"` InstrumentName string `json:"instrument_name"` }
type SpotSymbol ¶
type SpotSymbol struct {
*exchange.BaseSpotSymbol
}
func (*SpotSymbol) String ¶
func (sym *SpotSymbol) String() string
Click to show internal directories.
Click to hide internal directories.