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
This guide walks through the Giza Agent SDK from installation to a running agent. You’ll create a smart account, activate an agent, and start yield optimization.This quickstart focuses on the Agentic integration — Giza handles smart accounts, execution, gas, and optimization. If you have your own execution infrastructure and just want optimization intelligence, see the IaaS Integration Guide.
What Giza Manages vs What You Build
| Giza manages | You build |
|---|---|
| Smart account creation (ZeroDev) | User interface |
| Session key management | Deposit flow |
| Transaction execution | Performance display |
| Gas payment | Withdrawal requests |
| Continuous optimization | Notification systems |
| Protocol rebalancing | User authentication |
Architecture
Prerequisites
Node.js 18+
Node.js 18+
Check your version:
node --versionDownload from nodejs.org if needed.TypeScript Project
TypeScript Project
The SDK is built for TypeScript. JavaScript works too, but without type safety.
Giza API Credentials
Giza API Credentials
You’ll need:
GIZA_API_KEY- Your partner API keyGIZA_API_URL- Giza backend URLGIZA_PARTNER_NAME- Your partner identifier
Get API Keys
Request API keys from Giza teams.
Installation
Environment Setup
Create a.env file in your project root:
.env
Complete Integration Flow
Step 1: Initialize the SDK
Step 2: Create a Smart Account
Generate a smart account for your user. This is where they’ll deposit funds.Step 3: Get Available Protocols
Check which DeFi protocols are available for the token you want to optimize:Step 4: User Deposits Funds
User sends tokens to smart account
User transfers USDC (or supported token) to the
agent.wallet address from Step 2.Step 5: Activate the Agent
After the user deposits, activate the agent to start optimization:Once activated, the agent automatically:
- Monitors APRs across selected protocols
- Rebalances capital for optimal yield
- Handles all gas costs internally
- Continues optimizing until deactivated
Step 6: Monitor Performance
Track the agent’s performance:Step 7: Withdraw Funds
Users can withdraw partially or fully at any time:- Full Withdrawal
- Partial Withdrawal
Additional Operations
Top-Up Active Agent
Update Protocols
Manual Rebalance
Multi-Chain Management
Run agents on multiple chains simultaneously:Constraint-Based Risk Management
Use constraints to control agent behavior:Error Handling
Wrap SDK calls in try-catch blocks:Error Handling Guide
Error types, retry patterns, and user-friendly messages
Next Steps
Architecture
Understand smart accounts, agents, and protocols
SDK Reference
Explore all SDK methods
API Reference
HTTP API documentation
IaaS Integration
Use Optimizer with your own infrastructure