Skip to content

hyper-lp/back

Repository files navigation

HyperX

1st Place Winner - Hyperliquid Community Hackathon

Delta-neutral yield infrastructure on Hyperliquid. Rust keepers + Solidity vaults for automated LP management with perpetual hedging.

Overview

HyperX provides automated liquidity provisioning on HyperEVM DEXs (HyperSwap, ProjectX) while maintaining delta neutrality through perpetual short positions on HyperCore.

Strategy:

  • Concentrated LP positions (HYPE/USDT) on Uniswap V3-style DEXs
  • Perpetual shorts to hedge HYPE exposure
  • Automated rebalancing when positions drift out of range
  • ERC-7540 vault contracts for user deposits/withdrawals

Architecture

┌─────────────────────────────────────────────────────────────────┐
│                         HyperX System                           │
├─────────────────────────────────────────────────────────────────┤
│  Rust Keepers (off-chain)           Solidity Vaults (on-chain) │
│  ├── lprebal  - LP rebalancing      ├── Delta-Neutral Vault    │
│  ├── lpperp   - Perp hedging        └── ERC-7540 shares        │
│  ├── hdperp   - Hyperdrive keeper                              │
│  └── v7540/*  - Vault operations                               │
├─────────────────────────────────────────────────────────────────┤
│  HyperEVM (LP positions)  ←→  HyperCore (Perps + Spot)         │
└─────────────────────────────────────────────────────────────────┘

Quick Start

Prerequisites

  • Rust 1.75+
  • Foundry (for Solidity contracts)
  • Docker (optional)

Setup

# Clone and configure
cp config/.env.ex config/.env
cp config/main.demo.toml config/main.toml

# Edit config/.env with your keys
# Edit config/main.toml with your vault addresses

Run

# Development
cargo run --bin lprebal

# Production
cargo build --release --bin lprebal
./target/release/lprebal

Docker

docker compose up --build

Project Structure

src/
├── keepers/           # Keeper binaries
│   ├── lprebal.rs     # LP rebalancing keeper
│   ├── lpperp.rs      # Perpetual hedging keeper
│   ├── hdperp.rs      # Hyperdrive keeper
│   └── v7540/         # ERC-7540 vault keepers
└── shd/               # Core library
    ├── core/          # Blockchain interaction
    ├── types/         # Data structures
    └── misc/          # Utilities

sol/                   # Solidity contracts (Foundry)
├── src/               # Contract source
└── test/              # Contract tests

config/
├── main.toml          # Network and vault config
└── .env               # Secrets (gitignored)

Configuration

Environment Variables

# config/.env
PRIVATE_KEY=0x...              # Wallet private key
DATABASE_URL=...               # PostgreSQL connection
TELEGRAM_MONITOR_MSG_TOKEN=... # Notifications (optional)

Vault Configuration

# config/main.toml
[[tracking]]
vault_name = "alpha"
address = "0x..."
monitor_dex = "hyperswap"
lp_target_range_bps = 1500           # ±15% LP range
rebalance_trigger_deviation_bps = 500 # Rebalance at 5% drift

Commands

Command Description
cargo run --bin lprebal Run LP rebalancer
cargo test -- --nocapture Run tests
cargo fmt Format code
cd sol && forge test Test contracts
cd sol && forge build Build contracts

Networks

  • HyperEVM: https://rpc.hyperliquid.xyz/evm
  • Explorer: https://hyperevmscan.io
  • Supported DEXs: HyperSwap, ProjectX

License

MIT

Links

About

Delta-neutral yield infra on Hyperliquid.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors