Get price
Get price

Chainlink · Reads onchain state

Reads the latest Chainlink price of a base asset in a quote asset, normalized to 18 decimals. The feed registry's latestRoundData is fetched for the pair, and the answer is rescaled from the feed's own decimals to 18 so every pair compares alike. The round's timestamps come back alongside, so staleness can be checked. Reach for it whenever a strategy needs a reference price independent of any pool: compare a DEX quote against it to bound slippage, convert a dollar target into a token amount, or coil the updated-at timestamp into a predicate that requires the feed is fresh.

Get Chainlink Price (USD)

plug
chainlink
4actions
  1. 1·Take

    Opening the inputs, token is declared as a caller parameter, naming the asset whose price will be read at execution time.

  2. 2·Get price

    Passing that token into Chainlink, the latest price is read quoted in USD at 0x0000000000000000000000000000000000000348 and normalized to 18 decimals.

  3. 3·Bubble

    Bubbling the value from slot 1.7 surfaces the Chainlink USD price as an output of this plug.

  4. 4·Use

    Composing another plug, the swap parameter runs a nested plug inline within this one.

Take
Get price of in
Bubble
Use
  • Get Chainlink Price (USD)

    plug
    chainlink
  • Get Simple Moving Average

    plug
    time
    chainlink
  • Get Token Target

    plug
    database
    evm
  • Get Total Holdings Value

    plug
    evm
    boolean

On other protocols · 11