Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
waynebruce0x committed Jun 14, 2024
2 parents c22d281 + c132b4e commit 2b8c82e
Show file tree
Hide file tree
Showing 2,717 changed files with 37,831 additions and 18,437 deletions.
1 change: 0 additions & 1 deletion .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Also, don't hesitate to send a message on [our discord](https://discord.defillam
1. PLEASE PLEASE **enable "Allow edits by maintainers" while putting up the PR.**
2. Once your adapter has been merged, it takes time to show on the UI. No need to notify us on Discord.
3. Sorry, We no longer accept fetch adapter for new projects (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
3. Sorry, We no longer accept fetch adapter for new projects (reason: https://github.com/DefiLlama/DefiLlama-Adapters/discussions/432), we prefer the tvl to be computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.
4. **For updating listing info** It is a different repo, you can find your listing in this file: https://github.com/DefiLlama/defillama-server/blob/master/defi/src/protocols/data2.ts, you can edit it there and put up a PR
5. Do not edit/push `package-lock.json` file as part of your changes, we use lockfileVersion 2, and most use v1 and using that messes up our CI
6. No need to go to our discord and announce that you've created a PR, we monitor all PRs and will review it asap
Expand Down
5 changes: 3 additions & 2 deletions liquidations/aave-v2/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as sdk from "@defillama/sdk";
import { gql, request } from "graphql-request";
import { Liq } from "../utils/types";
import { getPagedGql } from "../utils/gql";
Expand Down Expand Up @@ -75,14 +76,14 @@ const rc: { [chain in Chains]: AaveAdapterResource } = {
name: "aave",
chain: Chains.ethereum,
usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
subgraphUrl: "https://api.thegraph.com/subgraphs/name/aave/protocol-v2",
subgraphUrl: sdk.graph.modifyEndpoint('8wR23o1zkS4gpLqLNU4kG3JHYVucqGyopL5utGxP2q1N'),
explorerBaseUrl: "https://etherscan.io/address/",
},
// [Chains.polygon]: {
// name: "aave",
// chain: Chains.polygon,
// usdcAddress: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
// subgraphUrl: "https://api.thegraph.com/subgraphs/name/aave/aave-v2-matic",
// subgraphUrl: sdk.graph.modifyEndpoint('H1Et77RZh3XEf27vkAmJyzgCME2RSFLtDS2f4PPW6CGp'),
// explorerBaseUrl: "https://polygonscan.com/address/",
// },
};
Expand Down
3 changes: 2 additions & 1 deletion liquidations/benqi/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as sdk from "@defillama/sdk";
import { gql } from "graphql-request";
import { getPagedGql } from "../utils/gql";
import BigNumber from "bignumber.js";
Expand All @@ -12,7 +13,7 @@ import {
totalCollateralValueInUsd,
} from "../utils/compound-helpers";

const subgraphUrl = "https://api.thegraph.com/subgraphs/name/yhayun/benqi";
const subgraphUrl = sdk.graph.modifyEndpoint('HcTvZi3fwucvRJvVmtFzNDTnomvMBk64xCLNQQg6GPAV');

const accountsQuery = gql`
query accounts($lastId: ID, $pageSize: Int) {
Expand Down
3 changes: 2 additions & 1 deletion liquidations/compound/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import * as sdk from "@defillama/sdk";
import { gql } from "graphql-request";
import { getPagedGql } from "../utils/gql";
import BigNumber from "bignumber.js";
Expand All @@ -12,7 +13,7 @@ import {
totalCollateralValueInUsd,
} from "../utils/compound-helpers";

const subgraphUrl = "https://api.thegraph.com/subgraphs/name/graphprotocol/compound-v2";
const subgraphUrl = sdk.graph.modifyEndpoint('AAva7YSZBLar4MaxQ3MqdJDFXkkHEaCDeibKTnraex1x');

const accountsQuery = gql`
query accounts($lastId: ID, $pageSize: Int) {
Expand Down
3 changes: 2 additions & 1 deletion liquidations/euler/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as sdk from "@defillama/sdk";
import { gql } from "graphql-request";
import { getPagedGql } from "../utils/gql";
import BigNumber from "bignumber.js";
import { Liq } from "../utils/types";

const subgraphUrl = "https://api.thegraph.com/subgraphs/name/euler-xyz/euler-mainnet";
const subgraphUrl = sdk.graph.modifyEndpoint('EQBXhrF4ppZy9cBYnhPdrMCRaVas6seNpqviih5VRGmU');

const accountsQuery = gql`
query accounts($lastId: ID, $pageSize: Int) {
Expand Down
6 changes: 3 additions & 3 deletions liquidations/mimo-protocol/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,16 @@ const getSubgraphUrl = (chain: Chain) => {

switch (chain) {
case Chain.ethereum: {
subgraphUrl = "https://api.thegraph.com/subgraphs/name/m19/titan";
subgraphUrl = sdk.graph.modifyEndpoint('FV3Dw1zMs97LpVPegWZKJv4bsbsZdrob2EqLCPxdcoDS');
break;
}
case Chain.polygon: {
subgraphUrl = "https://api.thegraph.com/subgraphs/name/m19/titanpolygon";
subgraphUrl = sdk.graph.modifyEndpoint('EfFLqiwngmmtE5su2t1EsFoEttoj8KWervocfab1ofYT');
break;
}
// case Chain.fantom: {
// subgraphUrl =
// "https://api.thegraph.com/subgraphs/name/rayxpub/titanfantom";
// sdk.graph.modifyEndpoint('DkSQLWkkiNfeNG43NJnHsW9hfih8hDt4SHFTNMQgPHJH');
// break;
// }
}
Expand Down
3 changes: 2 additions & 1 deletion liquidations/trader-joe-lend/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as sdk from "@defillama/sdk";
import { gql } from "graphql-request";
import { getPagedGql } from "../utils/gql";
import BigNumber from "bignumber.js";
import { Liq } from "../utils/types";

const subgraphUrl = "https://api.thegraph.com/subgraphs/name/traderjoe-xyz/lending";
const subgraphUrl = sdk.graph.modifyEndpoint('JB5EdQqbddMjawMLYe3C5ifmhN9WKYvLdgAKoUy1CyYy');

const accountsQuery = gql`
query accounts($lastId: ID, $pageSize: Int) {
Expand Down
2 changes: 1 addition & 1 deletion liquidations/venus/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from "../utils/compound-helpers";
const sdk = require("@defillama/sdk");

const subgraphUrl = "https://api.thegraph.com/subgraphs/name/venusprotocol/venus-subgraph";
const subgraphUrl = sdk.graph.modifyEndpoint('7h65Zf3pXXPmf8g8yZjjj2bqYiypVxems5d8riLK1DyR');

const accountsQuery = gql`
query accounts($lastId: ID, $pageSize: Int) {
Expand Down
122 changes: 93 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
"test": "echo \"Error: no test specified\" && exit 1",
"weeklyChanges": "git pull && git diff $(git log -1 --before=@{7.days.ago} --format=%H) --stat | grep -E \"projects/\" | cut -d / -f 2 | cut -d \" \" -f 1 | uniq | wc -l",
"dev": "babel-watch curve.js",
"lint": "eslint .",
"eslint:github-action": "eslint .",
"lint": "eslint -c .eslintrc.js .",
"eslint:github-action": "eslint -c .eslintrc.js .",
"test-interactive": "node utils/testInteractive",
"tvl": "cd utils;npm i; cd ..; node utils/testInteractive",
"treasury": "cd utils;npm i; cd ..; node utils/testInteractive treasury",
"entities": "cd utils;npm i; cd ..; node utils/testInteractive entities",
"useTokenLabels": "node utils/scripts/useTokenLabels.js",
"biggest-files": "find ./projects -name '*.js' -not -path './projects/helper/*' -not -path './projects/curve/*' -not -path './projects/sigmao/*' -exec du -sh {} \\; | sort -rh | head -n 100",
"postinstall": "echo 'run \"npm update @defillama/sdk\" if you want lastest sdk changes' "
},
"author": "",
Expand Down
2 changes: 1 addition & 1 deletion projects/0xDAO/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const xTAROT = "0x74D1D2A851e339B8cB953716445Be7E8aBdf92F4"

const fBEET = "0xfcef8a994209d6916EB2C86cDD2AFD60Aa6F54b1"

async function tvl(time, ethBlock, chainBlocks) {
async function tvl(_, __, chainBlocks) {
// 0xDAO Master Chef
const balances = {}
const chain = 'fantom'
Expand Down
17 changes: 13 additions & 4 deletions projects/0xLend/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
const { usdCompoundExports } = require("../helper/compound");
module.exports = {
kcc: usdCompoundExports("0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7", "kcc", "0x309f1639018e8B272126C4B99af442AA25Dcd1F2")
}
const { compoundExports2 } = require('../helper/compound')

const config = {
kcc: { comptroller: '0x337d8719f70D514367aBe780F7c1eAd1c0113Bc7', cether: '0x309f1639018e8b272126c4b99af442aa25dcd1f2' },
era: { comptroller: '0x599bb9202EE2D2F95EDe9f88F622854f7ef2c371', cether: '0x9dae6c8c431ffc6d21b836e0d8d113e8365defb9' },
blast: { comptroller: '0x1DD821C9E27fB2399DAb75AedB113c80C755DCa6', cether: '0xd9fcbd7b60966d013a28ff87925f75bb49e9b5ee' },
}

Object.keys(config).forEach(chain => {
module.exports[chain] = compoundExports2(config[chain])
})

module.exports.kcc.borrowed = () => ({})
Loading

0 comments on commit 2b8c82e

Please sign in to comment.