Core Components
Gateway Contract
The Gateway contract is the onchain entry point for all payment orders. It holds stablecoins in escrow during the settlement process — neither Paycrest nor any provider ever custodies the funds directly.Key Functions
- Order Creation: Accepts payment orders from senders; locks stablecoins in escrow (offramp) or coordinates stablecoin release to recipients (onramp)
- Event Emission: Emits events that the aggregator monitors to begin routing
- Escrow Settlement: Releases escrowed funds to providers after fulfillment is verified, or returns them to senders if the order can’t be completed
Payment Flow
Order Creation
Sender creates an order via the Sender API or direct contract interaction. For offramp, stablecoins are locked in escrow. For onramp, the contract coordinates stablecoin release once fiat receipt is confirmed.
Routing
Aggregator picks up the onchain event and routes the order to the most suitable liquidity provider based on rate, availability, and corridor.
Fulfillment
For offramp, the provider disburses fiat to the recipient via a local PSP. For onramp, the provider receives the user’s fiat deposit and reports confirmation.
Aggregator Node
The aggregator node is the coordination layer: it monitors onchain events, manages provider routing, and oversees the settlement pipeline.Core Functions
- Order Monitoring: Watches the Gateway contract for new orders
- Provider Matching: Routes orders to the optimal provider based on rate and availability
- Settlement Coordination: Manages the fulfillment → validation → settlement flow
- Webhook Delivery: Notifies senders of order status changes
Paycrest currently operates the sole aggregator in the network (federated model). All order matching and coordination fees flow to Paycrest. The protocol is designed to support multiple independent aggregators in a future phase. See the Decentralization Path.
API Layers
Blockchain Layer
- Gateway contract event monitoring
- Transaction submission and confirmation
- Multi-chain support
Business Logic Layer
- Order matching and provider selection
- Rate validation and optimization
- Refund and timeout handling
API Layer
- REST API (v1 and v2 sender/provider endpoints)
- Webhook delivery to senders
- Rate limiting and authentication
Data Layer
- Order state management
- Provider registry and availability
- Transaction logs and audit trail
Provision Nodes
Provision nodes handle fiat execution: disbursing fiat to recipients for offramp orders, or receiving and confirming fiat deposits for onramp orders. They are run by independent liquidity providers who connect their own PSP integrations.Components
- PSP Integration: Connects to local payment service providers (banks, mobile wallets)
- Rate Management: Sets and updates competitive rates per corridor
- Order Processing: Executes assigned payment orders
- Settlement Reporting: Reports fulfillment status back to the aggregator
Integration Types
Bank APIs
- Direct bank integrations
- Real-time payment rails
- Batch processing
Mobile Money
- M-Pesa, Airtel Money, MTN Mobile Money
- PIX (Brazil)
- Other mobile wallets
Deployment Options
Self-Hosted Deployment- Complete control over infrastructure and PSP connections
- Requires technical expertise for setup and maintenance
- Recommended for providers with existing PSP relationships
- One-click deployment through Blockops
- Automated scaling and monitoring
- Recommended for providers new to infrastructure management
Multi-Chain Support
The protocol is live on 8 EVM-compatible networks:| Network | Chain ID | Primary Use |
|---|---|---|
| Ethereum | 1 | USDT, USDC, cNGN |
| Base | 8453 | USDT, USDC, cNGN |
| Arbitrum One | 42161 | USDT, USDC |
| Polygon | 137 | USDT, USDC, cNGN |
| BNB Smart Chain | 56 | USDT, USDC, cNGN |
| Lisk | 1135 | USDT, USDC |
| Celo | 42220 | USDT, USDC |
| Scroll | 534352 | USDT, USDC |
Security Architecture
Smart Contract Security
The Gateway contract implements multiple security measures:- Non-custodial escrow: Funds are locked onchain, not held by Paycrest or providers
- Automatic refunds: Orders not fulfilled within 5 minutes trigger automatic fund return
- Access control: Role-based permissions and multi-signature governance for protocol changes
- Audited contracts: Gateway contracts are security-audited; see the contracts repository
Data Protection
- Encrypted recipient data: Recipient bank details are encrypted in transit and at rest
- API key authentication: All API requests authenticated via API Key + API Secret
- Webhook signature verification: HMAC-SHA256 signatures on all webhook payloads
Integration Paths
Senders have two integration options:Sender API
REST API integration — fastest time to integration. Paycrest handles the onchain interaction on your behalf.
Smart Contract
Direct Gateway contract integration — full onchain composability. Automated flows like yield-to-fiat and liquidation-to-bank work natively.