OriginSync-AI

What it does

OriginSync-AI is an autonomous trade telemetry control room and compliance engine built to eliminate friction across the $3.4 Trillion African Continental Free Trade Area (AfCFTA) corridor.

​Directly answering PayPal’s challenge for "Agents that Actually Transact" and "Automated Payout Tools", our AI engine doesn't just give advice—it dynamically calculates trade trust scores and fires PayPal Payouts sub-second the moment an AfCFTA trade case is verified, complete with an automated circuit breaker for high-risk shipments.

​It automates line-item tariff qualification under AfCFTA Phase II Rules of Origin—deterministically evaluating Value Addition (VA 40%), Change in Tariff Heading (CTH 2/4/6-digit), and Wholly Obtained (WO) commodity source chains. Simultaneously, it evaluates counterparty risk via our proprietary RIGS (Risk, Intent, Growth, Stakeholder) Framework, calculates real-time CIF exposure across regional corridors, and executes trust-gated liquidity payouts through an idempotent settlement engine.

How we built it

  • Deterministic Rules Engine & Backend: Built with FastAPI (Python) and validated against 64+ automated pytest suites to evaluate floating-point tariff limits, HS-code shifts, and zero-trust edge cases.
  • Trust-Gated Settlement Pipeline: Integrated the PayPal Sandbox Payouts & Orders API with an automated RIGS Circuit Breaker—automatically halting settlement execution and flagging trade cases for review if a shipment's trust score drops below 75.0.
  • High-Density Control Room Dashboard: Developed a React/TypeScript interface powered by AG Grid Enterprise for real-time telemetry rendering across 20 active trade corridors, dynamic metric aggregation, and client-side escaped UTF-8 CSV state exports.
  • Database Architecture & Multi-Tenancy: Deployed on Supabase (PostgreSQL) with isolated schema boundaries, resilient authorization fallback pipelines, and real-time state caching.

Challenges we ran into

  • Client-Side Snapshot Collisions: Early PWA builds cached unauthenticated network blips as permanent offline state (0 Trade Cases). We engineered a defensive cache-write guard that validates non-zero telemetry before updating local snapshots, alongside an explicit cache-purge protocol during auth state changes.
  • Multi-Alias Route & CORS Resilience: Mismatches between local dev proxies and Render reverse-proxies caused pre-flight CORS rejections. We bound telemetry handlers across standardized route aliases (/telemetry, /api/telemetry, /api/v1/telemetry) with permissive edge CORS headers.
  • Floating-Point Tariff Boundaries: Policy logic required strict boundary checks (e.g., verifying 39.9% VA rejection vs 40.0% pass). We built a 24-case pytest matrix specifically isolating boundary limits, malformed HS codes, and negative CIF values.

Accomplishments that we're proud of

  • Deployed a fully operational, production-grade Trade Control Room on Render (originsync-api.onrender.com).
  • Achieved full end-to-end integration between deterministic AfCFTA compliance, RIGS trust scoring, and automated PayPal Sandbox liquidity releases.
  • Achieved 100% test pass rates across 64+ backend integration and boundary unit tests.
  • Delivered zero-lag client-side state extraction with instant timestamped CSV report exports directly from active UI state.

What we learned

  • How to decouple regulatory compliance logic from execution layers through trust-gated idempotency state machines (PENDING , PROCESSING, COMPLETED).
  • Designing defensive schema fallback handlers and edge cache strategies for real-time financial telemetry.
  • Managing microservice proxy resilience and wildcard CORS handshakes across multi-cloud deployments.

What's next for OriginSync-AI

  • Multi-Rail Settlement Expansion: Extending settlement rails beyond PayPal to integrate directly with the Pan-African Payment and Settlement System (PAPSS) and regional RTGS corridors.
  • Multimodal Document Parsing: Ingesting physical Bills of Lading, phytosanitary certificates, and customs manifests via multimodal OCR to cross-verify physical documentation against digital trade submissions.
  • Cryptographic Origin Oracles: Generating verifiable, on-chain proof-of-origin attestations for port authorities and institutional trade financiers.

Built With

Share this project:

Updates

Submission history