Documentation Index
Fetch the complete documentation index at: https://docs.areal.finance/llms.txt
Use this file to discover all available pages before exploring further.
UpdateMay 3, 2026
Overview
The Off-Chain Services page is updated on two fronts:- Yield Claim Crank — its description of the RWT lane is brought in line with the rest of the docs sweep (the 15% RWT slice now goes through the Yield Distribution
LiquidityHoldingPDA and is drained into the Nexus by Authority viawithdraw_liquidity_holding, not by the crank vianexus_deposit). - Nexus Manager — gets a new
### Operational hardeningsection covering the seven shared operational primitives the bot uses (multi-RPC fallback, single-instance lock, WS reconcile, SOL pre-flight, kill-switch authority, decision engine, and theSEND_TXdry-run flag). The privileged-wallet rows for the Nexus Manager are also updated to reflect that the manager pubkey now lives onLiquidityNexus.manager, not ondex_config.
What changed on the page
Yield Claim Crank — RWT lane
### How It Works, “Claim for RWT Vault” Step — step 4 rewritten. Was: “Crank then callsnative_dex::nexus_depositto route 15% RWT into Nexus with principal tracking.” Now: “The 15% RWT slice lands in the Yield DistributionLiquidityHoldingPDA RWT ATA. Authority subsequently drains it into the Nexus viawithdraw_liquidity_holding(single TX, atomic principal-floor update via CPI tonexus_record_deposit). The crank does not handle the RWT lane — it is Authority-gated.”- Configuration table — adds
SEND_TXenv var (defaultfalse, dry-run mode). - On-Chain Interaction table —
Route to Nexusrow narrowed toRoute USDC to Nexusand explicitly notes that the RWT lane is Authority-gated and not driven by this crank.
Nexus Manager — Deposit Capital Step
Step rewritten as a two-lane description. Previously: “After OT distribute_revenue sends 10% USDC to crank, or after RWT claim_yield sends 15% RWT to crank — crank calls native_dex::nexus_deposit…” (single description for both lanes, both routed through the crank). Now:
- USDC lane — OT
distribute_revenuesends 10% USDC to a crank wallet, which callsnative_dex::nexus_depositto route USDC into the Nexus and bumptotal_deposited_usdc. - RWT lane — RWT
claim_yieldsends the 15% liquidity slice into the YDLiquidityHoldingPDA’s RWT ATA. Authority then callsyield_distribution::withdraw_liquidity_holding, which atomically transfers RWT into the Nexus RWT ATA AND CPIs intonexus_record_depositto updatetotal_deposited_rwt— single TX.
native_dex::nexus_deposit | crank (signer)…” row in the Nexus Manager’s On-Chain Interaction table is removed: the Nexus Manager itself does not call nexus_deposit — that is the Yield Claim Crank’s surface (USDC lane only). The Nexus Manager only swaps and adds/removes liquidity from the Nexus’s existing balances.
Nexus Manager — new ### Operational hardening section
Seven bullets describing the bot’s runtime safety and operational primitives:
- Multi-RPC fallback — multi-endpoint RPC client with consensus-read for security-critical state (Nexus principal floor, pool reserve depth before a swap)
- Single-instance lock — PID-file lock prevents two manager instances from racing
- WS reconcile after disconnect — on reconnect, walks program signatures since the last-seen slot to backfill missed
NexusDepositedandNexusManagerUpdatedevents - SOL pre-flight check — manager wallet must have enough SOL before the first submit each cycle; otherwise a structured
skipwith reasonlow_sol - Kill-switch authority — Authority can disable the manager by calling
update_nexus_manager(new_manager: [0u8; 32]); the three manager-only DEX instructions (nexus_swap,nexus_add_liquidity,nexus_remove_liquidity) all checksigner != [0u8; 32]and revert withNexusManagerDisableduntil Authority sets a real pubkey - Decision engine — ranks managed pools by drift from a target distribution (default: equal weight) and emits one of four decision kinds per cycle (
swap,add_liquidity,remove_liquidity,skip); decisions persisted append-only on disk in JSONL SEND_TXflag — dry-run mode — defaults toSEND_TX=false(compute and log decisions, no submit); flipped totruefor production after staging-mode verification
Wallet identity for the Nexus Manager
Two places now readLiquidityNexus.manager instead of dex_config.nexus_manager:
- The page-summary table at the top (column “Permissions / Required wallet”)
- The “Wallet & Privileges” table in the Shared Infrastructure section
Wallet registration step
The “Register bot wallets on-chain” step in the deployment checklist is updated. Previously:update_dex_config(nexus_manager: manager_pubkey). Now: initialize_nexus(manager: manager_pubkey) for first-time singleton creation; subsequent rotation via update_nexus_manager(new_manager); with a note that the manager pubkey now lives on LiquidityNexus.manager.
Why this matters
The Off-Chain Services page is the operator-facing reference for everyone running an Areal bot fleet. Three concrete consequences of leaving it stale:- A bot operator following the Initial Release checklist would call
update_dex_config(nexus_manager: …)and find the instruction either rejected or no-op (thenexus_managerfield has been moved offdex_config). - The Yield Claim Crank checklist would describe a
nexus_depositcall for the RWT lane that today produces no on-chain effect for a permissionless caller (the lane is Authority-gated throughwithdraw_liquidity_holding). - New Nexus Manager operators would lack the safety primitives now formally guaranteed in the spec — single-instance lock, multi-RPC consensus reads, kill-switch behaviour — and would have no contractual expectation that the bot defaults to dry-run mode.
Migration
Bot operators following the page should:- Use
initialize_nexusfor first-time setup,update_nexus_managerfor rotation. Stop callingupdate_dex_config(nexus_manager)— the field is gone. - Drop the assumption that the Yield Claim Crank handles the RWT lane. Wire the Authority-gated
withdraw_liquidity_holdingcall into the relevant operator runbook. - Set
SEND_TX=falsefor all Yield Claim Crank and Nexus Manager bot deployments by default; flip totrueonly after staging-mode verification.
Related documents
- Off-Chain Services — the page updated by this entry
- Liquidity Nexus — subsystem-level overview that the Nexus Manager bot operates on
- Native DEX contract —
nexus_swap,nexus_add_liquidity,nexus_remove_liquidity,update_nexus_manager - Yield Distribution contract —
withdraw_liquidity_holding(the Authority-gated drain that completes the RWT lane)