Commit Graph

640 Commits

Author SHA1 Message Date
Louise Poole
d4670d4312 chore: remove duplicate tycho-substreams from cargo.lock (#222) 2025-06-24 13:46:44 +02:00
Zizou
27f178de59 fix(sdk): properly handle deletion -> creation -> deletion sequence (#213)
* fix(sdk): properly handle deletion -> creation -> deletion sequence

This commit resolves a bug that occurred when an attribute underwent a deletion, followed by creation, and then another deletion. The system would incorrectly ignore the final deletion because the attribute was mistakenly marked as newly created during the process.

* docs: fix typo

Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>
2025-06-24 09:41:10 +00:00
Louise Poole
648a3bf419 fix: skip processing balances of bpt tokens (#220) 2025-06-19 16:27:26 +02:00
tvinagre
3f1beeab7c fix: Make get_block_storage_changes public (#214)
* fix: Make get_block_storage_changes public

* Make RpcTraceData caller optional

* feat: Create function to decode list of addresses
2025-06-16 21:40:39 +00:00
Zizou
7da01c745b feat: Balancer V2 DCI integration (#219)
* feat: Add DCI Entrypoints to BalancerV2 components

* fix: miscellaneous fixes before Balancer V2 resync

This commit fixes the entrypoints created by Balancer v2 packages, removes some disabled factories and remove support for BPT tokens (this is still to be investigated but so far we won't be able to support them)

* refactor: fix CI and bump version

* chore: update comments

---------

Co-authored-by: Thales <thales@datarevenue.com>
Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
Co-authored-by: Louise Poole <louise@datarevenue.com>
2025-06-16 11:35:59 +02:00
Louise Poole
de5c9503bc feat: improve test logs (#217)
* feat: improve test logs

* refactor: remove unused code
2025-06-10 10:26:30 +02:00
Zizou
2620a5442d chore: add repository URL to ethereum-maverick-v2.yaml (#212)
* chore: add repository URL to ethereum-maverick-v2.yaml

* chore: bump maverick-v2 version.

This bump is needed because we changed the version of `tycho-substreams` in a previous commit (to fix the bug with contract creation).

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-23 17:21:44 +02:00
Zach
fb0a57bf07 feat: Add Maverick V2 adapter and substreams (#167)
Co-authored-by: Thales <thales@datarevenue.com>
Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-23 17:07:15 +02:00
dianacarvalho1
a7841af383 feat: Add entrypoint utils and define EntryPointParams (#211)
* feat: Add entrypoint utils and define EntryPointParams

#time 23m


#time 0m

* fix: Make TraceData mandatory

#time 2m

* fix: Make component_id in EntryPointParams optional

#time 1m
2025-05-20 17:47:25 +01:00
zizou
7e73061f8e chore: add repository URL to substreams.yaml for ethereum_balancer_v2 2025-05-19 13:49:34 +02:00
Louise Poole
c778e7dee2 feat: extend DCI message structs (#210)
* feat: extend DCI message structs

* chore: add entrypoint params placeholder to transaction builder

* fix: rename call_data as calldata
2025-05-16 11:04:55 +02:00
Louise Poole
b13360c92b fix: change Entrypoint signature type to string (#209) 2025-05-14 15:42:44 +02:00
Zizou
43764fa5cb refactor: update test config to include coins (#208)
* refactor: update test config to include `coins`

* refactor: rename package to `ethereum_curve` and add repository URL in substreams.yaml

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-14 12:37:12 +02:00
dianacarvalho1
edee4b0b6b feat: Add get_block_storage_changes (#203)
* feat: add DCI message definitions

#time 4m

#time 2m

* fix: Make entrypoints into a HashSet instead of Vec

#time 0m

* fix: Rollback on message index change in ContractSlot

#time 5m

* feat: Add get_block_storage_changes

#time 34m


#time 0m

* Update substreams/crates/tycho-substreams/src/block_storage.rs

Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>

* Update substreams/crates/tycho-substreams/src/block_storage.rs

Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>

* fix: Filter out calls that are reverted and sort change by ordinal

#time 0m

* fix: Improve performance of get_block_storage_changes

We expect this util function to collect and handle a lot of information repeatedly (on every single block). So top performance optimisation (both memory and computation) is vital to minimise substream lags.

#time 6m

* fix: Use filter and flat_map instead of if and for loops

#time 1m

---------

Co-authored-by: Louise Poole <louise@datarevenue.com>
Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>
2025-05-14 09:18:07 +00:00
Zizou
e8bde64a23 fix: update tycho-substreams version in all vm packages (#206)
This is needed after https://github.com/propeller-heads/tycho-protocol-sdk/pull/201

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-14 10:57:22 +02:00
Khramtsov Valentin
1442215c91 fix: fix for publish-swap-encoders-package workflow (#207) 2025-05-14 10:57:30 +03:00
Zizou
62b178ad8f feat(curve): add coins in static attributes (#205)
* feat(curve): add coins in static attributes

This will be used by tycho-execution when executing swaps on the pool. It is needed because the `exchange` function takes token indexes and not addresses as input.

* style: make clippy happy with `format!`

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-13 18:57:06 +02:00
dianacarvalho1
2a77cf965c feat: Add entrypoint (#202)
* feat: add DCI message definitions


#time 4m

#time 0m

* feat: Add add_entrypoint to TransactionChangesBuilder

#time 15m


#time 0m

* fix: Make entrypoints into a HashSet instead of Vec

#time 0m

* fix: Rollback on message index change in ContractSlot

#time 5m

* fix: Ignore examples in docstrings when running cargo test

---------

Co-authored-by: Louise Poole <louise@datarevenue.com>
2025-05-13 11:31:36 +00:00
Louise Poole
b13b2b3cc0 ci: also detect cargo files in nested directories (#204) 2025-05-13 13:26:26 +02:00
Zizou
52d502198e fix: stop using buggy account_creations for creation tagging. (#201)
the `call.account_creations` field had been deprecated by Substreams because of some edge cases where a new account wasn't detected.
This commit removes the usage of this field in our sdk contract extraction logic and some others specific places. We decided to rely on the call type instead. This approach should be much more robust.

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-05-13 12:25:14 +02:00
Louise Poole
ee41e63775 feat: Update uniswap v3 package to use big endian encoding (#199)
* feat: update uniswap v3 package to big endian encoding

* chore: update use of format macro to make clippy happy
2025-05-05 13:54:11 +00:00
Louise Poole
01d97193b2 ci: Run substream checks only on changed substream modules (#200)
* ci: run substream checks only on changed substream modules

* ci: move substream package extraction code to a composite action
2025-05-05 15:47:49 +02:00
kayibal
30a6e11363 Fix testing env stup script
- Fails now if any command errors
- Conda environment activation is more stable now
2025-04-30 00:03:08 +01:00
Louise Poole
0f5bbae78c ci: freeze CI cargo version (#197) 2025-04-29 16:53:47 +02:00
Louise Poole
409cf15864 Revert "chore: update format! macro use to satisfy latest clippy version (#194)" (#196)
This reverts commit f29de67f1f.
2025-04-25 18:09:38 +02:00
Louise Poole
f29de67f1f chore: update format! macro use to satisfy latest clippy version (#194) 2025-04-25 15:13:01 +00:00
Zach
9740c92129 chore: update simulation dep (#190) 2025-04-03 09:25:09 +02:00
Louise Poole
97cab90b58 fix: fix script dependency check and paths (#186)
Allows you to run the script from outside of the testing directory.
2025-03-27 16:55:37 +01:00
Zizou
63f9c89429 fix: small fix and refactor after testing EkuboV2 (#188)
* fix: add `balance_owner` attribute for ekubo_v2 components

* refactor: rename `ekubo` into `ekubo-v2`

* refactor: freeze `substreams-helper` version in ekubo V2 module

* docs: improve integration test comment

* docs: add TODO to remove `balance_owner` in favor of `AccountBalances`

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-27 13:45:03 +00:00
die-herdplatte
e4609bed0b Ekubo Integration (#172)
* fix: Implement ethereum-ekubo

* fix: Remove unnecessary store

* fix: Correct balance accounting

* Adjust deltas by fee at PositionUpdated event

* Add partial Ekubo integration

* Generalize Hexable

* Native Ekubo integration

* cargo fmt & clippy

---------

Co-authored-by: kayibal <alan@datarevenue.com>
Co-authored-by: Zizou <111426680+zizou0x@users.noreply.github.com>
2025-03-27 12:29:39 +01:00
Zizou
002d42d100 feat: add Uniswap V2 config for Unichain (#187)
* feat: add Uniswap V2 config for Unichain

* refactor: add URLs for Uniswap V2 config

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-27 10:38:29 +01:00
kayibal
0313c9b498 chore: Publish tycho-substreams to crates.io 2025-03-26 17:47:26 +01:00
Zizou
e0b2977417 feat: Add UniswapV3 config for Unichain (#184)
* feat: Add UniswapV3 config for Unichain

* refactor: add url in UniswapV3 configs

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-26 11:41:33 +01:00
Zizou
7ec5f0fb1f feat: add unichain config for uniswapv4 (#180)
* feat: add unichain config for uniswapv4

* refactor: remove `sf/substreams` from excluded proto.

This folder has been removed because it was not used, so we don't need to have it in the excluded paths anymore.

* refactor: add url into substreams config for uniswap v4 modules

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-25 16:47:55 +00:00
Louise Poole
6acf16a8c6 fix: update tycho indexer testing dep to 0.60.0 (#183) 2025-03-25 17:01:09 +01:00
Louise Poole
494205b859 chore: update testing simulation dependency (#182)
Update to a version that supports account balances
2025-03-21 17:58:25 +02:00
Louise Poole
aa378e6ef5 fix: handle token balances on add_contract_changes (#181) 2025-03-21 11:34:37 +02:00
Zizou
18d8969227 refactor: better attribute name for Pancakeswapv3 module (#179)
Also fixes an issue with inconsistent version tag between cargo and substreams files

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-19 11:50:01 +01:00
Zizou
4c1e773b1b feat: add Pancakeswap v3 Substreams module (#178)
* feat: Add Pancakeswap V3 Substreams module

At this point it's just hard copy of Uniswap V3. It will be adapted in the following commits to make reviewing easier.

* refactor: adapt uniswapv3 module logic for pancakeswap v3

The main change is how they handle protocol fees. Protocol fees are set by default depending on the fee of the pool.

* refactor: use new protobuf structs

The "EntityChanges" got deprecated in favor of the hybrid messages. This commit makes PancakeswapV3 module use the new structs.

* fix: set correct factory address

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
Co-authored-by: Louise Poole <louise@datarevenue.com>
2025-03-17 14:39:05 +02:00
Zizou
503a83595e refactor: remove unnecessary clones in UniswapV3 module (#177)
Also fixes a bug that would lead to emitting wrong balances if there is a `CollectProtocol` event triggered (currently not affecting because it's not enabled)

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-03-13 15:24:48 +01:00
kayibal
d49b3f59cb Add new SwapAdapter interface.
This new interface allos the pool id to exceed 32 bytes. Some protocol have more complex pool ids that exceed 32 bytes this adds support for these.

 Additionally, it allows passing additional data if required. This allows more sophisticated features such as fee reduction or potentially offchain data that is required during swap simulation.
2025-03-11 18:39:32 -05:00
Louise Poole
a61be78007 docs: improve initialized_accounts docs (#175)
* docs: improve initialized_accounts docs

* docs: improve initialized_accounts docs
2025-03-11 12:45:02 +00:00
Louise Poole
ae10195bca chore: remove unused substreams protobuf files (#171) 2025-03-06 12:07:29 +02:00
Louise Poole
f13c1c263b refactor(uniswap_v4): remove costly clone calls (#169)
* Removed costly `TransactionTrace` clones calls and `.clone()` at a few other places

* style: formatting

* chore: bump uniswap v4 versions to 0.2.1

* fix: fix double referencing

---------

Co-authored-by: Matthieu Vachon <matt@streamingfast.io>
2025-03-04 14:51:13 +00:00
Louise Poole
04d14db719 feat: publicly expose protobuf module (#170) 2025-03-04 16:48:14 +02:00
Khramtsov Valentin
dcf7cb94c1 fix: changed on condition for swap encoders (#168) 2025-02-26 16:47:41 +02:00
Louise Poole
20165c271e feat: move initial lp fee to static attributes (#161)
This initial lp fee value is used for generating the PoolKey. It is static and should be part of the ProtocolComponent static attributes.
2025-02-18 15:01:38 +02:00
Zizou
b1e7ba9e2f refactor(substreams): add rust-toolchain to the templates and modules. (#155)
* refactor(substreams): add `rust-toolchain` to the templates and modules.

This freezes the wasm output for each module, allowing us to have full control over each packages and when we break the modules hashes.

* fix(testing): allow no `initialized_accounts` in tests

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-02-17 08:29:07 +00:00
Zizou
6da2141f66 chore(substreams): add base Uniswap v4 config (#157)
Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2025-02-13 14:44:17 +01:00
kayibal
a7e1dd9397 Use tycho-substreams erc20 abi. 2025-02-06 11:04:39 -06:00