Skip to content

Latest commit

 

History

32 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

yi3ld | TartanHacks 2026

Project Overview

yi3ld is a mobile banking application that brings DeFi yields to everyday checking accounts. Unlike traditional banks that pay 0% interest, yi3ld enables users to earn 3-10% APY on their deposits through automated stablecoin lending on AAVE and Kamino liquidity pools, while maintaining full liquidity, instant withdrawals, and supporting cross-border fiat payments.

The Problem

$18 trillion sits in U.S. checking accounts earning 0% interest while inflation erodes purchasing power at approximately 3% annually. Traditional savings accounts offer negligible yields, and international transfers remain expensive and slow.

Our Solution

yi3ld combines the convenience of traditional banking with the power of decentralized finance through:

  • Earning 3-10% APY on deposits through DeFi protocols
  • Instant liquidity with no lock-up periods
  • International transfers in 3 seconds via XRP Ledger
  • Full transparency with on-chain verification
  • Clean, minimalist mobile interface

Architecture

System Design

The application consists of three main layers:

Presentation Layer (React Native)

  • Waiting Room for fiat currency storage
  • Yielding Accounts for USDC-backed yield generation
  • International transfer interface

Backend Layer (Firebase)

  • User authentication via phone numbers
  • Account metadata and balance tracking
  • Transaction history
  • Real-time synchronization with blockchain

Blockchain Layer

  • Aave V3 for yield generation
  • Base Sepolia testnet for low-cost transactions
  • USDC stablecoin for deposits
  • XRP Ledger for cross-border payments

Data Flow

Deposit to Yield:

  1. User deposits fiat to Waiting Room (stored in Firebase)
  2. User transfers to Yielding Account
  3. System converts to USDC
  4. Deposits USDC to Aave V3
  5. User earns APY automatically
  6. Balance syncs from blockchain every 5 minutes

International Transfer:

  1. Sender initiates transfer in local currency
  2. System queries exchange rate
  3. Executes transfer via XRP Ledger
  4. Recipient receives in their local currency
  5. Settlement completes in 3-5 seconds

Technology Stack

Frontend

  • React Native with Expo
  • TypeScript for type safety
  • React Navigation for routing
  • Expo Vector Icons for UI elements

Backend

  • Firebase Authentication (Phone + SMS)
  • Cloud Firestore for data storage
  • Firebase Storage for encrypted keys

Blockchain

  • Ethers.js v6 for Ethereum interactions
  • Aave V3 protocol for yield
  • Base Sepolia testnet
  • USDC stablecoin
  • XRP Ledger for cross-border payments

Key Dependencies

  • ethers - Blockchain interactions
  • firebase - Backend services
  • react-native-get-random-values - Cryptographic polyfill
  • @ethersproject/shims - Ethers.js compatibility
  • @react-native-async-storage/async-storage - Persistent storage
  • expo-firebase-recaptcha - SMS verification

Project Structure

yi3ld/
├── src/
│   ├── components/
│   │   ├── Logo.tsx
│   │   └── WalletInfo.tsx
│   ├── screens/
│   │   ├── auth/
│   │   │   ├── PhoneAuthScreen.tsx
│   │   │   ├── VerifyCodeScreen.tsx
│   │   │   └── ProfileInputScreen.tsx
│   │   └── main/
│   │       ├── DashboardScreen.tsx
│   │       ├── DepositScreen.tsx
│   │       ├── ProfileScreen.tsx
│   │       ├── OpenAccountScreen.tsx
│   │       ├── SendMoneyScreen.tsx
│   │       ├── SendToYieldAccountScreen.tsx
│   │       └── DevFundingScreen.tsx
│   ├── services/
│   │   ├── auth.ts
│   │   ├── accounts.ts
│   │   ├── wallet.ts
│   │   ├── aave.ts
│   │   ├── xrpl.ts
│   │   ├── transfer.ts
│   │   ├── internationalTransfer.ts
│   │   └── yieldTransfer.ts
│   ├── navigation/
│   │   ├── AppNavigator.tsx
│   │   ├── AuthNavigator.tsx
│   │   ├── MainNavigator.tsx
│   │   └── types.ts
│   ├── context/
│   │   └── AuthContext.tsx
│   ├── hooks/
│   │   └── useAuth.ts
│   └── utils/
│       ├── countries.ts
│       ├── yieldPools.ts
│       └── utilFunctions.ts
├── FirebaseConfig.ts
├── App.tsx
├── package.json
└── .env

Key Features

Multi-Tier Yield Accounts

Users select from three risk-reward profiles

Waiting Room

A fiat currency holding account with zero yield that serves as an intermediary between traditional banking and DeFi. Supports USD, GBP, EUR, CAD, MXN, RUB, CNY, BRL, and AED.

Wallet Management

Each user receives one Ethereum wallet upon creating their first yielding account. All yielding accounts for that user share the same wallet address, with Firebase tracking logical ownership of funds.

International Transfers

Send money across borders using XRP Ledger technology:

  • Settlement time: 3 seconds
  • Transaction fee: $0.00001
  • Automatic currency conversion
  • Transparent exchange rates

Peer-to-Peer Yield Transfers

Transfer funds directly between yielding accounts. If the recipient does not have a matching account type, the system automatically creates one for them.

Blockchain Synchronization

Account balances automatically sync with blockchain state:

  • On application launch
  • Via pull-to-refresh
  • Every 5 minutes while app is active
  • After completing transactions

Multi-Currency Support

Native support for nine currencies with appropriate formatting and symbols. Waiting Room balances display in the user's local currency while yield accounts always display in USD as they are backed by USDC.

Database Schema

Users Collection

users/{userId}
  - phoneNumber: string
  - firstName: string
  - lastName: string
  - country: string
  - currency: string
  - currencySymbol: string
  - walletAddress: string (optional)
  - encryptedPrivateKey: string (optional)
  - walletCreatedAt: timestamp
  - createdAt: timestamp

Accounts Collection

accounts/{accountId}
  - userId: string
  - name: string
  - accountNumber: string
  - balance: number
  - type: 'checking' | 'savings' | 'waiting-room'
  - apy: number (optional)
  - poolId: string (optional)
  - protocol: string (optional)
  - chain: string (optional)
  - walletAddress: string (optional)
  - initialDeposit: number (optional)
  - totalYieldEarned: number (optional)
  - lastSynced: timestamp (optional)
  - createdAt: timestamp

Transactions Collection

transactions/{transactionId}
  - userId: string
  - type: string
  - fromAccount: string (optional)
  - toAccount: string (optional)
  - amount: number
  - amountSent: number (optional)
  - currencySent: string (optional)
  - amountReceived: number (optional)
  - currencyReceived: string (optional)
  - exchangeRate: number (optional)
  - txHash: string (optional)
  - xrplTxHash: string (optional)
  - blockchain: string (optional)
  - status: 'pending' | 'completed' | 'failed'
  - error: string (optional)
  - timestamp: timestamp

Smart Contract Integration

Aave V3 Contracts (Base Sepolia)

Addresses:

  • Pool: 0x07eA79F68B2B3df564D0A34F8e19D9B1e339814b
  • USDC: 0x036CbD53842c5426634e7929541eC2318f3dCF7e
  • aUSDC: 0xf53B60F4006cab2b3C4688ce41fD5362427A2A66

Primary Functions:

  • supply: Deposit USDC to earn yield
  • withdraw: Retrieve USDC plus accrued interest
  • getReserveData: Query current APY and pool statistics

Transaction Costs

Base Sepolia gas costs (at typical gas prices):

  • USDC approval: approximately $0.00005
  • Aave deposit: approximately $0.0002
  • Aave withdrawal: approximately $0.00018
  • Total round-trip: approximately $0.0004

Getting Started

Prerequisites

  • Node.js version 18 or higher
  • npm package manager
  • Expo CLI
  • iOS Simulator or Android Emulator
  • Alchemy account
  • Firebase project with Blaze plan

Installation Steps

  1. Install dependencies
npm install
  1. Configure environment variables

Create a .env file in the project root with the required variables listed in the Configuration section below.

  1. Start the development server
npx expo start
  1. Launch on desired platform

Press 'i' for iOS simulator or 'a' for Android emulator.

Configuration

Required Environment Variables

Blockchain Infrastructure:

  • ALCHEMY_API_KEY
  • BASE_SEPOLIA_RPC_URL
  • EXPO_PUBLIC_BASE_SEPOLIA_RPC_URL

Smart Contract Addresses:

  • EXPO_PUBLIC_AAVE_POOL_ADDRESS
  • EXPO_PUBLIC_USDC_ADDRESS
  • EXPO_PUBLIC_AUSDC_ADDRESS

Development Wallet (Testnet Only):

  • TEST_WALLET_PRIVATE_KEY
  • TEST_WALLET_ADDRESS
  • EXPO_PUBLIC_TEST_WALLET_PRIVATE_KEY
  • EXPO_PUBLIC_TEST_WALLET_ADDRESS

Security:

  • WALLET_ENCRYPTION_KEY

Firebase Configuration

  1. Create Firebase project at console.firebase.google.com
  2. Enable Phone Authentication
  3. Upgrade to Blaze plan (required for phone auth)
  4. Create Firestore database
  5. Set security rules to allow development access
  6. Add Firebase config to FirebaseConfig.ts

Alchemy Configuration

  1. Sign up at alchemy.com
  2. Create new app
  3. Select Base chain and Base Sepolia network
  4. Copy API key and RPC URL to .env

Test Tokens

Obtain Base Sepolia ETH from:

  • coinbase.com/faucets/base-ethereum-sepolia-faucet

Obtain test USDC from:

  • staging.aave.com/faucet (select Base Sepolia network)

Testing

Node.js Test Scripts

Test blockchain connection:

node test-connection.js

Fund user wallets:

node fund-user-wallet.js

Test Aave deposit:

node test-aave-deposit.js

Check current APY:

node check-apy.js

Setup XRPL wallet:

node setup-xrpl.js

In-App Development Tools

Dev Funding Screen: Access via Dashboard when running in development mode. Allows one-click funding of yield accounts with test USDC from your development wallet.

Quick Add to Waiting Room: Available in Waiting Room dropdown in development mode. Adds test funds to the waiting room for rapid testing.

How It Works

Account Creation

When a user creates their first yielding account, the system generates an Ethereum wallet. The wallet address is stored in Firebase along with the encrypted private key. All subsequent yielding accounts for that user share the same wallet.

Yield Generation

User funds deposited into yielding accounts are converted to USDC and deposited into Aave V3 lending pools. Interest accrues continuously based on the pool's current supply rate. The system periodically syncs blockchain balances with Firebase to display earned yield.

Balance Synchronization

A background service queries the blockchain every 5 minutes to check actual aToken balances. When the blockchain balance exceeds the Firebase balance, the difference is calculated as earned yield and the Firebase record is updated.

Currency Conversion

International transfers utilize exchange rates to convert between currencies. The sender's local currency is debited and the recipient's local currency is credited based on current market rates.

Account Matching

When transferring between yield accounts, the system checks if the recipient has a matching account type. If not, a new account of the same type is automatically created for the recipient.

Security Considerations

Current Implementation (Demo)

This hackathon prototype uses simplified security measures:

  • Private keys encrypted with Base64 and stored in Firebase
  • Open Firestore security rules for development
  • Testnet environment only
  • No insurance or audit coverage

Production Requirements

Before deploying with real funds, the following security measures are required:

  • Migration to AWS KMS or Google Cloud KMS for key management
  • Hardware Security Modules for key storage
  • Multi-signature wallets for administrative functions
  • Comprehensive smart contract audits
  • Bug bounty program
  • Insurance coverage for smart contract risks
  • Proper Firestore security rules with authentication
  • KYC and AML compliance
  • Money Transmitter Licenses

Database Structure

User Documents

Store user profile information including phone number, name, country preference, currency settings, and wallet information.

Account Documents

Track all accounts (waiting room and yielding) with balances, account types, pool assignments, protocol details, and synchronization timestamps.

Transaction Documents

Record all transfers including type, amounts, currency conversions, blockchain transaction hashes, and status.

Smart Contracts

Aave V3 Integration

The application interacts with Aave V3 deployed on Base Sepolia testnet. Key operations include:

Supply Operation: Deposits USDC into the lending pool, receiving aUSDC tokens in return. These tokens automatically increase in value as interest accrues.

Withdraw Operation: Burns aUSDC tokens to receive the underlying USDC plus all earned interest.

Reserve Data: Queries current supply rates, utilization, and other pool statistics to display accurate APY information to users.

Transaction Flow

Depositing to Aave requires two blockchain transactions:

  1. Approving Aave contract to spend USDC (ERC20 approval)
  2. Calling the supply function to deposit USDC

The approval step is optimized by approving a large amount upfront, avoiding repeated approval transactions.

Yield Pools

Conservative Tier

  • Protocol: AAVE USDC V3
  • Target APY: 4.2%

Balanced Tier

  • Protocol: Sentora PYUSD
  • Target APY: 6.48%

Aggressive Tier

  • Protocol: Elemental USDC Turbo
  • Target APY: 9.2%

Supported Currencies

The application supports nine currencies with automatic conversion:

  • USD (United States Dollar)
  • GBP (British Pound Sterling)
  • EUR (Euro)
  • CAD (Canadian Dollar)
  • MXN (Mexican Peso)
  • RUB (Russian Ruble)
  • CNY (Chinese Yuan)
  • BRL (Brazilian Real)
  • AED (UAE Dirham)

API Services

Authentication Service

Handles Firebase phone authentication, user creation, and session management. Creates user documents with encrypted wallet information.

Accounts Service

Manages CRUD operations for both waiting room and yielding accounts. Handles account creation, balance updates, and retrieval.

Wallet Service

Generates Ethereum wallets, encrypts private keys, stores wallet information in Firebase, and retrieves wallet instances for transactions.

Aave Service

Interfaces with Aave V3 smart contracts. Includes functions for checking balances, depositing USDC, withdrawing funds, and querying current APY rates.

XRPL Service

Manages international transfers and currency conversion. Currently uses mock implementation for demo purposes with architecture ready for production XRP Ledger integration.

Transfer Services

Three transfer services handle different transaction types:

  • Standard transfers between waiting room and yield accounts
  • International transfers with currency conversion
  • Peer-to-peer transfers between yield accounts

About

A mobile banking app that brings high yield DeFi lending protocols to everyday checking accounts through automated stablecoin lending on AAVE and Kamino liquidity pools | TartanHacks 2026

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages