Skip to content

Commit

Permalink
Overview and Integrate sections, gov module docs update (#195)
Browse files Browse the repository at this point in the history
* Incentives Update + reorder

Rewrite of Incentives guide
Removed LBP page - should be pushing to Streamswap instead, will include in Liquidity page
Ordered sidebar according to onboarding flow
Added SetSuperfluidAssets guide

* Layout Change

Change folder/sidebar layout + routing
Change overall index page layout to be new user friendly
Add index page for overview section
Merge governance and OSMO into new page about the OSMO token usage - to be reviewed
Removed section on self-governing liquidity pools
All new pages to be reviewed

* Update Airdrop Snapshot

Grammar and layout fixes plus some clarifications

* Update Initial Liquidity

Complete rewrite
Removed reference to pool creation (will be dealt with on earlier page)
Changed LBP process to StreamSwap
Updated Loan Swap process
Added Token Swap process

* Update Frontend page

Trim down to just "How to list on Main" Move Frontend details to the registration section next

* Update Create pool

Add page to explain how to create a pool
Fix ordering/layout on others

* Add transfer page

Page contains information on how to connect a new chain to Osmosis and have it recognised by explorers.

* Add non-IBC connection

* Tidy Registration

Moved frontend and price oracle registration here

* Osmo Token

* Update gov Module

* Format Incentives module

* Remove assets

* re-add assets

* Update since incentive changes

* Update OSMO token info

* Arrange sidebar
  • Loading branch information
JohnnyWyles authored Oct 26, 2023
1 parent 92a1c13 commit ecdb18d
Show file tree
Hide file tree
Showing 25 changed files with 941 additions and 1,178 deletions.
Binary file added docs/assets/asset_list.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/createpool.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/deploymentpreview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
293 changes: 174 additions & 119 deletions docs/osmosis-core/modules/gov/README.md

Large diffs are not rendered by default.

136 changes: 57 additions & 79 deletions docs/osmosis-core/modules/incentives/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,55 @@ type MsgAddToGauge struct {
- Modify the `Gauge` record by adding `msg.Rewards`
- Transfer the tokens from the `Owner` to incentives `ModuleAccount`.

## Transactions

### create-gauge

Create a gauge to distribute rewards to users

```sh
osmosisd tx incentives create-gauge [lockup_denom] [reward] [flags]
```

**Example 1**

I want to make incentives for LP tokens of pool 3, namely gamm/pool/3 that have been locked up for at least 1 day.
I want to reward 100 AKT to this pool over 2 days (2 epochs). (50 rewarded on each day)
I want the rewards to start dispersing on 21 December 2021 (1640081402 UNIX time)

```bash
osmosisd tx incentives create-gauge gamm/pool/3 10000ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4 \
--duration 24h --start-time 1640081402 --epochs 2 --from WALLET_NAME --chain-id osmosis-1
```

**Example 2**

I want to make incentives for ATOM (ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2) that have been locked up for at least 1 week (168h).
I want to reward 1000 JUNO (ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED) to ATOM holders perpetually (perpetually meaning I must add more tokens to this gauge myself every epoch). I want the reward to start dispersing immediately.

```bash
osmosisd tx incentives create-gauge ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 \
1000000000ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED --perpetual --duration 168h \
--from WALLET_NAME --chain-id osmosis-1
```

### add-to-gauge

Add coins to a gauge previously created to distribute more rewards to users

```sh
osmosisd tx incentives add-to-gauge [gauge_id] [rewards] [flags]
```

**Example**

I want to refill the gauge with 500 JUNO to a previously created gauge (gauge ID 1914) after the distribution.

```bash
osmosisd tx incentives add-to-gauge 1914 500000000ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED \
--from WALLET_NAME --chain-id osmosis-1
```

## Events

The incentives module emits the following events:
Expand Down Expand Up @@ -236,62 +285,6 @@ epochs, the identifier is required to check if distribution should be
done at `AfterEpochEnd` hook



## Transactions

### create-gauge

Create a gauge to distribute rewards to users

```sh
osmosisd tx incentives create-gauge [lockup_denom] [reward] [flags]
```

::: details Example 1

I want to make incentives for LP tokens of pool 3, namely gamm/pool/3 that have been locked up for at least 1 day.
I want to reward 100 AKT to this pool over 2 days (2 epochs). (50 rewarded on each day)
I want the rewards to start dispersing on 21 December 2021 (1640081402 UNIX time)

```bash
osmosisd tx incentives create-gauge gamm/pool/3 10000ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4 \
--duration 24h --start-time 1640081402 --epochs 2 --from WALLET_NAME --chain-id osmosis-1
```

:::

::: details Example 2

I want to make incentives for ATOM (ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2) that have been locked up for at least 1 week (168h).
I want to reward 1000 JUNO (ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED) to ATOM holders perpetually (perpetually meaning I must add more tokens to this gauge myself every epoch). I want the reward to start dispersing immediately.

```bash
osmosisd tx incentives create-gauge ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2 \
1000000000ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED --perpetual --duration 168h \
--from WALLET_NAME --chain-id osmosis-1
```

:::

### add-to-gauge

Add coins to a gauge previously created to distribute more rewards to users

```sh
osmosisd tx incentives add-to-gauge [gauge_id] [rewards] [flags]
```

::: details Example

I want to refill the gauge with 500 JUNO to a previously created gauge (gauge ID 1914) after the distribution.

```bash
osmosisd tx incentives add-to-gauge 1914 500000000ibc/46B44899322F3CD854D2D46DEEF881958467CDD4B3B10086DA49296BBED94BED \
--from WALLET_NAME --chain-id osmosis-1
```

:::

## Queries

In this section we describe the queries required on grpc server.
Expand Down Expand Up @@ -326,7 +319,7 @@ Query active gauges
osmosisd query incentives active-gauges [flags]
```

::: details Example
**Example**

```bash
osmosisd query incentives active-gauges
Expand Down Expand Up @@ -364,9 +357,6 @@ pagination:
total: "0"
...
```

:::

### active-gauges-per-denom

Query active gauges per denom
Expand All @@ -375,7 +365,7 @@ Query active gauges per denom
osmosisd query incentives active-gauges-per-denom [denom] [flags]
```

::: details Example
**Example**

Query all active gauges distributing incentives to holders of gamm/pool/341

Expand Down Expand Up @@ -416,8 +406,6 @@ pagination:
...
```

:::

### distributed-coins

Query coins distributed so far
Expand All @@ -426,7 +414,7 @@ Query coins distributed so far
osmosisd query incentives distributed-coins [flags]
```

::: details Example
**Example**

```bash
osmosisd query incentives distributed-coins
Expand Down Expand Up @@ -466,8 +454,6 @@ coins:
denom: uosmo
```

:::

### gauge-by-id

Query gauge by id
Expand All @@ -476,7 +462,7 @@ Query gauge by id
osmosisd query incentives gauge-by-id [id] [flags]
```

::: details Example
**Example**

Query the incentive distribution for gauge ID 1:

Expand Down Expand Up @@ -504,8 +490,6 @@ gauge:
start_time: "2021-06-19T04:30:19.082462364Z"
```

:::

### gauges

Query available gauges
Expand All @@ -514,7 +498,7 @@ Query available gauges
osmosisd query incentives gauges [flags]
```

::: details Example
**Example**

Query ALL gauges (by default the limit is 100, so here I will define a much larger number to output all gauges)

Expand Down Expand Up @@ -559,8 +543,6 @@ pagination:
...
```

:::

### rewards-estimation

Query rewards estimation
Expand All @@ -575,7 +557,7 @@ Query coins that is going to be distributed
osmosisd query incentives to-distribute-coins [flags]
```

::: details Example
**Example**

```bash
osmosisd query incentives to-distribute-coins
Expand Down Expand Up @@ -611,8 +593,6 @@ coins:
denom: uosmo
```

:::

### upcoming-gauges

Query scheduled gauges (gauges whose `start_time` has not yet occurred)
Expand All @@ -621,7 +601,7 @@ Query scheduled gauges (gauges whose `start_time` has not yet occurred)
osmosisd query incentives upcoming-gauges [flags]
```

::: details Example
**Example**

```bash
osmosisd query incentives upcoming-gauges
Expand All @@ -645,6 +625,4 @@ Using this command, we will see the gauge we created earlier, among all other up
num_epochs_paid_over: "2"
start_time: "2021-12-21T10:10:02Z"
...
```

:::
```
14 changes: 14 additions & 0 deletions docs/overview/educate/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"position": 4,
"label": "Overview",
"collapsible": true,
"collapsed": true,
"className": "red",
"link": {

"title": "Overview"
},
"customProps": {
"description": "The guides on this page will give a grounding on Osmosis functionality."
}
}
101 changes: 101 additions & 0 deletions docs/overview/educate/getting-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
sidebar_position: 3
---
# Getting Started
## Set up a Wallet
Before opening the Osmosis AMM App, make sure to install the [Keplr Wallet](wallets/keplr/README.md).

## Open the App
Go to [https://app.osmosis.zone/](https://app.osmosis.zone/)

![](../../assets/started-trade-page.png)

## Connect Wallet
![](../../assets/connect-wallet.png)

Click Approve. This confirms that you are connecting to the app.osmosis.zone and the chain osmosis-1.

![](../../assets/keplr-connect.png)


Always make sure you are connected to app.osmosis.zone name and network (osmosis-1)


## Deposit Funds

![](../../assets/started-assets-page.png)

Click Assets. Then click on the deposit link next to the asset name. For this example we are clicking the ATOM deposit link.

Accept connection to cosmoshub-4

![](../../assets/connect-cosmoshub.png)


Once connected, select how much you would like to deposit, then click the deposit button

[](../../assets/deposit-dialog.png)

Approve the transaction

![](../../assets/approve-tramsaction.png)

Once the transaction is completed a series if confirmations notifications will be displayed including the IBC confirmation.

![](../../assets/confirm-2.png)

## Swapping Tokens

Trading tokens is as easy as clicking on the Trade link and then selecting the pair you would like to trade. Check out the [glossary](terminology.md) to learn about terms such as [slipage](terminology.md#slippage).
![](../../assets/swap.png)


## Adding Liquidity to a Pool
Select a pool from the [Pools](https://app.osmosis.zone/pools) page.
![](../../assets/add-liquidity.png)

Then click Add/Remove Liquidity
![](../../assets/add-remove-liquidity.png)

Input a quantity of one of the assets. The quantity of the other asset(s) will auto-complete. (Pools require assets to be deposited in pre-determined weights.)

:::warning Warning
Please note that simply adding liquidity will not give you rewards. In order to get rewards you must bond LP tokens.
:::

![](../../assets/add-liquidity.png)

To remove liquidity, input the percentage amount to withdraw.

![](../../assets/remove-liquidity.png)

Incentivized pools receive OSMO liquidity mining rewards. Rewards are distributed to bonded LP tokens in these pools that meeting the bonding length criteria.

Swap fees are fees charged for making a swap in an LP pool. The fee is paid by the trader in the form of the input asset. Pool creators specify the swap fee when establishing the pool. The total fee for a particular trade is calculated as percentage of swap size. Fees are added to the pool, effectively resulting in pro-rata distribution to LPs proportional to their share of the total pool.

## Bonding LP Tokens
Start Earning! Users can choose to bond their LP tokens after depositing liquidity. LP tokens remain bonded for a length of their time of their choosing. Bonded LP tokens are eligible for liquidity mining rewards if they meet the minimum bonding length requirement.

Click Start Earning and choose a bonding length.

![](../../assets/start-earning.png)



### Internal Incentives

### External Incentives

Osmosis not only allows the community to add incentives to gauges. Anyone can deposit tokens into a gauge to be distributed. This feature allows outside parties to augment Osmosis’ own liquidity incentive program.

For example, there may be an ATOM< >FOOCOIN pool that has a one-day gauge incentivized by governance OSMO rewards. However, the Foo Foundation may also choose to add additional incentives to the one-day gauge or even add incentives to a new gauge (such as one-week gauge).

These external incentive providers can also set up long-lasting incentive programs that distribute rewards over an extended time period. For example, the Foo Foundation can deposit 30,000 Foocoins to be distributed over a one-month liquidity program. The program will automatically distribute 1000 Foocoins per day to the gauge.

## Go Superfluid!

## Unbonding LP Tokens
When a user wants to stop bonding an LP token, they submit a transaction that begins the unbonding period. After the end of the timer, they can submit another transaction to withdraw the tokens.



12 changes: 12 additions & 0 deletions docs/overview/educate/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Overview
sidebar_position: 0
---
import DocCardList from '@theme/DocCardList';

# Introduction

The guides on this page will explain background information on Osmosis.

<DocCardList />

Loading

1 comment on commit ecdb18d

@vercel
Copy link

@vercel vercel bot commented on ecdb18d Oct 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.