docs/fix: align API error codes, event schemas, oracle execution flow, and liquidation specs with implementation (#660, #662, #663, #664, #666, #667, #655, #656, #657) - #670
Open
ghzhost wants to merge 1 commit into
Conversation
…, and liquidation specs with implementation (SO4-Markets#660, SO4-Markets#662, SO4-Markets#663, SO4-Markets#664, SO4-Markets#666, SO4-Markets#667, SO4-Markets#655, SO4-Markets#656, SO4-Markets#657)
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.
Summary of Changes
This PR addresses and resolves multiple documentation and specification inconsistencies with the actual Soroban smart contract implementation in
SO4-Markets/contracts:Exchange Router API & Error Codes (docs/exchange-router-api.md's Error Codes table lists only 3 of exchange_router's 7 error variants, omitting Paused entirely #660, docs/exchange-router-api.md's claim_funding_fees section names the wrong event topic (fee_clm instead of fnd_clm) #662, docs/exchange-router-api.md's create_order/create_deposit/create_withdrawal event payloads are stale — all three were enriched by #442 but the doc still shows the pre-enrichment 3-field shape #663, docs/exchange-router-api.md's Overview claims create_order is exposed as a direct single-action helper — it's actually the prime example of one that isn't #664):
docs/exchange-router-api.mdevent payloads forcreate_order,create_deposit, andcreate_withdrawalto match the enriched schemas introduced in implementation (docs/exchange-router-api.md's create_order/create_deposit/create_withdrawal event payloads are stale — all three were enriched by #442 but the doc still shows the pre-enrichment 3-field shape #663).Oracle Execution Flow & Script Specs (docs/oracle.md claims submit_prices.sh signs a bundle and calls set_prices — it actually calls the unsigned set_prices_simple test path #666, docs/oracle.md's Price Pair (Min/Max) table describes increase/decrease execution price selection that doesn't match get_execution_price — it uses mid_price + impact, never min/max #667):
docs/oracle.mddescription of price execution logic: reflects mid_price + impact calculations rather than outdated min/max claims (docs/oracle.md's Price Pair (Min/Max) table describes increase/decrease execution price selection that doesn't match get_execution_price — it uses mid_price + impact, never min/max #667).submit_prices.shtest execution path vs signed bundles (docs/oracle.md claims submit_prices.sh signs a bundle and calls set_prices — it actually calls the unsigned set_prices_simple test path #666).Liquidation Flow & Position Utils (is_liquidatable's own comments contradict each other on whether PnL enters the primary comparison, and docs/liquidation-flow.md still describes the pre-#406-fix behavior #655, docs/liquidation-flow.md contradicts itself: §3 says the percentage fee split isn't implemented, but §4's worked example and §5's comparison table both use it as if it were live #656, docs/keeper-execution-flow.md calls oracle's price-submission function set_primary_price, which doesn't exist — the real entrypoint is set_prices #657):
docs/liquidation-flow.mdand comments inlibs/position_utils/src/lib.rsregarding PnL inclusion in primary health factor checks.Closes #660, closes #662, closes #663, closes #664, closes #666, closes #667, closes #655, closes #656, closes #657.