Overview
Integrate directly with Gearbox contracts from your Solidity code. This guide covers on-chain integration patterns for smart contract developers.
Prerequisites
Solidity 0.8.x experience
Familiarity with interface-based contract interaction
Understanding of ERC-20 and common DeFi patterns
What You'll Learn
Credit Accounts
Contract discovery, CreditFacade, CreditManager interactions
Multicall Encoding
Build and execute multicalls in Solidity
Pool Operations
Deposit, withdraw, and read pool state
Guide Structure
Credit Accounts - Contract discovery, ICreditFacadeV3, ICreditManagerV3 interfaces
Multicalls - MultiCall struct encoding, adapter calls
Pool Operations - IPoolV3 deposit/withdraw, ERC-4626 functions
Note: Contract discovery patterns (AddressProvider, ContractsRegister) are covered in the Credit Accounts guide.
Key Interfaces
When to Use Solidity Integration
On-chain protocol integration
Yes
Building adapters
Yes
Composable strategies
Yes
Backend services
No (use SDK Guide)
Frontend applications
No (use SDK Guide)
For TypeScript/JavaScript applications, see the SDK Guide.
Architecture Understanding
For conceptual background on how Gearbox works:
Credit Suite Architecture - How Credit Managers, Facades, and Configurators work together
Pool Architecture - Lending pools and ERC-4626 compliance
Multicall System - How multicalls execute and validate
Detailed Guides
Multicall Operations
Complete reference for each multicall operation with Solidity examples:
Transfer tokens to credit account
Borrow and repay
Manage collateral quotas
Remove tokens from account
Protect against price movement
Interact with DeFi protocols via adapters
Manage active collateral
On-demand oracle updates (Pyth, Redstone)
Optimize health checks with hints
Security cleanup
See Multicalls Overview for the diff pattern and complete encoding examples.
Use Case Guides
Integration-specific guides for common development scenarios:
Last updated
