Skip to main content
POST
SDK Alternative: Use giza.optimize(options) for a simpler TypeScript interface. See SDK docs

Description

Calculates the optimal capital allocation across DeFi lending protocols. Returns the optimal allocation, an action plan to achieve it, and execution-ready calldata. This endpoint is the core of the IaaS (Intelligence as a Service) integration.

Path Parameters

integer
required
The blockchain chain ID

Request Body

string
required
Total capital to allocate (as bigint string, e.g., “1000000000” for 1000 USDC)
string
required
Token address to optimize for
object
required
Current allocations by protocol (protocol name → amount as bigint string)Example: {"aave": "500000000", "compound": "500000000"}
array
required
List of protocol names to consider for optimization
array
Optional constraints for optimization. Each constraint is an object with kind and params.Constraint types and required parameters:Example:
string
Optional wallet address that will execute the transactions. Example: "0x1234567890123456789012345678901234567890"

Response

object
Optimization results
array
Ordered list of actions to execute
array
Execution-ready transaction data