Code Monkey home page Code Monkey logo

dextra.jl's Introduction

DEXTra.jl

DEXTra.jl is a Julia package for routing and optimizing asset transfers on realistic networks of decentralized exchanges (DEXs).

!!! warning This package is still under development and the API is subject to change.

Since each DEX has an independent calculation of slippage and fees, an exact solution for the optimal route is likely to be intractable. Instead, we use a heuristic approach to find a good solution in a reasonable amount of time.

Key Features

Our code combines two methods for optimizing asset transfers on DEXs:

  1. A coincidence of wants algorithm resolves all the required transfers on a single block. This is often the most cost-effective solution since it avoids the fees and slippage incurred by routing through one or more DEXs.

  2. An optimization algorithm that considers the price impact of different pathways through the network and reports the best combination of paths to minimize the total cost of the transfer. Note that due to increased slippage observed for large transfers, it is often advantageous to split a large transfer along multiple trading paths.

Terminology

  • DEX: A decentralized exchange is a protocol that allows users to trade assets without a central counterparty. The most popular DEXs are Uniswap, Sushiswap, and Balancer.

  • Liquidity Pool: A liquidity pool is a collection of some cryptocurrency that is tendered to a DEX to facilitate trading.
    In principle, there is a shared liquidity pool for all assets of one type (e.g. all ETH).
    In practice, some DEXs may have multiple liquidity pools for each asset pair (e.g. ETH/USDC). We will use both of these definitions in our code depending on what we are trying to do.

  • Coincidence of Wants: A coincidence of wants is a situation where two users have assets that they want to trade with each other. In this case, the two users can trade directly with each other without routing through a DEX.

Development Plans

  • Level graph -> weighted graph -> optimizer pipeline
  • Standardize output API
  • COW algorithm
  • Reading DEX data from Mongodb.
  • Notebook tutorials a la JuliaGraphsTutorials.

Developers

DEXTra.jl is developed and maintained by Jimmy-Xuan Shen (@jmmshn) with discussion and input from: - Jesper T. Kristensen - Juan Pablo Madrigal Cianci - Giorgos Felekis

dextra.jl's People

Contributors

jmmshn avatar

Stargazers

 avatar

Watchers

 avatar  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.