Skip to main content

getAvailableProtocols

Get available DeFi protocols and pools for a specific chain with APY data.

Signature

getAvailableProtocols(chainId: SupportedChainId): Promise<ProtocolsResponse>

Parameters

ParameterTypeRequiredDescription
chainIdSupportedChainIdTarget chain ID

Returns

List of available protocols with pools and APY data

Return Type

interface ProtocolsResponse {
success: boolean;
chainId: SupportedChainId;
protocols: Protocol[];
}

Example

const protocols = await sdk.getAvailableProtocols(42161);
protocols.protocols.forEach((protocol) => {
console.log(`${protocol.name} (ID: ${protocol.id})`);
if (protocol.pools) {
protocol.pools.forEach((pool) => {
console.log(` Pool: ${pool.name} - APY: ${pool.apy || "N/A"}%`);
});
}
});