Commit Graph

108 Commits

Author SHA1 Message Date
TAMARA LIPOWSKI
18fa0cc7ad fix: ekubo -> ekubo_v2
This is how it's called in tycho indexer/simulation.
2025-03-31 18:45:36 +02:00
TAMARA LIPOWSKI
b3078f9c7b feat: Support Ekubo callback in TychoRouter
- add integration test
- cannot directly call _handleCallback from the locked method of the tycho router because of bytes memory to bytes callback conversion
- Rename to EkuboPoolKey because of conflict with USV4 pool key

- Bonus: fix bug where input token to swap method must be ERC20 (we should also support ETH)
2025-03-31 17:49:45 +02:00
kayibal
0836bf7d53 feat: switch to tycho_commons 2025-03-27 16:58:34 +01:00
Diana Carvalho
27c9c53889 feat: Add check to don't support cyclical swaps with native actions
Remove unnecessary tests and improve comments

--- don't change below this line ---
ENG-4331 Took 30 minutes
2025-03-13 17:34:50 +00:00
royvardhan
b0e0c6d490 test: update cyclic swap encoding test asserts 2025-03-12 00:49:42 +05:30
royvardhan
ec26890d00 test: add assert in cyclic swap encoding tests 2025-03-12 00:49:42 +05:30
royvardhan
eb4ce40f6e test: add testCyclicSwapUnwrapOutputIntegration in encoder and testCyclicSwapUnwrapOutputIntegration test 2025-03-12 00:49:42 +05:30
royvardhan
525560ea16 chore: cleanup 2025-03-12 00:49:42 +05:30
royvardhan
bd504a8fed test: update test_split_input_cyclic_swap to use usv2 in the last swap 2025-03-12 00:49:42 +05:30
royvardhan
0edc201f06 test: add test_split_output_cyclic_swap in encoder, and testCyclicSplitOutputSwapIntegration integration test 2025-03-12 00:49:42 +05:30
royvardhan
3a6e933ce9 test: fix test_split_input_cyclic_swap and testCyclicSplitSwapIntegration 2025-03-12 00:49:42 +05:30
royvardhan
0a0101cc4d test: add testCyclicSplitSwapIntegration 2025-03-12 00:49:42 +05:30
royvardhan
79d6c020fa misc: fix _swapChecked for cyclic swap, update encoder swap path validation, add cyclic sequesntial swap integration test 2025-03-12 00:49:42 +05:30
TAMARA LIPOWSKI
a4476e0a17 feat: enforce checked amount when encoding to router
- If using the tycho router, you must either set the slippage with the expected amount in the solution, or you must set the checked amount
- Decided to put this in the split swap strategy validator, since this is not relevant when it comes to direct execution (no checks are performed inside the executors)
2025-03-05 15:59:57 -05:00
Diana Carvalho
5c28d77f1d feat: Check min amount out is not zero
Update tests

--- don't change below this line ---
ENG-4286 Took 57 minutes


Took 20 seconds
2025-03-05 17:53:51 +00:00
Diana Carvalho
fedc5043db feat: Deploy to mainnet (again)
--- don't change below this line ---
ENG-4260 Took 22 minutes
2025-02-27 18:01:15 +00:00
Diana Carvalho
3d65ac8cd9 feat: Deploy to mainnet. Update all addresses
--- don't change below this line ---
ENG-4260 Took 27 minutes


Took 10 seconds
2025-02-27 17:25:54 +00:00
Diana Carvalho
9eb4299ffe fix: the key for univ4 fee is key_lp_fee
Update tests with new executor addresses as well

--- don't change below this line ---
ENG-4260 Took 6 minutes
2025-02-27 11:49:03 +00:00
Diana Carvalho
34563c3eb7 feat: Deploy on mainnet
Also update executors.json with uniswap v2 address on mainnet

--- don't change below this line ---
ENG-4101 Took 22 minutes


Took 7 seconds
2025-02-26 09:49:00 +00:00
royvardhan
892726e07b chore: cleanup 2025-02-24 21:41:19 +05:30
royvardhan
bfaa63a1a0 test: fix router tests with new integration calldata 2025-02-24 21:37:40 +05:30
royvardhan
570aa50497 test: fix encoder tests after removing the selector 2025-02-24 20:48:55 +05:30
royvardhan
18efe0305b fix: usv4 integration tests and remove selector from swap/strategy encoder 2025-02-24 19:48:25 +05:30
TAMARA LIPOWSKI
023ae9c1ea chore: merge main 2025-02-21 09:48:22 -05:00
TAMARA LIPOWSKI
a7aa4d7ebb fix: Native ETH input/output integration tests/fixes
- Only for single swaps
- Used USV4 for this because it's the only DEX we support that allows native ETH swaps
- For Native ETH input single swaps, we need to properly check the remaining amount (we were treating them wronly like ERC20 tokens)
- For Native ETH output single swaps, we were passing the incorrect currency (the settle always needs to be the out token and the take always needs to be the in token, this should not depend on the zeroForOne value).
2025-02-21 00:23:24 -05:00
Diana Carvalho
20e6419a20 feat: Adapt SplitSwapStrategyEncoder to have optional permit2 logic
- If the signer_pk is not passed -> use the swap method that expects the tokens to be already in the Router
- If it is passed -> compute permit2 and use swap method that does the token in transfer
- Extend builder to have another shortcut
- Add integration test with contract
- Update bin (and simplified it) and quickstart

--- don't change below this line ---
ENG-4255 Took 1 hour 51 minutes

Took 2 minutes

Took 7 seconds
2025-02-20 18:29:11 +00:00
TAMARA LIPOWSKI
2c92596681 chore: merge main 2025-02-20 12:33:59 -05:00
TAMARA LIPOWSKI
447195a4a8 test: fix test after latest changes 2025-02-20 12:26:17 -05:00
TAMARA LIPOWSKI
d65d575003 feat: Don't encode min amount for USV4
We aren't checking min amount for any other executor. This would be overkill (since we are already checking in the main router) and also inconsistent.
2025-02-20 12:15:40 -05:00
royvardhan
29bc662ba9 refactor: use chain and protocol component from tycho_core::models 2025-02-20 22:36:50 +05:30
TAMARA LIPOWSKI
9eda00cbb6 chore: PR comments 2025-02-20 11:51:08 -05:00
TAMARA LIPOWSKI
bb8778b2bf chore: merge main 2025-02-20 11:45:18 -05:00
TAMARA LIPOWSKI
45fdfc708d feat: UniswapV4 integration test and fixes
- Biggest issue: We must encode the executor address, not the router address, in the USV4 swap encoder
2025-02-19 18:12:11 -05:00
TAMARA LIPOWSKI
81c8a04cbb fix: Pass proper group tokens in EncodingContext...
Also:
- Remove amount_out_min. Our reasoning is that we perform high-level final amount checks anyway (and expect users to do the same). Lower-level USV4 min amount checks are redundant.
2025-02-19 16:27:56 -05:00
TAMARA LIPOWSKI
c3482a509a feat: TychoRouter swap method not requiring Permit2
- Assume the tokens have been transferred into our router beforehand.
2025-02-19 16:15:57 -05:00
Harsh Vardhan Roy
6c4bb376fd Merge branch 'main' into router/hr/ENG-4239-usv4-swap-encoder 2025-02-20 00:07:43 +05:30
royvardhan
c472cda697 refactor: make group tokens and amount out min non optional 2025-02-20 00:05:47 +05:30
Diana Carvalho
4f29022c42 fix: After rebase fixes
--- don't change below this line ---
ENG-4246 Took 2 minutes
2025-02-19 17:05:46 +00:00
Diana Carvalho
d9d56e7a8c chore: Rename signer_pk to swapper_pk
--- don't change below this line ---
ENG-4246 Took 15 minutes
2025-02-19 17:03:25 +00:00
Diana Carvalho
30b5ab9025 fix: After rebase fixes
Put the strategy_encoders.rs back inside the strategy_encoder directory

--- don't change below this line ---
ENG-4246 Took 3 minutes

Took 12 seconds
2025-02-19 17:03:22 +00:00
Diana Carvalho
03506fabe9 feat: Create a EVMEncoderBuilder
- It has two three methods to be created:
  - new: where the user can pass any custom StrategyEncoder
  - tycho_router: where the default SplitSwapStrategyEncoder with Tycho Router will be used
  - direct_execution: where the user can encode only the execution data and integrate this into their workflow.
- This replaces StrategyEncoderRegistry
- EVMTychoEncoder holds directly the StrategyEncoder and not the registry (per one init of the EVMTychoEncoder there is only one possible StrategyEncoder)
- Update quickstart
- Update bin (add subcommands to bin to create a different instance of EVMEncoderBuilder)

--- don't change below this line ---
ENG-4246 Took 33 minutes

Took 38 seconds

Took 38 seconds
2025-02-19 17:03:10 +00:00
royvardhan
7f3aca90ba fix: update EncodingContext in strategy_encoder 2025-02-19 21:50:43 +05:30
Harsh Vardhan Roy
78bc045d14 Merge branch 'main' into router/hr/ENG-4239-usv4-swap-encoder 2025-02-19 21:45:30 +05:30
TAMARA LIPOWSKI
5ab233ed0a refactor: PR comments
- rename utils.rs to group_swaps.rs
- extend instead of push in order to avoid calling abi_encode_packed again
2025-02-19 10:25:16 -05:00
royvardhan
5b183b6690 chore: update executor_selector to swap_selector in swap encoder trait and attribute 2025-02-19 19:01:32 +05:30
royvardhan
1bfe656e6b feat: add new attributes in encoding context, update usv4 swap encoder and tests 2025-02-19 08:39:21 +05:30
TAMARA LIPOWSKI
ac831176d4 feat: Support swap grouping for executor strategy
- Also make sure the strategy errors if > 1 group.
2025-02-18 14:03:06 -05:00
TAMARA LIPOWSKI
962e460e34 refactor: Make group_swaps a util method
- In preparation for also using this for the executor encoder.
This also make test setup much easier for swap grouping - not having to init the encoder every time.
2025-02-18 12:12:08 -05:00
TAMARA LIPOWSKI
8f1e372c90 refactor: PR comments (moving things around/docs)...
- Move the validator into its own file, for organization purposes.
- Add missing elements to `SplitSwapStrategyEncoder` docstring
2025-02-17 23:57:01 -05:00
TAMARA LIPOWSKI
44aabf1761 feat: Merge USV4 strategy back into split strategy
- Since the group_swaps method is now generalized, there is no need to have an entirely separate method here.
2025-02-17 23:44:58 -05:00