Geminex.API.Public (geminex v0.1.0)

Public API endpoints for Gemini.

Summary

Functions

Retrieves time-intervaled data for the provided symbol.

Retrieves the current order book for the specified trading pair symbol.

Retrieves time-intervaled data for the provided perpetual swap symbol.

Retrieves symbols that currently have fee promos.

Retrieves the funding amount details for the specified symbol.

Retrieves the funding amount report file.

Retrieves the associated network for a requested token.

Retrieves the price feed for all trading pairs.

Retrieves extra detail on a supported symbol.

Retrieves all available symbols for trading.

Retrieves information about recent trading activity for the symbol.

Retrieves information about recent trading activity for the provided symbol (V2).

Retrieves the trade history for the specified trading pair symbol.

Functions

Link to this function

candles(symbol, time_frame)

@spec candles(symbol :: String.t(), time_frame :: String.t()) ::
  {:ok, [[any()]]} | {:error, any()}

Retrieves time-intervaled data for the provided symbol.

Parameters

  • symbol: Trading pair symbol (e.g., "btcusd").
  • time_frame: Time range for each candle (e.g., "1m", "5m").
Link to this function

current_order_book(symbol, opts \\ [])

@spec current_order_book(
  symbol :: String.t(),
  opts :: [limit_bids: non_neg_integer(), limit_asks: non_neg_integer()]
) :: {:ok, map()} | {:error, any()}

Retrieves the current order book for the specified trading pair symbol.

Parameters

  • symbol : The trading pair symbol (e.g., "btcusd").
  • opts : A list of query parameters to customize the order book data.
    • :limit_bids : The maximum number of bid orders to retrieve.
    • :limit_asks : The maximum number of ask orders to retrieve.

Returns

  • on success, containing the order book data as a map.
  • on failure, with an error reason.
Link to this function

derivatives_candles(symbol, time_frame)

@spec derivatives_candles(symbol :: String.t(), time_frame :: String.t()) ::
  {:ok, [[any()]]} | {:error, any()}

Retrieves time-intervaled data for the provided perpetual swap symbol.

Parameters

  • symbol: Perpetual swap symbol (e.g., "BTCGUSDPERP").
  • time_frame: Time range for each candle (e.g., "1m").
@spec fee_promos() :: {:ok, map()} | {:error, any()}

Retrieves symbols that currently have fee promos.

Link to this function

funding_amount(symbol)

@spec funding_amount(symbol :: String.t()) :: {:ok, map()} | {:error, any()}

Retrieves the funding amount details for the specified symbol.

Parameters

  • symbol: Trading pair symbol (e.g., "btcgusdperp").
Link to this function

funding_amount_report(opts \\ [])

@spec funding_amount_report(
  opts :: [
    fromDate: non_neg_integer(),
    toDate: non_neg_integer(),
    numRows: non_neg_integer()
  ]
) :: {:ok, binary()} | {:error, any()}

Retrieves the funding amount report file.

Parameters

  • opts : A list of query parameters to customize the report.
    • :fromDate : The start date for the report, represented as a Unix timestamp.
    • :toDate : The end date for the report, represented as a Unix timestamp.
    • :numRows : The maximum number of rows to retrieve in the report.

Returns

  • on success, containing the binary content of the report file.
  • on failure, with an error reason.
@spec network(token :: String.t()) :: {:ok, map()} | {:error, any()}

Retrieves the associated network for a requested token.

Parameters

  • token: Token identifier (e.g., "eth").
@spec price_feed() :: {:ok, [map()]} | {:error, any()}

Retrieves the price feed for all trading pairs.

Link to this function

symbol_details(symbol)

@spec symbol_details(symbol :: String.t()) :: {:ok, map()} | {:error, any()}

Retrieves extra detail on a supported symbol.

Parameters

  • symbol: Trading pair symbol (e.g., "btcusd").
@spec symbols() :: {:ok, [String.t()]} | {:error, any()}

Retrieves all available symbols for trading.

@spec ticker(symbol :: String.t()) :: {:ok, map()} | {:error, any()}

Retrieves information about recent trading activity for the symbol.

Parameters

  • symbol: Trading pair symbol (e.g., "btcusd").
Link to this function

ticker_v2(symbol)

@spec ticker_v2(symbol :: String.t()) :: {:ok, map()} | {:error, any()}

Retrieves information about recent trading activity for the provided symbol (V2).

Parameters

  • symbol: Trading pair symbol (e.g., "btcusd").
Link to this function

trade_history(symbol, opts \\ [])

@spec trade_history(
  symbol :: String.t(),
  opts :: [
    timestamp: non_neg_integer(),
    since_tid: non_neg_integer(),
    limit_trades: non_neg_integer(),
    include_breaks: boolean()
  ]
) :: {:ok, [map()]} | {:error, any()}

Retrieves the trade history for the specified trading pair symbol.

Parameters

  • symbol : The trading pair symbol (e.g., "btcusd").
  • opts : A list of options to customize the query.
    • :timestamp : The starting timestamp for the trade history.
    • :since_tid : The trade ID from which to start fetching trades.
    • :limit_trades : The maximum number of trades to retrieve.
    • :include_breaks : Whether to include breaks between trades. Defaults to false.

Returns

  • on success, containing the trade history as a list of maps.
  • on failure, with an error reason.