Skip to content

Conversation

@dianacarvalho1
Copy link
Contributor

  • It uses the index command of tycho indexer to sync the protocol until now and then stream the live updates
  • Connects to the stream and processes updates
  • Calculates spot prices, limits and get amount out using Tycho Simulation
  • It simulates execution using RPC batched RPC requests
    • Uses router and executor overwrites (so that the executor doesn't need to be deployed)
    • It batches the simulations in smaller chunks. The requests are really big because of the overwrites

Other changes:

  • Using ProtocolStreamBuilder in the state registry instead of TychoStreamDecoder. Then in the ranged test we are just extracting the decoder from the ProtocolStreamBuilder (hacky but it works)
  • In the full test we need to keep track of the ProtocolComponents to simulate in multiple blocks
  • Changed get_current_block to get_block(block_number)

@dianacarvalho1 dianacarvalho1 self-assigned this Nov 14, 2025
@dianacarvalho1 dianacarvalho1 changed the title feat: Update full test to use tycho-test feat: Update full test to use tycho-test and test on stream of updates Nov 14, 2025
@dianacarvalho1 dianacarvalho1 force-pushed the testing-sdk/dc/ENG-4969-full-test branch from 61e277e to 2aba30b Compare November 17, 2025 13:20
Copy link
Contributor

@tamaralipows tamaralipows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Damn this was massive. I have a few small questions for my understanding - the most important is the one about the block delay imo. Overall the refactor itself looks good though!

Comment on lines +212 to +213
"--retention-horizon",
"2024-01-01T00:00:00",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we throw away data older than this? Don't we have block from before this date possibly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure what this retention-horizon means.. I will ask cairoline 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it just means that whatever comes before this date won't be stored in the DB! Not that it won't be indexed, it just wont' be stored!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want this in the case where we are not clearing the DB? For example for the constantly running test? Will that still work as expected?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huuumm no idea tbh 😕 but if we are not clearing the DB it shouldn't sync past blocks.. but yeah if it's a really old protocol we might have issues here

@dianacarvalho1 dianacarvalho1 force-pushed the testing-sdk/dc/ENG-4969-full-test branch from 4409d58 to fec7ee0 Compare November 18, 2025 10:56
- It uses the index command of tycho indexer to sync the protocol until now and then stream the live updates
- Connects to the stream and processes updates
- Calculates spot prices, limits and get amount out using Tycho Simulation
- It simulates execution using RPC batched RPC requests
  - Uses router and executor overwrites (so that the executor doesn't need to be deployed)
  - It batches the simulations in smaller chunks. The requests are really big because of the overwrites

Other changes:
- Using ProtocolStreamBuilder in the state registry instead of TychoStreamDecoder. Then in the ranged test we are just extracting the decoder from the ProtocolStreamBuilder (hacky but it works)
- In the full test we need to keep track of the ProtocolComponents to simulate in multiple blocks
- Changed get_current_block to get_block(block_number)

#time 7h 5m

#time 8m


#time 1m

#time 3m
If true (default), clears the DB and re syncs from start. If not:
- for the ranged test, it skips indexing and uses the current state
- for the full test, it starts syncing from the last block in the db

#time 18m
- Imports at the top
- Remove unnecessary chain_block_time logic
- Fix uniswap v3 integration test by increasing the stop block a bit

#time 2h 37m
@dianacarvalho1 dianacarvalho1 force-pushed the testing-sdk/dc/ENG-4969-full-test branch from fec7ee0 to 4b26d1b Compare November 18, 2025 11:17
Copy link
Contributor

@tamaralipows tamaralipows left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit sus about the retention horizon but I guess we will realize pretty easily if it is broken!

@dianacarvalho1 dianacarvalho1 merged commit 662498e into main Nov 18, 2025
6 checks passed
@dianacarvalho1 dianacarvalho1 deleted the testing-sdk/dc/ENG-4969-full-test branch November 18, 2025 19:01
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.

3 participants