Commit Graph

13 Commits

Author SHA1 Message Date
Zizou
d766116421 fix: contract creation/update tagging (#117)
* chore: add sfrax to rust fmt ignore

* fix(substreams-sdk): correctly mark contract creation.

Previously we would mark a contract as created if it was created in any transaction in this block. This would lead to some unexpected behavior if the contract was created and updated in the same block but in different transactions. In that case the update would be tagged as creation.

* feat: extract asset types for ng factory

This will allow us to detect pools with rebasing tokens and blacklist them until we can support them in `tycho-simulation`

* fix: correctly index math implementation for twocrypto factory

This implementation is immutable and not dynamic.

* fix: index cryptopool factory

This factory is needed for simulations by pools that have admin fees.

* chore: fix build sfrax abi contract

* Bump curve version

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
Co-authored-by: tvinagre <tvinagre@gmail.com>
Co-authored-by: Thales <thales@datarevenue.com>
2024-12-06 17:59:39 -03:00
Zizou
9e8e360889 refactor(substreams): improve logic to ignore updates (#96)
* refactor(substreams): ignore transaction if contracts update are ignored.

There are some cases where we ignore contracts updates (for example if the old and new values are the same). In that case if the transaction only contains ignored updates we don't emit it.

* refactor(substreams): ignore deletions for freshly created attributes.

There are cases where an attribute can be created and deleted during the same transaction. To avoid sending a confusing deletion for something that was never created before, we just ignore the deletion in that particular case.

* feat(substreams): Add uniswap V3 logs only module (#98)

* feat(substreams): add uniswapV3 logs only Substreams module

* refactor(substreams): encode everything as big endian

* refactor(substreams): mark changes as creation when a tick liq is updated from 0

This will allow the SDK to detect cases where a tick is created and deleted in the same transaction and ignore it.

* ci(substreams): ignore built files for uniswapv3 logs only module and clean code

* refactor(substreams): update uniswapv3 substreams with new SDK interface

* feat(subtreams): emit default token balances value for uniswapv3

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>

---------

Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
2024-11-07 05:16:55 +00:00
kayibal
ac279502c8 chore(balancer): formatting 2024-08-01 12:34:38 +02:00
kayibal
f5b4c54a99 chore: code formatting 2024-07-25 14:11:29 +01:00
kayibal
2eb41d82f0 feat(tycho-substreams): Add builder for TransactionChanges.
This builder allows easier access to already changed contract addresses, and entity attributes while avoiding duplicated entries.

This is needed to implement the update markers on balancer substreams.
2024-07-25 14:11:29 +01:00
Zizou
96f67362bf Merge pull request #37 from propeller-heads/zz/update-protobuf
Update protobuf and Balancer Substreams
2024-07-23 15:19:14 +02:00
Florian Pellissier
c48532a5c4 feat: Update protobuf messages for Balancer, add pool_id and balance_owner as entity changes 2024-07-22 03:48:29 +02:00
Florian Pellissier
e6edcd1fa2 refactor: only include changes if we know call.caller AND the call type is delegatecall or callcode 2024-07-19 14:35:45 +02:00
Florian Pellissier
33e5f6a236 fix(substreams): Fix storage changes indexing for DELEGATECALL 2024-07-19 12:18:58 +02:00
kayibal
e70d5f0e86 Clip balances at 0.
In case we get negative balances, which happens sometimes e.g. in balancer and seems to be due to some rounding issues within the protocol, we simply clip the balance at 0 so we never emit negative balances as tycho-indexer the upstream system will interpret the balance bytes as unsigned integers.
2024-03-14 11:04:41 +00:00
kayibal
6b6e42e2f8 Run rustfmt 2024-03-14 00:27:52 +00:00
kayibal
425628ae97 Create a workspace and make clippy happy. 2024-03-14 00:19:54 +00:00
kayibal
e62cc13c0b Move crates under substreams directory.
This way we can run GHA jobs depending on what files changed.
2024-03-13 23:57:23 +00:00