Max Gas Limit

To manage gas costs, we have set a max gas limit called maxGasForMatching. This ensures that any unmatched liquidity returns to the underlying protocol, maintaining economic stability and guaranteeing users at least the underlying protocol's APY. Below is an example where the max gas limit is applied.

  1. The initial state: Supply 1 is 300 USDC, and supplies 2 through 10 are 10 USDC each.

  2. When borrow 11 is requested, priority is given to supply 1.

  3. After matching 300 USDC, followed by 10 USDC in each of the next 6 iterations, the gas limit of maxGasForMatching is reached.

  4. The matching engine then stops.

  5. The remaining 30 USDC falls back to the underlying protocol.

Last updated