sodax_get_asset_suppliers
Get a list of suppliers lending to a money market asset by providing its reserve contract address.
Instructions
Get suppliers (lenders) for a specific money market asset by its reserve address
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reserveAddress | Yes | The reserve contract address of the asset | |
| offset | No | Number of suppliers to skip for pagination | |
| limit | No | Maximum number of suppliers to return (1-100) | |
| format | No | Response format: 'json' for raw data or 'markdown' for formatted text | markdown |
Implementation Reference
- src/tools/sodaxApi.ts:842-873 (handler)MCP tool handler for sodax_get_asset_suppliers — registers the tool with server.tool(), defines Zod schema (reserveAddress, offset, limit, format), calls getMoneyMarketAssetSuppliers() service function, and formats the response.
// Tool 23: Get Money Market Asset Suppliers server.tool( "sodax_get_asset_suppliers", "Get suppliers (lenders) for a specific money market asset by its reserve address", { reserveAddress: z.string() .describe("The reserve contract address of the asset"), offset: z.number().min(0).optional().default(0) .describe("Number of suppliers to skip for pagination"), limit: z.number().min(1).max(100).optional().default(20) .describe("Maximum number of suppliers to return (1-100)"), format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, READ_ONLY, async ({ reserveAddress, offset, limit, format }) => { try { const suppliers = await getMoneyMarketAssetSuppliers(reserveAddress, { offset, limit }); return { content: [{ type: "text", text: `## Suppliers for ${reserveAddress.slice(0, 10)}...\n\n` + formatResponse(suppliers, format) }] }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : "Unknown error"}` }], isError: true }; } } ); - src/tools/sodaxApi.ts:846-855 (schema)Zod schema definitions for sodax_get_asset_suppliers: reserveAddress (string), offset (optional number, default 0), limit (optional number 1-100, default 20), format (enum JSON/Markdown, default Markdown).
{ reserveAddress: z.string() .describe("The reserve contract address of the asset"), offset: z.number().min(0).optional().default(0) .describe("Number of suppliers to skip for pagination"), limit: z.number().min(1).max(100).optional().default(20) .describe("Maximum number of suppliers to return (1-100)"), format: z.nativeEnum(ResponseFormat).optional().default(ResponseFormat.MARKDOWN) .describe("Response format: 'json' for raw data or 'markdown' for formatted text") }, - src/services/sodaxApi.ts:556-573 (helper)API service function getMoneyMarketAssetSuppliers — fetches GET /moneymarket/asset/:reserveAddress/suppliers from the SODAX API with optional offset and limit query params.
export async function getMoneyMarketAssetSuppliers( reserveAddress: string, options?: { offset?: number; limit?: number } ): Promise<unknown> { try { const params = new URLSearchParams(); if (options?.offset) params.append("offset", options.offset.toString()); if (options?.limit) params.append("limit", options.limit.toString()); const queryString = params.toString(); const url = `/moneymarket/asset/${reserveAddress}/suppliers${queryString ? `?${queryString}` : ""}`; const response = await apiClient.get(url); return response.data; } catch (error) { console.error("Error fetching asset suppliers:", error); throw new Error("Failed to fetch money market asset suppliers from SODAX API"); } } - src/index.ts:254-255 (registration)Registration of sodax_get_asset_suppliers in the tool listing for the /api endpoint under the moneyMarket category group.
"sodax_get_asset_suppliers", "sodax_get_all_borrowers" - API drift check contract for sodax_get_asset_suppliers — maps endpoint GET /moneymarket/asset/:reserveAddress/suppliers with expected params (reserveAddress, offset, limit) and response fields (suppliers, total, offset, limit).
"GET /moneymarket/asset/:reserveAddress/suppliers": { tool: "sodax_get_asset_suppliers", params: ["reserveAddress", "offset", "limit"], requiredParams: ["reserveAddress"], responseFields: ["suppliers", "total", "offset", "limit"], },