docs: fix funding rate clamp, payment formula, and market order clearing price#217
Open
GeorgeTsimos wants to merge 1 commit into
Open
docs: fix funding rate clamp, payment formula, and market order clearing price#217GeorgeTsimos wants to merge 1 commit into
GeorgeTsimos wants to merge 1 commit into
Conversation
GeorgeTsimos
commented
Jun 4, 2026
- `perpetuals.md`: Funding rate clamp lower bound corrected from `0` to `−max_funding_rate` — the formula contradicted the text below it which already described negative rates.
- `perpetuals.md`: Funding payment formula now includes `× (elapsed / funding_window)` — the proration factor was missing, making the formula independent of batch duration.
- `orderbook.md`: Added a paragraph after the clearing algorithm explaining that market orders don't influence the clearing price, and what happens when only one side has a limit order at the margin or no limit orders were matched at all.
…ing price - funding_rate clamp lower bound was 0; corrected to −max_funding_rate so negative rates (shorts pay longs) are represented accurately - funding_payment formula was missing the (elapsed / funding_window) proration factor; without it the formula implied a fixed per-batch charge independent of batch duration - added a paragraph to the orderbook clearing section explaining that market orders do not influence the clearing price, and what happens in the one-sided and all-market-order degenerate cases Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
majesticwizardcat
approved these changes
Jun 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.