You Only Lose (the) yield, Really.
Principal-protected DeFi on Flow โ your savings stay home while your yield goes adventuring.
| URL | |
|---|---|
| Web App | https://yoldr.vercel.app/ |
| GitHub | https://github.com/CodeswithrohStudio/yoldr |
| Flow Testnet Explorer | https://testnet.flowscan.io/account/0x8401ed4fc6788c8a |
DeFi has a participation problem โ not a yield problem.
Most people understand that crypto can generate high returns. What stops them is the fear of loss. A single bad trade can wipe out months of savings. Liquidations happen in minutes. Leverage is dangerous. And the complexity of managing positions is a full-time job.
At the same time, traditional savings accounts earn almost nothing. People are stuck choosing between:
- ๐ธ High yield, high risk โ leveraged DeFi positions that can blow up
- ๐ฆ Safe but worthless โ stablecoins and savings accounts that can't beat inflation
There is no middle ground. Until now.
Yoldr separates your principal from your risk. Here's how:
Your principal is locked in a vault. Forever safe. Only your daily yield ever leaves.
Using zero-coupon bond mathematics, Yoldr calculates exactly how much yield is needed to guarantee the return of your full deposit. That yield โ and only that yield โ is used to fund Shield positions: leveraged bets on Gold, BTC, ETH, and FLOW.
- ๐ If the shield wins โ you earn multiplied returns on top of your principal
- ๐ If the shield loses โ you lose only the yield. Your principal comes home.
This isn't a new concept in traditional finance โ it's the same math behind structured notes and principal-protected funds. Yoldr brings it on-chain, trustlessly, on Flow.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ USER (Flow Wallet) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ deposit FLOW
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Yoldr.cdc (Core Vault) โ
โ โ
โ โข Locks principal (zero-coupon guarantee) โ
โ โข Accrues yield at 5% APY (simulated, testnet) โ
โ โข harvestYield() โ returns accrued amount for shield margin โ
โ โข Streak tracking, XP points, rebalance engine โ
โโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ yield flows โ principal locked
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ShieldPosition.cdc โ โ MockPriceFeed.cdc โ
โ โ โ โ
โ NFT per position โ โ On-chain price oracle for: โ
โ GOLD / BTC / ETH / โโโโโโ GOLD, BTC, ETH, FLOW โ
โ FLOW at 1xโ5x lev โ โ (updateable by admin tx) โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ openShield() โ
โ P&L calculated โ
โ from price delta โ
โโโโโโโโโโโโโโฌโโโโโโโโโ
โ on close
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ BadgeMinter.cdc โ โ VaultPet.cdc โ
โ โ โ โ
โ Mints Shield Badge โ โ NFT companion bonded at deposit โ
โ NFT on position โ โ Griffin / Dragon / Phoenix / โ
โ close with P&L โ โ Narwhal โ
โ metadata on-chain โ โ Gains XP, levels up, evolves โ
โ isRare if >20% ret โ โ Mood reflects live shield P&L โ
โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Next.js 14 (App Router)
โโโ FCL (Flow Client Library) โ wallet auth, on-chain reads/writes
โโโ Zustand โ client state (vault, pet, positions)
โโโ Framer Motion โ animations, loading screens
โโโ Three.js โ landing page 3D scene
โโโ Tailwind CSS โ styling
โโโ Vercel โ deployment
All contracts are deployed to a single account on Flow Testnet:
Account: 0x8401ed4fc6788c8a
| Contract | Address | Description |
|---|---|---|
Yoldr |
0x8401ed4fc6788c8a |
Core vault โ deposits, yield accrual, withdrawal |
ShieldPosition |
0x8401ed4fc6788c8a |
NFT representing an open leveraged position |
VaultPet |
0x8401ed4fc6788c8a |
Companion NFT bonded to vault at deposit |
BadgeMinter |
0x8401ed4fc6788c8a |
Shield Badge NFT minted on position close |
MockPriceFeed |
0x8401ed4fc6788c8a |
On-chain price oracle for GOLD / BTC / ETH / FLOW |
Standard dependencies:
| Contract | Address |
|---|---|
NonFungibleToken |
0x631e88ae7f1d7c20 |
FungibleToken |
0x9a0766d93b6608b7 |
FlowToken |
0x7e60df042a9c0868 |
| Shield | Asset | Leverage | Expected APY | Guardian Pet |
|---|---|---|---|---|
| Gold Guardian | GOLD / USD | 5ร | ~5.8% | ๐ฆ Griffin |
| Crypto Cruiser | BTC / USD | 1ร spot | ~30% | ๐ Dragon |
| Ether Voyager | ETH / USD | 2ร | ~20% | ๐ฆ Phoenix |
| Flow Rider | FLOW / USD | 3ร | ~25% | ๐ฆ Narwhal |
Yoldr is built on Flow because the product requires specific blockchain properties that most chains can't deliver:
Every asset in Yoldr โ vault positions, pet NFTs, shield badges โ is a Cadence resource. Resources cannot be accidentally duplicated or destroyed. A Shield Position NFT is the position; it holds its own state and can only exist in one place at a time. This makes the principal-protection guarantee mathematically enforceable in the smart contract itself, not just promised in documentation.
Flow's capability-based access control lets Yoldr publish minter interfaces as public capabilities on the contract account (/public/vaultPetMinter, /public/shieldPositionMinter, /public/badgeMinter). This means any signed transaction can mint NFTs through a controlled interface โ no approvals, no allowances, no ERC-20 style footguns.
Yoldr's user loop is: deposit โ open shield โ wait โ close โ collect badge โ repeat. Each step is a transaction. On Flow Testnet, these confirm in ~2โ5 seconds for fractions of a cent. A product like Yoldr is unusable on Ethereum mainnet where a single deposit could cost $20โ$80 in gas. Flow makes the micro-interaction loop viable.
Flow Client Library (FCL) lets users connect with Blocto, Lilico, or WalletConnect in seconds โ no seed phrase required if using Blocto's custodial option. The target user for Yoldr is not a DeFi power user; it's someone who wants safety with upside. FCL's one-tap wallet connection removes the biggest onboarding barrier.
Yoldr uses NFTs not as collectibles but as financial primitives:
ShieldPositionNFT = the actual leveraged position (transferable, composable)VaultPetNFT = your on-chain streak and XP tracker (evolves with behaviour)BadgeMinterNFT = immutable trade history with P&L recorded on-chain
Flow's NonFungibleToken standard and Cadence's resource model make this natural. On EVM chains this would require complex workarounds to prevent double-spend on position NFTs.
Flow is building toward consumer DeFi. Yoldr is exactly that โ a DeFi product designed for people who have never opened MetaMask. The Flow ecosystem's focus on gaming, entertainment, and consumer apps means the future users Yoldr wants to reach are already coming to Flow.
- Node.js 18+
- Flow CLI (
brew install flow-cli) - A Flow testnet account with FLOW (get free FLOW from faucet.onflow.org)
git clone https://github.com/CodeswithrohStudio/yoldr.git
cd yoldr
npm install
npm run devOpen http://localhost:3000.
All transactions are in cadence/transactions/. Key admin commands:
# Update mock price feed (admin only)
flow transactions send cadence/transactions/updatePrice.cdc "BTC" 95000.0 \
--network testnet --signer testnet-account
# Setup minter capabilities (run once after deploy)
flow transactions send cadence/transactions/setupMinters.cdc \
--network testnet --signer testnet-accountNo .env needed โ all contract addresses are hardcoded for testnet in src/lib/flow.ts. WalletConnect project ID is pre-configured.
yoldr/
โโโ cadence/
โ โโโ contracts/
โ โ โโโ Yoldr.cdc # Core vault contract
โ โ โโโ ShieldPosition.cdc # Leveraged position NFT
โ โ โโโ VaultPet.cdc # Companion pet NFT
โ โ โโโ BadgeMinter.cdc # Shield badge NFT
โ โ โโโ MockPriceFeed.cdc # On-chain price oracle
โ โโโ transactions/
โ โโโ deposit.cdc # Create vault + mint pet
โ โโโ openShield.cdc # Open leveraged position
โ โโโ closeShield.cdc # Close position + mint badge
โ โโโ withdraw.cdc # Withdraw principal
โ โโโ updatePrice.cdc # Admin: update mock prices
โ โโโ setupMinters.cdc # Admin: publish capabilities
โโโ src/
โ โโโ app/
โ โ โโโ page.tsx # Landing page
โ โ โโโ app/
โ โ โโโ page.tsx # Dashboard
โ โ โโโ shields/ # Shield selector
โ โ โโโ badges/ # Badge collection
โ โ โโโ leaderboard/ # Global leaderboard
โ โโโ components/
โ โ โโโ DepositLoadingScreen # Storytelling TX loader
โ โ โโโ VaultPetDisplay # Pet with live mood states
โ โ โโโ YoldrFlowDiagram # Animated SVG explainer
โ โ โโโ BottomNav # Mobile navigation
โ โ โโโ StreakBar # XP / streak display
โ โ โโโ ToastNotifications # Transaction feedback
โ โโโ lib/
โ โ โโโ flow.ts # FCL config + all Cadence inline
โ โโโ store/
โ โโโ useYoldrStore.ts # Zustand global state
โโโ public/
โ โโโ logo.png # Yoldr logo
โ โโโ og-image.png # Open Graph share card
โ โโโ manifest.json # PWA manifest
โโโ flow.json # Flow CLI project config
Yoldr is built on the belief that good financial habits should feel like a game.
| Mechanic | How it works |
|---|---|
| Vault Pet | Choose your guardian at first deposit. It levels up with XP from every action. |
| Mood System | Pet animation reflects live P&L โ bounces when winning, shakes when taking hits |
| Daily Feed | Tap your pet once a day. Keeps your streak alive. Earns +10 XP. |
| Streak Counter | Consecutive daily check-ins multiply your yield bonus |
| Shield Badges | Every closed position mints a permanent on-chain badge with trade stats |
| Rare Badges | Positions with >20% return mint a rare badge (isRare: true on-chain) |
| Skin Evolution | Pet evolves: base โ silver (Lv.10) โ gold (Lv.25) โ legendary (Lv.50) |
| XP System | Deposit: +100 XP ยท Open Shield: +50 XP ยท Close Shield: +75 XP |
MIT โ built for the Flow Hackathon 2026.
Built with โค๏ธ on Flow