What this does
This plug converts a Morpho Blue borrow-share balance into a loan-asset amount by applying the market's virtual-asset and virtual-share offsets. It asks the caller for borrow_shares, total_borrow_assets, and total_borrow_shares at execution time. It runs whenever those three figures are supplied, adding 1 to the asset total and 1000000 to the share total before multiplying borrow_shares by virtual_assets, dividing by virtual_shares, and rounding up. Computing this by hand or on a stale total_borrow_assets or total_borrow_shares yields a borrow-asset figure that misstates the debt owed.
Actions · 7







Related plugs · 8