Abacus relayer fee incentivisation implementation and profit/loss dashboard
This project consists of a modification to the Rust based off-chain Relayer for Abacus. Specifically, we:
On the dashboard we show a simple user friendly line chart that shows the net daily profit/loss from running a relayer.
For the fee incentivisation feature we modified the Rust-based Abacus Relayer client using ethers-rs and coingecko API.
For the dashboard we created and deployed two live subgraphs to index the relevant contracts on the abacus network in order to calculate the daily profit (from user submitted fees) and daily loss (from gas expenses sending messages). With the help of the Graph team we were able to overcome some tricky bugs in our code. Unfortunately we ultimately discovered it is not possible to view the gasUsed for a tx on any graph hosted dashboard API versions (we needed this info), and for our use case we needed to index the mainnet contract so the studio was not a viable option.
We ended up indexing the events of the relevant contracts in memory in the frontend using ethers-js and plugging that data into our chart.
We used react and chart.js to create a user friendly chart to showcase the data. We also realized from our data that currently Abacus relayers are losing up to 2 ETH per day just between Optimism to Ethereum (Abacus supports dozens of networks and directions). This data suggests that the Rust client modification is very important for the sustainability of the protocol, and is something we are very open to continue working on after the hackathon.