https://github.com/arec1b0/hedged-lp-bot
A Nim-based trading bot for delta-neutral hedging of impermanent loss on Uniswap V2 using Binance perpetual futures.
https://github.com/arec1b0/hedged-lp-bot
binance defi nim perpetuals uniswap
Last synced: about 1 year ago
JSON representation
A Nim-based trading bot for delta-neutral hedging of impermanent loss on Uniswap V2 using Binance perpetual futures.
- Host: GitHub
- URL: https://github.com/arec1b0/hedged-lp-bot
- Owner: arec1b0
- License: mit
- Created: 2025-03-13T22:08:23.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T23:13:10.000Z (over 1 year ago)
- Last Synced: 2025-03-20T23:33:58.421Z (about 1 year ago)
- Topics: binance, defi, nim, perpetuals, uniswap
- Language: Nim
- Homepage: https://github.com/dkrizhanovskyi/hedged-lp-bot
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hedged Liquidity Provision Bot
A Nim-based trading bot designed to hedge impermanent loss in Uniswap V2 ETH/USDC pools by utilizing perpetual futures on Binance.
**Author:** [Daniil Krizhanovskyi](https://github.com/dkrizhanovskyi)
## Overview
The bot maintains a delta-neutral position by dynamically adjusting ETH short positions on Binance futures, aiming to mitigate impermanent loss.
## Repository Structure
```
hedged-lp-bot/
├── LICENSE
├── README.md
├── data/
│ └── sample_data.csv
├── docs/
│ └── architecture_overview.md
├── src/
│ ├── main.nim
│ ├── backtest.nim
│ ├── generate_data.nim
│ └── utils.nim
└── tests/
└── test_backtest.nim
```
## Key Features
- Delta-neutral hedging strategy
- Synthetic data generation for robust backtesting
- Comprehensive performance metrics (fees, PnL, returns)
## Quick Start
```bash
# Clone the repository
git clone https://github.com/dkrizhanovskyi/hedged-lp-bot
cd hedged-lp-bot
# Compile and run backtest
nim c -r src/main.nim
# Run unit tests
nim c -r tests/test_backtest.nim
```
## Results
Example backtest results:
```
Initial Investment: $20137.04
Final Value: $20748.52
Net Return: 3.04%
```
## Documentation
Detailed architecture and workflow can be found [here](docs/architecture_overview.md).
## Future Enhancements
- Live market data integration (Uniswap, Binance APIs)
- Advanced rebalancing strategies
- Multi-chain and multi-pool support
## License
[MIT License](LICENSE)