Smart Accounts
Smart accounts are the orchestration layer of the Yield Router. They are user-owned contracts that hold funds and execute transactions on behalf of the user.Why Smart Accounts
Traditional DeFi interactions require users to sign every transaction: deposits, withdrawals, rebalances. Automated routing would require either:- Custodial control (user gives funds to a third party)
- Constant user interaction (defeating the purpose of automation)
Architecture
Each user has two addresses per chain:| Account | Description |
|---|---|
| Main Wallet (EOA) | The user’s externally owned account, holds keys |
| Sub-Account (Smart Account) | A contract controlled by the main wallet, holds routed funds |

Permissions
The smart account grants Rosetta permission to:- Deposit into whitelisted Morpho vaults
- Supply to enabled Aave markets
- Withdraw from vaults and markets
- Rebalance between vaults and across protocols
- Withdraw to any address other than the user’s main wallet
- Access vaults, markets, or protocols not explicitly enabled in policies
- Modify policies without user signature
Withdrawal Constraint
All withdrawals from the smart account can only be sent to the user’s main wallet. This is enforced at the contract level. This eliminates an entire class of attack vectors. Even if Rosetta’s systems were compromised, funds could only be sent back to the rightful owner.Policies
Policies are on-chain rules that define what the Yield Router is permitted to do with a user’s funds. They are the user’s control mechanism over automated execution.What Policies Control
| Permission | Description |
|---|---|
| Enabled Assets | Which assets the Router can allocate (e.g., USDT0, USDC) |
| Enabled Vaults | Which Morpho vaults the Router can deposit into |
| Enabled Protocols | Which protocols are active (Morpho, Aave) |
| Withdrawal Destination | Fixed to user’s main wallet (cannot be changed) |

Enabling and Disabling
When a user disables a vault or protocol:- Policy state updates on-chain
- Router can no longer deposit into that vault or market
- Existing positions in that vault are withdrawn
- Router will reallocate funds on the next block
- Policy state updates on-chain
- Router can now include that vault or market in allocation decisions
- If the newly enabled option has a better sustainable APY, Router reallocates to it
Policy Upgrades
When Rosetta adds support for new assets, protocols, or chains, users must upgrade their policy to access them. This requires explicit user consent via signature. For example, when Rosetta added Base chain support:- Rosetta deployed new policy version with Base chain capability
- User sees “Upgrade available” in interface
- User reviews and signs the upgrade transaction
- Base chain vaults become available in user’s policy configuration