An open API service indexing awesome lists of open source software.

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.

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)