{"modulePath":"github.com/QuantProcessing/exchanges","version":"v0.2.20","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sdk\n\n## Types\n\n```go\ntype AuthResult struct {\n\tAccessToken  string `json:\"access_token\"`\n\tExpiresIn    int64  `json:\"expires_in\"`\n\tRefreshToken string `json:\"refresh_token\"`\n\tTokenType    string `json:\"token_type\"`\n\tScope        string `json:\"scope\"`\n}\n```\n\n```go\ntype Client struct {\n\tHTTPClient *http.Client\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient() *Client\n```\n\n```go\nfunc (c *Client) Buy(ctx context.Context, req OrderRequest) (*OrderResult, error)\n```\n\n```go\nfunc (c *Client) CancelAll(ctx context.Context) (int64, error)\n```\n\n```go\nfunc (c *Client) CancelAllByInstrument(ctx context.Context, instrumentName string) (int64, error)\n```\n\n```go\nfunc (c *Client) CancelOrder(ctx context.Context, orderID string) (*OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetInstruments(ctx context.Context, currency, kind string, expired bool) ([]Instrument, error)\n```\n\n```go\nfunc (c *Client) GetLastTradesByInstrument(ctx context.Context, instrumentName string, count int) (*TradesResult, error)\n```\n\n```go\nfunc (c *Client) GetOpenOrdersByInstrument(ctx context.Context, instrumentName string) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetOrderBook(ctx context.Context, instrumentName string, depth int) (*OrderBook, error)\n```\n\n```go\nfunc (c *Client) GetOrderHistoryByInstrument(ctx context.Context, instrumentName string, count int) ([]OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetOrderState(ctx context.Context, orderID string) (*OrderRecord, error)\n```\n\n```go\nfunc (c *Client) GetTicker(ctx context.Context, instrumentName string) (*Ticker, error)\n```\n\n```go\nfunc (c *Client) GetTradingViewChartData(ctx context.Context, instrumentName string, start, end int64, resolution string) (*TradingViewChartData, error)\n```\n\n```go\nfunc (c *Client) HasCredentials() bool\n```\n\n```go\nfunc (c *Client) Sell(ctx context.Context, req OrderRequest) (*OrderResult, error)\n```\n\n```go\nfunc (c *Client) WithBaseURL(baseURL string) *Client\n```\n\n```go\nfunc (c *Client) WithCredentials(apiKey, secretKey string) *Client\n```\n\n```go\ntype Instrument struct {\n\tState                    string         `json:\"state\"`\n\tPriceIndex               string         `json:\"price_index\"`\n\tKind                     string         `json:\"kind\"`\n\tInstrumentName           string         `json:\"instrument_name\"`\n\tInstrumentType           string         `json:\"instrument_type\"`\n\tFutureType               string         `json:\"future_type\"`\n\tSettlementCurrency       string         `json:\"settlement_currency\"`\n\tSettlementPeriod         string         `json:\"settlement_period\"`\n\tBaseCurrency             string         `json:\"base_currency\"`\n\tCounterCurrency          string         `json:\"counter_currency\"`\n\tQuoteCurrency            string         `json:\"quote_currency\"`\n\tOptionType               string         `json:\"option_type\"`\n\tMaxLeverage              int            `json:\"max_leverage\"`\n\tMakerCommission          float64        `json:\"maker_commission\"`\n\tTakerCommission          float64        `json:\"taker_commission\"`\n\tTickSize                 float64        `json:\"tick_size\"`\n\tContractSize             float64        `json:\"contract_size\"`\n\tMinTradeAmount           float64        `json:\"min_trade_amount\"`\n\tStrike                   float64        `json:\"strike\"`\n\tExpirationTimestamp      int64          `json:\"expiration_timestamp\"`\n\tCreationTimestamp        int64          `json:\"creation_timestamp\"`\n\tInstrumentID             int64          `json:\"instrument_id\"`\n\tIsActive                 bool           `json:\"is_active\"`\n\tTickSizeSteps            []TickSizeStep `json:\"tick_size_steps\"`\n\tBlockTradeCommission     float64        `json:\"block_trade_commission\"`\n\tBlockTradeMinTradeAmount float64        `json:\"block_trade_min_trade_amount\"`\n\tBlockTradeTickSize       float64        `json:\"block_trade_tick_size\"`\n}\n```\n\n```go\ntype OrderBook struct {\n\tInstrumentName string      `json:\"instrument_name\"`\n\tTimestamp      int64       `json:\"timestamp\"`\n\tState          string      `json:\"state\"`\n\tIndexPrice     float64     `json:\"index_price\"`\n\tMarkPrice      float64     `json:\"mark_price\"`\n\tLastPrice      float64     `json:\"last_price\"`\n\tBids           [][]float64 `json:\"bids\"`\n\tAsks           [][]float64 `json:\"asks\"`\n\tBestBidPrice   float64     `json:\"best_bid_price\"`\n\tBestBidAmount  float64     `json:\"best_bid_amount\"`\n\tBestAskPrice   float64     `json:\"best_ask_price\"`\n\tBestAskAmount  float64     `json:\"best_ask_amount\"`\n\tCurrentFunding float64     `json:\"current_funding\"`\n\tFunding8h      float64     `json:\"funding_8h\"`\n\tStats          Stats       `json:\"stats\"`\n}\n```\n\n```go\ntype OrderRecord struct {\n\tOrderID        string  `json:\"order_id\"`\n\tInstrumentName string  `json:\"instrument_name\"`\n\tDirection      string  `json:\"direction\"`\n\tOrderType      string  `json:\"order_type\"`\n\tOrderState     string  `json:\"order_state\"`\n\tAmount         float64 `json:\"amount\"`\n\tFilledAmount   float64 `json:\"filled_amount\"`\n\tPrice          float64 `json:\"price\"`\n\tAveragePrice   float64 `json:\"average_price\"`\n\tLastUpdateTime int64   `json:\"last_update_timestamp\"`\n\tUpdateTime     int64   `json:\"-\"`\n\tCreationTime   int64   `json:\"creation_timestamp\"`\n\tLabel          string  `json:\"label\"`\n\tTimeInForce    string  `json:\"time_in_force\"`\n\tCommission     float64 `json:\"commission\"`\n\tReduceOnly     bool    `json:\"reduce_only\"`\n\tReplaced       bool    `json:\"replaced\"`\n\tPostOnly       bool    `json:\"post_only\"`\n}\n```\n\n```go\ntype OrderRequest struct {\n\tInstrumentName string\n\tAmount         string\n\tType           string\n\tPrice          string\n\tTimeInForce    string\n\tLabel          string\n\tReduceOnly     bool\n\tPostOnly       bool\n}\n```\n\n```go\ntype OrderResult struct {\n\tOrder OrderRecord `json:\"order\"`\n}\n```\n\n```go\ntype Stats struct {\n\tHigh           float64 `json:\"high\"`\n\tLow            float64 `json:\"low\"`\n\tPriceChange    float64 `json:\"price_change\"`\n\tVolume         float64 `json:\"volume\"`\n\tVolumeUSD      float64 `json:\"volume_usd\"`\n\tVolumeNotional float64 `json:\"volume_notional\"`\n}\n```\n\n```go\ntype TickSizeStep struct {\n\tAbovePrice float64 `json:\"above_price\"`\n\tTickSize   float64 `json:\"tick_size\"`\n}\n```\n\n```go\ntype Ticker struct {\n\tInstrumentName         string  `json:\"instrument_name\"`\n\tState                  string  `json:\"state\"`\n\tBestAskAmount          float64 `json:\"best_ask_amount\"`\n\tBestAskPrice           float64 `json:\"best_ask_price\"`\n\tBestBidAmount          float64 `json:\"best_bid_amount\"`\n\tBestBidPrice           float64 `json:\"best_bid_price\"`\n\tCurrentFunding         float64 `json:\"current_funding\"`\n\tEstimatedDeliveryPrice float64 `json:\"estimated_delivery_price\"`\n\tFunding8h              float64 `json:\"funding_8h\"`\n\tIndexPrice             float64 `json:\"index_price\"`\n\tInterestValue          float64 `json:\"interest_value\"`\n\tLastPrice              float64 `json:\"last_price\"`\n\tMarkPrice              float64 `json:\"mark_price\"`\n\tMaxPrice               float64 `json:\"max_price\"`\n\tMinPrice               float64 `json:\"min_price\"`\n\tOpenInterest           float64 `json:\"open_interest\"`\n\tSettlementPrice        float64 `json:\"settlement_price\"`\n\tTimestamp              int64   `json:\"timestamp\"`\n\tStats                  Stats   `json:\"stats\"`\n}\n```\n\n```go\ntype Trade struct {\n\tTradeSeq       int64   `json:\"trade_seq\"`\n\tTradeID        string  `json:\"trade_id\"`\n\tTimestamp      int64   `json:\"timestamp\"`\n\tTickDirection  int     `json:\"tick_direction\"`\n\tPrice          float64 `json:\"price\"`\n\tMarkPrice      float64 `json:\"mark_price\"`\n\tIV             float64 `json:\"iv\"`\n\tInstrumentName string  `json:\"instrument_name\"`\n\tIndexPrice     float64 `json:\"index_price\"`\n\tDirection      string  `json:\"direction\"`\n\tAmount         float64 `json:\"amount\"`\n\tContracts      float64 `json:\"contracts\"`\n}\n```\n\n```go\ntype TradesResult struct {\n\tTrades  []Trade `json:\"trades\"`\n\tHasMore bool    `json:\"has_more\"`\n}\n```\n\n```go\ntype TradingViewChartData struct {\n\tStatus string    `json:\"status\"`\n\tTicks  []int64   `json:\"ticks\"`\n\tOpen   []float64 `json:\"open\"`\n\tHigh   []float64 `json:\"high\"`\n\tLow    []float64 `json:\"low\"`\n\tClose  []float64 `json:\"close\"`\n\tVolume []float64 `json:\"volume\"`\n\tCost   []float64 `json:\"cost\"`\n}\n```\n\n","path":"github.com/QuantProcessing/exchanges/deribit/sdk","name":"sdk","synopsis":"","isRedistributable":true}
