Your tokenized stocks, now collateral. Borrow USDG against TSLA, AMZN, PLTR on Arbitrum — no selling, no taxable events, one-click pledge via smart wallets.
EquiFlow is a permissionless lending protocol that turns tokenized US equities into instant on-chain liquidity. Holders of tokenized stocks (TSLA, AMZN, PLTR, NFLX, AMD) pledge their shares to a Solidity vault, borrow USDG stablecoin against them, and repay anytime — without ever selling the underlying asset. A second vault lets users borrow WETH against the same collateral.
Retail stockholders face an impossible trade-off when they need cash. Selling stock triggers capital-gains tax and forfeits future upside. Holding stock locks up capital in an asset that can't pay for groceries. Traditional brokers do offer margin loans — but only to high-net-worth clients, behind KYC walls, with no transparency.
The same problem exists on-chain: tokenized equities (a USD 4 trillion market today, growing 38% YoY) sit idle in wallets because no protocol accepts them as collateral. Aave, Morpho, and Compound only list crypto-native assets.
EquiFlow is the first borrow-against-tokenized-stock vault deployed on an Arbitrum Orbit chain (Robinhood Chain testnet today, Arbitrum One next). The protocol gives users:
Feature | What it does |
|---|---|
One-click pledge | ERC-4337 smart wallet bundles |
Live oracle pricing | Pyth Network prices every collateral asset 24/5 across regular, pre, post, and overnight sessions; a server-side keeper pushes the freshest session on-chain and gates the UI when a quote goes stale. |
Per-asset risk | Each asset has its own LTV cap (50–85%) and a liquidation threshold set above it, based on volatility. A Value-at-Risk model recommends a safe LTV per asset. |
Auto-Defender (BETA) | Session-key + keeper architecture designed to auto-repay a slice of debt before Health Factor breaches 1.0. Today it ships in BETA / dry-run: the user signs an off-chain authorization and the keeper computes the repay, but the on-chain validator and live repay are still pending. |
LP-side yield | USDG depositors earn the kinked-IRM supply APR; 100% transparent on-chain. |
Tokenized stocks live on Arbitrum Orbit (Robinhood Chain), Polygon, and Base — but none have a borrow market today. Arbitrum's RWA tailwind (BlackRock's BUIDL fund, Backed's bToken issuance, Robinhood Chain launch) makes this the right L2 to build on. Low-cost L2 settlement + EIP-7702 / ERC-4337 maturity makes the UX finally feel like a fintech app, not a DeFi app.
USDG vault: 0x86c4AC25524560799863505F7650B24014eDB0FB on Robinhood Chain Testnet (chainId 46630)
WETH vault: 0x1EcD5E7BaC4841d062C76Df408E4e3345CF9E0B2 (borrow WETH against the same collateral)
Block explorer: https://explorer.testnet.chain.robinhood.com
<p>We entered the buildathon with an empty repo and a thesis. We shipped a <strong>working end-to-end protocol</strong> with smart contracts, a polished frontend, account abstraction, and an autonomous keeper system — and have kept hardening it since.</p><h3>Smart contracts (Solidity + Foundry)</h3><ul><li><p><code data-inline="true" spellcheck="false">EquiFlowVault.sol</code> — full lending vault: pledge/borrow/repay/withdraw, per-asset LTV + liquidation threshold, multi-collateral health factor, liquidation flow with 5% bonus, LP share accounting (ERC-4626-style), reserve factor, treasury. Hardened with Ownable2Step, 24h timelocks on risk changes, dead-shares inflation-attack mitigation, per-asset borrow caps, and a bad-debt write-off path (~1,850 lines).</p></li><li><p><code data-inline="true" spellcheck="false">KinkedRateModel.sol</code><strong> + </strong><code data-inline="true" spellcheck="false">IInterestRateModel.sol</code> — the kinked (two-slope, Aave-V3-style) interest-rate model is now a pluggable contract behind an interface, swapped into the vault via a 24h-timelocked <code data-inline="true" spellcheck="false">scheduleIrm</code> / <code data-inline="true" spellcheck="false">executeIrm</code>.</p></li><li><p><code data-inline="true" spellcheck="false">PythPriceAdapter.sol</code><strong> + </strong><code data-inline="true" spellcheck="false">PythAdapterRegistry.sol</code> — a Chainlink-compatible (<code data-inline="true" spellcheck="false">AggregatorV3Interface</code>) wrapper around Pyth/MockPyth, hardened with a deviation cap, force-update delay, and confidence circuit-breaker; a canonical registry maps each price feed to its adapter so multiple vaults share one adapter per feed.</p></li><li><p><code data-inline="true" spellcheck="false">VaultMath.sol</code> — an external math library extracted to keep the vault under the EIP-170 contract-size limit.</p></li><li><p><code data-inline="true" spellcheck="false">Deploy.s.sol</code><strong> + </strong><code data-inline="true" spellcheck="false">DeployWethVault.s.sol</code> — deployment scripts that publish the vault(s) and adapters, mint test USDG, list the 5 collateral assets (TSLA / AMZN / PLTR / NFLX / AMD) with realistic risk parameters, and seed liquidity. The second script stands up a WETH-borrow vault reusing the same collateral and adapter registry.</p></li><li><p><strong>Market-hours mode</strong> — <code data-inline="true" spellcheck="false">setMarketStatus</code> (OPEN / CLOSED / HALTED) gates new borrows and liquidations when the underlying market is closed.</p></li><li><p><strong>Tests + internal audit</strong> — 169 Foundry tests across 6 files (~3,100 lines) covering happy paths, edge cases (zero collateral, max LTV, stale-oracle revert), and liquidation arithmetic. An internal audit pass (<code data-inline="true" spellcheck="false">EquiFlow-Audit-Report.md</code>) with a reproducing PoC (<code data-inline="true" spellcheck="false">AuditPoC.t.sol</code>) drove a batch of fixes (<code data-inline="true" spellcheck="false">AuditBatchFixes.t.sol</code>).</p></li></ul><h3>Frontend (Next.js 16 + React 19 + wagmi + RainbowKit)</h3><p>14 routes shipped, each with live on-chain data:</p><table style="min-width: 50px"><colgroup><col style="min-width: 25px"><col style="min-width: 25px"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p><strong>Route</strong></p></th><th colspan="1" rowspan="1"><p><strong>What it does</strong></p></th></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/</code></p></td><td colspan="1" rowspan="1"><p>Hero landing with live oracle ticker, rotating asset showcase, and a live armed-session counter.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/markets</code></p></td><td colspan="1" rowspan="1"><p>Real-time table of all collateral assets — live Pyth price, 24h change, sparkline, max LTV, borrow APR. The Pledge drawer opens straight from a row.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/markets/[sym]</code></p></td><td colspan="1" rowspan="1"><p>Per-asset detail page with full risk parameters, pledge calculator + drawer, and price chart.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/portfolio</code></p></td><td colspan="1" rowspan="1"><p>Connected-wallet dashboard (replaces the old <code data-inline="true" spellcheck="false">/positions</code>) — collateral, debt, live health factor, LP balance, vault selector, and repay / borrow-more / withdraw / LP-deposit / LP-withdraw modals.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/liquidations</code></p></td><td colspan="1" rowspan="1"><p>Liquidator UI listing at-risk positions ranked by health factor.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/faucet</code></p></td><td colspan="1" rowspan="1"><p>Testnet onboarding — links to the Robinhood Chain ETH and USDG faucets plus stock-token / USDC addresses.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/governance</code>, <code data-inline="true" spellcheck="false">/tokenomics</code>, <code data-inline="true" spellcheck="false">/docs</code>, <code data-inline="true" spellcheck="false">/api-reference</code></p></td><td colspan="1" rowspan="1"><p>Investor- and developer-facing pages backed by <code data-inline="true" spellcheck="false">/docs</code> markdown.</p></td></tr><tr><td colspan="1" rowspan="1"><p><code data-inline="true" spellcheck="false">/audits</code>, <code data-inline="true" spellcheck="false">/bug-bounty</code>, <code data-inline="true" spellcheck="false">/contracts</code>, <code data-inline="true" spellcheck="false">/sdk</code></p></td><td colspan="1" rowspan="1"><p>Informational / roadmap pages — security posture, planned bounty tiers, contract reference, and SDK quickstart. (Forward-looking content; no third-party audit or published SDK yet.)</p></td></tr></tbody></table><blockquote><p>The pledge flow now lives in a slide-in <strong>PledgeSidebar</strong> drawer launched from <code data-inline="true" spellcheck="false">/markets</code> or <code data-inline="true" spellcheck="false">/markets/[sym]</code>, so the standalone <code data-inline="true" spellcheck="false">/pledge</code> page was retired.</p></blockquote><h3>Account Abstraction (ERC-4337 + EIP-7702)</h3><ul><li><p><strong>Modular Account v2 smart wallets</strong> — built directly on <code data-inline="true" spellcheck="false">viem</code>'s <code data-inline="true" spellcheck="false">toSmartAccount</code> targeting Alchemy's canonical Modular Account v2 (SemiModular) factory + implementation, with sponsored UserOps via a Pimlico/Alchemy Gas Manager paymaster (<code data-inline="true" spellcheck="false">permissionless</code> + <code data-inline="true" spellcheck="false">viem</code>, no SDK lock-in). Every write (pledge, borrow, repay, LP, liquidate, withdraw) can run as a single sponsored signature.</p></li><li><p><strong>EIP-7702 delegation</strong> is implemented (authorization-tuple signing + on-chain delegation fallback); the factory-deployed account is currently the default path, with 7702 disabled for injected wallets that can't sponsor delegation.</p></li><li><p><strong>Session keys for Auto-Defender (BETA)</strong> — the user signs an EIP-712 grant, and the server keeper reads health factor vs. threshold and computes a health-factor-based repay. <strong>It runs in dry-run today</strong> (the on-chain validator install is a no-op and the keeper will not move funds yet); weekly USDG limits are tracked off-chain.</p></li><li><p><strong>USDG-as-gas (Tier-5 paymaster)</strong> is wired at the library level (ERC-20 paymaster policy) but not yet surfaced in the UI — every caller currently uses sponsored gas.</p></li></ul><h3>Oracle infrastructure</h3><ul><li><p><strong>Pyth Hermes proxy</strong> at <code data-inline="true" spellcheck="false">/api/pyth/by-symbol/[sym]</code> — fetches the freshest of 4 sessions (regular/pre/post/overnight) for true 24/5 coverage.</p></li><li><p><strong>Server-side keeper</strong> at <code data-inline="true" spellcheck="false">/api/keeper/tick</code> (per-adapter) and <code data-inline="true" spellcheck="false">/api/keeper/cron</code> (full-sweep) — signs <code data-inline="true" spellcheck="false">updatePrice()</code> / <code data-inline="true" spellcheck="false">forceUpdatePrice()</code> transactions using <code data-inline="true" spellcheck="false">KEEPER_PRIVATE_KEY</code> server-side; key never reaches the browser. It also infers market-open status from feed freshness and calls <code data-inline="true" spellcheck="false">setMarketStatus()</code>, and respects an on-chain deviation cap with a 30-minute force-update escape hatch.</p></li><li><p><strong>Stale-oracle UX</strong>: when prices age past <code data-inline="true" spellcheck="false">staleAfter</code>, the UI surfaces a banner with a manual "Refresh oracle" button and disables actions that would revert. No silent failures.</p></li><li><p><code data-inline="true" spellcheck="false">/api/keeper/health</code> — public JSON healthcheck consumable by UptimeRobot / Better Stack for production monitoring.</p></li><li><p><strong>Market data</strong> — <code data-inline="true" spellcheck="false">/api/markets/24h</code>, <code data-inline="true" spellcheck="false">/api/markets/history/[sym]</code>, and <code data-inline="true" spellcheck="false">/api/markets/sparkline</code> serve price history via Pyth Benchmarks with an optional Upstash Redis cache.</p></li></ul><h3>DevOps & deployment</h3><ul><li><p><code data-inline="true" spellcheck="false">vercel.json</code> with cron schedule (<code data-inline="true" spellcheck="false">*/2 * * * *</code>) to auto-tick all adapters every 2 minutes — zero-touch oracle freshness in production.</p></li><li><p><code data-inline="true" spellcheck="false">CRON_SECRET</code>-gated endpoints; Vercel Cron auto-injects the bearer token.</p></li><li><p><code data-inline="true" spellcheck="false">.env.example</code> documents every required variable with setup steps.</p></li><li><p>Per-route hardening: per-IP rate limiting, bounded JSON bodies, fetch timeouts, and stable sanitized error codes.</p></li><li><p>Multi-session Pyth substitution lets us run on a single regular-session priceId per asset, even when only the overnight session is active.</p></li></ul><h3>Numbers shipped</h3><ul><li><p><strong>Smart contracts</strong>: ~2,450 lines of Solidity across 8 contracts, plus ~3,100 lines of Foundry tests (169 tests)</p></li><li><p><strong>Frontend</strong>: 36 React components, 14 pages, 22 custom hooks</p></li><li><p><strong>API routes</strong>: 12 (Pyth proxy, keeper, defender CRUD, market data)</p></li><li><p><strong>Lines of TypeScript</strong>: ~34,000</p></li></ul><h3>What's working end-to-end (demoable)</h3><ol><li><p>Connect wallet → opt into smart-wallet mode; the counterfactual wallet deploys on your first UserOp.</p></li><li><p>Visit <code data-inline="true" spellcheck="false">/markets</code> → see the live assets (TSLA / AMZN / PLTR / NFLX / AMD, plus AAPL / NVDA / SPY reference feeds) with live Pyth prices and 24h changes.</p></li><li><p>Open the Pledge drawer → one signature approves + locks collateral + mints USDG debt (<code data-inline="true" spellcheck="false">pledgeAndBorrow</code>).</p></li><li><p>Visit <code data-inline="true" spellcheck="false">/portfolio</code> → see health factor compute live from on-chain state, and repay / borrow more / withdraw / supply LP.</p></li><li><p>Auto-Defender (BETA) → sign once to grant a session key; the keeper sweep monitors your health factor (dry-run today).</p></li><li><p>Drop price (simulated wick via keeper) → liquidator dashboard surfaces the position → execute liquidation with 5% bonus.</p></li></ol>
<p><strong>Bootstrapped — no external funding raised.</strong></p><p>EquiFlow is a self-funded prototype built entirely during the Arbitrum Open House London Buildathon. The project has:</p><ul><li><p>No outside investors</p></li><li><p>No SAFE, SAFT, or token allocations issued</p></li><li><p>No grants or sponsorships received</p></li><li><p>No committed term sheets</p></li><li><p>100% founder equity / ownership</p></li></ul><p>We are not currently running an active fundraise. If the buildathon submission demonstrates strong product-market signal, we may explore a pre-seed round post-event to fund a <strong>professional third-party security audit</strong> (an internal audit pass and fixes are already complete) and an <strong>Arbitrum One mainnet deployment</strong> — but no fundraising process is underway today.</p><p>Open to introductory conversations with investors interested in RWA, DeFi credit markets, or oracle infrastructure after the demo. No prior commitments to honor.</p>