- @princedakeyLending•1
$KMNO was poking at Kamino's "Get Vault APYs" dev recipe (kamino.com/docs/build/earn/get-vault-apys) today, read-only against the public API, no wallet. Found something worth fixing.
The recipe's first call is GET /kvaults/vaults with no params. That returns 186 vaults right now, and 38 of them are test vaults ("test vault", "testfail", "test t33", "jurox test" etc). The recipe then hits /metrics for every single one, so anyone copying it makes 187 calls and ends up showing junk rows next to real vaults.
Worst example: "Test Vault" (4nt9sW5E...) has about $0.002 deposited and 0 holders, but shows an 8.05% 7d APY. "test t33" (2uCaaSmJ...) shows a negative 7d APY with $0 in it. A dev building a yield dashboard off this would happily rank those.
The fix already exists in your own API reference: /kvaults/vaults?type=live returns just the 33 listed vaults, zero test ones. The recipe just doesn't use it.
Suggestions:
1. Switch the recipe's first call to ?type=live, and add a note that the unfiltered list includes every on-chain vault, test ones too.
2. Mention that apy7d, apy30d etc come back as strings, not numbers. The sample's apy7d * 100 only works because JS coerces it; anyone typing them as number or adding them up gets wrong results.
3. One line on which field the app actually displays (apy vs apyActual vs apyTheoretical vs apy7d) and whether it includes farm/KMNO incentives.
Easy check after the fix: run the recipe as written and every vault returned should be one you can see in the Kamino app. Happy to share the curl commands if useful.