Commit Graph

276 Commits

Author SHA1 Message Date
Tamara
e2be13521b Merge branch 'main' into encoding/tnl/fix-ekubo-grouping 2025-04-03 11:45:14 +02:00
TAMARA LIPOWSKI
b4c687bc3f fix: Proper ekubo protocol name in GROUPABLE_PROTOCOLS 2025-04-03 11:09:31 +02:00
Tamara
3a42059598 Merge branch 'main' into router/tnl/deploy-unichain 2025-04-03 10:53:31 +02:00
Diana Carvalho
5336969df8 fix: Fix tests after cherry picking
--- don't change below this line ---
ENG-4411 Took 1 hour 9 minutes

Took 18 minutes
2025-04-02 16:13:58 +01:00
Diana Carvalho
6cdca8381e feat: Fix rollFork usage for Ekubo test
- Created methods to deploy the router and the executors. Whenever we use rollFork we need to redeploy everything! Notice that the addresses will be different then!
- Created a test_executor_addresses.json to be used in the encoding tests, this way the calldata for the integration tests is already correct and we don't need to do any manual replacing (this was annoying). The addresses in this file match with the addresses used in the solidity tests

--- don't change below this line ---
ENG-4411 Took 1 hour 9 minutes

Took 28 minutes


Took 4 minutes

Took 45 minutes
2025-04-02 16:13:58 +01:00
TAMARA LIPOWSKI
4878229e1d fix: Set native and wrapped tokens for Unichain 2025-04-02 16:06:26 +02:00
TAMARA LIPOWSKI
d05e1183d4 feat: Unichain deployment 2025-04-02 15:49:08 +02:00
TAMARA LIPOWSKI
1f6f1a4236 feat: Add router_address to cli 2025-04-02 12:02:56 +02:00
TAMARA LIPOWSKI
c336a28905 feat: Support manual router address setting in builder 2025-04-02 11:24:31 +02:00
TAMARA LIPOWSKI
b397ddd2be fix: fix Solution.router_address for Ekubo 2025-04-02 11:24:12 +02:00
TAMARA LIPOWSKI
8865e22116 feat: Make EncodingContext.router_address optional 2025-04-02 11:24:04 +02:00
TAMARA LIPOWSKI
d5c589d2c0 feat: Remove router_address from Solution, set default
- The router address can be set when creating the SplitSwapStrategy, which now takes an Option<Bytes> as input during initialization (another breaking interface change)
- This change allows us to change our router address in the future with minimal effect on the users. Users should only pass the router address in the split swap initialization if they intend to use their own router for execution.
- This change also means that the router address does not need to be passed with the solution, even when using the executor strategy (which was pointless).
- I thought of having a router_address() method to set this in the encoder builder - but it seemed too messy, since we don't need the router address for execution for example. We would then potentially unnecessarily load and set the default router address when not needed. It is also not even used at the highest level EVMTychoEncoder, so it makes more sense for it to be directly associated with the swap strategy instead.
- Users will now not be able to encode for different routers without re-initializing the strategy. We assumed this use case to be very rare and not worth supporting.
2025-04-02 11:18:30 +02:00
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
6c35f114e3 fix: ekubo -> ekubo_v2
This is how it's called in tycho indexer/simulation.
2025-03-31 18:38:44 +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
Tamara
414a9609ec Merge branch 'main' into router/tnl/ENG-4409-pancake-v3-callback 2025-03-31 17:44:27 +02:00
die-herdplatte
485e5fd13e Merge remote-tracking branch 'upstream/main' into ekubo 2025-03-29 10:31:33 +01:00
kayibal
379858bfca fix: Handle unichain chain id 2025-03-27 16:58:34 +01:00
kayibal
0836bf7d53 feat: switch to tycho_commons 2025-03-27 16:58:34 +01:00
Tamara
db752f9222 Merge branch 'main' into ekubo 2025-03-27 15:54:34 +01:00
die-herdplatte
47d96c2347 Add integration test 2025-03-26 16:50:03 +01:00
die-herdplatte
92b5a8adb5 Remove split check 2025-03-26 12:15:50 +01:00
TAMARA LIPOWSKI
9accc84346 docs: Clarify validation criteria for cyclical swaps 2025-03-26 09:56:44 +01:00
die-herdplatte
261e2b2091 Merge remote-tracking branch 'upstream/main' into ekubo 2025-03-26 08:25:37 +01:00
TAMARA LIPOWSKI
fa024a4a67 feat: Add PancakeSwapV3 support to encoding
- Add deployed executor address to json
- Build proper encoder for pancake v3
- Increase gas limit when setting executors (costs more since we set one more)
- Fix json filename in scripts/README.md
2025-03-25 17:50:25 +01:00
TAMARA LIPOWSKI
1ed149a9b8 fix: Remove pancakeswap V3 from approved executor addresses
- Our router does not properly support pancakeswap.
2025-03-20 12:40:03 -04:00
TAMARA LIPOWSKI
783712be5d feat: Set v2/v3 executor addresses on ethereum
- Also fix router address env name in readme
2025-03-20 12:40:03 -04:00
die-herdplatte
9e6af4b99f cargo fmt & clippy 2025-03-20 14:18:15 +01:00
die-herdplatte
ce7362ef24 Error on unsupported options 2025-03-20 14:17:20 +01:00
die-herdplatte
af5742550f Add encoder tests 2025-03-20 11:27:06 +01:00
die-herdplatte
e954bc7e59 Fix attribute name 2025-03-20 11:26:52 +01:00
die-herdplatte
05d6286921 Merge remote-tracking branch 'origin/main' into ekubo 2025-03-20 09:59:19 +01:00
die-herdplatte
3c982c5824 Ekubo integration 2025-03-20 09:58:40 +01:00
TAMARA LIPOWSKI
d644b63851 fix: Slippage precision calculation
- The resolution wasn't high enough before, so 0.1% slippage would round to 0% slippage. We should instead use basis point resolution to overcome this.
2025-03-18 21:29:38 -04:00
Diana Carvalho
e96bcdfd0f fix: Add individual tests for each case
(split output and native action)

--- don't change below this line ---
ENG-4331 Took 6 minutes
2025-03-14 11:30:19 +00: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
Diana Carvalho
0aba7edf83 fix: In test asset, use 0 for the last split, and not 0.5
--- don't change below this line ---
ENG-4331 Took 5 minutes
2025-03-13 16:50:39 +00:00
Diana Carvalho
f62a9d28c0 feat: Add validation for cyclical trades
We only support cyclical trades when the repeated token is the first and the last token in the swap. We don't support cycles in between

--- don't change below this line ---
ENG-4331 Took 2 hours 4 minutes

(cherry picked from commit 55ffa4eb45)

Took 5 minutes


Took 2 minutes
2025-03-13 16:30:54 +00:00
Diana Carvalho
3d7dcef1bd Revert "feat: Add validation for cyclical trades"
This reverts commit 55ffa4eb45.

Took 5 minutes

Took 2 minutes

# Commit time for manual adjustment:
# Took 2 minutes
2025-03-13 16:26:06 +00:00
Diana Carvalho
55ffa4eb45 feat: Add validation for cyclical trades
We only support cyclical trades when the repeated token is the first and the last token in the swap. We don't support cycles in between

--- don't change below this line ---
ENG-4331 Took 2 hours 4 minutes
2025-03-13 16:13:28 +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