Expand description
Β§hft-optimus
LLM-driven high-frequency trading platform on Solana, built on Rig (ARC) - the Rust Inference Gateway.
Combines agentic LLM pipelines with on-chain DeFi execution on Solana,
enabling statefully supervised, multi-step agent workflows with full PEV
loop governance.
mAI (π§ ) Β· Technology Lead: Murtaza Ali Imtiaz (July 2019 β present)
Β§Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β hft-optimus β
ββββββββββββ¬βββββββββββ¬ββββββββββββ¬ββββββββββ¬βββββββββββ€
β pev β sor β onchain β avm β config β
β Plan β β Smart β Jupiter β AVM β Env β
β Executeββ Order β swap + β bench- β loader β
β Verify β Routing β Signer β mark β β
ββββββββββββ΄βββββββββββ΄ββββββββββββ΄ββββββββββ΄βββββββββββΒ§Full pipeline
- PEV loop (
pev) - Haiku decomposes the trade into fourpev::types::TradeTaskobjects; Sonnet executes each one using tool calls; Haiku verifies the output (pass β₯ 0.80). Up to two retries on failure. - SOR (
sor) - Raydium, Orca, and Serum are queried concurrently; the lowest cost-adjusted venue wins. - On-chain (
onchain) - Jupiter swap is simulated (dry-run by default) inside an isolatedonchain::signer::LocalSolanaSignercontext. - AVM audit (
avm) - Reactor GUI audit log records state-before, execution details, and state-after for every swap.
Β§Quick start
cp .env.example .env # set ANTHROPIC_API_KEY (optional - stub mode works without it)
cargo run --release -- --mode full --pair SOL/USDC --amount 1.0Β§Offline / stub mode
All subsystems work without an ANTHROPIC_API_KEY. When a key is absent
(or --skip-llm is passed), every PEV phase substitutes a deterministic
offline stub:
SKIP_LLM=1 cargo run --release -- --mode fullΒ§Feature flags
This crate has no optional feature flags. All subsystems are always compiled.
Β§Crate status
The venue adapters (raydium.rs, orca.rs, serum.rs) and the balance
query helpers (balance.rs, types.rs in onchain) are documented stubs
awaiting real SDK integration. The PEV loop, SOR router, SignerContext,
Jupiter dry-run simulation, and AVM benchmark are fully implemented.