Inspiration

A friend running an import business in Lagos waits 5–7 days and loses ~7% to SWIFT every time he pays a supplier in Yiwu. The rails are broken; stablecoins fix this — but no one has packaged it for non-crypto SMEs.

What it does

Silkpay lets African importers pay Chinese suppliers in their local currency. You upload a proforma invoice, we parse it with Claude Vision, our smart-order-router finds the cheapest path across multiple liquidity sources, funds are held in escrow on-chain in USDT, and the supplier gets CNY in their bank — all in one flow.

How we built it

  • Next.js 16 + Supabase for the dashboard, KYB onboarding, and Realtime status updates.
  • Claude Opus 4.7 vision with structured outputs to parse invoices for ~$0.04 a pop.
  • CVXPY (CLARABEL) + XGBoost on Modal for the SOR — convex optimization with an ML-predicted slippage term.
  • Foundry / Solidity 0.8.24 for TradeEscrow.sol with pull-payment semantics and a Tether-blacklist guard, deployed on Sepolia.
  • next-intl for FR / EN / 中文 from day one.

Challenges we ran into

  • CVXPY kept returning optimal_inaccurate on large NGN targets — switched ECOS → CLARABEL to fix the conditioning.
  • Structured outputs with the Anthropic SDK want .nullable(), not .optional() — silent schema mismatch cost us an afternoon.
  • BNB testnet faucets are gated behind mainnet BNB; pivoted to Sepolia so the demo actually runs.
  • Pre-deploying smart contracts that handle real-money semantics (blacklist, pull-payment, tranches) without an audit forced a lot of invariant testing.

Accomplishments that we're proud of

  • A real CVXPY solver, not a hand-waved heuristic — and it beats a naive baseline by ~135 bps on a 47M NGN test order.
  • End-to-end flow that actually works on stage: invoice in, CNY out, on-chain trail.
  • Trilingual UX shipped before launch, not bolted on after.
  • Zero any in the TypeScript.

What we learned

  • AI-generated CVXPY code compiles but rarely minimizes — every formulation needs numeric tests on known cases.
  • Most of the "hard" parts of cross-border payments aren't crypto, they're KYB and document parsing. Claude Vision + Realtime UI made both tractable.
  • Picking the right chain is a router decision, not an architectural one.

What's next for Silkpay

  • Multi-corridor: add Kenya, Ghana, Egypt on the African side; India and Vietnam on the supplier side.
  • Replace the simulated KYB providers (Smile ID, Tianyancha, ComplyAdvantage) with real integrations.
  • Hacken + Cyfrin audit + Code4rena contest before any mainnet escrow.
  • Multi-chain SOR: pick BNB / Tron / Base per route based on liquidity, fees, and finality.
  • WhatsApp Business notifications for the supplier side.

Built With

Share this project:

Updates