# Ledger

Ledger module allow users to liquidity stake/unstake rTokens and rToken relayers to send proposals.

## Way to Stake/Unstake rToken

* Stake: Take rATOM as an example, only a common transfer on Cosmos Hub is needed to get rATOM. By sending an amount of ATOM to the given pool accounts of rATOM, rToken relayers will receive the corresponding event and send an execute-bond-proposal to StafiHub which will mint rATOM for the from account.
* Unstake: [liquidity-unbond](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference) is the rpc interface for rToken holders to redeem their origin tokens.

## Available Query Commands

| Name                                                                                                        | Description                                    |
| ----------------------------------------------------------------------------------------------------------- | ---------------------------------------------- |
| [account-unbond](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)            | Query AccountUnbond                            |
| [bond-record](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)               | Query BondRecord                               |
| [bonded-pools](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)              | Query bonded-pools                             |
| [chain-era](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)                 | Query getChainEra                              |
| [era-exchange-rate](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)         | Query EraExchangeRate by a given denom and era |
| [era-exchange-rates](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)        | Query EraExchangeRatesByDenom                  |
| [era-unbond-limit](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)          | Query getEraUnbondLimit                        |
| [exchange-rate](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)             | Show ExchangeRate for a given denom            |
| [exchange-rate-list](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)        | List all ExchangeRate                          |
| [pool-detail](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)               | Query subaccounts and threshold of a pool      |
| [pool-unbond](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)               | Query unbonds by a given pool                  |
| [protocol-fee-receiver](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)     | Query protocol fee receiver                    |
| [relay-fee-receiver](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)        | Query relay fee receiver                       |
| [staking-reward-commission](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference) | Query staking reward commission                |
| [total-protocol-fee](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)        | Query total protocol fee                       |
| [unbond-commission](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)         | Query getUnbondCommission                      |
| [unbond-relay-fee](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference)          | Query getUnbondRelayFee                        |

### stafihubd query ledger account-unbond

```
stafihubd query ledger account-unbond [denom] [unbonder] [flags]
```

### stafihubd query ledger bond-record

```
stafihubd query ledger bond-record [denom] [txhash] [flags]
```

### stafihubd query ledger bonded-pools

```
stafihubd query ledger bonded-pools [denom] [flags]
```

### stafihubd query ledger chain-era

```
stafihubd query ledger chain-era [denom] [flags]
```

### stafihubd query ledger era-exchange-rate

```
stafihubd query ledger era-exchange-rate [denom] [era] [flags]
```

### stafihubd query ledger era-exchange-rates

```
stafihubd query ledger era-exchange-rates [denom] [flags]
```

### stafihubd query ledger era-unbond-limit

```
stafihubd query ledger era-unbond-limit [denom] [flags]
```

### stafihubd query ledger exchange-rate

```
stafihubd query ledger exchange-rate [denom] [flags]
```

### stafihubd query ledger exchange-rate-list

```
stafihubd query ledger exchange-rate-list [flags]
```

### stafihubd query ledger pool-detail

```
stafihubd query ledger pool-detail [denom] [pool] [flags]
```

### stafihubd query ledger pool-unbond

```
stafihubd query ledger pool-unbond [denom] [pool] [era] [flags]
```

### stafihubd query ledger protocol-fee-receiver

```
stafihubd query ledger protocol-fee-receiver [flags]
```

### stafihubd query ledger relay-fee-receiver

```
stafihubd query ledger relay-fee-receiver [denom] [flags]
```

### stafihubd query ledger staking-reward-commission

```
stafihubd query ledger staking-reward-commission [denom] [flags]
```

### stafihubd query ledger total-protocol-fee

```
stafihubd query ledger total-protocol-fee [flags]
```

### stafihubd query ledger unbond-commission

```
stafihubd query ledger unbond-commission [denom] [flags]
```

### stafihubd query ledger unbond-relay-fee

```
stafihubd query ledger unbond-relay-fee [denom] [flags]
```

### Useful Tx Commands

| Name                                                                                               | Description   |
| -------------------------------------------------------------------------------------------------- | ------------- |
| [liquidity-unbond](https://docs.stafihub.io/welcome-to-stafihub/chain/cli-client/broken-reference) | redeem rToken |

### stafihubd tx ledger liquidity-unbond

```
stafihubd tx ledger liquidity-unbond [pool] [value] [recipient] [flags]
```
