tensaikit
Version:
An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.
95 lines (94 loc) • 4.71 kB
TypeScript
import { z } from "zod";
import { ActionProvider } from "../actionProvider";
import { EvmWalletProvider } from "../../walletProviders";
import { Network } from "../../network";
import { ActiveMarketsQuerySchema, MarketStateByUniqueKeySchema, WhitelistedVaultsQuerySchema } from "./schemas";
/**
* Provides subgraph-based read-only actions for Morpho Blue protocol.
* Includes interest rates, active markets, and account-level data queries.
*/
export declare class MorphoSubgraphActionProvider extends ActionProvider<EvmWalletProvider> {
/**
* Initializes the Morpho Subgraph Action Provider
*/
constructor();
/**
* Retrieves a list of active (whitelisted) Morpho Blue markets with configuration and state metrics.
*
* This function queries the Morpho subgraph to return market entries that are whitelisted,
* including supply/borrow APYs, token details, oracle and interest rate model configuration,
* utilization, collateral stats, and overall TVL.
*
* Useful for building dashboards or letting users explore markets available for lending/borrowing.
*
* @param walletProvider - Instance of EVM-compatible wallet provider.
* @param args - Pagination input including:
* - `skip`: Number of items to skip.
* - `first`: Number of items to fetch (max 100).
*
* @returns A Promise resolving to a JSON string of active Morpho Blue markets.
*
* @throws Will throw an error if:
* - The network is not supported or is invalid.
* - The subgraph query fails or returns an invalid result.
*/
getActiveMarkets(walletProvider: EvmWalletProvider, args: z.infer<typeof ActiveMarketsQuerySchema>): Promise<string>;
/**
* Retrieves all whitelisted vaults available on the Morpho Blue protocol for the current network.
*
* Each vault contains metadata (name, symbol, creator), performance data (APY, total assets), and reward info.
* Useful for users selecting yield strategies or analyzing vaults curated by the protocol.
*
* @param walletProvider - Instance of EVM-compatible wallet provider.
* @param args - Pagination input including:
* - `skip`: Number of items to skip.
* - `first`: Number of items to fetch (max 100).
*
* @returns A Promise resolving to a JSON string array of whitelisted vaults.
*
* @throws Will throw if the network is unsupported or the query fails.
*/
getWhitelistedVaults(walletProvider: EvmWalletProvider, args: z.infer<typeof WhitelistedVaultsQuerySchema>): Promise<string>;
/**
* Fetches the current state of a specific Morpho Blue market using its unique key.
*
* This action returns on-chain metrics such as TVL, supply/borrow amounts, liquidity,
* and performance rates (APY, APR). Useful for tracking market health and performance.
*
* @param walletProvider - Connected EVM-compatible wallet provider.
* @param args - Includes a valid `uniqueKey` and `chainId` to identify the market.
*
* @returns A Promise resolving to a JSON string of market state details.
*
* @throws If the network is not supported or subgraph query fails.
*/
getMarketStateByUniqueKey(walletProvider: EvmWalletProvider, args: z.infer<typeof MarketStateByUniqueKeySchema>): Promise<string>;
/**
* Retrieves complete portfolio data for the connected wallet in Morpho Blue protocol.
*
* This includes vault and market positions (with PnL, balances, and USD values), and recent transactions.
* Ideal for building user dashboards or financial summaries.
*
* @param walletProvider - Connected EVM-compatible wallet provider.
*
* @returns A Promise resolving to a JSON string of the user's positions and activity.
*
* @throws Will throw if the network is unsupported or query fails.
*/
getUserPortfolioData(walletProvider: EvmWalletProvider): Promise<string>;
/**
* Fetches all curators registered on the Morpho Blue protocol for the connected network.
*
* Each curator includes metadata (name, image), AUM, and verification status.
* Useful for filtering vaults or recommending trusted curators to users.
*
* @param walletProvider - Instance of EVM-compatible wallet provider.
*
* @returns A Promise resolving to a JSON string of curators.
*
* @throws If the network is unsupported or the subgraph call fails.
*/
getCurators(walletProvider: EvmWalletProvider): Promise<string>;
supportsNetwork: (network: Network) => boolean;
}
export declare const morphoSubgraphActionProvider: () => MorphoSubgraphActionProvider;