# Compound Interest

Balance, contributions, and the interest earned on both — the arithmetic every savings product starts from.

- Method: `GET`
- Path: `/v1/finance/compound-interest`

**Parameters**

| Name | Type | | Description |
|---|---|---|---|
| `principal` | number | required | The starting balance. |
| `rate_pct` | number | required | Annual rate in percent. |
| `years` | number | required | How long it compounds. |
| `times_per_year` | integer | optional | Compounding periods per year: 1, 2, 4, 12, 365. |
| `contribution` | number | optional | Added at the end of every period. |

**Example request**

```bash
curl https://api.diraz.ae/v1/finance/compound-interest \
  -H "Authorization: Bearer drz_live_…"
```

**Example response**

```json
{
  "data": {
    "principal": 1000,
    "rate_pct": 5,
    "years": 10,
    "times_per_year": 1,
    "contribution": 0,
    "balance": 1628.89,
    "total_contributed": 1000,
    "interest_earned": 628.89
  },
  "meta": {
    "request_id": "req_7Q2fK4mZ"
  }
}
```