Morpho: Get Market Liquidity
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

This plug computes the available liquidity of a Morpho Blue market by subtracting its borrowed assets from its supplied assets. It asks the caller for a market identifier, morpho_market, at execution time. It fires on demand whenever run, reading the market's current totals and returning the difference as available_liquidity. Computing this by hand means fetching both totals separately and differencing them, and a stale total returns a liquidity figure that no longer matches the market's on-chain state.

Actions · 4

  • Get total supplied and borrowed
    Get total supplied and borrowed in
    Reads a Morpho Blue market's totals: assets and shares supplied and borrowed.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8