# Operations Reference

> Markdown export of the Gearbox Protocol documentation page for agents and retrieval systems.

Canonical page: https://docs.gearbox.finance/developers/operations-reference
Source file: content/developers/operations-reference.mdx
Section router: https://docs.gearbox.finance/developers/llms.txt
Section full export: https://docs.gearbox.finance/developers/llms-full.txt

Detailed guides for each multicall operation in TypeScript.

> For Solidity multicall encoding, see [Multicalls](https://docs.gearbox.finance/developers/multicalls).

## Why This Section?

The main [multicalls.md](https://docs.gearbox.finance/developers/multicalls) covers the basics: SDK service helpers, combining with raw encoding, and a complete example. This section goes deeper on each operation - when you need it, complete examples, and what can go wrong.

## Quick Reference

| Operation            | SDK Helper                    | When to Use                                | Guide                                                                                                                              |
| -------------------- | ----------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| Add Collateral       | `prepareAddCollateral()`      | Deposit tokens to increase health factor   | [Adding Collateral](https://docs.gearbox.finance/developers/adding-collateral)                 |
| Increase Debt        | `prepareIncreaseDebt()`       | Borrow from pool                           | [Debt Management](https://docs.gearbox.finance/developers/debt-management)                     |
| Decrease Debt        | `prepareDecreaseDebt()`       | Repay borrowed funds                       | [Debt Management](https://docs.gearbox.finance/developers/debt-management)                     |
| Update Quota         | `prepareUpdateQuota()`        | Enable/adjust quota token exposure         | [Updating Quotas](https://docs.gearbox.finance/developers/updating-quotas)                     |
| Withdraw Collateral  | `prepareWithdrawCollateral()` | Remove tokens from account                 | [Withdrawing Collateral](https://docs.gearbox.finance/developers/withdrawing-collateral)       |
| Slippage Control     | Manual encoding               | Protect swaps from sandwich attacks        | [Controlling Slippage](https://docs.gearbox.finance/developers/controlling-slippage)           |
| External Calls       | Manual encoding               | Interact with Uniswap, Curve, etc.         | [Making External Calls](https://docs.gearbox.finance/developers/making-external-calls)         |
| Enable/Disable Token | Manual encoding               | Explicit collateral management             | [Enabling/Disabling Tokens](https://docs.gearbox.finance/developers/enabling-disabling-tokens) |
| Price Updates        | Manual encoding               | Update Pyth/Redstone feeds                 | [Updating Price Feeds](https://docs.gearbox.finance/developers/updating-price-feeds)           |
| Check Params         | Manual encoding               | Optimize gas, set min health factor        | [Collateral Check Params](https://docs.gearbox.finance/developers/collateral-check-params)     |
| Revoke Allowances    | Manual encoding               | Security measure after suspicious activity | [Revoke Allowances](https://docs.gearbox.finance/developers/revoke-allowances)                 |

## Page Structure

Each operation guide follows the same structure:

1. **Why** - When you need this operation
2. **What** - What it does and how it fits the system
3. **How** - Working TypeScript code
4. **Gotchas** - Common mistakes and edge cases
5. **See Also** - Related operations and Solidity reference

## SDK Helpers vs Manual Encoding

**Five operations have SDK helpers** via `createCreditAccountService`:

* `prepareAddCollateral(token, amount)`
* `prepareIncreaseDebt(amount)`
* `prepareDecreaseDebt(amount)`
* `prepareUpdateQuota(token, change, minQuota)`
* `prepareWithdrawCollateral(token, amount, to)`

**Six operations require manual encoding** with viem's `encodeFunctionData`:

* `storeExpectedBalances` / `compareBalances`
* `enableToken` / `disableToken`
* `onDemandPriceUpdate`
* `setFullCheckParams`
* `revokeAdapterAllowances`

All manual encoding uses `iCreditFacadeV300MulticallAbi` from `@gearbox-protocol/sdk`.

## Related

* [Multicalls Overview](https://docs.gearbox.finance/developers/multicalls) - Basic patterns and complete example
* [Credit Accounts](https://docs.gearbox.finance/developers/credit-accounts) - Account data and services
* [Solidity Multicalls](https://docs.gearbox.finance/developers/multicalls) - On-chain implementation details
