How StablePay Works
StablePay provides infrastructure to convert stablecoins to INR with bank payouts. This guide explains the end-to-end flow.Architecture Overview
User Lifecycle
1. User Registration
When you create a user via our API:- We generate a unique HD wallet address (BIP-44 derivation)
- Same address works across all EVM chains (Polygon, Ethereum, Arbitrum, Base)
- Separate address generated for Solana
- User record stored with
kyc_status: pending
2. KYC Verification
Users complete KYC through our flow:| Step | Method | Purpose |
|---|---|---|
| 1 | Aadhaar | Government ID verification via DigiLocker |
| 2 | PAN | Identity verification |
| 3 | Face Liveness | Anti-fraud verification |
| 4 | Bank | Account ownership verification |
All KYC data is encrypted at rest using AES-256-GCM.
3. Deposit Detection
Our blockchain listeners monitor deposit addresses:- EVM chains: Poll for ERC-20 Transfer events every 5 seconds
- Solana: Monitor SPL token account balance changes
- Confirmations: Wait for required block confirmations
4. Payout Execution
Once deposits are confirmed:- Calculate INR amount using live exchange rate
- Deduct platform (optional developer) fees
- Initiate bank transfer via IMPS (instant) or NEFT (batch)
- Track UTR and update transaction status
Exchange rates are cached for 15 minutes and fetched from multiple providers with automatic failover. The rate source is included in API responses for transparency.
PII Protection
All personally identifiable information is:- Encrypted with AES-256-GCM before storage
- Decrypted only when needed for KYC/payout
- Never logged or exposed in webhooks
Transaction States
Timing Expectations
| Stage | Typical Duration |
|---|---|
| KYC Completion | 2-5 minutes |
| Deposit Detection | < 10 seconds |
| Polygon Confirmation | ~1 minute |
| Ethereum Confirmation | ~3 minutes |
| Solana Finalization | ~15 seconds |
| IMPS Payout | < 30 seconds |
