Skip to content

Commit

Permalink
Docbuild automation (#1492)
Browse files Browse the repository at this point in the history
* docbuild automation

* tokenmodule spec docs

* sidebar fixes

* formatting fixes

* superlinter fixes

* superlinter fixes

* superlinter fixes

* superlinter fixes

* superlinter fixes

* superlinter fixes

* superlinter fixes

Co-authored-by: Xiangan He <[email protected]>
  • Loading branch information
xBalbinus and xBalbinus authored May 20, 2022
1 parent d610ff3 commit 16007fb
Show file tree
Hide file tree
Showing 9 changed files with 2,207 additions and 133 deletions.
57 changes: 56 additions & 1 deletion x/epochs/spec/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `epochs`
# Epochs

## Abstract

Expand All @@ -18,3 +18,58 @@ they can easily be signalled upon such events.
5. **[Hooks](05_hooks.md)**\
6. **[Queries](06_queries.md)**\
7. **[Future improvements](07_future_improvements.md)**

## Queries

### epoch-infos

Query the currently running epochInfos

```sh
osmosisd query epochs epoch-infos
```
::: details Example

An example output:

```sh
epochs:
- current_epoch: "183"
current_epoch_start_height: "2438409"
current_epoch_start_time: "2021-12-18T17:16:09.898160996Z"
duration: 86400s
epoch_counting_started: true
identifier: day
start_time: "2021-06-18T17:00:00Z"
- current_epoch: "26"
current_epoch_start_height: "2424854"
current_epoch_start_time: "2021-12-17T17:02:07.229632445Z"
duration: 604800s
epoch_counting_started: true
identifier: week
start_time: "2021-06-18T17:00:00Z"
```
:::

### current-epoch

Query the current epoch by the specified identifier

```sh
osmosisd query epochs current-epoch [identifier]
```

::: details Example

Query the current `day` epoch:

```sh
osmosisd query epochs current-epoch day
```

Which in this example outputs:

```sh
current_epoch: "183"
```
:::
128 changes: 42 additions & 86 deletions x/gamm/README.md → x/gamm/spec/05_queries_transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,44 @@ The **Query** submodule of the GAMM module provides the logic to request informa
- [Total Liquidity](#total-liquidity)
- [Total Share](#total-share)

## Estimate Swap Exact Amount In

### Estimate Swap Exact Amount In
Query the estimated result of the [Swap Exact Amount In](#swap-exact-amount-in) transaction. Note that the flags *swap-route-pool* and *swap-route-denoms* are required.

### Usage

#### Usage
```sh
osmosisd query gamm estimate-swap-exact-amount-in <poolID> <sender> <tokenIn> [flags]
```

### Example

#### Example
Query the amount of ATOM the sender would receive for swapping 1 OSMO in pool 1.

```sh
osmosisd query gamm estimate-swap-exact-amount-in 1 osmo123nfq6m8f88m4g3sky570unsnk4zng4uqv7cm8 1000000uosmo --swap-route-pool-ids 1 --swap-route-denoms ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2
```

## Estimate Swap Exact Amount Out

### Estimate Swap Exact Amount Out
Query the estimated result of the [Swap Exact Amount Out](#swap-exact-amount-out) transaction. Note that the flags *swap-route-pool* and *swap-route-denoms* are required.

### Usage

#### Usage
```sh
osmosisd query gamm estimate-swap-exact-amount-out <poolID> <sender> <tokenOut> [flags]
```

### Example

#### Example
Query the amount of OSMO the sender would require to swap 1 ATOM out of pool 1.

```sh
osmosisd query gamm estimate-swap-exact-amount-out 1 osmo123nfq6m8f88m4g3sky570unsnk4zng4uqv7cm8 1000000ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --swap-route-pool-ids 1 --swap-route-denoms uosmo
```

## Num Pools

### Num Pools
Query the number of active pools.

### Usage

#### Usage
```sh
osmosisd query gamm num-pools
```

## Pool

Query the parameter and assets of a specific pool.
<<<<<<< HEAD:x/gamm/spec/05_queries_transactions.md
Query the parameter and assets of a specific pool.

### Usage

Expand All @@ -75,106 +64,79 @@ osmosisd query gamm pool <poolID> [flags]

### Example

>>>>>>> main:x/gamm/README.md
Query parameters and assets from pool 1.

```sh
osmosisd query gamm pool 1
```

## Pool Assets

### Pool Assets
Query the assets of a specific pool. This query is a reduced form of the [Pool](#pool) query.

### Usage

#### Usage
```sh
osmosisd query gamm pool-assets <poolID> [flags]
```

Query the assets from pool 1.

### Example

#### Example
```sh
osmosisd query gamm pool-assets 1
```

## Pool Params

### Pool Params
Query the parameters of a specific pool. This query is a reduced form of the [Pool](#pool) query.

### Usage

#### Usage
```sh
osmosisd query gamm pool-params <poolID> [flags]
```

Query the parameters from pool 1.

### Example

#### Example
```sh
osmosisd query gamm pool-params 1
```

## Pools

### Pools
Query parameters and assets of all active pools.

### Usage

```sh
osmosisd query gamm pools
```

## Spot Price

Query the spot price of a pool asset based on a specific pool it is in.

### Usage

```sh
osmosisd query gamm spot-price <poolID> <tokenInDenom> <tokenOutDenom> [flags]
```

### Example

#### Usage
Query the price of OSMO based on the price of ATOM in pool 1.

```sh
osmosisd query gamm spot-price 1 uosmo ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2
```

## Total Liquidity

### Total Liquidity
Query the total liquidity of all active pools.

### Usage

#### Usage
```sh
osmosisd query gamm total-liquidity
```

## Total Share

### Total Share
Query the total amount of GAMM shares of a specific pool.

### Usage

#### Usage
```sh
osmosisd query gamm total-share <poolID> [flags]
```

### Example

#### Example
Query the total amount of GAMM shares of pool 1.

```sh
osmosisd query gamm total-share 1
```

# Transactions



### Transactions
The **Transaction** submodule of the GAMM module provides the logic to create and interact with the liquidity pools. It contains the following functions:

- [Create Pool](#create-pool)
Expand All @@ -187,8 +149,8 @@ The **Transaction** submodule of the GAMM module provides the logic to create an
- [Swap Exact Amount In](#swap-exact-amount-in)
- [Swap Exact Amount Out](#swap-exact-amount-out)

## Create Pool

### Create Pool
Create a new liquidity pool and provide the initial liquidity to it. Pool initialization parameters must be provided through a JSON file using the flag *pool-file*.

#### Usage
Expand All @@ -199,7 +161,7 @@ osmosisd tx gamm create-pool [flags]

The configuration file *config.json* must specify the following parameters.

```sh
```json
{
"weights": [list weighted denoms],
"initial-deposit": [list of denoms with initial deposit amount],
Expand All @@ -208,9 +170,7 @@ The configuration file *config.json* must specify the following parameters.
"future-governor": [number of hours]
}
```

### Example

#### Example
Create a new ATOM-OSMO liquidity pool with a swap and exit fee of 1%.

```sh
Expand All @@ -219,7 +179,7 @@ tx gamm create-pool --pool-file ../public/config.json --from myKeyringWallet

The configuration file contains the following parameters.

```sh
```json
{
"weights": "5uatom,5uosmo",
"initial-deposit": "100uatom,100uosmo",
Expand All @@ -229,8 +189,9 @@ The configuration file contains the following parameters.
}
```

## Join Pool


### Join Pool
Join a specific pool with a custom amount of tokens. Note that the flags *pool-id*, *max-amounts-in* and *share-amount-out* are required.

#### Usage
Expand All @@ -247,8 +208,8 @@ Join pool 1 with 1 OSMO and the respective amount of ATOM, using myKeyringWallet
osmosisd tx gamm join-pool --pool-id 2 --max-amounts-in 1000000uosmo --max-amounts-in 1000000uion --share-amount-out 1000000 --from myKeyringWallet
```

## Exit Pool

### Exit Pool
Exit a specific pool with a custom amount of tokens. Note that the flags *pool-id*, *min-amounts-out* and *share-amount-in* are required.

#### Usage
Expand All @@ -265,8 +226,8 @@ Exit pool one with 1 OSMO and the respective amount of ATOM using myKeyringWalle
osmosisd tx gamm exit-pool --pool-id 1 --min-amounts-out 1000000uosmo --share-amount-in 1000000 --from myKeyringWallet
```

## Join Swap Extern Amount In

### Join Swap Extern Amount In
Note that the flags *pool-id* is required.

#### Usage
Expand All @@ -281,12 +242,10 @@ osmosisd tx gamm join-swap-extern-amount-in [token-in] [share-out-min-amount] [f
osmosisd tx gamm join-swap-extern-amount-in 1000000uosmo 1000000 --pool-id 1 --from myKeyringWallet
```

## Exit Swap Extern Amount Out

### Exit Swap Extern Amount Out
Note that the flag *pool-id* is required.

#### Usage

```sh
osmosisd tx gamm exit-swap-extern-amount-out [token-out] [share-in-max-amount] [flags]
```
Expand All @@ -295,11 +254,10 @@ osmosisd tx gamm exit-swap-extern-amount-out [token-out] [share-in-max-amount] [

```sh
osmosisd tx gamm exit-swap-extern-amount-out 1000000uosmo 1000000 --pool-id 1 --from myKeyringWallet

```

## Join Swap Share Amount Out

### Join Swap Share Amount Out
Note that the flag *pool-id* is required.

#### Usage
Expand All @@ -314,8 +272,8 @@ osmosisd tx gamm join-swap-share-amount-out [token-in-denom] [token-in-max-amoun
osmosisd tx gamm join-swap-share-amount-out uosmo 1000000 1000000 --pool-id 1 --from myKeyringWallet
```

## Exit Swap Share Amount In

### Exit Swap Share Amount In
Note that the flag *pool-id* is required.

#### Usage
Expand All @@ -330,8 +288,7 @@ osmosisd tx gamm exit-swap-share-amount-in [token-out-denom] [share-in-amount] [
osmosisd tx gamm exit-swap-share-amount-in uosmo 1000000 1000000 --pool-id 1 --from myKeyringWallet
```

## Swap Exact Amount In

### Swap Exact Amount In
Swap an exact amount of tokens into a specific pool. Note that the flags *swap-route-pool-ids* and *swap-route-denoms* are required.

#### Usage
Expand All @@ -348,8 +305,8 @@ Swap 1 OSMO through pool 1 into at least 0.3 ATOM using MyKeyringWallet.
osmosisd tx gamm swap-exact-amount-in 1000000uosmo 300000 --swap-route-pool-ids 1 --swap-route-denoms ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 --from MyKeyringWallet
```

## Swap Exact Amount Out

### Swap Exact Amount Out
Swap an exact amount of tokens out of a specific pool. Note that the flags *swap-route-pool-ids* and *swap-route-denoms* are required.

### Usage
Expand All @@ -367,6 +324,5 @@ osmosisd tx gamm swap-exact-amount-out 1000000ibc/27394FB092D2ECCD56123C74F36E4C
```

## Other resources

- [Creating a liquidity bootstrapping pool](./client/docs/create-lbp-pool.md)
- [Creating a pool with a pool file](./client/docs/create-pool.md)
* [Creating a liquidity bootstrapping pool](./client/docs/create-lbp-pool.md)
* [Creating a pool with a pool file](./client/docs/create-pool.md)
Loading

0 comments on commit 16007fb

Please sign in to comment.