UNPKG

tensaikit

Version:

An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.

22 lines (21 loc) 1.06 kB
import { z } from "zod"; import { EvmWalletProvider } from "../../../walletProviders"; import { MarketStateByUniqueKeySchema } from "../schemas"; /** * Fetches the on-chain state of a Morpho Blue market using its unique key. * * This function queries the Morpho subgraph to retrieve the current market state * (liquidity, borrow/supply stats, APYs, etc.) associated with the provided `uniqueKey`. * * @param walletProvider - Connected EVM wallet instance. * @param args - Object containing a valid `uniqueKey` (bytes32) to identify the market. * * @returns A Promise resolving to the state of the specified market, * or `null` if the market is not found or has no recorded state. * * @throws Will throw an error if: * - Network or chainId is missing or invalid. * - The network is not supported by Morpho subgraph. * - A subgraph call fails or returns an invalid result. */ export declare const fetchMarketStateByUniqueKey: (walletProvider: EvmWalletProvider, args: z.infer<typeof MarketStateByUniqueKeySchema>) => Promise<any>;