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