fix: replace assert! panics with error returns in sqrt_price_math#1
Closed
tvinagre wants to merge 1712 commits into
Closed
fix: replace assert! panics with error returns in sqrt_price_math#1tvinagre wants to merge 1712 commits into
tvinagre wants to merge 1712 commits into
Conversation
fix: use correct "ticks/" prefix when handling deleted tick attributes
## [0.228.1](0.228.0...0.228.1) (2026-01-14) ### Bug Fixes * use correct "ticks/" prefix when handling deleted tick attributes ([287f3e1](287f3e1))
fix: Add bounds checking to observations
Previous fix in #507 didn't trigger a release because it wasn't using sementic release commit names
…ease fix: dummy commit
## [0.228.2](0.228.1...0.228.2) (2026-01-16) ### Bug Fixes * dummy commit ([a5f59c3](a5f59c3))
…cies feat: update tycho-client, tycho-common, and tycho-ethereum to version 0.129.1
## [0.229.0](0.228.2...0.229.0) (2026-01-20) ### Features * update tycho-client, tycho-common, and tycho-ethereum to version 0.129.1 ([b4d92b8](b4d92b8))
…est-local-run chore: improve integration test local runs
## [0.229.1](0.229.0...0.229.1) (2026-01-20) ### Bug Fixes * record block count instead of block number ([3a0c281](3a0c281))
…ion-0.154.0 feat: update tycho-execution version
## [0.230.0](0.229.1...0.230.0) (2026-01-21) ### Features * Bump tycho-execution ([9698dbe](9698dbe))
## [0.247.2](0.247.1...0.247.2) (2026-03-03) ### Bug Fixes * add rocketpool back to integration test ([eaab73a](eaab73a))
feat: update execution version for new rocketpool executor
## [0.248.0](0.247.2...0.248.0) (2026-03-04) ### Features * update execution version for new rocketpool executor ([3233e45](3233e45))
… changes TransitionError generic was removed in tycho-common 0.144.0. This PR adjust tycho-simulation to work with the latest version.
…er-breaking-changes fix: update dependencies and adjust interfaces with upstream breaking changes
## [0.248.1](0.248.0...0.248.1) (2026-03-06) ### Bug Fixes * update dependencies and adjust interfaces with upstream breaking changes ([2953077](2953077))
Dispatches the compatibility-check workflow in propeller-heads/tycho whenever a release is published, keeping the meta-crate in sync. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…workflow chore: add notify-tycho-compat workflow
…checks Replace assert! panics with SimulationError::InvalidInput returns in the swap price limit validation for UniswapV3, UniswapV4, Velodrome, and Aerodrome slipstreams. Prevents crashes during depth calculation when price moves beyond the maximum trade amount. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Test that out-of-range price limits return SimulationError::InvalidInput instead of panicking, including the depth calculation scenario where pool sqrt_price reaches MIN_SQRT_RATIO + 1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix: replace assert! panics with SimulationError in swap price limit checks
## [0.248.2](0.248.1...0.248.2) (2026-03-12) ### Bug Fixes * replace assert! panics with SimulationError in swap price limit checks ([bcaa584](bcaa584))
…rwrite fix: overwrite existing accounts on ChangeType::Creation
## [0.248.3](0.248.2...0.248.3) (2026-03-12) ### Bug Fixes * force-overwrite proxy token accounts to prevent stale placeholders ([45f87ae](45f87ae)) * overwrite existing accounts on ChangeType::Creation ([af6bb78](af6bb78)) * split proxy account updates by change type for proper handling ([1061193](1061193))
…est CLI Add --min-token-quality and --max-days-since-last-trade CLI args to the integration test binary, wiring them into the load_all_tokens call instead of the previous hardcoded None defaults. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add --tvl-buffer-ratio CLI arg (default 1.1) to support TVL hysteresis filtering, matching the tycho-solver pattern. The lower bound of the TVL filter is now tvl_threshold / tvl_buffer_ratio instead of tvl_threshold. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…se-filtering-config feat: expose filtering config on integration test CLI
## [0.249.0](0.248.3...0.249.0) (2026-03-16) ### Features * add TVL buffer ratio to integration test CLI ([647875a](647875a)) * expose token quality and traded days filtering on integration test CLI ([0fa87c0](0fa87c0))
This is needed to be compatible with latest tycho-client version (see propeller-heads/tycho@3e0e75f)
…ements feat: update lru dependency
## [0.250.0](0.249.0...0.250.0) (2026-03-16) ### Features * update lru dependency ([87a6694](87a6694))
Replace 6 assert\!() calls in production swap math with proper SimulationError::FatalError returns. These assertions could crash Fynd when derived computations hit pools with extreme states. Add 6 tests covering each error path.
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
assert!()calls insqrt_price_math.rswithSimulationError::FatalErrorreturnsget_amount0_delta: move zero check before the subtraction that depends on itContext
Fynd crashed in production with
assertion failed: price_limit < self.sqrt_pricein the uniswap_v4 swap path (v0.234.0). That specific assertion was already fixed in v0.250.0, but 6 moreassert!()calls remained insqrt_price_math.rson the same code path.Test plan
cargo test --lib -- sqrt_price_math::tests— 25 pass (19 existing + 6 new)cargo clippyclean