MCPcopy Index your code
hub / github.com/blockworks-foundation/autobahn

github.com/blockworks-foundation/autobahn @executor-v1.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release executor-v1.1.0 ↗ · + Follow
993 symbols 2,500 edges 191 files 52 documented · 5% 7 cross-repo links updated 15mo agoexecutor-v1.0.1 · 2024-10-14★ 3736 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Fill.city Autobahn

logo

Autobahn is the open source aggregator for swaps on Solana. This public good protocol enables developers to contribute their own DEX adapters. Take back control: access to orderflow from routers on Solana should not be centralized.

The graph search is optimized for reliability of trade execution. Reliability is preferred over marginal price to improve user experience. Full test coverage through daily verification of all routed pools ensures correctness.

A hosted version is available. Reach out to partnerships@mango.markets to get an access token. Self-hosting requires custom validator patches to enable low-latency account subscriptions.

Using the router (as a client)

Basically it is the same API as Jupiter: https://autobahn.mngo.cloud/<TOKEN>/

quote (GET)

Supported parameters: - inputMint - outputMint - amount - slippageBps - maxAccounts - onlyDirectRoutes

swap & swap-instructions (POST)

Supported parameters:

  • userPublicKey
  • wrapAndUnwrapSol
  • autoCreateOutAta
  • quoteResponse

Running the router

See example configuration file example-config.toml to create your own setup

Run like this:

RUST_LOG=info router my_config.toml

Creating a new DEX Adapter

Adding new DEX adapter is welcome, you can do a pull-request, it will be appreciated !

See CreatingAnAdapter.MD file for details.

Integration testing

It's possible to dump data from mainnet, and then use that in tests: - To assert quoting is correct (same result as simulated swap) - To check router path finding perfomance

See Testing.MD file for details.

There's a script for daily smoke tests:

RPC_HTTP_URL=... ./scripts/smoke-test.sh

Tokio-Console

Build router with feature tokio-console and RUSTFLAGS="--cfg tokio_unstable" like this:

RUSTFLAGS="--cfg tokio_unstable" cargo build --bin router --release --features tokio-console

And use the tokio-console crate to display running tasks

License

Autobahn is published under GNU Affero General Public License v3.0. In case you are interested in an alternative license please reach out to partnerships@mango.markets

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Method 430
Function 339
Class 184
Enum 21
Interface 19

Languages

Rust100%

Modules by API surface

bin/autobahn-router/src/routing.rs54 symbols
bin/autobahn-router/src/ix_builder.rs33 symbols
lib/dex-raydium/src/internal/state.rs30 symbols
lib/dex-invariant/src/internal/invariant-types/src/math.rs27 symbols
programs/simulator/tests/cases/test_swap_from_dump.rs25 symbols
lib/dex-invariant/src/invariant_dex.rs22 symbols
lib/dex-invariant/src/internal/invariant-types/src/decimals.rs21 symbols
bin/autobahn-router/src/edge.rs21 symbols
lib/dex-orca/src/orca_dex.rs20 symbols
lib/dex-invariant/src/internal/invariant-types/src/utils.rs20 symbols
lib/router-config-lib/src/lib.rs19 symbols
lib/dex-invariant/src/internal/invariant-types/src/structs/tickmap.rs19 symbols

For agents

$ claude mcp add autobahn \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page