Skip to content

XEL Integration

Version: 1.0
Date: 2026-07-11
Parent: docs/23-auto-yield-implementation.md, docs/24-open-yield-api.md, docs/25-open-yield-sui-move.md
Plane: XEL-152
Reuse scan: Codex comments on XEL-152…168

Once Open Yield is built, it is not a separate product next to XEL.
It is the treasury capability every Living Character can use.


Each XEL character’s shared Endowment becomes an Open Yield position; persona stays GEN-optional; keepers + owner APIs drive stake/harvest/Auto Pay under policy.

Persona (GEN optional)
Memory (Walrus/Seal)
Mind (inference providers)
LivingCharacter aNFT (owned)
Endowment + TreasuryPolicy ── Open Yield execution home (Sui)
├── Auto Yield (opt-in stake / harvest / compound)
├── Auto Pay (post-fee residual → storage/inference/x402)
├── Bridge-in (Mayan Base/Sol → Sui)
├── Gas sponsor (Turbos USDC→SUI)
└── Opportunity agent (DefiLlama map, propose only)

XEL subsystemPathOpen Yield role after build
Endowment / fee / harvestcontracts/v2/sources/treasury.moveOnchain capital + ~5% yield skim
Venue adaptersruntime/treasury/suilend-adapter.mjs, navi-adapter.mjssupply/withdraw/claim/read_apy
Lifecycle / waterfall mathruntime/treasury/lifecycle.mjsplans, net-yield receipts, allowlist blockers
Heartbeat keepersruntime/keepers/heartbeat-runner.mjs, talus-leader-heartbeat.mjspermissionless harvest poke
Bridge-inruntime/treasury/mayan-executor.mjs + backend bridge-to-suifund endowment from Base/Sol
Gasruntime/treasury/gas-sponsor.mjssponsor stake/harvest/sweep PTBs
Paymentsruntime/payments/x402.mjs + payment.moveAuto Pay rail
Operator yield APIbackend/main.py stablecoin-yield routesinternals under product API
Honest FE patternfrontend/components/settings/YieldVenueStatus.tsxtemplate for Auto Yield UI
Funding snapshotsbackend/main.py funding budget/snapshotestimates + runway inputs
Policy schemaschemas/treasury-policy.v1.jsonextend for auto_yield / auto_pay fields
Public agent surfacesite/skill.md / skill.jsondocument Open Yield capability

StepHow
Character mintCreate aNFT + shared Endowment + TreasuryPolicy (auto_yield_enabled=false)
DepositAnyone/owner top_up_endowmentno fee
Enable Auto YieldOwner sets auto_yield_enabled=true (+ optional max stake / venue)
StakeOwner (or narrow stake envelope) → Suilend/NAVI supply under allowlist
HarvestPermissionless heartbeat: claim PTB → fee skim → residual compound
WithdrawOwner withdraw_endowment_principalno fee; unstake first if needed
SurvivalOnly auto-unstake when storage due + liquid short

Integration rule: Open Yield never replaces the aNFT; it operates the endowment.

Wrap existing operator treasury into character-scoped Open Yield APIs:

Product routeCalls into
GET/PUT /api/characters/{id}/auto-yieldpolicy + app mirror of auto_yield_enabled
POST .../open-yield/preview · routediscovery + scorer + optional top_up/stake plan
POST .../open-yield/harvestkeeper/plan builders + adapters
POST .../open-yield/withdrawowner auth → unstake + withdraw
GET .../open-yield/positionfunding snapshot + read_apy + estimates
POST .../open-yield/auto-payspend policy + x402 targets
GET /api/open-yield/opportunitiesdiscovery agent snapshots
GET /api/open-yield/venuesstablecoin-yield readiness

Keep /api/treasury/sui/stablecoin-yield/* as internal/operator aliases.

JobIntegration
Heartbeat cron / TalusLoad character roster of shared endowments; claim→heartbeat; gas-sponsor PTB
Opportunity agentCron: DefiLlama → filter TVL≥$50M → propose; never stake
Wallet watcherBase/Sol USDC → Mayan → credit endowment → optional notify owner to stake
Auto PayAfter harvest residual: pay storage/inference within policy via x402
SurfaceChange
Settings / TreasuryAuto Yield toggle OFF default; venue; staked/liquid
Endowment / Funding screensReal estimates from API; kill demo APY (funding-model.ts stubs)
YieldVenueStatusExtend for Open Yield status + blockers
Character profile (public)Optional: net APY estimate / runway only if honest data exists
Fan creditsUnchanged ring-fence — never Auto Pay source
SurfaceIntegration
site/skill.mdDocument Open Yield tools: preview, route, harvest, position
MCP / GEN agentsCall XEL open-yield routes with character scope + AgentCap limits
Provider registryOptional capability treasury.yield.v1 / open_yield.v1
GENXEL Open Yield
Optional persona synthesisDoes not control funds
GEN credits / x402 purchaseSeparate from endowment principal
Publish to XELCharacter may arrive unfunded; Open Yield starts when endowment funded

Line: persona by GEN, capital by Open Yield — both optional; character valid with neither.


1. Mint character → Endowment liquid, Auto Yield OFF
2. Fund (top_up and/or Mayan bridge-in)
3. Owner enables Auto Yield (optional)
4. Owner stakes amount/venue (or owner-signed stake envelope)
5. Keepers harvest permissionlessly → fee skim ~5% → residual compounds
6. Storage due → survival auto-unstake min if needed
7. Auto Pay (if on) → residual → storage/inference/x402
8. Owner can withdraw anytime (after unstake if needed)

ActionOwnerAgentCapAnyone
top_upyesif funded path allowsyes (pay in)
enable Auto Yieldyesnono
stake principalyes (or narrow envelope)only if explicit stake scopeno
harvest pokeyesyesyes
Auto Pay configyesno widenno
Auto Pay execute residualpolicywithin spend policyno
withdraw principalyesnono

FieldSource after integration
auto_yield_enabledonchain TreasuryPolicy + app mirror
liquid_micros / staked_microsindexer + venue position
gross_apy_bps / net_apy_bpsadapter read_apy + fee bps
last_harvested_atheartbeat events
opportunities[]discovery agent DB/snapshots
auto_pay configapp policy + spend-policy
fee_bpsprotocol_yield_skim_bps

All APIs keyed by character_id (and endowment object id), not a global vault share id.


  1. Ship discovery/scorer/API/toggle without broadcast
  2. Wire FE honesty to real status
  3. Staging: owner stake mock → harvest fee path
  4. Close XEL-70 NO-GO (SDK roots, flags, keeper roster, prepare smoke)
  5. Staging live Suilend with small amount
  6. Prod flags only with mav go
  7. Auto Pay last (post-fee residual only)

  • New character: Auto Yield OFF, liquid endowment only
  • Owner can enable, stake USDC on Suilend, see real net APY
  • Permissionless harvest takes ~5% fee, compounds residual
  • Bridge-in from Base/Sol credits that character’s endowment
  • Gas-sponsored PTBs for stake/harvest
  • FE never shows demo 5% APY
  • Agent cannot withdraw principal
  • skill.md lists Open Yield capabilities for external agents

  • Standalone Base YieldRouter.sol as character home
  • Multi-user ERC-4626 share vault replacing per-character endowment
  • Auto-stake on mint
  • DefiLlama as execution oracle
  • GEN holding character principal

TicketIntegration point
153–154, 164runtime discovery/scorer → opportunities API → skill/orchestrator
155–157character open-yield API → backend stablecoin-yield internals
156TreasuryPolicy + FE toggle
158, 167–168keepers + gas-sponsor + fee waterfall
159keeper survival path
160Endowment/Funding/Settings FE
161prod env / readiness
163x402 + residual after harvest
165funding snapshot estimates block
166wallet-watcher + Mayan + optional Turbos
162skill.md + docs + Plane pages