Skip to main content

List All Chains

GET /chains Retrieve a list of all supported blockchains with their contract addresses and configuration.

Request

curl "https://api.darex.com/api/v1/chains"

Response

{
  "chains": [
    {
      "chainId": 8453,
      "name": "base",
      "displayName": "Base",
      "blockExplorer": "https://basescan.org",
      "isTestnet": false,
      "contracts": {
        "instrumentRegistry": "0x...",
        "swapPoolRegistry": "0x...",
        "hook": "0x...",
        "router": "0x...",
        "instrumentToken": "0x...",
        "quoter": "0x...",
        "adapters": {
          "aave": "0x...",
          "compound": "0x...",
          "morpho": "0x...",
          "moonwell": "0x..."
        }
      },
      "uniswap": {
        "poolManager": "0x...",
        "positionManager": "0x...",
        "swapRouter": "0x...",
        "permit2": "0x..."
      },
      "tokens": {
        "USDC": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
        "EURC": "0x...",
        "USDbC": "0x...",
        "GHO": "0x...",
        "USDS": "0x...",
        "DAI": "0x...",
        "eUSD": "0x...",
        "WETH": "0x..."
      }
    }
  ],
  "total": 1
}

Response Fields

FieldTypeDescription
chainIdnumberThe blockchain’s chain ID
namestringInternal chain name (lowercase)
displayNamestringHuman-readable chain name
blockExplorerstringURL to the block explorer
isTestnetbooleanWhether this is a testnet
contractsobjectDarex contract addresses
contracts.instrumentRegistrystringInstrumentRegistry contract address
contracts.swapPoolRegistrystringSwapPoolRegistry contract address
contracts.hookstringUniswap V4 hook contract address
contracts.routerstringRouter contract address
contracts.instrumentTokenstringInstrumentToken contract address
contracts.quoterstringQuoter contract address
contracts.adaptersobjectProtocol adapter addresses
uniswapobjectUniswap V4 contract addresses
tokensobjectCommon token addresses on this chain

Get Single Chain

GET /chains/:chainId Retrieve detailed information about a specific blockchain.

Request

curl "https://api.darex.com/api/v1/chains/8453"

Path Parameters

ParameterTypeRequiredDescription
chainIdnumberYesThe chain ID (e.g., 8453 for Base)

Response

{
  "chainId": 8453,
  "name": "base",
  "displayName": "Base",
  "blockExplorer": "https://basescan.org",
  "isTestnet": false,
  "contracts": {
    "instrumentRegistry": "0x...",
    "swapPoolRegistry": "0x...",
    "hook": "0x...",
    "router": "0x...",
    "instrumentToken": "0x...",
    "quoter": "0x...",
    "adapters": {
      "aave": "0x...",
      "compound": "0x...",
      "morpho": "0x...",
      "moonwell": "0x..."
    }
  },
  "uniswap": {
    "poolManager": "0x...",
    "positionManager": "0x...",
    "swapRouter": "0x...",
    "permit2": "0x..."
  },
  "tokens": {
    "USDC": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "EURC": "0x...",
    "USDbC": "0x...",
    "GHO": "0x...",
    "USDS": "0x...",
    "DAI": "0x...",
    "eUSD": "0x...",
    "WETH": "0x..."
  }
}

Error Responses

404 Not Found - Chain not supported
{
  "statusCode": 404,
  "message": "Chain 1 not found or not supported"
}

TypeScript Example

const BASE_URL = 'https://api.darex.com/api/v1';

// Get all supported chains
async function getChains() {
  const response = await fetch(`${BASE_URL}/chains`);
  return response.json();
}

// Get specific chain details
async function getChain(chainId: number) {
  const response = await fetch(`${BASE_URL}/chains/${chainId}`);
  if (!response.ok) {
    throw new Error(`Chain ${chainId} not supported`);
  }
  return response.json();
}

// Usage
const { chains } = await getChains();
console.log(`Supported chains: ${chains.map(c => c.displayName).join(', ')}`);

// Get Base chain contracts
const baseChain = await getChain(8453);
console.log('InstrumentRegistry:', baseChain.contracts.instrumentRegistry);
console.log('Aave Adapter:', baseChain.contracts.adapters.aave);

Next Steps