Skip to Content
docs

Aave V4 Assets

Assets represent ERC-20 tokens that can be supplied or borrowed within Aave V4.

Asset Data Structure

Asset data describes a specific token in the protocol:

  • Token identification: id, address, symbol, name, decimals
  • Aggregate metrics: total supplied, total borrowed, caps, and available amounts
  • Reserve coverage: total number of reserves and how many are active
  • Current price: exchange valuation for a specific currency

The following TypeScript interfaces illustrate the core Asset types:

interface Asset {
  __typename: "Asset";
  id: AssetId;
  token: Erc20Token;
  summary: AssetSummary;
  price: ExchangeAmountWithChange;
}

Fetching Asset Information

Query detailed information about a specific asset.

Use the useAsset hook in React, the asset action in TypeScript, or the asset query in GraphQL to fetch asset information.

import { type AssetRequest, useAsset } from "@aave/react";

function AssetDetails({ request }: { request: AssetRequest }) {
  const { data, loading, error } = useAsset(request);

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  if (!data) return <div>Asset not found</div>;

  return (
    <div>
      <h3>{data.token.info.name}</h3>
      <p>Chain: {data.token.chain.name}</p>
    </div>
  );
}

See below for examples of AssetRequest objects in React. In GraphQL, specify the asset ID or token address and chain ID.

import { chainId, evmAddress } from "@aave/react";

const request: AssetRequest = {
  query: {
    token: {
      address: evmAddress("0x123…"),
      chainId: chainId(1),
    },
  },
};

Finally, in React and TypeScript, you can specify a different time window or currency for the data.

import { TimeWindow } from "@aave/react";

// …

const { data, loading, error } = useAsset({
  query: {
    // your query criteria
  },
  timeWindow: TimeWindow.LastWeek,
});

Multichain Asset

A multichain asset aggregates a single token across every chain where it is listed as a Hub Asset. Tokens are grouped by their canonical symbol (the case-insensitive, alias-resolved symbol that identifies the same asset across chains), so you can show protocol-wide totals and APY ranges without querying each chain separately.

Data Structure

A multichain asset exposes the per-chain Asset list alongside an aggregated summary.

The following TypeScript interfaces illustrate the core multichain asset types:

interface MultichainAsset {
  __typename: "MultichainAsset";
  assets: Asset[];
  summary: MultichainAssetSummary;
}

Fetching a Multichain Asset

Select the token with exactly one of symbol or tokenInfo. Omit chainIds to aggregate across all chains, or pass a list to restrict the result.

Use the useMultichainAsset hook in React, the multichainAsset action in TypeScript, or the multichainAsset query in GraphQL to fetch an asset aggregated across chains.

import { useMultichainAsset } from "@aave/react";

function MultichainAssetSummary() {
  const { data, loading, error } = useMultichainAsset({
    query: { symbol: "USDC" },
  });

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      <p>Deployed on {data.summary.chainCount} chains</p>
      <p>
        Total supplied: {data.summary.totalSupplied.value.toDisplayString(2)}{" "}
        {data.summary.totalSupplied.symbol}
      </p>
    </div>
  );
}

See below for examples of MultichainAssetRequest objects in React. In GraphQL, provide exactly one of symbol or tokenInfo in query, and optionally restrict the result with chainIds.

const request: MultichainAssetRequest = {
  query: {
    symbol: "USDC",
  },
};

By default, Merkl rewards are included in the APY range. Pass includeRewards: false for protocol base rates only.

Protocol APYs Only
const request: MultichainAssetRequest = {
  query: { symbol: "USDC" },
  includeRewards: false,
};

Asset Price History

Asset price history data provides time-series price information for an asset.

Use the useAssetPriceHistory hook in React, the assetPriceHistory action in TypeScript, or the assetPriceHistory query in GraphQL to fetch historical price data.

import {
  type AssetPriceHistoryRequest,
  useAssetPriceHistory,
} from "@aave/react";

function AssetPrice({ request }: { request: AssetPriceHistoryRequest }) {
  const { data, loading, error } = useAssetPriceHistory(request);

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      {data.map((sample) => (
        <div key={sample.date.toString()}>
          <p>
            <small>{sample.date.toLocaleDateString()}</small>$
            {sample.price.toFixed(2)}
          </p>
        </div>
      ))}
    </div>
  );
}

See below for examples of AssetPriceHistoryRequest objects in React. In GraphQL, specify the asset ID or token, currency, and time window.

const request: AssetPriceHistoryRequest = {
  query: {
    assetId: asset.id,
  },
};

Finally, in React, you can specify a different currency or time window for the data.

import { Currency } from "@aave/react";

const { data, error, loading } = useAssetPriceHistory({
  query: {
    // your query criteria
  },
  currency: Currency.Eur,
});

Asset Supply History

Asset supply history data provides time-series total supply information for an asset.

Use the useAssetSupplyHistory hook in React, the assetSupplyHistory action in TypeScript, or the assetSupplyHistory query in GraphQL to fetch historical supply data.

import {
  type AssetSupplyHistoryRequest,
  useAssetSupplyHistory,
} from "@aave/react";

function AssetSupply({ request }: { request: AssetSupplyHistoryRequest }) {
  const { data, loading, error } = useAssetSupplyHistory(request);

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      {data.map((sample) => (
        <div key={sample.date.toString()}>
          <p>
            <small>{sample.date.toLocaleDateString()}</small>
            {sample.amount.value.toDisplayString(2)}
          </p>
        </div>
      ))}
    </div>
  );
}

See below for examples of AssetSupplyHistoryRequest objects in React. In GraphQL, specify the asset ID or token and time window.

const request: AssetSupplyHistoryRequest = {
  query: {
    assetId: asset.id,
  },
};

Finally, in React, you can specify a different time window for the data.

Custom Time Window
import { TimeWindow } from "@aave/react";

const { data, error, loading } = useAssetSupplyHistory({
  query: {
    // your query criteria
  },
  window: TimeWindow.LastMonth,
});

Asset Borrow History

Asset borrow history data provides time-series total borrow information for an asset.

Use the useAssetBorrowHistory hook in React, the assetBorrowHistory action in TypeScript, or the assetBorrowHistory query in GraphQL to fetch historical borrow data.

import {
  type AssetBorrowHistoryRequest,
  useAssetBorrowHistory,
} from "@aave/react";

function AssetBorrow({ request }: { request: AssetBorrowHistoryRequest }) {
  const { data, loading, error } = useAssetBorrowHistory(request);

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      {data.map((sample) => (
        <div key={sample.date.toString()}>
          <p>
            <small>{sample.date.toLocaleDateString()}</small>
            {sample.amount.value.toDisplayString(2)}
          </p>
        </div>
      ))}
    </div>
  );
}

See below for examples of AssetBorrowHistoryRequest objects in React. In GraphQL, specify the asset ID or token and time window.

const request: AssetBorrowHistoryRequest = {
  query: {
    assetId: asset.id,
  },
};

Finally, in React, you can specify a different time window for the data.

Custom Time Window
import { TimeWindow } from "@aave/react";

const { data, error, loading } = useAssetBorrowHistory({
  query: {
    // your query criteria
  },
  window: TimeWindow.LastMonth,
});

Protocol History

Fetch protocol-wide historical data (deposits, borrows). Pass chainIds to scope the history to specific chains, or omit it to aggregate across all of them.

Use the useProtocolHistory hook in React, the protocolHistory action in TypeScript, or the protocolHistory query in GraphQL to fetch protocol-wide historical data.

import { type ProtocolHistoryRequest, useProtocolHistory } from "@aave/react";

function ProtocolHistory({ request }: { request: ProtocolHistoryRequest }) {
  const { data, loading, error } = useProtocolHistory(request);

  if (loading) return <div>Loading…</div>;

  if (error) return <div>Error: {error.message}</div>;

  return (
    <div>
      {data.map((sample) => (
        <p key={sample.date.toString()}>
          <small>{sample.date.toLocaleDateString()}</small>
          <span>
            <strong>Deposits</strong>
            {sample.deposits.symbol}
            {sample.deposits.value.toDisplayString(2)}
          </span>
          <span>
            <strong>Borrows</strong>
            {sample.borrows.symbol}
            {sample.borrows.value.toDisplayString(2)}
          </span>
        </p>
      ))}
    </div>
  );
}

In GraphQL, specify currency and time window.

Protocol History Request
{
  "request": {
    "currency": "USD",
    "window": "LAST_WEEK",
    "chainIds": [1, 43114]
  }
}