• Fetch the price of a token in the specified unit.

    Returns

    the price in units of the token.

    Example

    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.chainlink.fetchPrice(token, unit);

    Returns

    the price.

    Parameters

    • token: Address

      the token address.

    • unitAddress: Address

      the unit address.

    Returns BigDecimal

Generated using TypeDoc