KeeperHub / KeeperHub/keeperhub
fix(protocol-actions): aave-v3 `referralCode` marked optional in the registry but required in practice
- Dominant language
- TypeScript
- Stars
- 24
- Forks
- 93
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Description
**Expected**
The action registry marks `referralCode` optional on aave-v3 actions, so omitting it works.
**Actual**
Calls fail without it; `referralCode: "0"` is required in practice. The papercut is compounded by where it happens: the protocol-action route ignores `simulate` (see companion issue "protocol action route silently ignores `simulate`"), so iterating on this endpoint has real consequences once the payload starts passing validation.
**Repro**
```bash
# Omitting referralCode (registry: optional) -> request fails.
# Adding "referralCode":"0" -> passes validation (and broadcasts — no simulate on this route).
curl -s -X POST https://app.keeperhub.com/api/execute/aave-v3/supply \
-H "Authorization: Bearer $KH_KEY" -H "Content-Type: application/json" \
-d '{"chainId":11155111,"asset":"0x","amount":"","onBehalfOf":"0x","referralCode":"0"}'
```
**Proposed fix**
Either default `referralCode` to `"0"` server-side in the protocol-action handler, or mark it required in the registry. One line either way; the current mismatch is the worst of both.
Observed on `app.keeperhub.com`, 2026-08-04.
Contributor guide
Research direction
Start with the protocol-action route, its action registry, and the protocol-action handler; reproduce the supplied curl request while noting that this route ignores simulate. Confirm whether the registry or handler owns the mismatch, then verify that omitting referralCode no longer fails unexpectedly and that the intended required/default behavior is covered.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, blockchain
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100