Skip to content

Xtra-Computing/TRADER

Repository files navigation

TRADER

TRADER is an efficient, incremental algorithm for real-time arbitrage detection in streaming transaction graphs, designed for decentralized finance (DeFi) and other high-frequency trading scenarios. Unlike existing approaches that require expensive recomputation on static snapshots, TRADER leverages dynamic programming and localized updates to identify negative cycles (arbitrage opportunities) as soon as new data arrives. The system supports both incremental and batch edge updates, and features an edge grouping strategy to maximize speed and scalability.

Getting Started

1. Build

No preprocessing is needed. To build the project:

mkdir build
cd build
cmake ..
make

2. Running Experiments

Choose your update mode and run the appropriate Python script. Paths are now configurable via CLI flags and default to project-relative locations:

  • Incremental Edge Update

    python run_experiments.py
    # Example with custom paths:
    # python run_experiments.py --processed-data-dir ./dynamic_graph_data/processed_graph_data_new --seeds-file ./seeds.txt
  • Batch Edge Update

    python run_experiments_in_batchs.py
  • Edge Grouping Update

    python run_experiments_auto_batch.py

Generate seeds for experiments (optional, for reproducibility):

python generate_seeds.py

Repository Contents

  • run_experiments.py — Main script for incremental updates.
  • run_experiments_in_batchs.py — Batch updates.
  • run_experiments_auto_batch.py — Edge grouping update.
  • generate_seeds.py — Generate reproducible seeds.
  • dynamic_cycle_detection/ — Source code for the TRADER algorithm.
  • dynamic_graph_data/ — Example datasets.

Usage Example

# Build
mkdir build && cd build && cmake .. && make

# Incremental mode
python run_experiments.py 

# Batch mode
python run_experiments_in_batchs.py 

# Edge grouping
python run_experiments_auto_batch.py 

Disclaimer

TRADER is developed for academic research purposes only. Any deployment in production or real trading must comply with applicable regulations and consider risks such as slippage, execution delays, and market volatility. Use at your own risk.

About

[ICDE' 26] Real-time Arbitrage Detection via Negative Cycles on Dynamic Graphs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors