---
title: "Refresh cash-equivalent reserve APY from Aave and USTB (cron)"
method: POST
path: "/cron/apy"
tags: ["cron"]
---

# Refresh cash-equivalent reserve APY from Aave and USTB (cron)

`POST /cron/apy`

Expected schedule: **every 5 minutes**.

Loads all **cash equivalent** reserves, then refreshes APY by `yieldSource` for rows whose JSON `data` has `cashEquivalentType` on-chain:

- **Aave** (`yieldSource` Aave): reads Aave V3 USDC `liquidityRate` on Base mainnet via Alchemy (API key from `ALCHEMY_RPC_KEY`), derives compounded supply APY (annual rate in ray, same compounding model as Aave `MathUtils`).
- **USTB** (`yieldSource` USTB): reads 30-day yield from the Superstate API (`https://api.superstate.com/v1/funds/1/yield`); result is cached in memory for **24 hours** under `ustbYield` so the external call runs at most once per day.

Matching reserves get `apy` updated; others are skipped. Returns **204** with an empty body on success. Requires `X-CRON-API-KEY` matching `CRON_API_KEY`.

## Headers

- `X-CRON-API-KEY` string, required

## Response `204`

APY refresh completed. On-chain Aave and/or cached USTB yields were applied to matching cash-equivalent reserves; no response body.

## Other responses

- `401` — Missing or invalid `X-CRON-API-KEY`.

---

[API](https://skmtc.dev/dre/apis/dre-api.md) · [All operations](https://skmtc.dev/dre/apis/dre-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/dre/dre-api/revisions/5d14beb9482b/schema)
