Escher.Finance
  • 🖐️General
    • Introduction - What is Escher.Finance
    • Liquid staking with Escher
    • Native staking
  • 🪙Escher assets
    • eU - LST for Union chain
    • eBaby - LST for Babylon chain
  • 🏗️Architecture
    • System overview
    • Liquid Staking protocol
    • Hidden Layer Contract
    • Union Interoperability
  • 🔑Key features
    • Voyager
    • Authz (Paymaster)
    • Full Interoperability
    • Connecting Chains: From PFM to PMF & ICA as Router
    • ICA Controller
    • Account Abstraction
  • 📐Fundamental info
    • What is Chain Abstraction
    • What is Nomos and Seamless Direct dApp Connectivity
    • What is Union
Powered by GitBook
On this page
  • Key Features
  • User Interaction Flow
  • Liquid Staking Calculation
  • Compound Interest in Liquid Staking
  • Comparison Graph
Export as PDF
  1. Architecture

Liquid Staking protocol

PreviousSystem overviewNextHidden Layer Contract

Last updated 2 months ago

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.

Key Features

  • 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

User Interaction Flow

  1. The user connects to the liquid staking contract through their Inter-Chain Account (ICA), which is controlled from another chain.

  2. The ICA receives the tokens and automatically sends them to the liquid staking protocol using authorization or a callback mechanism.

  3. The liquid staking protocol mints eTokens representing the staked assets.

  4. The ICA receives the eTokens and sends them back to the user's original chain.

Liquid Staking Calculation

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.

Exchange Rate Calculation

The exchange rate is calculated as follows:

Exchange Rate = (Total Staked Tokens + Unclaimed Rewards) / Total eTokens Issued

Example Calculation

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:

  1. Early stakers benefit from their longer staking period

  2. New stakers receive a fair amount of eTokens based on the current value of the staked assets

  3. 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.

Compound Interest in Liquid Staking

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.

Comparison Graph

Here's a comparison of growth for an initial stake of 1000 tokens over the course of a year:

P=k(1+rn)n−f∑z=0n−1(1+rn)zP = k \left( 1 + \frac{r}{n} \right)^n - f \sum_{z=0}^{n-1} \left( 1 + \frac{r}{n} \right)^zP=k(1+nr​)n−f∑z=0n−1​(1+nr​)z

🏗️