cowdao-grants / cow-fee

GNU General Public License v3.0
1 stars 0 forks source link

Allow sending withdraw summary to slack #25

Open fleupold opened 1 month ago

fleupold commented 1 month ago

The withdraw script has been running successfully for the past few weeks, however we currently have very limited visibility into the working and script outputs. The script currently has a few debug prints (without specific line separation) that allow following the execution in terminal (and alert upon failure) but make it hard to build proper reporting around successful passes of the script.

This issue tracks the feature to create a final summary message and either logs it as a single multiline message (so that it can be grepped for in our fluentd with a custom slack redirect rule) or as a general optional slack webhook message directly in the script.

The information that should be included in this message

mfw78 commented 1 month ago

For this, how about instead a simple JS page that:

  1. Enter in the TX hash
  2. Fetch the receipts / logs of the TX hash
  3. Process the logs to retrieve all PreSignature and Transfer events (the latter for the native token)
  4. Display the status of all orders, and the estimated cumulative total from the order's details - and link to the CoW Explorer.

One could also have a "latest" drip that uses an eth_getLogs to fetch the most recent Settlement event, and therefore infer the TX hash to load the data from.

The outcome of this is a simple utility that doesn't further embed things in infrastructure, and displays best practices for DAOs who may be looking to do similar for their treasury - and provides wide open reporting for CoW DAO members to see the activity of harvesting.

mfw78 commented 1 month ago

Some quick ChatGPT: https://gist.github.com/mfw78/1f2c6d926c7496d50b581ab11d01fa7f

fleupold commented 1 month ago

My main concern here is about getting notified that the withdraw happened (I somewhat trust the script but would like our automations to still provide a success summary into the communication channels we use for better visibility).

The extra status site is nice, however I think the actual trades can also be seen by looking at https://explorer.cow.fi/address/0x9008D19f58AAbD9eD0D60971565AA8510560ab41