For the complete documentation index, see llms.txt. This page is also available as Markdown.

Indexing Vault Factories & Vaults

This chapter teaches the generic pattern for indexing every vault created through VaultPortal β€” the factory that produced it, and the vault itself. It is vault-type agnostic on purpose: one event covers all vaults, and you branch on the factory to enrich each record.

Vault-type-specific guides (which dividend asset a vault pays, how to read its composition, which extra events it emits) are the sub-chapters that follow, such as Index & Query a Stocks Vault. Each vault type is documented the same way.

Overview

A tax token can be launched together with a revenue vault in a single transaction through VaultPortal.newTaxTokenWithVault / newTokenV6WithVault. No matter which factory produced the vault, VaultPortal emits one universal signal:

/// @notice Emitted when a new tax token with an associated vault is successfully created
/// @param token        The address of the newly deployed tax token
/// @param vault         The address of the newly created vault that will receive tax revenue
/// @param vaultFactory  The vault factory address that was used to create the vault
event FlapTaxVaultTokenCreated(
    address indexed token,
    address indexed vault,
    address indexed vaultFactory
);

All three arguments are indexed, so you can filter by token, vault, or vaultFactory directly at the log level.

FlapTaxVaultTokenCreated is emitted by VaultPortal β€” not by the individual factories. Index it on the VaultPortal address for the chain you are following (see Deployed Contract Addresses). Individual factories may emit their own richer events; those are documented per vault type in the sub-chapters.

Suggested indexing flow

  1. Listen to FlapTaxVaultTquokenCreated on VaultPortal.

  2. Persist (token, vault, vaultFactory) plus the block/tx context.

  3. Classify the vault by its vaultFactory address (see Identify the vault type).

  4. Enrich the record with vault-type-specific data by reading from the vault/factory, or by calling VaultPortal.getVault / tryGetVault for a generic summary.

Because the vault type is fully determined by vaultFactory, adding support for a new vault type is additive: keep indexing the same event, and add a new branch for the new factory address. Each vault type is documented in its own sub-chapter.

Identify the vault type

The vaultFactory address is the type key. How you decode a vault (which dividend asset it pays, which extra events it emits) is determined entirely by the factory that produced it, so maintain a per-chain allowlist mapping each known vaultFactory address to a vault type and its decoding logic. A vaultFactory that is not in your allowlist is a vault type you do not decode yet β€” flag it so you know to add a decoding branch. The Stocks (RWA / Index) factory addresses are listed in Index & Query a Stocks Vault.

Enrich via VaultPortal (generic summary)

If you only need a generic summary and do not want to talk to each factory, VaultPortal exposes two view helpers:

Prefer tryGetVault in an indexer: it never reverts, so a token with no vault simply returns found = false instead of failing your batch call. getVault reverts with VaultNotFound(taxToken) when there is no vault.

VaultInfo.description is produced by the vault's own description() method and is intended for display. It is not a stable schema β€” do not parse it for machine-readable fields. Read typed values from the vault/factory instead (see the per-vault-type sub-chapters).

Vault types

Last updated