Events


Subscribing to Events

aori_subscribewss://api.aori.io

The QuoteRequested event is emitted when a quote is requested (RFQ) from you or another user. The event data will not include the outputAmount in the takerOrder object.

Optional Filtering Properties

  • Name
    tradeId
    Type
    string
    Description

    Will be "rfq" for quote requests

  • Name
    orderType
    Type
    string
    Description

    Will be "rfq" for quote requests

  • Name
    address
    Type
    `string`
    Description

    The blockchain network ID

  • Name
    token
    Type
    string[]
    Description

    The order details from the taker requesting the quote

  • Name
    chainId
    Type
    number
    Description

    The blockchain network ID

Subscription Request

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "aori_subscribe",
  "params": [{}]
}

Response

{
  "id": 1,
  "result": "Ok"
}

Event Types

  • Name
    quoteRequested
    Type
    Description

    Emitted when a quote is requested (RFQ) from you or another user. For RFQ orders, the outputAmount is not included in the takerOrder.

    See Example
  • Name
    orderPlaced
    Type
    Description

    Emitted when a maker places a limit order to be taken. Includes the complete order details including outputAmount.

    See Example
  • Name
    quoteReceived
    Type
    Description

    Emitted when a market maker or solver provides a quote for an RFQ. Contains the maker's order details.

    See Example
  • Name
    tradeMatched
    Type
    Description

    Emitted when a match occurs between a taker and maker. Contains full order details and signatures from both parties.

    See Example
  • Name
    tradeSettled
    Type
    Description

    Emitted when a trade/RFQ has been successfully settled on-chain. Includes the settlement transaction hash.

    See Example
  • Name
    orderExpired
    Type
    Description

    Emitted when an order reaches its endTime before being matched. For RFQs, contains the taker order; for limit orders, contains the maker order.

    See Example
  • Name
    tradeFailed
    Type
    Description

    Emitted when a matched trade fails to settle or is cancelled by the maker. Contains both maker and taker order details.

    See Example
  • Name
    orderCancelled
    Type
    Description

    Emitted when a maker cancels a limit order before it receives a match.

    See Example

Event Schema

{
  "tradeId": "aori_1a2b3",
  "event": "quoteRequested", // Event type
  "data": {...},
  "timestamp": 1730164716725 // Unix timestamp
}

Example Events

Quote Requested

The QuoteRequested event is emitted when a quote is requested (RFQ) from you or another user. The event data will not include the outputAmount in the takerOrder object.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    Will be "rfq" for quote requests

  • Name
    takerOrder
    Type
    object
    Description

    The order details from the taker requesting the quote

  • Name
    chainId
    Type
    integer
    Description

    The blockchain network ID

Example Event

{
  "type": "QuoteRequested",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "rfq",
    "takerOrder": {
      // AoriOrder object
    },
    "chainId": 1
  },
  "timestamp": 1728301181254
}

Quote Recieved

The QuoteReceived event is emitted when a market maker or solver provides a quote for an RFQ.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    Will be "rfq" for quote responses

  • Name
    makerOrder
    Type
    object
    Description

    The order details from the maker providing the quote

  • Name
    chainId
    Type
    integer
    Description

    The blockchain network ID

Example Event

{
  "type": "QuoteReceived",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "rfq",
    "makerOrder": {
      // AoriOrder object
    },
    "chainId": 1
  },
  "timestamp": 1728301181255
}

Trade Matched

The TradeMatched event is emitted when a match occurs between a taker and maker. Contains full order details and signatures from both parties.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    The type of order matched ("rfq" or "limit")

  • Name
    makerOrder
    Type
    object
    Description

    Complete maker order details

  • Name
    takerOrder
    Type
    object
    Description

    Complete taker order details

  • Name
    matching
    Type
    object
    Description

    Contains fee details and matching information

Example Event

{
  "type": "TradeMatched",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "rfq",
    "makerOrder": {},
    "makerOrderHash": "0x...",
    "makerSignature": "0x...",
    "takerOrder": {},
    "takerOrderHash": "0x...",
    "takerSignature": "0x...",
    "chainId": 1,
    "matching": {
      "feeTag": "0x...",
      "feeRecipient": "0x..."
    }
  },
  "timestamp": 1728301181255
}

Trade Settled

The TradeSettled event is emitted when a trade/RFQ has been successfully settled on-chain.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    The type of order settled

  • Name
    makerOrder
    Type
    object
    Description

    The maker's order details

  • Name
    takerOrder
    Type
    object
    Description

    The taker's order details

  • Name
    transactionHash
    Type
    string
    Description

    The hash of the settlement transaction

Example Event

{
  "type": "TradeSettled",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "rfq",
    "makerOrder": {},
    "takerOrder": {},
    "chainId": 1,
    "transactionHash": "0x1234..."
  },
  "timestamp": 1728301181255
}

Neutral

The OrderExpired event is emitted when an order reaches its endTime before being matched.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    The type of expired order ("rfq" or "limit")

  • Name
    takerOrder
    Type
    object
    Description

    For RFQ orders - the expired taker order

  • Name
    makerOrder
    Type
    object
    Description

    For limit orders - the expired maker order

Example Event

{
  "type": "OrderExpired",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "rfq",
    "takerOrder": {},
    "chainId": 1
  },
  "timestamp": 1728301181255
}

Trade Failed

The TradeFailed event is emitted when a matched trade fails to settle or is cancelled by the maker.

Data Properties

  • Name
    orderType
    Type
    string
    Description

    The type of failed trade

  • Name
    makerOrder
    Type
    object
    Description

    The maker's order details

  • Name
    takerOrder
    Type
    object
    Description

    The taker's order details

  • Name
    matchingHash
    Type
    string
    Description

    Hash of the matching data

Example Event

{
  "type": "TradeFailed",
  "tradeId": "aori-1234567890",
  "data": {
    "orderType": "limit",
    "makerOrder": {},
    "takerOrder": {},
    "matchingHash": "0x...",
    "chainId": 1
  },
  "timestamp": 1728301181255
}