What Is an Agent
AnAgent is a resource handle bound to a single smart-account wallet address. Every method on the Agent class operates on that wallet, so you never need to pass the address repeatedly. The Agent encapsulates the full lifecycle of an autonomous yield agent: activation, monitoring, withdrawals, rewards, and protocol management.
How to Get One
There are three ways to obtain anAgent instance, all through the Giza client:
| Method | API Call | Use Case |
|---|---|---|
giza.createAgent(eoa) | Yes | Create a new smart account for an EOA |
giza.getAgent(eoa) | Yes | Look up an existing smart account by EOA |
giza.agent(wallet) | No | Wrap a known smart-account address |
The wallet Property
Every Agent exposes the smart-account address it is bound to:
Method Categories
TheAgent class groups its methods into six categories. Each is documented on its own page.
Lifecycle
Manage the agent’s activation state and trigger runs.| Method | Return Type | Description |
|---|---|---|
activate(options) | ActivateResponse | Activate the agent with token, protocols, and deposit tx |
deactivate(options?) | DeactivateResponse | Deactivate and optionally transfer funds back |
topUp(txHash) | TopUpResponse | Record an additional deposit |
run() | RunResponse | Trigger a manual optimization run |
Lifecycle
Full method reference with parameters, types, and examples
Monitoring
Track portfolio value, performance history, and APR.| Method | Return Type | Description |
|---|---|---|
portfolio() | AgentInfo | Current portfolio state, deposits, status |
performance(options?) | PerformanceChartResponse | Historical performance data points |
apr(options?) | WalletAprResponse | Current APR with optional sub-period breakdown |
aprByTokens(period?) | AprByTokenResponse | APR broken down by token allocation |
deposits() | DepositListResponse | List of all deposits |
Monitoring
Full method reference with parameters, types, and examples
Transactions
Browse transaction history, execution records, and logs. These methods return aPaginator for async iteration.
| Method | Return Type | Description |
|---|---|---|
transactions(options?) | Paginator<Transaction> | All wallet transactions |
executions(options?) | Paginator<ExecutionWithTransactionsDTO> | Execution batches with transactions |
executionLogs(executionId, options?) | Paginator<LogDTO> | Logs for a specific execution |
logs(options?) | Paginator<LogDTO> | All wallet logs |
Withdrawals
Withdraw funds and monitor withdrawal status.| Method | Return Type | Description |
|---|---|---|
withdraw(amount?) | WithdrawResponse | Initiate a partial or full withdrawal |
status() | WithdrawalStatusResponse | Current agent status and dates |
waitForDeactivation(options?) | WithdrawalStatusResponse | Poll until deactivation completes |
fees() | FeeResponse | Current fee structure |
limit(eoa) | LimitResponse | Withdrawal limit for the EOA |
Rewards
Claim and inspect accrued rewards. Paginated history uses thePaginator class.
| Method | Return Type | Description |
|---|---|---|
claimRewards() | ClaimedRewardsResponse | Claim all available rewards |
rewards(options?) | Paginator<RewardDTO> | Paginated reward records |
rewardHistory(options?) | Paginator<RewardDTO> | Paginated reward history |
Protocols
View and update the agent’s protocol selection and constraints.| Method | Return Type | Description |
|---|---|---|
protocols() | Protocol[] | Current protocol list for the agent |
updateProtocols(protocols) | void | Replace the agent’s protocol selection |
constraints() | ConstraintConfig[] | Current allocation constraints |
updateConstraints(constraints) | void | Replace allocation constraints |
whitelist() | unknown | Get the agent’s whitelist |