# Subnet Node Delegate Staking

Subnet nodes can be staked to for a portion of the nodes emissions. Each node can have its own delegate reward rate.

## Add

Users can add balance to a subnet by calling `add_to_node_delegate_stake` with the subnet ID and balance, they want to transfer to the subnet.

```rust
pub fn add_to_node_delegate_stake(
    origin: OriginFor<T>, 
    subnet_id: u32,
    subnet_node_id: u32,
    node_delegate_stake_to_be_added: u128
)
```

## Remove

Users can remove their node delegate stake balance by calling `remove_node_delegate_stake` with the subnet ID and subnet node ID to remove from and the shares to remove. Shares are converted to balance internally.

```rust
pub fn remove_node_delegate_stake(
    origin: OriginFor<T>, 
    subnet_id: u32,
    subnet_node_id: u32,
    node_delegate_stake_shares_to_be_removed: u128
)
```

## Transfer

Users can transfer node delegate stake shares from one account to another by calling `transfer_node_delegate_stake` with the subnet ID, subnet node ID, to account ID, and shares to transfer.

```rust
pub fn transfer_node_delegate_stake(
    origin: OriginFor<T>, 
    subnet_id: u32,
    subnet_node_id: u32, 
    to_account_id: T::AccountId, 
    node_delegate_stake_shares_to_transfer: u128
)
```

## Donate Node Delegate Stake

{% hint style="warning" %}
This functionality does NOT increase a user's balance.
{% endhint %}

Users can donate and increase the overall delegate stake balance in the subnets pool by calling `increase_node_delegate_stake` with the subnet ID nd subnet node ID they want to increase the pool balance of, and the amount to transfer to the subnet.

This will increase the balance of all current delegate stakers.

This function is useful for airdropping rewards to the subnet node delegate stakers.

```rust
pub fn donate_node_delegate_stake(
    origin: OriginFor<T>, 
    subnet_id: u32,
    subnet_node_id: u32,
    amount: u128,
)
```

## Swap & Queue

Users can swap node delegate stake between nodes by calling `swap_node_delegate_stake` with the subnet ID and the subnet node ID, to remove stake from, and the subnet ID and subnet node ID to add stake to, with the shares they want to remove from the `from_subnet_id` and `from_subnet_node_id`.

This will **queue** the swap to the new subnet and be fulfilled in one epoch.

[See how to update a swap queue](/network/staking/update-swap-queue.md).

```rust
pub fn swap_node_delegate_stake(
    origin: OriginFor<T>, 
    from_subnet_id: u32,
    from_subnet_node_id: u32, 
    to_subnet_id: u32, 
    to_subnet_node_id: u32, 
    node_delegate_stake_shares_to_swap: u128
)
```


---

# 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.hypertensor.org/network/staking/subnet-node-delegate-staking.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.
