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

# Native Staking

> Learn how to stake SUI - native staking

Stake your SUI tokens with native staking to earn staking rewards. This creates liquid staking positions using SUI token.

## Usage

```javascript theme={null}
// Stake 1 SUI
const result = await agent.stake(1, "0xce8e537664ba5d1d5a6a857b17bd142097138706281882be6805e17065ecde89");

// Stake 0.5 SUI
const result = await agent.stake(0.5, "0xce8e537664ba5d1d5a6a857b17bd142097138706281882be6805e17065ecde89");
```

## Parameters

| Parameter | Type   | Required | Description              |
| --------- | ------ | -------- | ------------------------ |
| amount    | number | Yes      | Amount to be staked      |
| poolId    | string | Yes      | Pool address to stake to |

## Example Prompts

### Natural Language Prompts

```javascript theme={null}
"Stake 1 SUI to pool  0xce8e537664ba5d1d5a6a857b17bd142097138706281882be6805e17065ecde89"
```

### LangChain Tool Prompts

```javascript theme={null}
// Stake 1 SUI
{
 "amount": 1,
 "poolId": "0xce8e537664ba5d1d5a6a857b17bd142097138706281882be6805e17065ecde89"
}
```

## Example Implementation

```javascript theme={null}
import { SuiAgentKit } from "@getnimbus/sui-agent-kit";

async function stakeSUI(agent: SuiAgentKit) {
  try {
    // Stake 1 SOL
    const result = await agent.stake(1, "0xce8e537664ba5d1d5a6a857b17bd142097138706281882be6805e17065ecde89");
    console.log("Staking successful:", result);
  } catch (error) {
    console.error("Staking failed:", error);
  }
}
```

## Implementation Details

* Uses `sui system` for staking
* Automatically handles transaction versioning
* Includes proper transaction confirmation
* Provides liquid staking position

## Response Format

```javascript theme={null}
// Successful response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "success",
}

// Error response
{
  tx_hash: "DHGKz1EZDnDHbiRC2P3dZd7xuLnfGdncDaBvaExyTAfM",
  tx_status: "failed",
}
```

## Error Handling

```javascript theme={null}
try {
  const result = await agent.stake(amount, poolId);
} catch (error) {
  if (error.message.includes("Insufficient balance")) {
    // Handle insufficient balance
  } else {
    // Handle other transaction failures
  }  
}
```

## Best Practices

1. Balance Verification

* Check SUI balance before staking
* Account for transaction fees
* Consider minimum stake amounts

2. Transaction Management

* Monitor transaction status
* Implement proper error handling
* Use appropriate commitment levels

3. Security

* Verify transaction details
* Double-check amounts
* Keep private keys secure

4. User Experience

* Show transaction progress
* Display staking rewards

## Important Notes

* Minimum staking amount: 1 SUI
* Staking rewards auto-compound
* No unbonding period required

## Related Functions

* get\_holding: Check token balances
