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:| 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 vaults
- Withdraw from vaults
- Rebalance between vaults
- Withdraw to any address other than the user’s main wallet
- Access vaults or assets 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 vaults the Router can deposit into |
| Withdrawal Destination | Fixed to user’s main wallet (cannot be changed) |
Enabling and Disabling
When a user disables a vault:- Policy state updates on-chain
- Router can no longer deposit into that vault
- Existing positions in that vault is withdrawn
- Router will reallocate funds on the next block
- Policy state updates on-chain
- Router can now include that vault in allocation decisions
- If the new added vault has a better sustainable APY, Router reallocates to it
Policy Upgrades
When Rosetta adds support for new assets or vaults, users must upgrade their policy to access them. This requires explicit user consent via signature. For example, if Rosetta adds USDe support:- Rosetta deploys new policy version with USDe capability
- User sees “Policy upgrade available” in interface
- User reviews and signs the upgrade transaction
- New asset becomes available in user’s policy configuration