liquidity-staking-module

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 21, 2022 License: Apache-2.0

README

liquidity-staking-module

The purpose of this repository is to develop and release a new set of staking, distrbution and slashing modules for the Cosmos Hub that are compatible with cosmos-skd 0.43 and do not need to wait on cosmos-sdk 0.45 to included in a Gaia release and Cosmos hub Upgrade.

Liquid Staking design

This repo represents an opinionated design for adding liquid staking to the Cosmos SDK.

There are a few core goals.

  1. Staked assets should be able to converted into liquid staked assets without unbonding.
  2. The smallest change set possible on the existing staking, slashing and distrbution modules.
  3. Assets are expected to be minimally fungible. Assets have a denom of "cosmosvaloperxxxx[recordId]". Record ID is a pointer to a non fungible asset that recieves the rewards from the tokenized stake.
  4. Governance rights remain with the validator. Validators vote with the full voting power of all staked assets (including those made liquid), but liquid staked assets cannot vote (cannot override the validator).

Typical user flow.

  1. Alice bonds 500 ATOM to iqlusion.io
  2. Alice executes MsgTokenizeShares for the 500_000_000uatom and 500_000_000cosmosvaloper1xxxx42 in return.
  3. Alice does an OTC deal with Bob for 250_000_000cosmosvaloper1xxxx42 assets.
  4. Bob exectutes MsgRedeemTokensforShares for 250_000_000cosmosvaloper1xxxx42 which now becomes a delegation of 250atom to iqlusion.
  5. While the shares were tokenized, TokenizedShareRecord 42 is recieving the full 500 atom of rewards minus iqlusion's commission.
  6. Once Bob redeems his tokens for shares, now TokenizedShareRecord 42 will only recieve 250 atoms worth of rewards.
  7. Alice can execute MsgWithdrawTokenizeShareRecordReward pass these rewards back to Alice's account.
Example Commands
liquidstakingd tx staking tokenize-share cosmosvaloper1qp49fdjtlsrv6jkx3gc8urp2ncg88s6mcversm 1000000stake cosmos1qp49fdjtlsrv6jkx3gc8urp2ncg88s6macdkug
liquidstakingd query distribution tokenize-share-record-rewards cosmos1qp49fdjtlsrv6jkx3gc8urp2ncg88s6macdkug
liquidstakingd tx distribution withdraw-tokenize-share-reward
liquidstakingd tx staking redeem-tokens 1000cosmosvaloper14tlxr8mcr3rg9mjp8d96f9na0v6mjtjlqnksqy1

Hypothetical user flow with refungiblization

This flow requires an integration with CosmWasm (or Interchain Security) that is not part of this repo at this time.

  1. Alice bonds 500 ATOM to iqlusion.io
  2. Alice executes MsgTokenizeShares for the 500_000_000uatom and 500_000_000cosmosvaloper1xxxx42 in return.
  3. There is a staking DAO contract in cosmwasm that is willing to accept tokenizedshares from iqlusion.
  4. Alice excutes a multimsg sending 500_000_000cosmosvaloper1xxxx42 and MsgTransferTokenizeShareRecord to the address of the Staking DAO contract.
  5. The Staking contract queries the state to see shares to atom ratio for iqlusion and the pending rewards in the share record.
  6. Alice recieve 500_000_000ustatom from the staking dao contract.
Testnet

Please join our testnet for Release 0.2.

genesis.json

persistent_peers = "6aa0b269094af7e54fbfc1faa005845fe97269e4@34.124.241.85:26656,837a38ee4fdac1b0252f31eee9780ac74d685512@34.124.168.210:26656,dd0acaa93c4bae0be874cf52ae4487551756a1e0@35.240.151.206:26656"

Directories

Path Synopsis
app
params
Package params defines the simulation parameters in the simapp.
Package params defines the simulation parameters in the simapp.
cmd
testutil
network
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
Package network implements and exposes a fully operational in-process Tendermint test network that consists of at least one or potentially many validators.
x
distribution
Package distribution implements a Cosmos SDK module, that provides an implementation of the F1 fee distribution algorithm.
Package distribution implements a Cosmos SDK module, that provides an implementation of the F1 fee distribution algorithm.
distribution/migrations/v034
Package v034 is used for legacy migration scripts.
Package v034 is used for legacy migration scripts.
distribution/migrations/v036
Package v036 is used for legacy migration scripts.
Package v036 is used for legacy migration scripts.
distribution/migrations/v038
Package v038 is used for legacy migration scripts.
Package v038 is used for legacy migration scripts.
distribution/migrations/v040
Package v040 is copy-pasted from: https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/distribution/types/keys.go
Package v040 is copy-pasted from: https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/distribution/types/keys.go
distribution/types
Package types is a reverse proxy.
Package types is a reverse proxy.
genutil
Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
Package genutil contains a variety of genesis utility functionality for usage within a blockchain application.
slashing/migrations/v040
Package v040 is copy-pasted from: https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/slashing/types/keys.go
Package v040 is copy-pasted from: https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/x/slashing/types/keys.go
slashing/types
noalias DONTCOVER
noalias DONTCOVER
staking/migrations/v034
Package v034 is used for legacy migration scripts.
Package v034 is used for legacy migration scripts.
staking/migrations/v036
Package v036 is used for legacy migration scripts.
Package v036 is used for legacy migration scripts.
staking/migrations/v038
Package v038 is used for legacy migration scripts.
Package v038 is used for legacy migration scripts.
staking/migrations/v040
Package v040 is taken from: https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/x/staking/types/genesis.pb.go by copy-pasted only the relevants parts for Genesis.
Package v040 is taken from: https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/x/staking/types/genesis.pb.go by copy-pasted only the relevants parts for Genesis.
staking/types
Package types is a reverse proxy.
Package types is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL