LogoLogo
  • Tally Docs
  • Tally Features
    • What is Tally?
    • Token Launch
      • Claim
      • Governance Smart Contracts
      • Token Wrapper
      • Delegate Registration & Claim-and-Delegate
    • Value Accrual with Staking
      • Features & Use Cases
      • FAQ
      • Glossary
    • Governance
      • Advanced Features
        • MultiGov
        • Advanced Voting
          • Flexible Voting Extension
          • Signal Voting
            • Snapshot
          • Private Voting
        • Partial Delegation
        • Security Council Elections
        • Chain Integration
        • Proposal Templates
        • Optimistic Governance
        • Gasless Voting and Delegation (Relay)
          • Gasless Voting
          • Gasless Delegation
        • Integrations
          • Karma - Delegate Scoring
          • Discourse
          • Safe
      • Standard Features
    • Tally API
    • Tally Zero
  • How to Use Tally
    • Navigate the Tally homepage
    • Set up a Tally Profile
    • Create Proposals
      • Custom Actions
        • Chain Deployment of Uniswap v3
        • Token Vesting with Hedgey
        • Token Grants with Hedgey
        • Streaming Payments with Sablier
        • Tuple Support
      • Swaps
        • Swaps: FAQs
      • Draft Proposals
      • Test Proposals
    • Execute Proposals
      • Advanced Execution
    • Delegate on Tally
      • Delegates Page
      • Delegate Voting Power
      • Create a Delegate Statement
    • Vote on Tally
    • Stake on Tally
    • Get Notifications on Tally
    • Use Tally with a Gnosis Safe
      • Vote with a Gnosis Safe
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Participate in Security Council Elections
    • Using Ledger with Solana
  • Set up & Technical Documentation
    • Tally Architecture
    • Deploy a Governor DAO
      • Deploy a Governor
        • Deploy a Governor with a new token
      • Add a Governor to an existing token
      • Check for Token Contract Compatibility
        • Network Support
        • OpenZeppelin Governor
        • Compound Governor Bravo
        • Tokens: ERC-20 and NFTs
      • Choose Governor parameters
    • Add a DAO to Tally
      • DAO Admins
      • DAO Settings
    • Use Governor with Gnosis Safe
      • Gnosis Safe Overview
      • Zodiac Governor Module for SubDAOs and Grants Programs
      • Upgrade Gnosis Safe to Governor with Zodiac
    • Staking Contracts
      • Get Started
      • How Staking Works
        • Liquid Staking
          • LST Auto delegates
      • Staking Operator's Guide
      • DeFi Integration Guide
      • FAQ & Troubleshooting
    • Security
    • Chain Compatibility
  • Education
    • Intro to Governance
      • General Ecosystem Info
      • Participating in Governance
    • Governance Concepts
      • Decentralized Governance Overview
      • Onchain vs Offchain Voting
      • Application Layer vs. Base Layer Governance
      • Governance Execution Methods
      • Procedural Governance
      • Vote Delegation
    • Governance Frameworks
      • OpenZeppelin Governor
      • Curve Voting Escrow
      • Multisigs
      • Snapshot Polls
    • DAO Best Practices
      • Running an Onchain DAO Using OpenZeppelin Governor
    • Index of DAOs
      • DAOs on Tally
        • Aave (AAVE)
        • Ampleforth (FORTH)
        • Arbitrum (ARB)
        • Compound (COMP)
        • Gitcoin (GTC)
        • GMX
        • Idle Finance (IDLE)
        • Inverse Finance (INV)
        • PoolTogether (POOL)
        • Uniswap (UNI)
        • ZKsync
      • DAOs Not on Tally
        • Balancer (BAL)
        • Curve (CRV)
        • Index Coop (INDEX)
        • KyberDAO (KNC)
        • MakerDAO (MKR)
        • Sushi (SUSHI)
  • Resources
    • Tally Platform
    • Blog
    • DAO Talk Podcast
    • Newsletter
    • Twitter / X
  • Payment Addresses
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Set up & Technical Documentation
  2. Staking Contracts

DeFi Integration Guide

Integrate Tally's staking contract into a DeFi protocol

PreviousStaking Operator's GuideNextFAQ & Troubleshooting

Last updated 22 days ago

Was this helpful?

Tally staking lets holders earn rewards, participate in governance, and use their assets in DeFi. This guide outlines considerations for add the LST to a lending market, AMM, or restaking system.

See below for details about how a DeFi protocol can integrate the from the .

Integrate the ERC20 Token

The LST is a standard ERC20 token with no "weird" features like rebasing. The integration will be similar to other ERC20 tokens.

Note: FixedGovLST uses a rebasing LST internally. Integrating against the underlying rebasing LST is not recommended!

Smart contract audits

The LST contracts has been audited twice, in both a private audit and a public contest.

The underlying direct staking system , Staker, has also been audited twice, with both a private audit and a public contest.

  • Staker is built on UniStaker.

Price oracle integration

If the LST does not have a native price oracle, the price can be inferred from the price of the underlying staked token's price.

The is built on top of a . The rebasing LSTs can be unstaked 1:1 for the underlying staked token. Here's how to pull the underlying staked token balance in Solidity:

function getUnderlyingBalance(address user) external view returns (uint256) {
    // Get the fixed LST token balance of the user
    uint256 fixedTokenBalance = fixedLstContract.balanceOf(user);
    
    // If the account has no balance, return 0
    if (fixedTokenBalance == 0) return 0;
    
    // The share scale factor is public on the FixedGovLst contract
    uint256 shareScaleFactor = fixedLstContract.SHARE_SCALE_FACTOR();
    
    // Convert the fixed LST tokens to shares by multiplying by the scale factor
    uint256 userShares = fixedTokenBalance * shareScaleFactor;
    
    // Use the rebasing LST contract's stakeForShares function
    uint256 underlyingBalance = governanceLstContract.stakeForShares(userShares);
    
    return underlyingBalance;
}

Note: If the LST has a withdrawal delay, there is a potential duration mismatch between the LST and staked token. It's not safe to infer the price from the underlying token in that case, because the LST's and staked token's prices could diverge.

Liquidity considerations

The LST is transferrable, so it will have its own liquidity. The underlying staked token also has liquidity. Because the LST can be unstaked for the underlying token, risk analysts should also consider the liquidity of the underlying token.

Programatic liquidations should consider the liquidity of both assets and whether there is a withdrawal delay.

LST Governance

The LST and the underlying Staker contract both have limited admin roles.

In general, the admins cannot take staked assets or accrued rewards. They can change the reward schedule, the rules for reward eligibility, and turn on the fee switch.

Slashing Risk

The default version of the staking system does not have any slashing features.

Upgradeability

The staking contracts are designed to be immutable. However, like any smart contract, staking can be deployed as an upgradeable proxy.

If they're deployed that way, DeFi integrators should understand the upgrade path for the system.

fixedGovLST
stGOV contracts
The LST audit reports are available here in the git repo.
The Staker audit reports are available in the Staker repo
Unistaker's three audit reports are available here.
fixed-balance LST
rebasing LST