Skip to main content
Returns an array of AmplifyVault objects matching the provided filter criteria. All parameters are optional — omitting all filters returns every vault accessible with your API key. Use getVaultsByConfig() as the primary way to discover vault names before calling transaction functions.

Import

import { getVaultsByConfig, YieldType } from '@paxoslabs/amplify-sdk'

Usage

// Get all CORE vaults on Ethereum
const vaults = await getVaultsByConfig({
  yieldType: YieldType.CORE,
  chainId: 1,
})

// Use the vault name in transaction calls
const [vault] = vaults
console.log(vault.name) // e.g. "amplify-core-eth-usdc"

Parameters

All parameters are optional. Results are filtered client-side from the vault cache and scoped to your organization by API key.
ParameterTypeDescription
yieldTypeYieldTypeFilter by yield strategy ("CORE", "TREASURY", or "FRONTIER")
chainIdnumberFilter by blockchain network ID
depositAssetAddressAddressFilter by deposit token address (baseTokenAddress)
withdrawAssetAddressAddressFilter by withdrawal asset address
settlementAssetAddressAddressFilter by settlement asset address
interface GetVaultsByConfigParams {
  yieldType?: YieldType
  chainId?: number
  depositAssetAddress?: Address
  withdrawAssetAddress?: Address
  settlementAssetAddress?: Address
}

Return Type

Promise<AmplifyVault[]>
Each AmplifyVault object includes:
interface AmplifyVault {
  id: string
  name: string // Use this as vaultName in transaction functions
  chainId: number
  yieldType: YieldType
  vault: VaultContracts // Contract addresses
  sla?: VaultSLA
  supportedAssets: VaultSupportedAsset[]
}

interface VaultSupportedAsset {
  address: Address // `0x${string}`
  symbol: string
  name: string
  decimals: number
  coinGeckoTokenId?: string
  depositable?: boolean
  withdrawable?: boolean
}

Examples

import {
  getVaultsByConfig,
  prepareDepositTxData,
  YieldType,
} from "@paxoslabs/amplify-sdk";

const USDC = "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48";

// Find the CORE USDC vault on Ethereum
const [vault] = await getVaultsByConfig({
  yieldType: YieldType.CORE,
  chainId: 1,
  depositAssetAddress: USDC,
});

if (!vault) {
  throw new Error("Vault not found");
}

// vault.name is now safe to use in transaction calls
const txData = await prepareDepositTxData({
  vaultName: vault.name,
  depositAsset: USDC,
  depositAmount: "1000",
  to: userAddress,
  chainId: 1,
});

Relationship to Other Discovery Functions

FunctionUse Case
getVaultsByConfig()Primary vault discovery — returns multiple vaults with flexible filters
findVaultByConfig()Single vault lookup by asset address + yield type + chain
getVaults()Raw vault list with VaultFilterOptions (equivalent to getVaultsByConfig)
getVaultsByConfig() and getVaults() share the same underlying cache. Results are automatically scoped to your organization by the API key used in initAmplifySDK().

Cache Behavior

getVaultsByConfig() uses the vault cache:
  • On first call, fetches from the Amplify API and populates the cache
  • Subsequent calls within the TTL (10 minutes) return cached data
  • Expired cache is automatically refreshed on access
  • Call waitForCacheReady() at startup to ensure the cache is pre-populated

Error Handling

ErrorDescriptionResolution
"SDK not initialized"Called before initAmplifySDK()Initialize the SDK first
"Invalid yieldType"Unknown yield type valueUse YieldType.CORE, YieldType.TREASURY, or YieldType.FRONTIER
"Invalid chainId"Non-positive integer chain IDProvide a valid chain ID
"Invalid depositAssetAddress"Malformed addressProvide a valid checksummed Ethereum address