airswap / airswap-protocols

AirSwap Contracts and Tools
https://about.airswap.io/
MIT License
231 stars 94 forks source link

Improvement, add info in the SwapERC20 event to track the exchange ratio of pair. #1341

Open Jason-Zhangxin-Chen opened 4 days ago

Jason-Zhangxin-Chen commented 4 days ago

Hi, is it possible to add such info in the SwapERC20 event, thus that we can track the orderbooks and aggregate the exchange ratio of pairs from airswap network easily?

emit SwapERC20(nonce, signerWallet, signerToken, signerAmount, senderToken, senderAmount);
dmosites commented 4 days ago

Hello, this info was removed from the event log to improve gas efficiency. It can be derived from Transfer events on the same transaction, which is done for example in getFullSwapERC20 available in @airswap/utils. https://github.com/airswap/airswap-protocols/blob/develop/tools/utils/src/swap-erc20.ts#L354

Jason-Zhangxin-Chen commented 3 days ago

Thank you so much, @dmosites. Just a few more questions: