Two offers on the XRPL order book have the same price—which one gets filled first?

For offers with the same exchange rate in the same order book, the rule given in the XRPL documentation is first come, first served. The `quality` field in the `book_offers` response represents an offer’s exchange rate, calculated by dividing the amount the taker pays by the amount they receive. When exchange rates are the same, the earlier offer is placed first.

Suppose two sell offers are at the same price, and a buy order that arrives later is only large enough to fill the one at the front of the queue. The offer behind it may still have to wait, even if the page shows that a trade has occurred at that price. To investigate, first make sure you’re looking at the same order book, then check the original exchange rates and the order in which the offers were placed, and finally review your actual trade history. If the page rounds two prices to the same value, compare their original values first.

$XRP #XRPL

Source documentation https://xrpl.org/docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/book_offers