Skip to Content
docs

Aave V4 Liquidity Hubs

Liquidity Hubs hold the shared liquidity of Aave V4 and grant each Spoke a credit line for borrowing and a debit line for supplying.

Hub Data Structure

Hub data provides an aggregate view of a Liquidity Hub, including:

  • Identification: id, name, chain, address
  • Aggregated details: totalSupplied, totalBorrowed
  • System caps: totalSupplyCap, totalBorrowCap

In Solidity, Hubs are represented by deployed contracts implementing the IHub interface, managed by governance. Unlike the SDK, there is no single onchain struct containing Hub metadata (name, address) nor aggregate summary information (e.g., total liquidity) as these are maintained offchain.

Hubs manage two key relationships: Assets and Spokes. For more information about Hub Assets, see the Hub Assets section below. For details on Spoke-Hub relationships and Spoke data structures, see the Spoke Data Structure section.

The following TypeScript interfaces and GraphQL fragments illustrate the core Hub type.

interface Hub {
  __typename: "Hub";
  id: HubId;
  address: EvmAddress;
  chain: Chain;
  name: string;
  summary: HubSummary;
}

Listing Available Hubs

Discover all available Aave Liquidity Hubs across supported networks.

Use the useHubs hook in React, the hubs action in TypeScript, or the hubs query in GraphQL to fetch a list of Liquidity Hubs.

import { type HubsRequest, useHubs } from "@aave/react";

function HubsList({ request }: { request: HubsRequest }) {
  const { data, loading, error } = useHubs(request);

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

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

  return (
    <div>
      {data.map((hub) => (
        <div key={hub.id}>
          <h3>{hub.name}</h3>
          <p>Chain: {hub.chain.name}</p>
        </div>
      ))}
    </div>
  );
}

useHubsAction doesn’t watch for updates. Use it for on-demand fresh data, such as in an event handler.

In React and GraphQL, see below for examples of HubsRequest objects.

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

const request: HubsRequest = {
  query: {
    chainIds: [chainId(1)],
  },
};

In React, you can also specify a different currency for the data.

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

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

Deployed Hubs

In Solidity, hubs are deployed and managed by governance. The following hubs are deployed on Ethereum Mainnet:

NameAddress
Core Hub0xCca852Bc40e560adC3b1Cc58CA5b55638ce826c9
Plus Hub0x06002e9c4412CB7814a791eA3666D905871E536A
Prime Hub0x943827DCA022D0F354a8a8c332dA1e5Eb9f9F931

Once a hub address is known, access its assets and spokes using the methods documented in the Hub Data Structure section above.

Fetching a Single Hub

Get detailed information about a specific Liquidity Hub.

Use the useHub hook in React, the hub action in TypeScript, or the hub query in GraphQL to fetch a specific hub by ID or by address and chain.

import { type HubRequest, useHub } from "@aave/react";

function HubDetails({ request }: { request: HubRequest }) {
  const { data, loading, error } = useHub(request);

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

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

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

  return (
    <div>
      <h2>{data.name}</h2>
      <p>Address: {data.address}</p>
      <p>Chain: {data.chain.name}</p>
    </div>
  );
}

In React, see below for examples of HubRequest objects.

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

const request: HubRequest = {
  query: {
    hubId: hubId(params.id), // HubId - typically from URL params
  },
};

In React, pass timeWindow or currency with the request; in TypeScript, pass them in the third options argument of hub.

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

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

Hub Summary History

Fetch historical summary data for a specific hub over a specified time window.

Use the useHubSummaryHistory hook in React, the hubSummaryHistory action in TypeScript, or the hubSummaryHistory query in GraphQL to fetch historical summary data for a hub.

import {
  type HubSummaryHistoryRequest,
  useHubSummaryHistory,
} from "@aave/react";

function HubHistory({ request }: { request: HubSummaryHistoryRequest }) {
  const { data, loading, error } = useHubSummaryHistory(request);

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

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

  return (
    <div>
      <h2>Hub History</h2>
      {data.map((item) => (
        <div key={item.date.toString()}>
          <p>Date: {item.date.toLocaleDateString()}</p>
          <p>
            Deposits: {item.deposits.symbol}
            {item.deposits.value.toDisplayString(2)}
          </p>
          <p>
            Borrows: {item.borrows.symbol}
            {item.borrows.value.toDisplayString(2)}
          </p>
          <p>Utilization: {item.utilizationRate.normalized.toFixed(2)}%</p>
        </div>
      ))}
    </div>
  );
}
  • React: See below for examples of HubSummaryHistoryRequest objects.
  • GraphQL: Use the query and window fields to specify the hub and time period.
import { hubId, TimeWindow } from "@aave/react";

const request: HubSummaryHistoryRequest = {
  query: { hubId: hubId(params.id) },
  window: TimeWindow.LastWeek,
};

Specify the time window for the historical data. window accepts TimeWindow.LastDay (default), LastWeek, LastMonth, LastSixMonths, LastYear or All (GraphQL: LAST_DAY, LAST_WEEK, LAST_MONTH, LAST_SIX_MONTHS, LAST_YEAR, ALL).

Last Week
import { hubId, TimeWindow } from "@aave/react";

const request: HubSummaryHistoryRequest = {
  query: { hubId: hubId(params.id) },
  window: TimeWindow.LastWeek,
};

You can also specify a different currency for the data.

Custom Currency
import { Currency, hubId, TimeWindow } from "@aave/react";

const { data, error, loading } = useHubSummaryHistory({
  query: { hubId: hubId(params.id) },
  window: TimeWindow.LastWeek,
  currency: Currency.Eur,
});

Hub Spoke Configs

Fetch per-asset configuration for a specific (hub, spoke) pair, including supply caps, borrow caps, operational status, and the risk premium threshold.

The HubSpokeConfig type describes each config.

HubSpokeConfig
interface HubSpokeConfig {
  __typename: "HubSpokeConfig";
  hub: Hub;
  spoke: Spoke;
  asset: HubAsset;
  supplyCap: Erc20Amount;
  borrowCap: Erc20Amount;
  active: boolean;
  halted: boolean;
  riskPremiumThreshold: PercentNumber;
}

Use the useHubSpokeConfigs hook in React, the hubSpokeConfigs action in TypeScript, or the hubSpokeConfigs query in GraphQL to fetch all asset configs shared by a hub and spoke.

import { type HubId, type SpokeId, useHubSpokeConfigs } from "@aave/react";

function HubSpokeConfigs({ hubId, spokeId }: { hubId: HubId; spokeId: SpokeId }) {
  const { data, loading, error } = useHubSpokeConfigs({ hubId, spokeId });

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

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

  return (
    <ul>
      {data.map((config) => (
        <li key={config.asset.id}>
          {config.asset.underlying.info.symbol}: {config.active ? "Active" : "Inactive"}
        </li>
      ))}
    </ul>
  );
}

Hub Assets

Hub Assets are the ERC-20 tokens held by a given Hub.

Hub Asset Data Structure

Hub Asset data provides detailed information about each asset available on a Liquidity Hub, including:

  • Identification: id, onchainAssetId, underlying token details
  • Hub reference: the hub where this asset is available
  • Summary metrics: supplied/borrowed amounts, APY rates, utilization
  • Reserve coverage: total connected reserves and active reserves
  • Settings: fee receiver, liquidity fees, strategies
  • User state: user’s balance (when user is specified in request)
interface HubAsset {
  __typename: "HubAsset";
  id: HubAssetId;
  onchainAssetId: OnChainHubAssetId;
  hub: Hub;
  underlying: Erc20Token;
  summary: HubAssetSummary;
  settings: HubAssetSettings;
  userState: HubAssetUserState | null;
}

Listing Hub Assets

Discover all available assets on a Hub, including their liquidity metrics, APY rates, and user-specific data.

Use the useHubAssets hook in React, the hubAssets action in TypeScript, or the hubAssets query in GraphQL to fetch assets for a specific hub. In Solidity, assets within the hub are assigned sequential assetId values starting from 0. For reference, here’s a complete function to retrieve all Hub Assets.

import { type HubAssetsRequest, useHubAssets } from "@aave/react";

function HubAssetsList({ request }: { request: HubAssetsRequest }) {
  const { data, loading, error } = useHubAssets(request);

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

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

  return (
    <div>
      {data.map((asset) => (
        <div key={asset.id}>
          <h3>{asset.underlying.info.name}</h3>
          <p>Hub: {asset.hub.name}</p>
        </div>
      ))}
    </div>
  );
}

In React, see below for examples of HubAssetsRequest objects.

const request: HubAssetsRequest = {
  query: {
    hubId: hub.id, // hub.id: HubId from component props or previous query
  },
};

In React and TypeScript, you can add a user address to return HubAssetUserState for each asset.

Hub Asset User State
import { evmAddress } from "@aave/react";

const request: HubAssetsRequest = {
  query: {
    // your query criteria
  },
  user: evmAddress("0x456…"),
};

In React, you can also specify a different currency for the data.

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

// …

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

Interest Rate Model

The interest rate model describes how supply and borrow rates change across the utilization range for a specific Hub Asset. Each data point includes the utilization rate, the corresponding borrow and supply rates, and the liquidity distance from the current state.

HubAssetInterestRateModelPoint
interface HubAssetInterestRateModelPoint {
  __typename: "HubAssetInterestRateModelPoint";
  utilizationRate: PercentNumber;
  borrowRate: PercentNumber;
  supplyRate: PercentNumber;
  liquidityDistance: Erc20Amount;
}

Fetch the full interest rate curve for a specific Hub Asset.

Use the useHubAssetInterestRateModel hook to fetch the interest rate curve for a Hub Asset.

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

function InterestRateModel({ hubAssetId }: { hubAssetId: HubAssetId }) {
  const { data, loading, error } = useHubAssetInterestRateModel({
    query: { hubAssetId },
  });

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

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

  return (
    <div>
      {data?.map((point, i) => (
        <div key={i}>
          <span>Utilization: {point.utilizationRate.normalized.toFixed(2)}%</span>
          <span>Borrow Rate: {point.borrowRate.normalized.toFixed(2)}%</span>
          <span>Supply Rate: {point.supplyRate.normalized.toFixed(2)}%</span>
        </div>
      ))}
    </div>
  );
}