This plug converts a dollar amount into a token amount using the price an Aave market will enforce, not a quote from anywhere else. It takes three inputs: the token to price, the Aave market to read against, and the dollar value to convert. The oracle read and the division happen in the same transaction, so the amount a later step supplies or repays is sized on the number the market is using at that moment. Sizing against a stale quote instead is what leaves a position short.
Actions · 4
Getpriceofin
Reads the price the market's own oracle assigns to an asset.Reads the price the market's own oracle assigns to an asset.
Calculate
Applies a binary arithmetic operation to two values and returns the result.Applies a binary arithmetic operation to two values and returns the result.
Setto
Assigns a value to a named variable that later steps reference.Assigns a value to a named variable that later steps reference.
Bubble
Surfaces a value as an output of this plug.Surfaces a value as an output of this plug.