# Account Operations

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

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

A reference of all operations available on credit accounts. Each operation can be included as a call within a multicall.

## 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/gm-mc-collateral)    |
| Increase Debt        | `prepareIncreaseDebt()`       | Borrow from pool                           | [Debt Management](https://docs.gearbox.finance/developers/gm-mc-debt)            |
| Decrease Debt        | `prepareDecreaseDebt()`       | Repay borrowed funds                       | [Debt Management](https://docs.gearbox.finance/developers/gm-mc-debt)            |
| Update Quota         | `prepareUpdateQuota()`        | Enable/adjust quota token exposure         | [Updating Quotas](https://docs.gearbox.finance/developers/gm-mc-quotas)          |
| Withdraw Collateral  | `prepareWithdrawCollateral()` | Remove tokens from account                 | [Withdrawing Collateral](https://docs.gearbox.finance/developers/gm-mc-withdraw) |
| Slippage Control     | Manual encoding               | Protect swaps from sandwich attacks        | [Slippage & Safety](https://docs.gearbox.finance/developers/gm-mc-safety)        |
| External Calls       | Manual encoding               | Interact with Uniswap, Curve, etc.         | [External Calls](https://docs.gearbox.finance/developers/gm-mc-external)         |
| Enable/Disable Token | Manual encoding               | Explicit collateral management             | [Token Management](https://docs.gearbox.finance/developers/gm-mc-tokens)         |
| Price Updates        | Manual encoding               | Update Pyth/Redstone feeds                 | [Slippage & Safety](https://docs.gearbox.finance/developers/gm-mc-safety)        |
| Check Params         | Manual encoding               | Optimize gas, set min health factor        | [Slippage & Safety](https://docs.gearbox.finance/developers/gm-mc-safety)        |
| Revoke Allowances    | Manual encoding               | Security measure after suspicious activity | [Token Management](https://docs.gearbox.finance/developers/gm-mc-tokens)         |

## 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`.

## Page Structure

Each operation guide covers:

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

## Learn More

* [Multicalls](https://docs.gearbox.finance/developers/gm-accounts-multicalls) - How to build and execute multicalls
* [Credit Accounts](https://docs.gearbox.finance/developers/gm-accounts) - Account data and services
