The Router
Status: Partially implemented. Solana settlement via Jupiter is live. Cross-chain settlement (Circle CCTP V2) and gasless transactions (Kora) are planned.
Routing Architecture
AGG functions like a DEX aggregator (Jupiter) but for payments, not just swaps. It solves the “n-to-1” problem: Users haven tokens on m chains, but the Merchant wants 1 specific token on 1 chain.
1. The 402 Handshake
The protocol begins when a client hits a gated resource. Server Response (402 Payment Required)2. Pathfinding
The AGG Client (SDK) calculates the optimal route based on the user’s wallet state. Factors:- Gas Cost: Solana (less than $0.001) vs Base vs Polygon.
- Swap Slippage: If paying with SOL to settle in USDC (routed via Jupiter).
- Bridge Time: If paying from Base to settle on Solana (via CCTP V2).
User (Base/ETH) -> Uniswap (USDC) -> CCTP V2 Bridge -> Solana (USDC) -> Merchant
3. Solana Settlement (v0 + LUTs)
On Solana, AGG uses Versioned Transactions (v0) and Address Lookup Tables (LUTs) to pack complex logic into a single atomic transaction with sub-2-second finality. Transaction Structure:- Swap Instruction: Jupiter CPI to convert User Token -> USDC.
- Fee Instruction: Transfer platform fee to Treasury.
- Payment Instruction: Transfer remaining amount to Merchant.
- Memo Instruction: Attach
orderIdfor reconciliation.
Fee Structure
AGG enforces a transparent fee model:| Fee Type | Rate | Payer | Description |
|---|---|---|---|
| Platform Fee | 0.5–1.0% | Merchant | Deducted from the settlement amount. |
| Gas Fee | Variable | User | Network costs (gasless via Kora where supported). |
Cross-Chain Settlement
For cross-chain payments (e.g., Base -> Solana), AGG utilizes Circle CCTP V2 (Cross-Chain Transfer Protocol).- Burn (Source): User burns USDC on source chain.
- Attest (Circle): Circle verifies the burn.
- Mint (Destination): USDC minted on destination chain and forwarded to Merchant.
Integrations
- Jupiter: Optimal swap routing on Solana.
- Kora: Gasless transaction sponsorship — users don’t need SOL for gas.
- Circle CCTP V2: Non-custodial cross-chain USDC transfers.