Conversation
A route that is one RFQ swap executes the maker's signed quote and nothing else, so its simulated output against the quoted output is the gap between the price levels it was solved on and what the maker signed. Neither metric could separate those routes from the rest. quote_simulations_total and quote_simulation_deviation_bps now carry rfq=none|single_leg|mixed, and the simulation outcome log carries the same field. A gap wider than the request's slippage shows as a revert rather than as a deviation. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The deviation histogram shows how far signed RFQ quotes land from their price levels, but not for which pair or at what size. A successful simulation of a single-leg RFQ route now logs its protocol, component, token pair, amount in, the quoted and simulated amounts after fees, and the deviation, under the fynd::simulation_outcome target. quoted_after_fees is split out of deviation_bps so the log states the same quoted amount the deviation compares against. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The encoder requests each Hashflow leg's signed quote itself and keeps
only the calldata, so how far the maker signs from the price levels the
leg was solved on was visible nowhere. Hashflow's executor data carries
the signed amounts, packed as base_token | quote_token |
base_token_amount | quote_token_amount, so encode_quotes now reads them
back from the encoded transaction.
- rfq_signed_quote_deviation_bps{protocol} records the signed rate
against the price-level rate, for every Hashflow leg of every encoded
quote, in every deployment
- a fynd::rfq_signed_quote debug line adds the order, component, pair,
and the level and signed amounts
- rfq_signed_quote_unread_total counts a leg whose data is not found,
which is what shows the packing has changed
- a test encodes a Hashflow leg through the real tycho-execution router
encoder and reads the amounts back
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
rfq_signed_quote_deviation_bps reads every Hashflow leg's signed quote from the calldata, including legs inside longer routes and gaps wide enough to revert, in every deployment. The simulation label measured only single-swap routes, only where simulation runs, and lost every gap that reverted, so it is removed with its log line, IndicativeSim and quoted_after_fees. Reverts 48ff496 and e2d8d89. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A route that splits a pair between Hashflow and an AMM leg holds the pair back to back twice: a Uniswap V3 swap packs token_in | token_out | fee | receiver. The reader took the first occurrence and read the AMM leg's fee and address bytes as signed amounts, which recorded gaps of billions of bps on dev. A match now counts only when the two amounts after it fit below 2^128 and the next word is a unix time, as Hashflow's quote_expiry is; otherwise the search moves on. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Measures how far each Hashflow leg's signed quote lands from the price levels it was solved on.
The encoder requests each Hashflow leg's signed quote itself and keeps only the calldata. Hashflow's executor data carries the signed amounts, packed as
base_token | quote_token | base_token_amount | quote_token_amount, andencode_quotesnow reads them back out.rfq_signed_quote_deviation_bps{protocol}records the signed rate against the price-level rate for every Hashflow leg of every encoded quote, including legs inside longer routes and gaps wide enough to revert. Negative means the maker signed for less than its levels advertised.fynd::rfq_signed_quotedebug line adds the order, component, pair, and the level and signed amounts.rfq_signed_quote_unread_totalcounts a leg whose data is not found. It is what shows the packing has changed.test_encoded_hashflow_leg_carries_signed_amountsencodes a Hashflow leg through the real tycho-execution router encoder and reads the amounts back.src/serve.rsgives the histogram the signed bps bucketsquote_simulation_deviation_bpsuses.🤖 Generated with Claude Code