Module: Bitfinex::RESTv1OrderBook

Included in:
RESTv1
Defined in:
lib/rest/v1/order_book.rb

Instance Method Summary collapse

Instance Method Details

#orderbook(symbol = "btcusd", params = {}) ⇒ Hash

Get the full order book

@example:

client.orderbook("btcusd")

Parameters:

  • symbol (string) (defaults to: "btcusd")
  • params (defaults to: {})

    :limit_bids [int] (optional) Limit the number of bids returned. May be 0 in which case the array of bids is empty. Default 50.

  • params (defaults to: {})

    :limit_asks [int] (optional) Limit the number of asks returned. May be 0 in which case the array of asks is empty. Default 50.

  • params (defaults to: {})

    :group [0/1] (optional) If 1, orders are grouped by price in the orderbook. If 0, orders are not grouped and sorted individually. Default 1

Returns:

  • (Hash)

    :bids [Array], :asks [Array]



12
13
14
15
# File 'lib/rest/v1/order_book.rb', line 12

def orderbook(symbol="btcusd", params = {})
  check_params(params, %i{limit_bids limit_asks group})
  get("book/#{symbol}", params).body
end