Method Signature
Description
Activates an autonomous agent to manage capital in a smart account. Once activated, the agent continuously monitors APRs and automatically rebalances funds across selected protocols for optimal yield.Parameters
Smart account address to activate.
User’s origin wallet (EOA or smart wallet).
Token address deposited (e.g., USDC address).
Array of protocol names the agent can use. Get available protocols with
getProtocols().Example: ["aave", "compound", "moonwell"]Optional but recommended. Deposit transaction hash for verification.
Optional constraints to control agent behavior.Example:
Return Value
Success message confirming activation.
Smart account address that was activated.
Example
Constraints
Available constraint types:| Constraint | Description | Parameters |
|---|---|---|
min_protocols | Minimum protocols to use | { min_protocols: number } |
max_amount_per_protocol | Cap per any protocol | { max_amount: string } |
max_allocation_amount_per_protocol | Cap specific protocol | { protocol: string, max_amount: string } |
exclude_protocol | Blacklist protocol | { protocol: string } |
min_amount | Min per protocol | { min_amount: string } |
Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
ValidationError: At least one protocol must be selected | Empty protocols array | Provide at least one protocol |
GizaAPIError: No deposits found | Smart account has no balance | Ensure user deposited funds first |
GizaAPIError: Invalid protocol | Protocol not available | Check available protocols with getProtocols() |
Notes
Activation is Asynchronous
Activation is Asynchronous
Activation initiates the process but agents may take a few moments to start optimizing. Check status with
getPortfolio().Provide Transaction Hash
Provide Transaction Hash
Including the deposit
tx_hash helps verify funds and speeds up activation.Select Multiple Protocols
Select Multiple Protocols
Choose at least 2-3 protocols for diversification and better optimization opportunities.