PHPackages                             xrplwin/xrpl-orderbook-reader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. xrplwin/xrpl-orderbook-reader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xrplwin/xrpl-orderbook-reader
=============================

This repository takes XRPL Orderbook (book\_offers) datasets and requested volume to exchange and calculates the effective exchange rates based on the requested and available liquidity.

v1.0.5(3y ago)21201MITPHPPHP ^8.1.0

Since Aug 26Pushed 3y agoCompare

[ Source](https://github.com/XRPLWin/XRPL-Orderbook-Reader)[ Packagist](https://packagist.org/packages/xrplwin/xrpl-orderbook-reader)[ Docs](https://github.com/XRPLWin)[ RSS](/packages/xrplwin-xrpl-orderbook-reader/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

[![CI workflow](https://github.com/XRPLWin/XRPL-Orderbook-Reader/actions/workflows/main.yml/badge.svg)](https://github.com/XRPLWin/XRPL-Orderbook-Reader/actions/workflows/main.yml)[![GitHub license](https://camo.githubusercontent.com/d795388b28b9e35e608a770dbb7410c033bbf32f7cf8fc09ff0fb986f9525d9c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f5852504c57696e2f5852504c2d4f72646572626f6f6b2d526561646572)](https://github.com/XRPLWin/XRPL-Orderbook-Reader/blob/main/LICENSE)[![Total Downloads](https://camo.githubusercontent.com/7e5ee8b1d2d2cd5929aa65be4f638f81702aa1b865fe5ea8b8f47850fc3adaf6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7872706c77696e2f7872706c2d6f72646572626f6f6b2d7265616465722e7376673f7374796c653d666c6174)](https://packagist.org/packages/xrplwin/xrpl-orderbook-reader)

XRPL Orderbook Reader for PHP
=============================

[](#xrpl-orderbook-reader-for-php)

This repository takes XRPL Orderbook (`book_offers`) datasets and requested volume to exchange and calculates the effective exchange rates based on the requested and available liquidity.

Optionally certain checks can be specified (eg. `book_offers` on the other side of the book) to warn for limited (percentage) liquidity on the requested side, and possibly other side of the order book.

This is PHP port of  by [Wietse Wind](https://github.com/WietseWind) ([@XRPL Labs](https://github.com/XRPL-Labs))

Note
====

[](#note)

This package is provided as is, please test it yourself first.
Found a bug? [Report issue here](https://github.com/XRPLWin/XRPL-Orderbook-Reader/issues/new)

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- [Composer](https://getcomposer.org/)

Installation
------------

[](#installation)

To install run

```
composer require xrplwin/xrpl-orderbook-reader

```

Usage
-----

[](#usage)

```
use \XRPLWin\XRPL\Client;

$xrplwinapiclient = new Client([]);
$lc = new LiquidityCheck([
  # Trade:
  'from' => [
    'currency' => 'XRP'
  ],
  'amount' => 10,
  'to' => [
    'currency' => 'USD',
    'issuer' => 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq'
  ],
],
[
  # Options:
  //'rates' => 'to',
  //'maxSpreadPercentage' => 4,
  //'maxSlippagePercentage' => 3,
  //'maxSlippagePercentageReverse' => 3,
  //'maxBookLines' => 500,
  'includeBookData' => true //default false
], $xrplwinapiclient);

try {
  $Liquidity = $lc->get();
} catch (\Throwable) {
  //Unable to connect to provided XRPL server...
  $Liquidity = [
    'rate' => null,
    'safe' => false,
    'errors' => ['CONNECT_ERROR']
  ];
}

print_r($Liquidity);
/**
 * [
 *   'rate' => NUMBER,
 *   'safe' => BOOLEAN,
 *   'errors' => ARRAY,
 *   'books' => ARRAY
 * ]
 **/
```

Running tests
-------------

[](#running-tests)

Run all tests in "tests" directory.

```
composer test

```

or

```
./vendor/bin/phpunit --testdox

```

### Sample

[](#sample)

See [sample.php](sample.php)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~41 days

Recently: every ~62 days

Total

7

Last Release

1104d ago

Major Versions

v0.0.1 → v1.0.02022-08-26

### Community

Maintainers

![](https://www.gravatar.com/avatar/02b0ccc19f65ae6ac53ec11a802ad35565047f862eeccde3a7291917920f9160?d=identicon)[xrplwin](/maintainers/xrplwin)

---

Top Contributors

[![zgrguric](https://avatars.githubusercontent.com/u/108837406?v=4)](https://github.com/zgrguric "zgrguric (28 commits)")

---

Tags

composerpackageRateexchangeordersripplexrpxrplrippledbook\_offers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/xrplwin-xrpl-orderbook-reader/health.svg)

```
[![Health](https://phpackages.com/badges/xrplwin-xrpl-orderbook-reader/health.svg)](https://phpackages.com/packages/xrplwin-xrpl-orderbook-reader)
```

###  Alternatives

[jean85/pretty-package-versions

A library to get pretty versions strings of installed dependencies

1.3k289.5M62](/packages/jean85-pretty-package-versions)[composer/satis

Simple Repository Generator

3.3k1.4M17](/packages/composer-satis)[fxp/composer-asset-plugin

NPM/Bower Dependency Manager for Composer

8894.8M39](/packages/fxp-composer-asset-plugin)[foxy/foxy

Fast, reliable, and secure NPM/Yarn/pnpm bridge for Composer

177287.5k25](/packages/foxy-foxy)[netojose/laravel-bootstrap-4-forms

Bootstrap 4 form builder for Laravel 5

182115.3k](/packages/netojose-laravel-bootstrap-4-forms)[php-forge/foxy

Fast, reliable, and secure Bun/NPM/Yarn/pnpm bridge for Composer

45103.3k4](/packages/php-forge-foxy)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
