Documentation Index
Fetch the complete documentation index at: https://docs.gizatech.xyz/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Agent class provides methods for managing which DeFi protocols an agent can allocate to and what constraints govern those allocations. These are wallet-scoped operations that apply to a specific smart account.There are two levels of protocol queries in the SDK:
giza.protocols(token)— Chain-level query on theGizaclient. Returns active protocol names for a given token across the chain.agent.protocols()— Wallet-scoped query on theAgentinstance. Returns fullProtocolobjects configured for this specific agent.
protocols()
Get the full list of protocols configured for this agent’s smart account, including metadata like TVL, APR, and pool information.Signature
Returns
Promise<Protocol[]>
Protocol Type
Examples
updateProtocols()
Update the list of protocols the agent is allowed to allocate to. At least one protocol must be provided.Signature
Parameters
Array of protocol names to enable for this agent. Must contain at least one entry.
Errors
ValidationError: Thrown if the protocols array is empty.
Examples
constraints()
Get the current allocation constraints for this agent.Signature
Returns
Promise<ConstraintConfig[]>
ConstraintConfig Type
kind field corresponds to one of the constraint types. Common constraint kinds include:
| Kind | Description | Params |
|---|---|---|
min_protocols | Minimum number of protocols to allocate across | { min_protocols: number } |
max_allocation_amount_per_protocol | Maximum percentage per protocol | { max_allocation: number } |
max_amount_per_protocol | Maximum absolute amount per protocol | { max_amount: number } |
min_amount | Minimum allocation amount | { min_amount: number } |
exclude_protocol | Exclude a protocol from allocation | { protocol: string } |
min_allocation_amount_per_protocol | Minimum allocation per protocol | { min_allocation: number } |
Examples
updateConstraints()
Replace the allocation constraints for this agent.Signature
Parameters
Array of constraint configurations to apply to the agent.
Examples
whitelist()
Get the whitelist configuration for this agent’s smart account.Signature
Returns
Promise<unknown> — the whitelist data structure varies by configuration.