Staking Contract
Staking
Overview
RovBTC
is the main user-facing vault contract of the Rover protocol. It allows holders of native BTC, pBTC, or already-staked stBTC to deposit their assets and receive rovBTC – an ERC-4626 compliant receipt token that represents a share of the protocol's pooled collateral and its staking rewards.
Behind the scenes every deposit is converted into stBTC (a yield-bearing representation of pBTC) and kept inside the vault. As the underlying stBTC balance grows due to staking rewards, each rovBTC token becomes redeemable for an ever-growing amount of BTC.
This page explains the complete staking lifecycle, the fees that apply, and the roles that safeguard the contract.
Deposit flow
depositBTC
The user sends native BTC (gas token) together with the call
BTC
depositPBTC
The user already holds pBTC
pBTC
depositStakedBTC
The user already holds stBTC
stBTC
1. Pre-checks
Contract must not be paused.
assets
must be non-zero.The desired deposit must not push the vault above
maxDepositTVL
(if the limit is set).
2. Asset handling
BTC ⇒ pBTC – If the user sends native BTC the contract immediately wraps it into pBTC via
pBTC.deposit{value: msg.value}()
.pBTC ⇒ stBTC – pBTC is approved to the staking contract and staked with
stBTC.deposit(assets, address(this))
.stBTC direct – For
depositStakedBTC
the user directly transfers stBTC to the vault, so only an ERC-20 transfer is required.
3. Minting rovBTC
The amount of rovBTC minted equals the amount of stBTC shares the vault received (sharesReceived
). This keeps rovBTC perfectly aligned with the underlying stBTC position.
Withdrawal / Redemption flow
Users can leave the vault through three public functions:
withdraw
– burn enough rovBTC so that exactlyassets
pBTC are returned.redeem
– burn a specific amount of rovBTC shares and receive pBTC (amount determined bypreviewRedeem
).redeemNativeBTC
– likeredeem
but unwraps pBTC to native BTC and transfers it toreceiver
.
Net assets are delivered to the user (pBTC
transfer or unwrap + native BTC transfer).
Rewards fee
The protocol may charge a fee on staking gains – never on principal. The fee percentage is stored in rewardsFee
and can be changed by an account holding the RovBTC Admin role.
Events
Deposit(caller, receiver, assets, shares)
– standard ERC-4626 deposit event.Referral(caller, assets, referralId)
– emitted on each deposit function, carries an optional referral identifier.RewardFeeCollected(gains, feeAmount)
– emitted whenever a withdrawal produces gains.
Helpers
Preview functions
previewDeposit(assets)
– exact rovBTC a user will receive forassets
pBTC.previewWithdraw(assets)
– shares required to receive exactlyassets
pBTC (net of fee).previewRedeem(shares)
– net pBTC the user will receive for redeemingshares
rovBTC.
TVL helpers
calculateTVL()
/totalAssets()
– expose the current total value locked (in pBTC terms).
Glossary
BTC – Native Bitcoin on Botanix.
pBTC – Wrapped BTC ERC-20 token, 1:1 with native BTC.
stBTC – Staked BTC ERC-20 token accruing staking rewards.
rovBTC – ERC-4626 vault token representing a share of the Rover stake pool.
Last updated