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.
No preprocessing is needed. To build the project:
mkdir build
cd build
cmake ..
makeChoose 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.pyrun_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.
# 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 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.