> ## Documentation Index
> Fetch the complete documentation index at: https://xoxno.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Hubs

> How hub_id isolates markets inside the shared central pool.

A **hub** is an isolation domain. Every market is addressed as:

```rust theme={"system"}
HubAssetKey { hub_id: u32, asset: Address }
```

Never identify a market by asset address alone. The same token on two hubs is
two markets: separate indexes, cash, revenue, debt, and bad-debt socialization.

## What the hub gives you

* One pool contract, but separate accounting rows per market
* Its own interest-rate curve, reserve factor, and flash-loan settings, stored
  in pool `Params(HubAssetKey)`
* Its own indexes, cash, revenue, and bad-debt write-downs

Caps are **not** set here. Supply and borrow caps live on the spoke listing
(`SpokeAssetConfig`), so two spokes can cap the same market differently. See
[Spokes](/docs/stellar-lending/spokes).

## Discover markets

1. Read deployed controller / pool addresses from
   [Addresses](/docs/stellar-lending/dev/addresses) (do not hardcode).
2. Resolve listed hub assets from controller/pool views used by your indexer or
   SDK.
3. Always pass both `hub_id` and `asset` into supply, borrow, withdraw, and
   repay.

## Related

* [Markets](/docs/stellar-lending/markets) — listing and pool parameters
* [System architecture](/docs/stellar-lending/dev/system-architecture) — contract map
