update sdk and add projects

This commit is contained in:
0xngmi
2021-05-05 21:55:38 +02:00
parent f0f4e1c852
commit 5fef268453
4 changed files with 142 additions and 72 deletions

142
package-lock.json generated
View File

@@ -23,9 +23,9 @@
}
},
"@defillama/sdk": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-1.1.9.tgz",
"integrity": "sha512-P2qJn/Er1sRvC/kE/ABXR7tfK46I5Zo3EjUqs+Bcy8fxTErZBtEaYWKpRTZ0O3ursUKYODDHHspnhDudbbZiOQ==",
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-2.0.2.tgz",
"integrity": "sha512-VKrLswHlAaEcqWvyueOl5pOGl3K6unDkcpcgorPPYlDCRnYYRi8F2hm8VoaA87r50TYrLYq0+SZGocSTQxewnw==",
"requires": {
"ethers": "^5.0.32",
"graphql": "^15.5.0",
@@ -35,9 +35,9 @@
},
"dependencies": {
"@ethersproject/abi": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.0.tgz",
"integrity": "sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw==",
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.2.tgz",
"integrity": "sha512-uMhoQVPX0UtfzTpekYQSEUcJGDgsJ25ifz+SV6PDETWaUFhcR8RNgb1QPTASP13inW8r6iy0/Xdq9D5hK2pNvA==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -97,9 +97,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -199,9 +199,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -241,20 +241,20 @@
}
},
"ethers": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.1.0.tgz",
"integrity": "sha512-2L6Ge6wMBw02FlRoCLg4E0Elt3khMNlW6ULawa10mMeeZToYJ5+uCfiuTuB+XZ6om1Y7wuO9ZzezP8FsU2M/+g==",
"version": "5.1.4",
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.1.4.tgz",
"integrity": "sha512-EAPQ/fgGRu0PoR/VNFnHTMOtG/IZ0AItdW55C9T8ffmVu0rnyllZL404eBF66elJehOLz2kxnUrhXpE7TCpW7g==",
"requires": {
"@ethersproject/abi": "5.1.0",
"@ethersproject/abi": "5.1.2",
"@ethersproject/abstract-provider": "5.1.0",
"@ethersproject/abstract-signer": "5.1.0",
"@ethersproject/address": "5.1.0",
"@ethersproject/base64": "5.1.0",
"@ethersproject/basex": "5.1.0",
"@ethersproject/bignumber": "5.1.0",
"@ethersproject/bignumber": "5.1.1",
"@ethersproject/bytes": "5.1.0",
"@ethersproject/constants": "5.1.0",
"@ethersproject/contracts": "5.1.0",
"@ethersproject/contracts": "5.1.1",
"@ethersproject/hash": "5.1.0",
"@ethersproject/hdnode": "5.1.0",
"@ethersproject/json-wallets": "5.1.0",
@@ -263,14 +263,14 @@
"@ethersproject/networks": "5.1.0",
"@ethersproject/pbkdf2": "5.1.0",
"@ethersproject/properties": "5.1.0",
"@ethersproject/providers": "5.1.0",
"@ethersproject/providers": "5.1.2",
"@ethersproject/random": "5.1.0",
"@ethersproject/rlp": "5.1.0",
"@ethersproject/sha2": "5.1.0",
"@ethersproject/signing-key": "5.1.0",
"@ethersproject/solidity": "5.1.0",
"@ethersproject/strings": "5.1.0",
"@ethersproject/transactions": "5.1.0",
"@ethersproject/transactions": "5.1.1",
"@ethersproject/units": "5.1.0",
"@ethersproject/wallet": "5.1.0",
"@ethersproject/web": "5.1.0",
@@ -426,9 +426,9 @@
}
},
"@ethersproject/contracts": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.1.0.tgz",
"integrity": "sha512-dvTMs/4XGSc57cYOW0KjgX1NdTujUu7mNb6PQdJWg08m9ULzPyGZuBkFJnijBcp6vTOCQ59RwjboWgNWw393og==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.1.1.tgz",
"integrity": "sha512-6WwktLJ0DFWU8pDkgH4IGttQHhQN4SnwKFu9h+QYVe48VGWtbDu4W8/q/7QA1u/HWlWMrKxqawPiZUJj0UMvOw==",
"requires": {
"@ethersproject/abi": "^5.1.0",
"@ethersproject/abstract-provider": "^5.1.0",
@@ -443,9 +443,9 @@
},
"dependencies": {
"@ethersproject/abi": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.0.tgz",
"integrity": "sha512-N/W9Sbn1/C6Kh2kuHRjf/hX6euMK4+9zdJRBB8sDWmihVntjUAfxbusGZKzDQD8i3szAHhTz8K7XADV5iFNfJw==",
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.1.2.tgz",
"integrity": "sha512-uMhoQVPX0UtfzTpekYQSEUcJGDgsJ25ifz+SV6PDETWaUFhcR8RNgb1QPTASP13inW8r6iy0/Xdq9D5hK2pNvA==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -505,9 +505,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -607,9 +607,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -736,9 +736,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -823,9 +823,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -938,9 +938,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1025,9 +1025,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -1135,9 +1135,9 @@
}
},
"@ethersproject/providers": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.1.0.tgz",
"integrity": "sha512-FjpZL2lSXrYpQDg2fMjugZ0HjQD9a+2fOOoRhhihh+Z+qi/xZ8vIlPoumrEP1DzIG4DBV6liUqLNqnX2C6FIAA==",
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.1.2.tgz",
"integrity": "sha512-GqsS8rd+eyd4eNkcNgzZ4l9IRULBPUZa7JPnv22k4MHflMobUseyhfbVnmoN5bVNNkOxjV1IPTw9i0sV1hwdpg==",
"requires": {
"@ethersproject/abstract-provider": "^5.1.0",
"@ethersproject/abstract-signer": "^5.1.0",
@@ -1207,9 +1207,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1309,9 +1309,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -1453,9 +1453,9 @@
},
"dependencies": {
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1546,9 +1546,9 @@
},
"dependencies": {
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1647,9 +1647,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1749,9 +1749,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",
@@ -1868,9 +1868,9 @@
}
},
"@ethersproject/bignumber": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.0.tgz",
"integrity": "sha512-wUvQlhTjPjFXIdLPOuTrFeQmSa6Wvls1bGXQNQWvB/SEn1NsTCE8PmumIEZxmOPjSHl1eV2uyHP5jBm5Cgj92Q==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.1.1.tgz",
"integrity": "sha512-AVz5iqz7+70RIqoQTznsdJ6DOVBYciNlvO+AlQmPTB6ofCvoihI9bQdr6wljsX+d5W7Yc4nyvQvP4JMzg0Agig==",
"requires": {
"@ethersproject/bytes": "^5.1.0",
"@ethersproject/logger": "^5.1.0",
@@ -1970,9 +1970,9 @@
}
},
"@ethersproject/transactions": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.0.tgz",
"integrity": "sha512-s10crRLZEA0Bgv6FGEl/AKkTw9f+RVUrlWDX1rHnD4ZncPFeiV2AJr4nT7QSUhxJdFPvjyKRDb3nEH27dIqcPQ==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.1.1.tgz",
"integrity": "sha512-Nwgbp09ttIVN0OoUBatCXaHxR7grWPHbozJN8v7AXDLrl6nnOIBEMDh+yJTnosSQlFhcyjfTGGN+Mx6R8HdvMw==",
"requires": {
"@ethersproject/address": "^5.1.0",
"@ethersproject/bignumber": "^5.1.0",

View File

@@ -9,7 +9,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"@defillama/sdk": "^1.1.9",
"@defillama/sdk": "^2.0.0",
"@makerdao/multicall": "^0.12.0",
"@project-serum/serum": "^0.13.33",
"@solana/web3.js": "^1.2.6",

View File

@@ -0,0 +1,35 @@
const { request, gql } = require("graphql-request");
const { toUSDTBalances } = require('../helper/balances');
const graphUrl = 'https://api.thegraph.com/subgraphs/name/sameepsi/quickswap'
const graphQuery = gql`
query get_tvl($block: Int) {
uniswapFactory(
id: "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",
block: { number: $block }
) {
totalVolumeUSD
totalLiquidityUSD
}
}
`;
async function tvl(timestamp, block, chainBlocks) {
const {uniswapFactory} = await request(
graphUrl,
graphQuery,
{
block: chainBlocks['polygon'],
}
);
const usdTvl = Number(uniswapFactory.totalLiquidityUSD)
return toUSDTBalances(usdTvl)
}
module.exports = {
polygon:{
tvl,
},
tvl
}

View File

@@ -0,0 +1,35 @@
const { request, gql } = require("graphql-request");
const { toUSDTBalances } = require('../helper/balances');
const graphUrl = 'https://api.thegraph.com/subgraphs/name/eerieeight/spookyswap'
const graphQuery = gql`
query get_tvl($block: Int) {
uniswapFactory(
id: "0x152eE697f2E276fA89E96742e9bB9aB1F2E61bE3",
block: { number: $block }
) {
totalVolumeUSD
totalLiquidityUSD
}
}
`;
async function tvl(timestamp, block, chainBlocks) {
const {uniswapFactory} = await request(
graphUrl,
graphQuery,
{
block:chainBlocks['fantom'],
}
);
const usdTvl = Number(uniswapFactory.totalLiquidityUSD)
return toUSDTBalances(usdTvl)
}
module.exports = {
fantom:{
tvl,
},
tvl
}