Skip to main content

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:
  1. We generate a unique HD wallet address (BIP-44 derivation)
  2. Same address works across all EVM chains (Polygon, Ethereum, Arbitrum, Base)
  3. Separate address generated for Solana
  4. User record stored with kyc_status: pending

2. KYC Verification

Users complete KYC through our flow:
StepMethodPurpose
1AadhaarGovernment ID verification via DigiLocker
2PANIdentity verification
3Face LivenessAnti-fraud verification
4BankAccount 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:
  1. Calculate INR amount using live exchange rate
  2. Deduct platform (optional developer) fees
  3. Initiate bank transfer via IMPS (instant) or NEFT (batch)
  4. 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:
  1. Encrypted with AES-256-GCM before storage
  2. Decrypted only when needed for KYC/payout
  3. Never logged or exposed in webhooks

Transaction States

Timing Expectations

StageTypical Duration
KYC Completion2-5 minutes
Deposit Detection< 10 seconds
Polygon Confirmation~1 minute
Ethereum Confirmation~3 minutes
Solana Finalization~15 seconds
IMPS Payout< 30 seconds

Next Steps