package gemini

All checked builds pass
  1. Overview
  2. Docs
OCaml bindings for Gemini Trading Exchange API

Install

dune-project
 Dependency

Authors

Maintainers

Sources

gemini-0.3.0.tbz
sha256=272dee4881951e559c66dc65d524373132d592af70c5612ae6ce9845956a4b77
sha512=2f6e73ee03d688d7b6f0fd3ec97c67d9bdfee03868ec45c28acb58a7cf71f50f070020f335531c476b11354dff0393cb2d8084e28747d0d5bd8e1ce2a603f0ea

Description

This library implements the Gemini exchange v1 REST, Market Data, and Order events websockets services. It is backed by yojson, cohttp-async and cohttp_async_websocket to do the heavy lifting. A provisional console interface is also provided using s-expressions to encode request parameters.

Added to opam-repository:

README

Introduction

This library implements the Gemini exchange v1 REST, Market Data, and Order events websockets services. It is backed by 'yojson', cohttp-async and cohttp_async_websocket to do the heavy lifting. A provisional console interface is also provided using s-expressions to encode request parameters.

Installation

From your project directory run

opam pin . -y

You can also build the code locally with make or dune.

Api Documentation

The autogenerated api documentation is here.

Configuration

Default environment property

export GEMINI_ENV=production

or

export GEMINI_ENV=sandbox

Sandbox properties

export GEMINI_SANDBOX_API_KEY=...
export GEMINI_SANDBOX_API_SECRET=...

Production properties

export GEMINI_PRODUCTION_API_SECRET=...
export GEMINI_PRODUCTION_API_KEY=...

Example command line usage

gemini tradevolume

2018-03-30 22:01:44.029835-04:00 Info response:
 ((((account_id 123456) (symbol Ethusd) (base_currency Eth)
   (notional_currency Usd) (data_date 2018-03-07)
   (total_volume_base 1.35528896) (maker_buy_sell_ratio 0) (buy_maker_base 0)
   (buy_maker_notional 0) (buy_maker_count 0) (sell_maker_base 0)
   (sell_maker_notional 0) (sell_maker_count 0) (buy_taker_base 1.35528896)
   (buy_taker_notional 997.5062274496) (buy_taker_count 1)
   (sell_taker_base 0) (sell_taker_notional 0) (sell_taker_count 0))
  ((account_id 123456) (symbol Ethusd) (base_currency Eth)
   (notional_currency Usd) (data_date 2018-03-12)
   (total_volume_base 0.30208043) (maker_buy_sell_ratio 0) (buy_maker_base 0)
   (buy_maker_notional 0) (buy_maker_count 0) (sell_maker_base 0)
   (sell_maker_notional 0) (sell_maker_count 0) (buy_taker_base 0.80208043)
   (buy_taker_notional 428.72431038315204) (buy_taker_count 10)
   (sell_taker_base 0) (sell_taker_notional 0) (sell_taker_count 0))
  ....
 gemini order new '((symbol Ethusd) (price 500.0) (amount .001) (type_ Exchange_limit) (client_order_id "test-order") (options ()) (side Sell))'

2018-03-30 22:18:01.210962-04:00 Info response:
 ((client_order_id (test-order)) (order_id 1392122353) (id 1190026576)
 (symbol Ethusd) (exchange Gemini) (avg_execution_price 0.00) (side Sell)
 (type_ Exchange_limit) (timestamp (2018-03-30 22:18:01.000000-04:00))
 (timestampms (2018-03-30 22:18:01.198000-04:00)) (is_live true)
 (is_cancelled false) (is_hidden false) (was_forced false)
 (executed_amount 0) (remaining_amount 0.001) (options ()) (price 500.00)
 (original_amount 0.001))

License

MIT

Features and Bugs

Open issues on github. I am too busy to add new features personally but will review and accept PRs when time permits.

TODO

  • order status web sockets api
  • fix unit test harness
  • document code
  • make opam release
  • rich cli support for order commands
  • write to binary format instead of csv
  • switch to eio where applicable
  • integration test against sandbox environment

Dev Dependencies

None

Optional Dependencies

None

Used by

None

Conflicts

None

Build status

Results of building gemini with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.

Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.

Version OCaml 4.11 OCaml 4.14 OCaml 5.2 OCaml 5.4 OCaml 5.5
0.3.0 (this version) n/a n/a good good good
  • good Package successfully built
  • partial One of the dependencies failed to build
  • bad Package failed to build
  • n/a Package is not available in this environment
  • internal Internal failure