Module V1.Market_data

Market data websockets api for the Gemini trading exchange. This broadcasts only public events and require no authentication.

module Side : sig ... end

Encapsulates various concepts of side in the market dat api.

module Message_type : sig ... end

Represents market data message types supported by the Gemini exchange.

module Event_type : sig ... end

Represents different types of market data events

type heartbeat = unit

The heartbeat response type has no payload

val heartbeat_of_yojson : Yojson.Safe.t -> heartbeat Ppx_deriving_yojson_runtime.error_or
val sexp_of_heartbeat : heartbeat -> Sexplib0.Sexp.t
val heartbeat_of_sexp : Sexplib0.Sexp.t -> heartbeat
module Reason : sig ... end

Different reasons a market data event occured

module Change_event : sig ... end

An change event to an order. The reaosn field indicates the type of change.

module Trade_event : sig ... end

An trade event of an order.

module Block_trade_event : sig ... end

A block trade event.

module Auction_open_event : sig ... end

An auction open event.

module Auction_result : sig ... end

Represents different results possible from an auction.

module Auction_indicative_price_event : sig ... end

An auction indicative price event.

module Auction_outcome_event : sig ... end

An auction outcome event.

module Auction_event_type : sig ... end

Represents different auction event types.

module Auction_event : sig ... end
type event = [
  1. | `Auction of Auction_event.t
  2. | `Auction_open of Auction_open_event.t
  3. | `Change of Change_event.t
  4. | `Trade of Trade_event.t
  5. | `Block_trade of Block_trade_event.t
]

The type of event, unified over auction, change, and trade events.

val event_of_yojson : Yojson.Safe.t -> event Ppx_deriving_yojson_runtime.error_or
val sexp_of_event : event -> Sexplib0.Sexp.t
val event_of_sexp : Sexplib0.Sexp.t -> event
val __event_of_sexp__ : Sexplib0.Sexp.t -> event
module Update : sig ... end

The type of a market data update message.

type message = [
  1. | `Heartbeat of heartbeat
  2. | `Update of Update.t
]

The type of a market data message- a heartbeat or update.

val sexp_of_message : message -> Sexplib0.Sexp.t
val message_of_sexp : Sexplib0.Sexp.t -> message
val __message_of_sexp__ : Sexplib0.Sexp.t -> message
type response = {
  1. socket_sequence : int64;
  2. message : message;
}

The type of a market data response.

val name : string

The name of the channel

val version : string

The channel protocol version

val path : string list

The uri path for this channel

val authentication : [ `Private | `Public ]

Authentication syle for this channel. One of `Private or `Public

type uri_args = [
  1. | `Btcusd
  2. | `Ethusd
  3. | `Ethbtc
  4. | `Zecusd
  5. | `Zecbtc
  6. | `Zeceth
  7. | `Zecbch
  8. | `Zecltc
  9. | `Ltcusd
  10. | `Ltcbtc
  11. | `Ltceth
  12. | `Ltcbch
  13. | `Bchusd
  14. | `Bchbtc
  15. | `Bcheth
  16. | `Lunausd
  17. | `Xtzusd
  18. | `Linkusd
  19. | `Aaveusd
  20. | `Crvusd
  21. | `Injusd
  22. | `Maticusd
  23. | `Ftmusd
  24. | `Dogeusd
  25. | `Cubeusd
  26. | `Chzusd
  27. | `Dotusd
  28. | `Rareusd
  29. | `Qntusd
]

Uri arguments which are appended to the end of the path segment

val sexp_of_uri_args : uri_args -> Sexplib0.Sexp.t
val uri_args_of_sexp : Sexplib0.Sexp.t -> uri_args
val all_of_uri_args : uri_args list
val encode_uri_args : uri_args -> string

Encder from well typed uri arguments to a string suitable for a uri.

val default_uri_args : uri_args option

Defaut uri arguments. Optional for some channels.

val response_of_yojson : Yojson.Safe.t -> response Ppx_deriving_yojson_runtime.error_or
val sexp_of_response : response -> Sexplib0.Sexp.t
val response_of_sexp : Sexplib0.Sexp.t -> response
module Csv_of_event : sig ... end
val events_of_response : response -> Csv_of_event.t

Given a response value produce csvable events modularized by event type.

type query

Query parameters for the channel

val sexp_of_query : query -> Sexplib0.Sexp.t
val query_of_sexp : Sexplib0.Sexp.t -> query
val encode_query : query -> string * string

Encodes queries as an http header key value pair

module Error : sig ... end
val client : (module Cfg.S) -> ?query:Async.Sexp.t list -> ?uri_args:uri_args -> unit -> [ `Ok of response | Error.t ] Async.Pipe.Reader.t Async.Deferred.t
val command : string * Async.Command.t