Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

34 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

YOLDR

You Only Lose (the) yield, Really.

Principal-protected DeFi on Flow โ€” your savings stay home while your yield goes adventuring.

Live App Flow Testnet GitHub


๐Ÿ”— Live Deployment

URL
Web App https://yoldr.vercel.app/
GitHub https://github.com/CodeswithrohStudio/yoldr
Flow Testnet Explorer https://testnet.flowscan.io/account/0x8401ed4fc6788c8a

๐Ÿงฉ Problem Statement

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.


โœ… Solution

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.


๐Ÿ— Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                        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   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Frontend Stack

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

๐Ÿ“œ Deployed Contracts (Flow Testnet)

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 Types

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

โšก Why Flow

Yoldr is built on Flow because the product requires specific blockchain properties that most chains can't deliver:

1. Resource-Oriented Programming (Cadence)

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.

2. Account Model with Capabilities

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.

3. Fast Finality at Low Cost

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.

4. Consumer-Grade Wallet UX

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.

5. NFTs as First-Class Financial Instruments

Yoldr uses NFTs not as collectibles but as financial primitives:

  • ShieldPosition NFT = the actual leveraged position (transferable, composable)
  • VaultPet NFT = your on-chain streak and XP tracker (evolves with behaviour)
  • BadgeMinter NFT = 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.

6. Ecosystem Alignment

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.


๐Ÿš€ Getting Started (Local Dev)

Prerequisites

  • Node.js 18+
  • Flow CLI (brew install flow-cli)
  • A Flow testnet account with FLOW (get free FLOW from faucet.onflow.org)

Install & Run

git clone https://github.com/CodeswithrohStudio/yoldr.git
cd yoldr
npm install
npm run dev

Open http://localhost:3000.

Cadence Transactions

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-account

Environment

No .env needed โ€” all contract addresses are hardcoded for testnet in src/lib/flow.ts. WalletConnect project ID is pre-configured.


๐Ÿ“ Project Structure

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

๐ŸŽฎ Gamification Layer

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

๐Ÿ“„ License

MIT โ€” built for the Flow Hackathon 2026.


Built with โค๏ธ on Flow

Live App ยท Contracts on Flowscan ยท GitHub

Releases

Packages

Contributors

Languages