Liquid staking components for Cosmos/CosmWasm-based contracts.
- Babylon Chain: Babylon Liquid Staking Contract
The Babylon contract includes optimization mechanisms to maintain validator balance. Every 360 blocks, the contract automatically executes staking, unstaking, delegation, collect reward, operations to ensure stable performance. Reward management on Babylon is directly embedded within the liquid staking contract.
- For liquid staking contract architecture implementation, please see: Architecture
| Component | Description | Language(s) |
|---|---|---|
| Liquid Staking | Cosmwasm Liquid Staking Contract | Rust |
| CW20 Token Minter | Union CW20 to handle cw20 token mint & burn | Rust |
| UCS30 Zkgm | Union UCS30 Zkgm to transfer asset | Rust |
| Component | Description | Language(s) |
|---|---|---|
| Liquid Staking Backend service | Liquid Staking Backend Job Service to do process rewards and automatic transfer after unbonding complete | Node/TS |
| Component | Description | Language(s) |
|---|---|---|
| Indexer | Cosmwos Indexer | Rust |
This repo uses nix for deterministic and reproducible builds and development environments.
If you are unfamiliar with nix, we recommend zero to nix.
To enter the dev shell for this repo, run:
nix developTo format the repo:
nix fmtTo build a package:
nix build .#liquidstaking-babylonThe built artifacts can be found in result. All rust packages will have the commit hash embeded at build time, via embed-commit. This is handled transparently by the crane builders from the union repo; the only requirement is that the embed-commit crate is added as a dependency (and the builds will fail if it is not a dependency):
$ nix build .#liquidstaking-babylon.release
$ ls -alhL result
-r-xr-xr-x 1 root root 553K Jan 1 1970 result
$ nix run guthub:unionlabs/union#embed-commit-verifier -- extract result
1ad4854a1e1d2cbce71c6b064a190ebf1662f947 # the commit has of the repo when this package was built