Files
tycho-protocol-sdk/substreams/ethereum-curve
Florian Pellissier 10a36c0a9b fix: Replace buggy balance extraction with SDK extract_balance_deltas_from_tx
The bug occurred when a Transfer event involved both the sender and recipient being pools. In such cases, the previous implementation only created a BalanceDelta for the "to" address and missed accounting for the "from" address.
2024-07-12 14:59:54 +02:00
..
2024-07-02 17:08:45 +02:00
2024-03-29 14:55:31 -05:00
2024-03-01 14:41:00 -05:00
2024-03-07 17:00:32 -05:00
🎉
2024-05-08 19:35:25 -05:00
2024-06-04 17:13:01 -04:00

Instructions

The run command for our substream is a little different here due to the inclusion of the dynamic parameters for manually admitted pools.

This command will add extra parameters to the map_components module via the python params.py script. This embeds directly in the bash/zsh compatible command here. If python is not ideal, the script can be easily converted into bash but it would require the jq executable (I've used AI to convert it just fine in testing).

$ substreams run -e mainnet.eth.streamingfast.io:443 substreams.yaml map_protocol_changes --start-block 11507454 --stop-block +100 -p map_components=`python params.py`

params.json

This json file is a top-level array containing objects that describe a specific ProtocolComponent. Each object contains the following fields:

  • name: Just for documentation purposes
  • address: The lowercase address of the component
  • tx_hash: The hash of the transaction where the component was emitted
  • tokens: A list of token addresses ordered in the exact same way as the Pool
  • attributes: A nested object of key to value that represents the static attributes of the component.

Please see the included 3 examples for 3pool, steth, and tricrypto2.