read.account.history
Read-onlyIdempotent
Retrieve historical collateral and debt values for an Arcadia Finance account to analyze performance trends over time.
Instructions
Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value). Each value is the account's net value in USD (human-readable, not raw units). Useful for charting account performance over a period.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| account_address | Yes | Arcadia account address | |
| days | No | Number of days of history (default 14) | |
| chain_id | No | Chain ID: 8453 (Base) or 130 (Unichain) |
Output Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| history | Yes |
Implementation Reference
- src/tools/read/account.ts:240-265 (handler)The handler function for 'read.account.history', which calls api.getAccountHistory and returns the formatted account history data.
async ({ account_address, days, chain_id }) => { try { const validChainId = validateChainId(chain_id); if (days <= 0) { return { content: [{ type: "text" as const, text: "Error: days must be a positive number" }], isError: true, }; } const raw = await api.getAccountHistory(validChainId, account_address, days); const result = { history: Array.isArray(raw) ? raw : [] }; return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }], structuredContent: result, }; } catch (err) { return { content: [ { type: "text" as const, text: `Error: ${err instanceof Error ? err.message : String(err)}`, }, ], isError: true, }; } - src/tools/read/account.ts:221-239 (registration)Registration block for 'read.account.history' tool including definition of inputs and outputs.
server.registerTool( "read.account.history", { annotations: { title: "Get Account History", readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: true, }, description: "Get historical collateral and debt values for an Arcadia account over time. Returns a time series of snapshots (timestamp, collateral_value, debt_value, net_value). Each value is the account's net value in USD (human-readable, not raw units). Useful for charting account performance over a period.", inputSchema: { account_address: z.string().describe("Arcadia account address"), days: z.number().default(14).describe("Number of days of history (default 14)"), chain_id: z.number().default(8453).describe("Chain ID: 8453 (Base) or 130 (Unichain)"), }, outputSchema: AccountHistoryOutput, },