Staking

Goals

This guide shows you how to Stake ETH using the Liquid Collective Protocol and receive LsETH in return.

By the end of this guide you will:

  • Have an understanding of the Liquid Collective protocol

  • Stake ETH

Pre-read

Review the Authentication Guide for the Alluvial API.

Dependencies

  • Ethers.js: You will use Ether.js, a popular library for interacting with Smart Contracts to query blockchain information and send transactions.

  • Application Binary Interface (ABI): The ABI for the River smart contract will be used to READ /WRITE to the contract.

  • Hoodi ETH: You will be accessing the Hoodi testnet, ensure you have a wallet with HoodiETH.

After reading both guides, come back to continue the implementation of the staking workflow.

Implementation

Import libraries

In the backend (Node.js) application you will need to import one library.

app.js

Full code implementation can be see in Appendix, at bottom of the guide.

Next, add information about the RPC node Provider being used. This example uses this example you are using Chainstack, but there are several options for platforms to host an RPC node.

Staking transaction

You can now create the transaction object. In the example below, you are transferring 0.0000001 from address 0xbe79ff177a8F6a0D9656cF47D8687f43666a4d1e to the River address.

Great job! You have successfully staked ETH. You can use the transaction hash returned to view more details.

Congratulations! You've now staked ETH, received LsETH, and retrieved your balance. As a next step, review the guide on how to implement redemptions.

Appendix

Full Code

Full code for making deposit transaction

Last updated

Was this helpful?