Sdk implementation: Sfrax adapter and substream (#91)

* feat: initial setup

* feat: implemented getCapabilities and getTokens

* chore: adjusted getPoolIds

* feat: Initial implementation of getLimits()

* feat: implemented getLimits, getTokens and internal functions for amounts

* feat: implemented price

* feat: implemented swap function

* fix and test: fixed minor issues on adapter and setup test

* debugging price function

* fix: debugged price function and fixed getPriceAt function

* test: testOneIncreasingPriceFoundFraxV3SFrax

* fix: debugging and fixing buy function

* fix: fixed getPriceAt

* test: testing post trade price

* fix: Fixed getPriceAt

* fix: Fixed getLimits

* fix: Fixed prices and improved readability

* fix: Fixed price and transfers in swap

* feat: Finished tests

* chore: Changed approve to safeIncreaseAllowance

* feat: created substream for staked frax

* feat: remove useless files

* feat: fixed dependencies in cargo.toml

* feat: rename folder

* feat: updated cargo.lock

* feat: changed lib.rs, added modules.rs

* feat: update modules.rs with corrects addresses

* feat: rename folder in ethereum-sfrax

* feat: remove useless comments, change locked asset address, rename

* feat: undo changes on mod.rs in ethereum-balancer

* feat: rename variable

* feat: update substreams/cargo.toml

* feat: modify ristfmt.toml

* feat: performed code formatting

* feat: modify src/abi

* feat: performed formatting with nightly

* feat: fix addition opeation

* feat: adjust code with for i, f

* feat: performed fmt inside ethereum-sfrax folder

* feat: performed clippy

* feat: fix with clippy warning suggests

* feat: undo any change in ethereum-balancer

* feat: change stakedfrax_contract.rs

* fix: stakedfrax_contract.rs

* feat: add blank line

* feat: add #[allow(clippy::all)] on ethereum-sfrax/src/abi/mod.rs

* feat: update comments on pool_factories.rs

* feat: update cargo.toml and substreams.yaml

* feat: add tycho evm in pb folder

* feat: add params to take contracts' addresses

* feat: add logic to map rewards_cycle

* feat: performed fmt and fix versioning

* feat: remove useless functions

* feat: add logic to track rewards_to_distribute

* feat: passing CI

* fix: substreams.yaml

* feat: fixed params in manifest

Co-authored-by: mrBovo <bovo.ignazio@proton.me>

* feat: fixed error in map_relative_balances function

* feat: passing CI checks

* fix: 🐛 hex-binary address encoding + refactoring vault-> underlying map

* style: 💄 fix formatting

* feat: Implemented testPoolBehaviour

* alignment with propeller main

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

* files update to match propeller/main

* creating integration_test fir sfrax

* fixed FraxV3SFraxAdapter.sol import paths

* updated with correct addresses FraxV3SFraxAdapter manifest.yaml

* updated sfrax manifest.yaml

* updated to support sdk

* integration_test sfrax updated

* fix: 🐛 add reward processing

* chore: ♻️ minor cleanups

* fix: Fixed adapter limits

* fix: fix adapter and substream sdk tests

* fix: Fixed CI errors

* chore: fmt

* chore: Removed unused line

* fix: Fixed clippy warnings

* chore: formatted with rustup

* chore: Removed unused line

* chore: post-build formatting

* chore: Formatting using different toolchain vesion

* chore: 💄 format

* chore: 💄 format 2

* chore: Using static address for frax

* feat: Added second constructor param for sfrax

* fix: Fixed limits on frax sell

* chore: Fixed merge conflict with sfraxeth

* chore: Remove sfraxeth_contract changes

* chore: Fixed EOFs

* fix: Fixed fmt on stakedfrax contract

---------

Co-authored-by: mp-web3 <mp.web3.t@gmail.com>
Co-authored-by: gabrir99 <gabri.ruini@gmail.com>
Co-authored-by: mrBovo <bovo.ignazio@proton.me>
Co-authored-by: Ignazio Bovo <ignazio@jsgenesis.com>
Co-authored-by: mrBovo <bovoignazio.dev@gmail.com>
Co-authored-by: Mattia <mp.web3@gmail.com>
This commit is contained in:
Domenico
2024-10-25 19:53:06 +02:00
committed by GitHub
parent 549ca39d1a
commit e484ea28ca
23 changed files with 8821 additions and 31 deletions

44
substreams/Cargo.lock generated
View File

@@ -233,7 +233,7 @@ dependencies = [
"itertools 0.12.1",
"num-bigint",
"prost 0.11.9",
"prost-types 0.12.3",
"prost-types 0.12.6",
"substreams",
"substreams-ethereum",
"tycho-substreams",
@@ -252,7 +252,7 @@ dependencies = [
"itertools 0.13.0",
"num-bigint",
"prost 0.11.9",
"prost-types 0.12.3",
"prost-types 0.12.6",
"serde",
"serde_qs",
"substreams",
@@ -260,6 +260,26 @@ dependencies = [
"tycho-substreams",
]
[[package]]
name = "ethereum-sfrax"
version = "0.1.0"
dependencies = [
"anyhow",
"ethabi 17.2.0",
"getrandom",
"hex",
"hex-literal 0.4.1",
"itertools 0.12.1",
"num-bigint",
"num-traits",
"prost 0.11.9",
"prost-types 0.11.9",
"regex",
"substreams",
"substreams-ethereum",
"tycho-substreams",
]
[[package]]
name = "ethereum-sfraxeth"
version = "0.1.0"
@@ -723,12 +743,12 @@ dependencies = [
[[package]]
name = "prost"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a"
checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29"
dependencies = [
"bytes",
"prost-derive 0.12.3",
"prost-derive 0.12.6",
]
[[package]]
@@ -768,12 +788,12 @@ dependencies = [
[[package]]
name = "prost-derive"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e"
checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1"
dependencies = [
"anyhow",
"itertools 0.10.5",
"itertools 0.12.1",
"proc-macro2",
"quote",
"syn 2.0.52",
@@ -790,11 +810,11 @@ dependencies = [
[[package]]
name = "prost-types"
version = "0.12.3"
version = "0.12.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e"
checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0"
dependencies = [
"prost 0.12.3",
"prost 0.12.6",
]
[[package]]
@@ -1111,7 +1131,7 @@ dependencies = [
"num-bigint",
"pad",
"prost 0.11.9",
"prost-types 0.12.3",
"prost-types 0.12.6",
"substreams",
"substreams-entity-change",
"substreams-ethereum",