Skip to content

pgr866/TriangularArbitrage

Repository files navigation

Triangular Arbitrage in Rust (MEXC)

🔄 Generate Cargo.lock

Run this once to generate or update your Cargo.lock using Docker:

docker build -f Dockerfile.lockgen -t lockgen . && docker run -d --name lockgen-container lockgen tail -f /dev/null && docker cp lockgen-container:/app/Cargo.lock ./Cargo.lock && docker rm -f lockgen-container && docker rmi lockgen

🧪 Development

To build and run the project interactively using Docker (with live code volume):

docker build -f Dockerfile.dev -t main . && docker run --rm -it -v "$(pwd):/app" main

This allows you to iterate quickly during development.

🚀 Production

🧱 Generate the static binary executable

docker build -f Dockerfile.binaryextract -t binarygen . && docker run -d --name binary-container binarygen tail -f /dev/null && docker cp binary-container:/app/target/x86_64-unknown-linux-musl/release/main ./main && docker rm -f binary-container && docker rmi binarygen

✅ Run the binary (Linux/Mac)

Make the file executable and run it in the background, saving output to a log file:

sudo chmod +x main && ./main > logs.txt 2>&1 & disown

Then, monitor the log file in real time:

tail -f logs.txt

Make sure .env is in the same directory. dotenv() loads .env from the working directory.

🐳 Run with Docker (for Windows or isolation)

docker build -t main . && docker run --rm --env-file .env main

This ensures environment variables are passed to the container even if .env isn't loaded natively by the executable.

🖥️ Recommended VM

Microsoft Azure - Standard B2ats v2 (2 vCPUs, 1 GiB memory)

Best Regions:

  • (Asia Pacific) East Asia: 48 ms <== (possibly Hong Kong)
  • (Asia Pacific) Japan East: 50 ms
  • (Asia Pacific) Korea Central: 51 ms
  • (Asia Pacific) Southeast Asia: 76 ms

💰 $9.56/month

  • Securely copies main and .env to the remote server's home directory via SSH:
scp "C:\WORKSPACES\TriangularArbitrage\main" "C:\WORKSPACES\TriangularArbitrage\.env" azureuser@20.205.131.172:~
  • Then connect to the VM via SSH:
ssh azureuser@20.205.131.172

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published