BreakingUpdateMay 15, 2026
Overview
A new on-chain instructionupdate_areal_fee_destination allows the DEX authority to rotate dex_config.areal_fee_destination after initialize_dex. Before this change the destination was set once and could only be modified via a program upgrade. The new path mirrors industry standard (Uniswap V3 setFeeProtocol, Raydium governance-controlled fee owner) and resolves a class of trapped-state scenarios where the bootstrap step pointed the destination at the wrong token account.
What changed
Contract
- New instruction
update_areal_fee_destination(contracts/native-dex/src/instructions/update_dex_config.rs). Authority-gated. Takes the new destination as an SPL Token Account and validates on-chain that its mint equalsRWT_MINT(reusing theInvalidProtocolFeeDestinationerror introduced by the 2026-05-13 P0-2 fix). - Idempotent — passing the current destination is a no-op with no event.
- Emits a new
ArealFeeDestinationUpdated { old_destination, new_destination, timestamp }event for off-chain audit trails.
Spec
initialize_dexparameters table —areal_fee_destinationdescription no longer says “static, immutable”. Now: “Set at init; updatable by authority viaupdate_areal_fee_destination.”update_dex_configNote — clarified that onlypause_authorityremains immutable inDexConfig;areal_fee_destinationis now rotatable.Configuration & Authoritysection — newupdate_areal_fee_destinationAccordion documenting parameters, validation, and logic.Eventstable — addedArealFeeDestinationUpdated.DexConfigstate table — updated mutability note forareal_fee_destination.
Why this is “breaking”
The breaking dimension is the docs surface, not on-chain compatibility: existing callers ofupdate_dex_config are unchanged. The “breaking” tag captures that the protocol’s trust model now includes “authority can redirect protocol fees at any time” — auditors and integrators must factor this into their security review.
Trust model implications
- Authority can redirect protocol fees. Mitigation: authority is the Team Multisig after bootstrap (per
Authority Transfer). Every rotation emitsArealFeeDestinationUpdated, providing a permanent on-chain audit trail. - Mint constraint enforced at update site. The on-chain
mint == RWT_MINTcheck means the stored destination is always an RWT ATA. The runtime mint-check inswapandzap_liquidity(added by 2026-05-13 P0-2) becomes a defense-in-depth tier rather than a primary guard. - No backdoor to migrate state. The instruction only updates
dex_config.areal_fee_destination. It does not touch pools, reserves, LP positions, or the accumulator — those are owned by their respective PDAs.
Motivating scenario
The Testnet bootstrap accidentally pointeddex_config.areal_fee_destination at the deployer’s USDC ATA rather than an RWT ATA. Combined with the 2026-05-13 P0-2 change (silent fallback removed), this would have bricked all swaps on a misconfigured cluster. The new instruction provides the canonical recovery path: the authority calls update_areal_fee_destination(new_account = correct_rwt_ata) and protocol-fee CPI succeeds again.
Migration
- Existing deployments where
areal_fee_destinationis already a valid RWT ATA — no action required. The new instruction is optional. - Deployments where the bootstrap pinned a non-RWT ATA — authority must call
update_areal_fee_destinationwith a valid RWT ATA before swap/zap will succeed. - Off-chain integrations (UI, indexers) — subscribe to
ArealFeeDestinationUpdatedif Treasury rotation is part of your trust model.
Related documents
- Native DEX contract —
update_areal_fee_destinationAccordion + DexConfig table update - 2026-05-13 native-dex protocol-fee revert — the P0-2 fix that made this migration path necessary