Skip to content

apeethsol69/variational-perp-trader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variational Perp Trader

Rule-based automated perpetual trading bot for Variational RFQ DEX on Arbitrum. Define entry conditions across 500+ markets with zero trading fees and let the bot execute, manage, and exit positions automatically.

Last updated: March 2026

What is Variational Perp Trader?

Variational Perp Trader is a systematic rule-based execution engine for Variational, the RFQ perpetual DEX on Arbitrum. With 500+ markets and zero trading fees (0.1 USDC only on deposit/withdraw), Variational is ideal for high-frequency systematic strategies where per-trade costs would otherwise erode returns.

preview_variational-perp-trader

You configure entry conditions - funding rate threshold, price momentum, open interest delta - and the bot scans all Variational markets continuously, entering positions when conditions are met. Exits are managed by take-profit, stop-loss, funding flip, or time-based rules.

Variational's 2-4% loss rebate is automatically factored into exit calculations, improving effective risk/reward on every trade.


Download

Platform Architecture Download
Windows x64 Download the latest release

Entry Rule Builder

Condition Example Description
funding_rate_threshold 0.01% Enter when funding exceeds this rate
momentum_window_min 15 Lookback in minutes for momentum signal
oi_delta_pct 5 Open interest change % to trigger entry
side LONG LONG, SHORT, or both
markets ["BTC-PERP"] Markets to monitor
max_open_positions 6 Cap on simultaneous positions

Engine Features

  • RFQ-native routing - submits quotes through Variational's RFQ system for best-price execution
  • Funding rate scanner - monitors funding across all configured markets and enters when rate is favorable
  • Momentum filter - requires price momentum confirmation before entry
  • Open interest delta - detects OI acceleration as an additional entry signal
  • Loss rebate accounting - tracks cumulative rebate credits earned (2-4% of net losses)
  • Multi-exit manager - take-profit, stop-loss, funding flip, and time-based close modes
  • Gas optimizer - batches Arbitrum transactions to minimize L2 gas overhead

Two Ways to Run It

Windows App Python Bot
Setup Double-click pip install + config
Strategy Config-based Full code access
Backtest Built-in Script-based
Config config.toml Direct code access
Logs Dashboard JSON per trade

Quick Start

# 1. Download from Releases
# 2. Edit config.toml - set your entry conditions, markets, and exit rules
# 3. Run Perp Trader - market scanning and automated trading start immediately

Python

cd variational-perp-trader/python
pip install -r requirements.txt
python variational-perp-trader-raw-v.1.4.14.py

How It Works

  1. Scan - polls all configured Variational markets for funding rate, price, and OI data
  2. Match - applies entry rule set; all conditions must pass simultaneously
  3. Execute - submits RFQ quote and opens position via Arbitrum wallet signature
  4. Monitor - tracks open positions against exit rules and closes when triggered

Config Reference

[wallet]
api_key = ""
rpc_url = "https://arb1.arbitrum.io/rpc"

[entry]
side = "both"
funding_rate_threshold = 0.01
momentum_window_min = 15
oi_delta_pct = 5.0
usd_per_position = 500
max_open_positions = 6
markets = ["BTC-PERP", "ETH-PERP", "SOL-PERP"]

[exit]
take_profit_pct = 3.0
stop_loss_pct = 1.5
funding_flip_exit = true
time_exit_hours = 12

[alerts]
telegram_bot_token = ""
telegram_chat_id = ""

Trade Log Format

{
  "trade_id": "var_perp_20260319_088",
  "market": "BTC-PERP",
  "side": "LONG",
  "entry_price": 84210.5,
  "size_usd": 500.0,
  "funding_rate_at_entry": 0.0142,
  "exit_price": 86832.3,
  "exit_type": "take_profit",
  "pnl_usd": 15.59,
  "rebate_credit_usd": 0.0,
  "gas_eth": 0.00038
}

variational perp trade result

Verified Live

Configuration used:

  • BTC-PERP LONG, funding threshold 0.01%, momentum 15-min, $500 per position
Details
Market BTC-PERP
Entry LONG at 84,210.5, $500 deployed
Funding at entry 0.0142%
Trade ID VAR-PERP-20260319-0881
Result
Exit price 86,832.3 (take-profit)
Net P&L +$15.59 on $500 (3.1% ROI)
Gas cost 0.00038 ETH

Frequently Asked Questions

What is Variational? Variational is an RFQ perpetual DEX on Arbitrum with 500+ markets. It charges zero trading fees - only 0.1 USDC per deposit/withdrawal - making it ideal for systematic rule-based strategies.

What is the loss rebate? Variational credits 2-4% of your net trading losses back to your account. The bot tracks this and factors it into effective P&L calculations on every closed position.

Does the bot support shorting? Yes. Set side = "SHORT" or "both" in your config. The funding rate scanner can be set to prefer shorts when funding is negative (shorts earn funding).

Can I backtest my rules? Yes. scripts/backtest.py replays historical Variational funding and price data against your configured rule set and returns simulated P&L.

What markets are available? Variational has 500+ perpetual markets including major crypto (BTC, ETH, SOL), altcoins, and emerging assets. The bot can monitor all of them simultaneously.

Are my API credentials safe? It is stored locally in your config file and used only for signing Arbitrum transactions. Use a dedicated trading wallet - never your main wallet.


Use Cases

  • Arbitrum perp trading - execute systematic strategies on Variational with zero fee drag
  • Funding rate arbitrage - capture funding payments on high-rate Variational markets
  • RFQ perp automation - automate RFQ-based position entry and exit on Arbitrum
  • Variational momentum bot - enter on momentum + OI confirmation, exit at take-profit
  • Zero fee perp strategy - backtest and run strategies that only work with zero trading fees

Repository Structure

variational-perp-trader/
+-- variational-perp-trader-raw-v.1.4.14.exe
+-- config.toml
+-- data/
|   +-- trades/
|   +-- logs/
|   +-- dll/
+-- python/
|   +-- src/
|   |   +-- scanner.py
|   |   +-- matcher.py
|   |   +-- executor.py
|   |   +-- exit_manager.py
|   +-- scripts/
|   |   +-- backtest.py
|   +-- requirements.txt
+-- README.md

Requirements

python-dotenv, web3, eth-account, httpx, typer[all], devtools
  • Arbitrum wallet with USDC for margin
  • Variational account (connect wallet at variational.market)
  • Telegram bot token (optional)

Rules in. Zero fees. Edge out.