Overview
The Staking precompile provides access to Sei’s native staking functionality, allowing you to delegate tokens to validators, redelegate between validators, undelegate tokens, and query delegation information directly from EVM contracts. Contract Address:0x0000000000000000000000000000000000001005
Key Features
- Delegation Management: Delegate SEI tokens to validators to earn rewards
- Redelegation: Move delegations between validators without unbonding period
- Undelegation: Withdraw delegated tokens (subject to unbonding period)
- Delegation Queries: Check delegation amounts and details
Available Functions
State-Changing Functions
delegate(string) → bool
delegate(string) → bool
Delegate SEI tokens to a validator.Parameters:
valAddress
(string): The validator’s operator address
redelegate(string, string, uint256) → bool
redelegate(string, string, uint256) → bool
Redelegate tokens from one validator to another without unbonding.Parameters:
srcAddress
(string): Source validator addressdstAddress
(string): Destination validator addressamount
(uint256): Amount to redelegate (in wei)
undelegate(string, uint256) → bool
undelegate(string, uint256) → bool
Undelegate tokens from a validator (starts unbonding period).Parameters:
valAddress
(string): The validator’s operator addressamount
(uint256): Amount to undelegate (in wei)
View Functions
delegation(address, string) → Delegation
delegation(address, string) → Delegation
Get delegation information for a delegator and validator pair.Parameters:
delegator
(address): The delegator’s EVM addressvalAddress
(string): The validator’s operator address
Usage Examples
- Viem
- Ethers.js
- Manual
Common Use Cases
Liquid Staking Protocols
- Auto-Delegation: Automatically delegate user deposits to optimal validators
- Rebalancing: Redelegate between validators based on performance metrics
- Yield Optimization: Monitor and adjust delegations for maximum rewards
Staking-as-a-Service
- Portfolio Management: Manage delegations across multiple validators
- Risk Distribution: Spread delegations to reduce validator risk
- Performance Tracking: Monitor delegation performance and rewards
DeFi Integration
- Collateral Management: Use staked tokens as collateral in lending protocols
- Governance Participation: Delegate to validators aligned with protocol governance
- Yield Strategies: Combine staking with other DeFi yield opportunities
Validator Selection Strategies
Performance-Based Selection
Diversification Strategy
Error Handling
Common errors when using the Staking precompile:- Insufficient balance: Not enough SEI to delegate
- Invalid validator: Validator address doesn’t exist or is jailed
- Delegation not found: No existing delegation to query/modify
- Minimum delegation: Some validators may have minimum delegation requirements
Unbonding Period
When undelegating tokens, they enter a 21-day unbonding period:- Tokens are locked: Cannot be transferred or re-delegated during unbonding
- No rewards: Unbonding tokens don’t earn staking rewards
- Slashing risk: Tokens can still be slashed if validator misbehaves during unbonding
Related Precompiles
- Distribution: Claim staking rewards from delegations
- Bank: Check SEI balance before delegating
- Governance: Participate in network governance