{"id":29219905,"url":"https://github.com/protofire/cl-defi-score-oracle","last_synced_at":"2026-03-04T19:01:24.459Z","repository":{"id":41741831,"uuid":"230484345","full_name":"protofire/cl-defi-score-oracle","owner":"protofire","description":"Chainlink: DefiScore Oracle","archived":false,"fork":false,"pushed_at":"2023-01-24T01:02:11.000Z","size":1498,"stargazers_count":3,"open_issues_count":15,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-17T04:33:39.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/protofire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-27T17:19:03.000Z","updated_at":"2021-09-14T06:42:42.000Z","dependencies_parsed_at":"2023-01-31T18:00:40.098Z","dependency_job_id":null,"html_url":"https://github.com/protofire/cl-defi-score-oracle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/protofire/cl-defi-score-oracle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protofire%2Fcl-defi-score-oracle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protofire%2Fcl-defi-score-oracle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protofire%2Fcl-defi-score-oracle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protofire%2Fcl-defi-score-oracle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/protofire","download_url":"https://codeload.github.com/protofire/cl-defi-score-oracle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/protofire%2Fcl-defi-score-oracle/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30090037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T18:31:08.343Z","status":"ssl_error","status_checked_at":"2026-03-04T18:31:07.708Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-03T02:07:49.190Z","updated_at":"2026-03-04T19:01:24.427Z","avatar_url":"https://github.com/protofire.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chainlink: DefiScore Oracles\nDefiScore is an Open Framework for Evaluating DeFi Protocols, a methodology for assessing risk in permissionless lending platforms.\nScores are relative and calculated from eight attributes across three categories: smart contract risk (50%), financial risk (35%), \u0026 regulatory risk (15%)\n\nThis MVP creates an External Adapter that returns the score of a given asset on a lending platform, and a Consumer smart contract which will request the score on demand.\n\nParameters:\n- Assets: `dai` | `sai` | `usdc` | `eth` | `wbtc` | `rep` | `zrx` | `bat` | `tusd` | `usdt`\n- Platform: `compund` | `dydx` | `fulcrom` | `nuo` | `ddex`\n\n**Note:** The following steps require some basic knowledge about the Chainlink stack: how to run a Chainlink Node, create Jobs, Bridges and External Initiators in the node, and deploy External Adapter functions. It is advisable to start by reading the [Chainlink Docs](https://docs.chain.link).\n\n### Prerequisites\n- Running a Chainlink Node\n\n### Steps for running this\n\n#### 1. Deploy an Chainlink Oracle\n\n  - Follow the steps from [Chainlink Docs - Deploy your own Oracle contract](https://docs.chain.link/docs/fulfilling-requests#section-deploy-your-own-oracle-contract) and [Chainlink Docs - ](https://docs.chain.link/docs/fulfilling-requests#section-deploy-your-own-oracle-contract)\n\n\n#### 2. Deploy External Adapter function\n\n  - Follow the steps from https://chainlinkadapters.com/guides/run-external-adapter-on-gcp for deploying the `external-adapter` as a Cloud Function in GCP.\n\n#### 3. Create bridge for the External Adapter\n\n  Reference docs: https://docs.chain.link/docs/node-operators\n\n  External adapters are added to the Chainlink node by creating a bridge type. Bridges define the tasks' name and URL of the external adapter. When a task type is received, and it is not one of the core adapters, the node will search for a bridge type with that name, utilizing the bridge to your external adapter.\n\n  **Note:** Bridge and task type names are case insensitive.\n\n  To create a bridge on the node, you can navigate to the \"Create Bridge\" menu item in the GUI. From there, you will specify a Name, URL and, optionally, the number of Confirmations for the bridge.\n\n  **Note:** Bridge Name should be unique to the local node and the Bridge URL should be the URL of your external adapter, whether local or on a separate machine.\n\n#### 4. Create job which uses the bridge\n\nCreate a job in the node like the following\n\n```javascript\n  {\n    \"initiators\": [\n      { \"type\": \"runLog\" }\n    ],\n    \"tasks\": [\n      { \"type\": \"BRIDGE NAME FROM STEP 2\" },\n      { \"type\": \"ethtx\" }\n    ]\n  }\n```\n\n#### 5. Deploy Consumer Smart Contracts\n\nWithin the `oracle` directory:\n\n```bash\nnpm i\n```\n\nCreate a `.env` file, copy content of `.env.example` and update `RPC_URL` with your Infura PROJECT_ID, `PK` with your account private key, `ORACLE` with the address of the contract deployed on step #1 and `DEFI_SCORE_JOB_ID` with the one you got from step #3.\n\n```bash\nnpm run migrate:kovan\n```\n\nFund `DefiScore` contract using `https://kovan.chain.link/`\n\n#### 6. Execute oracle method\n\n- DefiScore contract\n```bash\neth abi:add DefiScore PATH_TO_BUILD_FOLDER/contracts/DefiScore.json\neth contract:send --kovan DefiScore@DEFI_SCORE_CONTRACT_ADDRESS 'requestDefiScore(\"dydx\", \"eth\")' --pk=YOUR_ADDRESS_PK\n```\n\n#### 7. Check out the results\n\n`DefiScore` contract emits the event `DefiScore(bytes32 indexed requestId, uint256 timestamp, uint16 openSource, uint16 audited, uint16 verifyed, uint16 safe, uint16 score, uint16 iquidityIndex, uint16 collateralIndex)` when the request to the External Adapter is fulfilled so go to https://kovan.etherscan.io/address/DEFI_SCORE_CONTRACT_ADDRESS#events and check the event was emmited.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotofire%2Fcl-defi-score-oracle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprotofire%2Fcl-defi-score-oracle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprotofire%2Fcl-defi-score-oracle/lists"}