← BASTIONΠΥΡΓΟΣ · THE LIBRARY

Documentation

Bastion v0.4 — autonomous, verifiable AI fund on Robinhood Chain
InstallQuick startConfiguration ArchitectureThe councilRisk kernel Verifiable reasoningProvidersSurfaces
Auditable beats autonomous. An agent that cannot show its evidence trail is a demo, not infrastructure.

Installation

One line on macOS / Linux — installs the native binary via cargo (or builds from source if Node is present):

curl -fsSL https://bastiontrade.xyz/install.sh | bash

Or build the Rust binary directly:

cargo install --git https://github.com/adrydevel/bastion-rs bastion-rs

Windows (PowerShell):

powershell -Command "irm https://bastiontrade.xyz/install.ps1 | iex"

Quick start

Run one full research → debate → size → execute → prove pass. No keys are required for the demo pass:

bastion run --ticker NVDA
you ▸ trade tokenized NVDA on Robinhood Chain, 2% risk, prove it
bastion ▸ swarm: research → debate → size → execute → prove
  ▸ quorum  5 agents · consensus long
  ▸ size    Kelly 0.18 · CVaR pass · cleared
  ▸ exec    long NVDA-x · $1,200 @ market
  ▸ prove   reasoning hashed · attested on-chain
bastion ▸ done. verified — not assumed.

Configuration

Everything is configurable from the CLI or a local config file. Keys stay on your disk and are never uploaded.

KeyDefaultWhat it does
providerhermesReasoning runtime. Nous Research Hermes by default; any OpenAI-compatible endpoint works.
universeNVDA, AAPL, GOOG…Tokenized stocks the swarm may trade.
quorum3Votes required before capital moves.
maxKelly0.25Cap on fractional-Kelly position size.
cvarLimit0.08Tail-risk (expected shortfall) ceiling.
maxDrawdown0.15Drawdown that trips the circuit-breaker.
attestOnchaintrueAnchor a proof of every decision on Robinhood Chain.

Point the runtime at any provider with environment variables:

BASTION_BASE_URL=https://inference-api.nousresearch.com/v1
BASTION_API_KEY=nous-…

Architecture

One pass over a market frame flows through six layers:

oracle quote ─▶ regime detector ─▶ council debate ─▶ risk kernel ─▶ proof ─▶ execute
                     │                   │                │            │
                  bandit             5 agents         Kelly/CVaR    keccak256
                 (strategy)        quorum vote       circuit-break  + anchor
LayerResponsibility
RegimeClassify trend / chop / high-volatility from the oracle series.
AllocationThompson-sampling bandit shifts capital toward what is working now.
CouncilFive agents opine independently; a quorum decides.
RiskKelly sizing, CVaR cap, drawdown circuit-breaker.
MemoryRecall similar past states and post-mortems.
ProofHash the decision, anchor it on Robinhood Chain.

The council

No single agent can move capital — a quorum moves it, or the desk stays flat.

AgentRole
AnalystReads price structure and trend on the tokenized-stock oracle.
SentimentWeighs news and social flow around the underlying equity.
RiskArgues the downside: liquidity, gap risk, correlation to the book.
ContrarianActively tries to refute the emerging consensus.
ExecutorJudges fill quality, slippage, and whether the edge survives costs.

Risk kernel

Deterministic and inspectable. Position size is half-Kelly, clamped to maxKelly. Tail risk is capped by CVaR (expected shortfall). A drawdown circuit-breaker halts the fund before it bleeds past maxDrawdown.

Verifiable reasoning

Every decision — the agent votes, the feature window, the final verdict — is serialised and hashed with keccak256. The hash pair plus a timestamp is anchored on Robinhood Chain, so every trade is auditable and tamper-evident after the fact. In the hosted tier the reasoning runs inside a TEE and the enclave signs the attestation.

Providers

Reasoning runs on Nous Research Hermes by default (open-weights, OpenAI-compatible). Bring your own keys for any compatible provider — they never leave your disk, and the newest models are fetched live.

Surfaces

Terminal — the primary interface; launch the fund and watch the swarm reason and trade from one command. Discord — monitor and steer your fund, owner-gated. More surfaces coming.