Value to Token Amount
0x484428507A212cA56D71baa27Ca6089a6dB63a88

What this does

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

  • Get price
    Get price of in
    Reads the price the market's own oracle assigns to an asset.
  • Calculate
    Calculate
    Applies a binary arithmetic operation to two values and returns the result.
  • Set
    Set to
    Assigns a value to a named variable that later steps reference.
  • Bubble
    Bubble
    Surfaces a value as an output of this plug.

Related plugs · 8