Atomic Liquidation and Other Actions via 1-time Hooks 4 Sale on Uniswap V4
Watchtower, a novel protocol for atomic price action triggered interventions. Uniswap V4 Hooks have allowed this protocol to react to price changes caused by executions of swaps. The reactions are atomic first-in-line without a possibility for anyone to intercept and front-run the reacting transaction.
Watchtower allows for anyone to permissionlessly subscribe to desired price actions caused by swaps and and take advantage of the prompt atomic actions as desired. Such actions can be delinquent loan liquidations, limit orders, undercollateralized option and/or derivative liquidations and many other use cases.
The implementation was facilitated by our One-time Hooks, which can be attached and detached dynamically to Uniswap V4 pools.
Watchtower has an economic incentive model that is beneficial to all parties involved.
Pure Solidity to implement an elaborate Uniswap V4 hook that can manage dynamic "hooks".
How does this work?
In order to act on-chain, someone needs to initiate the contract call. This is not done by keepers, but by swap
callers on Uniswap V4. Unknowingly they can cause action trigger calls, which does not cost them anything and they are
rewarded for this as well. The user simply visits the Web3 front end of Uniswap V4. As soon as they ask for a swap,
the Uniswap V4 calculates a route for the most efficient execution of the swap. Multiple pools can be used, but almost no pool is left behind, as if that happens, the pool in question remains behind with a more favorable price and it becomes even more attractive.
This is achieved via an Uniswap V4 Hook, attached to one of the above described pools. This hook can be used by multiple pools, as many as one would want. However this hook is quite complicated. As Uniswap V4 hooks are permanently attached to the pools, this hook: