Polymarket Integration

Polymarket is the largest source of global liquidity. It operates on the Polygon PoS sidechain. While it offers deep volume, its architecture is hybrid: matching is done off chain, but settlement is on chain.

Data Ingestion (Gamma API) FaaSFi utilizes the Gamma API to fetch market structures and prices.

  • Endpoint: GET https://gamma-api.polymarket.com/events

  • Normalization: Polymarket prices are returned as decimal probabilities (e.g., "0.65"). FaaSFi maps the conditionId (a unique hash) to a human readable event string for the UI.

Execution (CLOB & EIP-712) Polymarket uses a Central Limit Order Book (CLOB). Unlike a standard DEX where you swap tokens directly, Polymarket requires cryptographically signed orders.

  • The Challenge: Users cannot be asked to sign a wallet transaction for every single trade in a high frequency hedging strategy.

  • The Solution (Proxy Wallets): FaaSFi implements a Proxy Wallet architecture.

    1. The user's main wallet authorizes a "Session Key" or delegates permission to a FaaSFi managed proxy.

    2. FaaSFi's server signs the order using EIP-712 (Typed Structured Data) standards.

    3. The signed order is posted to the Polymarket Relayer API.

    4. Settlement occurs atomically on the Polygon blockchain via the CTF (Conditional Token Framework) Exchange contract.

Last updated