/contracts

The official ARCx contracts repo

Primary LanguageTypeScript

npm version arcxmoney

ARCx Contracts

ARCx Credit is a decentralized liquidity market that offers the safest and most capital-efficient borrowing experience in DeFi through the use of the DeFi Credit Score. Unlike traditional borrowing protocols, ARCx Credit rewards Borrowers who demonstrate effective risk management practices by granting them progressively higher maximum loan-to-value (LTV) ratios on their loans. The primary objective for ARCx Credit is to profitably improve capital efficiency in DeFi lending markets through measuring and rewarding responsible borrowing behavior. Click here to read the official docs.

Architecture

Contracts high-level arch

At a very high level, the ARCx protocol is a credit market that has works in the following manner:

  • Lenders lend their stablecoins to borrowers that meet some minimum credit score requirement, on the SapphirePool contract
  • ARCx observes the borrowing behavior of on-chain addresses and issues a credit score for each of them. These scores are then compiled inside a merkle tree of which root is published on the SapphirePassportScores contract on a daily basis.
  • Borrowers deposit their collateral inside a SapphireCore contract and take a loan while respecting their personal collateral ratio determined by their credit score.
  • When they repay, part of the interest goes back to the lenders, and the other part goes to the protocol.

Warning

This is experimental, beta software and is provided on an "as is" and "as available" basis. We do not give any warranties and will not be liable for any loss, direct or indirect through continued use of this code.

Audits and Bug Bounties

The contracts have not yet been audited, but one is on its way.

We currently have an active bug bounty with Immunefi that can be viewed here. If you have found any critical bug please let us know through the bug bounty program.

Developers

Our contracts were written in Solidity and our tests in TypeScript.

If you want to contribute, familiarity with Hardhat, Ethers, Waffle and TypeChain is needed.

Pre Requisites

Before running any command, make sure to install dependencies:

$ yarn install

Build

Compile the smart contracts with Buidler and generate TypeChain artifacts:

$ yarn build

Lint Solidity

Lint the Solidity code:

$ yarn lint:sol

Test Unit

Run the unit tests:

$ yarn test

Coverage

Generate the code coverage report:

$ yarn coverage

Clean

Delete the smart contract artifacts, the coverage reports and the Buidler cache:

$ yarn clean

Discussion

For any concerns or feedback, open an issue or visit us on Discord to discuss.