Commit Graph

265 Commits

Author SHA1 Message Date
zizou
e064ea7aae fix(substreams-sdk): fix a bug in aggregate_balances_changes that was causing some balance changes loss.
The `aggregate_balances_changes` was keeping a map of token -> balance_change per transaction. Therefore, if a transaction was causing a balance change for the same token but on differents components we would only keep the update for the last component updated and drop the others.
2024-10-25 16:10:14 +02:00
Louise Poole
ef985f5ff4 fix(usv2): correctly encode the component_id in balances 2024-10-25 15:32:26 +02:00
Louise Poole
430375f035 fix(usv2): fix pancakeswap binary path 2024-10-25 15:25:02 +02:00
Louise Poole
09bf076631 chore: update usv2 forks configs 2024-10-25 15:16:13 +02:00
Louise Poole
02227937ad feat(usv2): set default balances on pool creation 2024-10-25 15:15:49 +02:00
Mattia Papa
3013cd9bfd Sfraxeth adapter and substream with SDK integration (#87)
* first commit

* feat: implemented get tokens and improved modifier

* feat: added missing functions (to implement)

* feat: implemented getPoolIds

* feat: implemented getCapabilities

* feat: implemented getLimits function

* fix: fixed constructor

* feat and fix: implemented testGetLimitsFraxEthV3 and fixed getLimits

* feat: implementing getPriceAt function

* feat and fix: finished implementing getPriceAt, fixed modifier

* feat: price function and tests implemented

* fix: removed onlySupportedTokens modifier from getPriceAt and applied it in price and swap function

* feat: implemented sell, buy, and swap functions

* implementing final tests

* aligned with main branch

* fixes

* fix: Review Fixes

* feat: 🎨 sfraxeth substream initial scaffolding

* fix: 🎨 protocol component creation at deployment block

* build: 💚 cargo build

* feat: 🎨 map proper event to balance changes

* fix: 🚚 remove unnecessary files

* fix: 💚 ci checks

Due to the CI checks requiring the latest rust nightly, the rust-lang organisation
introduced new doc related rules. This commit fixes the CI errors by making
the necessary changes to the comments in substreams-balancer comments

* fix: 🐛 wasm output name

* fix: 🐛 update starting block = deployment block -1

* feat: 🎨 add store for reward cycles and update balances accounting after after deposit before Withdraw

* feat: 🎨 finish setting up block reward logic

* docs: 📝 add comments on extra module

* build: 📌 adapt dependencies to workspace dependencies

setting prost-types to workspace version causes build errors

* feat: 🎨 add support for several EVM compatible networks

* fix: 🐛 update balance delta accounting logic following the `NextRewardCycle` event only

* fix: 🐛 hex address string param encoding

* fix: 🐛 deployment transaction check

* ci: 💚 ci check passing

* fix: 🐛 issues with hex-binary encoding

* refactor: ♻️ address mappings for various networks

* fix: 💚 formatting

* feat: Implemented testPoolBehaviour

* chore: Removed unused comments

* feat: ⬆️ update to recent sdk

* feat: 🎨 testing setup

* test:  setup test environminte for sfraxeth

* fix: 🐛 unwrap error in map_protocol_changes

* build: ⬆️ update rust version

* build:  remove unnecessary deps

* build: 🚚 remove unnecessary pb/tycho

* fix: 🐛 remove balance owner attribute

* fix: 🐛 remove unnecessary static attributes

* fix: 🐛 remove manual updates

* fix: 🔥 remove unused data model from contract.proto

* fix: 🐛 filter by known components

* feat:  use store delta for reward change accounting

* refactor: ♻️ remove shallow create vault component

* feat:  replace is_deployment_tx logic with simpler txn match

* test:  manual testing with inspection against etherscan

https://etherscan.io/address/0xac3E018457B222d93114458476f3E3416Abbe38F#events

* ci: 💚 ci checks

* fix: 🐛 map_protocol_components output data

* fix: 🐛 output type on map_protocol_changes

* test: 🧪 skip balance checks

* fixed FraxV3FrxEthAdapter arguments for constructor in manifest.yaml

* fix: 🐛 adapter error with overflow/underflow and addresses

* restore: restored previous adater version

* fix: set minimum swap amount to prevent overflow/underflow

* fix: set minimum swap amount only for sfrxETH -> frxETH

* improve: added print block_number to runner.py when get_amout_out fails

* removed console.log

* alignment with propeller main

* Update forge-std submodule reference to include ds-test

* installed protosim_py 0.21.0

* commented out minimum swap amount for sfrxEth -> frxEth pair

* updated adapter limits

* working on fixes

* fix: Adjust getLimits according to protocol limitation.

Previously limits were estimated with token supplies, this commit simplifies limits and adjusts them so they correspond closely with what is supported by the sfrxETH contract.

* chore: fmt

* wip: Changed ubuntu to 20.04, fmt adapters

* wip: Updated python tests

* wip: Trying with ubuntu: latest

* chore: fmt adapters

* wip: Using ubuntu 20.04

* chore: Switched back to ubuntu-latest

---------

Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: domenicodev <domenico.romeo3919@gmail.com>
Co-authored-by: kayibal <alan@datarevenue.com>
Co-authored-by: domenicodev <domenico.rom3@gmail.com>
2024-10-23 14:17:45 +01:00
Louise Poole
7f262c3994 ci: allow numbers in substream release version tag 2024-10-21 17:56:32 +02:00
Louise Poole
5c38cd6fb3 feat: improve substream release script
Improvements include:
- exit the script if any non-recoverable step fails
- fix bug where cargo version was hardcoded to be detected in balancer package
- allow optional input of substream config file. This is necessary for protocols with forks as they will have multiple configs in one directory
2024-10-17 19:43:07 +02:00
Louise Poole
3c3b5195f7 fix: update uniswap v2 configs and package name 2024-10-17 19:43:07 +02:00
Louise Poole
3639d8d747 feat(uniswap_v2): encode attribute values with big endian encoding 2024-10-17 19:43:07 +02:00
zizou
18f4446344 fix(balancer): index PoolBalanceManaged balance changes 2024-10-17 12:49:03 +02:00
zizou
f602e01942 format(substreams): separate code and imports 2024-10-15 10:15:38 +02:00
zizou
4c448e701a ci: make clippy happy 2024-10-14 18:16:18 +02:00
zizou
6f4c24500b chore(substreams): bump versions and update yaml files 2024-10-14 18:11:53 +02:00
zizou
42f2f45aa7 refactor(substreams): Update ambient Substreams 2024-10-14 18:09:17 +02:00
zizou
aff76f8cc7 chore: fix CI 2024-10-11 14:24:55 +02:00
zizou
050ae59a83 refactor(substreams): refactor uniswapv3 to use tycho-substreams 2024-10-11 14:18:22 +02:00
zizou
d7cc19c4ff refactor(substreams): refactor uniswapv2 to use tycho-substreams 2024-10-11 14:11:19 +02:00
zizou
73d48236ba feat(substreams): add substreams for Uniswap v2 and v3 2024-10-11 14:00:52 +02:00
zizou
c90b190936 fix: correctly handle hexbytes convertion
There was a bug if the value was already a HexBytes that would lead to some tiny changes on the HexBytes, leading to our test being too permissive.
2024-09-06 17:27:31 +02:00
zizou
d0d81fc671 refactor: improve curve static attributes 2024-09-06 17:24:41 +02:00
zizou
4fbdb434c8 docs(curve): add static attr and ongoing task in curve readme 2024-09-06 17:22:29 +02:00
zizou
558d85d912 chore(clippy): ignore long paragraph in generated files 2024-09-06 11:11:03 +02:00
zizou
065c162c5a fix(balancer-susbtreams): fix a bug with pool id in case of Swap event. Also bump the Substreams version. 2024-09-06 11:04:29 +02:00
Florian Pellissier
27768ce114 refactor(balancer-substreams): remove pool_id static attr and use ProtocolComponent.id instead 2024-08-22 10:04:15 +02:00
Zizou
9c140a71af Merge pull request #67 from propeller-heads/zz/sdk/improve-onboarding-process
refactor: make onboarding easier
2024-08-20 11:33:20 +02:00
Florian Pellissier
37f1fbfe04 docs(substreams): miscellaneous docs improvements and update 2024-08-19 11:56:55 +02:00
Florian Pellissier
c218252548 refactor(curve): stateless contracts as state attribute instead of static. 2024-08-15 10:42:06 +02:00
Florian Pellissier
420cf13466 refactor(curve): Remove unnecessary WETH stateless contracts
These contracts became unnecessary because we handle things differently on the Adapter side, we use native eth instead of WETH when possible.
2024-08-13 11:58:21 +02:00
Florian Pellissier
5c25d2fac0 style(curve): Fix CI 2024-08-09 11:24:36 +02:00
Florian Pellissier
bd59af67ed fix(curve): Add weth as stateless contract for CryptoPool with ETH 2024-08-09 11:00:58 +02:00
Florian Pellissier
1f2316713f fix(curve): Update integration tests 2024-08-09 10:39:58 +02:00
Florian Pellissier
6ac29335c7 docs(curve-substreams): Add docs for each tests 2024-08-09 10:39:14 +02:00
Florian Pellissier
d8d7a6d9fd fix(curve): add new missing initialized account and update Tycho binary 2024-08-09 10:39:14 +02:00
Florian Pellissier
388902b2ed fix(curve): index tricrypto2 dependencies 2024-08-09 10:39:14 +02:00
Florian Pellissier
9fa382ea60 refactor(curve): avoid RPC call when possible 2024-08-09 10:39:14 +02:00
Florian Pellissier
65ac765284 refactor(curve): add utils functions on ProtocolComponent 2024-08-09 10:39:14 +02:00
Florian Pellissier
a46e1e4a57 fix(curve): fix sUSD pool 2024-08-09 10:39:14 +02:00
Florian Pellissier
2f0b084cc6 refactor(curve): rename tests 2024-08-09 10:39:14 +02:00
Florian Pellissier
4d528ddab3 fix(curve): fix curve tests after SDKv2 update, also add a few missing tests 2024-08-09 10:39:14 +02:00
Florian Pellissier
95efda0423 refactor(substreams-testing): Use Pydantic to deserialize test_assets.yaml 2024-08-08 17:58:20 -03:00
kayibal
9df366b29d fix(balancer): Change pool_id encoding to utf-8.
Since it is used to replace component_id, it should be a string as well.
2024-08-08 17:58:20 -03:00
Thales
11619bf8be Add initialization-block to tycho runner, fix docker and improve docs 2024-08-08 17:58:20 -03:00
kayibal
ac279502c8 chore(balancer): formatting 2024-08-01 12:34:38 +02:00
kayibal
75b66a85af fix(balancer): Get all balancer tests working. 2024-08-01 12:03:01 +02:00
Florian Pellissier
a6cff51bf6 feat: SDK improvements
Add a way to pull stateless contracts code from node, add more settings to test_assets.yaml, add logic to allow dynamic stateless contract by calling another contract
2024-07-30 16:24:20 +01:00
kayibal
8196d1c3a1 fix(balancer): Add bpt tokens to components.
The pools support swapping in and out of balancer lp positions out of the box. So including the bpt token will likely be useful in the future.
2024-07-29 16:44:38 +01:00
kayibal
bb25ee7f15 WIP: balancer tests 2024-07-25 21:05:48 +01:00
kayibal
f5b4c54a99 chore: code formatting 2024-07-25 14:11:29 +01:00
kayibal
148fac276c feat(balancer): Add rate providers to static attributes.
Adds the rate providers and additional attributes to balancers static attributes. These will help in the future to migrate some of the components to use the DCI.

Adds a small attributes module to tycho-substreams to make json encoding a bit easier.
2024-07-25 14:11:29 +01:00