GeezerVison is showing github.com — feat: add liquidity-based sale quotes and historical price audits by BlinkyStitt · Pull Request #43 · SatoshiAndKin/ypricemagic
Conversation
BlinkyStitt
commented
Sep 11, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add amount-sensitive native sale quotes and historical price audits across supported DEXes and immediate redemption paths. Preserve integer amounts, fees, exclusions, canonical block identity, independent result paths, and liquidity ranking. Spot and terminal USDC valuation remains 1 USDC = $1; USDC amount requests use actual DEX outputs.
Repair the historical pricing failures and complete strict typing for production code, tests, and validation tools. Retry transient archive-state misses at the same requested block identifier while preserving unexpected errors and cancellation, including Compound direct calls and oracle reads.
Rationale
The earlier full suite reported 68 failures and zero timeouts. Investigation found adapter defects, unsupported historical samples, incorrect sale-versus-oracle expectations, and transient provider-state failures. The 3,600-second deadlines remain unchanged; previously measured successful calls fit within them.
Short archive retries still exhausted under concurrent historical workloads. The bounded recovery window now permits ten attempts with 121.5 seconds of total backoff. A persistent miss raises its original error. Strict mypy checks also exposed malformed helper calls and sync/async interface errors that now have behavioral regression coverage.
Details
The three review findings are repaired: Chainlink availability and prices are checked against independent pinned native state; V3 results require actual swap/redemption paths with independently reconstructed USD values; empty Solidly and Velodrome V2 quotes return unavailable so routing can try another pool. Exact outputs, fees, exclusions, ranking, and unexpected-error/cancellation propagation are preserved.
Native reference checks cover canonical WETH redemption and later V2 legs in V3-entry routes. The diagnostic sampler now keeps its real clock when retry tests mock asyncio.sleep, preventing the separately reproduced validation stall. Neither pricing deadlines nor resource limits were increased.
- Normalize V2 index and V3 entry-point addresses, including bytes, HexBytes, and inherited Slipstream behavior. Treat empty V2 output as an unavailable candidate and continue routing.
- Restore V1 native ETH-to-USDC continuation. Require V3/Slipstream proof of full input execution; preserve exact fee-inclusive outputs and liquidity ranking.
- Resolve historical Compound controllers and oracle denominations, Synthetix resolver state, and verified retired or unavailable feeds. Preserve fallback, exclusions, and unexplained-error propagation.
- Repair GUNI balances, historical Popsicle scaling and zero supply, PieDAO calls, and Aave async dispatch and unverified wrappers. Enable the previously unmarked Compound async tests and verify historical expectations with native reads.
- Fix scalar and batch ERC20 decoding, multicall return mappings, Saddle call order, Ellipsis native reserve units, log decoding/topic restoration, timestamp persistence, CLI selectors, and trace-cache schema lookups. Preserve Decimal valuation results and configured tuple paths.
- Model inherited a_sync methods, overloads, properties, queues, and generators in the local mypy extension. Positive and negative typing probes cover arguments, return values, overrides, and execution modes. Strict checking remains enabled across 231 source files.
- Retain DEBUG-only
y.stuck? diagnostics at the default five-minute interval. No cache or database schema migrations. Declare the existing frozen Click 8.5.0 dependency directly; CI installs existing development requirements, including numpy. Resolved dependency versions remain unchanged.
Final validation of committed 7d5074c0 (native and mutation controls use pricing-identical 5e809224):
- Required Python 3.12 command unchanged:
PYTEST_ADDOPTS="-p no:pytest_ethereum" BROWNIE_NETWORK=mainnet make test — 2,161 passed, 17 skipped, zero failures, exit 0. All 450 review-specific cases pass within that full run and in the separate Python 3.13 native run.
- Frozen focused matrix: 691 passed on each of Python 3.11, 3.12, and 3.13. Strict mypy reports zero diagnostics across 231 files; all ten compiled extensions are verified from imported
.so paths on every version. All 11 validation-runner tests pass per version.
- 15/15 sequential historical native checks passed, including Router02 absent at block 10,100,000 and a later successful V2 quote.
- Original adapter control: 18 expected failures / 40 passes; the same assertions pass after repair. Always-None Chainlink discovery now causes 162 assertion failures, and constant-$123/empty-path V3 quotes fail all 84 cases. All mutation failures occur at the intended assertions.
- All 13 GitHub checks passed on validated source: nine platform/version mypy jobs, compilation, formatting, and both CodeQL checks.
- The full job completed in 4,772.368 seconds, with peak cgroup memory 4,513,456,128 bytes. Its longest test passed in 3,257.994 seconds, below the unchanged 3,600-second deadline. No final acceptance job timed out, was interrupted, was OOM-killed, or omitted a required report.
- The sampler regression fails on the original helper and passes after repair. The full-suite retry-boundary test completes in 0.000553 seconds after repair; its prior 3,600-second diagnostic stall remains explicitly recorded as a failed validation attempt, even though pytest later labeled that individual test passed.
The 17 skips cover chain-specific tests, deprecated/uninitialized contracts, and inapplicable bucket checks. Earlier passing suites and failed controls remain historical evidence; they are not substituted for these final checks.
All heavy jobs use 8 GiB RAM, no swap, four CPUs, and 512 processes/threads, with one heavy job per profile. Source identities, exact failures, memory peaks, and missing reports are retained in the repair checklist and review repair evidence. The unrelated generated C file is preserved and excluded from repair commits.
The older exploratory audit is source-specific: its unavailable exits, reference-policy differences, provider errors, and incomplete references remain documented in the prior audit evidence. It is not a passing audit of the repaired source; earlier audit OOM and timeout experiments remain separate.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Await eligible quotes with deterministic selection and owned task cleanup. Correct historical feeds, backing ratios, conversion paths, discovery blocks, and price-cache isolation so callers receive valid USD valuations.
Add production-function regressions and a checked chain-specific price-cache reset. Centralize validation settings and retain compiled-extension checks.
Use the deepest eligible pool with bounded fallback so pricing avoids route-list growth. Quote exact readable amounts through native swaps and supported redemptions, with fees, impact, and copied block-hash caches.
Add the historical DeFiLlama audit, Python 3.11-3.13 build/test configuration, and review evidence. Keep PR #43 in draft because RPC/explorer failures prevent complete live validation.
BlinkyStitt
changed the title
fix: compare DEX candidates and correct historical pricing
feat: add liquidity-based sale estimates and historical audits
Sep 12, 2026
BlinkyStitt
changed the title
feat: add liquidity-based sale estimates and historical audits
feat: add liquidity-based sale quotes and historical price audits
Sep 12, 2026
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|