{"id":22302962,"url":"https://github.com/xrplwin/xrpl-orderbook-reader","last_synced_at":"2025-07-29T03:33:24.495Z","repository":{"id":57938916,"uuid":"473913062","full_name":"XRPLWin/XRPL-Orderbook-Reader","owner":"XRPLWin","description":"Parse XRPL Order Book results into effective liquidity based exchange prices","archived":false,"fork":false,"pushed_at":"2023-05-01T21:02:44.000Z","size":49,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T12:55:43.237Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/XRPLWin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-25T07:39:23.000Z","updated_at":"2024-06-22T13:01:37.000Z","dependencies_parsed_at":"2024-12-03T18:43:03.473Z","dependency_job_id":"82fb910e-c52c-46c1-bca8-fa91df6b7cf1","html_url":"https://github.com/XRPLWin/XRPL-Orderbook-Reader","commit_stats":{"total_commits":29,"total_committers":2,"mean_commits":14.5,"dds":"0.10344827586206895","last_synced_commit":"8826d8ebed8a9df68e3a8b8879b05cec5bd50f63"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/XRPLWin/XRPL-Orderbook-Reader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-Orderbook-Reader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-Orderbook-Reader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-Orderbook-Reader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-Orderbook-Reader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/XRPLWin","download_url":"https://codeload.github.com/XRPLWin/XRPL-Orderbook-Reader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/XRPLWin%2FXRPL-Orderbook-Reader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267623126,"owners_count":24117129,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T18:42:06.527Z","updated_at":"2025-07-29T03:33:24.196Z","avatar_url":"https://github.com/XRPLWin.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![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)\n[![GitHub license](https://img.shields.io/github/license/XRPLWin/XRPL-Orderbook-Reader)](https://github.com/XRPLWin/XRPL-Orderbook-Reader/blob/main/LICENSE)\n[![Total Downloads](https://img.shields.io/packagist/dt/xrplwin/xrpl-orderbook-reader.svg?style=flat)](https://packagist.org/packages/xrplwin/xrpl-orderbook-reader)\n\n# XRPL Orderbook Reader for PHP\nThis repository takes XRPL Orderbook (`book_offers`) datasets and requested volume to\nexchange and calculates the effective exchange rates based on the requested and available liquidity.\n\nOptionally certain checks can be specified (eg. `book_offers` on the other side of the book)\nto warn for limited (percentage) liquidity on the requested side, and possibly other side\nof the order book.\n\nThis is PHP port of https://github.com/XRPL-Labs/XRPL-Orderbook-Reader by [Wietse Wind](https://github.com/WietseWind) ([@XRPL Labs](https://github.com/XRPL-Labs))\n\n# Note\n\nThis package is provided as is, please test it yourself first.  \nFound a bug? [Report issue here](https://github.com/XRPLWin/XRPL-Orderbook-Reader/issues/new)\n\n## Requirements\n- PHP 8.1 or higher\n- [Composer](https://getcomposer.org/)\n\n## Installation\nTo install run\n\n```\ncomposer require xrplwin/xrpl-orderbook-reader\n```\n\n## Usage\n```PHP\nuse \\XRPLWin\\XRPL\\Client;\n\n$xrplwinapiclient = new Client([]);\n$lc = new LiquidityCheck([\n  # Trade:\n  'from' =\u003e [\n    'currency' =\u003e 'XRP'\n  ],\n  'amount' =\u003e 10,\n  'to' =\u003e [\n    'currency' =\u003e 'USD',\n    'issuer' =\u003e 'rhub8VRN55s94qWKDv6jmDy1pUykJzF3wq'\n  ],  \n],\n[\n  # Options:\n  //'rates' =\u003e 'to',\n  //'maxSpreadPercentage' =\u003e 4,\n  //'maxSlippagePercentage' =\u003e 3,\n  //'maxSlippagePercentageReverse' =\u003e 3,\n  //'maxBookLines' =\u003e 500,\n  'includeBookData' =\u003e true //default false\n], $xrplwinapiclient);\n\ntry {\n  $Liquidity = $lc-\u003eget();\n} catch (\\Throwable) {\n  //Unable to connect to provided XRPL server...\n  $Liquidity = [\n    'rate' =\u003e null,\n    'safe' =\u003e false,\n    'errors' =\u003e ['CONNECT_ERROR']\n  ];\n}\n\nprint_r($Liquidity); \n/**\n * [\n *   'rate' =\u003e NUMBER,\n *   'safe' =\u003e BOOLEAN,\n *   'errors' =\u003e ARRAY,\n *   'books' =\u003e ARRAY\n * ]\n **/\n```\n## Running tests\nRun all tests in \"tests\" directory.\n```\ncomposer test\n```\nor\n```\n./vendor/bin/phpunit --testdox\n```\n\n### Sample\n\nSee [sample.php](sample.php)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplwin%2Fxrpl-orderbook-reader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxrplwin%2Fxrpl-orderbook-reader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxrplwin%2Fxrpl-orderbook-reader/lists"}