This repo is archived. Some day it will come back better :) Keep an eye on https://github.com/LimpidCrypto/xrpl-trading π
This repository is in active development and is not working yet. The bot currently requires you to put in your seed value via terminal. It is planned to use the Tangem wallet in the future so you will never be required to give away your secrets. At the current stage I would never use a bot like this, even if it should work!
- NEVER GIVE AWAY YOUR SECRETS!!!
OfferCreate
transactionsA trading bot that uses the decentralized exchange of the XRP Ledger. It uses arbitrage trading and market making to make profit.
decentralized exchange
(DEX
).DEX
are called Offers
.OfferCreate
transactions with the Immediate or cancel flag to the ledger.Offers
consume other Offers
in an order book. For example if you want to buy a currency you place a bid Offer
that consumes an ask Offer
that has the same or a better price than the bid Offer
.The arbitrage trading bot takes advantage of the price differences in different liquid order books to make profit.
Basic Spatial Arbitrage | Triangular Arbitrage |
---|---|
1. Order: USD.r1 > BTC.r1 | 1. Order: USD.r1 > BTC.r1 |
2. Order: BTC.r2 > USD.r2 | 2. Order: BTC.r2 > ETH.r1 |
3. Order: ETH.r2 > USD.r2 |
The bot places an immediate or cancel offer that trades 10 USD.r1 for 9 EUR.r1. The bot then places a second immediate or cancel offer that trades 9 EUR.r2 for 11 USD.r2. The profit for this trade is 1 USD. Neither the TakerGets
nor the TakerPays
issuers have to be the same for both trades. All four issuers can be completely different. Doing so brings the most flexibility.
The bot only trades liquid order books and adjusts all Offer
values from the lowest TakerGets
balance.
Market makers provide liquidity to a market. Place a buy and a sell order on the tip of a illiquid order book. The spread the two orders has to be big enough to cover the potential transfer fees. The market maker bot only trades illiquid order books, where %[^1] of the orders have been consumed in the last 2 weeks.
The order books most expensive bid order has a price of 50 $ and the cheapest ask order price is 52 $, so the spread is 3.85 %[^2].
The bot then calculates what prices it needs to place the orders at to cover the transfer fees and still be profitable while minimize the current spread of 3.85 %. It aims to provide a spread of 0.5 %. If one or both orders are not fulfilled after a week the orders will get canceled automatically.
[^1]: not determined yet [^2]: quoted spread = (52 $ - 50 $) / 51 $ 100 ((ask - bid) / midpoint 100)