> For the complete documentation index, see [llms.txt](https://docs.satlayer.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.satlayer.xyz/bvs-developers-1/developer-toolbox/satlayer-cli/delegation.md).

# Delegation

The `delegation` subcommand simplifies the process to delegate and undelegate tokens.

### reg-operator

Registers an operator to the delegation manager that it is ready to receive delegation.

```
satlayer-cli delegation reg-operator <operator-key-name> [<approver-address>]
```

In which:

* **operator-key-name** - the name of the key (in the key storage specified in the configuration) of the operator
* **approver-address(optional)** - the address of the approver wallet. It's an optional address.

### update-operator-details

Updates on-chain delegation information of the operator

```
satlayer-cli delegation update-operator-details <user-key-name> <deprecated-earnings-receiver> <delegation-approver> <staker-optout-window-blocks> 
```

In which:

* **user-key-name**- the name of the key in the keyring to use for contract execution
* **deprecated-earnings-receiver** - the address that receives the tokens if operator left before reward distribution
* **delegation-approver(optional)** - the address of the approver contract. It's optional that can bet set 0.
* &#x20;**staker-optout-window-blocks** - the number of block between staker opting out and opting-out finishes

### update-operator-metadatauri

Updates the metadata URI

```
satlayer-cli delegation update-operator-metadatauri <user-key-name> <uri>
```

In which:

* **user-key-name** - the name of the key in the keyring to use for contract execution
* **uri** - the new URI to be broadcasted on-chain for operator metadata

This function must be invoked with the default address in the configuration to be the operator itself.

### delegate-to

Delegate to an operator

```
satlayer-cli delegation delegate-to <staker-key-name> <operator-address> <approver-key-name>
```

In which:

* **staker-key-name** - the name of the key (in the key storage specified in the configuration) of the staker to stake it's assets
* **operator-address**- the operator to delegate to
* **approver-key-name** - the name of the key (in the key storage specified in the configuration) of the approver

### undelegate

Undelegate from an operator

```
satlayer-cli delegation undelegate <staker-key-name> <operator-address>
```

* **staker-key-name** - the name of the key (in the key storage specified in the configuration) of the staker to stake it's assets
* **operator-address** - the operator to delegate to

### is-delegated

Query if an address have already delegated it's assets to an operator

```
satlayer-cli delegation is-delegated <address>
```

In which:

* **address** - the address of which to be checked

### is-operator

Queries if an operator has registered for accepting delegation

```
satlayer-cli delegation is-operator <address>
```

In which:

* **address** - the address of the operator to be queried

### get-operator-details

Query the information set by `update-operator-details`.&#x20;

```
satlayer-cli delegation get-operator-detail <address>
```

In which

* **address** - the address of the operator to be queried

### get-delegation-approver

Queries the delegation approver address of an operator

```
satlayer-cli delegation get-delegation-approver <address>
```

In which:

* **address** - the address of the operator to be queried

### get-staker-optoutwindowblocks

Queries how many block has to pass before opting out finishes for an operator. This information is also available in `get-delegation-approver`.

```
satlayer-cli delegation get-staker-optoutwindowblocks <address>
```

In which:

* **address** - the address of the operator to be queried

### get-operator-shares

Query the amount of shares of a strategy an operator has.

```
satlayer-cli delegation get-operator-shares <operator-address> <strategy>
```

In which

* **operator-address** - the address of the operator to be queried
* **strategy** - address of the strategy we are concerned about

### get-delegatable-shares

Query the amount of shares that can be delegated to an operator

```
satlayer-cli delegation get-delegatable-shares <address>
```

In which:

* **address** - the address of the operator to be concerned about

### get-withdraw-delay

Query the withdraw delay of a strategy

```
satlayer delegation get-withdraw-delay <strategy>
```

In which:

* **strategy** - address of the strategy we are concerned about&#x20;
