* feat: update balancer v2 spkg to make it return old slot values
This is needed for the new DCI version that uses old values to look into exactly what part of the slot change and compare with the retrigger offset
* refactor: use crate registry instead of github
---------
Co-authored-by: zizou <111426680+flopell@users.noreply.github.com>
* feat: Pass adapter contract to decoder
This was the most elegant solution we could come up with at the moment for having the proper adapter in the builder.
Notes:
- The default adapter bytecode in tycho-simulation is still loaded at compile time.
- If the adapter bytecode is passed to the decoder, it will be loaded dynamically at runtime and used instead the bytecodes in tycho-simulation.
- The adapter bytecode is used in the builder to get capabilities and thus spot prices before returning the state, so just overwriting the adapter in the state is way too cumbersome. We went with this solution since it was the lesser evil, even though we know it leaks VM-specific info to non-vm protocols (which was already being done anyway with the balances).
* feat: Take a struct of vm_attributes instead of just adapter path
So that we don't need to change the interface in the future
* chore: remove comment - we are no longer blocked
This is fixed with the latest change to pass adapter contract to decoder
* feat: Use DecoderContext instead of VMAttributes
- More easily extendable
- Doesn't break the existing decoder interface
---------
Co-authored-by: TAMARA LIPOWSKI <data.lipowski@extaccount.com>
* Add Ekubo TWAMM support
* Change order of words
* Account TWAMM order balances
* Fix tracking wrong component balance deltas
Swapped and PositionUpdated are the only events affecting pool TVL
* Fix fee addition
Fees are a .64 instead of a .128 since v2 & the result is rounded
* Consistent naming
* cargo fmt
* Add method for selecting store method from change type
* Only store the affected sale rate delta on OrderUpdated events
* Remove unnecessary parameterization
* Index Ekubo MEV-resist pools
* cargo clippy
* feat: update tycho-client and support testing DCI enabled protocols
* refactor: improve python Typing
* test: update test suite tycho-simulation dependency
The updated version includes an account_balances fix.
* refactor: use sets instead of lists
* feat: update tycho-client test dependency
* feat: Initial manifest structure
* feat: Adapter initial development and price function implementation
* feat: Implemented getPoolIDs
* feat: Implemented getTokens
* feat: Implemented getCapabilities
* feat: Implemented getLimits
* feat: Implemented swap
* feat: Created Adapter version for CurveV2 pools uint256
* fix: Review Fixes
* chore: Formatted code and code adjustments
* feat: Separated contracts and finished tests for Curve Exchange(Crypto and StableSwap)
* feat: Adjusted naming and formatted tests code
* chore: Initial merging of swaps
* merge CurveCryptoSwapAdapter and CurveStableSwapAdapter into CurveAdapter
* Fix and Test: fixes on CurveAdapter.sol and created CurveAdapter.t.sol
* review and fixes
* removed unused test and parameters
* chore: Initial MetaPool underlying swap and ETH native implementation
* chore: expanded swap and sell functions to support seap for underlying tokens and LPS
* chore: expanded functionalities of CurveAdapter and fixed getTokens function
* fix: fixed registry.is_meta
* chore: fixes
* chore: extended adapter and implementing tests for new pools
* chore: updated Adapter, implementing final tests
* fixing eth transfer
* fix and tests: fixed adapter and finishing tests implementation
* using adapter with try catch
* feat: Final fixes for pools support, using try-catch
* chore: Removed chunk files
* chore: Formatted code and removed unused condition
* fix: Fixed calculatedAmount in sell function when receiveToken=ETH
* chore: Adjusted ETH pools check
* corrected metaregistry address
* fix: fixed int128 conversion to unit256
* feat: Removed registry from adapter
* feat: Implemented price()
* fix: Propeller review fixes
* review fixes
* fix: Final fixes for custom custom int128 pools
* chore: Removed unused test
* fix: Fixed price error in custom pools
* feat: Improved isInt128Pool function to support any coin
* fix: Fixed price for custom pools using ETH balance when token0 is WETH
* fix: Fixed price function and added AdapterTest support in test
* fix: Fixed divisions in getPriceAt
* feat: Added secondary ETH pool support, e.g. stETH
* refactor(curve-adapter): Avoid calling WETH contract if possible. (#65)
* refactor(curve-adapter): Avoid calling WETH contract if possible.
This PR aims to use native ETH instead of WETH when possible, this is to avoid having to index WETH contract.
* style(adapter): apply `forge fmt`
* refactor(curve): change limit factor to 2
---------
Co-authored-by: Florian Pellissier <111426680+flopell@users.noreply.github.com>
* refactor: fix Curve Adapter test after rebase
* fix: remove PriceFunction capability for Curve
This was wrongly implemented: it return the price for a quote and not the marginal price after the swap.
* refactor: improve adapter test and fix failing test for etherfi
---------
Co-authored-by: domenicodev <domenico.romeo3919@gmail.com>
Co-authored-by: mp-web3 <mp.web3.t@gmail.com>
Co-authored-by: Zizou <111426680+zizou0x@users.noreply.github.com>
Co-authored-by: Florian Pellissier <111426680+flopell@users.noreply.github.com>
Co-authored-by: Diana Carvalho <diana@propellerheads.xyz>
* feat: add balancer swapAdapter and Substreams
* fix: undo tycho-substreams logs, ignore abi on rustmft
* ci: prevent warnings from failing CI
* ci: skip size check on CI
* chore: forge fmt
* feat: vault balance from storage
Vault contract tokenBalance message are set according to the vault
storage changes in the `_reserveOf` storage variable VaultStorage.sol
contract
This was the culprit that caused the failure in simulation since
balancer enforces the invariant that `token.balanceOf(vault_addr) == _reservesOf[token]`
* ci: warnings
* fix: avoid duplicated balance changes
* fix: order by ordinal
* chore: format
* feat: extract new contracts before extracting balance changes
* feat: skip unnecessary steps if no balance change is found
* refactor: filter out account balances for tokens that aren't part of any protocol components.
On the indexer side, when we receive an account balance, we need to know about the token. This commit ensure that the token was introduced before we emit any account balance with it.
* refactor: don't index liquidity buffers.
Liquidity buffers rely on rate providers. Therefore we need DCI (feature to be able to index previously created contract) to deal with them.
* refactor: cleanup tests and add docstrings
* chore: lock tycho-substreams version
* ci: set Foundry workflow to use stable foundry
* feat(DCI): Add DCI Entrypoints to BalancerV3 components (#218)
* refactor: fix typo in weighted_pool_factory_contract name
* feat: add rate_providers static attributes
* feat: add DCI entrypoints to BalancerV3 components
* fix: set default trade price to Fraction(0, 1)
* feat: remove buffers as components
Buffers are to be used internally by Boosted pools (stable/weighted pools that use ERC4626 tokens). They are not to be treated as a separate swap component.
* test: update test blocks
Extend tests some tests block range to ensure liquidity was added to the pool and can be simulated on
* feat: remove buffers as components
Remove balance updates for buffer components
* feat: listen for pool pause/unpause events
* chore: formating
* fix: encoding call data
* test: update Balancer V3 tests to use DCI
* test: set indexer log level to info
* docs: add comment on support of boosted pools
* feat: update balancer v3 package version
---------
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>
Co-authored-by: Louise Poole <louisecarmenpoole@gmail.com>
* 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>