Skip to content

project-x: use the last completed day for volume and apy - #3283

Open
takinanton wants to merge 1 commit into
DefiLlama:masterfrom
takinanton:project-x-completed-day
Open

takinanton wants to merge 1 commit into
DefiLlama:masterfrom
takinanton:project-x-completed-day

Conversation

@takinanton

@takinanton takinanton commented Nov 28, 2026 •

Copy link
Copy Markdown

The fee apy is annualized from the newest poolDayData bucket which is the UTC day still in progress, so it drops to almost nothing after midnight and climbs back all day. WHYPE-USDC 0.05% was listed at 0.06% with $54k volume early today while the subgraph has $70.5M for Nov 27. I pointed the query at the bucket of the last completed UTC day, same idea as uniswap-v4 after #3098. Ran npm run test --adapter=project-x around 8am UTC and that pool went from 13.4% on $12.5M volume to 75.6% on $70.2M. All 258 tests pass and tvl is unchanged.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Daily pool data is now retrieved for the previous UTC calendar day instead of using each pool’s latest available data. This keeps the displayed daily values aligned to the same date across pools.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The Project X adaptor now requests pool-day data for the previous UTC day by timestamp instead of selecting each pool’s latest bucket.

Changes: UTC day data query

Layer / File(s) Summary
Date-filtered pool-day query
src/adaptors/project-x/index.js
dayDataQuery filters by a required date. fetchDayData supplies the previous UTC day’s start timestamp for each ID batch.

Estimated code review effort: 2 (Simple) | ~5 minutes

Change: Bug fix

Suggested reviewers: slasher125, kanerep

Merge Risk: Minimal · up to 406c5

Project X fee APY and volume now come from the last completed UTC day instead of the partial current day, which removes the near-zero reading just after midnight. No concrete defect was found. The only open question is whether the subgraph's date encoding matches the query, and the author's reported results suggest it does. The change is small and easy to revert.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the project, the switch to the last completed day, and the affected metrics (volume and APY). The change in src/adaptors/project-x/index.js makes dayDataQuery request data for the prev…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the project, the switch to the last completed day, and the affected metrics (volume and APY). The change in src/adaptors/project-x/index.js makes dayDataQuery request data for the previous UTC day instead of each pool's latest bucket, which matches the title. The title is specific and accurate, so it passes.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 777e38d7-f7d5-405d-9ff4-950054621989
Commits

Reviewing files that changed from the base of the PR and between ccd3bf6 and 406c53a.

Files selected for processing: 1

  • src/adaptors/project-x/index.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

Copy link
Copy Markdown

The project-x adapter exports pools:

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

Nb of pools: 42
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬──────────────────┬─────────────┬────────────────┬────────────────────┬─────────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┬────────────────────┐
│ (index) │ pool                                         │ chain            │ project     │ symbol         │ tvlUsd             │ apyBase             │ url                                                                                                                                          │ underlyingTokens                                                                               │ poolMeta │ volumeUsd1d        │
├─────────┼──────────────────────────────────────────────┼──────────────────┼─────────────┼────────────────┼────────────────────┼─────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┼────────────────────┤
│ 0       │ '0x6c9a33e3b592c0d65b3ba59355d5be0d38259285' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-USDC'   │ 14548805.350723231 │ 75.59450022622343   │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0xb88339cb7199b77e23db6e890353e22632ba630f&fee=500'   │ [ '0x5555555555555555555555555555555555555555', '0xb88339cb7199b77e23db6e890353e22632ba630f' ] │ '0.05%'  │ 70073887.82265231  │
│ 1       │ '0x0d6ecb912b6ee160e95bc198b618acc1bcb92525' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-UBTC'   │ 5817258.076669788  │ 67.66171229823091   │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0x9fdbda0a5e284c32744d2f17ee5c74b284993463&fee=3000'  │ [ '0x5555555555555555555555555555555555555555', '0x9fdbda0a5e284c32744d2f17ee5c74b284993463' ] │ '0.3%'   │ 4179734.9723711517 │
│ 2       │ '0x422e586c906eb241f784b4f5a633c2c7e59a2f54' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-USDC'   │ 4993573.254000448  │ 73.79724242101022   │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0xb88339cb7199b77e23db6e890353e22632ba630f&fee=3000'  │ [ '0x5555555555555555555555555555555555555555', '0xb88339cb7199b77e23db6e890353e22632ba630f' ] │ '0.3%'   │ 3913262.5674051605 │
│ 3       │ '0xaf80230eb13222db743c21762f65a046bb5f5437' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-UETH'   │ 951622.7108150878  │ 59.19995681535016   │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0xbe6727b535545c67d5caa73dea54865b92cf7907&fee=3000'  │ [ '0x5555555555555555555555555555555555555555', '0xbe6727b535545c67d5caa73dea54865b92cf7907' ] │ '0.3%'   │ 598237.4788654525  │
│ 4       │ '0xbe352daf66af94ccf2012a154a67daef95facb91' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-kHYPE'  │ 886503.9912425851  │ 0.11709716382383228 │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0xfd739d4e423301ce9385c1fb8850539d657c296d&fee=100'   │ [ '0x5555555555555555555555555555555555555555', '0xfd739d4e423301ce9385c1fb8850539d657c296d' ] │ '0.01%'  │ 33070.11885728391  │
│ 5       │ '0xbd19e19e4b70eb7f248695a42208bc1edbbfb57d' │ 'Hyperliquid L1' │ 'project-x' │ 'WHYPE-USD₮0'  │ 473847.162171187   │ 46.558088608332945  │ 'https://www.prjx.com/deposit?tokenA=0x5555555555555555555555555555555555555555&tokenB=0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb&fee=500'   │ [ '0x5555555555555555555555555555555555555555', '0xb8ce59fc3717ada4c02eadf9682a9e934f625ebb' ] │ '0.05%'  │ 1405633.524254427  │
│ 6       │ '0xb0ca298dd776421ee1b9b053c06168971395cd1a' │ 'Hyperliquid L1' │ 'project-x' │ 'USDC-AVLT'    │ 458086.6578053626  │ 0.9189512654363061  │ 'https://www.prjx.com/deposit?tokenA=0xb88339cb7199b77e23db6e890353e22632ba630f&tokenB=0xd0ee0cf300dfb598270cd7f4d0c6e0d8f6e13f29&fee=20000' │ [ '0xb88339cb7199b77e23db6e890353e22632ba630f', '0xd0ee0cf300dfb598270cd7f4d0c6e0d8f6e13f29' ] │ '2%'     │ 670.5309236535936  │
│ 7       │ '0x93f84253e43eed6a6406ca762b354bf7a94edd8d' │ 'Hyperliquid L1' │ 'project-x' │ 'kmHYPE-kHYPE' │ 375949.8942051522  │ 0.2849278173715798  │ 'https://www.prjx.com/deposit?tokenA=0x360c140e5344a1a0593d44b4ea6fc7c3daf0c473&tokenB=0xfd739d4e423301ce9385c1fb8850539d657c296d&fee=10000' │ [ '0x360c140e5344a1a0593d44b4ea6fc7c3daf0c473', '0xfd739d4e423301ce9385c1fb8850539d657c296d' ] │ '1%'     │ 341.25066198455033 │
│ 8       │ '0x77f21b76757889c3c8e9aa7a1c549cc4180d4609' │ 'Hyperliquid L1' │ 'project-x' │ 'vkHYPE-kHYPE' │ 372239.9290429227  │ 0.2778330313626851  │ 'https://www.prjx.com/deposit?tokenA=0x9ba2edc44e0a4632eb4723e81d4142353e1bb160&tokenB=0xfd739d4e423301ce9385c1fb8850539d657c296d&fee=2000'  │ [ '0x9ba2edc44e0a4632eb4723e81d4142353e1bb160', '0xfd739d4e423301ce9385c1fb8850539d657c296d' ] │ '0.2%'   │ 1647.3486441577897 │
│ 9       │ '0x6ae099fd8695c51f94954f93ca3fcb6c9bddb2a4' │ 'Hyperliquid L1' │ 'project-x' │ 'UBTC-UETH'    │ 310871.5476729715  │ 9.155495168844427   │ 'https://www.prjx.com/deposit?tokenA=0x9fdbda0a5e284c32744d2f17ee5c74b284993463&tokenB=0xbe6727b535545c67d5caa73dea54865b92cf7907&fee=3000'  │ [ '0x9fdbda0a5e284c32744d2f17ee5c74b284993463', '0xbe6727b535545c67d5caa73dea54865b92cf7907' ] │ '0.3%'   │ 30223.881839769358 │
└─────────┴──────────────────────────────────────────────┴──────────────────┴─────────────┴────────────────┴────────────────────┴─────────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┴────────────────────┘

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.

1 participant