Skip to content

Xtra-Computing/ORDER

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ORDER: Optimal Routing in Financial Exchange Graphs

This repo implements ORDER (Optimal Routing with path inDexing in Exchange gRaphs), a high-efficiency routing solution for real-time decision-making in financial exchange networks.

About

We study the problem of optimal routing on financial exchange graphs. Given a directed graph where vertices represent assets and edges encode tradable pairs with exchange rates and capacities, the goal is to find a sequence of routes that maximizes the delivered output.

ORDER introduces a hierarchical bucket path index with lazy computation and adaptive controller. It demonstrates robustness across different market regimes and exchange pairs, enabling timely, high-quality routing under fragmented liquidity and tight capacity constraints.

Build Instructions

  1. Create a Build Directory:

    cd code
    mkdir build
  2. Navigate to the Build Directory:

    cd build
  3. Run CMake:

    cmake ..
  4. Compile the Project:

    make

After compilation, the executable files will be available in the build directory.

Usage

1. Two Bucket Adaptive K Algorithm

This algorithm uses two buckets with adaptive k value adjustment.

Usage:

build/rerank_two_bucket_adaptive_k <edge_group_dir> <total_amount> <output_dir>

Example:

build/rerank_two_bucket_adaptive_k cpp_graph/1_3 100 output_results

Parameters:

  • edge_group_dir: Directory containing edge group files and paths.txt
  • total_amount: Total amount/capacity to route
  • output_dir: Directory where results will be saved

2. Multi Bucket Fixed K Algorithm

This algorithm uses multiple buckets with a fixed k value that you specify.

Usage:

build/rerank_multi_bucket_fixed_k <edge_group_dir> <total_amount> <output_dir> <initial_k>

Example:

build/rerank_multi_bucket_fixed_k cpp_graph/1_3 1000 output_results 10

Parameters:

  • edge_group_dir: Directory containing edge group files and paths.txt
  • total_amount: Total amount/capacity to route
  • output_dir: Directory where results will be saved
  • initial_k: K value for the algorithm

3. Multi Bucket Adaptive K Algorithm

This algorithm uses multiple buckets with adaptive k value adjustment.

Usage:

build/rerank_multi_bucket_adaptive_k <edge_group_dir> <total_amount> <output_dir>

Example:

build/rerank_multi_bucket_adaptive_k cpp_graph/1_3 100 output_results

Parameters:

  • edge_group_dir: Directory containing edge group files and paths.txt
  • total_amount: Total amount/capacity to route
  • output_dir: Directory where results will be saved

Output Files

Each algorithm generates the following output files in the specified output directory:

  • summary.txt: Contains algorithm statistics, performance metrics, and k value history
  • details.txt: Contains detailed path selection information for each round

Disclaimer

ORDER is provided for academic research only. It must not be used in live trading without thorough risk, compliance, and security review. Real-world deployment carries significant hazards—including slippage, MEV, adverse selection, chain reorgs, and confirmation delays—that require robust controls and governance.

About

[SIGMOD'26] ORDER: Optimal Routing with Path Indexing in Exchange Graph

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages