Skip to content

feat: index SwapHood V3 on Robinhood Chain - #1584

Open
zach030 wants to merge 3 commits into
mainfrom
feat/swaphood-v3-robinhood
Open

zach030 wants to merge 3 commits into
mainfrom
feat/swaphood-v3-robinhood

Conversation

@zach030

@zach030 zach030 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Indexes SwapHood V3 on Robinhood Chain. SwapHood V3 is PancakeSwap V3 with two extra fee tiers: 80 (tick spacing 10) and 1800 (tick spacing 50).

Factory 0x0ec554f0bff0be6c99d1e95c8015bb0950f6a2c7 (PancakeV3Factory), first PoolCreated at block 7,020,627. The pool deployer 0xcb42…f1b2 emits no PoolCreated.
Substreams ethereum-pancakeswap-v3 with the new robinhood-swaphood-v3.yaml, components swaphood_v3_pool
Simulation UniswapV3State
Execution UniswapV3SwapEncoder, executor 0x33E8602FeDD1215CB04c865C66648DbA5b81fb75

Substreams change

map_protocol_changes panicked with Unexpected fee value on Initialize for any tier other than 100, 500, 2500 and 10000. PancakeV3Pool.initialize writes a protocol fee of 3200 and overrides it only for tiers 100 (3300) and 500 (3400). The module now returns 3200 for every other tier as well. Output for the existing manifests does not change. Package version: 0.1.4.

Protocol fees do not affect quotes. UniswapV3State does not read them.

On-chain check of the protocol fee defaults

SetFeeProtocol emits the previous value. The first event on a pool therefore shows what initialize wrote. Pools that were never changed show it in slot0.

Tier Expected On chain
100 3300 3300 (first SetFeeProtocol on 0x18ab…)
500 3400 3400 (first SetFeeProtocol on 0x6356…)
1800 3200 3200 (first SetFeeProtocol on 0xdd59…)
10000 3200 3200 (first SetFeeProtocol on 0x124b… and 0x0816…)
80 3200 3200 (slot0 of 0xae6c…, never changed)
2500 3200 3200 (slot0 of 0xc6cf…, never changed)

SwapHood's pool code is not identical to PancakeV3Pool. Besides the collectProtocol change (it also accepts calls from a PairFeesV3 contract, 0x626a…6f3c), its setFeeProtocol accepts values above Pancake's 4000 cap. Pools have been set to 8000, 8500, 9000 and 10000. The substreams take these values from SetFeeProtocol, so they are indexed as is.

Testing

  • cargo test -p ethereum-pancakeswap-v3: 6 passed.
  • cargo nextest run -p tycho-execution: 304 passed.
  • integration_test_robinhood_swaphood_v3.tycho.yaml: two cases, each from pool creation to the first swap.
    • WETH/USDG at fee 80.
    • WETH/PONS at fee 1800. This case includes a SetFeeProtocol from 3200 to 10000.
  • Not run yet: the protocols/testing harness. The Docker build failed on network errors.

🤖 Generated with Claude Code

zach030 and others added 3 commits October 12, 2026 14:48
SwapHood V3 is PancakeSwap V3 with two extra fee tiers (80/ts 10 and
1800/ts 50). Reuse ethereum-pancakeswap-v3 through a new
robinhood-swaphood-v3 manifest, UniswapV3State for simulation and the
shared Robinhood UniswapV3Executor for execution.

map_protocol_changes panicked on Initialize for any fee tier outside
100/500/2500/10000. PancakeV3Pool.initialize writes 3200 first and only
overrides it for 100 and 500, so fall back to 3200 like the contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
price_printer and quickstart only list protocols that are live.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Document fee_to_default_protocol_fees as a doc comment, point the
reference link at the 3200 default, shorten the v0.1.4 changelog and
drop its inaccurate claim about SwapHood's pool code, and note the
SetFeeProtocol covered by the fee 1800 integration test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant