Inspiration

$150 billion was liquidated across crypto derivatives markets in 2025. Traders aren't wrong about wanting leverage, they're using the wrong instruments. Perps charge funding rates, looping carries variable borrow costs, and both suffer liquidation risk. We looked at how projects like f(x) Protocol solved this by splitting an asset into a stablecoin and a leveraged token, and realized nobody had applied this to tokenized equities. With xStocks bringing real stocks on-chain as composable ERC-20s, the opportunity was obvious: build the first liquidation-free leverage protocol for tokenized equities.

What it does

Paragon splits xStocks (tokenized equities like SPYx, QQQx) into two new financial primitives: paraUSD, a stablecoin backed by a diversified basket of tokenized equities, and paraStocks (paraSPY, paraQQQ, etc.), leveraged tokens that amplify the underlying stock's price movement with no liquidation, no funding rates, and no active position management.

Users deposit xStocks into a shared vault and choose how they want to invest based on what the current leverage bands allow. Three minting modes give users flexibility: Leverage Only minting for pure directional exposure, paraUSD Only minting for stable buying power from your stock value, or Split Mint to receive both sides and decide what to do with each.

The protocol includes a stability pool where paraUSD stakers earn concentrated protocol fee yield (done to incentivize paraUSD liquidity) as well as a three-tier stability system to maintain system between leverage between 2x-5x (fee controls, stability pool drawdown, treasury recapitalization).

How we built it

Smart contracts -- Solidity with Foundry. The core is a single Vault contract (~18 source files) managing per-asset sub-pool accounting, three mint paths (standard, leverage-only, stable-only), three redeem paths (leveraged, paraUSD, balanced), and a dynamic fee calculator that uses asymmetric quadratic curves to nudge leverage toward 3x. The stability pool implements an ERC-4626-style share token for fee yield distribution. We wrote MockXStock contracts that replicate Backed Finance's shares-based rebasing interface (shares × multiplier) so everything works on testnet without real xStocks. 12 test files cover everything from basic minting math to full system integration simulations with real SPY/QQQ price movements.

Oracle infrastructure -- CoinGecko was the only freely accessible oracle provider that tracks xStock secondary market prices 24/7. Pyth and Chainlink do offer after-hours equity data, but require premium/enterprise memberships that weren't viable for a hackathon build. We built a keeper bot that fetches SPYx and QQQx prices every 60 seconds and pushes them on-chain through CoinGeckoOracleAdapter contracts. The oracle interface is abstracted behind IPriceOracle so mainnet can swap to Pyth or Chainlink without touching the Vault.

Frontend -- Next.js with Wagmi, Viem, and Privy for authentication. We integrated Privy's embedded wallets so users who sign up with just an email automatically get a wallet created for them, no browser extension or seed phrase required. The login flow supports both email and existing wallet connections, and the app defaults users onto Ink Sepolia so they never have to manually add a network. The interface includes a markets overview, per-asset detail pages with a leverage simulator, a portfolio tracker with P&L calculations, and a stability pool staking page showing live APY. We built a GitHub Actions cron job that snapshots leverage and pool data to Supabase every 5 minutes to power historical charts.

Risk calibration -- We ran Value-at-Risk analysis on 30+ years of SPY and QQQ historical data to derive the CR thresholds. The 99.9% confidence 1-day VaR for QQQ is -8.59%, giving a mathematical minimum CR of 109.4%. We set the healthy threshold at 125% with a ~15pp conservative buffer.

Challenges we ran into

The hardest problem was the fee calculator math. We needed fees that smoothly scale based on how far leverage deviates from the 3x target, but behave asymmetrically. Actions pushing leverage higher need a different curve than actions pushing it lower. Getting the quadratic curves to produce sensible fees across the full 2x to 5x range without cliff edges or dead zones took several iterations.

Modeling the stability modes was tricky because they interact with each other. Mode 1 fee escalation changes user incentives, which affects whether Mode 2 triggers, which determines if the stability pool gets drawn down, which changes the fee yield for stakers. We ended up writing a full system integration test that simulates a market crash through all three modes to verify the cascade works correctly.

The sub-pool accounting for paraUSD was subtle. paraUSD is one fungible token but backed by multiple different xStocks. We had to track per-user per-asset "stable credits" to prevent someone from minting paraUSD against one stock and then redeeming it against a different, more favorable pool. Getting this credit ledger right without breaking fungibility of paraUSD itself required careful design.

Oracle coverage for tokenized equities was a challenge we didn't anticipate. Pyth and Chainlink do publish equity prices, but their freely available feeds stop updating after US market close, which means the protocol would go dark for 17+ hours on weeknights and 65+ hours on weekends. Their after-hours data requires premium memberships. Discovering that CoinGecko tracks xStock secondary market prices around the clock solved this, but we had to build the entire keeper infrastructure from scratch since there's no existing CoinGecko-to-on-chain oracle solution.

Accomplishments that we're proud of

  • Built a production-ready new financial primitive for real-world assets.
  • Applied a proven DeFi mechanism (dual-token split) to tokenized equities for the first time.
  • Designed a complete stability system with three tiers of protection: dynamic fee controls, stability pool drawdown, and treasury recapitalization.
  • The protocol creates two entirely new asset classes from xStocks, an equity-backed stablecoin and liquidation-free leveraged equity tokens, both composable with the rest of DeFi.

What we learned

The relationship between leverage, collateral ratio, and fee design is deeply interconnected, you can't design one without the others. Tokenized equities are actually better collateral for this mechanism than crypto because their lower volatility means the stablecoin peg is more robust and the leverage is more predictable. We also learned that the biggest design challenge isn't the happy path, it's the crisis scenarios. Modeling what happens during a 20% market crash and ensuring every stability mechanism fires correctly taught us more about protocol design than building the basic core mint/redeem logic.

What's next for Paragon

Phase 1: paraUSD/sparaUSD Composability — DeFi integrations to deepen stablecoin liquidity. Get paraUSD and sparaUSD (staked paraUSD) listed on lending markets like Tydro, yield trading protocols like Pendle, and vault strategies like Piggybank. More integrations means more utility for paraUSD holders, which drives demand and strengthens the peg.

Phase 2: New Leveraged Long xStock Markets — Expand beyond the initial supported stocks by creating pools for additional xStocks. Design collateral ratios per new asset and go to market one-by-one to ensure each new market has sufficient liquidity before launching the next.

Phase 3: Liquidation-Free Leverage on Shorts — Integrate short exposure into a v2 of the protocol. Develop the architecture to use existing long pools as counterparties for short positions. Deploy short markets one-by-one, starting with the most liquid para-assets.

Built With

  • claude-code
  • coingecko
  • foundry
  • ink
  • next.js
  • openai-codex
  • openzeppelin
  • privy
  • solidity
  • supabase
  • tailwindcss
  • typescript
  • viem
  • wagmi
  • xstocks
Share this project:

Updates