Skip to main content

Pool customization

Pool customization lets users choose which pools an agent may use for an asset.

The workflow has three parts:

  1. Load the available pools with getPoolCatalog.
  2. Restore the user's saved choices with getPoolSelection.
  3. Save new choices with setPoolSelection before depositing.

Without a saved pool selection for a protocol and chain, the agent uses its default pool selection. Saving pool names creates an explicit selection; saving an empty selection means none of the displayed pools are selected.

getPoolCatalog​

Returns the selectable pools for an asset, grouped by protocol.

getPoolCatalog(params: {
asset: OwneySupportedTokens;
strategy: "conservative" | "aggressive" | "yieldmaxxing";
agentId?: AgentId;
}): Promise<PoolCatalogProtocol[]>

Parameters

  • asset - Asset whose pools should be returned.
  • strategy - Strategy used to load the available pool catalogue.
  • agentId - Optional target agent.

Each PoolCatalogProtocol contains the protocol name, optional logo, and its AvailablePool entries. A pool includes its chain, asset, name, APY, TVL in USD, and optional link.

If one protocol cannot provide pools, it is omitted without discarding the rest of the catalogue.

getPoolSelection​

Returns the pool selections and asset strategies currently saved for the requested protocol/chain pairs.

Requires wallet connection: Yes

getPoolSelection(params: {
pairs: Array<{ protocolId: string; chainId: number }>;
assets: Array<"USDC" | "WETH">;
agentId?: AgentId;
}): Promise<SavedPoolSelection>
  • pairs determines which protocol/chain selections to read.
  • assets determines which saved asset strategies to read.
  • A pair omitted from saved.pairs uses the agent's default pool selection.
  • A saved pair with an empty pools array means no pools are selected for that protocol and chain.

setPoolSelection​

Saves explicit pool selections for the user. Call it before deposit or swapAndDeposit.

Requires wallet connection: Yes

setPoolSelection(params: {
selection: UserPoolSelectionRequest;
agentId?: AgentId;
}): Promise<void>

For each UserPoolSelection:

  • pools contains the pool names selected by the user.
  • availablePools must contain every pool shown for the same asset, protocol, and chain—not only the selected pools. The SDK uses the complete list to preserve choices belonging to other assets.
  • An empty pools array, with a non-empty availablePools array, selects none of the displayed pools.

If saving fails, do not start the deposit.