This repository now includes a reference implementation of a delta-neutral volume bot that interacts with the Aster futures API. The bot opens offsetting positions across two accounts to safely generate trading volume while keeping net exposure close to zero.
- REST client implementing the authentication workflow described in the official documentation, including leverage and margin management endpoints.
- Hedged trading cycles that open and close positions on paired accounts, tracking filled trades and commissions for each cycle.
- Persistent status file for terminal monitoring of cumulative volume and fees.
- Dry-run mode for safely testing the strategy without hitting the live API.
-
Create and activate a Python 3.10+ environment.
-
Install dependencies:
pip install -r requirements.txt
All runtime settings live in a single configuration file—no command-line overrides are required. Copy the provided example and fill in the credentials for your paired accounts:
cp bot-config.example.yaml my-config.yaml
Update the new file with your API keys and desired bot parameters. The
bot-config.example.yaml
file is heavily documented and lists every supported
option, including:
symbol
,order_value
(in quote currency),leverage
, andmargin_type
for each cycle. If you prefer to size orders by base asset instead, you can still supplyorder_quantity
.- Risk controls such as
target_volume
,hold_seconds
, andmax_cycles
. - Output settings such as
status_file
andstatus_update_interval_minutes
(defaults to 60 minutes).
Start the bot from the terminal and point it at your configuration file. Logs remain in the console with color-coded summaries so you can watch each hedge cycle, filled notional, and cumulative fees at a glance.
python volume_bot.py run --config my-config.yaml -vv
The bot only writes to the status file at the configured interval (e.g. once per hour by default). To inspect the most recent snapshot, use the status helper:
python volume_bot.py status --status-file bot_status.json
Run the automated tests with pytest
:
pytest