DocumentationOpen App

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

PageCovers
Account OperationsOpen, adjust, and close Credit Account positions
PositionsQuery active positions, health factor, collateral breakdown
MulticallsComposable batched operations within a single transaction
Add CollateralMulticall operation: add collateral tokens
Manage DebtMulticall operation: increase or decrease debt
WithdrawMulticall operation: withdraw collateral
External CallsMulticall operation: interact with external DeFi protocols
Manage QuotasMulticall operation: update quota allocations
Token ManagementMulticall operation: enable/disable collateral tokens
Safety & SlippageMulticall operation: slippage protection and health checks
LiquidationsHow liquidations work, thresholds, and partial liquidations
Bot SystemAutomated 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