Documentation
SWAN is a non-custodial, autonomous wealth protocol on Robinhood Chain that continuously manages your tokenized real-world assets (equities and crypto) plus a USDG yield base. It earns a variable USDG yield on Morpho on every idle dollar and moves to safety on its own when markets turn, all inside limits you sign, in a wallet only you control.
Read Introduction and How SWAN works, then jump to the Quickstart. Builders can skip to the Technical reference.
Introduction #
Most portfolios do nothing while you sleep. Cash sits idle, risk assets ride out every drawdown, and the disciplined moves, trimming into danger, re-entering when it clears, are exactly the ones humans are worst at making unemotionally.
SWAN turns a portfolio into a rules-based, always-on index. You define a policy once, a target mix, a safety floor, how aggressively to shelter and how gradually to re-enter. An AI agent then watches the market 24/7 and rebalances your vault inside those limits, on decentralized markets that never close. It never takes custody: your assets live in a contract only your wallet can withdraw from.
Your keys, always
Funds live in a vault contract deployed for your address. The agent can rebalance within your caps, it can never withdraw.
You write the constitution
A signed policy sets the target mix, floors and triggers. The agent governs inside it; the contract enforces it on-chain, per trade.
USDG base yield
Idle dollars flow into Morpho USDG lending targeting ~7% APY, variable and set by lending-market conditions.
Responds to conditions
Tokenized stocks trade around the clock on-chain, so SWAN reacts to regime changes in real time, not on a market-hours calendar.
How SWAN works #
SWAN is built in three layers that sit on top of each other inside your vault:
1 · Yield-bearing base
Every dollar you deposit is put to work immediately. Base capital is supplied to Morpho lending vaults on Robinhood Chain, targeting roughly 7% APY on dollar-backed assets. The interest-bearing receipt tokens become the collateral foundation the growth sleeves are built on, nothing sits idle.
2 · Growth sleeves
On top of the base, the agent holds a target mix across three sleeves, equities (tokenized stocks & ETFs), crypto (ETH, BTC) and USDG (a dollar base supplied to Morpho). The split is set by your chosen strategy and is what the agent steers back toward as prices drift.
3 · Flight to safety
Continuously, the agent computes the SWAN Score, a composite read on market regime. When the score crosses your shelter threshold, the agent rotates risk assets into USDG on Morpho (safe yield), in stages. When the regime clears, it rebuilds risk gradually. Exiting is only 20% of the job; the disciplined re-entry is where long-term returns are actually made.
// the agent runs this continuously, per vault const score = swanScore() // 0-100 regime read const target = policy.targetFor(score) // your mix, adjusted for regime const drift = current.vs(target) if (Math.abs(drift) > policy.band && cooldownElapsed()) vault.rebalance(...) // one Uniswap swap, inside your caps
Quickstart #
Creating your first vault takes about two minutes. You'll need a wallet (MetaMask, Rabby, or any EIP-1193 wallet) on Robinhood Chain, and a little ETH for gas.
- Connect your wallet. Open the app and connect on Robinhood Chain. No wallet handy? Use “Explore in demo mode” to look around first.
- Pick an amount and a strategy. Choose how much to fund and one of the presets, Preserver, Balanced or Growth (see Strategies).
- Set your autonomy level. Advisor, Copilot or Autopilot, how much the agent may do on its own (see Autonomy levels).
- Sign & deploy. One signature writes your policy; one transaction deploys your vault and funds it. Creating the vault costs a few cents of ETH in gas, separate from your deposit.
- You're live. If you chose Autopilot, the agent is appointed at creation and starts managing immediately. Watch it from your dashboard; withdraw or revoke anytime.
The agent needs a small amount of ETH to pay gas when it trades. If it ever runs low you'll see a “top up” note, the vault's own funds are never touched for gas.
The SWAN Score #
The SWAN Score is a single number from 0 to 100 that estimates how dangerous the current market regime is. Low is calm; high is stormy. It's a composite, deliberately not a single price trigger, so it's slow to panic and hard to whipsaw.
What it measures
| Signal | Weight | What it captures |
|---|---|---|
| Realized volatility | 35% | Where current volatility sits versus its own history (percentile). Rising vol lifts the score. |
| Trend vs 200-day | 30% | Position and slope relative to the long-term trend. Breaking below trend raises risk. |
| Drawdown velocity | 20% | How fast price is falling, not just how far, sharp, fast drops score higher than slow grinds. |
| Leverage / positioning | 10% | Crowding and leverage in the system (funding, open interest). |
| Macro calendar | 5% | Known event risk within ~48h, FOMC, CPI, jobs prints, nudges the score ahead of the print. |
Regime bands
Track & harvest
The agent holds your target mix and compounds base yield. Business as usual.
Trim at the edges
Elevated risk. The agent begins de-risking in stages if the reading persists, one scary wick won't move your money.
Flight to safety
Rotate risk assets into USDG on Morpho / stable yield, held in your own vault, never an omnibus account.
Rebuild gradually
As the score clears back below your re-entry level, risk is rebuilt over time, not all at once.
Score inputs are computed from public market data (e.g. CoinGecko price history for BTC/ETH). The default policy shelters at a score of 65 and begins re-entry below 45, with a 6% drift band and hysteresis to avoid flip-flopping.
Flight to safety #
“Flight to safety” is SWAN's core behavior, and it's what separates it from a stop-loss. A stop-loss is a single price trigger that fires once, blind to context, usually into the worst liquidity of the day. SWAN's flight-to-safety:
- De-risks in stages as the regime deteriorates, rather than dumping everything at one price.
- Earns yield on what it shelters, value rotates into USDG supplied to Morpho lending, not idle cash.
- Avoids whipsaw with hysteresis, separate shelter and re-entry thresholds mean it doesn't churn on noise.
- Re-enters gradually when the regime clears, on the schedule your policy sets.
Flight-to-safety manages market risk on the growth sleeves; it does not remove it. No strategy eliminates the possibility of loss. See Yield & risk.
Vaults #
A vault is your own on-chain account, a smart contract deployed for your wallet with a policy the agent must obey. Most people run more than one: a cautious core, a braver satellite.
Creating a vault
From the app, choose an amount and a strategy, set your autonomy level, then sign and deploy. Under the hood, the factory deploys a fresh SwanVault owned by your wallet, with the token whitelist and Uniswap router preconfigured. If you fund with ETH, it's wrapped to WETH inside the vault in the same transaction.
Funding & withdrawing
Add funds anytime by sending WETH, USDG or ETH to your vault's address, or via the Deposit action. Only you can withdraw: withdrawToken and withdrawETH are onlyOwner and send straight back to your wallet. There are no lockups and no exit fees.
Closing a vault
A vault is a contract, so it can't be erased from the chain, but you can empty and retire it. The app's Delete vault action withdraws every asset back to your wallet (one approval per asset), revokes the agent, and removes the vault from your dashboard. The now-empty contract remains on-chain but holds nothing.
Because a vault is just a contract at an address, you can always re-add or interact with it later from its address or a block explorer, removing it from the dashboard is only a view-layer action.
Strategies #
Strategies are presets for your target mix and how aggressively you shelter and re-enter. Pick one as a starting point, then fine-tune the policy.
| Strategy | Target mix (equities / crypto / USDG) | Temperament |
|---|---|---|
| Preserver | 55 / 15 / 30 | Shelters early, re-enters slowly. Capital-first. |
| Balanced default | 62 / 23 / 15 | The SWAN default, a middle path. |
| Growth | 55 / 40 / 5 | Shelters late, re-enters fast. Return-first. |
Custom policy
Beyond the presets you control: the target mix, a safety floor (minimum % always in USDG), the shelter threshold (the SWAN Score at which de-risking begins), re-entry speed, and the asset whitelist, the agent can trade nothing outside it.
The v0 on-chain tradeable universe is WETH (risk) ↔ USDG (dollar/safe) via Uniswap on Robinhood Chain. The three-sleeve model above is the product target; sleeves expand as more tokenized assets list on-chain.
Autonomy levels #
You choose how much the agent may do on its own. All three stay inside your policy and caps, the difference is who presses “go”.
| Level | Who acts | Behavior |
|---|---|---|
| Advisor max human | You sign every move | The agent proposes rebalances; nothing executes without your signature. |
| Copilot default | Auto-shelter | De-risking is automatic, safety shouldn't wait for you to wake up. Re-entries wait for your approval. |
| Autopilot max agent | Full delegation | The agent manages entirely inside your envelope. You get receipts, not questions. |
Choosing Autopilot at creation appoints the shared SWAN agent in the same transaction that deploys your vault, so it's running the moment the vault exists, no separate step. For Advisor/Copilot you appoint or approve as needed.
The agent #
The agent is SWAN's off-chain brain. It's an always-on service that, each tick (about every 10 minutes):
- computes the live SWAN Score from market data;
- discovers the vaults that have appointed its key;
- reads each vault's real on-chain balances;
- computes the target allocation from the vault's policy and the score;
- if the vault has drifted past its band and the on-chain cooldown has elapsed, submits one
rebalance(), a real Uniswap swap the vault executes on itself.
The agent key is powerful only in a narrow way: it can call rebalance() within the vault's hard caps, and nothing else. It cannot withdraw a cent. Losing the agent key is not the same as losing funds, the worst case is the vault stops rebalancing until you appoint a new agent or manage it manually.
In the current release, one shared SWAN agent services appointed vaults from an always-on host. You can also run your own agent against the same contracts, the vault only cares about the address it has appointed.
Non-custody model #
SWAN is non-custodial by construction. Your assets are held in a SwanVault contract deployed for your address. SWAN's contract receives delegated trading rights only, scoped to a whitelist of assets and a single DEX venue, capped by your intent, and revocable in one transaction.
Withdrawals
withdrawToken / withdrawETH are owner-only and pay to your wallet. The agent has no withdrawal path, not even to itself.
Policy & revoke
Changing the policy or revoking the agent requires your key. One transaction (revokeAgent) stops the agent instantly.
Control boundary #
Three parties, three roles, and the contract is the police.
| You decide, at setup | The agent decides, continuously | The contract enforces, always |
|---|---|---|
| Target mix & safety floor · volatility ceiling & re-entry speed · asset whitelist · autonomy level · deposits, withdrawals, revocation | When the regime changed · how much to move & in what order · where to route · when to begin re-entry, all inside your bands | Cannot withdraw to any address · cannot touch a non-whitelisted asset or venue · cannot breach your caps, checked per trade · cannot change your policy |
The on-chain caps that back this up:
| Guard | What it does |
|---|---|
| Token whitelist | The vault will only hold and trade owner-approved tokens. |
| Uniswap-only router | Trades route through a single, immutable DEX router set at deploy, the agent can't send funds elsewhere. |
| Per-trade cap | maxTradeBps limits how much of a balance a single trade can move (default 25%). |
| Cooldown | A minimum time between trades (default 1 hour) throttles activity. |
| Slippage floor | Every swap carries a minOut, it reverts rather than execute at a bad price (“too little received”). |
| Reentrancy guard | State-changing calls are protected against reentrancy. |
| One-tx revoke | revokeAgent() removes the agent and pauses trading immediately; withdrawals stay available. |
Yield & risk #
The base lending layer is USDG supplied to Morpho lending on Robinhood Chain. That is the yield foundation of the portfolio, variable and set by market conditions, and not a guaranteed or insured rate.
The growth sleeves, tokenized equities and crypto, carry normal market risk. That's precisely the part SWAN's flight-to-safety logic actively manages, but it does not remove it. Nothing here is FDIC or SIPC coverage, and no strategy removes market risk entirely.
Availability & risk. Tokenized stocks on Robinhood Chain are available in 120+ countries but not to U.S., U.K. or Canadian persons, among others, they're structured as tokenized debt securities under EU rules. The crypto and stable-yield sleeves have broader availability. Nothing in these docs is investment advice; digital assets involve substantial risk of loss.
Audit status. The v0.3 contracts are internally reviewed but not yet independently audited. Treat mainnet use as early and size accordingly.
Network & addresses #
SWAN runs on Robinhood Chain mainnet.
| Parameter | Value |
|---|---|
| Network | Robinhood Chain (mainnet) |
| Chain ID | 4663 (0x1237) |
| RPC | https://rpc.mainnet.chain.robinhood.com |
| Explorer | https://robinhoodchain.blockscout.com |
| Gas token | ETH |
| SwanVaultFactory | 0x328c0e8dBe36C29e87E561f89DD2d8AB1B2bF419 |
| WETH | 0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73 (18 dec) |
| USDG (Global Dollar) | 0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168 (6 dec) |
| Uniswap v3 pool (WETH/USDG) | 0x69bfaf19c9f377bb306a89aed9f6b07e2c1a8d9a · fee 0.05% |
SwanVault contract #
Each vault is an instance of SwanVault, owned by the wallet that created it. Owner-only functions manage funds and policy; the appointed agent may only call rebalance.
Owner functions
| Function | Purpose |
|---|---|
depositToken(address token, uint256 amount) | Pull an approved token into the vault. |
withdrawToken(address token, uint256 amount) | Withdraw a token to the owner. amount = 0 withdraws the full balance. |
withdrawETH(uint256 amount) | Withdraw ETH to the owner. amount = 0 withdraws the full balance. |
setAgent(address agent) | Appoint the agent allowed to call rebalance. |
revokeAgent() | Remove the agent and pause trading immediately. |
setPolicy(bytes32 policyHash) | Store the EIP-712 hash of your signed policy. |
setTokenAllowed(address token, bool allowed) | Add or remove a token from the whitelist. |
setLimits(uint16 maxTradeBps, uint32 cooldown) | Set the per-trade cap and cooldown. |
setPaused(bool paused) | Pause or resume rebalancing. |
Agent function
// callable only by the appointed agent, only within the caps below function rebalance( address tokenIn, address tokenOut, uint24 fee, uint256 amountIn, uint256 minOut ) external returns (uint256 amountOut);
View functions
owner(), agent(), paused(), maxTradeBps(), cooldown(), lastTradeAt(), allowedToken(address).
Factory contract #
SwanVaultFactory is the single, permissionless front door. It has no admin and takes no fees, anyone can deploy a vault they own.
| Member | Purpose |
|---|---|
createVault(bytes32 policyHash, address agent) | Deploy a vault you own, optionally appointing an agent (pass the zero address for none). |
createVaultWithETH(bytes32 policyHash, address agent) payable | Same, but wraps the ETH you send to WETH inside the new vault in one transaction. Autopilot passes the SWAN agent here. |
vaultsOf(address owner) | Returns the list of vaults created by an owner. |
totalVaults() | Total vaults ever created. |
event VaultCreated(address owner, address vault, bytes32 policyHash, address agent) | Emitted on each deployment. |
const factory = new ethers.Contract(FACTORY, ABI, signer) const tx = await factory.createVaultWithETH( policyHash, // keccak256 of your EIP-712 policy "0x6610d6d1848908F82a61bf4dC85514Fbd89A0F8f", // SWAN agent, or 0x0 for none { value: ethers.parseEther("0.02") } ) const rc = await tx.wait() // VaultCreated → your new vault address
Policy & EIP-712 #
Your policy, target mix, thresholds, re-entry, autonomy, is expressed as structured data and signed by your wallet with EIP-712 typed-data signing. The signature is free and gasless and moves nothing; it proves you authored the policy. The vault stores only the keccak256 hash of the policy on-chain, so anyone can verify a policy against its hash and recover your address from the signature.
Because the policy hash is on-chain and the signature is verifiable, the rules the agent operates under are auditable, you don't have to trust a model, only the caps the contract enforces.
Rebalance mechanics #
When the agent rebalances, the vault performs the swap on itself through the immutable Uniswap router. Every call is bounded:
- Direction & size come from the drift between current and target allocation, the agent moves a fraction of the gap, never the whole balance.
- Per-trade cap (
maxTradeBps) hard-limitsamountInto a share of the input balance. - Cooldown (
cooldownvslastTradeAt) blocks trades that are too frequent. - Slippage floor (
minOut) is derived from the live pool price; the swap reverts if it can't be met. - Whitelist: both
tokenInandtokenOutmust be allowed, or the call reverts.
Proceeds always stay inside the vault, there is no path for a rebalance to send value anywhere but back into your vault's own balance.
FAQ #
Is SWAN custodial?
No. Assets live in a vault contract deployed for your address; SWAN's contract receives delegated trading rights only, scoped to a whitelist and a single DEX, capped by your intent, and revocable in one transaction. It can rebalance; it cannot withdraw to any other address.
Isn't this just a fancy stop-loss?
No, the difference is the whole product. A stop-loss is a single price trigger that fires once, blind to context. SWAN runs a continuous composite score, de-risks in stages, earns yield on what it shelters, avoids whipsaw with hysteresis, and re-enters gradually. The disciplined re-entry is where long-term returns are made.
What if the agent goes offline?
Nothing dangerous. The agent can only trigger rebalances; it isn't required for your funds to exist or exit. If it disappears, your vault simply goes static, assets stay in your wallet, base yield keeps accruing, and you can withdraw or trade manually anytime.
How is this different from a robo-advisor?
Three ways: robo-advisors hold custody (SWAN never does); they rebalance on a calendar during market hours (SWAN responds to conditions in real time, because tokenized stocks trade 24/7 on-chain); and they leave cash idle (SWAN's base earns a variable Morpho lending yield from deposit).
Where does the base yield come from?
The base sleeve is USDG supplied to Morpho lending on Robinhood Chain, targeting roughly 7% (variable, set by market conditions). The growth sleeves carry normal market risk, that's the part flight-to-safety manages. This is on-chain lending, not a bank deposit, and is not FDIC/SIPC coverage.
Glossary #
| SWAN Score | A 0-100 composite estimate of market-regime danger that drives flight-to-safety. |
| Sleeve | One slice of the growth allocation, equities, crypto, or the USDG base. |
| Shelter | The de-risking action taken when the score crosses your shelter threshold. |
| Re-entry | The gradual rebuild of risk assets after the regime clears. |
| Policy | Your signed rule set: target mix, floors, thresholds, re-entry, autonomy. |
| Vault | Your on-chain account (a SwanVault contract) that holds funds and obeys the policy. |
| Agent | The off-chain service that computes the score and submits capped rebalances. |
| USDG | Global Dollar, the dollar-denominated token used as the safe/base asset on Robinhood Chain. |
| Receipt token | The yield-bearing token received for supplying to the lending base; used as collateral. |
Links #
- SWAN app, create and manage vaults.
- swanprotocol.xyz, the main site.
- Robinhood Chain explorer, verify contracts and transactions.