Skip to content

Commit

Permalink
GitBook: [master] 30 pages and 23 assets modified
Browse files Browse the repository at this point in the history
  • Loading branch information
sauravtom authored and gitbook-bot committed Jan 11, 2021
1 parent 51a1aec commit f7a65dc
Show file tree
Hide file tree
Showing 54 changed files with 1,987 additions and 0 deletions.
Binary file added .gitbook/assets/ethsif.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 .gitbook/assets/peggy-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 .gitbook/assets/sifchain-token-economics.pdf
Binary file not shown.
Binary file added .gitbook/assets/sifchainaddliquidity.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 .gitbook/assets/sifchainappstructure.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 .gitbook/assets/sifchaincreatepool.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 .gitbook/assets/sifchaincreateswapflow.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 .gitbook/assets/sifchaindecommissionflow.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 .gitbook/assets/sifchainevent.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 .gitbook/assets/sifchainmessages.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 .gitbook/assets/sifchainremoveliquidity.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 .gitbook/assets/sifchainstructs.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 .gitbook/assets/sifchainswap.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 .gitbook/assets/sifeth.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Welcome to Sifchain

![](.gitbook/assets/twitter-header_environment-1500x500px-large-logo.jpg)

{% embed url="https://sifchain.finance/" %}



49 changes: 49 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Table of contents

* [Welcome to Sifchain](README.md)

## Getting Started

* [Introduction to Sifchain](getting-started/introduction-to-sifchain.md)
* [Technical Overview](getting-started/overview-of-technical-concepts/README.md)
* [Cosmos SDK](getting-started/overview-of-technical-concepts/cosmos-sdk/README.md)
* [Application-Specific Blockchains](getting-started/overview-of-technical-concepts/cosmos-sdk/application-specific-blockchains.md)
* [Starport IBC](getting-started/overview-of-technical-concepts/starport-ibc/README.md)
* [Genesis File](getting-started/overview-of-technical-concepts/starport-ibc/genesis-file.md)
* [EVM Smart Contracts](getting-started/overview-of-technical-concepts/starport-ibc/evm-smart-contracts.md)
* [WASM smart contracts](getting-started/overview-of-technical-concepts/starport-ibc/wasm-smart-contracts.md)

## Core Concepts

* [Sifnode](core-concepts/sifnode.md)
* [Peggy](core-concepts/peggy/README.md)
* [Pegged Tokens \(General Case\)](core-concepts/peggy/general-case-mode-for-pegged-tokens.md)
* [Sifchain Ethereum Bridge](core-concepts/peggy/sifchain-ethereum-bridge.md)
* [User Flows](core-concepts/peggy/user-flows.md)
* [Peggy Smart Contracts](core-concepts/peggy/peggy-smart-contracts.md)
* [Sifchain Liquidity Pools](core-concepts/liquidity-pool/README.md)
* [CLP Architecture](core-concepts/liquidity-pool/clp-architecture.md)
* [Sifchain Consensus](core-concepts/sifchain-consensus.md)

## Roles

* [Validators](roles/validators.md)
* [Swappers](roles/swappers.md)
* [Liquidity Providers](roles/liquidity-providers.md)
* [Traders](roles/traders.md)

## Resources

* [Tutorials](resources/tutorials/README.md)
* [Peggy Tutorial](resources/tutorials/peggy-tutorial.md)
* [Peggy ethBridge Tutorial](resources/tutorials/peggy-ethbridge-tutorial.md)
* [Running Sifnode and becoming a Sifchain validator](resources/tutorials/running-sifnode-and-becoming-a-sifchain-validator.md)
* [Running Sifnode on Kubernetes](resources/tutorials/running-sifchain-validator-on-kubernetes.md)
* [Tokenomics](https://sifchain.finance/token-economics%20)
* [Testnet Blockexplorer](https://blockexplorer-testnet.sifchain.finance/)

## Join Sifchain

* [Sifchain Communities](join-sifchain/sifchain-communities.md)
* [Contributing to Sifchain](join-sifchain/contributing-to-sifchain.md)

98 changes: 98 additions & 0 deletions core-concepts/liquidity-pool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Sifchain Liquidity Pools

A liquidity pool is a primitive for many decentralized cryptocurrency trading platforms including [Uniswap](https://docs.ethhub.io/guides/graphical-guide-for-understanding-uniswap), [Sushiswap](https://boxmining.com/sushi/), [Balancer](https://docs.balancer.finance/getting-started/faq#balancer-pools), Mooniswap \(from 1inch\), MCDEX, [Thorchain](https://docs.thorchain.org/how-it-works/continuous-liquidity-pools), Perpetual Protocol, [Curve](https://www.curve.fi/stableswap-paper.pdf), [Bancor](https://support.bancor.network/hc/en-us/articles/360000472072-What-Are-Bancor-Liquidity-Pools-#:~:text=Liquidity%20pools%20perform%20autonomous%2C%20peer,holding%20its%20%E2%80%9Cpool%20token%E2%80%9D.%29) and more. Binance has even created a liquidity pool swap program on its centralized exchange because the returns are so lucrative.‌

Sifchain's liquidity pools are based on Sushiswap with extensibility in mind for potential updates. Rowan will be the settlement token for each pool, meaning each pool will contain Rowan as one asset and an external asset as the other. Sifchain’s swap UI will support swaps between external assets \(for example, cMKR:cCOMP\) but such transactions will actually require two swaps between two different liquidity pools \(for example, cMKR:ROWAN and then ROWAN:cCOMP\).‌

Liquidity providers need to be able to add liquidity into Sifchain’s liquidity pools where they can earn income. Liquidity providers should be able to deposit any token Sifchian supports to the appropriate pool. They should be able to add [asymmetrically](https://medium.com/thorchain/asymmetric-withdrawals-on-bepswap-a6924ed2f28b), meaning they can add only Rowan or only TKN for any token. This is as opposed to Uniswap where users must add equal values of the settlement token \(ETH\) and the other token \(TKN\). Liquidity providers should be able to add or remove liquidity whenever they choose.‌

Sifchain allows swappers to send a transaction to a liquidity pool with the amount of tokens they want to give up in exchange for tokens on the other side of the pool. Sifchain uses both an order book and a CLP for trade completion.‌

## Asymmetric Liquidity Pool‌ <a id="asymmetric-liquidity-pool"></a>

In many decentralized exchanges, users can add liquidity to liquidity pools and earn a portion of the transaction fees charged to other users who want to swap tokens in the pool. The constraint that most liquidity pools put on liquidity providers is that they must put in an equal value of each token pair. For example, in the ETH/DAI liquidity pool in Uniswap, a user is required to add 2.64 ETH for every 1,000 DAI that is added at the time of this writing. And then based on the amount the user puts into the pool, they then receive a proportionate amount of the fees charged.‌

With Sifchain, users who want to add liquidity to a pool can add any amount of either or both tokens. This is known as adding liquidity asymmetrically, which gives users ultimate flexibility. Based on the amount of tokens in the pool and the amount that the user adds, they will then own a percentage of the entire pool. Sifchain will initially use the same formula to calculate ownership as BEPSwap.‌

**When a user only puts in one side of the pool, how is their ownership percentage calculated?**

The formula that is used to calculate ownership % is designed to incentivize users to keep the liquidity pool balanced. As one side of the pool increases, users can gain a higher % of the overall pool by adding tokens to the other side.‌

Below is the formula used to calculate the units owned by a user when they add Rowan or another asset to the liquidity pool.

$$
slipAdjustment = 1 - |\frac{Ra-rA}{(2R + r)*(a +A)}|
$$

$$
units = \frac{P(rA+Ra)}{2RA}*slipAdjustment
$$

where‌

r = rowan deposited‌

a = asset deposited‌

R = Rowan Balance \(before\)

A = Asset Balance \(before\)

P = Existing Pool Units‌

The liquidity provider is allocated a portion of the fees collected from swappers proportional to their ownership of the pool. For example, If the liquidity provider owns 2% of the pool, they are allocated 2% of the fees collected. Learn more about asymmetric liquidity pools here‌

[https://medium.com/sifchain-finance/sifchain-technical-introduction-advantages-of-an-asymmetric-liquidity-pool-93bedae3986c](https://medium.com/sifchain-finance/sifchain-technical-introduction-advantages-of-an-asymmetric-liquidity-pool-93bedae3986c)

### Validator Subsystem <a id="validator-subsystem"></a>

Validators stake tokens to earn ROWAN.‌

Variables‌

* inflation rate
* percentage of tokens staked
* delegation rates

Revenue source‌s

* minting policy
* slashing rate

![](https://gblobscdn.gitbook.com/assets%2F-MMWSB3Kf9g5504mhpLn%2F-MMaQQ83RZCKP6CGkn0C%2F-MMa_csi70arcERz7d_l%2FScreen%20Shot%202020-11-20%20at%2010.27.03%20PM.png?alt=media&token=37c7f386-a86e-4ec8-b0d0-de6bdd0561aa)

### Liquidity Provider Subsystem <a id="liquidity-provider-subsystem"></a>

Participants provide liquidity to sifchain's CLP and earn rewards in ROWAN tokens.‌

Variables‌

* Rowan \(settlement\) token price
* swap volumes
* number of unique liquidity providers

Revenue sources‌

* Liquidity fee policy
* Swapping activity


![](https://gblobscdn.gitbook.com/assets%2F-MMWSB3Kf9g5504mhpLn%2F-MMaQQ83RZCKP6CGkn0C%2F-MMa_j1HaVo5d4moISEQ%2FScreen%20Shot%202020-11-20%20at%2010.27.28%20PM.png?alt=media&token=99830407-dc84-4af3-9448-62f94ad5a7cd)

### Rebalancing Policy <a id="rebalancing-policy"></a>

The incentive Pendulum keeps the network in a balanced state. It stops the network from becoming unsafe or inefficient by changing the distribution of rewards to node operators and liquidity

![](https://gblobscdn.gitbook.com/assets%2F-MMWSB3Kf9g5504mhpLn%2F-MMaQQ83RZCKP6CGkn0C%2F-MMa_sTnDeac6bjKxxfr%2FScreen%20Shot%202020-11-20%20at%2010.28.08%20PM.png?alt=media&token=1a63d547-b125-4f90-a259-ec6df0e50e51)

### Sifchain Liquidity pool features <a id="sifchain-liquidity-pool-features"></a>

* Slip based fee model inspired by Thorchain
* Rowan as settlement token for all pools
* Asymmetric deposits and withdraws

## Liquidity Pools Architecture‌ <a id="liquidity-pools-architecture"></a>

[https://github.com/Sifchain/sifnode/blob/develop/docs/4.Liquidity%20Pools%20Architecture.md](https://github.com/Sifchain/sifnode/blob/develop/docs/4.Liquidity%20Pools%20Architecture.md)

Loading

0 comments on commit f7a65dc

Please sign in to comment.