Forked from the Compound Protocol.
The Paribus Protocol is an Ethereum smart contract for supplying or borrowing assets. Through the pToken contracts, accounts on the blockchain supply capital (Ether or ERC-20 tokens) to receive pTokens or borrow assets from the protocol (holding other assets as collateral). The Paribus pToken contracts track these balances and algorithmically set interest rates for borrowers.
Before getting started with this repo, please read:
- The Paribus Litepaper
- The Compound Whitepaper, describing how Compound works
- The Compound Protocol Specification, explaining in plain English how the protocol operates
For questions about interacting with Paribus, please visit Paribus Discord server, Paribus Telegram channel.
For security concerns, please visit our Discord / Telegram group or email security@paribus.io.
We detail a few of the core contracts in the Paribus protocol.
- PToken, PErc20 and PEther
- The Paribus pTokens, which are self-contained borrowing and lending contracts. PToken contains the core logic and PErc20 and PEther add public interfaces for Erc20 tokens and ether, respectively. Each PToken is assigned an interest rate and risk model (see InterestRateModel and Comptroller sections), and allows accounts to *mint* (supply capital), *redeem* (withdraw capital), *borrow* and *repay a borrow*. Each PToken is an ERC-20 compliant token where balances represent ownership of the market.
- Comptroller
- The risk model contract, which validates permissible user actions and disallows actions if they do not fit certain risk parameters. For instance, the Comptroller enforces that each borrowing user must maintain a sufficient collateral balance across all pTokens.
- Paribus (PBX)
- The Paribus Governance Token (PBX).
- InterestRateModel
- Contracts which define interest rate models. These models algorithmically determine interest rates based on the current utilization of a given market (that is, how much of the supplied assets are liquid versus borrowed).
- SafeMath
- Library for safe math operations.
- ErrorReporter
- Library for tracking error codes and failure conditions.
- Exponential
- Library for handling fixed-point decimal numbers.
- SafeToken
- Library for safely handling Erc20 interaction.
- WhitePaperInterestRateModel
- Initial interest rate model, as defined in the Whitepaper. This contract accepts a base rate and slope parameter in its constructor.
To run paribus, pull the repository and install its dependencies. You will need npm installed.
git clone https://github.com/Paribus/paribus-protocol
cd paribus-protocol
npm install
Contract tests are defined under the tests directory /test. To run the tests run:
npm test
To run code coverage, run:
npm run coverage
To lint the code, run:
npm run lint
For any concerns with the protocol, open an issue or visit Paribus on Discord to discuss.
For security concerns, please email security@paribus.io.
© Copyright 2023, Compound Labs, Paribus team