Liquid Staking protocol
Last updated
Last updated
The liquid staking protocol is a core component of Escher's architecture, built on CosmWasm and deployed on the Union Chain. This protocol manages the entire lifecycle of liquid staking, from initial stake to reward distribution.
Staking: Allows users to stake their tokens
Minting: Issues liquid tokens (LTokens) representing staked assets
Burning: Enables users to burn LTokens to reclaim original assets
Auto-restaking: Automatically compounds rewards
Unbonding: Manages the process of unstaking tokens
Reward Claiming: Distributes staking rewards to users
The user connects to the liquid staking contract through their Inter-Chain Account (ICA), which is controlled from another chain.
The ICA receives the tokens and automatically sends them to the liquid staking protocol using authorization or a callback mechanism.
The liquid staking protocol mints eTokens representing the staked assets.
The ICA receives the eTokens and sends them back to the user's original chain.
The liquid staking protocol uses a dynamic exchange rate to calculate the relationship between staked tokens and eTokens. This rate adjusts as rewards accrue, ensuring fair distribution among all stakers.
The exchange rate is calculated as follows:
Let's walk through an example to illustrate how this works:
Initial State:
Total Staked Tokens: 1,000,000
Total eTokens Issued: 1,000,000
Unclaimed Rewards: 0
Initial Exchange Rate: 1.0
After 30 days:
New Rewards: 50,000
Total Staked Tokens: 1,000,000
Unclaimed Rewards: 50,000
Total eTokens Issued: 1,000,000
New Exchange Rate = (1,000,000 + 50,000) / 1,000,000 = 1.05
This means each eToken is now worth 1.05 of the original token.
If a new user stakes 100 tokens at this point:
eTokens received = 100 / 1.05 ≈ 95.24 LTokens
When a user with 100 eTokens unstakes:
Tokens received = 100 * 1.05 = 105 tokens
This system ensures that:
Early stakers benefit from their longer staking period
New stakers receive a fair amount of eTokens based on the current value of the staked assets
All stakers proportionally benefit from the accrued rewards
The liquid staking protocol automatically handles these calculations, providing a seamless and fair staking experience for all users, regardless of when they enter or exit the staking pool.
Escher's liquid staking protocol employs an auto-restaking mechanism that compounds rewards frequently, maximizing returns for stakers. Let's explore how this compounding effect works and compare it to non-compounding staking.
Term to maximize:
where
P: Final value of staked tokens.
𝑘: Initial stake amount.
𝑟: Annual Percentage Yield (APY) (in decimal form).
𝑛: Number of times rewards are claimed and re-staked per year.
𝑓: Transaction fee. Must be reward claim fee + re-stake fee.
Here's a comparison of growth for an initial stake of 1000 tokens over the course of a year: