Hi Ethereum folks,
We have been working on mitigating the arbitrage risk in a HTLC-based Atomic Swap, which is called the “free premium problem”, where the initiator can abort the deal (i.e. have optionality) without any penalty. For detailed explanation on “free premium problem”, see https://blog.bitmex.com/atomic-swaps-and-distributed-exchanges-the-inadvertent-call-option/.
We analysed how profitable the arbitrage can be given the default timelock setting (24/48 hrs). Our result shows that the profit can be approximately 1% ~ 2.3%, which is non-negligible compared with 0.3% for stock market. This can be attractive as it’s totally risk-free. Please refer to our paper https://eprint.iacr.org/2019/896 (which gets accepted in ACM AFT’19), and the related code GitHub - fair-atomic-swap/fair-atomic-swap: On the optionality and fairness of Atomic Swaps if interested.
Several studies have proposed for solving this problem. Their basic idea is that, the transaction for the premium needs to be locked with the same secret hash but with a flipped payout, i.e. when redeemed with the secret, the money goes back to Alice and after timelock, the premium goes to Bob as a compensation for Alice not revealing the secret. However, this introduces a new problem: Bob can get the premium without paying anything, by never participating in.
Therefore, we bring up atomic swap smart contracts for a more fair version. We explore the Atomic Swaps under both Spot scenarios and American Call Options scenarios. See repo/tree/master/src/atomicswap/ethatomicswap/contract/src/contracts for details.
- The RiskySpeculativeAtomicSwapSpot.sol is an simple atomic swap smart contract. Without premium, the initiator can actually arbitrage the fluctuations on price, making profit with no risk.
- The RiskySpeculativeAtomicSwapSpot.sol is the premium version for Spot scenarios.
- The RiskySpeculativeAtomicSwapOption.sol is the premium version for American Call Options.
We hope our work can make more people in the community aware of such a “free premium problem”, and have an fair implementation to refer to. Besides, our protocol can easily support option derivates DEXs.
So we are here proposing EIP-2266 EIPs/EIPS/eip-2266.md at master · ethereum/EIPs · GitHub. We really look forward to your feedback.
Regards,
HAOYU