Skip to main content
Sisera is architected as a modular TypeScript monorepo with independently deployable applications (apps/web, apps/api, mobile) and framework-neutral domain packages (packages/*).

High-Level Topology


Monorepo Package Boundaries


The Six Architectural Invariants

Every code path in Sisera enforces six non-negotiable invariants:
Both paper and live orders—whether initiated manually by a human, triggered by an armed policy, or proposed by an autonomous agent—must pass through @sisera/risk. The risk engine loads portfolio state and mandate limits server-side; clients can never supply their own risk limits in a request payload.
Every market quote carries explicit source, observedAt, receivedAt, and quality metadata. If a reference feed (such as Pyth Core) or venue quote is stale or degraded, execution fails closed immediately.
Language models are strictly confined to narrating corroborated evidence and translating natural-language user prompts into candidate policy structures. Only deterministically validated domain commands may enter the order state machine.
Autonomous agents run inside isolated evaluation contexts with hard capital, notional, and leverage caps. An agent never holds wallet keys or invokes a venue adapter directly; it emits a structured proposal that is evaluated by the policy and pre-trade risk engines.
When an upstream provider is unreachable or an asset lacks a verified reference price, Sisera returns an explicit unavailable state and excludes unpriced positions from NAV rather than inventing or interpolating synthetic numbers.
Every execution decision records the exact actor principal, manifest or policy hash, portfolio snapshot, quote provenance, and risk evaluation reasons in append-only PostgreSQL tables. Database triggers reject mutations to activated policies and enforce evidence requirements on agent promotions.

Advisory-Locked Background Scheduler

When SISERA_SCHEDULER_ENABLED=true (default), apps/api runs four coordinated background loops. Each loop acquires a PostgreSQL advisory lock, guaranteeing that even across horizontally scaled API instances, only a single leader executes each cycle: