{"id":18056021,"url":"https://github.com/limpidcrypto/xrpl-trading","last_synced_at":"2026-01-27T12:37:11.488Z","repository":{"id":111175494,"uuid":"553860686","full_name":"LimpidCrypto/xrpl-trading","owner":"LimpidCrypto","description":"A trading bot that performs arbitrage and market making on the XRP Ledger","archived":false,"fork":false,"pushed_at":"2024-07-19T14:51:43.000Z","size":71,"stargazers_count":16,"open_issues_count":20,"forks_count":3,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-11T02:06:22.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/LimpidCrypto.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-10-18T22:20:58.000Z","updated_at":"2025-03-07T19:48:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"aab6cb43-1c4a-4d21-bc6b-e52cdd5f55bd","html_url":"https://github.com/LimpidCrypto/xrpl-trading","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LimpidCrypto/xrpl-trading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LimpidCrypto%2Fxrpl-trading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LimpidCrypto%2Fxrpl-trading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LimpidCrypto%2Fxrpl-trading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LimpidCrypto%2Fxrpl-trading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LimpidCrypto","download_url":"https://codeload.github.com/LimpidCrypto/xrpl-trading/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LimpidCrypto%2Fxrpl-trading/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-10-31T01:13:21.293Z","updated_at":"2026-01-27T12:37:11.473Z","avatar_url":"https://github.com/LimpidCrypto.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xrpl-trading\nA trading bot that performs types.arbitrage and market making on the XRP Ledger\n\n## Concepts\n1. Arbitrage\n    - 1.1 Simple cross exchange types.arbitrage\n    - 1.2 Triangular types.arbitrage\n2. Market making\n\n### 1. Arbitrage\nArbitrage trading describes the practice of taking advantage of differences in prices of the same assets in two or more markets.\nIn other words you are buying an asset in one market and at the same time you are selling the same asset at a higher price in a second market.\n\nOften times arbitrageurs have prefunded multiple asstets on multiple exchanges to monitor as many possibilities for types.arbitrage opportunities as possible and to act as fast as possible. Arbitrageurs always have to make sure they've funded their assets they want to trade. If they don't have them funded they have to first buy the asset they want to spend which takes extra time and fees. Using the DeX and path finding of the XRP Ledger we can fund the wished asset, buy an asset and sell that asset with just a few transactions that all get validated in the same Ledger at the same time. So the types.arbitrage opportunity will be taken super fast and will cost, in the best case, a friction of a cent. Often times issuers have defined transfer fees that get charged whenever you are transfer a token, which increases the overall fees.\n\n```\nFT = FTxn + FTfr\n```\n- F\u003csub\u003eT\u003c/sub\u003e: Total fee\n- F\u003csub\u003eTxn\u003c/sub\u003e: Transaction fee\n- F\u003csub\u003eTfr\u003c/sub\u003e: Transfer fee\n\nOn the XRPL we don't have multiple CeX but one DeX with multiple issuers of tokens. You can trade all tokens against each other. There are no limitations that you couldn't trade `USD:Bitstamp` against `USD:Gatehub` just because the issuers are different.\n\n#### 1.1 Simple cross exchange types.arbitrage\nThis is the simplest type of types.arbitrage. We have Asset\u003csub\u003eA\u003c/sub\u003e, trade it against Asset\u003csub\u003eB\u003c/sub\u003e and trade Asset\u003csub\u003eB\u003c/sub\u003e for Asset\u003csub\u003eC\u003c/sub\u003e.\n\nThe flowchart below shows the potentially simplest example of a cross exchange types.arbitrage opportunity:\n```mermaid\nflowchart TB\nAlice{Alice:\\n10 XRP\\n5 USD:Gatehub} --\u003e XRPUSDB[XRP/USD:Bitstamp\\n0.50 USD] --\u003e Alice1{Alice:\\n5 USD:Bitstamp\\n5 USD:Gatehub} --\u003e XRPUSDG[XRP/USD:Gatehub\\n0.49 USD] --\u003e Alice2{Alice:\\n10.2 XRP\\n5 USD:Bitstamp}\n\nclassDef wallet fill:#0003ba;\nclassDef buyOrderBook fill:#3e8a2f;\nclassDef sellOrderBook fill:#a60202;\n\nclass Alice,Alice1,Alice2 wallet;\nclass XRPUSDB buyOrderBook;\nclass XRPUSDG sellOrderBook;\n```\nAt the time `Alice` spot's the types.arbitrage opportunity, she hold's `10 XRP` and `5 USD` from the issuer `Gatehub` (`USD:Gatehub`). She spotted an offer that enables her to trade `10 XRP` at a price of `0.50 USD:Bitstamp` to receive `5 USD:Bitstamp`. She takes that trade because she also spotted an offer that enables hew to trade `5 USD:Gatehub` at a price of `0.49 USD:Gatehub` to receive `10.2 XRP`. After she consumes both offers, Alice still has `5 USD` (just the issuer changed), but now has `10.2 XRP`.\nIn this case, Alice whould need to send two `OfferCreate` transactions to consume the offers.\n\nBut what if Alice spotted the exact same types.arbitrage opportunity but had no `5 USD:Gatehub` funded?\nAccording to this situation Alice's wallet would look like this:\n```mermaid\nflowchart TB\nAlice{Alice:\\n10 XRP}\n\nclassDef wallet fill:#0003ba;\nclass Alice wallet;\n```\nAlice then looks if there is a payment path available that is efficient enough, so that the types.arbitrage opportunity is still profitable. If it is the example would look like something like this:\n```mermaid\nflowchart TB\nAlice3{Alice:\\n10 XRP} --\u003e Steps((Multiple path step\\nto receive the wished\\namount of USD:Gatehub)) --\u003e Alice{Alice:\\n10 XRP\\n5 USD:Gatehub} --\u003e XRPUSDB[XRP/USD:Bitstamp\\n0.50 USD] --\u003e Alice1{Alice:\\n5 USD:Bitstamp\\n5 USD:Gatehub} --\u003e XRPUSDG[XRP/USD:Gatehub\\n0.49 USD] --\u003e Alice2{Alice:\\n10.2 XRP\\n5 USD:Bitstamp}\n\nclassDef wallet fill:#0003ba;\nclassDef buyOrderBook fill:#3e8a2f;\nclassDef sellOrderBook fill:#a60202;\n\nclass Alice,Alice1,Alice2,Alice3 wallet;\nclass XRPUSDB buyOrderBook;\nclass XRPUSDG sellOrderBook;\n```\n\n#### 1.2 Triangular types.arbitrage\nThis type of types.arbitrage is similar to the simple type of cross exchange types.arbitrage. As the name already suggest's, this type trades 3 assets against each other. This type has the advantage that we are monitoring more possibilities to find a profitable types.arbitrage opportunity.\nHere is a simple example how a triangular opportunity could look like:\n```mermaid\nflowchart TB\nAlice{Alice:\\n10 XRP} --\u003e xrpusd[XRP/USD:Gatehub\\n0.50 USD] --\u003e Alice1{Alice:\\n5 USD:Gatehub} --\u003e usdeur[USD:Gatehub/EUR:Bitstamp\\n1.10 EUR] --\u003e Alice2{Alice:\\n5.50 EUR:Bitstamp} --\u003e eurxrp[EUR:Gatehub/XRP\\n1.85 XRP] --\u003e Alice3{Alice:\\n10.2 XRP}\n\nclassDef wallet fill:#0003ba;\nclassDef orderBook fill:#3e8a2f;\n\nclass Alice,Alice1,Alice2,Alice3 wallet;\nclass xrpusd,usdeur,usdeur,eurxrp orderBook;\n```\n\n### Market making\n\n---\n## Setup\n## Usage\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimpidcrypto%2Fxrpl-trading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flimpidcrypto%2Fxrpl-trading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flimpidcrypto%2Fxrpl-trading/lists"}