The freedom to pay with crypto, later.
FlexFi is a revolutionary Solana-based protocol that enables Buy Now, Pay Later (BNPL) transactions backed by cryptocurrency collateral. Unlike traditional BNPL services, FlexFi eliminates debt traps by requiring users to stake crypto assets as collateral.
- No toxic debt - Every payment is collateral-backed
- Automatic liquidation - No late fees, just collateral forfeit
- Flexible payment terms - 3, 4, 6, 12, 18, 24, or 36 installments
- Inclusive scoring - Your access grows as you use the platform
- Real-time updates - Score adjusts with payment behavior
- No bank dependency - Fully sovereign credit system
- Standard (Free): 7% fees, 3-6 month terms
- Silver ($50/year): 4% fees, up to 12 months
- Gold ($150/year): 3.5% fees, 0.5% cashback
- Platinum ($300/year): 3% fees, 1.5% cashback
- Bronze/Silver/Gold NFTs enhance card benefits
- Reduced fees and increased limits
- Unique utility beyond just aesthetics
- Earn on every purchase - Rewards invested automatically
- Multiple strategies - Staking, DeFi, RWA, Auto-compound
- Passive income while spending
| π§© Module | π― Purpose | π§ Key Functions | π° Financial Impact |
|---|---|---|---|
| π Staking | Collateral Management | β’ Deposit USDC β’ Lock periods (7-365 days) β’ Auto-liquidation |
Secures BNPL transactions |
| π BNPL | Buy Now Pay Later | β’ Create payment plans β’ Process installments β’ Handle defaults |
Core revenue generation |
| π Score | Credit Assessment | β’ Track payment history β’ Dynamic scoring (0-1000) β’ Risk evaluation |
Determines user limits |
| π³ Card | User Tiers | β’ 4 tier system β’ Annual fee management β’ Benefit allocation |
Subscription revenue |
| π¨ NFT | Enhanced Benefits | β’ Mint utility NFTs β’ Attach to cards β’ Dynamic perks |
Premium user engagement |
| π Yield | Reward System | β’ Auto-invest rewards β’ Multiple strategies β’ Compound returns |
User retention incentive |
π€ User β π Whitelist Check β π° Stake Collateral β π BNPL Eligible
β
π Score Tracking β π³ Card Benefits β π¨ NFT Enhancements β π Yield Generation
| Layer | Component | Access Level | Purpose |
|---|---|---|---|
| Layer 1 | Whitelist System | Admin-controlled | Platform access |
| Layer 2 | Wallet Verification | User signature | Transaction auth |
| Layer 3 | Collateral Check | Protocol logic | Risk management |
| Layer 4 | Score Validation | Dynamic scoring | Credit limits |
- Rust (latest stable)
- Solana CLI tools
- Node.js (for tests)
- Git
# Clone the repository
git clone https://github.com/your-org/flexfi-web3.git
cd flexfi-web3
# Build the program
cargo build-bpf
# Run tests
npm run test# Deploy to devnet
solana program deploy target/deploy/flexfi_program.so
# Verify deployment
solana program show <PROGRAM_ID>All users must be whitelisted to use FlexFi functions:
// Initialize whitelist (admin only)
InitializeWhitelist
// Add user to whitelist
AddToWhitelist { user_pubkey }Users stake USDC as collateral for BNPL transactions:
// Deposit staking
DepositStaking { amount, lock_days }
// Withdraw staking (after lock period)
WithdrawStaking { amount }Create and manage Buy Now, Pay Later contracts:
// Create BNPL contract
CreateBNPLContract {
amount,
installments,
payment_interval_days
}
// Make payment
MakeBNPLPayment
// Check for overdue payments
CheckRepaymentTrack and manage user credit scores:
// Initialize score (50 points default)
InitializeScore
// Update score (automatic)
UpdateScore { change }
// Get current score
GetScoretests/
βββ 1-verify-wallet-whitelisted.js # Verify wallet whitelist status
βββ 2-test-staking-with-backend.js # Test staking functionality
βββ 3-test-score.js # Test credit score system
# Install dependencies
npm install
# Run individual tests
node tests/1-verify-wallet-whitelisted.js
node tests/2-test-staking-with-backend.js
node tests/3-test-score.jsflowchart TD
A[π€ User visits FlexFi] --> B[π Register with Email]
B --> C[π Backend creates wallet]
C --> D[β
Admin adds to whitelist]
D --> E[π° User stakes 100 USDC]
E --> F[π Score initialized: 50 pts]
F --> G[π³ Choose card tier]
G --> H[ποΈ Ready for BNPL!]
style A fill:#e1f5fe
style H fill:#c8e6c9
| Step | Action | Who | Result |
|---|---|---|---|
| 1 | User registers | User | Account created |
| 2 | Wallet generation | Backend | New Solana wallet |
| 3 | Whitelist addition | Admin | Access granted |
| 4 | Stake collateral | User | 100 USDC locked 30 days |
| 5 | Score initialization | System | 50 credit points |
| 6 | Card selection | User | Silver card active |
| 7 | BNPL eligibility | System | Up to 100 USDC available |
π° Purchase: $30 sneakers
π Split: 3 payments of $10.33 each
π¦ Collateral: 100 USDC staked
π³ Card: Silver (4% fee = $1.20)
Timeline:
Week 1: β
Merchant gets $30 instantly
Week 4: β
Payment 1 ($10.33) - Score: 505
Week 9: β Payment 2 missed - Auto-debit from staking - Score: 485
Week 12: β
Payment 3 ($10.33) - Contract complete - Score: 505
πΉ Purchase: $100 coffee machine
πΉ Gold Card: 0.5% cashback = $0.50
πΉ Strategy: AutoCompound Staking
πΉ APY: ~8% annually
Monthly progression:
Month 1: $0.50 β Stake
Month 2: $1.03 β Compound
Month 3: $1.59 β Compound
Month 6: $3.24 β Available to claim
| Feature | Silver Card | Silver + Bronze NFT |
|---|---|---|
| BNPL Fee | 4% | 3.5% |
| Credit Limit | Standard | +10% |
| Perks | Basic | Priority processing |
| Visual | Standard design | Custom NFT art |
SOLANA_RPC_URL=https://api.devnet.solana.com
FLEXFI_PROGRAM_ID=7Yd4fxojkMc9ZvCiewx7coorSnFm84VccBiNxX3hujUHKey constants can be modified in src/constants.rs:
// Minimum staking amount (10 USDC)
pub const MIN_STAKING_AMOUNT: u64 = 10_000_000;
// Initial credit score
pub const INITIAL_SCORE: u16 = 50;
// Grace period for late payments
pub const GRACE_PERIOD_DAYS: u8 = 15;- Staking mechanism
- BNPL contracts
- Credit scoring
- Whitelist system
- Card system implementation
- NFT utility integration
- FlexYield mechanism
- Cross-chain bridges
- FlexBoost merchant integration
- Mobile SDK
- DeFi integrations
- Governance token
- Code audit by Certik
- Economic audit by Gauntlet
- Bug bounty program
- All functions require appropriate signatures
- Critical operations include checks and balances
- Automatic liquidation prevents bad debt
- Comprehensive testing coverage
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Write tests for new functionality
- Ensure all tests pass
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Website: flex-fi.io
- Documentation: docs.flex-fi.io
- Twitter: @FlexFi_
- Discord: FlexFi Community
- β Successful Staking: 100 USDC staked β
- β Score System: 50 initial points β
- β Whitelist Integration: Secure access control β
- β Automated Testing: Comprehensive test suite β
Built with β€οΈ on Solana
FlexFi: Redefining the future of payments with crypto-backed credit.