Assets

Learn how to query and monitor asset information across Aave v4.


Assets represent ERC20 tokens that can be supplied, borrowed, or traded within the Aave protocol.

Asset Data Structure

Asset data provides comprehensive information about a specific token in the protocol, including:

  • Token identification: id, address, symbol, name, decimals

  • Aggregate metrics: total supplied, total borrowed, caps, and available amounts

  • Current price: fiat valuation

The following TypeScript interfaces illustrate the core Asset types:

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

Fetching Asset Information

Query detailed information about a specific asset.

Use the useAsset hook 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.name}</h3>      <p>Chain: {data.token.chain.name}</p>    </div>  );}

See below for examples of how to use the useAsset hook.

import { chainId, evmAddress } from "@aave/react";
const { data, loading, error } = useAsset({  query: {    token: {      address: evmAddress("0x123…"),      chainId: chainId(1),    },  },});

Asset Price History

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

Use the useAssetPriceHistory hook to fetch historical price data.

import {  type AssetPriceHistoryRequest,  useAssetPriceHistory,} from "@aave/react";
function AssetPriceChart({ 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>            {sample.date.toLocaleDateString()}: ${sample.price.toFixed(2)}          </p>        </div>      ))}    </div>  );}

See below for examples of how to use the useAssetPriceHistory hook.

import { Currency, TimeWindow } from "@aave/react";
const { data, error, loading } = useAssetPriceHistory({  query: {    assetId: asset.id,  },  currency: Currency.Usd,  window: TimeWindow.LastWeek,});

Asset Supply History

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

Use the useAssetSupplyHistory hook to fetch historical supply data.

import {  type AssetSupplyHistoryRequest,  useAssetSupplyHistory,} from "@aave/react";
function AssetSupplyChart({ 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>            {sample.date.toLocaleDateString()}: {sample.amount.value}          </p>        </div>      ))}    </div>  );}

See below for examples of how to use the useAssetSupplyHistory hook.

import { TimeWindow } from "@aave/react";
const { data, error, loading } = useAssetSupplyHistory({  query: {    assetId: asset.id,  },  window: TimeWindow.LastWeek,});

Asset Borrow History

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

Use the useAssetBorrowHistory hook to fetch historical borrow data.

import {  type AssetBorrowHistoryRequest,  useAssetBorrowHistory,} from "@aave/react";
function AssetBorrowChart({ 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>            {sample.date.toLocaleDateString()}: {sample.amount.value}          </p>        </div>      ))}    </div>  );}

See below for examples of how to use the useAssetBorrowHistory hook.

import { TimeWindow } from "@aave/react";
const { data, error, loading } = useAssetBorrowHistory({  query: {    assetId: asset.id,  },  window: TimeWindow.LastWeek,});