Skip to main content
Event Types

DEX Events

XRNotify monitors the XRPL decentralized exchange (DEX) — a native on-ledger order book that lets any account trade any two assets without a centralized intermediary. Offers are limit orders; when two compatible offers cross, a trade executes automatically as part of ledger consensus.

dex.offer_createddex.offer_cancelleddex.offer_filleddex.offer_partial

Amount format: All amount fields in DEX events are either a string representing drops of XRP (e.g. "1000000"), or an object { currency, value, issuer } for issued tokens. Never a number.

dex.offer_created

OfferCreate

Fires when an OfferCreate transaction places a new limit order on the DEX. The offer remains open on the order book until it is fully filled, cancelled, or expires. If the offer partially crosses on creation, a dex.offer_partial event is also emitted.

Payload schema

FieldTypeDescription
offer_idnumberOffer sequence number (account sequence at time of creation)
accountstringAccount address that placed the offer
taker_paysstring | objectAmount the offer creator will pay when the offer is consumed (what the taker receives)
taker_getsstring | objectAmount the offer creator will receive when the offer is consumed (what the taker pays)
expirationstring | nullISO 8601 expiry timestamp, or null for no expiry
flagsnumberRaw transaction flags bitmask
is_passivebooleanTrue if this is a passive offer that will not consume crossing offers at creation
is_fill_or_killbooleanTrue if the offer must be fully filled immediately or cancelled entirely
is_immediate_or_cancelbooleanTrue if the offer fills what it can immediately then cancels any remainder
ledger_indexnumberLedger in which the offer was placed
tx_hashstringTransaction hash

Example payload

{
  "event_id": "xrpl:89560000:A1B2C3D4E5F6:dex.offer_created",
  "event_type": "dex.offer_created",
  "ledger_index": 89560000,
  "timestamp": "2024-01-15T14:00:00Z",
  "network": "mainnet",
  "payload": {
    "offer_id": 87654321,
    "account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
    "taker_pays": {
      "currency": "USD",
      "value": "100.00",
      "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
    },
    "taker_gets": "50000000",
    "expiration": null,
    "flags": 0,
    "is_passive": false,
    "is_fill_or_kill": false,
    "is_immediate_or_cancel": false,
    "ledger_index": 89560000,
    "tx_hash": "A1B2C3D4E5F6A1B2C3D4E5F6A1B2C3D4E5F6A1B2C3D4E5F6A1B2C3D4E5F6A1B2"
  }
}

dex.offer_cancelled

OfferCancel / auto-expired

Fires when an offer is removed from the order book — either explicitly via an OfferCancel transaction, or automatically when an expiry time passes and the ledger removes the offer during the next close.

Payload schema

FieldTypeDescription
offer_idnumberSequence number of the cancelled offer
accountstringOwner of the cancelled offer
ledger_indexnumberLedger in which cancellation occurred
tx_hashstringTransaction hash (the OfferCancel tx, or the tx that triggered auto-removal)

dex.offer_filled

Trade — fully consumed

Fires when an offer on the order book is completely consumed by a crossing trade. The offer no longer exists on the ledger after this event. Both the offer creator and the taker receive these events when account filters match.

Payload schema

FieldTypeDescription
offer_idnumberSequence number of the fully-filled offer
accountstringAccount that originally placed the offer
taker_pays_actualstring | objectExact amount paid by the taker in this fill
taker_gets_actualstring | objectExact amount received by the taker in this fill
fill_amountstring | objectTotal traded amount (equivalent to taker_gets_actual for a complete fill)
ledger_indexnumberLedger in which the fill was validated
tx_hashstringTransaction hash of the crossing trade

Example payload

{
  "event_id": "xrpl:89561500:B3C4D5E6F7A8:dex.offer_filled",
  "event_type": "dex.offer_filled",
  "ledger_index": 89561500,
  "timestamp": "2024-01-15T14:30:00Z",
  "network": "mainnet",
  "payload": {
    "offer_id": 87654321,
    "account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
    "taker_pays_actual": {
      "currency": "USD",
      "value": "100.00",
      "issuer": "rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq"
    },
    "taker_gets_actual": "50000000",
    "fill_amount": "50000000",
    "ledger_index": 89561500,
    "tx_hash": "B3C4D5E6F7A8B3C4D5E6F7A8B3C4D5E6F7A8B3C4D5E6F7A8B3C4D5E6F7A8B3C4"
  }
}

dex.offer_partial

Trade — partially consumed

Fires when an offer is partially filled by a crossing trade but remains on the order book with a reduced amount. The offer continues to exist and will fire additional dex.offer_partial or dex.offer_filled events as more trades cross it.

Payload schema

FieldTypeDescription
offer_idnumberSequence number of the partially-filled offer
accountstringAccount that placed the offer
taker_pays_actualstring | objectAmount paid by the taker in this partial fill
taker_gets_actualstring | objectAmount received by the taker in this partial fill
remainingstring | objectAmount still unfilled — what remains on the order book
fill_percentnumberPercentage filled in this event (0–100), as a float
ledger_indexnumberLedger in which the partial fill occurred
tx_hashstringTransaction hash of the crossing trade

Related event types