> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shakesco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set Staking Rate

> Configure the base reward rate used for all customer stakes

<span style={{display:"none"}}>For the complete documentation index, see [llms.txt](/llms.txt).</span>

Sets the base reward rate for your token. Every customer stake is calculated proportionally from this base: a customer locking for half the base duration earns half the base reward, locking for double earns double, and so on.

You only need to call this once unless you want to change the rate. Stakes created before a rate change keep their original reward percent.

<Info>
  This must be set before customers can create stakes. [`/create-stake`](/api-reference/tokens/staking/create-stake) returns `400 Invalid parameters` until you do.
</Info>

### Request Body

<ParamField body="base_duration" type="string" required>
  Base lock period in seconds (e.g. `"31536000"` = 1 year)
</ParamField>

<ParamField body="base_reward_percent" type="number" required>
  Reward earned over the base period, in percent. `20` = 20%. Decimals allowed (`12.5`).
</ParamField>

### Response

<ResponseField name="tx_hash" type="string">
  Reference identifier for the rate change
</ResponseField>

```javascript theme={null}
await fetch("https://tokens.shakesco.com/set-staking-rate", {
  method: "POST",
  headers: { Authorization: `Bearer ${API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ base_duration: "31536000", base_reward_percent: 20 }),
});
```

<ResponseExample>
  ```json 200 OK theme={null}
  { "tx_hash": "0xabc..." }
  ```
</ResponseExample>
