Add Gami Labs yield adapter#2715
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new Gami Labs adaptor that registers vaults, gathers vault state via batched multicalls, fetches USD prices for underlyings from Llama, computes normalized tvlUsd and pricePerShare per vault, and exports an ChangesGami Labs Adaptor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Error while running gami-labs adapter: Test Suites: 1 failed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
src/adaptors/gami-labs/index.js (1)
121-123: ⚡ Quick winOne failing chain drops every pool.
Promise.allrejects as soon as anyprocessChainthrows (e.g. ansdk.api.abi.multiCallerror on one chain or the pricefetchfailing), so a single-chain hiccup yields zero pools instead of partial results. Consider isolating per-chain failures.♻️ Isolate per-chain failures
- const results = await Promise.all( - Object.entries(byChain).map(([chain, vaults]) => processChain(chain, vaults)) - ); - - return results.flat(); + const results = await Promise.allSettled( + Object.entries(byChain).map(([chain, vaults]) => processChain(chain, vaults)) + ); + + return results + .filter((r) => r.status === 'fulfilled') + .flatMap((r) => r.value);🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/adaptors/gami-labs/index.js` around lines 121 - 123, Promise.all currently rejects when any processChain fails, dropping all pools; change the aggregation to isolate per-chain failures by using Promise.allSettled (or mapping each Object.entries(byChain).map to a try/catch wrapper) so individual processChain errors are caught and logged but do not reject the whole batch; collect only the fulfilled values into results (reference symbols: byChain, processChain, results, Promise.all/Promise.allSettled) and ensure failures are logged/filtered out before flattening the final pools array.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adaptors/gami-labs/index.js`:
- Around line 47-51: The fetchJson helper uses global fetch and can reject the
whole run when one chain fails; replace its usage in the gami-labs price fetch
path so calls to the coins.llama.fi endpoint use the project's axios helper
instead: call utils.getData (or wrap it with utils.withRetry for transient
429/5xx retries) in place of fetchJson, update the code paths in
apy()/processChain() that request prices to await utils.getData(...) (or await
utils.withRetry(utils.getData, ...)(...)) and preserve the existing error
behavior from getData so a single-chain transient error is retried/handled
without aborting all Promise.all results.
- Around line 101-111: The adapter currently sets project: 'gami-labs' (which
doesn't match any protocol slug) and emits PPS-only pools without any apy
fields; update the returned pool object in src/adaptors/gami-labs/index.js (the
function that builds the pool return with keys pool, chain, project, symbol,
tvlUsd, pricePerShare, underlyingTokens, poolMeta, url) to (1) use the correct
protocol slug instead of the hard-coded 'gami-labs' (replace with the canonical
slug constant or value used by your registry/metadata so the "known protocol
slug" check passes) and (2) ensure PPS-only pools still provide at least one
finite APY by populating apy/apyBase/apyReward when pricePerShare exists (for
example set apyBase = 0 and apy = 0 if you cannot compute a yield, or compute an
APY from pricePerShare changes if historical data is available) so the adapter
satisfies src/adaptors/test.js and src/handlers/triggerAdaptor.js filters.
---
Nitpick comments:
In `@src/adaptors/gami-labs/index.js`:
- Around line 121-123: Promise.all currently rejects when any processChain
fails, dropping all pools; change the aggregation to isolate per-chain failures
by using Promise.allSettled (or mapping each Object.entries(byChain).map to a
try/catch wrapper) so individual processChain errors are caught and logged but
do not reject the whole batch; collect only the fulfilled values into results
(reference symbols: byChain, processChain, results,
Promise.all/Promise.allSettled) and ensure failures are logged/filtered out
before flattening the final pools array.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 020ae875-7ef8-4e8c-b351-f165af7bb5c9
📒 Files selected for processing (1)
src/adaptors/gami-labs/index.js
| async function fetchJson(url) { | ||
| const r = await fetch(url); | ||
| if (!r.ok) throw new Error(`HTTP ${r.status} for ${url}`); | ||
| return r.json(); | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Node engine requirement
fd -d 2 '^package\.json$' --exec cat {} \; | jq -r '.engines // "no engines field"'
# Does the repo convention use utils.getData / axios for off-chain calls?
rg -nP "utils\.getData\s*\(" -g 'src/adaptors/**' | head -n 20
# Any existing adaptors relying on global fetch (to gauge precedent)?
rg -nP '(^|[^.\w])fetch\s*\(' -g 'src/adaptors/**' | head -n 20
# Confirm utils exposes getData
rg -nP '\bgetData\b' -g 'src/adaptors/utils.js' -C2Repository: DefiLlama/yield-server
Length of output: 4188
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect gami-labs adaptor around the reported lines
fd -a '^src/adaptors/gami-labs/index\.js$' . | while read -r f; do
echo "### $f"
nl -ba "$f" | sed -n '35,160p'
done
# Inspect utils.getData implementation and any axios timeout/retry/non-2xx handling
fd -a '^src/adaptors/utils\.js$' . | while read -r f; do
echo "### $f (getData)"
nl -ba "$f" | sed -n '1,220p'
doneRepository: DefiLlama/yield-server
Length of output: 48
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== gami-labs/index.js =="
f="$(fd -a -t f 'gami-labs/index\.js$' src/adaptors . | head -n 1 || true)"
echo "Found: $f"
if [ -n "${f:-}" ]; then
nl -ba "$f" | sed -n '1,220p'
fi
echo
echo "== src/adaptors/utils.js (getData) =="
u="$(fd -a -t f '^utils\.js$' src/adaptors . | head -n 1 || true)"
echo "Found: $u"
if [ -n "${u:-}" ]; then
nl -ba "$u" | sed -n '70,170p'
fi
echo
echo "== Search gami-labs for fetchJson + processChain usage =="
if [ -n "${f:-}" ]; then
rg -n "fetchJson|processChain" "$f" || true
fiRepository: DefiLlama/yield-server
Length of output: 261
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Check for src/adaptors/utils.js =="
if [ -f src/adaptors/utils.js ]; then
echo "Found src/adaptors/utils.js"
cat -n src/adaptors/utils.js | sed -n '80,170p'
else
echo "src/adaptors/utils.js not found"
fd -t f 'utils\.js$' src/adaptors --full-path | head -n 50
fi
echo
echo "== Locate gami-labs/index.js =="
fd -t f 'index\.js$' src/adaptors --full-path | rg -n 'gami[-_]?labs' || true
fd -t f 'gami[-_]?labs' src/adaptors --full-path | head -n 50 || trueRepository: DefiLlama/yield-server
Length of output: 3803
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== gami-labs/index.js (lines 1-220) =="
cat -n src/adaptors/gami-labs/index.js | sed -n '1,220p'
echo
echo "== gami-labs/index.js: fetchJson/processChain usages =="
rg -n "fetchJson|processChain|Promise\.all|allSettled|withRetry|utils\.getData" src/adaptors/gami-labs/index.js
echo
echo "== gami-labs/index.js: any direct fetch usage =="
rg -n "(^|[^.\w])fetch\s*\(" src/adaptors/gami-labs/index.jsRepository: DefiLlama/yield-server
Length of output: 7785
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== package.json engines (if any) =="
fd -t f 'package\.json$' . --full-path | while read -r p; do
echo "-- $p"
cat "$p" | rg -n '"engines"\s*:' -n || true
# show engines block if present (first ~40 lines around it)
if cat "$p" | rg -n '"engines"\s*:' >/dev/null; then
line=$(cat "$p" | rg -n '"engines"\s*:' | head -n1 | cut -d: -f1)
start=$((line-5)); end=$((line+25))
cat -n "$p" | sed -n "${start},${end}p"
fi
done
echo
echo "== Does code use utils.withRetry anywhere? =="
rg -n "utils\.withRetry\s*\(" -g 'src/adaptors/**' | head -n 50 || true
echo
echo "== Does any code call withRetry around utils.getData? =="
rg -n "withRetry\s*\(\s*\(\)\s*=>\s*utils\.getData|withRetry\s*\(\s*async\s*\(\)\s*=>\s*utils\.getData|getData\([^)]*\)\s*\)" -g 'src/adaptors/**' | head -n 50 || true
echo
echo "== Any custom timeout config for axios in utils? =="
rg -n "axios\.(create|defaults|interceptors).*timeout|timeout\s*:" src/adaptors/utils.js || true
echo
echo "== gami-labs/index.js uses withRetry or utils.getData? =="
rg -n "withRetry|getData" src/adaptors/gami-labs/index.js || trueRepository: DefiLlama/yield-server
Length of output: 7397
Replace native fetch with utils.getData (optionally wrapped in utils.withRetry) for gami-labs price fetching.
src/adaptors/gami-labs/index.js uses fetchJson() (global fetch, throws on !r.ok) to call https://coins.llama.fi/prices/current/...; because apy() runs processChain() across chains via Promise.all, a transient non-2xx/connection issue for one chain rejects the whole adaptor run and drops results for all pools. The repo’s utils.getData is axios-based (throws on non-2xx) and retry handling is available via utils.withRetry (429 + 5xx), so route this request through those helpers instead of raw fetch.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/adaptors/gami-labs/index.js` around lines 47 - 51, The fetchJson helper
uses global fetch and can reject the whole run when one chain fails; replace its
usage in the gami-labs price fetch path so calls to the coins.llama.fi endpoint
use the project's axios helper instead: call utils.getData (or wrap it with
utils.withRetry for transient 429/5xx retries) in place of fetchJson, update the
code paths in apy()/processChain() that request prices to await
utils.getData(...) (or await utils.withRetry(utils.getData, ...)(...)) and
preserve the existing error behavior from getData so a single-chain transient
error is retried/handled without aborting all Promise.all results.
| return { | ||
| pool: `${v.address.toLowerCase()}-${sdkChain}`, | ||
| chain: CHAIN_DISPLAY[sdkChain] || sdkChain, | ||
| project: 'gami-labs', | ||
| symbol: sym || v.name, | ||
| tvlUsd, | ||
| pricePerShare, | ||
| underlyingTokens: [asset.toLowerCase()], | ||
| poolMeta: v.name, | ||
| url: v.url, | ||
| }; |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Confirm the registered protocol slug for Gami Labs
curl -s https://api.llama.fi/protocols | jq -r '.[] | select(.name|test("gami";"i")) | "\(.name) -> \(.slug)"'Repository: DefiLlama/yield-server
Length of output: 293
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Check protocols list for slug gami-labs and name 'Gami Labs' ==="
curl -s https://api.llama.fi/protocols | jq -r '
[
(.[] | select(.slug=="gami-labs") | "\(.name) -> \(.slug)"),
(.[] | select((.name|ascii_downcase)=="gami labs" ) | "\(.name) -> \(.slug)"),
(.[] | select((.slug|ascii_downcase|test("gami-labs")) ) | "\(.name) -> \(.slug)"),
(.[] | select((.name|ascii_downcase|test("gami labs")) ) | "\(.name) -> \(.slug)")
] | map(select(length>0)) | flatten | unique | .[]
' | head -n 50
echo
echo "=== Also dump any protocol slugs containing 'gami-labs' ==="
curl -s https://api.llama.fi/protocols | jq -r '.[] | select((.slug|ascii_downcase|test("gami-labs"))) | "\(.name) -> \(.slug)"' | head -n 50
echo
echo "=== Dump any protocol names containing 'Gami Labs' or 'gami labs' ==="
curl -s https://api.llama.fi/protocols | jq -r '.[] | select((.name|ascii_downcase|test("gami labs"))) | "\(.name) -> \(.slug)"' | head -n 50Repository: DefiLlama/yield-server
Length of output: 267
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Inspect gami-labs adapter around lines ~80-140 ==="
# Try to locate file first
ls -la src/adaptors/gami-labs || true
sed -n '1,220p' src/adaptors/gami-labs/index.js | nl -ba | sed -n '70,160p'
echo
echo "=== Find how pricePerShare is used in this adapter ==="
rg -n "pricePerShare|apyBase|apyReward|apy\\b|project\\s*:" src/adaptors/gami-labs/index.js
echo
echo "=== Find sanity/schema checks mentioning pricePerShare in repo ==="
rg -n "pricePerShare|apyBase|apyReward|apy\\b" test src | head -n 200Repository: DefiLlama/yield-server
Length of output: 360
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== Run adapter test for gami-labs (best effort) ==="
npm -s run test --adapter=gami-labsRepository: DefiLlama/yield-server
Length of output: 3521
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== protocols: exact slug 'gami-labs' existence (count) ==="
curl -s https://api.llama.fi/protocols | jq -r '
(map(select(.slug=="gami-labs")) | length) as $n
| "count=" + ($n|tostring)
'
echo
echo "=== protocols: any slug containing 'gami-labs' ==="
curl -s https://api.llama.fi/protocols | jq -r '
.[]
| select((.slug|ascii_downcase|test("gami-labs")))
| "\(.name) -> \(.slug)"
' | head -n 50
echo
echo "=== protocols: any name containing 'gami labs' (exact words) or 'gami-labs' ==="
curl -s https://api.llama.fi/protocols | jq -r '
.[]
| select(
((.name|ascii_downcase|test("gami labs")) or (.name|ascii_downcase|test("gami-labs")))
)
| "\(.name) -> \(.slug)"
' | head -n 50
echo
echo "=== protocols: any slug with 'gami' (first 30) ==="
curl -s https://api.llama.fi/protocols | jq -r '
.[]
| select((.slug|ascii_downcase|test("gami")))
| "\(.name) -> \(.slug)"
' | head -n 30Repository: DefiLlama/yield-server
Length of output: 546
🏁 Script executed:
#!/bin/bash
set -euo pipefail
FILE="src/adaptors/gami-labs/index.js"
echo "=== file stats ==="
wc -l "$FILE"
echo
echo "=== project field(s) in adapter ==="
rg -n "project\\s*:" "$FILE" || true
echo
echo "=== pricePerShare / apy fields in adapter ==="
rg -n "pricePerShare|apyBase|apyReward|\\bapy\\b" "$FILE" || true
echo
echo "=== show around return block (approx lines 80-140) ==="
sed -n '70,160p' "$FILE" | cat -nRepository: DefiLlama/yield-server
Length of output: 2765
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== repo: locate schema/sanity checks referencing pricePerShare ==="
rg -n "pricePerShare" test src | head -n 200
echo
echo "=== repo: locate required field checks for apy/pps ==="
rg -n "apyBase|apyReward|\\bapy\\b|sanity|schema" test src | head -n 200Repository: DefiLlama/yield-server
Length of output: 49220
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed_show () {
local f="$1"; local start="$2"; local end="$3";
echo "---- $f:$start-$end ----"
sed -n "${start},${end}p" "$f"
}
echo "=== inspect src/queries/yield.js around pricePerShare definition ==="
wc -l src/queries/yield.js
sed_show src/queries/yield.js 320 420
echo
echo "=== inspect src/api/controllers/yield.js around pricePerShare ==="
wc -l src/api/controllers/yield.js
sed_show src/api/controllers/yield.js 1 120
sed_show src/api/controllers/yield.js 120 220
sed_show src/api/controllers/yield.js 220 320
echo
echo "=== inspect src/handlers/triggerAdaptor.js around pricePerShare ==="
wc -l src/handlers/triggerAdaptor.js
sed_show src/handlers/triggerAdaptor.js 80 180
sed_show src/handlers/triggerAdaptor.js 260 360
sed_show src/handlers/triggerAdaptor.js 360 480
echo
echo "=== inspect src/adaptors/test.js around pricePerShare schema ==="
wc -l src/adaptors/test.js
rg -n "pricePerShare" src/adaptors/test.js | head -n 50
sed_show src/adaptors/test.js 1 120
sed_show src/adaptors/test.js 180 260Repository: DefiLlama/yield-server
Length of output: 22531
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== inspect src/types/Pool.d.ts ==="
wc -l src/types/Pool.d.ts
sed -n '1,120p' src/types/Pool.d.ts
echo
echo "=== locate sanity/schema validator code for pools ==="
rg -n "sanity|schema" src | head -n 200
echo
echo "=== locate required/allowed fields in pool validation ==="
rg -n "apyBase|apyReward|apy\\b|pricePerShare" src | rg -n "required|validate|schema|sanity" | head -n 200Repository: DefiLlama/yield-server
Length of output: 2441
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== repo root ==="
ls -la | head -n 80
echo
echo "=== directories ==="
ls -d */ | head -n 200
echo
echo "=== Find how 'project' is used/validated ==="
rg -n "project" src/api src/queries src/handlers src/types | head -n 200
echo
echo "=== Find protocol slug linking logic (project/slug) ==="
rg -n "slug.*project|project.*slug|protocol.*project|project.*protocol" src | head -n 200Repository: DefiLlama/yield-server
Length of output: 14446
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed_show () {
local f="$1"; local start="$2"; local end="$3";
echo "---- $f:$start-$end ----"
sed -n "${start},${end}p" "$f"
}
echo "=== inspect src/queries/yield.js around pricePerShare definition ==="
wc -l src/queries/yield.js
sed_show src/queries/yield.js 320 420
echo
echo "=== inspect src/api/controllers/yield.js around pricePerShare ==="
wc -l src/api/controllers/yield.js
sed_show src/api/controllers/yield.js 1 130
sed_show src/api/controllers/yield.js 130 240
sed_show src/api/controllers/yield.js 240 340
echo
echo "=== inspect src/handlers/triggerAdaptor.js around pricePerShare ==="
wc -l src/handlers/triggerAdaptor.js
sed_show src/handlers/triggerAdaptor.js 80 190
sed_show src/handlers/triggerAdaptor.js 250 360
sed_show src/handlers/triggerAdaptor.js 360 480
echo
echo "=== inspect src/adaptors/test.js around pricePerShare schema ==="
wc -l src/adaptors/test.js
rg -n "pricePerShare" src/adaptors/test.js | head -n 30
sed_show src/adaptors/test.js 1 140
sed_show src/adaptors/test.js 160 260
sed_show src/adaptors/test.js 260 340Repository: DefiLlama/yield-server
Length of output: 24740
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== inspect src/types/Pool.d.ts ==="
wc -l src/types/Pool.d.ts
sed -n '1,140p' src/types/Pool.d.ts
echo
echo "=== locate pool validation/sanity logic ==="
rg -n "sanity|schema" src | head -n 200
echo
echo "=== locate validators mentioning apy or pricePerShare ==="
rg -n "validate|sanity|schema" src | rg -n "apyBase|apyReward|pricePerShare|apy\\b" | head -n 200Repository: DefiLlama/yield-server
Length of output: 2328
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== repo root ==="
ls -la | head -n 80
echo
echo "=== directories ==="
ls -d */ | head -n 200
echo
echo "=== Find how 'project' is used/validated ==="
rg -n "project" src/api src/queries src/handlers src/types | head -n 200
echo
echo "=== Find protocol slug linking logic (project/slug) ==="
rg -n "slug.*project|project.*slug|protocol.*project|project.*protocol" src | head -n 200Repository: DefiLlama/yield-server
Length of output: 14446
🏁 Script executed:
#!/bin/bash
set -euo pipefail
sed_show () {
local f="$1"; local start="$2"; local end="$3";
echo "---- $f:$start-$end ----"
sed -n "${start},${end}p" "$f"
}
echo "=== inspect src/queries/yield.js around pricePerShare definition ==="
wc -l src/queries/yield.js
sed_show src/queries/yield.js 320 420
echo
echo "=== inspect src/api/controllers/yield.js around pricePerShare ==="
wc -l src/api/controllers/yield.js
sed_show src/api/controllers/yield.js 1 130
sed_show src/api/controllers/yield.js 130 240
sed_show src/api/controllers/yield.js 240 340
echo
echo "=== inspect src/handlers/triggerAdaptor.js around pricePerShare ==="
wc -l src/handlers/triggerAdaptor.js
wc -l src/handlers/triggerAdaptor.js
sed_show src/handlers/triggerAdaptor.js 80 190
sed_show src/handlers/triggerAdaptor.js 250 360
sed_show src/handlers/triggerAdaptor.js 360 480
echo
echo "=== inspect src/adaptors/test.js around pricePerShare schema ==="
wc -l src/adaptors/test.js
rg -n "pricePerShare" src/adaptors/test.js | head -n 30
sed_show src/adaptors/test.js 1 140
sed_show src/adaptors/test.js 160 260
sed_show src/adaptors/test.js 260 340Repository: DefiLlama/yield-server
Length of output: 24775
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "=== inspect src/types/Pool.d.ts ==="
wc -l src/types/Pool.d.ts
sed -n '1,140p' src/types/Pool.d.ts
echo
echo "=== locate pool validation/sanity logic ==="
rg -n "sanity|schema" src | head -n 200
echo
echo "=== locate validators mentioning apy or pricePerShare ==="
rg -n "validate|sanity|schema" src | rg -n "apyBase|apyReward|pricePerShare|apy\\b" | head -n 200Repository: DefiLlama/yield-server
Length of output: 2328
Fix project slug + ensure PPS-only pools provide apy* (tests/pipeline drop otherwise)
src/adaptors/gami-labs/index.jssetsproject: 'gami-labs', buthttps://api.llama.fi/protocolscontains no protocol withslug == "gami-labs"(count=0) — so adapter test’s “known protocol slug” check should fail.- The repo’s sanity checks don’t accept PPS-only pools:
src/adaptors/test.jsrequires at least one finite value amongapy/apyBase/apyReward, andsrc/handlers/triggerAdaptor.jsfilters out pools where all three are null. So PPS-only pools must still emitapy*(or the pipeline/tests need updating to support PPS-only).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/adaptors/gami-labs/index.js` around lines 101 - 111, The adapter
currently sets project: 'gami-labs' (which doesn't match any protocol slug) and
emits PPS-only pools without any apy fields; update the returned pool object in
src/adaptors/gami-labs/index.js (the function that builds the pool return with
keys pool, chain, project, symbol, tvlUsd, pricePerShare, underlyingTokens,
poolMeta, url) to (1) use the correct protocol slug instead of the hard-coded
'gami-labs' (replace with the canonical slug constant or value used by your
registry/metadata so the "known protocol slug" check passes) and (2) ensure
PPS-only pools still provide at least one finite APY by populating
apy/apyBase/apyReward when pricePerShare exists (for example set apyBase = 0 and
apy = 0 if you cannot compute a yield, or compute an APY from pricePerShare
changes if historical data is available) so the adapter satisfies
src/adaptors/test.js and src/handlers/triggerAdaptor.js filters.
|
Error while running gami-labs adapter: Test Suites: 1 failed, 1 total |
|
The gami-labs adapter exports pools: Test Suites: 1 passed, 1 total |
Yield adapter - Gami Labs
This PR adds a yield adapter for Gami Labs, listed on TVL via DefiLlama/DefiLlama-Adapters#19461 (merged).
Methodology
Reports
pricePerShare(= totalAssets / totalSupply, ratio of underlying per share) for each curated vault. DefiLlama yield-server will computeapyBasefrom the daily PPS deltas. No reward APY (Gami curator vaults have no liquidity mining).Coverage
asset(),totalAssets(),totalSupply(),decimals(),symbol(),convertToAssets().Local test
Adapter outputs 15 pools, total TVL ~$24M (matches DefiLlama TVL page).
Notes
@defillama/sdkand DefiLlama's own price feed (coins.llama.fi).Summary by CodeRabbit