Understand the credit score model at a glance. There are three distinct models, one for each of our chosen validators, namely Plaid, Coinbase & MetaMask.
Plaid model (powered by Plaid)
- 🥌 analyze up to 5 years of transaction history
- 💎 dynamically select user's best credit card products
- 🎯 detect recurring deposits and withdrawals (monthly)
- 🛠️ deploy linear regression on minimum running balance over the past 24 months
- 🧲 auto-filter & discard microtransactions
- 📌 inspect loan, investment, and saving accounts
Coinbase model (powered by Coinbase)
- 🔔 check for user KYC status
- 🔑 live fetch of top 25 cryptos by market cap via CoinMarketCap API
- 🔥 dynamically select user's best crypto wallets
- 🔐 auto-convert any currency to USD in real-time
- 💡 analyze all transactions since Coinbase account inception
- 💰 compute user's net profit
MetaMask model (powered by Covalent)
- 🦊 authenticate user via MetaMask
- 🪂 account for credits, debits transactions, transfers, frequency, the cumulative balance now, and more
- ⛓️ fetch up to 100 top ERC20 tokens (by market capitalization) via CoinMarketCap API
- 📊 analyze time series of latest 400 transactions on MetaMask wallet
- 🐞 inspect historical OHLCV for last 30 days
NarOracle returns to the user a numerical score ranging from 300-900 points. The score is partitioned into categorical bins
(very poor
| poor
| fair
| good
| very good
| excellent
| exceptional
), which describe the score qualitatively (see fuel gauge in the diagram below). Every bin is associated with a USD equivalent, which represents the maximum loan amount in USD that a user qualifies for, based on the NearOracle calculation. Lastly, the NearOracle also returns the estimated payback period, namely the expected time it will take for the user to pay back the loan.
The loan terms (loan amount, qualitative descriptor, and payback period) are algorithmic recommendations, and, therefore, they are not prescriptive. Although we strongly advise lenders and borrowers to consider NearOracle's parameters, we also encourage them to stipulate loan terms that best suit their unique needs.
Download or clone the repo to your machine, running in terminal
git clone ... my-project-name
cd my-project-name
Run either of the commands below. You'll need either pip
or conda
package manager
pip install -r requirements.txt # using pip
conda create --name <env_name> --file requirements.txt # using Conda
Create a .env
local file in your root folder. The required credentials are
PLAID_ENV='sandbox'
DATABASE_URL='postgres_url'
If you want to test the algorithm alone in the backend (independently from the dApp frontend) we recommend you do so using the Swagger API platform. Running the commands below will redirect you to the Swagger, where you'll be able to run in the backend trial credit score calculations for your preferred validator (Plaid, Coinbase, or Covalent)
cd my-project-name
uvicorn main:app –reload
⚠️ The oracle will execute properly, only if you set up a correct and complete.env
file.
☢️ depending on the validator you choose you'll need to enter the parameters for the API endpoint request.
Procure the necessary keys here:
- CoinMarketCap API key → follow the Developers guide here
- Plaid client_id and secret_key → create a Plaid account here, then retrieve your Plaid keys
- Coinbase API Key → create a Coinbase account here, then retrieve your Coinbase keys
To generate a new set of API keys follow this flow:Coinbase
->settings
->API
->New API Key
. - Covalent API key → register here