Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/udayj/dex-aggregator
Lightweight Dex Aggregator for Jediswap v1 pools
https://github.com/udayj/dex-aggregator
rust rust-lang starknet starknet-ecosystem
Last synced: 15 days ago
JSON representation
Lightweight Dex Aggregator for Jediswap v1 pools
- Host: GitHub
- URL: https://github.com/udayj/dex-aggregator
- Owner: udayj
- Created: 2024-10-28T18:05:13.000Z (23 days ago)
- Default Branch: main
- Last Pushed: 2024-11-04T15:54:07.000Z (16 days ago)
- Last Synced: 2024-11-04T16:44:03.375Z (16 days ago)
- Topics: rust, rust-lang, starknet, starknet-ecosystem
- Language: Rust
- Homepage:
- Size: 629 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Dex Aggregator for Jediswap v1 pools
This is a lightweight dex aggregator. It exposes a simple REST based API service to get trade quotes for a token pair and manage the underlying datastore.
To compile `cargo build --release` (using rust version 1.80.0)
To run `cargo run --release` - dex_config.toml holds configurable values
Server will be available at http://localhost:3000
Sample query to get [trade quotes](http://localhost:3000/quotes?sellTokenAddress=0x53c91253bc9682c04929ca02ed00b3e423f6710d2ee7e0d5ebb06f3ecf368a8&buyTokenAddress=0x4718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d&sellAmount=10000000000&getLatest=true) -
The `getLatest` query parameter lets you use pre indexed data (if false or not present) and get latest reserves data (if true)Open Api Docs available at http://localhost:3000/api-docs/openapi.json
Swagger UI available at http://localhost:3000/swagger-ui/
The basic idea is to find all possible paths to trade between a token pair and then do gradient optimisation to optimise an objective function - maximise output when given an input amount and minimise input when given an output amount. Ref [here](https://github.com/udayj/dex-aggregator/tree/main/notes) for some math notes.