Skip to main content
The MultiCall struct represents a single call in a multicall sequence, allowing batched operations on credit accounts.

Struct Definition

struct MultiCall {
    address target;
    bytes callData;
}

Fields

target
address
The target contract for the call. This is either the credit facade (for account management operations) or an adapter (for protocol interactions).
callData
bytes
The encoded function call data to execute on the target contract.

Usage

MultiCall structs are used in arrays to batch multiple operations together:
MultiCall[] memory calls = new MultiCall[](2);

// Add collateral
calls[0] = MultiCall({
    target: creditFacade,
    callData: abi.encodeCall(
        ICreditFacadeV3Multicall.addCollateral,
        (token, amount)
    )
});

// Increase debt
calls[1] = MultiCall({
    target: creditFacade,
    callData: abi.encodeCall(
        ICreditFacadeV3Multicall.increaseDebt,
        (borrowAmount)
    )
});

creditFacade.multicall(creditAccount, calls);

Common Targets

Credit Facade: For account management operations:
  • addCollateral
  • withdrawCollateral
  • increaseDebt
  • decreaseDebt
  • updateQuota
Adapters: For protocol interactions:
  • Swap tokens on DEXes
  • Provide liquidity
  • Stake tokens
  • Any other whitelisted protocol interaction
  • FullCheckParams - Parameters for collateral checks during multicalls
  • DebtLimits - Debt limits enforced during multicalls

Build docs developers (and LLMs) love