Fetch the price of a token in the specified unit.
the price in units of the token.
import { Address } from "@graphprotocol/graph-ts";import { oracles } from "@protofire/subgraph-devkit";const token = Address.fromString("0x6b175474e89094c44da98b954eedeac495271d0f");const unit = Address.fromString("0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48");const price = oracles.uniswap.fetchPrice(token, unit);
the price.
the token address.
the unit address.
Generated using TypeDoc
Fetch the price of a token in the specified unit.
Returns
the price in units of the token.
Example
Returns
the price.