# Marinade

## Marinade

### Overview

Marinade is a liquid staking protocol on Solana that allows users to stake SOL and receive mSOL tokens. This integration enables users to participate in the Solana network's consensus while maintaining liquidity through the mSOL token.

### What is Liquid Staking?

Liquid staking refers to a process where you:

* Stake your cryptocurrency tokens to help secure the network
* Receive liquid tokens (mSOL) in return that represent your staked position
* Can use these liquid tokens in other DeFi applications while your original tokens remain staked
* Continue earning staking rewards on your original position
* Benefit from professional validator management

### How Marinade Works

#### 1. Staking SOL

* User deposits SOL into the Marinade liquidity pool
* The protocol stakes this SOL with Marinade validators on Solana
* User receives mSOL tokens representing their stake
* Option to stake all available SOL or a specific amount
* No minimum staking period or lockup

#### 2. Earning Rewards

* Staked SOL earns network rewards from validating transactions
* Rewards increase the value of mSOL relative to SOL over time
* APY is visible and updated regularly via the getApy function
* No manual claiming required - rewards automatically accrue

#### 3. Unstaking Process

* User can unstake at any time by returning mSOL
* The protocol handles the unstaking process on Solana
* User receives their original SOL plus any accrued rewards
* Option to unstake all staked SOL or a specific amount

### Using the Tool

To interact with Marinade, use the following command formats:

#### For Staking:

```
Stake SOL to earn mSOL rewards with:
 - Chain name: solana
 - Amount: [AMOUNT] (use -1 to stake all available SOL)
```

#### For Unstaking:

```
Unstake SOL from Marinade liquidity pool with:
 - Chain name: solana
 - Amount: [AMOUNT] (use -1 to unstake all staked SOL)
```

#### For Checking Stake Amount:

```
Get staked amount in Marinade liquidity pool with:
 - Chain name: solana
```

#### For Getting APY:

```
View current APY for Marinade staking with:
 - Chain name: solana
```

#### For Getting TVL:

```
View current TVL in Marinade staking pool with:
 - Chain name: solana
```

#### Example:

```
Stake SOL to earn mSOL rewards with:
 - Chain name: solana
 - Amount: 10
```

### Token Types

#### 1. SOL (Native Token)

* Solana's native token used for staking
* Provides network security and consensus
* Required for transaction fees on Solana

#### 2. mSOL (Liquid Staking Token)

* Received when staking SOL with Marinade
* Represents your staked position and accrued rewards
* Can be used in other DeFi applications
* Value increases over time relative to SOL

### Important Considerations

#### 1. Staking Period

* No minimum staking period required
* Unstaking is processed on-demand
* The value of mSOL increases over time relative to SOL

#### 2. Reward Distribution

* Rewards are automatically reflected in the mSOL/SOL exchange rate
* No manual claiming required
* The longer you hold mSOL, the more SOL you'll receive when unstaking

#### 3. Validator Selection

* Marinade protocol manages validator selection and delegation
* Validators are chosen based on performance and reliability
* Risk is spread across multiple validators for security

#### 4. Liquidity Considerations

* mSOL can be traded or used in other DeFi applications
* Liquidity pools may have varying depths
* Exchange rate between mSOL and SOL reflects accrued rewards

### Available Functions

* `stake`: Stake SOL to earn mSOL rewards from Marinade liquidity pool
* `unstake`: Unstake SOL from Marinade liquidity pool
* `getStakeAmount`: Receive user staked amount in Marinade liquidity pool
* `getApy`: View current APY for Marinade staking
* `getTvl`: View current TVL in Marinade staking pool

### Parameters for Functions

#### stake

| Parameter | Type   | Description                                               |
| --------- | ------ | --------------------------------------------------------- |
| chainName | string | Must be "solana"                                          |
| amount    | string | Amount of SOL to stake. Set to "-1" to stake all user SOL |

#### unstake

| Parameter | Type   | Description                                                     |
| --------- | ------ | --------------------------------------------------------------- |
| chainName | string | Must be "solana"                                                |
| amount    | string | Amount of SOL to unstake. Set to "-1" to unstake all staked SOL |

#### getStakeAmount, getApy, getTvl

| Parameter | Type   | Description      |
| --------- | ------ | ---------------- |
| chainName | string | Must be "solana" |

### Example Prompts:

* "HeyAnon, please stake 50% of my Solana on @marinade on Solana"
* "HeyAnon, please unstake all of my mSOL from @marinade on Solana"


---

# 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.heyanon.ai/heyanon.ai/hey-anon/protocols-and-functions-supported/defi-protocols/marinade.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.
