package gemini

  1. Overview
  2. Docs

Module V1.Market_dataSource

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

Sourcemodule Side : sig ... end

Encapsulates various concepts of side in the market dat api.

Sourcemodule Message_type : sig ... end

Represents market data message types supported by the Gemini exchange.

Sourcemodule Event_type : sig ... end

Represents different types of market data events

Sourcetype heartbeat = unit

The heartbeat response type has no payload

Sourceval sexp_of_heartbeat : heartbeat -> Sexplib0.Sexp.t
Sourceval heartbeat_of_sexp : Sexplib0.Sexp.t -> heartbeat
Sourcemodule Reason : sig ... end

Different reasons a market data event occured

Sourcemodule Change_event : sig ... end

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

Sourcemodule Trade_event : sig ... end

An trade event of an order.

Sourcemodule Block_trade_event : sig ... end

A block trade event.

Sourcemodule Auction_open_event : sig ... end

An auction open event.

Sourcemodule Auction_result : sig ... end

Represents different results possible from an auction.

An auction indicative price event.

Sourcemodule Auction_outcome_event : sig ... end

An auction outcome event.

Sourcemodule Auction_event_type : sig ... end

Represents different auction event types.

Sourcemodule Auction_event : sig ... end
Sourcetype 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.

Sourceval sexp_of_event : event -> Sexplib0.Sexp.t
Sourceval event_of_sexp : Sexplib0.Sexp.t -> event
Sourceval __event_of_sexp__ : Sexplib0.Sexp.t -> event
Sourcemodule Update : sig ... end

The type of a market data update message.

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

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

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

The type of a market data response.

Sourceval name : string

The name of the channel

Sourceval version : string

The channel protocol version

Sourceval path : string list

The uri path for this channel

Sourceval authentication : [ `Private | `Public ]

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

Sourcetype 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

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

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

Sourceval default_uri_args : uri_args option

Defaut uri arguments. Optional for some channels.

Sourceval sexp_of_response : response -> Sexplib0.Sexp.t
Sourceval response_of_sexp : Sexplib0.Sexp.t -> response
Sourcemodule Csv_of_event : sig ... end
Sourceval events_of_response : response -> Csv_of_event.t

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

Sourcetype query

Query parameters for the channel

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

Encodes queries as an http header key value pair

Sourcemodule Error : sig ... end
Sourceval 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
Sourceval command : string * Async.Command.t