docs: add perpetuals, margin, liquidation, and wallets pages - #645
Open
nonso7 wants to merge 1 commit into
Open
Conversation
Covers DX-071, DX-073, DX-074, and DX-069. Three new pages (/concepts/perpetuals, /concepts/margin-and-leverage, /get-started/wallets) and a full rewrite of the /concepts/liquidation stub. Every worked example was computed by running the interface's own functions (estimateLiquidationPrice, calculatePnl, sizeFromCollateralAndLeverage in apps/web/src/features/trade/lib/trade-math.ts) against the stated inputs, not estimated. Sourcing: - Liquidation formula and 0.5% maintenance margin: trade-math.ts:37-63 (rate at :49); duplicate estimator in liquidation.ts:16-35. Contract-side value is PositionInfo.liquidationPrice (packages/contracts/src/generated/synthetics-reader/src/index.ts:54, getAccountPositions at :337), read in usePositions.ts:57. Liquidation lifecycle from mappingHandlers.ts:203-209 and :570-596, schema.graphql:309. - Leverage: trade-math.ts:21,27; usePositions.ts:66; CollateralDialog.tsx:62, 77-78; LeverageSlider.tsx:12; useMarketsInfo.ts:77; LEVERAGE_TOO_HIGH in packages/contracts/src/errors.ts:24. Collateral tokens from apps/web/src/features/pools/data/markets.ts. - Wallets: WALLET_OPTIONS in ConnectButton.tsx:38, error string at :264, kit init in app/providers/index.tsx:78-79, signing path in lib/soroban/tx-builder.ts:23 through packages/contracts/src/clients/exchange-router.ts:139,201, session persistence in wallet-store.ts:43-44. The Soroban contract source is not part of this repository, so the on-chain maintenance-margin threshold could not be verified against the code that enforces it. The liquidation page states that limitation directly and ships as status: beta pending maintainer review, as DX-074 requires. Partial liquidation is documented as not implemented anywhere in this repository. Also removes the /concepts/perpetuals and /concepts/margin-and-leverage placeholder entries from link-ignore.json, now that both routes exist, and updates the quickstart sentence that described the wallet guide as planned. Verification: check:links passes (41 pages), lint:prose reports 0 errors, and the docs script tests pass (40/40). check:content passes for these pages once committed with today's date; it still reports 10 pre-existing updated-date mismatches on pages this change does not touch. lint, typecheck, check:tokens, test, test:coverage and build all fail identically on unmodified main (verified against a clean clone of a07d258: identical typecheck errors, byte-identical check:tokens output, same three failing docs test files, same CSS budget failure with the same asset hash), so this change neither introduces nor fixes them.
|
@nonso7 is attempting to deploy a commit to the Ijai's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@nonso7 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Covers DX-071, DX-073, DX-074, and DX-069.
Three new pages (/concepts/perpetuals, /concepts/margin-and-leverage, /get-started/wallets) and a full rewrite of the /concepts/liquidation stub. Every worked example was computed by running the interface's own functions (estimateLiquidationPrice, calculatePnl, sizeFromCollateralAndLeverage in apps/web/src/features/trade/lib/trade-math.ts) against the stated inputs, not estimated.
Sourcing:
The Soroban contract source is not part of this repository, so the on-chain maintenance-margin threshold could not be verified against the code that enforces it. The liquidation page states that limitation directly and ships as status: beta pending maintainer review, as DX-074 requires. Partial liquidation is documented as not implemented anywhere in this repository.
Also removes the /concepts/perpetuals and /concepts/margin-and-leverage placeholder entries from link-ignore.json, now that both routes exist, and updates the quickstart sentence that described the wallet guide as planned.
Verification: check:links passes (41 pages), lint:prose reports 0 errors, and the docs script tests pass (40/40). check:content passes for these pages once committed with today's date; it still reports 10 pre-existing updated-date mismatches on pages this change does not touch. lint, typecheck, check:tokens, test, test:coverage and build all fail identically on unmodified main (verified against a clean clone of a07d258: identical typecheck errors, byte-identical check:tokens output, same three failing docs test files, same CSS budget failure with the same asset hash), so this change neither introduces nor fixes them.
Closes #581
Closes #583
Closes #585
Closes #586