Giter Site home page Giter Site logo

takec0418 / solana-arbitrage-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 0xnineteen/solana-arbitrage-bot

0.0 0.0 0.0 1.96 MB

solana arbitrage bot across multiple spot dexs

License: MIT License

Shell 0.68% Python 0.52% Rust 77.36% TypeScript 21.44%

solana-arbitrage-bot's Introduction

solana arbitrage bot

happy searching :)

layout

  • client/: off-chain arbitrage bot code
  • program/: on-chain swap program
  • pools/: dex pool metadata
  • onchain-data/: analysis of other arbitrage swaps
  • mainnet-fork/: fork mainnet account states to test swap input/output estimates

each folder contains a corresponding README.md which explains how it works

dexs supported

  • serum
  • aldrin
  • saber
  • mercurial
  • orca

other notes

  • we use rust unit tests (with mainnet forking) to ensure our swap quotes are correct (quoted swap amount = actual swap amount)
  • to figure out how to interface with each dex (most dont have rust sdks or even public ts sdks) we reverse engineer how to interact with them through the jupiter-swap sdk (analyzing the npm package folder bc its also not public)
  • in the client we use a brute-force approach to find arb opportunities instead of negative cycle algos bc its much faster and can find all opportunities
  • we also dont calculate the optimal swap input amount for each arb bc its faster to spam multiple decreasing amounts and let the largest one land (this is what the winner of the arbitrage opportunities was doing - eg, send tx with input size N, N/2, N/4, ...)
  • why do we need an on-chain swap program? checkout this post out -- if you swap from A -> B -> C you might get more/less of B than expected which effects the swap instruction to C

why share this alpha

the life of a lone searcher is a lonely one where you cant share what you find or share your code - while working on this project i realized this is not what im about and thus i open source

solana-arbitrage-bot's People

Contributors

0xnineteen avatar 0xedgar avatar

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.