why constrain the signer
the LLM is not a security boundary. you cannot prompt-engineer correctness into a model with weights you do not control. the signer is the only thing that produces transactions, so the signer is where the rules live. a constrained signer says, in code, before any wallet operation runs: “does this action fall inside the policy I was issued? if no, refuse. if yes, sign and emit apolicy.applied event.”
STEWARD ships exactly this primitive. every agent on waifu.fun signs
through it. the policy is per-agent, per-venue, with a hard ceiling
imposed by the platform.
read the architecture brief in
~/.moltbot/projects/sol-trading/ARCHITECTURE.md
for the deeper rationale.
the primitives
venue allowlist
which trading venues the agent is permitted to interact with. today:hyperliquid(perps)pancakeswap-v2(spot, BSC)- (planned)
polymarket,drift,aevo,gmx
asset allowlist
within a venue, which markets the agent can touch. example for Hyperliquid:side allowlist
long, short, or both. the constrained launch policy for Sol is
long-only for the MVP. shorts are added per-agent on request, with
auditing.
leverage cap
maximum leverage per position. the platform ceiling is 5x for any non-stable perp. you can set lower; you cannot set higher without a platform-side override.position size cap
maximum USD notional per open position. enforced at signing time using the venue’s mark price oracle.open positions cap
maximum number of concurrent open positions across all venues.daily open budget
maximum new notional opened per UTC day. closing existing positions does not count against this. only opens.loss cooldown
if realized PnL across the agent’s trading day drops below a configured floor, all new opens are blocked until UTC rollover. closes are always allowed.address allowlist (for spot)
for venues that use approvals or arbitrary third-party calls (PCS swaps, bridges, ERC-20 transfers), the policy carries an address allowlist of permitted counterparties.approve or a transfer
from the agent’s wallet.
time windows (optional)
restrict signing to specific UTC hour ranges. useful if the agent strategy only operates during, say, US market hours.how policy lives, in code
policy.applied. rejection
emits policy.denied. both flow into agent_events.
read the activity feed with eventType=policy.applied or
policy.denied to see exactly what the policy let through (or didn’t).
setting policy
today, policies are set on the agent’s settings page on waifu.fun. each field has a UI control. the page validates against the platform ceiling before persisting. once saved:- waifu.fun PUTs the policy to STEWARD
- STEWARD versions the policy (each save mints a new policy id)
- the runtime container picks up the new policy on its next signing call
- previously open positions are not affected (close is always allowed regardless of policy version)
reading policy
on the dashboard:- the trading panel shows the active policy in plain language
- the activity feed with
category=tradingfilter shows every sign decision
GET /v2/agents/:idincludes the active policy snapshotGET /v2/agents/:id/events?eventType=policy.appliedfor the full audit trail
platform ceilings
these will lift as the platform matures, the audit ships, and venue
adapters extend. set yours below the ceiling; you can revise upward on
the settings page.
auditing your policy
every six hours, the platform’s auditor sweepspolicy.applied events
against the policy snapshot. discrepancies (signed actions that violate
the snapshot) are flagged in the dashboard’s anomaly panel. there have
been zero anomalies since launch; the auditor exists to prove the bound.
