Skip to content

fix: gains funding precision 1e21 (1000x correction) - #2113

Merged
Flotapponnier merged 3 commits into
devfrom
feat/fee-compare-carry-v2
Aug 27, 2026
Merged

Flotapponnier merged 3 commits into
devfrom
feat/fee-compare-carry-v2

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

lastFundingRatePerSecondP uses 1e21 precision, not 1e18. Was causing Gains funding estimates to be 1000x too high in crossSim projections and the fallback estimation.

Verified empirically: HL BTC funding = 4.51e-10/sec; Gains BTC at 1e21 = 4.47e-10/sec (within 1%). At 1e18 it was 4.47e-7/sec (990x off).

@Flotapponnier
Flotapponnier merged commit 2d99e44 into dev Aug 27, 2026
1 check failed
bakabhai993 pushed a commit to bakabhai993/OpenChainBench that referenced this pull request Sep 12, 2026
* fix: Gains USDC collateral array index (2 not 3)

* feat: fallback Gains funding estimate when API returns zero

* fix: gains funding precision 1e21 not 1e18 (1000x correction)
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