Positions (Strategies)
This section covers opening and managing leveraged positions via Credit Accounts. A "position" in Gearbox is a Credit Account with active debt and collateral — it is the fundamental unit of leveraged activity in the protocol.
Overview
To enter a strategy, you open a Credit Account, deposit collateral, borrow from a Pool, and deploy capital through whitelisted DeFi adapters. The Credit Manager checks solvency after every operation. When you are done, you close the position by repaying debt and withdrawing remaining collateral.
The position lifecycle is: open, adjust, monitor, close.
What's in This Section
| Page | Covers |
|---|---|
| Account Operations | Open, adjust, and close Credit Account positions |
| Positions | Query active positions, health factor, collateral breakdown |
| Multicalls | Composable batched operations within a single transaction |
| Add Collateral | Multicall operation: add collateral tokens |
| Manage Debt | Multicall operation: increase or decrease debt |
| Withdraw | Multicall operation: withdraw collateral |
| External Calls | Multicall operation: interact with external DeFi protocols |
| Manage Quotas | Multicall operation: update quota allocations |
| Token Management | Multicall operation: enable/disable collateral tokens |
| Safety & Slippage | Multicall operation: slippage protection and health checks |
| Liquidations | How liquidations work, thresholds, and partial liquidations |
| Bot System | Automated position management, keeper bots, and monitoring |
SDK Entry Points
The primary namespaces for position management:
TypeScript
// Open a position const tx = await sdk.positions.prepareOpen({ strategy, amount, leverage }); const preview = await sdk.positions.previewOpen(tx); await sdk.transactions.execute(tx); // Check position status const status = await sdk.positions.getStatus(positionId); // Adjust an existing position const adjustTx = await sdk.positions.prepareAdjust({ position, changes }); const adjustPreview = await sdk.positions.previewAdjust(adjustTx); await sdk.transactions.execute(adjustTx); // Close a position const closeTx = await sdk.positions.prepareClose({ position }); const closePreview = await sdk.positions.previewClose(closeTx); await sdk.transactions.execute(closeTx);
Learn More
- Strategy Opportunities — discover strategies via the unified opportunity search
- Lender (Pools) — the lender side of the protocol
- SDK Namespaces — full namespace reference