Skip to content

Instantly share code, notes, and snippets.

@patcito
Created February 19, 2026 17:21
Show Gist options
  • Select an option

  • Save patcito/b875f9bd071375bee84bbc57710aa124 to your computer and use it in GitHub Desktop.

Select an option

Save patcito/b875f9bd071375bee84bbc57710aa124 to your computer and use it in GitHub Desktop.
GET /mm/lend — Lending Overview Endpoint

GET /mm/lend — Lending Overview Endpoint

Returns full lending data across all chains with per-asset metrics, APY rates, token prices, and optional user positions.

Parameters

Param Type Required Description
user string No User wallet address. If omitted, all user-specific fields are 0.

Example

GET /mm/lend
GET /mm/lend?user=0xABC123...

Response Shape

{
  "success": true,
  "data": {
    "globalMetrics": {
      "totalSuppliedUsd": 12500000.50,
      "totalAvailableUsd": 8000000.25,
      "totalBorrowedUsd": 4500000.25,
      "totalEarningsUsd": 0
    },
    "userMetrics": {
      "totalSuppliedUsd": 5000.0,
      "totalBorrowedUsd": 1200.0,
      "totalEarningsUsd": 0,
      "claimableEarningsUsd": 0,
      "healthFactor": null,     // only set when user has positions
      "netApyPct": null         // only set when user has positions
    },
    "chains": [
      {
        "chainId": 146,
        "chainName": "Sonic",
        "globalMetrics": {
          "totalSuppliedUsd": 12500000.50,
          "totalAvailableUsd": 8000000.25,
          "totalBorrowedUsd": 4500000.25,
          "totalEarningsUsd": 0
        },
        "userMetrics": {
          "totalSuppliedUsd": 5000.0,
          "totalBorrowedUsd": 1200.0,
          "healthFactor": 1.85,   // float, e.g. 1.85 = 185%
          "netApyPct": 3.25       // weighted net APY across positions
        },
        "assets": [
          {
            "address": "0x29219dd400f2Bf60E5a23d13Be72B486D4038894",
            "symbol": "USDC",
            "name": "USD Coin",
            "decimals": 6,
            "tokenprice": 1.0,         // USD per token (decimalized float)
            "isSuppliable": true,
            "isBorrowable": true,
            "supplyApyPct": 4.02,      // percentage, e.g. 4.02 = 4.02%
            "borrowApyPct": 5.15,
            "userMetrics": {
              "walletBalance": 1500.0,          // in token units
              "walletBalanceUsd": 1500.0,
              "totalSupplied": 5000.0,          // deposited as collateral
              "totalSuppliedUsd": 5000.0,
              "totalBorrowed": 1200.0,
              "totalBorrowedUsd": 1200.0,
              "totalAvailable": 8000000.0,      // available to borrow from pool
              "totalAvailableUsd": 8000000.0,
              "totalEarnings": 0,
              "totalEarningsUsd": 0,
              "claimableEarnings": 0,
              "claimableEarningsUsd": 0
            },
            "globalMetrics": {
              "totalSupplied": 12500000.50,     // total tokens supplied to pool
              "totalSuppliedUsd": 12500000.50,
              "totalAvailable": 8000000.25,     // cash available in pool
              "totalAvailableUsd": 8000000.25,
              "totalBorrowed": 4500000.25,
              "totalBorrowedUsd": 4500000.25,
              "totalEarnings": 0,
              "totalEarningsUsd": 0,
              "utilizationPct": 0.36            // 0-1 range (0.36 = 36%)
            }
          }
          // ... more assets
        ]
      }
      // ... more chains
    ]
  }
}

Notes

  • All numeric values are decimalized floats (not raw wei/wad). For example, 1500 USDC is 1500.0, not 1500000000.
  • tokenprice is USD per token as a float.
  • APY fields (supplyApyPct, borrowApyPct, netApyPct) are percentages: 4.02 means 4.02%.
  • utilizationPct is 0–1 range: 0.36 means 36% utilization.
  • healthFactor is a float: 1.85 means 185% health factor.
  • When user is not provided, all userMetrics numeric fields are 0 and healthFactor/netApyPct are null.
  • USD values for global metrics are sourced from Redis snapshots when available, falling back to on-chain calculation.

PR

https://github.com/flyingtulipdotcom/ft-api/pull/264

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment