Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
masaun committed Feb 11, 2020
1 parent 86d4866 commit 22f5ac6
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 77 deletions.
163 changes: 87 additions & 76 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,87 @@

# Bancor Protocol Contracts v0.5 (beta)

## Overview

Bancor is a decentralized liquidity protocol that provides tokens with constant liquidity. The protocol is made up of a series of smart contracts which are designed to pool liquidity and perform non-custodial token-to-token conversions in a single transaction. More than 150 tokens are integrated with the Bancor Protocol, including ETH, EOS, DAI, IQ, PEOS & more.

* Join the [Bancor Developers Telegram group](https://t.me/BancorDevelopers) or the [Bancor Protocol Telegram group](https://t.me/bancor)
* Check out the [Bancor Blog](https://blog.bancor.network/)
* Read the Bancor Protocol [Whitepaper](https://storage.googleapis.com/website-bancor/2018/04/01ba8253-bancor_protocol_whitepaper_en.pdf)
* Visit the [Bancor Web App](https://www.bancor.network/communities/5a780b3a287443a5cdea2477?utm_source=social&utm_medium=github&utm_content=readme)

## How Bancor Works

Token conversions via the Bancor Protocol are executed against on-chain liquidity pools known as “Bancor Relays”. Each Relay holds reserves of both BNT (Bancor’s Network Token) and a base token (which could be any ERC20 or EOS-based token, with more blockchains to come). For instance, the base token for the ‘DAIBNT’ Relay is DAI.

A Relay’s reserves receive and dispense tokens in order to fulfill trades and are autonomously rebalanced to determine prices. Selling BNT for the base token increases the size of the BNT reserve and decreases the size of the base token’s reserve. This shifts the reserve ratio, increasing the base token's price relative to BNT for subsequent transactions. The larger a trade relative to the total size of the reserves, the more price slippage will occur.

Since BNT is a common pair for all Relays, it can be used as an intermediary allowing direct token-token trades in a single transaction, including across different blockchains. Notably, traders never need to hold BNT to perform conversions via Bancor Protocol.

## Providing Liquidity on Bancor

Anyone can become a liquidity provider to a Relay and contribute to its reserves. This is different than buying tokens on Bancor. It requires staking tokens in a Relay. Users can stake their tokens in a Relay by buying “Relay Tokens” on bancor.network, or through any third-party liquidity portal built atop the Bancor Protocol. Relay Tokens can be sold at any time to withdraw a proportional share of the Relay’s liquidity.

Each time a Relay processes a conversion, a small liquidity provider fee (usually 0.1-0.3%) is taken out of each trade and deposited into the Relay’s reserves. These fees function as an incentive for liquidity providers who can withdraw their proportional share of the reserves including the accumulated fees. The larger a Relay’s reserves, the lower the slippage costs incurred by traders transacting with the Relay, driving more conversion volume and, in turn, more fees for liquidity providers.

Currently, whoever initiates the Relay determines its fees, while in the future, liquidity providers will be able to vote on the Relay’s fee. Bancor takes no platform fee from trades.

## Upgradeability

All smart contract functions are public and all upgrades are opt-in. If significant improvements are made to the system a new version will be released. Token owners can choose between moving to the new system or staying in the old one. If possible, new versions will be backwards compatible and able to trade with the old versions.

## Language

A “Smart Token” refers to tokens which utilize reserves to automate trading, including “Liquid Tokens” (one reserve), “Relay Tokens” (two reserves) and “Array Tokens” (three or more reserves). See Section 6 of the [Bancor Whitepaper](https://storage.googleapis.com/website-bancor/2018/04/01ba8253-bancor_protocol_whitepaper_en.pdf) (“Smart Token Configurations”) for more details.

The terms “reserves” and “connectors” have the same meaning throughout Bancor’s smart contract code and documentation. “Reserve ratio” and “connector weight” are also used interchangeably. “Connector balance” refers to the token inventories held in a Smart Token’s reserve.

## Warning

Bancor is a work in progress. Make sure you understand the risks before using it.

## Testing

### Prerequisites

* node 10.16.0
* npm 6.9.0
* python 3.7.3
* web3.py 4.9.2

### Installation

* `npm install`

### Verification

* Verifying all the contracts:
* `npm test 1` (quick testing)
* `npm test 2` (full coverage)
* [Verifying the BancorFormula contract](solidity/python/README.md)

### [Utilities](solidity/utils/README.md)

## Collaborators

* **[Yudi Levi](https://github.com/yudilevi)**
* **[Barak Manos](https://github.com/barakman)**
* **[Ilana Pinhas](https://github.com/ilanapi)**
* **[David Benchimol](https://github.com/davidbancor)**
* **[Or Dadosh](https://github.com/ordd)**
* **[Martin Holst Swende](https://github.com/holiman)**

## License

Bancor Protocol is open source and distributed under the Apache License v2.0
# Bancor Liquidly Pool with Compound

***
## 【Introduction of Bancor Liquidly Pool with Compound】
- This is the "Bancor Liquidly Pool with Compound".
- This is one of system of "new bancor pool design" that integrate Compound (cToken) with Bancor Pool by using bancor and compound protocol.
- I try to integrate Compound with Bancor Pool
- Both of token (cToken and BNT) are conbined and published as SmartToken (i.e. "cDAIBNT")
- Currently, I implement them on ropsten

 


***

## 【Setup for testing system behaviir in frontend】
### Setup wallet by using Metamask
1. Add MetaMask to browser (Chrome or FireFox or Opera or Brave)
https://metamask.io/


2. Adjust appropriate newwork below
```
Ropsten Test Network
```

 


### Setup backend
1. Deploy contracts to Ropsten Test Network
```
(root directory)
$ npm run migrate:ropsten
```

 


### Setup frontend
1. Execute command below in root directory.
```
$ npm run client
```

2. Access to browser by using link
```
http://127.0.0.1:3000
```

 

***


## 【Work flow】

 

***

## 【References】
- Gitcoin / Sustain Web3
- Bancor Challenge 2 — New Liquidity Pool Designs
https://gitcoin.co/issue/bancorprotocol/contracts/337/3948

- Document of bancor protocol
- How to Create a Bancor Liquidity Pool
https://docs.bancor.network/user-guides/token-integration/how-to-create-a-bancor-liquidity-pool
- ContractAddress on Ropsten Network
https://support.bancor.network/hc/en-us/articles/360010410399-Ethereum-Ropsten-Network-
- ContractAddress(Called by `addressOf()`
https://docs.bancor.network/user-guides/network-data-and-stats/ethereum-contract-addresses

- Document of compound protocol
- ContractAddress of cToken on Ropsten
https://compound.finance/developers

- Github of bancor protocol
- Bancor Protocol Contracts v0.5 (beta)
https://github.com/bancorprotocol/contracts

- Reference dApp
- Co-Trader:https://bancor.cotrader.com/#/pool
- Zerion (Invest tab): https://app.zerion.io
2 changes: 1 addition & 1 deletion client/src/components/NewBancorPool/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default class NewBancorPool extends Component {
p={20}
borderColor={"#E8E8E8"}
>
<h4>New Bancor Pool</h4>
<h4>Bancor Liquidly Pool with Compound</h4>
<h5>(Try to integrate Compound with Bancor Pool)</h5>

<Image
Expand Down

0 comments on commit 22f5ac6

Please sign in to comment.