Skip to content

Instantly share code, notes, and snippets.

@patcito
Created March 30, 2026 16:56
Show Gist options
  • Select an option

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

Select an option

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

API Updates (2026-03-30)

1. circuitBreakerLimitRaw — raw integer CB limit

Added to both /mm/lend and /mm/lend/cb endpoints. Use this instead of the float circuitBreakerLimit for MAX button / validation to avoid float rounding mismatches.

/mm/lend/cb

{
  "data": {
    "circuitBreakerLimit": 2.827221,
    "circuitBreakerLimitRaw": "2827221",
    "circuitBreakerLimitUsd": 2.827221
  }
}

/mm/lend — per-asset globalMetrics

{
  "globalMetrics": {
    "circuitBreakerLimit": 2.827221,
    "circuitBreakerLimitRaw": "2827221",
    "circuitBreakerLimitUsd": 2.827221
  }
}

2. totalRepayable — max repayable amount

Added to chains[].assets[].userMetrics. Value: min(walletBalance, totalBorrowed).

FE should subtract session fee on their side if using sessions.

{
  "userMetrics": {
    "totalRepayable": 0.996546,
    "totalRepayableRaw": "996546",
    "totalRepayableUsd": 0.996546,
    "totalBorrowed": 2.187954,
    "walletBalance": 0.996546
  }
}

3. HF preview fix for non-collateral assets

/mm/preview/hf/withdraw and /mm/preview/hf/deposit now correctly handle non-collateral assets (e.g. ftUSD):

  • isCollateral=false → deposit/withdraw does not change projected HF
  • is_below_min_equity is skipped for non-collateral deposit/withdraw
  • priceAndDecimals revert is handled gracefully (falls back to $1 for non-collateral)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment