Skip to main content

Overview

Monitoring methods let you inspect the current state of an agent and its historical performance. All methods are called on an Agent instance and are scoped to that agent’s smart-account wallet.

portfolio()

Returns the full current state of the agent, including deposits, withdrawals, status, protocol selection, and key dates.

Return Type

Example


performance(options?)

Returns historical performance data points for charting portfolio value over time. Each data point includes the date, value, USD value, accrued rewards, and portfolio breakdown.

Parameters

string
ISO date string to filter performance data from this date onward. Omit to get all available history.

Return Type

Where Portfolio is Record<string, AllocatedValue> mapping protocol names to their allocation details, and AccruedRewardsBySymbol is Record<string, AccruedRewardsWithValue> mapping reward token symbols to their locked/unlocked amounts.

Example


apr(options?)

Returns the agent’s annualized percentage rate (APR). Optionally specify a date range to compute APR over a specific period. The response can include sub-period breakdowns for detailed analysis.

Parameters

string
ISO date string for the start of the APR calculation period.
string
ISO date string for the end of the APR calculation period.
boolean
When true, uses the exact end date instead of rounding to the nearest period boundary.

Return Type

Example


aprByTokens(period?)

Returns APR data broken down by token allocation. Each entry includes the current value, USD value, and base/total APR for that allocation.

Parameters

Period
Time period for the APR calculation. Use Period.ALL for the entire history or Period.DAY for daily.

Return Type

Example


deposits()

Returns all deposits made to the agent’s smart account.

Return Type

Example


Building a Dashboard

This example shows how to combine monitoring methods to build a portfolio dashboard view.
Use Promise.all to fetch independent data in parallel. This reduces total latency compared to sequential calls.

Next Steps

Lifecycle

Activation, deactivation, and agent state management

Agent Overview

All Agent methods at a glance

Giza Client

Chain-level queries and agent factory methods