6. Developer Guide

Architecture at a glance

  • SDK (TypeScript): A lightweight client to request quotes, execute swaps, check tx status, subscribe to updates, and interact with sFund endpoints.

  • Gateway API (Express, REST + WebSocket): Orchestrates quotes, routes, and transaction lifecycle. Replace the stub logic with your real routing, sequencer, zk-proof, and bridge adapters.

  • Smart Contracts (Solidity): SwapRouter, CollateralVault, SFund and interfaces for message bridge and zk verifier.

  • UI Demo (React + Vite): Minimal front-end showing quote → execute flow against the Gateway.

SDK & API Access:

  • Add cross-chain swaps into dApps, wallets, or DEXs.

  • Query liquidity pools & optimal routing paths.

  • Access live state updates via WebSockets.

  • Plug into Splenex collateral engine: tools to integrate Splenex functionality into external platforms.

Transaction Lifecycle:

  1. Request Submitted.

  2. Sequencing via PoH.

  3. Execution routed across pools.

  4. zk-proof generated.

  5. Settlement updates global vault.

  6. Confirmation across chains: developers can track every stage of execution.

Developer Hooks:

  • Pre-Trade Validation Hook → Confirm route before swap.

  • Post-Settlement Hook → For dApp-specific actions.

  • Liquidity Pool Access → LP participation + rewards: extensibility points for custom integrations.

Last updated