# stake

This entrypoint is designed to stake or unstake QUIPU tokens to a specific DEX pool.

{% hint style="info" %}
This call payoff staking rewards in all accrued tokens automatically.

Calling this method with `amount = 0n` and any path (`Add/Remove`) triggers payoff without transfer QUIPU tokens.&#x20;
{% endhint %}

### Call parameters

<table><thead><tr><th width="150">Field</th><th width="150" align="center">Type</th><th width="448.2">Description</th></tr></thead><tbody><tr><td>pool_id</td><td align="center"><code>pool_id_t</code></td><td>pool identifier.</td></tr><tr><td>amount</td><td align="center"><code>nat</code></td><td>amount of QUIPU tokens to stake or unstake.</td></tr></tbody></table>

```pascaligo
type stake_param_t      is [@layout:comb] record [
  pool_id                 : pool_id_t;
  amount                  : nat;

type stake_action_t     is
| Add of stake_param_t
| Remove of stake_param_t
```


---

# 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.quipuswap.com/smart-contracts/quipuswap-stable-swap-dex/standalone-dex/dex-methods/dex-rewards/stake.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.
