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

# Compute Units

> Understand how Sim bills API usage using Compute Units (CUs) and how they're calculated per endpoint.

export const DefaultChainCount = ({endpoint}) => {
  const dataState = useState(null);
  const data = dataState[0];
  const setData = dataState[1];
  useEffect(function () {
    fetch("https://api.sim.dune.com/v1/evm/supported-chains", {
      method: "GET"
    }).then(function (response) {
      return response.json();
    }).then(function (responseData) {
      setData(responseData);
    });
  }, []);
  if (data === null) {
    return <>N</>;
  }
  if (!data.chains || !Array.isArray(data.chains)) {
    return <>N</>;
  }
  var uniqueDefaultChains = new Set();
  for (var i = 0; i < data.chains.length; i++) {
    var chain = data.chains[i];
    var hasDefaultTag = Array.isArray(chain.tags) && chain.tags.indexOf("default") !== -1;
    if (!hasDefaultTag) {
      continue;
    }
    if (endpoint !== undefined) {
      if (chain[endpoint] && chain[endpoint].supported === true) {
        uniqueDefaultChains.add(chain.name);
      }
    } else {
      uniqueDefaultChains.add(chain.name);
    }
  }
  var count = uniqueDefaultChains.size;
  return <>{count}</>;
};

Every API call costs Compute Units (CUs). Simple queries cost 1 CU. Multi-chain queries multiply by the number of chains. For example, fetching balances for 1 wallet on 3 chains = 3 CUs.

<Warning>
  If you omit the `chain_ids` parameter, the request uses the `default` chain set, which currently includes {<DefaultChainCount endpoint="balances" />}+ chains and may grow as Sim adds networks. Always pass explicit `chain_ids` to keep costs predictable.
</Warning>

| Endpoint                         | Type            | Compute Units                                                                                                      | Default Chains (no chain\_ids)                                                    |
| -------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------- |
| Balances (EVM & SVM)             | Chain-dependent | N compute units, where N is the number of chains processed in the `chain_ids` query parameter after tag expansion  | {<DefaultChainCount endpoint="balances" />}                                       |
| Balances (single token sub-path) | Fixed           | 1 compute unit per request. Accepts exactly one `chain_ids` value (single chain only)                              | -                                                                                 |
| Collectibles                     | Chain-dependent | N compute units, where N is the number of chains processed in the `chain_ids` query parameter after tag expansion  | {<DefaultChainCount endpoint="collectibles" />}                                   |
| DeFi Positions                   | Chain-dependent | 4N compute units, where N is the number of chains processed in the `chain_ids` query parameter after tag expansion | 6                                                                                 |
| Activity                         | Fixed           | 3 compute units per request                                                                                        | —                                                                                 |
| Transactions (EVM & SVM)         | Fixed           | 1 compute unit per request                                                                                         | —                                                                                 |
| Token Info                       | Fixed           | 2 compute units per request, even though `chain_ids` is required                                                   | —                                                                                 |
| Token Holders                    | Fixed           | 2 compute units per request                                                                                        | —                                                                                 |
| Search Tokens                    | Fixed           | 2 compute units per request, regardless of how many `chain_ids` are included                                       | —                                                                                 |
| Subscriptions                    | Event-based     | 2 compute units per event sent to your webhook. Note that a single webhook payload can contain multiple events.    | All supported EVM chains (varies by subscription type) when chain\_ids is omitted |

## How CUs work

For chain-dependent endpoints, CU equals the number of distinct chains the request processes. If you pass tags (like `default`, `mainnet`, or `testnet`) via `chain_ids`, we expand them to specific chains before computing CU. If you omit `chain_ids` in the Collectibles or Balances endpoints, the endpoint uses its default chain set. CU equals the size of that set at request time, currently {<DefaultChainCount endpoint="balances" />} for Balances and {<DefaultChainCount endpoint="collectibles" />} for Collectibles, and may change as Sim adds more chains.

For fixed endpoints, each request consumes exactly specified number of compute units regardless of how many chains you query or what parameters you provide.

## Chain selection and tags

Chain count is computed after we expand any tags you pass. To keep CU predictable over time, specify explicit `chain_ids` (EVM). If you use tags like `default` or `mainnet`, we expand them to specific chains at request time. Tags can grow as we add more networks. Pin chains explicitly to keep CU stable. See [Supported Chains](/evm/supported-chains#tags).

## Examples

<Columns cols={2}>
  <Card title="Balances: explicit chains">
    Use `?chain_ids=1,8453,137` to process three chains. This consumes three CUs.
  </Card>

  <Card title="Balances: default set">
    Omitting `chain_ids` uses the endpoint's chains tagged `default`. CU equals the size of that set at request time ({<DefaultChainCount endpoint="balances" />} as of now, and subject to change). See [Supported Chains](/evm/supported-chains#tags).
  </Card>

  <Card title="Balances: mainnet tag">
    Passing `?chain_ids=mainnet` expands to all supported mainnet chains for the endpoint. CU equals the expanded chain count.
  </Card>

  <Card title="Balances (single token sub-path): fixed cost">
    Each request consumes 1 CU and must specify exactly one chain via `chain_ids`.
  </Card>

  <Card title="Collectibles: default set">
    Omitting `chain_ids` uses the endpoint's chains tagged `default`. CU equals the size of that set at request time ({<DefaultChainCount endpoint="collectibles" />} as of now, and subject to change).
  </Card>

  <Card title="Activity: fixed cost">
    Activity uses a fixed-cost model. Each request consumes the same CU regardless of chains queried.
  </Card>

  <Card title="Token Info: fixed cost">
    Token Info is fixed-cost per request, even though `chain_ids` is required. CU does not scale with the number of chains.
  </Card>

  <Card title="Subscriptions: event-based cost">
    Each event sent to your webhook consumes 2 CUs. A single webhook payload may contain multiple events, resulting in multiple CUs per webhook delivery.
  </Card>
</Columns>

## FAQs

<AccordionGroup>
  <Accordion title="How do I estimate CU before making a request?">
    For chain-dependent endpoints, count the chains you include (after any tag expansion). For fixed-CU endpoints, see the table at the top of the page.
  </Accordion>

  <Accordion title="Does token filtering impact CU usage?">
    No. CU is based on chain count or a fixed per-request cost, not on token filtering. See [Token Filtering](/token-filtering).
  </Accordion>

  <Accordion title="Why did my CU change when I didn't pass chain_ids?">
    If you omit `chain_ids` for endpoints where it can be passed, we use the endpoint's `default` chain set, which may grow as new chains are added. Pin explicit chains to keep CU stable.
  </Accordion>

  <Accordion title="Where do I view my CU usage?">
    Visit your Sim Dashboard.
  </Accordion>
</AccordionGroup>
