Staker.app Just Got Cheaper & Faster⚡

Sam Presnal
Staker
Published in
3 min readJul 28, 2021

--

Cheaper Transactions

With the help of the newly built Staker Smart Relayer, we were able to bring user transaction broadcasting and replaying in-house. This allowed us to substantially reduce the footprint of all Staker.app transactions.

Reduction in median transaction gas used 🚀

Shown above, is the before and after median gas used for various user transactions. The average reduction is approximately 25%, which directly reduces the total cost of gas fees for users.

Faster Transactions

The reduction in gas used, in combination with the Staker Smart Relayer, allowed us to migrate all user transactions from a split slow-pool/fast-pool to all fast-pool, which in turn results in a better overall experience. On average, user transactions now complete within 2.5 minutes, approximately a 60% reduction in execution time.

Reduction in median transaction seconds executing

Staker Smart Relayer 🤖

Previously, we were using a 3rd-party service to deliver user transactions. We replaced this service with a richer and more robust relayer that offers a lot of advantages including the ability to extend support to PulseChain.

To explain the upgrades, things may get a bit technical…

Staker Gas Oracle

All ‘smart’ things start with a good source of raw data. We collect the information from all transactions in the latest blocks and process them.

Process Steps

  1. Retrieve and store
  2. Feed transactions to machine learning model
  3. Forecast next 30-minutes gas prices
  4. Adjust user gas price according to forecast and latest price
Visualization of forecast bounds and various gas speeds

Staker Relayer

The relayer is a continuously running application that checks the status of pending user transactions and updates or rebroadcasts them if necessary. Two conditions can trigger a rebroadcast — the gas price (provided by the Staker Gas Oracle) having increased since latest execution or max execution duration having been exceeded.

To start, the transaction is broadcast at ‘fast’ speed. If the transaction does not complete within the specified max execution duration of 5 minutes, it will be broadcast at the next gas price tier, ‘instant’. This continues until the transaction is accepted.

Transaction relay high-level overview

The Staker Smart Relayer comes at no extra cost to users. The intention of the relayer is to offer the best gas price and faster transactions while still preventing stuck or dropped transactions.

This significant upgrade is just the beginning. We’ll soon be able to embrace the emerging multi-chain world and abstract all that complexity away from users.

-🔥🍞

--

--