14 Commits

Author SHA1 Message Date
Diana Carvalho
5eb9973dbd feat: Add estimated_amount_in to Swap. Add SwapBuilder
Use SwapBuilder everywhere inside crate
Integration tests will be done later

--- don't change below this line ---
ENG-4696 Took 1 hour 56 minutes

Took 4 minutes
2025-08-13 18:05:17 +01:00
TAMARA LIPOWSKI
c217702560 feat: Add protocol state to Swap object
- This consists of lots of necessary battles with lifetimes.
2025-07-22 12:13:39 -04:00
Diana Carvalho
eec50f8822 feat: Extend Swap to hold user_data: Option<Bytes>
Took 25 minutes
2025-06-05 15:47:40 +01:00
Diana Carvalho
73c1a2db6a chore: Rename selector to function signature
Took 8 minutes
2025-05-27 09:37:24 +01:00
Diana Carvalho
c62af2f232 feat: Don't sign permit2 objects
We don't want to be responsible for holding private keys -> the user is the one that should do this outside of tycho-execution

Done:
- Remove signature from EncodedSolution
- Introduce UserTransferType and pass that everywhere instead of is_permit2_active and token_in_already_in_router
- Remove signing from permit2. Added it to the encoding_utils.rs only
- Mark encode_full_calldata as deprecated
- Backwards compatibility: still accept a signer for the encode_full_calldata case
- Update all tests

Took 2 hours 10 minutes


Took 13 minutes
2025-05-26 12:50:11 +01:00
Diana Carvalho
facdf716bd feat: Add interacting_with to EncodedSolution
- Remove encode_full_calldata from the TychoEncoder trait
- Make the TychoExecutorEncoder use encode_solutions instead of encode_full_calldata
- Update tycho-encode.rs accordingly

Took 1 hour 3 minutes


Took 12 seconds
2025-05-22 14:43:12 +01:00
Diana Carvalho
08056c4a6c feat: Remove slippage and expected_amount from Solution
The user is responsible for coming up with a sensible value for this themselves

Took 37 minutes
2025-05-22 14:43:12 +01:00
Diana Carvalho
35441456ac Merge branch 'refs/heads/main' into feature/gas-optimization
# Conflicts:
#	foundry/test/TychoRouter.t.sol
#	src/encoding/evm/strategy_encoder/strategy_encoders.rs
#	src/encoding/evm/utils.rs

Took 3 minutes

Took 35 seconds
2025-04-23 12:30:46 +01:00
Diana Carvalho
8b4b79b353 feat: Refactor TychoEncoder
We have a trait TychoEncoder and then two implementations: TychoRouterEncoder and TychoExecutorEncoder.
This way we go a level above with the decision if it is a direct execution or if it should use the tycho router.

- Created two builders: one for each tycho encoder
- Delete ExecutorStrategyEncoder and move code straight into the TychoExecutorEncoder
- Add validate_solution to trait TychoEncoder
- Move group_swaps.rs a level up
- Update tests and usage cases

Doing this we get rid of all that weird stuff we were doing before

--- don't change below this line ---
ENG-4306 Took 2 hours 6 minutes


Took 12 seconds
2025-04-23 12:30:13 +01:00
Diana Carvalho
c0b50c0661 fix: Add empty dicts for unichain and base in config
Also fix example: we need a checked amount or slippage set now

--- don't change below this line ---
ENG-4332 Took 6 minutes
2025-04-08 16:18:44 +01: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
kayibal
0836bf7d53 feat: switch to tycho_commons 2025-03-27 16:58:34 +01:00
Diana Carvalho
6f572eed01 feat: Rename shortcut methods of encoder builder
Also moved executors_file_path to be an independent attribute

--- don't change below this line ---
ENG-4286 Took 19 minutes
2025-03-03 12:59:42 +00:00
Diana Carvalho
36d2f23fba docs: Clean up readme and rename quickstart->encoding example
--- don't change below this line ---
ENG-4261 Took 17 minutes
2025-02-28 09:57:06 +00:00