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

# Calculate Staking Reward

> Preview the reward percent a given lock duration would earn

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

Returns the reward percent that would apply if a customer locked tokens for the given duration. Calculated proportionally from your base staking rate. Use this to show customers a preview before they confirm a stake.

### Query Parameters

<ParamField query="duration" type="string" required>
  Lock duration in seconds (e.g. `"2592000"` = 30 days)
</ParamField>

### Response

<ResponseField name="reward_percent" type="number">
  Reward percent for that duration (e.g. `5` = 5%)
</ResponseField>

```javascript theme={null}
const res = await fetch(
  "https://tokens.shakesco.com/calculate-staking-reward?duration=2592000",
  { headers: { Authorization: `Bearer ${API_KEY}` } }
);
const { reward_percent } = await res.json();
```

<ResponseExample>
  ```json 200 OK theme={null}
  { "reward_percent": 5 }
  ```
</ResponseExample>
