tensaikit
Version:
An autonomous DeFi AI Agent Kit on Katana enabling AI agents to plan and execute on-chain financial operations.
24 lines (23 loc) • 1 kB
TypeScript
import { EvmWalletProvider } from "../../../walletProviders";
/**
* Fetches Morpho Blue user data (positions, vaults, and transactions) by wallet address.
*
* This function queries the Morpho subgraph for a user's detailed activity and positions
* using the connected wallet's address on the supported chain/network.
*
* It retrieves:
* - Market positions (supply, borrow, collateral, PnL)
* - Vault positions (assets, shares, USD value)
* - Transaction history
*
* @param walletProvider - The connected EVM wallet provider instance.
*
* @returns A user object from the subgraph including positions and transactions,
* or `null` if the user has no data or address is not found.
*
* @throws Will throw an error if:
* - Network/chainId is missing or invalid.
* - The network is not supported by the Morpho subgraph.
* - The subgraph query fails or returns invalid data.
*/
export declare const fetchUserDataByAddress: (walletProvider: EvmWalletProvider) => Promise<any>;