Skip to content

fix: normalize netLpPosition to netLpPos for API consistency#161

Open
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/normalize-netlppos-field-name
Open

fix: normalize netLpPosition to netLpPos for API consistency#161
0x-SquidSol wants to merge 1 commit intodcccrypto:mainfrom
0x-SquidSol:fix/normalize-netlppos-field-name

Conversation

@0x-SquidSol
Copy link
Copy Markdown
Contributor

Summary

  • Issue: The same logical field (net LP position) used two different JSON names: netLpPosition in /funding/global and /funding/:slab top-level, but netLpPos in /markets, /open-interest, and all funding history arrays. Most notably, a single /funding/:slab response contained both namesnetLpPosition at the top level and netLpPos inside last24hHistory entries.
  • Fix: Standardizes on netLpPos everywhere.

Why netLpPos?

  • 6 of 8 existing occurrences already used netLpPos
  • Matches the DB column name net_lp_pos (natural camelCase translation)
  • Aligns with the abbreviated convention used throughout the API (netLpPos, lpSumAbs, etc.)
  • Smallest diff — only 2 response fields need changing

Changes

File Change
src/routes/funding.ts netLpPositionnetLpPos in /funding/global (L82) and /funding/:slab (L143, L192) responses + comments
openapi.yaml Updated FundingRateSummary (L888) and FundingRateDetails (L905) schemas
tests/routes/funding.test.ts Updated assertion (L94)

Test plan

  • tsc --noEmit passes
  • vitest run passes (186/186 tests)
  • Verified netLpPos is now used consistently across all endpoints

🤖 Generated with Claude Code

The same logical field (net LP position) was exposed under two
different names: `netLpPosition` in /funding/global and /funding/:slab
top-level responses, but `netLpPos` everywhere else (/markets,
/open-interest, and all funding history arrays — including the
last24hHistory array nested *inside* the /funding/:slab response).

Standardizes on `netLpPos` (6 of 8 existing occurrences, matches
the DB column `net_lp_pos`, aligns with the abbreviated convention
used throughout the API).

Changes:
- funding.ts: rename field in /funding/global and /funding/:slab responses
- openapi.yaml: update FundingRateSummary and FundingRateDetails schemas
- funding.test.ts: update assertion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Warning

Rate limit exceeded

@0x-SquidSol has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 10 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 10 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fbbddfcb-b3f6-414a-a09e-c94a2c89364b

📥 Commits

Reviewing files that changed from the base of the PR and between fb94c29 and 43647ab.

📒 Files selected for processing (3)
  • openapi.yaml
  • src/routes/funding.ts
  • tests/routes/funding.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

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