Skip to Content
docs

Aave V4 Spokes

Spokes are the modules users interact with; each Spoke draws liquidity from one or more Liquidity Hubs.

Spoke Data Structure

Spoke data provide information about individual borrowing modules, including:

  • Identification: id, name, address, chain
  • Liquidation parameters: target health factor, max-bonus threshold, and bonus factor (liquidationConfig)
  • Summary metrics: supplied, borrowed, supply and borrow caps, connected Hubs, and unique assets

The following TypeScript interfaces and GraphQL fragments illustrate the core Spoke type. In Solidity, Spokes are deployed contracts implementing the ISpoke interface, managed by governance, and the following structs illustrate the Spoke data.

interface Spoke {
  __typename: "Spoke";
  id: SpokeId;
  name: string;
  address: EvmAddress;
  chain: Chain;
  liquidationConfig: SpokeLiquidationConfig | null;
  summary: SpokeSummary;
  connectedHubs: SpokeConnectedHub[];
}

In Solidity, the relationship between Spokes and Hubs is tracked onchain within the Hub contract. Each Spoke can connect to multiple Hub Assets, maintaining separate SpokeData state for each asset. Spoke connections and config updates emit these events:

Spoke Events
event AddSpoke(uint256 indexed assetId, address indexed spoke);
event UpdateSpokeConfig(uint256 indexed assetId, address indexed spoke, SpokeConfig config);

Listing Available Spokes

Discover all available Aave Spokes across supported networks.

Use the useSpokes hook in React, the spokes action in TypeScript, or the spokes query in GraphQL to fetch a list of available spokes.

import { type SpokesRequest, useSpokes } from "@aave/react";

function SpokesList({ request }: { request: SpokesRequest }) {
  const { data, loading, error } = useSpokes(request);

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

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

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

In React, see below for examples of SpokesRequest objects.

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

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

Deployed Spokes

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

NameAddress
Main Spoke0x94e7A5dCbE816e498b89aB752661904E2F56c485
Bluechip Spoke0x973a023A77420ba610f06b3858aD991Df6d85A08
Ethena Correlated Spoke0x58131E79531caB1d52301228d1f7b842F26B9649
Ethena Ecosystem Spoke0xba1B3D55D249692b669A164024A838309B7508AF
EtherFi eSpoke0xbF10BDfE177dE0336aFD7fcCF80A904E15386219
Forex Spoke0xD8B93635b8C6d0fF98CbE90b5988E3F2d1Cd9da1
Gold Spoke0x65407b940966954b23dfA3caA5C0702bB42984DC
Kelp eSpoke0x3131FE68C4722e726fe6B2819ED68e514395B9a4
Lido eSpoke0xe1900480ac69f0B296841Cd01cC37546d92F35Cd
Lombard BTC Spoke0x7EC68b5695e803e98a21a9A05d744F28b0a7753D
Treasury Spoke0xB9B0b8616f6Bf6841972a52058132BE08d723155

Spokes connected to a specific Hub can be discovered through the Hub’s Spoke events and methods. See the Hub Data Structure section for details on querying spoke relationships.

Fetching a Single Spoke

Fetch a specific Spoke by ID or by address and chain ID.

Use the useSpoke hook in React, the spoke action in TypeScript, or the spoke query in GraphQL to fetch a specific spoke.

import { type SpokeRequest, useSpoke } from "@aave/react";

function SpokeDetails({ request }: { request: SpokeRequest }) {
  const { data, loading, error } = useSpoke(request);

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

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

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

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

In React, see below for examples of SpokeRequest objects.

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

const request: SpokeRequest = {
  query: {
    spokeId: spokeId(params.id), // SpokeId - typically from URL params
  },
};

Spoke Summary History

Fetch historical deposits and borrows for a specific spoke over a chosen time window.

Use the useSpokeSummaryHistory hook in React, the spokeSummaryHistory action in TypeScript, or the spokeSummaryHistory query in GraphQL to fetch historical data for a Spoke.

import {
  type SpokeSummaryHistoryRequest,
  useSpokeSummaryHistory,
} from "@aave/react";

function SpokeHistory({ request }: { request: SpokeSummaryHistoryRequest }) {
  const { data, loading, error } = useSpokeSummaryHistory(request);

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

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

  return (
    <div>
      <h2>Spoke 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>
        </div>
      ))}
    </div>
  );
}
  • React: See below for examples of SpokeSummaryHistoryRequest objects.
  • GraphQL: Use the query, currency and window fields to specify the Spoke and time period.
import { spokeId, TimeWindow } from "@aave/react";

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