---
title: "Snapshot on-chain investment balances for cash-equivalent reserves (cron)"
method: POST
path: "/cron/onchain-investments"
tags: ["cron"]
---

# Snapshot on-chain investment balances for cash-equivalent reserves (cron)

`POST /cron/onchain-investments`

Expected schedule: **every 30 minutes**.

Loads all **cash equivalent** reserves whose JSON `data` has `cashEquivalentType` on-chain, then for each reserve reads the on-chain balance at the latest block by `yieldSource`:

- **Aave** (`yieldSource` Aave): Aave V3 USDC supply position for `wallet` on Base via the Aave client.
- **USTB** and other sources: ERC-20 `balanceOf(wallet)` on `contractAddress` for `chainId`.

Upserts a `collaterals` row per reserve (`collateralType` `INVESTMENT_ONCHAIN`, `assetType`, `wallet`, `chainId`, `blockNumber`, `value`). Returns **204** with an empty body on success. Requires `X-CRON-API-KEY` matching `CRON_API_KEY`. Also updates WTGXX unpaid yield.

## Headers

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

## Response `204`

On-chain investment snapshot pass finished; collateral rows were upserted for matching 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)
