project screenshot 1
project screenshot 2
project screenshot 3

Abacast

Abacus relayer fee incentivisation implementation and profit/loss dashboard

Abacast

Created At

ETHMexico

Winner of

🥇 Abacus — Best Use

💡 The Graph — 🥇 Best New Subgraph

Project Description

This project consists of a modification to the Rust based off-chain Relayer for Abacus. Specifically, we:

  • Check how much gas has been paid by the user on the origin chain.
  • Convert units of native tokens on the origin chain and destination chain to USD.
  • Calculate the total gas cost for the relayer to send the message to the destination chain.
  • If the relayer will make at least X percentage more than they need to spend on gas to execute the message, then we will execute the message.

On the dashboard we show a simple user friendly line chart that shows the net daily profit/loss from running a relayer.

How it's Made

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.

background image mobile

Join the mailing list

Get the latest news and updates