Architecture
Architecture
Section titled “Architecture”DAY is an agent-native yield router: markets → route → optional Auto Yield → harvest → Auto Pay.
Not product core: vault farms / SuperVaults / “deposit into our vault.”
Brand: DAY · dayprotocol.com · Limitless Labs
Layers
Section titled “Layers”flowchart TB subgraph UserLayer["User / Agent Layer"] A[AI Agents / Characters] B[Developers / dApps] C[SDK - TypeScript / Python] end
subgraph OrchestratorLayer["Orchestrator Layer (Offchain)"] D[Orchestrator Agent] E[Decision Engine<br/>Goal-based Routing] F[Data Fetcher<br/>Discovery + adapter reads] AP[Auto Pay policy] end
subgraph OnchainLayer["Onchain Execution Layer"] subgraph Sui["Sui Chain — Phase 1 home"] G1[YieldRouter] H1[AdapterRegistry] I1[Adapters<br/>Suilend, NAVI, Scallop, …] end
subgraph Solana["Solana Chain — Phase 1 home"] G2[YieldRouter] H2[AdapterRegistry] I2[Adapters<br/>Kamino, marginfi, Jito, …] end
subgraph Base["Base — bridge-in / discovery"] G3[YieldRouter later] H3[AdapterRegistry] I3[Adapters later<br/>Morpho, Aave, …] end
subgraph Arbitrum["Arbitrum — expansion"] G4[YieldRouter later] H4[AdapterRegistry] I4[Adapters later] end end
subgraph DataLayer["Data Layer"] J[DefiLlama map optional] K[Adapter read_apy truth] X[x402 pay path optional] end
subgraph CrossChain["Cross-Chain Layer"] L[Mayan compose<br/>CCTP / Wormhole under the hood] end
A --> C B --> C C --> D D --> E E --> F E --> AP F --> J F --> K AP --> X E --> G1 E --> G2 E -.->|not Phase-1 home| G3 E -.->|not Phase-1 home| G4
G1 --> H1 H1 --> I1 G2 --> H2 H2 --> I2 G3 --> H3 H3 --> I3 G4 --> H4 H4 --> I4
I1 --> L I2 --> L I3 --> L I4 --> L
L --> G1 L --> G2| Layer | Components | Responsibility |
|---|---|---|
| User / Agent | SDK, AI agents, dApps | Call DAY without custody |
| Orchestrator (offchain) | Decision engine, data fetcher, Auto Pay policy | Goal → route plan; prepare/execute gates |
| Onchain execution | YieldRouter, AdapterRegistry, Adapters | deposit / withdraw / harvest / fee math |
| Data | DefiLlama map + adapter read_apy; optional x402 | Discovery ≠ truth |
| Cross-chain | Mayan compose (not DIY multi-AMB) | Fund Phase-1 homes; credit after delivery |
Phase 1 emphasis
Section titled “Phase 1 emphasis”flowchart LR SDK["@dayprotocol/sdk"] --> API["DAY API / Orchestrator"] API --> Disc["Discovery map"] API --> Truth["read_apy<br/>venue adapters"] API --> Plan["prepare plans"] Plan --> SuiR["Sui YieldRouter path"] Plan --> SolR["Solana YieldRouter path"] Base["Base USDC"] -->|Mayan| SuiR Base -->|Mayan| SolR SuiR --> AdS["Suilend / NAVI / …"] SolR --> AdL["Kamino / Jito / …"] AdS --> Harvest["harvest + 5% performance fee on realized yield"] AdL --> Harvest Harvest --> AutoPay["Auto Pay residual"]| Component | Description | Where |
|---|---|---|
| YieldRouter | Entry for route/stake/unstake/harvest under owner policy | Onchain per execution home (Sui, Sol first) |
| AdapterRegistry | Allowlisted protocols + readiness | Onchain + offchain registry mirror |
| Adapters (Forms) | Thin connectors to venues | Onchain wrappers + offchain planners |
| Orchestrator | Goal-based routing, enablement, kill switch | Offchain (/api/day/*) |
| Auto Pay | Post-fee residual → storage / inference / x402 | Offchain policy + optional pay rails |
| Bridge | Mayan Base/Eth/Sol/Sui → Sui|Sol | Plan + delivery + rescue |
Alignments
Section titled “Alignments”| Sketch | DAY reality |
|---|---|
| Wormhole / LayerZero as product layer | Compose Mayan (CCTP/Wormhole under the hood). Do not reimplement multi-AMB. |
| Base + Arbitrum as full homes | Phase 1 execution homes = Sui + Solana. Base = bridge-in / registry. Arb = expansion. |
| x402 as primary yield data bus | Discovery map + adapter read_apy. x402 = payments / optional paid data. |
| Vault product | Out of scope as product core |
| Characters | Consumers of DAY, not the product core |
Core flows
Section titled “Core flows”Deposit / route (Auto Yield OFF by default)
Section titled “Deposit / route (Auto Yield OFF by default)”sequenceDiagram participant Agent participant SDK participant Orch as Orchestrator participant Router as YieldRouter participant Reg as AdapterRegistry participant Ad as Adapter Form participant Venue as External venue
Agent->>SDK: goal + amount + policy SDK->>Orch: preview / prepare Orch->>Orch: allowlist + readiness + read_apy Orch-->>SDK: plan (no invent APY) Agent->>SDK: execute (owner opt-in if stake) SDK->>Router: deposit/route Router->>Reg: resolve adapter Reg->>Ad: supply Ad->>Venue: protocol supply Venue-->>Agent: position at venue / receiptHarvest + fee + Auto Pay
Section titled “Harvest + fee + Auto Pay”sequenceDiagram participant Anyone as Keeper / agent participant Orch as Orchestrator participant Router as YieldRouter participant Ad as Adapter participant Venue
Anyone->>Orch: harvest trigger Orch->>Router: harvest plan Router->>Ad: claim / realize yield Ad->>Venue: claim_yield / exchange rate Venue-->>Router: gross yield Router->>Router: skim 5% performance fee on realized yield Router-->>Orch: residual Orch->>Orch: Auto Pay residual onlyBridge-in (Base → home)
Section titled “Bridge-in (Base → home)”sequenceDiagram participant Owner participant Orch participant Mayan participant Home as YieldRouter home
Owner->>Orch: bridge plan Base→Sui|Sol Orch->>Mayan: compose rail Mayan-->>Home: delivery Orch->>Orch: actualReceived vs minOut alt actual >= minOut Orch->>Home: credit actual else under minOut / failed Orch->>Owner: rescue destination = owner endNon-goals
Section titled “Non-goals”- No vault farm product / SuperVault core
- No team custody of principal
- No fee on deposit/withdraw
- No multi-AMB reimplementation
- No contract lock / UpgradeCap burn until explicit go
Related
Section titled “Related”| Page | Role |
|---|---|
| Package IDs | Live Sui / Solana / Base / Arb ids |
| Fees | 5% performance fee on realized yield + other protocol fees |
| API | HTTP + SDK calls |
| Audit | Public contract source paths |