Skip to content

Percobain/ppn.fi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PPN.fi — Principal-Protected Yield with Asset Exposure

Deposit USDC. Pick any asset. If it goes up, you win. If it goes down, you get every dollar back.

ppnfi.xyz | Built on Base | RWA Perps & Vaults


The Problem We're Solving

There are two types of people in finance, and both are stuck:

The saver has $50,000 in a savings account earning 3-4%. They watch Bitcoin go 5x, gold hit all-time highs, Miami real estate climb 56% in 5 years — and they do nothing. Why? Because they cannot afford to lose their principal. They have bills, rent, family. One bad trade and they're wiped out. So they sit on the sidelines and watch inflation eat their savings.

The degen apes into 50x leveraged positions, hits a 10x once, gets liquidated three times, and ends up net negative. They have the appetite for risk but no protection from ruin. One bad day erases months of gains.

Both of these people need the same thing: a way to get upside exposure to assets without any possibility of losing their deposit.

This product exists in TradFi. It's called a Principal-Protected Note. Goldman Sachs, JPMorgan, and every major bank sells them to high-net-worth clients. Minimum investment: $100,000-$1,000,000. Fees: 2-5%. Available to: the wealthy.

PPN.fi brings this to everyone, powered by DeFi, starting at any amount, on Base.


How It Works

The math is borrowed from TradFi zero-coupon bond pricing — but instead of a bank's treasury desk, we use DeFi yield protocols (Morpho, Aave V3, Moonwell) to guarantee the principal.

You deposit $10,000 USDC
  |
  +-- $9,753 goes into a Morpho/Aave/Moonwell yield vault
  |     This amount is calculated so it grows back to exactly
  |     $10,000 at maturity. That's the zero-coupon bond math:
  |     PV = FV / (1 + rate)^time
  |
  +-- $247 is your "exposure budget"
        This is yield you haven't earned yet.
        It's used as margin to open a leveraged position
        on whatever asset you chose — gold, Bitcoin,
        Miami real estate, anything.

At maturity:
  The vault returns:     $10,000 (guaranteed by yield math)
  The position returns:  profit if asset went up, or $0 if liquidated
  YOU GET BACK:          $10,000 + any profit. Never less than $10,000.

The worst case is you get your full deposit back. The best case is your deposit plus leveraged gains on the asset. You literally cannot lose money on your principal.


We Proved It With 12.5 Million Simulations

We didn't just build the math and hope it works. We backtested every single possible scenario against real historical price data from three independent sources.

Data sources and coverage:

  • Gold and Silver — Yahoo Finance COMEX Futures (GC=F, SI=F). 4,072 daily closing prices from January 4, 2010 to March 13, 2026. Over 16 years of real commodity futures data.
  • Bitcoin, Ethereum, Solana, XRP — CoinGecko Pro API. Up to 4,702 daily prices going back to April 2013. Full crypto history including multiple bull/bear cycles.
  • 19 US Real Estate Markets — Parcl Labs price feed API. 1,827 daily price-per-sqft index values from March 2021 to March 2026. Cities: New York, Brooklyn, Los Angeles, San Francisco, San Diego, Miami, Miami Beach, Austin, Denver, Atlanta, Chicago, Boston, Washington DC, Pittsburgh, Charlotte, Tampa, Las Vegas, Nashville, and US National index.

Total: 58,196 real-world daily price data points across 25 assets.

APYs are not hardcoded. Every backtest run fetches live yield rates from DeFiLlama's API (yields.llama.fi/pools) for Aave V3, Morpho Steakhouse, and Moonwell on Base. The backtest uses whatever the current rates are — right now that's Aave at 2.46%, Morpho at 3.62%, and Moonwell at 3.43%.

We tested every possible combination: 25 assets, 3 yield protocols, 11 leverage levels (1x through 100x), 7 durations (30 days through 365 days), and every possible entry date in each asset's history. That's 5,775 unique configurations and 12,523,401 individual simulations.

The result: 100.0000% principal protection. Not a single simulation — out of 12.5 million — lost a dollar of the user's deposit. The zero-coupon bond math holds perfectly in every scenario.

Which Markets Work Best

With current live yields from Morpho/Aave/Moonwell (2.5-3.6% APY), four markets deliver over 10% annualized returns with less than 20% liquidation risk:

Solana is the strongest performer at +44.5% annualized with zero liquidation risk, using Morpho at just 1x leverage over 365 days. The asset's own appreciation does all the heavy lifting — you don't even need leverage.

XRP delivers +28.7% annualized, also at 1x leverage with zero liquidation. Same story — the crypto bull trend makes even conservative configs wildly profitable.

Ethereum returns +23.0% annualized at 1x/365d with zero liquidation risk. The exposure budget from Morpho's 3.62% APY is enough to capture meaningful ETH upside without any leverage risk.

Bitcoin is the tightest pass at +10.4% annualized with 19.9% liquidation, requiring 2x leverage over 270 days on Morpho. Bitcoin's lower volatility relative to altcoins means you need a touch of leverage to beat 10%, but it still works.

Real estate markets are all profitable but don't clear the 10% annualized bar at current yield levels. Miami, Tampa, Las Vegas, Charlotte, and Nashville are the top performers — their low volatility (2-7% annualized vs 50-80% for crypto) means dramatically lower liquidation rates, which makes them ideal when yields return to 5-6%+ range. At those rates, real estate PPNs become the killer product because you can safely run 10-20x leverage with under 20% liquidation.

Gold at +21.4% annualized with 9.9% liquidation was a standout in earlier tests at higher APYs. With 16 years of data showing +352% total return (from $1,117 to $5,061 per ounce), gold remains the best risk-adjusted PPN asset when yield conditions improve.


The Platform: RWA Perps & Vaults

PPN.fi isn't just the principal-protected product. It's a full RWA perpetuals exchange with a liquidity vault system that makes everything work.

RWA Perpetual Markets

We operate on-chain perpetual swap markets for real-world assets that most DeFi platforms can't touch:

Real Estate — 19 US city price-per-sqft indexes powered by Parcl Labs oracle feeds. You can go long or short on New York, Miami, San Francisco, Las Vegas — any major US market. These are the same indexes that institutional real estate funds track, now available to anyone with a wallet.

Commodities — Gold (XAU), Silver (XAG), WTI Crude Oil, Natural Gas. Real COMEX futures-grade pricing via Yahoo Finance feeds.

Crypto — Bitcoin, Ethereum, Solana, XRP with CoinGecko Pro data feeds.

Forex — USD/INR, EUR/USD, GBP/USD for emerging market and major pair exposure.

PPN positions trade on these perp markets. But anyone can also trade them directly — the PPN product and the perp exchange feed each other.

Liquidity Vaults — How LPs Earn

The vault is the engine that makes everything possible. LPs deposit USDC and become the counterparty to every PPN position and every perp trade on the platform.

How the vault makes money:

Every time a user opens or closes a position, the vault collects a trading fee (0.05-0.1%). Every leveraged position that gets liquidated — and our backtest shows that happens frequently at higher leverage — the vault captures the remaining margin. Perpetual markets charge periodic funding rates that flow to LPs. And there's a bid/ask spread on execution.

Why real estate PPNs are a goldmine for vault LPs:

This is the insight that makes the whole system work. Real estate indexes have 2-7% annualized volatility compared to 50-80% for crypto. This means the vault's risk as a counterparty is dramatically lower on RE positions. More users are willing to take leveraged RE positions because the liquidation risk is low, which means more volume and more fees. Positions stay open longer because they don't get liquidated as often, generating ongoing funding fees. The vault becomes a steady yield-generating machine powered by predictable real estate appreciation.

How APY is determined:

Vault APY equals total fees collected plus liquidation proceeds plus funding income, divided by total vault TVL. It's dynamic — more trading volume means higher APY. The protocol doesn't promise a fixed rate; it routes real trading revenue to LPs.

Revenue split: 70% to LP vault (driving APY for liquidity providers), 20% to protocol treasury, 10% to insurance fund for edge cases.

The User Economics

For the PPN user: You pay a small creation fee and trading fee. You get principal protection plus leveraged upside. Worst case: $10,000 in, $10,000 out minus fees. Best case: $10,000 in, $10,000 plus leveraged gains out.

For the LP: You deposit USDC and earn a share of all trading fees, liquidation proceeds, and funding income generated by every position on the platform. Your risk is temporary drawdown if many positions profit at the same time — but the house has a structural edge because most leveraged positions eventually get liquidated.


WhatsApp + Twilio Integration

PPN.fi is accessible directly through WhatsApp via Twilio's messaging API. Users can manage their entire portfolio without ever opening a browser.

How it works: Users message the PPN.fi WhatsApp number. The Elsa AI agent service parses natural language intents — "hedge $5000 on Miami real estate for 6 months" or "what's my portfolio balance" — and executes accordingly. The system handles multi-step confirmation flows (you confirm before any trade executes), wallet linking (connect your existing wallet or get a BitGo custodial wallet created automatically), and real-time trade notifications.

Why WhatsApp matters: In emerging markets — India, Southeast Asia, Latin America, Africa — WhatsApp is the primary internet. These are exactly the users who need principal protection the most. They can't afford to lose savings, they don't use MetaMask, but they use WhatsApp every day. Meeting users where they are, in the app they already live in, removes every friction point between "I want to earn yield safely" and actually doing it.

The Twilio integration handles webhook-based message routing, async processing for operations that take longer than 15 seconds (like on-chain transactions), and outbound notifications when positions mature or get liquidated.


Integration Partners

Morpho — Primary Yield Engine

Morpho Steakhouse vault on Base provides the yield that powers the zero-coupon bond math. Currently at 3.62% APY with $411M in TVL, it's the deepest and most reliable USDC yield source on Base. The exposure budget — the money that funds your leveraged position — comes directly from Morpho's yield. Higher Morpho rates mean bigger exposure budgets mean more upside for users.

Aave V3 — Battle-Tested Redundancy

The most proven lending protocol in DeFi with billions in TVL across chains. Aave V3 on Base provides a 2.46% APY baseline. Having Aave as an option means if Morpho ever has issues — smart contract pause, utilization spike, rate compression — positions can route to Aave seamlessly. It's the safety net behind the safety net.

Moonwell — Base-Native Yield

Moonwell is built specifically for Base, offering 3.43% APY on USDC. Being Base-native means deeper integration, lower latency, and alignment with the Base ecosystem. For users who want maximum Base-native exposure, Moonwell is the natural choice.

Parcl Labs — Real Estate Oracle

Parcl provides the price feeds that make real estate perpetuals possible. Their daily dollar-per-sqft index for 19 US cities is the data backbone of our RE markets. Without Parcl, there's no way to create leveraged real estate exposure on-chain. This is the integration that unlocks the entire RWA thesis — tokenized access to the $45 trillion US housing market.

Elsa AI Agents — Intelligent Automation

AI-powered agents that parse natural language trade intents, manage PPN positions, optimize entry timing, and handle the WhatsApp interaction flow. Elsa bridges the gap between "I want to hedge my savings" and the actual DeFi transaction — users don't need to understand leverage, duration, or yield protocols. They just say what they want and Elsa handles the rest.

BitGo — Institutional Custody

For users who don't have a Web3 wallet (which is most people in the world), BitGo provides custodial wallet infrastructure. The WhatsApp flow can automatically create a BitGo-secured wallet, fund it, and manage positions — all without the user ever touching a seed phrase. This is critical for mainstream adoption. BitGo's multi-sig cold storage ensures large deposits and vault TVL are protected at institutional grade.

ENS — Human Identity

Ethereum Name Service integration means users see their .eth names throughout the platform instead of 0x addresses. It's a small thing that makes the experience feel human. When you're managing real money, seeing "alice.eth" instead of "0x7f3a..." matters.

Base — The Foundation

Coinbase's L2 was chosen for specific reasons: gas costs around $0.01 per transaction (PPNs require multiple contract calls, so this matters), fast confirmation times for a financial product, Coinbase's 100M+ user distribution channel for future growth, and a rapidly growing RWA ecosystem where Parcl, Morpho, and Moonwell all have strong presence. PPN.fi is designed as a Base DeFi RWA Primitive — a foundational building block that other protocols can compose with.


How We Got Here — The Ideation Process

We started with a simple observation: DeFi yields (5-15%) are structurally higher than TradFi savings rates (3-4%). That delta — even just 2-3 percentage points — is enough to fund meaningful leveraged exposure if you apply the right math.

The zero-coupon bond formula has been used by investment banks for decades. Present Value equals Future Value divided by (1 + rate) to the power of time. It's not exotic. It's not novel. It's the most boring, proven formula in finance. What's novel is applying it to DeFi yields and on-chain execution.

We then asked: what assets should we offer? The obvious answer was crypto — but crypto is volatile and most positions get liquidated. So we looked at real estate indexes and commodities. Real estate has 2-7% annualized volatility versus 50-80% for crypto. That means at the same leverage level, real estate positions survive dramatically more often. A 20x leveraged Miami real estate PPN has a 36% liquidation rate. A 20x leveraged Bitcoin PPN has an 81% liquidation rate. Same leverage, same math, completely different outcomes.

That insight — that real estate is the killer use case for PPNs — led us to Parcl Labs and the 19 US city indexes. It also shaped the vault economics: real estate PPNs generate steady, predictable fee income for LPs because positions don't blow up every week like crypto positions do.

We built the backtest engine to validate everything with real data before writing a single line of smart contract code. The engine runs the exact same math the contracts will execute, against every possible entry date for every asset, across every leverage and duration combination. 12.5 million simulations later, we had proof that the math holds in 100% of cases.

The WhatsApp integration came from asking: who actually needs principal protection the most? Not crypto natives — they're comfortable with risk. It's the 4 billion people in emerging markets who save in local currency, watch it depreciate, and have no access to structured financial products. They all have WhatsApp. So we built the product to work there.


Tech Stack

Frontend: React 19 with Vite, Tailwind CSS, shadcn/ui components, Framer Motion animations, Recharts for data visualization

Web3: Wagmi 2 and RainbowKit 2 for wallet connection, ethers.js 6 and viem 2 for contract interaction

Backend: Express 5 API server, Socket.io for real-time price streaming, Twilio SDK for WhatsApp messaging

Smart Contracts: Solidity 0.8.28 on Hardhat 2.27, deployed on Base

Yield Sources: Morpho Steakhouse, Aave V3, Moonwell — live APYs fetched from DeFiLlama

Price Feeds: Parcl Labs (real estate), Yahoo Finance via yfinance (metals), CoinGecko Pro (crypto)

AI: Elsa agent service with OpenAI NLP for WhatsApp intent parsing

Custody: BitGo for custodial wallet creation and management

Backtesting: Python 3 with yfinance, 12.5M simulations across 25 assets


Running the Backtest

cd backtest
pip install -r requirements.txt

# Full analysis — all 25 assets, live APYs, all configs
python run_full_analysis.py

# Quick test
python main.py --quick

# Real estate deep analysis
python analyze_re_ppn.py

# Real estate market analytics
python analyze_real_estate.py

All results are saved to backtest/results/ — JSON for raw data, CSV per asset, and detailed markdown reports ready to feed into Claude or any analysis tool.


The Bottom Line

PPN.fi takes a proven TradFi structure, powers it with DeFi yields, applies it to real-world assets, and delivers it through WhatsApp. The backtest proves it works — 12.5 million simulations, 25 assets, 16 years of data, zero principal losses. The vault economics create a sustainable fee machine for LPs. The real estate integration via Parcl Labs unlocks the largest asset class in the world for on-chain leveraged exposure with dramatically lower risk than crypto.

This isn't speculation. It's math.


PPN.fi — ppnfi.xyz

Built with data. Backed by math. Protected by design.

About

PPN.fi is a principal-protected DeFi protocol for earning upside on real-world and crypto assets without losing your principal. Built on Base using yield vaults and RWA perpetuals.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors