> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glam.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Delegated Accounts

Delegated accounts (also known as delegates) start with no permissions and must be explicitly granted access. Permissions are granular, allowing vault owners to build precise guardrails by adding specific capabilities to each delegate.

* Low-privileged delegates are ideal for performing routine tasks such as staking and farming.
* High-privileged delegates can be used for more sensitive operations like trading and transfers.

This approach enhances security by ensuring that delegates can only perform intended actions within the defined boundaries:

* It reduces the risk of unauthorized operations and accidental mistakes.
* Even if a delegate is compromised, the impact is limited to the permissions granted to them.

## Permissions

Permissions are protocol-specific capabilities defined by each [integration program](/v1/platform/integrations). They represent the smallest units of access that can be granted to delegates, allowing for fine-grained control over what actions each delegate can perform.

Permission bitflags are stored as `u64` integers, allowing for a maximum of 64 permissions per protocol.

Follow the links in the table to view the permission definitions in program IDLs.

| Protocol                                                                                                                                 | Permission Name | Permission Bitflag   | Description                                 |
| ---------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------------------- | ------------------------------------------- |
| [System](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/glam_protocol.json#L3103-L3112)       | WSOL            | `0b0000000000000001` | Wrap SOL to wSOL                            |
|                                                                                                                                          | Transfer        | `0b0000000000000010` | Transfer vault SOL an allowlisted address   |
| [Jupiter Swap](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/glam_protocol.json#L3068-L3082) | SwapAny         | `0b0000000000000001` | Swap any token to any other token           |
|                                                                                                                                          | SwapLST         | `0b0000000000000010` | Swap among SOL and LSTs                     |
|                                                                                                                                          | SwapAllowlisted | `0b0000000000000100` | Swap tokens that are explicitly allowlisted |
| [SPL](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_spl.json#L1259-L1263)                | Transfer        | `0b0000000000000001` | Transfer vault token an allowlisted address |
| [Kamino Lending](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_kamino.json#L2841-L2865)  | Init            | `0b0000000000000001` | Initialize Kamino lending account           |
|                                                                                                                                          | Deposit         | `0b0000000000000010` | Deposit tokens into Kamino lending          |
|                                                                                                                                          | Withdraw        | `0b0000000000000100` | Withdraw tokens from Kamino lending         |
|                                                                                                                                          | Borrow          | `0b0000000000001000` | Borrow tokens on Kamino lending             |
|                                                                                                                                          | Repay           | `0b0000000000010000` | Repay borrowed tokens                       |
| [Kamino Vaults](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_kamino.json#L2871-L2880)   | Deposit         | `0b0000000000000001` | Deposit into Kamino vaults                  |
|                                                                                                                                          | Withdraw        | `0b0000000000000010` | Withdraw from Kamino vaults                 |
| [Kamino Farms](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_kamino.json#L2821-L2835)    | Stake           | `0b0000000000000001` | Stake tokens in Kamino farms                |
|                                                                                                                                          | Unstake         | `0b0000000000000010` | Unstake tokens from Kamino farms            |
|                                                                                                                                          | HarvestReward   | `0b0000000000000100` | Harvest farming rewards                     |
| [CCTP](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_cctp.json#L1253-L1257)              | Transfer        | `0b0000000000000001` | Bridge asset to another chain               |

### Pending Audit

This table lists permissions defined by integration programs that are pending audit.

| Protocol                                                                                                                                  | Permission Name | Permission Bitflag   | Description                        |
| ----------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -------------------- | ---------------------------------- |
| [Stake Program](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/glam_protocol.json#L3088-L3097) | Stake           | `0b0000000000000001` | Stake SOL to a validator           |
|                                                                                                                                           | Unstake         | `0b0000000000000010` | Unstake from a validator           |
| [Stake Pool](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_stake_pool.json#L1577-L1596)   | DepositSol      | `0b0000000000000001` | Deposit SOL to a pool              |
|                                                                                                                                           | DepositStake    | `0b0000000000000010` | Deposit stake account to a pool    |
|                                                                                                                                           | DepositSolAny   | `0b0000000000000100` | Deposit SOL to any pool            |
|                                                                                                                                           | DepositStakeAny | `0b0000000000001000` | Deposit stake account to any pool  |
|                                                                                                                                           | WithdrawSol     | `0b0000000000010000` | Withdraw SOL from a pool           |
|                                                                                                                                           | WithdrawStake   | `0b0000000000100000` | Withdraw stake account from a pool |
| [Sanctum](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_stake_pool.json#L1557-L1576)      | DepositSol      | `0b0000000000000001` | Deposit SOL to a pool              |
|                                                                                                                                           | DepositStake    | `0b0000000000000010` | Deposit stake account to a pool    |
|                                                                                                                                           | DepositSolAny   | `0b0000000000000100` | Deposit SOL to any pool            |
|                                                                                                                                           | DepositStakeAny | `0b0000000000001000` | Deposit stake account to any pool  |
|                                                                                                                                           | WithdrawSol     | `0b0000000000010000` | Withdraw SOL from a pool           |
|                                                                                                                                           | WithdrawStake   | `0b0000000000100000` | Withdraw stake account from a pool |
| [Marinade](https://github.com/glamsystems/glam-sdk/blob/6d03d99af6650b3f211de84c8e5f152eebef78f3/idl/ext_marinade.json#L1577-L1586)       | Stake           | `0b0000000000000001` | Stake SOL to get mSOL              |
|                                                                                                                                           | Unstake         | `0b0000000000000010` | Unstake mSOL to get SOL            |
