Cambrian Lending protocols endpoint API

By Cambrian Network evm

GET /api/v1/evm/lending/protocols

Lending Protocols

Overview

Returns every lending protocol supported by Cambrian's EVM lending data pipeline. Each entry identifies a protocol on a given chain along with the number of pools or markets currently tracked for it, so this endpoint is a good starting point before querying protocol-specific lending data.

Business Value

  • Protocol Discovery: Quickly identify which lending protocols are supported before querying protocol-specific endpoints.
  • Coverage Insight: The poolCount field indicates the breadth of data available for each protocol, helping prioritize integration efforts.
  • Cross-Protocol Comparison: Enables side-by-side comparison of protocol adoption and pool counts on a given chain.
  • Integration Planning: Serves as an entry point for building dashboards or tools that aggregate lending data across multiple protocols.

Endpoint Details

URL:

https://api.cambrian.org/evm/lending/protocols

Method: GET
Authentication: Required via X-API-Key header

Query Parameters

Parameter Type Required Default Description
chain_id integer No 8453 EVM chain ID. Enum: 1, 8453, 42161, 4663, 56
limit integer No 100 Limit the number of results.
offset integer No 0 Offset the results, allows you to skip a number of rows before starting to return rows.
order_asc array No - List of column names to order by in ascending order divided by comma. Leave empty items to combine with descending order. Enum values: chainId, protocolId, protocolName, poolCount
order_desc array No - List of column names to order by in descending order divided by comma. Leave empty items to combine with ascending order. Enum values: chainId, protocolId, protocolName, poolCount

Response Field Descriptions

Response Field Type Description
chainId UInt16 EVM chain ID the protocol is deployed on
protocolId LowCardinality(String) Unique identifier for the lending protocol
protocolName LowCardinality(String) Human-readable name of the lending protocol
poolCount UInt64 Number of pools/markets tracked for this protocol on this chain

Examples

1. List supported lending protocols on Base

Retrieves the supported lending protocols for the default chain (Base, chain_id 8453), limited to 10 results.

curl -X GET "https://api.cambrian.org/evm/lending/protocols?limit=10" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "columns": [
      {
        "name": "chainId",
        "type": "UInt16"
      },
      {
        "name": "protocolId",
        "type": "LowCardinality(String)"
      },
      {
        "name": "protocolName",
        "type": "LowCardinality(String)"
      },
      {
        "name": "poolCount",
        "type": "UInt64"
      }
    ],
    "data": [
      [
        8453,
        "aave-v3",
        "Aave V3",
        15
      ],
      [
        8453,
        "euler-lend",
        "Euler Lend",
        432
      ],
      [
        8453,
        "fluid-borrow",
        "Fluid Borrow",
        37
      ],
      [
        8453,
        "fluid-lend",
        "Fluid Lend",
        6
      ],
      [
        8453,
        "morpho-blue",
        "Morpho Blue",
        4325
      ],
      [
        8453,
        "morpho-v1",
        "Morpho V1",
        513
      ],
      [
        8453,
        "morpho-v2",
        "Morpho V2",
        3595
      ]
    ],
    "rows": 7
  }
]

The result set is capped at 10 items. This particular response returned 7 protocols on Base (chain_id 8453): Aave V3, Euler Lend, Fluid Borrow, Fluid Lend, and three Morpho variants, each with its own poolCount.

x402 Payment Option

This endpoint also supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.

Quick Start (TypeScript)

npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
  "https://x402.cambrian.org/evm/lending/protocols"
);
const data = await response.json();

Quick Start (Python)

pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        response = await http.get("https://x402.cambrian.org/evm/lending/protocols")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. Server verifies payment and returns the API response

The x402 SDK handles steps 2 through 5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request