Live Trading

Live trading adds two boundaries to a strategy: an exchange account and an executor. Begin with read-only market data, use an exchange sandbox where available, and grant only the permissions required by the application.

Declare an account

#include <aurum/venue/okx.hpp>

auto account = venue::okx::Account("trading", TRADE);

bind<Datafeed>(venue::okx::Bar("BTCUSDT", "1m"));
auto executor =
    bind<device::BoundExecutor>(venue::okx::Executor(account));

The account name is also the default credential reference.

Store credentials

Create $AURUM_HOME/secrets/okx-live.toml with owner-only permissions:

[[accounts]]
venue = "okx"
name = "trading"
permissions = "READ,TRADE"
api_key = "..."
api_secret = "..."
passphrase = "..."
mkdir -p "$AURUM_HOME/secrets"
chmod 700 "$AURUM_HOME/secrets"
chmod 600 "$AURUM_HOME/secrets/okx-live.toml"
aurum run . --auth okx-live

Alternatively, pass an explicit absolute file URI:

aurum run . --auth file:///secure/path/okx-live.toml

Never place credentials in the strategy source, deployment archive, or shell history.

Release controls

Before a production push:

  • increment the project version;

  • verify the intended account and permission set;

  • handle accepted, rejected, partially filled, filled, canceled, and timeout outcomes;

  • define position and notional limits;

  • confirm logs and runtime health in a paper run;

  • keep a known-good version available for rollback.

Continue with Deploy a Project for remote delivery and Projects for lifecycle operations.