Earn Zap Router (Morpho)
EarnZapRouter is the one-signature entry point into Morpho Earn (VaultV2) on
Robinhood Chain. Users hold nothing but ETH and sign ONE transaction — the router
handles wrap → swap → deposit (and the reverse on exit).
The zap flows
- Vault shares mint directly to the user (
onBehalf = user). The router tracks bookkeeping (balanceOfShares) but never takes custody of positions. - The WETH/USDG leg uses the 0.01% pool (
POOL_FEE = 100) — the deepest WETH/USDG tier on the chain. - Both swap legs are slippage-bounded (
amountOutMinimum): a sandwich beyond tolerance reverts the whole zap atomically.
Fees
Cumulative lifetime exit fees are tracked publicly (
totalExitFees) for
transparency.
Worked example
User zaps 1 ETH into a USDG Morpho vault (USDG = 1 USD):
Later, redeeming all shares worth 3300 USDG:
Security model
1. Vault allowlist — additive-only. Vaults are whitelisted at deploy or viaaddVault(); there is no removal. Every addition is emitted. The router can never be
pointed at a hostile “vault” to farm share approvals.
2. No custody, no approvals over user funds. Users approve the router only for
vault shares at exit time (VaultV2.redeem pulls from onBehalf = user). The
router’s own token approvals cover only in-flight swap amounts produced inside the
contract during a zap.
3. Checks-Effects-Interactions everywhere. The share bookkeeping is decremented
before any ETH leaves — a malicious treasury or receiver cannot reenter into a
stale position.
4. No stray ETH acceptor. The only ETH path out is the WETH unwrap; there is no
state-changing fallback. Tokens that land on the router outside a zap (donations,
misdirected transfers) can be rescued via sweepDust(token, amount) → treasury —
zap flows never leave tokens at rest on the router.
Beyond the zap
The Earn module surfaces (all read through the same client):- Morpho Borrow — supply collateral → borrow → repay → withdrawCollateral, direct Morpho Blue calls, no router, no custody. Full closes use a fork-safe repay-by-exact-shares path so closing never leaves debt residue.
- Morpho Farms — Merkl rewards claiming for positioned users.
- Longbow pools — supply/withdraw shortcuts with entry/exit guidance based on utilization; my-position cards pinned with badges.
- Native stock tokens — the dividend and lootbox rails swap into the same canonical Robinhood Stock Tokens the swap legs use.