Solana Staking and MEV Explained
Covering how Jito stake pools and MEV work (no SQL in this guide)
This article will not have any SQL explainers. If you want to learn SQL on Solana, start here.
Staking and MEV are hot topics on essentially all chains now. However, they take very different forms based on how execution and consensus works. Execution is how a transaction is submitted and processed, consensus is how a block of transactions get validated and confirmed.
I’ve created a Solana Staking/MEV dashboard and a “flow of funds” visual to make this all easier to understand. Let’s get into it!
Thanks to Buffalu, Evan, and Edgar for patiently answering all my questions :)
→ Thread here if you just want a TLDR; ←
Want to stake SOL on Jito? Use my referral link to do so ❤️
They’re running a points program for staking, referring, and using JitoSOL across DeFi
An Intro to Staking
On Ethereum, you have consensus through “Proof of Stake” where validators (computers with at least 32 ETH) post blocks every 12 seconds. Smart contract protocols like Lido give you “liquid staking tokens” (LST) like staked ETH (stETH) in return for your ETH deposit. Lido then splits (“delegates”) between a set of 29 operators, each of whom can run multiple validators.
📊 You should check out Hildobby’s Ethereum staking dashboard for more stats.
On Solana, this delegated proof of stake (DPOS) consensus is built natively into the blockchain, where the vote (validator) and stake accounts are separated. You can stake your own account and run your own validator, but you can also provide liquidity through a program (smart contract) called a “stake pool”. It’s super simple to deploy a LST on Solana, you can run one line of code to create a pool and token. JitoSOL, bSOL, laineSOL all use this. The deployment and management of LSTs happen within that one stake pool program. It’s up to the LST/pool owner to decide which vote accounts (validators) to give the stake pools to.
Jito created a pool with the token JitoSOL, and is currently delegating to 80+ vote operators (validators):
Jito’s differentiator is that they only stake validators running the jito-solana client to ensure stakers are receiving MEV. Part of that gets restaked into the stake pool, so Jito stakers get additional MEV yield on top of stake rewards. Don’t worry if you don’t know what MEV is, we’ll get into it below.
📊 Here are some JitoSOL summary stats from my dashboard:
Solana Staking and Withdrawals
As of 9/20/2023, JitoSOL has acquired 2.2m+ SOL in their stake pool. 2.15m of that is from deposits, and 40k is from stake rewards and 50 mev rewards (yes, just 50).
There are two ways of depositing and two ways of withdrawing from the stake pool. You can reference the stake pool rust docs to see all the instructions in detail, but the short summary is:
deposit_sol: Deposit SOL from your wallet to the JitoSOL stake pool. You can see the SOL transfer into the stake pool at instruction #3.1 of this transaction.
deposit_stake: Deposit from your existing stake account into the JitoSOL stake pool. This is done with a stake “merge” call, seen at instruction #3.3 of this transaction. You can see the full balance is transferred between the merged stake accounts in the state balance diff.
withdraw_sol: Withdraw SOL into another stake account and wait to deactivate it. This is done with a stake “split” call, seen at instruction #3.2 of this transaction.
withdraw_stake: Withdraw immediately from the stake pool through a JitoSOL swap (has a higher fee). This is done with a stake “withdraw” call, you can see this occur in instruction #1.7 of this transaction.
The stake pool can be found at Jito4A, with reserve pool at BgKUX where liquidity sits and then is routed to the validators. You can see how much stake has come in and out through those four functions:
To get the top stakers, you can check the top holders of the JitoSOL token:
Two key tables I used in the query here are “solana_utils.latest_balances” to get JitoSOL currently held and “solana_utils.sns_domains” to get the .sol domains.
Want to stake SOL on Jito? Use my referral link to do so ❤️
They’re running a points program for staking, referring, and using JitoSOL across DeFi
Solana Staking Rewards
Validators confirm blocks (with voting), which pays out rewards in the form of:
Staking: new token issuance
Votes: payment for voting on blocks
Fees: transaction fees from blocks
These are paid every “epoch”, which is roughly 2 days (432000 blocks). You can get these reward values from the “solana.rewards” or “solana_utils.total_rewards” tables, and get JitoSOL specific stake rewards by checking for validators added (delegated) by JitoSOL.
Vote reward + tx fees goes to validator. It takes 3 SOL each epoch to cover vote costs, with 134 epoch’s a year. That’s 402 SOL to breakeven on costs (source) - hence why validators take a “commission” on staking rewards. You can see this validator takes a 4% commission. The rest of the staking reward goes directly back into the JitoSOL delegated stake accounts.
There are currently 84 delegated stake accounts (as of 9/20/2023):
🚨 I haven’t found how/when the stake commission gets paid to validators - my assumption is that it is just added to “voting” reward. If you can explain it to me with examples then I’ll update here and credit you :)
MEV on Solana
Transactions on any chain go into a queue (mempool), where other actors have some time to order transactions around submitted ones - with some extra fees of course.
There are three players involved:
Searcher: someone who scans the queue and finds an opportunity, like arbitraging across different DEXs. They then submit *potential* transactions that would execute that arb, with a bid (a bribe) to get the right ordering.
Builder: someone who actually builds the blocks, with all submitted transactions in consideration.
Proposer/Validator: the entity that actually confirms blocks.
On Ethereum it’s gotten really complex with many entities in each role, all using the Flashbots MEV-Boost Relays/PBS. On Solana, you have many searchers that all submit to Jito Labs, who acts as the single builder (docs).
Searchers will bid to be included with “tips”, that are paid to Jito tip addresses. 5% of those tips go to Jito, 95% of those tips go to the validators (not delegated validators, these can be any validators running Jito-solana). Tip distribution occurs through the use of “claim” on the tip-distribution program (decoded on Dune as “jito_tip_distribution_solana.jito_tip_distribution_call_claim”).
The tip portion that goes to the validators are split with their stakers with a commission determined by the validator operator. JitoSOL prioritizes validators that take under 10% of the tip (so 90% of the tip goes back to the stakers).
Yes, it’s not much today. But as Solana DeFi grows, the advantage JitoSOL has in providing yield and restaking grows too.
Right now, we’re seeing about 2 million bundles (tips) a week…
…from 40-60 MEV wallets a week:
📊 There is a bundle explorer Jito created if you want to dig deeper on MEV.
Putting it all together
Now that you’ve learned all the concepts involved, here is the visual showing how all the funds flow between accounts
LST’s like JitoSOL will continue to play a pivotal role in reviving Solana DeFi, such as in Drift v2, marginfi, Kamino Finance, and more:
If you’re an analyst, you should focus on understanding the 200 lines of SQL in this staking deposits, withdrawals, and rewards query. I’ve commented my queries to give more context and example transactions.
💡 If you’re a protocol on Solana looking to get involved in the data ecosystem, go submit your IDL/rust docs to Dune decoded tables and then DM me on Twitter.
Want to stake SOL on Jito? Use my referral link to do so ❤️
They’re running a points program for staking, referring, and using JitoSOL across DeFi