> ## 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.

# Lend Suilend

> Learn to lend on Suilend protocool

Lend tokens on Suilend to earn rewards or use them as collateral to borrow other tokens. Enjoy a secure, efficient way to maximize your assets with passive income and flexible liquidity.

## Example Prompts

### Natural Language Prompts

```javascript theme={null}
"lend suilend 1 ssui"
```

### LangChain Tool Prompts

```javascript theme={null}
// Lend 1 sSUI
{
 amount: 1;
 symbol: 'ssui';
}
```

## Example Implementation

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

async function lendingSuilend(agent: SuiAgentKit) {
  try {
    const result = await agent.lendingSuilend({
      type: "LENDING";
      amount: 1,
      symbol: "ssui",
    });
    console.log("Result:", result);
  } catch (error) {
    console.error("Stake failed:", error);
  }
}
```

## Implementation Details

* Check user balance
* Initialize data from Suilend SDK
* Prepare the transaction payload
* Sign & execute the transaction

## 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 res = await agent.lendingSuilend({
    type: "LENDING",
    amount: 1,
    symbol: "ssui",
  });
} 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

## Related Functions

* get\_holding: Check token balances
