Architecture

Signex is built as a peer-to-peer (P2P) swap platform where trades are executed atomically on-chain while most order logic and trade discovery happens off-chain. The architecture is designed for fast, secure, trustless swaps of crypto and NFTs.


Core Components

Smart Contracts

  • Execute atomic swaps: assets move wallet-to-wallet in one transaction. No escrow, no partial execution.

  • Verify EIP-712 signatures to ensure only the intended maker/taker can execute a trade.

  • Validate trade parameters (amounts, expiry, same token prevention, etc.).

  • Track used nonces and executed trades to prevent replay attacks.

Off-Chain Order Layer

  • Stores signed trade orders for quick discovery.

  • Indexes trades so counterparties can see available orders instantly.

  • Syncs state to dashboards in real-time (Supabase).

  • Handles trade filtering, search, and dashboard data aggregation.

Frontend Interface

  • Trade creation & signing: users sign EIP-712 trades from their wallets.

  • Wallet connection: RainbowKit + Wagmi.

  • Token/NFT data fetching:

    • Zapper API: fetch token balances and amounts for display.

    • Alchemy API: fetch NFT metadata.

    • CoinGecko & DexScreener: token logos, decimals, and metadata.

  • Real-time dashboard updates for trade status, history, and user stats.


Tech Stack

Blockchain Layer

  • EVM-compatible chains

  • Base (primary deployment)

  • Expandable to other chains

Smart Contracts

  • Solidity 0.8.33

  • EIP-712 signatures

  • Atomic swap execution logic

Backend / Coordination

  • Supabase

  • Real-time syncing of trade orders and status

  • Indexing and dashboards

Frontend

  • Next.js (App Router)

  • React + TypeScript

  • Tailwind CSS + shadcn/ui

  • Wagmi + RainbowKit for wallet connection

  • Viem / ethers.js for contract interaction


Trade Flow (Atomic Swap Logic)

  1. Maker creates trade and signs it off-chain (EIP-712 signature).

  2. Signed trade is stored in Supabase for indexing and discovery.

  3. Counterparty reviews the trade in the dashboard.

  4. Counterparty accepts the trade and triggers the smart contract execution.

  5. Smart contract verifies signatures and nonces, then swaps assets atomically in a single transaction:

    • Crypto-to-crypto swap

    • NFT-to-NFT swap

    • Crypto-to-NFT swap

    • (Future P2P fiat flows possible)

  6. Trade status updates instantly in both users’ dashboards.


Custody Model

  • Users retain full control of their assets throughout the trade until execution.

  • No locking of assets or escrow; trades are executed directly from wallet-to-wallet.

  • Atomic swap ensures all-or-nothing execution, eliminating first-send risk.

Last updated