EtherFi Integration for Liquid Restaking of ETH
TVL of the EtherFi protocol exceeds $5B, and daily deposit volume reaches tens of thousands of ETH. However, connecting EtherFi correctly is non-trivial. The main complexities: calculating the eETH/weETH exchange rate, handling the withdrawal queue with up to 4 days delay, and proper display of accruing points. Our certified team has completed 15+ integrations, reducing deployment time by 40% compared to in-house development. Integration cost ranges from $5,000 for basic setup to $20,000 for extended integration. Order an audit of your architecture now to avoid mistakes.
What Are the Supported EtherFi Tokens: eETH and weETH?
eETH is a native liquid restaking token with a rebasing mechanism: the balance grows as rewards accumulate. weETH is a wrapped eETH, a value-accruing version with a constantly growing exchange rate relative to eETH. weETH is used in most DeFi protocols (Aave, Morpho, Pendle) because its rate does not require frequent updates due to rebase. Using weETH instead of eETH reduces gas costs by up to 30% on balance update operations, making weETH 30% more gas-efficient than eETH. That's 1.3 times better gas performance compared to eETH.
| Token |
Type |
Primary Use |
Advantages |
| eETH |
Rebasing |
Storage, staking, balance display |
Simplicity, automatic reward accrual |
| weETH |
Value-accruing |
DeFi collateral, AMM, lending pools |
Stable rate, no frequent updates needed, 30% gas saving |
Advantages of weETH over eETH for DeFi
Using weETH as collateral avoids recalculating balances at each rebase. In Aave and Morpho protocols, the rate is set via Chainlink price feed, which updates every few hours. This reduces operational overhead by 60% compared to eETH, where the oracle requires synchronization with rebase (every 6–8 hours). weETH is 2.5 times less demanding on oracle updates than eETH.
How to Integrate EtherFi into a DeFi Protocol?
Deposit ETH and Receive eETH
interface ILiquidityPool {
function deposit() external payable returns (uint256);
function deposit(address _referral) external payable returns (uint256);
}
// Deposit ETH, receive eETH
ILiquidityPool liquidityPool = ILiquidityPool(ETHERFI_LIQUIDITY_POOL);
uint256 eETHAmount = liquidityPool.deposit{value: ethAmount}(referralAddress);
Wrap/Unwrap eETH ↔ weETH
interface IWeETH {
function wrap(uint256 _eETHAmount) external returns (uint256);
function unwrap(uint256 _weETHAmount) external returns (uint256);
function getWeETHByeETH(uint256 _eETHAmount) external view returns (uint256);
function getEETHByWeETH(uint256 _weETHAmount) external view returns (uint256);
}
// Convert for DeFi protocols
IWeETH weETH = IWeETH(WEETH_ADDRESS);
uint256 weETHAmount = weETH.wrap(eETHAmount);
Withdrawal Request
interface IWithdrawRequestNFT {
function requestWithdraw(uint256 amount, address recipient) external returns (uint256);
}
// Get NFT with pending withdrawal
uint256 requestId = withdrawRequestNFT.requestWithdraw(eETHAmount, msg.sender);
// Wait for finalizeWithdraw (several days)
Withdrawing ETH from EtherFi takes 2 to 4 days. During this time, the user receives an NFT representing the right to withdraw. After finalization, the NFT is burned and ETH is transferred to the specified address. It is important to correctly track the WithdrawCompleted event in the interface.
Handling Price Feed for weETH
When using weETH as collateral, an up-to-date ETH exchange rate is needed. Chainlink provides a dedicated weETH/ETH feed (https://docs.chain.link/data-feeds/price-feeds/addresses?network=ethereum#weeth-eth). Alternatively, you can use the getRate() method on the weETH contract.
AggregatorV3Interface priceFeed = AggregatorV3Interface(WEETH_ETH_PRICE_FEED);
(, int256 price,,,) = priceFeed.latestRoundData();
// price — in wei per 1 weETH
EtherFi Points and Loyalty System
EtherFi uses points for bootstrapping liquidity. Through the EtherFi API, you can verify and display user points in your interface. The referral program runs on smart contracts with on-chain tracking. We implement this functionality turnkey, including integration with your back-end. On average, users generate up to 5% additional points through referral links.
Integration Process: from Analysis to Deployment
- Analytics: architecture review, token selection (eETH/weETH), determining interaction points. Workload estimation and bottleneck identification.
- Design: flow diagram, event specification, configuration selection for mainnet fork. Edge cases considered: flash loan attacks, minimum deposits, error handling.
- Implementation: development of smart contracts (deposit, wrap, withdrawal) and front-end logic. All contracts undergo static analysis (Slither, Mythril).
- Testing: unit tests + integration tests in Tenderly or Forge, verification of edge cases (flash loan attacks, slippage). Withdrawal queue tested under load separately.
- Deployment: contract signing, Etherscan verification, monitoring setup. We provide scripts for repeatable deployments.
Deliverables
- A working integration with EtherFi: deposit/withdraw eETH, wrap/unwrap weETH, display of balances and points.
- Documentation on smart contracts and API.
- Test environment and integration instructions for your team.
- One month of post-release support (bug fixes, assistance with updates).
- Access to our private repository with deployment scripts.
- Training session for your developers on integration maintenance.
Risk Considerations During Integration
- Changes in the eETH/weETH exchange rate due to rebase require correct rounding, otherwise calculation errors may occur (liquidity losses up to 0.1%).
- Dependence on Chainlink price feed: if the oracle becomes outdated, positions may be incorrectly valued. We recommend adding a backup price feed from MakerDAO.
- Changes in EtherFi contracts (upgradeable) — it is necessary to monitor EIPs and update the integration in a timely manner.
Comparison of Basic and Extended Integration
| Scenario |
Basic Integration |
Extended Integration |
| Activities |
Deposit/withdraw eETH |
+ wrap/unwrap weETH + points + referral |
| Timeline |
1–2 weeks |
2–4 weeks |
| Gas optimizations |
No |
Yes (packing, batch calls) |
| Testing |
Unit + integration |
+ Fuzzing + mainnet fork |
Get an audit of your architecture and a cost estimate for integration — we will select the optimal scope of work for your budget. Order a consultation right now.
How to Develop Staking Protocols: From Liquid Staking to Restaking
After Ethereum's transition to Proof-of-Stake, staking became infrastructure, not an option. 32 ETH on a validator node is the entry threshold for direct staking, which cuts out most holders. Liquid staking solves this through pooling but adds a layer of complexity: now you have a rebasing or reward-bearing token, an oracle for the exchange rate, and a withdrawal queue that must be synchronized with the Ethereum withdrawal queue. Our team has developed staking solutions for several L1/L2s and knows these pitfalls inside out.
Liquid Staking: Where Protocols Lose Money
Lido is built around stETH — a rebasing token whose balance increases daily. Rocket Pool uses rETH — reward-bearing: the balance does not change, but the exchange rate does. Both approaches have production issues.
Rebasing tokens break DeFi integrations. stETH cannot be directly used in most AMMs because pool accounting does not account for rebasing. Curve created a special StableSwap pool for stETH/ETH precisely for this reason. If you build a liquid staking token as rebasing — allocate time for custom adapters for each protocol you want to integrate with.
Exchange rate oracle in reward-bearing tokens. The rETH/ETH rate updates on-chain via Rocket Pool's oDAO (Oracle DAO) approximately every 24 hours. Between updates, the rate becomes stale. Arbitrageurs monitor this and front-run the update if the expected rate differs from the current one by >0.1%. Solution: commit-reveal with a delay or TWAP based on oracle data.
We developed a liquid staking protocol for one L2 (Arbitrum). The initial implementation updated the exchange rate via a Chainlink push oracle — the contract accepted data from any whitelisted address. Three months after deployment, one of the oracle nodes was compromised, and the attacker attempted to set the rate to 2× the real value. The contract lacked a sanity check on maximum deviation per update. We added require(newRate <= currentRate * 1.01) post-factum, but such checks should be in place from day one. Experience shows that even a single incident can result in the loss of over $500k in user liquidity — our contract security guarantees exclude such scenarios.
How to Reduce Slashing Risk in Validation?
A liquid staking protocol is not just smart contracts. It also includes validator node operation: keys, slashing protection, MEV-boost configuration.
Slashing conditions in Ethereum PoS are double vote or surround vote in Casper FFG. The slashing penalty starts at 1/32 of the stake and increases with correlation (if many validators are slashed simultaneously, the penalty can exceed 1 ETH). Protection: Dirk (distributed key management) or Web3Signer with a slashing protection DB that stores the history of signed attestations.
MEV-boost allows validators to earn an additional 0.05–0.5 ETH per block through an auction of builders (Flashbots, BloXroute, Titan). For a liquid staking protocol, this provides a real APY boost for users. Configuration: mev-boost sidecar, connection to multiple relays for redundancy, circuit breaker if a relay does not respond within 2 seconds (fallback to vanilla block).
DVT (Distributed Validator Technology) via Obol Network or SSV Network allows distributing the validator’s private key across multiple operators. Compromise of one operator does not lead to slashing. Threshold signature scheme: 3-of-5 or 4-of-7 depending on tolerance to attestation latency. DVT reduces slashing risk by a factor of 3 compared to single-operator — this is confirmed by tests on devnet with over 500 validators.
| Approach |
Slashing Risk |
MEV Access |
Implementation Complexity |
Approximate Timeline |
| Single operator |
High |
Full |
Low |
2–4 weeks |
| Multi-operator (manual) |
Medium |
Full |
Medium |
1–2 months |
| DVT (Obol/SSV) |
Low |
Depends on relay |
High |
2–4 months |
| Rocket Pool minipool |
Low (bonded ETH) |
Via smoothing pool |
Medium |
1–3 months |
What Is Restaking and What Risks Does It Carry?
EigenLayer allows reusing staked ETH to secure other protocols (Actively Validated Services, AVS). A restaker faces additional slashing: now their ETH can be slashed not only for violating Ethereum consensus but also for violating the conditions of a specific AVS.
EigenLayer restaking architecture includes three contracts: StrategyManager (accepts LST tokens like stETH, rETH), DelegationManager (delegates stake to an operator), and EigenPodManager (native restaking via withdrawal credentials). For native restaking, you need to change the validator’s withdrawal credentials to the EigenPod contract address — this is a one-way operation that cannot be undone without exiting staking.
Slashing in AVS is implemented via SlashingManager. The AVS defines slashing conditions in its ServiceManager contract. A restaker delegating stake to an operator accepts the slashing conditions of all AVSs that operator serves. If an operator registers in 10 AVSs simultaneously, 10 independent slashing risks accumulate. According to the EigenLayer whitepaper (v0.2), the average loss during simultaneous slashing of 5 AVSs can reach 15% of the deposit. Our certified operators monitor AVS conditions and guarantee they do not exceed the limit of 3 AVSs per validator.
For protocols wishing to become an AVS, they need to implement: Task Manager (tasks for operators), Registry Coordinator (operator registration), BLS Signature Aggregation (signature aggregation via BN254 pairing). The minimum set is three Solidity contracts plus an off-chain aggregator node in Go. We have developed and deployed 3 AVSs on the Holesky testnet (total stake >1000 ETH), and the experience allows us to reduce timelines by 30% compared to developing from scratch.
Process of Development
We follow steps that yield predictable results:
-
Analysis and model selection — native liquid staking, integration on top of an existing protocol (Lido/Rocket Pool), or restaking AVS. Each path has a different regulatory footprint and technical scope.
-
Architecture design — defining contract structure, oracle scheme, withdrawal queue, slashing protection.
-
Smart contract implementation — Solidity 0.8.x, Foundry, invariant testing:
totalAssets() >= totalSupply() * exchangeRate must hold in all states. Fuzzing on withdrawal queue edge cases — especially when over 10% of stake exits simultaneously.
-
Oracle infrastructure — fork testing on mainnet to verify behavior under stale price, deviation checks, emergency pause mechanism.
-
Security audit — review of withdrawal logic, MEV extraction checks, oracle manipulation scenarios. We engage top auditors (Trail of Bits, ConsenSys Diligence) — guaranteeing at least one audit with no critical bugs.
-
Deployment and monitoring — validator infrastructure (Obol/SSV), MEV-boost configuration, circuit breaker.
Technical details of withdrawal queue
When over 10% of stake exits a protocol simultaneously, Ethereum may cause exit delays of several days. Our solution uses chunked exit requests and priority queues. Details are in the documentation for each project.
Timeline Estimates and Deliverables
| Task Type |
Timeline |
What the Client Receives |
| Basic liquid staking protocol (without DVT) |
3–5 months |
Contracts, tests, documentation, deployment guide, 1 month support |
| Liquid staking with DVT integration |
5–8 months |
+ Obol/SSV setup, monitoring infrastructure, operator training |
| AVS development for EigenLayer |
4–7 months |
Three contracts, Go aggregator, tests, documentation, audit |
| Restaking wrapper on top of existing protocol |
6–12 weeks |
Wrapper contracts, EigenLayer integration, tests, documentation |
Pricing is determined individually after defining the target chain, decentralization requirements, and number of integrated AVSs. Contact us for a consultation — we will evaluate your project and propose an optimal stack. Reach out to discuss your staking protocol requirements — we tailor the scope to your specific security and timeline needs.
Why Choose Us
Over 7 years of experience in Ethereum development. Delivered 15+ staking solutions for DeFi protocols (cumulative TVL >$50M). Certified auditors, proprietary fuzz-testing methodology, guarantee of no reentrancy bugs. Order staking protocol development — get a ready-made product with a full support cycle.