SDK Reference

Installation

For installation instructions use Getting Started with the SDK

SDK references

Vault Discovery

getAllVaults(params?)

Get information about all available vaults.

const vaults = await sdk.getAllVaults({
  query: {
    page: 0,
    perPage: 100,
    allowedNetworks: ['mainnet', 'polygon'],
    allowedProtocols: ['aave', 'compound'],
    allowedAssets: ['USDC', 'USDT'],
    minTvl: 1000000,
    maxTvl: 100000000,
    onlyTransactional: true,
    onlyAppFeatured: false
  }
})

getVault(params)

Get detailed information about a specific vault.

const vault = await sdk.getVault({
  path: {
    network: 'mainnet',
    vaultAddress: '0x1234...'
  }
})

getAssets(params)

List all tracked assets across networks.

Historical Data Methods

getVaultHistoricalData(params)

Get historical APY and TVL data for a vault.

getVaultHistoricalApy(params)

Get historical APY data only (lighter response than full historical data).

getVaultHistoricalTvl(params)

Get historical TVL data only.

getVaultHistoricalSharePrice(params)

Get historical share price data only.

Portfolio Methods

getPositions(params)

Get all positions for a user address.

getPosition(params)

Get a single vault position for a user.

getDepositOptions(params)

Get the best deposit options for a user.

getIdleAssets(params)

Get idle assets in a user's wallet that could be earning yield.

getUserVaultTotalReturns(params)

Get total returns for a specific user and vault.

getUserVaultEvents(params)

Get events (deposits, withdrawals) for a specific user and vault.

Transaction Methods

getTransactionsContext(params)

Get transaction context for a specific vault interaction. Returns available steps, token balances, allowances, and deposit limits.

getActions(params)

Generate signed-ready transaction calldata for deposit, redeem, or other vault actions.

The action parameter accepts: deposit, redeem, request-redeem, claim-redeem, request-deposit, claim-deposit, start-redeem-cooldown.

Rewards Methods

getRewardsTransactionsContext(params)

Get claimable rewards context for a wallet across all networks.

getRewardsClaimActions(params)

Generate transaction calldata to claim pending rewards.

Benchmark Methods

getBenchmarks(params)

Get current benchmark rates (USD or ETH) for a network.

getHistoricalBenchmarks(params)

Get historical benchmark rates with pagination.

Error Handling

The SDK throws HttpResponseError for API errors:

TypeScript Support

This SDK is written in TypeScript and provides full type safety. All API responses are properly typed based on the OpenAPI specification.

License

MIT License - see the LICENSE file for details.

Last updated