Skip to content

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
SO4-Markets:mainfrom
ghzhost:docs/fix-api-oracle-liquidation-inconsistencies
Open

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
ghzhost wants to merge 1 commit into
SO4-Markets:mainfrom
ghzhost:docs/fix-api-oracle-liquidation-inconsistencies

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 23, 2026

Copy link
Copy Markdown

Summary of Changes

This PR addresses and resolves multiple documentation and specification inconsistencies with the actual Soroban smart contract implementation in SO4-Markets/contracts:

  1. 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):

  2. 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):

  3. 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):

Closes #660, closes #662, closes #663, closes #664, closes #666, closes #667, closes #655, closes #656, closes #657.

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.

docs/exchange-router-api.md's claim_funding_fees section names the wrong event topic (fee_clm instead of fnd_clm) docs/exchange-router-api.md's Error Codes table lists only 3 of exchange_router's 7 error variants, omitting Paused entirely docs/keeper-execution-flow.md calls oracle's price-submission function set_primary_price, which doesn't exist — the real entrypoint is set_prices 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 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

1 participant