You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Morpho Blue accrues interest lazily — `totalSupplyAssets` and `totalBorrowAssets` are only updated on-chain when someone interacts with the market. The `market()` view function returns stored (potentially stale) state.
441
+
442
+
When fetching market data, the library computes accrued interest locally to correct for staleness:
Where `taylorCompounded(rate, n)` is a 3rd-order Taylor approximation of `exp(rate * n) - 1`, matching the on-chain implementation.
460
+
461
+
## 9. Limitations
462
+
463
+
### 9.1 Point-in-Time rateAtTarget
464
+
465
+
The Morpho Blue IRM is adaptive: `rateAtTarget` drifts over time based on utilization history. When utilization is above the 90% target, `rateAtTarget` increases; when below, it decreases. The adjustment speed is approximately 50x/year.
466
+
467
+
All simulations in this library use the **current**`rateAtTarget` value. A large deposit that pushes utilization well below target would, over time, cause `rateAtTarget` to decrease further, compounding the APY reduction beyond the point-in-time estimate. Conversely, a large withdrawal pushing utilization above target would cause `rateAtTarget` to increase.
468
+
469
+
For small deposits/withdrawals relative to market size, this drift is negligible. For large position changes, the true long-term impact will differ from the instantaneous estimate.
470
+
471
+
### 9.2 Floating-Point Precision
472
+
473
+
See section 1.1 for details on numerical precision. The library uses JavaScript `number` (IEEE-754 double) for APY math after converting on-chain `bigint` values. This is sufficient for all practical vault sizes but loses precision for raw balances exceeding `2^53` base units.
474
+
475
+
### 9.3 Continuous Compounding Approximation
476
+
477
+
The library uses `exp(rate * time) - 1` for APY computation, while Morpho on-chain uses a 3rd-order Taylor approximation. Both approximate continuous compounding and differ by less than `10^-8` for realistic rates.
0 commit comments