How to programmatically stake and retrieve rewards data on Ethereum.
At a high-level, the flow for staking Ethereum involves:
Generating one or multiple validation keys using Kiln API
Making the deposit transaction, either with one by one with the official deposit contract or by batches through Kiln Batch Deposit Contract. Based on the custodian you use, you may be able to generate this transaction with a higher-level API provided by your custodian.
Monitoring validator performance and accrued rewards using Kiln Rewards API
Ethereum stake API object
Ethereum Stake is an API object linked to an Account and represents a validation key (ie a 32ETH stake).
Validation public key
Current deployment state
State (see State machine)
Last state update date
Validator balance (in gwei)
APY of accrued rewards
Validator effective balance
Staker Ethereum Address
This state machine represents all the state an Ethereum object can be in. Transitions are performed automatically by Kiln services.
Validator key is uploaded and waiting for deployment
Deposit transaction is made but not yet in a finalized block
32 ETH deposit is complete on Ethereum mainnet chain
Validator configuration is under review to avoid errors or slashing risks
Deployed and waiting for the Beacon Chain to process the deposit
Validator is waiting in activation queue to start validation (~2 days)
Validator is participating to the network
Validator is offline
Validator has been slashed for bad behavior
User wants to stop a validator
Validator deletion is under review
Validator is exiting and being deleted
Validator has exit and been deleted
Ethereum network stats API object
This object represents stats about the Ethereum network.
Current network staking APY
Current percentage of tokens staked on the network
Ethereum API routes
The following routes are available in the Kiln API:
Create a new Ethereum Stake (validation key)
Retrieve Ethereum Stakes, for an Account, a Wallet or a Pubkey