FlashFlow is a comprehensive DeFi protocol that tokenizes real-world assets (RWA) into investment baskets, providing instant liquidity to asset originators and yield opportunities to investors through AI-powered risk assessment.
Public Endpoint: http://81.15.150.183:3000
VM ID: 019989d8-57b1-72e2-82ef-f1c61dfee9cd
Deployed on: Fluence Virtual Servers
- What It Does
- Technology Stack
- Why We Chose Our Stack
- Architecture
- Setup Instructions
- How to Run
- Usage Examples
- API Documentation
- Smart Contracts
- License
FlashFlow revolutionizes how real-world assets are tokenized and made liquid in the DeFi ecosystem. The platform enables:
- Instant Liquidity: Convert invoices, SaaS revenue, creator income, and rental properties into immediate cash
- AI Risk Assessment: Automated evaluation of asset quality and payment probability
- Smart Contract Automation: Transparent, trustless funding and repayment processes
- KYC Integration: Compliance through Self Protocol identity verification
- Diversified Asset Baskets: Invest in curated pools of real-world assets
- Risk-Adjusted Returns: AI-categorized baskets by risk level (Low: 6-8% APY, Medium: 8-12% APY, High: 12-18% APY)
- Real-time Analytics: Live performance tracking and yield monitoring
- Automated Distributions: Smart contract-based profit sharing
- Invoices & Receivables - Outstanding B2B payments
- SaaS Revenue Streams - Recurring software subscription income
- Creator Economy - Future revenue from content creators
- Real Estate Rentals - Property income streams
- Luxury Assets - High-value collectibles and luxury goods
- React 19 with Vite for fast development
- Tailwind CSS for responsive design
- Framer Motion for smooth animations
- Ethers.js for blockchain interactions
- Zustand for state management
- React Router for navigation
- Node.js with Express.js API server
- MongoDB with Mongoose ODM
- AWS S3 for file storage
- OpenAI/Google AI for risk assessment
- Sharp for image processing
- Solidity 0.8.28 smart contracts
- Hardhat development framework
- OpenZeppelin for security standards
- Self Protocol for KYC verification
- Fluence Virtual Servers for deployment
- Kadena EVM Testnet for blockchain operations
- Integra Connect for real estate data
We chose Kadena for several critical reasons:
- Scalability: Kadena's braided blockchain architecture provides unlimited scalability without sharding complexity
- Low Gas Fees: Significantly lower transaction costs compared to Ethereum mainnet
- EVM Compatibility: Seamless integration with existing Ethereum tooling and libraries
- Security: Proof-of-Work consensus with formal verification capabilities
- Enterprise Ready: Built for institutional adoption with compliance features
Kadena Implementation Details:
- Network: Kadena EVM Testnet (Chain 20)
- Chain ID: 5920
- RPC Endpoint:
https://evm-testnet.chainweb.com/chainweb/0.0/evm-testnet/chain/20/evm/rpc - Contract Address:
0xF76c7Afb2F15aFB086283251f67b9D9B2db83c92
We deployed on Fluence because:
- Decentralized Infrastructure: Peer-to-peer computing network that aligns with DeFi principles
- Cost Efficiency: Significantly lower costs than traditional cloud providers
- Global Distribution: Automatic geographic distribution for better performance
- Web3 Native: Built specifically for blockchain and DeFi applications
- Developer Experience: Simple deployment with excellent documentation
Fluence Deployment Details:
- VM ID:
019989d8-57b1-72e2-82ef-f1c61dfee9cd - Public IP:
81.15.150.183:3000 - Region: Distributed across Fluence network nodes
- Auto-scaling: Handles traffic spikes automatically
We integrated Integra for real estate assets because:
- RWA Specialization: Focused on real-world asset tokenization
- Property Data: Comprehensive real estate market data and analytics
- Compliance: Built-in regulatory compliance for property investments
- Institutional Grade: Trusted by major financial institutions
- API Integration: Seamless data feeds for property valuation and market analysis
Integra Integration:
- Real-time property valuations
- Market trend analysis
- Rental income verification
- Property ownership validation
- Legal compliance checks
- Node.js (v16.0.0 or higher)
- npm or yarn
- MongoDB (local or cloud)
- MetaMask wallet extension
- Git
git clone https://github.com/percobain/FlashFlow.git
cd FlashFlowcd server
cp .env.example .envEdit .env with your configuration:
# Database
DATABASE_URL=mongodb://localhost:27017/flashflow
MONGODB_URI=mongodb://localhost:27017/flashflow
# AI Services
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_google_api_key
# AWS S3
AWS_ACCESS_KEY_ID=your_aws_access_key
AWS_SECRET_ACCESS_KEY=your_aws_secret_key
AWS_REGION=us-east-1
S3_BUCKET_NAME=flashflow-assets
# Blockchain
SEPOLIA_API_KEY=your_private_key_without_0x
ALCHEMY_API_KEY=your_alchemy_api_key
# Server
PORT=3000
NODE_ENV=developmentcd ../client
cp .env.example .envEdit .env:
VITE_API_URL=http://localhost:3000
VITE_KADENA_RPC=https://evm-testnet.chainweb.com/chainweb/0.0/evm-testnet/chain/20/evm/rpc
VITE_CHAIN_ID=5920
VITE_CONTRACT_ADDRESS=0xF76c7Afb2F15aFB086283251f67b9D9B2db83c92cd server
npm installcd ../client
npm installcd ../contracts
npm installStart MongoDB locally or use a cloud provider like MongoDB Atlas.
# If using local MongoDB
mongod --dbpath /path/to/your/dbIf you want to deploy your own contracts:
cd contracts
npx hardhat compile
npx hardhat run scripts/deploy.js --network kdaTestnetcd server
npm run devServer runs on http://localhost:3000
cd client
npm run devFrontend runs on http://localhost:5173
Add Kadena EVM Testnet to MetaMask:
- Network Name: Kadena EVM Testnet
- RPC URL:
https://evm-testnet.chainweb.com/chainweb/0.0/evm-testnet/chain/20/evm/rpc - Chain ID:
5920 - Currency Symbol:
KDA - Block Explorer:
https://explorer.chainweb.com
cd client
npm run buildcd server
npm start# Build and run with Docker Compose
docker-compose up --buildcurl -X POST http://81.15.150.183:3000/api/assets \
-H "Content-Type: multipart/form-data" \
-F "[email protected]" \
-F "assetType=invoice" \
-F "amount=50000" \
-F "description=Outstanding payment from ABC Corp" \
-F "dueDate=2024-12-31"{
"success": true,
"assetId": "asset_abc123",
"riskScore": 75,
"basketId": "medium-risk",
"estimatedFunding": 42500,
"analysisResults": {
"paymentProbability": 0.85,
"timeToPayment": 45,
"riskFactors": ["Late payment history", "Industry volatility"]
}
}curl http://81.15.150.183:3000/api/baskets{
"baskets": [
{
"id": "low-risk",
"name": "Conservative Income",
"apy": 7.2,
"totalValue": 2500000,
"availableShares": 150000,
"riskScore": 25,
"assets": 45
},
{
"id": "medium-risk",
"name": "Balanced Growth",
"apy": 10.8,
"totalValue": 1800000,
"availableShares": 200000,
"riskScore": 55,
"assets": 32
}
]
}curl -X POST http://81.15.150.183:3000/api/investments \
-H "Content-Type: application/json" \
-d '{
"basketId": "medium-risk",
"amount": 10000,
"investorAddress": "0x742d35Cc6635Cb9532..."
}'import { useWeb3 } from './contexts/Web3Context';
const MyComponent = () => {
const { connectWallet, account, balance } = useWeb3();
return (
<div>
<button onClick={connectWallet}>
{account ? `Connected: ${account}` : 'Connect Wallet'}
</button>
{balance && <p>Balance: {balance} KDA</p>}
</div>
);
};import { investInBasket } from './services/web3Service';
const handleInvest = async (basketId, amount) => {
try {
const tx = await investInBasket(basketId, amount);
console.log('Investment successful:', tx.hash);
} catch (error) {
console.error('Investment failed:', error);
}
};curl -X POST http://81.15.150.183:3000/api/ai/analyze \
-H "Content-Type: application/json" \
-d '{
"assetType": "saas",
"monthlyRevenue": 50000,
"churnRate": 5,
"customerCount": 1200,
"growthRate": 15
}'{
"riskScore": 35,
"riskLevel": "low",
"basketRecommendation": "low-risk",
"analysis": {
"revenue_stability": 8.5,
"market_conditions": 7.8,
"growth_potential": 9.2,
"customer_retention": 8.9
},
"recommendations": [
"Strong recurring revenue model",
"Healthy customer retention",
"Growing market segment"
]
}Most endpoints require a valid Ethereum address or signed message for authentication.
- Development:
http://localhost:3000/api - Production:
http://81.15.150.183:3000/api
GET /assets- List all assetsPOST /assets- Create new assetGET /assets/:id- Get asset detailsPUT /assets/:id- Update assetDELETE /assets/:id- Delete asset
GET /baskets- List investment basketsGET /baskets/:id- Get basket detailsPOST /baskets/:id/invest- Invest in basket
GET /analytics/platform- Platform statisticsGET /analytics/baskets/:id- Basket performanceGET /analytics/user/:address- User portfolio
POST /ai/analyze- Analyze asset riskPOST /ai/market-prediction- Market trend analysis
- 100 requests per minute per IP
- 1000 requests per hour per authenticated user
Address: 0xF76c7Afb2F15aFB086283251f67b9D9B2db83c92
// Create new asset
function createAsset(
string memory assetId,
uint256 amount,
uint8 riskScore,
string memory assetType
) external
// Invest in basket
function investInBasket(
string memory basketId,
uint256 amount
) external
// Claim yields
function claimYields(string memory basketId) externalAddress: Deployed on Celo Testnet
// Start verification
function requestVerification() external
// Complete verification (called by Self Protocol)
function completeVerification(
address user,
bytes calldata verificationData
) externalAll contracts are verified on Kadena block explorer and can be viewed at:
https://explorer.chainweb.com/address/0xF76c7Afb2F15aFB086283251f67b9D9B2db83c92
cd server
npm testcd contracts
npx hardhat testcd client
npm run test# Start all services
npm run test:integration#!/bin/bash
# deploy.sh
# Install Fluence CLI
npm install -g @fluencelabs/cli
# Initialize Fluence project
fluence init
# Configure deployment
fluence deploy --vm-id 019989d8-57b1-72e2-82ef-f1c61dfee9cd
# Verify deployment
curl http://81.15.150.183:3000/healthNODE_ENV=production
PORT=3000
DATABASE_URL=mongodb+srv://user:[email protected]/flashflow
FLUENCE_VM_ID=019989d8-57b1-72e2-82ef-f1c61dfee9cd
PUBLIC_IP=81.15.150.183- Total Assets Under Management: $2.4B
- Active Investors: 45,000+
- Average APY: 12.3%
- Asset Categories: 5
- Successful Transactions: 98.7%
- Dashboard: http://81.15.150.183:3000/dashboard
- API Stats: http://81.15.150.183:3000/api/analytics/platform
- OpenZeppelin standards for secure implementations
- Reentrancy protection on all financial functions
- Access control for administrative functions
- Formal verification through Kadena's capabilities
- Helmet.js for HTTP security headers
- Rate limiting to prevent abuse
- Input validation on all endpoints
- JWT authentication for sensitive operations
- HTTPS encryption for all communications
- Environment variable protection
- Database encryption at rest
- Regular security audits