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.
| Parameter | Type | Description |
|---|
yieldType | YieldType | Filter by yield strategy ("CORE", "TREASURY", or "FRONTIER") |
chainId | number | Filter by blockchain network ID |
depositAssetAddress | Address | Filter by deposit token address (baseTokenAddress) |
withdrawAssetAddress | Address | Filter by withdrawal asset address |
settlementAssetAddress | Address | Filter by settlement asset address |
interface GetVaultsByConfigParams {
yieldType?: YieldType
chainId?: number
depositAssetAddress?: Address
withdrawAssetAddress?: Address
settlementAssetAddress?: Address
}
Return Type
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
Get specific vault
List all vaults
React hook
Multi-chain vaults
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,
});
import { getVaultsByConfig } from "@paxoslabs/amplify-sdk";
// All vaults for your organization
const allVaults = await getVaultsByConfig();
for (const vault of allVaults) {
console.log(`${vault.name} — ${vault.yieldType} on chain ${vault.chainId}`);
}
import { useQuery } from "@tanstack/react-query";
import { getVaultsByConfig, YieldType } from "@paxoslabs/amplify-sdk";
function useVaults(yieldType?: YieldType, chainId?: number) {
return useQuery({
queryKey: ["vaults", yieldType, chainId],
queryFn: () => getVaultsByConfig({ yieldType, chainId }),
});
}
function VaultSelector() {
const { data: vaults, isLoading } = useVaults(YieldType.CORE, 1);
if (isLoading) return <p>Loading vaults...</p>;
return (
<select>
{vaults?.map((vault) => (
<option key={vault.id} value={vault.name}>
{vault.name} ({vault.supportedAssets.map((a) => a.symbol).join(", ")})
</option>
))}
</select>
);
}
import { getVaultsByConfig, YieldType } from "@paxoslabs/amplify-sdk";
// Get CORE vaults across all chains
const coreVaults = await getVaultsByConfig({
yieldType: YieldType.CORE,
});
for (const vault of coreVaults) {
console.log(`Chain ${vault.chainId}: ${vault.name}`);
}
// Get all vaults on HyperEVM (chainId 999)
const hyperVaults = await getVaultsByConfig({ chainId: 999 });
Relationship to Other Discovery Functions
| Function | Use 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
| Error | Description | Resolution |
|---|
"SDK not initialized" | Called before initAmplifySDK() | Initialize the SDK first |
"Invalid yieldType" | Unknown yield type value | Use YieldType.CORE, YieldType.TREASURY, or YieldType.FRONTIER |
"Invalid chainId" | Non-positive integer chain ID | Provide a valid chain ID |
"Invalid depositAssetAddress" | Malformed address | Provide a valid checksummed Ethereum address |