This plug converts a Morpho borrow share balance into a loan-asset amount using the protocol's virtual-offset rounding. 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 total assets and 1000000 to total shares before multiplying borrow_shares by virtual assets, dividing by virtual shares, and rounding up. Computing this by hand or against stale market totals yields a borrow-asset figure that misstates the debt owed.
Actions · 7
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.
Calculate
Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.
Calculatetimesdividedbyrounded
Multiplies two values and divides by a third in one step, rounding up or down.
Setto
Assigns a value to a named variable that later steps reference.
Bubble
Surfaces a value as an output of this plug.
Related plugs · 8
Not ready to run as it stands: it waits on values or a position of your own.