Git Product home page Git Product logo

xrpl-trading-bot's Introduction

ARCHIVED

This repo is archived. Some day it will come back better :) Keep an eye on https://github.com/LimpidCrypto/xrpl-trading ๐Ÿ‘€

Warning ๐Ÿšจ

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!!!

Main tasks:

  • Get it running
      • Build trading paths
        • Spatial Arbitrage
        • Triangular Arbitrage
        • Market Maker
    • Determine which trade would be the most profitable
    • Build OfferCreate transactions
    • Sign transactions
    • Submit transactions
  • Add support for Tangem wallet
  • First release

XRPL-trading-bot

A trading bot that uses the decentralized exchange of the XRP Ledger. It uses arbitrage trading and market making to make profit.

๐Ÿ“– Basics:

  • The XRP Ledger has the world's first decentralized exchange (DEX).
  • Orders on the DEX are called Offers.
  • This bot only sends 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.
  • Arbitrage trading and market making are not known to make huge profits. There are known to make profits with low risk.

๐Ÿ“ˆ Trading types:

๐Ÿ’ฑ Arbitrage Trading

The arbitrage trading bot takes advantage of the price differences in different liquid order books to make profit.

Types:
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
Example:

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 Maker

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.

Example:

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.

Footnotes

  1. not determined yet โ†ฉ

  2. quoted spread = (52 $ - 50 $) / 51 $ * 100 ((ask - bid) / midpoint * 100) โ†ฉ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.