Skip to main content

Overview

Intelligence as a Service (IaaS) provides access to Giza’s Optimizer as a stateless intelligence service. If you already have your own execution infrastructure (smart accounts, transaction execution, capital management), you can leverage Giza’s AI-powered 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, making it perfect for integration 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 integrating with existing capital management systems
  • You want optimization intelligence 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

{
  chainId: Chain.BASE,
  total_capital: "1000000000",           // Your total capital
  token_address: USDC_ADDRESS,           // Token you're optimizing
  current_allocations: {                 // 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 { GizaAgent, Chain, WalletConstraints } from '@giza/agent-sdk';

const giza = new GizaAgent({ chainId: Chain.BASE });

async function getOptimalAllocation() {
  // Call optimizer
  const result = await giza.optimizer.optimize({
    chainId: Chain.BASE,
    total_capital: "1000000000",
    token_address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    current_allocations: {
      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)
    });
  }
}

Next Steps