> For the complete documentation index, see [llms.txt](https://docs.gnoswap.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gnoswap.io/contracts/staker/mint_stake.gno.md).

# mint\_stake.gno

{% embed url="<https://github.com/gnoswap-labs/gnoswap/blob/main/contract/r/gnoswap/staker/v1/mint_stake.gno>" %}

Creates a new position and stakes it in a single transaction.

## MintAndStake

```go
func MintAndStake(
	cur realm,
	token0 string,
	token1 string,
	fee uint32,
	tickLower int32,
	tickUpper int32,
	amount0Desired string,
	amount1Desired string,
	amount0Min string,
	amount1Min string,
	deadline int64,
	referrer string
) (uint64, string, string, string, string)
```

MintAndStake mints and stakes an LP token.

#### Parameters

| Name             | Type   | Description                                        |
| ---------------- | ------ | -------------------------------------------------- |
| `cur`            | realm  | Pass `cross` as argument.                          |
| `token0`         | string | The path of token0.                                |
| `token1`         | string | The path of token1.                                |
| `fee`            | uint32 | The fee tier of the pool.                          |
| `tickLower`      | int32  | The lower tick of the price range of the position. |
| `tickUpper`      | int32  | The upper tick of the price range of the position. |
| `amount0Desired` | string | The maximum amount of token0 to add and stake.     |
| `amount1Desired` | string | The maximum amount of token1 to add and stake.     |
| `amount0Min`     | string | The minimum amount of token0 to add and stake.     |
| `amount1Min`     | string | The minimum amount of token1 to add and stake.     |
| `deadline`       | int64  | The deadline at which the transaction will expire. |
| `referrer`       | string | The referrer address for reward tracking.          |

#### Return Values

| Name         | Type   | Description                                                           |
| ------------ | ------ | --------------------------------------------------------------------- |
| `positionId` | uint64 | The ID of the position to be created and staked.                      |
| `liquidity`  | string | The liquidity amount of the position.                                 |
| `amount0`    | string | The amount of token0 to be staked.                                    |
| `amount1`    | string | The amount of token1 to be staked.                                    |
| `poolPath`   | string | The path of the pool that the position will be created and staked in. |
