Risk engine

Borrow power is the only number that matters for credit. It is not market cap, not spot from a single pool, and not a curator whitelist of “good” tickers. It is liquidity-gated, haircut-adjusted value with hard share and weekend rules.

Formula

for each collateral leg:
  if poolLiquidity < minLiquidity → power = 0
  value = min(amount × medianTwap, protocolCap)
  haircut = assetHaircut
  if stock && marketClosed:
    haircut *= weekendMultiplier
  contrib = value × haircut
  if meme: memePower += contrib else quality += contrib

maxMeme = quality × memeShare / (1 − memeShare)
memeKept = min(memePower, maxMeme)
totalPower = quality + memeKept

if quality == 0:
  effectivePower = 0   // account cannot open

Invariants

  1. Liquidity, not market cap. Cap is cheap to paint. Depth is not.
  2. Below floor = zero. Automatic. No manual trash list required for graduates with ~$175 median liquidity.
  3. Meme share ≤ 20%. Memes never finance the whole account.
  4. Quality collateral required. Stocks or USDG must contribute power before the account opens.
  5. Weekend multiplier 75% of haircut. Protects Monday cash-open gaps.

Health factor

HF = borrowPower / debt. Below 1.0 the account is liquidatable. The terminal colors HF for watch and danger bands so the number remains readable in under a second.