Skip to content

Add guard clause to liminal tokenized data#17977

Merged
g1nt0ki merged 2 commits intoDefiLlama:mainfrom
FelixBruguera:liminal-fix
Feb 13, 2026
Merged

Add guard clause to liminal tokenized data#17977
g1nt0ki merged 2 commits intoDefiLlama:mainfrom
FelixBruguera:liminal-fix

Conversation

@FelixBruguera
Copy link
Contributor

@FelixBruguera FelixBruguera commented Feb 9, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved balance data handling to prevent unnecessary token updates when no balance information is available.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The change adds an early exit condition to the TVL calculation flow in the liminal-money project. When the API returns no balances, the function now returns early, preventing unnecessary subsequent token-amount update operations.

Changes

Cohort / File(s) Summary
Early Exit Logic
projects/liminal-money/index.js
Added early return in tvl flow when API balance retrieval yields no balances, preventing downstream token-amount processing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A balance check, so swift and keen,
Returns early from the in-between,
When nothing's found, we hop away,
Saving work for another day! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive No pull request description was provided by the author, but the PR is for a code fix (not a new protocol listing), making the template largely inapplicable. Add a brief description explaining the purpose of the guard clause, what problem it solves, and why this change is necessary.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a guard clause to the liminal tokenized data flow, which matches the +1 line addition in the code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
projects/liminal-money/index.js (1)

73-73: Guard clause gates breakdown TVL on tokenized data availability—clarify intent.

The guard on line 73 skips processing the USDC and asset breakdown (lines 75–86) whenever addTokenizdData doesn't find matching tokenized records. However, the breakdown data comes from the main API record (line 69), not from tokenized records. If this is intentional (report TVL only when tokenized data exists), add a comment explaining the design. If unintended, consider removing the guard—the breakdown should be reported independently.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@llamabutler
Copy link

The adapter at projects/liminal-money exports TVL:

hyperliquid               0.00

total                    0.00 

if (!record) return;

await addTokenizdData(api);
if (Object.keys(api.getBalances()).length === 0) return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you instead throw an error here, else it would return empty data

@llamabutler
Copy link

The adapter at projects/liminal-money exports TVL:

hyperliquid               0.00

total                    0.00 

@g1nt0ki g1nt0ki merged commit e841fc4 into DefiLlama:main Feb 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants