TX Hooks
Following in the footsteps of Tx Swap's innovative features, we are thrilled to introduce cutting-edge functionality in TX Swap: TX Hooks.
If you've been eagerly anticipating Uni v4's trade hooks, your wait is over. TX Hooks are now live! These hooks empower users to specify Ethereum calls, also known as "inner transactions," that execute atomically before and after a swap on the TX Swap protocol. We offer two types of hooks:
Pre-hooks: These hooks execute at the beginning of the settlement process before the swap occurs. It's important to note that pre-hooks are executed even before verifying an order's signature or transferring sell tokens from the user's account. This enables pre-hooks to be utilized for various purposes, such as:
Using a Safe and performing a SignMessageLib transaction to cover the cost of signing an on-chain order if and only if it gets executed.
Setting the necessary ERC-20 approvals to the TX Swap protocol using EIP-2612 permit, ensuring that approvals are set only if the order is executed.
Unstaking tokens just in time for trading.
Claiming an airdrop right before executing a sell order.
Post-hooks: These hooks execute at the end of the settlement process, once the swap is completed and the trade proceeds have been transferred to the receiver address. Post-hooks can utilize the trade proceeds for further actions, such as:
Bridging the trade proceeds to Layer 2 solutions.
Staking the trading proceeds.
It's worth mentioning that executing hooks incurs additional fees, which are charged in the sell token, similar to regular order execution fees. Therefore, there's no need to hold any special token or extra ETH to make use of this feature.
With TX Hooks, users can enhance their trading experience on the TX Swap platform by seamlessly integrating Ethereum calls before and after swaps, enabling a wide range of possibilities and customization.
Join us now and explore the power of TX Hooks, bringing even more flexibility and control to your trading strategies on the TX Swap protocol!
Last updated