DeFi Integration Guide
Integrate Tally's staking contract into a DeFi protocol
Last updated
Was this helpful?
Integrate Tally's staking contract into a DeFi protocol
Last updated
Was this helpful?
With staking, tokenholders can have it all. They can earn rewards, participate in governance, and use their assets in DeFi.
Here's how a DeFi protocols can integrate the from the .
The LST is a stanrdard 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!
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:
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.