Chain Configuration

This directory contains network configuration for supported blockchain networks.

Supported Chains

Chain
Chain ID
Status

Base Mainnet

8453

Supported

Configuration Structure

ChainConfig Interface

interface ChainConfig {
  // Basic info
  chainId: number;
  name: string;

  // Contract addresses
  contracts: {
    optionBook: string;
    optionFactory: string;
  };

  // Implementation addresses for option strategies
  implementations: {
    PUT: string;
    INVERSE_CALL: string;
    CALL_SPREAD: string;
    PUT_SPREAD: string;
    CALL_FLY: string;
    PUT_FLY: string;
    CALL_CONDOR: string;
    PUT_CONDOR: string;
    IRON_CONDOR: string;
  };

  // Token configurations
  tokens: {
    [symbol: string]: {
      address: string;
      symbol: string;
      decimals: number;
    };
  };

  // API endpoints
  apiBaseUrl: string;
  indexerApiUrl: string;
  pricingApiUrl: string;
  wsBaseUrl: string;
  stateApiUrl: string;   // RFQ state indexer

  // RPC endpoints
  defaultRpcUrls: string[];
}

Base Mainnet Configuration (8453_v6)

Exported Functions

getChainConfigById

Get the full chain configuration for a given chain ID.

getTokenConfigById

Get token configuration for a specific chain and token symbol.

getSupportedTokensById

Get list of all supported tokens for a chain.

isChainIdSupported

Check if a chain ID is supported.

Price Feeds

The SDK uses Chainlink price feeds for BTC and ETH pricing:

Asset
Price Feed Address

BTC

0x64c911996D3c6aC71f9b455B1E8E7266BcbD848F

ETH

0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70

Adding New Chains

To add support for a new chain:

  1. Add chain configuration to chains/index.ts

  2. Update the SupportedChainId type in types/client.ts

  3. Add contract addresses for the new chain

  4. Add token configurations

API Endpoints

Endpoint
Purpose
URL Pattern

Orders API

Fetch available orders

{apiBaseUrl}/

Indexer API

User positions, stats

{indexerApiUrl}/...

Pricing API

Greeks, IV surfaces

{pricingApiUrl}/...

State API

RFQ state indexer

{stateApiUrl}/api/state

WebSocket

Real-time updates

{wsBaseUrl}

Last updated