Skip to content

fix and exclude unidex-perp#2279

Merged
0xkr3p merged 1 commit intoDefiLlama:masterfrom
0xkr3p:fix/unidex-perp-fix-exclude
Jan 21, 2026
Merged

fix and exclude unidex-perp#2279
0xkr3p merged 1 commit intoDefiLlama:masterfrom
0xkr3p:fix/unidex-perp-fix-exclude

Conversation

@0xkr3p
Copy link
Contributor

@0xkr3p 0xkr3p commented Jan 21, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved TVL and APY calculation precision with enhanced USD conversion
  • Chores

    • Excluded adaptor from dataset

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

📝 Walkthrough

Walkthrough

The Unidex Perp adaptor is enhanced to compute TVL and APY in USD. Per-pool staking token prices are looked up to calculate USD-denominated TVL with 2-decimal precision. Annual rewards in USD are calculated by iterating reward tokens and annualizing rates. APY is computed as the annual rewards-to-TVL ratio with zero-division protection. The adaptor is added to the exclude list.

Changes

Cohort / File(s) Summary
Adaptor Enhancement
src/adaptors/unidex-perp/index.js
Switched ABI import to JSON format; added per-pool staking token price lookup; implemented TVL calculation in USD with 2-decimal precision; computed annual rewards in USD from reward token rates; added APY calculation with zero-division guard; updated emitted pool object with tvlUsdNum and apyReward fields
Exclusion Configuration
src/utils/exclude.js
Added 'unidex-perp' to excludeAdaptors list for dataset filtering

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 Price tokens dancing in the pool,
TVL and APY calculated cool,
Rewards annualized with care and grace,
Division guards keep us in place,
Unidex now perfectly dressed! 🌱

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix and exclude unidex-perp' directly corresponds to the main changes: fixing TVL and APY calculations in the unidex-perp adaptor, and excluding it from enrichment.
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

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.

@llamatester
Copy link

The unidex-perp adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.246 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬───────────────────────────────────────────────────────┬────────────┬───────────────┬──────────┬────────┬───────────┬──────────────────────────────────────────────────┬──────────────────────────────────────────────────┬────────────────────────────────────────────┐
│ (index) │ pool                                                  │ chain      │ project       │ symbol   │ tvlUsd │ apyReward │ rewardTokens                                     │ underlyingTokens                                 │ url                                        │
├─────────┼───────────────────────────────────────────────────────┼────────────┼───────────────┼──────────┼────────┼───────────┼──────────────────────────────────────────────────┼──────────────────────────────────────────────────┼────────────────────────────────────────────┤
│ 0       │ '0x35ad17c9ee4aab967ecbd95b4ce7eb9d8e761a2b-arbitrum' │ 'Arbitrum' │ 'unidex-perp' │ 'MOLTEN' │ 0      │ 0         │ [ '0x66e535e8d2ebf13f49f3d49e5c50395a97c137b1' ] │ [ '0x66e535e8d2ebf13f49f3d49e5c50395a97c137b1' ] │ 'https://leverage.unidex.exchange/staking' │
└─────────┴───────────────────────────────────────────────────────┴────────────┴───────────────┴──────────┴────────┴───────────┴──────────────────────────────────────────────────┴──────────────────────────────────────────────────┴────────────────────────────────────────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

@0xkr3p 0xkr3p merged commit 7545c4c into DefiLlama:master Jan 21, 2026
2 checks 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.

2 participants