5. Trade Protocol (On- and Off-Ramp)
We formalize the order lifecycle as a state machine with timeouts:
States: OPEN → MATCHED → FUNDED → CONFIRMED → SETTLED | DISPUTED → RESOLVED | EXPIRED
Common Parameters (governed):
T_match(max time to accept a match),T_fiat(max time to make fiat transfer),T_confirm(confirmation window),T_dispute(challenge window).B_bond_user,B_bond_merchant(optional performance bonds/slashing weights by reputation tier and payment rail risk class).min_amount,max_amountper rail/region; fee schedules; quote expiry windows.
5.1 On-Ramp (Fiat → USDC on Base; Solana planned)
- Open: User opens BUY order with amount & rail.
- Match: Protocol assigns a merchant on-chain based on staked USDC. Refundable bonds may lock.
- Fund Fiat: User pays fiat to provided account within
T_fiat. - Merchant Ack: Merchant confirms receipt of fiat payment.
- Settle: Contract releases USDC to user; fees assessed; bonds unlocked.
- Dispute: If conflict, parties submit evidence; authorized admins issue on-chain verdict.
5.2 Off-Ramp (USDC on Base → Fiat; Solana planned)
- Open: User opens SELL order; transfers USDC to escrowless settlement adapter (contract holds or streams atomically per design).
- Match: Merchant accepts and posts quote/bond.
- Fund Crypto: User's USDC is locked for settlement.
- Merchant Pays Fiat: Merchant pays fiat and confirms completion; or user challenges.
- Settle/Dispute: As above.
5.3 Payment-Rail Risk Classes
Rails differ (instant/irreversible vs reversible/chargeback-prone). The protocol maps rails to bond multipliers, confirmation requirements, and longer/shorter dispute windows.