In traditional freelance platforms and escrow services, client funds sit completely idle during project execution. Whether it's a 1-month or 6-month project, the money locked in escrow earns zero interest while waiting for milestone approvals.
- $10,000 locked for 3 months β $0 earned in traditional escrow
- Lost opportunity cost β Clients could have earned 5% APY elsewhere
- Inefficient capital allocation β Billions locked globally earning nothing
- Trust barriers β Freelancers worry about payment delays while client funds earn nothing
This creates a lose-lose scenario where both parties sacrifice earning potential for security.
Yield-X is a modular, yield-generating escrow protocol on the Stellar blockchain that applications can plug into to automatically invest escrowed funds into Real World Assets (RWA) while maintaining full security and trustless execution.
- β Automatic Yield Generation - Escrowed funds are automatically deposited into OUSG (tokenized US Treasury bonds) earning 5% APY
- β Win-Win Model - Freelancers receive full payment + clients keep 100% of yield earned
- β Zero Trust Required - Smart contracts enforce milestone-based payments with blockchain security
- β Instant Settlement - No bank delays, near-zero transaction fees
- β Multi-Currency Support - Pay in XLM, USDC, or fiat tokens (INR, KES, NGN)
Example: You create a 3-month project worth $10,000 USDC
| Traditional Escrow | Yield-X |
|---|---|
| $10,000 locked, earning $0 | $10,000 β OUSG earning 5% APY |
| After 3 months: $0 interest | After 3 months: $125 yield earned |
| Freelancer gets: $10,000 | Freelancer gets: $10,000 |
| Client gets: $0 | Client keeps: $125 |
Everyone wins! Freelancers get paid securely and on time, clients earn passive income while waiting.
Yield-X is designed as a protocol you can plug into any application (web, mobile, backend) to escrow funds, earn yield, and release payments trustlessly. Below are two simple integration paths.
If you're building with React, you can wire directly into the existing hooks and helpers.
-
Connect Freighter in your app startup
// frontend/src/hooks/useWallet.ts const { address, connect } = useWallet(); useEffect(() => { if (!address) connect(); }, [address]);
-
Import contract hooks and call protocol methods
// Example: create a job and start yield import { useContracts } from "./src/hooks/useContracts"; export function CreateJobButton() { const { createJob, releasePayment, requestWithdrawPrincipal, claimYield, getYieldClaimTimeRemaining, } = useContracts(); async function handleCreate() { const tx = await createJob({ freelancer: "GAUCMH7KIOUZBPA5K4I7HMZV63XHSD36J7E5DH7TJXACWNWAROUMPRZZ", amount: "10000000", // 10 XLM (7-decimal) milestones: 3, asset: "XLM", }); // tx.id can be shown in a success modal } async function handleRelease(milestoneIndex: number) { await releasePayment({ jobId: "<job_id_bytes32>", milestoneIndex }); } async function handleTwoPhaseWithdraw() { await requestWithdrawPrincipal({ jobId: "<job_id_bytes32>" }); // Poll lockup until 0, then claim yield const remaining = await getYieldClaimTimeRemaining({ jobId: "<job_id_bytes32>", }); if (remaining === 0) await claimYield({ jobId: "<job_id_bytes32>" }); } return ( <div> <button onClick={handleCreate}>Create Job</button> <button onClick={() => handleRelease(0)}>Release Milestone 1</button> <button onClick={handleTwoPhaseWithdraw}>Claim Yield</button> </div> ); }
-
Listen for yield events and persist state
- The UI dispatches a custom
yieldPendingevent when the lockup starts. - Persist using localStorage keys (e.g.,
yieldx_pending_yield) for countdown continuity.
- The UI dispatches a custom
See frontend/src/hooks/useContracts.ts and frontend/src/lib/contracts.ts for ready-to-use wrappers.
Call the Soroban contracts directly from your server or CLI.
-
Configure contract addresses
- Escrow Core:
CCK5VICBIWM245Q5TLB2FXCJYKVPTLIIB4HO2QPESG7TOF3ZPCZRKCVA - Yield Harvester:
CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC - Liquidity Router:
CDTDGS22DS33NPH2GNE4UWPYEJD57MJN6DTPDZXLD46SIKNNCYNKNA3A
- Escrow Core:
-
Invoke contract methods
# Create job (Escrow Core) stellar contract invoke \ --id CCK5VICBIWM245Q5TLB2FXCJYKVPTLIIB4HO2QPESG7TOF3ZPCZRKCVA \ --source <CLIENT_ADDRESS> --network testnet -- create_job \ --arg freelancer:<ADDR> --arg amount:10000000 --arg milestones:3 --arg asset:XLM # Release payment for milestone stellar contract invoke \ --id CCK5VICBIWM245Q5TLB2FXCJYKVPTLIIB4HO2QPESG7TOF3ZPCZRKCVA \ --source <CLIENT_ADDRESS> --network testnet -- release_payment \ --arg job_id:<BYTES32> --arg milestone_index:0 # Two-phase yield claim (Yield Harvester) stellar contract invoke \ --id CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC \ --source <CLIENT_ADDRESS> --network testnet -- request_withdraw_principal \ --arg job_id:<BYTES32> # After lockup expiry stellar contract invoke \ --id CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC \ --source <CLIENT_ADDRESS> --network testnet -- claim_yield \ --arg job_id:<BYTES32>
-
Optional: Multi-currency deposits
- Swap into the escrow asset via the Liquidity Router before
create_job. - Example:
swap(from_asset, to_asset, amount)to convert INR/KES/NGN β USDC/XLM.
- Swap into the escrow asset via the Liquidity Router before
Integration checklist:
-
Connect wallet or signing key management
-
Provide freelancer address, amount, milestones, and asset
-
Handle two-phase withdrawals (principal now, yield after lockup)
-
Persist job and yield state for UX continuity
-
β Automatic Yield Generation - Escrowed funds are automatically deposited into OUSG (tokenized US Treasury bonds) earning 5% APY
-
β Win-Win Model - Freelancers receive full payment + clients keep 100% of yield earned
-
β Zero Trust Required - Smart contracts enforce milestone-based payments with blockchain security
-
β Instant Settlement - No bank delays, near-zero transaction fees
-
β Multi-Currency Support - Pay in XLM, USDC, or fiat tokens (INR, KES, NGN)
Example: You create a 3-month project worth $10,000 USDC
| Traditional Escrow | Yield-X |
|---|---|
| $10,000 locked, earning $0 | $10,000 β OUSG earning 5% APY |
| After 3 months: $0 interest | After 3 months: $125 yield earned |
| Freelancer gets: $10,000 | Freelancer gets: $10,000 |
| Client gets: $0 | Client keeps: $125 |
Everyone wins! Freelancers get paid securely and on time, clients earn passive income while waiting.
Yield-X uses a three-layer smart contract system on Stellar/Soroban:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CLIENT CREATES JOB β
β (e.g., $10,000 USDC, 3 milestones, 3 months) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββ
β 1. ESCROW CORE CONTRACT β
β - Validates job parameters β
β - Creates milestone structure β
β - Transfers USDC from client β
β - Calls Yield Harvester β
ββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββ
β 2. YIELD HARVESTER CONTRACT β
β - Receives $10,000 USDC β
β - Swaps USDC β OUSG via DEX β
β - Tracks principal + yield β
β - Earns 5% APY automatically β
ββββββββββββββββββββββββββββββββββββββ
β
βΌ
ββββββββββββββββββββββββββββββββββββββ
β 3. LIQUIDITY ROUTER CONTRACT β
β - Enables multi-currency swaps β
β - Uses Stellar DEX liquidity β
β - Supports XLM, USDC, fiat tokens β
ββββββββββββββββββββββββββββββββββββββ
- Purpose: Manages job lifecycle, milestone tracking, and payment releases
- Key Functions:
create_job()- Creates job with milestones, transfers funds to Yield Harvesterapprove_milestone()- Client approves completed workrelease_payment()- Triggers payment from Yield Harvester to freelancercancel_job()- Refunds client if project cancelled
- Contract Address:
CCK5VICBIWM245Q5TLB2FXCJYKVPTLIIB4HO2QPESG7TOF3ZPCZRKCVA
- Purpose: Manages yield generation via OUSG Real World Asset tokens
- Key Functions:
track_deposit()- Records principal amount depositedwithdraw_to()- Withdraws principal + yield, sends to freelancer and clientrequest_withdraw_principal()- Initiates 30-second lockup for yield claimclaim_yield()- Transfers accrued yield to client after lockup
- Yield Calculation: 5% APY with daily compounding
- Contract Address:
CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC
- Purpose: Multi-currency support via Stellar DEX integration
- Key Functions:
swap()- Converts between XLM, USDC, and other assetsget_best_path()- Finds optimal swap route
- Contract Address:
CDTDGS22DS33NPH2GNE4UWPYEJD57MJN6DTPDZXLD46SIKNNCYNKNA3A
1. Client creates job via UI (e.g., $10,000 USDC, 3 milestones)
2. Client signs transaction in Freighter Wallet
3. Escrow Core contract executes:
- Validates inputs (client, freelancer, amount, asset)
- Creates job metadata with 3 milestones ($3,333 each)
- Calls token.transfer() via env.invoke_contract()
- Transfers $10,000 USDC: Client β Yield Harvester
4. Yield Harvester receives funds:
- Records principal: $10,000
- Swaps USDC β OUSG
- Begins earning 5% APY
1. Freelancer submits proof of work for Milestone 1
2. Client approves milestone via UI
3. Client clicks "Release Payment"
4. Escrow Core executes:
- Validates milestone is approved
- Calls YieldHarvester.withdraw_to()
- Passes: principal ($3,333), freelancer address, client address
5. Yield Harvester calculates:
- Principal: $3,333
- Accrued yield (prorated): ~$33.33 (1% for 1 month)
- Total: $3,366.33
6. Transfers execute:
- Freelancer receives: $3,333 (principal)
- Client receives: $33.33 (yield earned)
7. Remaining balance continues earning yield
Tech Stack:
- React 18 with TypeScript for type safety
- Vite as build tool for fast development
- Tailwind CSS for modern styling
- Framer Motion for smooth animations
- React Router DOM for navigation
- Freighter Wallet integration for Stellar transactions
Key Components:
ClientDashboard.tsx- Job management, yield tracking, milestone approvalFreelancerDashboard.tsx- Job browsing, proposal submission, payment historyCreateJob.tsx- Multi-step job creation form with asset selectionJobDetails.tsx- Real-time milestone tracking and payment releases
Contract Integration:
lib/contracts.ts- Contract function wrappers (create job, release payment, claim yield)hooks/useContracts.ts- React hooks for contract interactionsconfig/contracts.ts- Contract addresses and network configuration
Language: Rust
Platform: Stellar Soroban (Stellar's smart contract platform)
Contract Structure:
// escrow_core/src/lib.rs
pub struct Job {
pub job_id: BytesN<32>,
pub client: Address,
pub freelancer: Address,
pub total_amount: i128,
pub asset_address: Address,
pub milestones: Vec<Milestone>,
pub status: JobStatus,
pub yield_earned: i128,
}
pub struct Milestone {
pub milestone_id: u32,
pub amount: i128,
pub proof_url: String,
pub status: MilestoneStatus, // Pending, Approved, Paid
}Problem: Initial implementation used TokenClient::transfer() which failed silently because client signature didn't authorize token transfers.
Solution: Switched to env.invoke_contract() which properly handles authorization chains:
// BEFORE (Failed)
let token_client = token::TokenClient::new(&env, &asset_address);
token_client.transfer(&client, &yield_harvester, &total_amount);
// AFTER (Fixed)
let mut transfer_args = Vec::new(&env);
transfer_args.push_back(client.clone().into_val(&env));
transfer_args.push_back(yield_harvester.clone().into_val(&env));
transfer_args.push_back(total_amount.into_val(&env));
env.invoke_contract::<()>(
&asset_address,
&Symbol::new(&env, "transfer"),
transfer_args,
);Reference: PAYMENT_FLOW_FIX.md
Problem: OUSG redemptions require a 30-second lockup period for RWA compliance.
Solution: Implemented two-phase withdrawal:
request_withdraw_principal()- Releases principal immediately, locks yield for 30 secondsclaim_yield()- Transfers yield after lockup expires
Reference: YIELD_CLAIM_INTEGRATION.md
Problem: Needed to support XLM, USDC, and future fiat tokens without redeploying contracts.
Solution: Liquidity Router contract with dynamic routing via Stellar DEX:
pub fn swap(
env: &Env,
from_asset: Address,
to_asset: Address,
amount: i128,
min_output: i128,
) -> i128- Freighter Wallet browser extension
- Stellar testnet account with XLM (Get from Friendbot)
- Node.js 18+ and npm
# Clone repository
git clone https://github.com/sukrit-89/Flowpay.git
cd Flowpay
# Install frontend dependencies
cd frontend
npm install
# Configure environment (optional - testnet contracts pre-configured)
cp .env.example .env
# Start development server
npm run devVisit http://localhost:3000
- Connect Wallet - Click "Connect Wallet" and approve Freighter
- Create Job:
- Navigate to "Create Job"
- Enter freelancer address (e.g.,
GAUCMH7KIOUZBPA5K4I7HMZV63XHSD36J7E5DH7TJXACWNWAROUMPRZZ) - Amount: 10 XLM
- Milestones: 3
- Click "Create Job" and sign transaction
- Verify Deposit:
stellar contract invoke --id CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC \ --source deployer --network testnet -- get_total_deposits # Should show deposited amount - Approve Milestone - Navigate to job details, click "Approve Milestone 1"
- Release Payment - Click "Release Payment" and sign transaction
- Verify Freelancer Received Funds - Check freelancer balance on Stellar Expert
| Contract | Address |
|---|---|
| Escrow Core | CCK5VICBIWM245Q5TLB2FXCJYKVPTLIIB4HO2QPESG7TOF3ZPCZRKCVA |
| Yield Harvester | CBMU2XVMEJWJTXZBACTBJRGCFPXJCGUNT2VEENSVPN63G4MSMUDRBSMC |
| Liquidity Router | CDTDGS22DS33NPH2GNE4UWPYEJD57MJN6DTPDZXLD46SIKNNCYNKNA3A |
Token Addresses:
- XLM (Wrapped Native):
CDLZFC3SYJYDZT7K67VZ75HPJVIEUVNIXF47ZG2FB2RMQQVU2HHGCYSC - USDC:
CBIELTK6YBZJU5UP2WWQEUCYKLPU6AUNZ2BQ4WWFEIE3USCIHMXQDAMA
IMPORTANT: These are the primary test accounts used for demonstrations. Check these addresses on Stellar testnet to verify transactions.
| Role | Account Address |
|---|---|
| π· Client Account | GD2LJQHARPMQXTNP2CVGMAZ7SROW3O46K77JEZPPTLT4QXHLE7XI5VFC |
| πΆ Freelancer Account | GAUCMH7KIOUZBPA5K4I7HMZV63XHSD36J7E5DH7TJXACWNWAROUMPRZZ |
Quick Links:
View All Contracts on Stellar Expert
- π¨ Modern Animated UI - Smooth transitions with Framer Motion
- πΎ Wallet Persistence - Auto-reconnect on page reload
- π Live Statistics - Animated counters with CountUp.js
- π― Role-Based Navigation - Sleek sidebar adapts to user role
- π Gradient Effects - Dynamic background animations
- π± Responsive Design - Optimized for mobile, tablet, desktop
- π Toast Notifications - Real-time feedback for all actions
Color Scheme:
- Primary: Orange/Coral (#F97316)
- Background: Pure Black (#000000)
- Surface: Dark Gray (#0F0F0F)
- Text: White (#FFFFFF) with gray variations
- Core escrow functionality with milestone tracking
- OUSG yield integration (5% APY)
- Multi-currency support (XLM, USDC)
- Testnet deployment
- Modern animated UI
- Wallet persistence
- Authorization flow fixes
- Security audit (pre-mainnet)
- Mainnet deployment
- Dispute resolution system
- Freelancer reputation/rating system
- Mobile app (React Native)
- Fiat on/off ramps
- Integration with OpenEden for real OUSG
| Currency | Symbol | Type | Status |
|---|---|---|---|
| Stellar Lumens | XLM | Native | β Live |
| USD Coin | USDC | Stablecoin | β Live |
| OUSG | OUSG | RWA Token | β Live |
| Indian Rupee | INR | Fiat Token | π Coming Soon |
| Kenyan Shilling | KES | Fiat Token | π Coming Soon |
| Nigerian Naira | NGN | Fiat Token | π Coming Soon |
- β Milestone-based escrow prevents payment disputes
- β Smart contract authorization ensures only authorized parties can execute actions
- β Trustless execution - no centralized party controls funds
- β Battle-tested Stellar blockchain infrastructure
- β Real World Assets (OUSG) backed by US Treasury bonds
β οΈ Testnet only - full security audit required before mainnet deployment
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Make your changes with clear commit messages
- Add tests if applicable
- Push to branch (
git push origin feature/amazing-feature) - Open Pull Request with detailed description
MIT License - see LICENSE file for details.
- Stellar Development Foundation - For Soroban smart contract platform
- Ondo Finance - For OUSG tokenization and RWA infrastructure
- Freighter Wallet Team - For seamless wallet integration
- Stellar Community - For feedback and support
- Website: yield-x.io
- Twitter: @yieldx
- Discord: Join our community
- Email: hello@yield-x.io
- GitHub: github.com/sukrit-89/Flowpay
- Payment Flow Fix Details - How we solved authorization issues
- Yield Claim Integration - 30-second lockup implementation
- Contract Addresses - All deployed contract addresses
- Deployment Guide - How to deploy contracts
- Add USDC Guide - How to add USDC to your wallet
Built with β€οΈ on Stellar
Earn while you pay. That's the Yield-X difference.
Fun Fact: If all freelance escrow platforms globally ($10B+ locked annually) used Yield-X, clients would collectively earn $500M+ per year in passive yield while still paying freelancers the exact same amount. π