Skip to content

Commit

Permalink
update nxfi idl
Browse files Browse the repository at this point in the history
  • Loading branch information
conquerorzzz committed Jul 26, 2024
2 parents 6a3ab9b + 2a0420e commit fd588b1
Show file tree
Hide file tree
Showing 784 changed files with 17,618 additions and 8,725 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore all files
*
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
103 changes: 84 additions & 19 deletions package-lock.json

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

19 changes: 2 additions & 17 deletions projects/01/index.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
const ADDRESSES = require('../helper/coreAssets.json')
const { sumTokens2 } = require('../helper/solana')
const { sumTokensExport } = require('../helper/solana')

async function tvl() {
const tokens = [
ADDRESSES.solana.USDC,
ADDRESSES.solana.SOL,
ADDRESSES.solana.USDT,
"7vfCXTUXx5WJV5JADk17DUJ4ksgau7utNKj4b963voxs",
"9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E",
"mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So",
"9vMJfxuKxXBoEa7rM12mYLMwTacLMLDJqHozw96WQL8i",
]
const owner = 'HjHSNe8hhvZ8hKCRrhKg1DGiGPd9NYQbUjT1SQRDo4kZ'

return sumTokens2({ owner, tokens })
}
module.exports = {
hallmarks:[
[1667865600, "FTX collapse"]
],
timetravel: false,
solana: {
tvl,
tvl: sumTokensExport({ owner: 'HjHSNe8hhvZ8hKCRrhKg1DGiGPd9NYQbUjT1SQRDo4kZ' }),
},
methodology: `To obtain the tvl we're getting the vault accounts information where user deposited collateral is stored.`,
}
3 changes: 2 additions & 1 deletion projects/21-co/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ const { cexExports } = require('../helper/cex')
const config = {
bitcoin: {
owners: [
'1HTGi4tfXSEtcXD4pk6S3vBs3s64hWY1pW'
'1HTGi4tfXSEtcXD4pk6S3vBs3s64hWY1pW',
'12WZhMFFLHQ4rCMSkeBfbJXRk7aGWyBh1M',
],
},
solana: {
Expand Down
27 changes: 27 additions & 0 deletions projects/3jane/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const abi = {
vaultParams: "function vaultParams() view returns (bool isPut, uint8 decimals, address asset, address underlying, uint56 minimumSupply, uint104 cap)"
}

const config = {
ethereum: {
vaults: [
"0xAcD147A5bbCB7166c5BB13A9354ad7a59b99fB4d", // weETH call vault
]
}
}

module.exports = {
methodology: "Sums the totalBalance of all 3Jane Theta Vaults",
};

Object.keys(config).forEach(chain => {
const { vaults } = config[chain]
module.exports[chain] = {
tvl: async (api) => {
const balances = await api.multiCall({ abi: "uint256:totalBalance", calls: vaults })
const data = await api.multiCall({ abi: abi.vaultParams, calls: vaults })
const tokens = data.map(d => d.asset)
api.add(tokens, balances)
}
}
})
Loading

0 comments on commit fd588b1

Please sign in to comment.