Skip to main content

Overview

Intelligence as a Service (IaaS) gives you access to Giza’s Optimizer as a stateless service. If you already have execution infrastructure (smart accounts, transaction execution, capital management), you can use Giza’s optimization engine to get optimal capital allocations without giving up control.

What is IaaS?

IaaS means you bring your own:
  • Smart account infrastructure
  • Transaction execution system
  • Capital management logic
  • Risk controls
  • Rebalancing schedule
And you consume Giza’s:
  • Optimization intelligence
  • Optimal allocation calculations
  • APR improvement metrics
  • Action plans
  • Execution-ready calldata
The Optimizer is completely stateless — no data stored, no side effects. Each call is independent, which makes it straightforward to integrate with existing systems.

When to Use IaaS

Choose IaaS if:
  • You already have smart account infrastructure or Vaults
  • You want to control transaction execution
  • You need custom rebalancing schedules or strategies
  • You’re plugging into existing capital management systems
  • You want optimization without autonomous execution

Flow

  1. You call Giza Optimizer with current allocations
  2. Giza returns optimal allocations + action plan
  3. You decide whether/when to execute
  4. You execute transactions with your infrastructure
  5. Repeat on your schedule

The Optimizer Service

What You Send

{
  token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',  // Token you're optimizing
  capital: '1000000000',                   // Your total capital
  currentAllocations: {                    // Current state
    aave: '500000000',
    compound: '500000000'
  },
  protocols: ['aave', 'compound', 'moonwell'],  // Protocols to consider
  constraints: [...]                       // Optional constraints
}

What You Get

{
  optimization_result: {
    allocations: [                       // Optimal target allocation
      { protocol: "moonwell", allocation: "450000000", apr: 8.5 },
      { protocol: "aave", allocation: "350000000", apr: 7.2 },
      { protocol: "compound", allocation: "200000000", apr: 6.8 }
    ],
    weighted_apr_initial: 7.0,           // Before optimization
    weighted_apr_final: 7.8,             // After optimization
    apr_improvement: 0.8,                // +0.8% improvement
    total_costs: 0.45                    // Estimated gas costs (USD)
  },
  action_plan: [                         // Step-by-step actions
    { action_type: "withdraw", protocol: "compound", amount: "300000000" },
    { action_type: "deposit", protocol: "moonwell", amount: "450000000" }
  ],
  calldata: [                            // Ready-to-execute transaction data
    {
      contract_address: "0x...",
      function_name: "withdraw",
      parameters: [...],
      description: "Withdraw 300 USDC from Compound"
    }
  ]
}

Integration Example

import { Giza, Chain, WalletConstraints } from '@gizatech/agent-sdk';

const giza = new Giza({ chain: Chain.BASE });

async function getOptimalAllocation() {
  // Call optimizer
  const result = await giza.optimize({
    token: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
    capital: '1000000000',
    currentAllocations: {
      aave: '600000000',
      compound: '400000000'
    },
    protocols: ['aave', 'compound', 'moonwell', 'seamless'],
    constraints: [
      {
        kind: WalletConstraints.MIN_PROTOCOLS,
        params: { min_protocols: 2 }
      }
    ]
  });

  console.log(`APR improvement: +${result.optimization_result.apr_improvement}%`);

  // Decide whether to execute based on YOUR logic
  if (result.optimization_result.apr_improvement > 0.5) {
    // Execute with YOUR infrastructure
    await executeRebalancing(result.action_plan, result.calldata);
  } else {
    console.log('APR improvement too small, skip rebalancing');
  }
}

async function executeRebalancing(actionPlan, calldata) {
  // YOUR execution logic here
  for (const call of calldata) {
    await yourSmartAccount.executeTransaction({
      to: call.contract_address,
      data: encodeFunctionData(call.function_name, call.parameters)
    });
  }
}

Optimizer Input/Output Reference

For the full optimizer response types including OptimizationResult, ActionDetail, and CalldataInfo interfaces, see the SDK Optimizer Reference. For constraint types (MIN_PROTOCOLS, MAX_AMOUNT_PER_PROTOCOL, etc.), see Constraints.

Next Steps