AMM/DEX Methods
Get DEX order book
wss://honeycluster.io
rpc method: book_offers

Returns the current offers in a given order book (the DEX exchange rates between two currencies).

Try it now
Response · book_offers WS Response
{
  "result": {
    "ledger_index": 89012345,
    "offers": [
      {
        "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
        "BookDirectory": "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D5505DCAA",
        "Flags": 0,
        "OwnerNode": "0",
        "TakerGets": "5000000",
        "TakerPays": {
          "currency": "USD",
          "issuer": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
          "value": "2.5"
        },
        "quality": "0.0000005"
      }
    ]
  },
  "status": "success",
  "type": "response",
  "id": 1
}
Request Message
book_offers WS Request
application/json
Get DEX order book
FieldTypeDescription
command
required
string
WebSocket command name
id
object
Client-supplied identifier to correlate requests with responses.
taker_gets
object
The currency the taker would receive (the "ask" side).
taker_gets.currency
required
string
Three-letter ISO 4217 currency code, or 160-bit hex currency code.
taker_gets.issuer
string
Account address of the token issuer. Omit for XRP.
taker_pays
object
The currency the taker would pay (the "bid" side).
taker_pays.currency
required
string
Three-letter ISO 4217 currency code, or 160-bit hex currency code.
taker_pays.issuer
string
Account address of the token issuer. Omit for XRP.
taker
string
Account address to use as a perspective for unfunded offers.
limit
integer
Maximum number of results to return. Clio servers may return more than this.
ledger_index
object
A ledger index (sequence number) or shortcut string identifying which ledger to use.
ledger_hash
string
256-bit hex hash identifying a specific ledger version.
api_version
object
API version for the response format. Version 2 is the default for rippled 2.0+.
Example
Json
{
  "command": "book_offers",
  "id": 1,
  "taker_gets": {
    "currency": "XRP"
  },
  "taker_pays": {
    "currency": "USD",
    "issuer": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe"
  },
  "limit": 10
}
Response Message
book_offers WS Response
application/json
WebSocket response for book_offers
FieldTypeDescription
result
object
status
enum<string>
Available
successerror
type
string
id
stringnumber
Echo of the client-provided correlation ID
Example
Json
{
  "result": {
    "ledger_index": 89012345,
    "offers": [
      {
        "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
        "BookDirectory": "7E5F614417C2D0A7CEFEB73C4AA773ED5B078DE2B5771F6D5505DCAA",
        "Flags": 0,
        "OwnerNode": "0",
        "TakerGets": "5000000",
        "TakerPays": {
          "currency": "USD",
          "issuer": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
          "value": "2.5"
        },
        "quality": "0.0000005"
      }
    ]
  },
  "status": "success",
  "type": "response",
  "id": 1
}