# Staking functions

## Stake

Transfer XNT to stake account:

```sh
solana transfer <STAKE_PUBKEY> 1000
```

Do delegate stake operation:

```sh
solana delegate-stake stake.json vote.json
```

Check condition of a stake:

```sh
solana stake-account stake.json
```

## Deactivate stake

Get stake account:

```sh
solana account stake.json
```

Deactivate stake:

```sh
solana deactivate-stake <STAKE_PUBKEY>
```

See un-staking progress:

```sh
solana stake-account stake.json
```

## Withdraw stake

```sh
solana withdraw-stake <STAKE_ACCOUNT_ADDRESS> <RECIPIENT_ADDRESS> <AMOUNT>
```

Leave some XNT for unstaking fee.

## Delegate a stake (to someone else)

#### Create a new stake account

Include the vote account of the one you want to stake to.

{% code overflow="wrap" %}

```sh
solana-keygen new --no-passphrase -o ~/.config/solana/stake_<VOTE_PUBKEY>.json
```

{% endcode %}

#### Create stake account on ledger and send XNT/SOL to it

```sh
solana create-stake-account stake_<VOTE_PUBKEY>.json 1000
```

#### Delegate stake

```
solana delegate-stake stake_<VOTE_PUBKEY>.json <VOTE_PUBKEY>
```

#### Check stake

```sh
solana stakes <VOTE_PUBKEY>
```

{% hint style="info" %}
You cant ad to an ongoing stake. Either unstake, let the epoch run and stake again or create a new stake account and stake separately without unstaking anything.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.x1.xyz/validating/staking-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
