diff --git a/package-lock.json b/package-lock.json index 65ed9a50d5..050ebe328a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,8 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@defillama/sdk": "^2.3.61", + "bignumber.js": "^9.0.2", "date-fns": "^2.23.0", "dotenv": "^10.0.0", "graphql": "^15.5.1", @@ -17,6 +19,7 @@ "node-fetch": "^2.6.1", "saslprep": "^1.0.3", "simple-statistics": "^7.7.5", + "ssl-root-cas": "^1.3.1", "superagent": "^6.1.0", "web3": "^1.4.0" }, @@ -360,6 +363,11 @@ "node": ">=6.9.0" } }, + "node_modules/@coolaj86/urequest": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz", + "integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA==" + }, "node_modules/@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -383,6 +391,22 @@ "node": ">=12" } }, + "node_modules/@defillama/sdk": { + "version": "2.3.61", + "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-2.3.61.tgz", + "integrity": "sha512-o0u0SLQjkx0ttmDCFr3Zxm2oI++XSOXjy9KkYhNEC9Y9Bwp4TwmibOAy4BYz30PxqruODVPrq29vNP8djVK1tA==", + "dependencies": { + "@supercharge/promise-pool": "^2.1.0", + "ethers": "^5.4.5", + "graphql": "^15.5.0", + "graphql-request": "^3.4.0", + "lodash": "^4.17.21", + "node-fetch": "^2.6.1" + }, + "bin": { + "sdk": "build/cli.js" + } + }, "node_modules/@electron/get": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.14.1.tgz", @@ -572,6 +596,25 @@ "@ethersproject/bytes": "^5.6.0" } }, + "node_modules/@ethersproject/basex": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.0.tgz", + "integrity": "sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/properties": "^5.6.0" + } + }, "node_modules/@ethersproject/bignumber": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", @@ -628,6 +671,59 @@ "@ethersproject/bignumber": "^5.6.0" } }, + "node_modules/@ethersproject/contracts": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.0.tgz", + "integrity": "sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "^5.6.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0" + } + }, + "node_modules/@ethersproject/contracts/node_modules/@ethersproject/abi": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "node_modules/@ethersproject/hash": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", @@ -653,6 +749,65 @@ "@ethersproject/strings": "^5.6.0" } }, + "node_modules/@ethersproject/hdnode": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.0.tgz", + "integrity": "sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz", + "integrity": "sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, "node_modules/@ethersproject/keccak256": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", @@ -705,6 +860,25 @@ "@ethersproject/logger": "^5.6.0" } }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz", + "integrity": "sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/sha2": "^5.6.0" + } + }, "node_modules/@ethersproject/properties": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", @@ -723,6 +897,81 @@ "@ethersproject/logger": "^5.6.0" } }, + "node_modules/@ethersproject/providers": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.5.tgz", + "integrity": "sha512-TRS+c2Ud+cMpWodmGAc9xbnYRPWzRNYt2zkCSnj58nJoamBQ6x4cUbBeo0lTC3y+6RDVIBeJv18OqsDbSktLVg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersproject/random": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.0.tgz", + "integrity": "sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" + } + }, "node_modules/@ethersproject/rlp": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", @@ -742,6 +991,26 @@ "@ethersproject/logger": "^5.6.0" } }, + "node_modules/@ethersproject/sha2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, "node_modules/@ethersproject/signing-key": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.1.tgz", @@ -765,6 +1034,29 @@ "hash.js": "1.1.7" } }, + "node_modules/@ethersproject/solidity": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.0.tgz", + "integrity": "sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "node_modules/@ethersproject/strings": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", @@ -811,6 +1103,58 @@ "@ethersproject/signing-key": "^5.6.0" } }, + "node_modules/@ethersproject/units": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.0.tgz", + "integrity": "sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.0.tgz", + "integrity": "sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/json-wallets": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" + } + }, "node_modules/@ethersproject/web": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", @@ -833,6 +1177,28 @@ "@ethersproject/strings": "^5.6.0" } }, + "node_modules/@ethersproject/wordlists": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.0.tgz", + "integrity": "sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -1465,6 +1831,14 @@ "node": ">=6" } }, + "node_modules/@supercharge/promise-pool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@supercharge/promise-pool/-/promise-pool-2.1.0.tgz", + "integrity": "sha512-YEKOfn4xF+DQ61UY5NwHNtr8hYjwchXjGTocVJDAHLQceIRZF8VECH7gumFbp+aGTfygPbMbEtBumXJ/mcJz+w==", + "engines": { + "node": ">=8" + } + }, "node_modules/@szmarczak/http-timer": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", @@ -1862,6 +2236,11 @@ "node": ">=6.0" } }, + "node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + }, "node_modules/agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -1911,6 +2290,8 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, + "optional": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -1926,7 +2307,9 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node_modules/ajv-keywords": { "version": "3.5.2", @@ -2374,6 +2757,11 @@ "tweetnacl": "^0.14.3" } }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -5032,6 +5420,79 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.0.tgz", "integrity": "sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw==" }, + "node_modules/ethers": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.5.tgz", + "integrity": "sha512-9CTmplO9bv0s/aPw3HB3txGzKz3tUSI2EfO4dJo0W2WvaEq1ArgsEX6obV+bj5X3yY+Zgb1kAux8TDtJKe1FaA==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/abi": "5.6.1", + "@ethersproject/abstract-provider": "5.6.0", + "@ethersproject/abstract-signer": "5.6.0", + "@ethersproject/address": "5.6.0", + "@ethersproject/base64": "5.6.0", + "@ethersproject/basex": "5.6.0", + "@ethersproject/bignumber": "5.6.0", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.0", + "@ethersproject/contracts": "5.6.0", + "@ethersproject/hash": "5.6.0", + "@ethersproject/hdnode": "5.6.0", + "@ethersproject/json-wallets": "5.6.0", + "@ethersproject/keccak256": "5.6.0", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.2", + "@ethersproject/pbkdf2": "5.6.0", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.5", + "@ethersproject/random": "5.6.0", + "@ethersproject/rlp": "5.6.0", + "@ethersproject/sha2": "5.6.0", + "@ethersproject/signing-key": "5.6.1", + "@ethersproject/solidity": "5.6.0", + "@ethersproject/strings": "5.6.0", + "@ethersproject/transactions": "5.6.0", + "@ethersproject/units": "5.6.0", + "@ethersproject/wallet": "5.6.0", + "@ethersproject/web": "5.6.0", + "@ethersproject/wordlists": "5.6.0" + } + }, + "node_modules/ethers/node_modules/@ethersproject/abi": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "dependencies": { + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "node_modules/ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -7175,8 +7636,7 @@ "node_modules/lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "node_modules/lodash.defaults": { "version": "4.2.0", @@ -10567,6 +11027,14 @@ "node": ">=0.10.0" } }, + "node_modules/ssl-root-cas": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ssl-root-cas/-/ssl-root-cas-1.3.1.tgz", + "integrity": "sha512-KR8J210Wfvjh+iNE9jcQEgbG0VG2713PHreItx6aNCPnkFO8XChz1cJ4iuCGeBj0+8wukLmgHgJqX+O5kRjPkQ==", + "dependencies": { + "@coolaj86/urequest": "^1.3.6" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -12928,6 +13396,11 @@ "to-fast-properties": "^2.0.0" } }, + "@coolaj86/urequest": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@coolaj86/urequest/-/urequest-1.3.7.tgz", + "integrity": "sha512-PPrVYra9aWvZjSCKl/x1pJ9ZpXda1652oJrPBYy5rQumJJMkmTBN3ux+sK2xAUwVvv2wnewDlaQaHLxLwSHnIA==" + }, "@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -12945,6 +13418,19 @@ "@cspotcode/source-map-consumer": "0.8.0" } }, + "@defillama/sdk": { + "version": "2.3.61", + "resolved": "https://registry.npmjs.org/@defillama/sdk/-/sdk-2.3.61.tgz", + "integrity": "sha512-o0u0SLQjkx0ttmDCFr3Zxm2oI++XSOXjy9KkYhNEC9Y9Bwp4TwmibOAy4BYz30PxqruODVPrq29vNP8djVK1tA==", + "requires": { + "@supercharge/promise-pool": "^2.1.0", + "ethers": "^5.4.5", + "graphql": "^15.5.0", + "graphql-request": "^3.4.0", + "lodash": "^4.17.21", + "node-fetch": "^2.6.1" + } + }, "@electron/get": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@electron/get/-/get-1.14.1.tgz", @@ -13076,6 +13562,15 @@ "@ethersproject/bytes": "^5.6.0" } }, + "@ethersproject/basex": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.6.0.tgz", + "integrity": "sha512-qN4T+hQd/Md32MoJpc69rOwLYRUXwjTlhHDIeUkUmiN/JyWkkLLMoG0TqvSQKNqZOMgN5stbUYN6ILC+eD7MEQ==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/properties": "^5.6.0" + } + }, "@ethersproject/bignumber": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.6.0.tgz", @@ -13102,6 +13597,41 @@ "@ethersproject/bignumber": "^5.6.0" } }, + "@ethersproject/contracts": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.6.0.tgz", + "integrity": "sha512-74Ge7iqTDom0NX+mux8KbRUeJgu1eHZ3iv6utv++sLJG80FVuU9HnHeKVPfjd9s3woFhaFoQGf3B3iH/FrQmgw==", + "requires": { + "@ethersproject/abi": "^5.6.0", + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/transactions": "^5.6.0" + }, + "dependencies": { + "@ethersproject/abi": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", + "requires": { + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + } + } + }, "@ethersproject/hash": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.6.0.tgz", @@ -13117,6 +13647,45 @@ "@ethersproject/strings": "^5.6.0" } }, + "@ethersproject/hdnode": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.6.0.tgz", + "integrity": "sha512-61g3Jp3nwDqJcL/p4nugSyLrpl/+ChXIOtCEM8UDmWeB3JCAt5FoLdOMXQc3WWkc0oM2C0aAn6GFqqMcS/mHTw==", + "requires": { + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" + } + }, + "@ethersproject/json-wallets": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.6.0.tgz", + "integrity": "sha512-fmh86jViB9r0ibWXTQipxpAGMiuxoqUf78oqJDlCAJXgnJF024hOOX7qVgqsjtbeoxmcLwpPsXNU0WEe/16qPQ==", + "requires": { + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/pbkdf2": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, "@ethersproject/keccak256": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.6.0.tgz", @@ -13139,6 +13708,15 @@ "@ethersproject/logger": "^5.6.0" } }, + "@ethersproject/pbkdf2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.6.0.tgz", + "integrity": "sha512-Wu1AxTgJo3T3H6MIu/eejLFok9TYoSdgwRr5oGY1LTLfmGesDoSx05pemsbrPT2gG4cQME+baTSCp5sEo2erZQ==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/sha2": "^5.6.0" + } + }, "@ethersproject/properties": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.6.0.tgz", @@ -13147,6 +13725,49 @@ "@ethersproject/logger": "^5.6.0" } }, + "@ethersproject/providers": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.6.5.tgz", + "integrity": "sha512-TRS+c2Ud+cMpWodmGAc9xbnYRPWzRNYt2zkCSnj58nJoamBQ6x4cUbBeo0lTC3y+6RDVIBeJv18OqsDbSktLVg==", + "requires": { + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/basex": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/networks": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/rlp": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/web": "^5.6.0", + "bech32": "1.1.4", + "ws": "7.4.6" + }, + "dependencies": { + "ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "requires": {} + } + } + }, + "@ethersproject/random": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.6.0.tgz", + "integrity": "sha512-si0PLcLjq+NG/XHSZz90asNf+YfKEqJGVdxoEkSukzbnBgC8rydbgbUgBbBGLeHN4kAJwUFEKsu3sCXT93YMsw==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0" + } + }, "@ethersproject/rlp": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.6.0.tgz", @@ -13156,6 +13777,16 @@ "@ethersproject/logger": "^5.6.0" } }, + "@ethersproject/sha2": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.6.0.tgz", + "integrity": "sha512-1tNWCPFLu1n3JM9t4/kytz35DkuF9MxqkGGEHNauEbaARdm2fafnOyw1s0tIQDPKF/7bkP1u3dbrmjpn5CelyA==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "hash.js": "1.1.7" + } + }, "@ethersproject/signing-key": { "version": "5.6.1", "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.6.1.tgz", @@ -13169,6 +13800,19 @@ "hash.js": "1.1.7" } }, + "@ethersproject/solidity": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.6.0.tgz", + "integrity": "sha512-YwF52vTNd50kjDzqKaoNNbC/r9kMDPq3YzDWmsjFTRBcIF1y4JCQJ8gB30wsTfHbaxgxelI5BfxQSxD/PbJOww==", + "requires": { + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/sha2": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "@ethersproject/strings": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.6.0.tgz", @@ -13195,6 +13839,38 @@ "@ethersproject/signing-key": "^5.6.0" } }, + "@ethersproject/units": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.6.0.tgz", + "integrity": "sha512-tig9x0Qmh8qbo1w8/6tmtyrm/QQRviBh389EQ+d8fP4wDsBrJBf08oZfoiz1/uenKK9M78yAP4PoR7SsVoTjsw==", + "requires": { + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/logger": "^5.6.0" + } + }, + "@ethersproject/wallet": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.6.0.tgz", + "integrity": "sha512-qMlSdOSTyp0MBeE+r7SUhr1jjDlC1zAXB8VD84hCnpijPQiSNbxr6GdiLXxpUs8UKzkDiNYYC5DRI3MZr+n+tg==", + "requires": { + "@ethersproject/abstract-provider": "^5.6.0", + "@ethersproject/abstract-signer": "^5.6.0", + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/hdnode": "^5.6.0", + "@ethersproject/json-wallets": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/random": "^5.6.0", + "@ethersproject/signing-key": "^5.6.0", + "@ethersproject/transactions": "^5.6.0", + "@ethersproject/wordlists": "^5.6.0" + } + }, "@ethersproject/web": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.6.0.tgz", @@ -13207,6 +13883,18 @@ "@ethersproject/strings": "^5.6.0" } }, + "@ethersproject/wordlists": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.6.0.tgz", + "integrity": "sha512-q0bxNBfIX3fUuAo9OmjlEYxP40IB8ABgb7HjEZCL5IKubzV3j30CWi2rqQbjTS2HfoyQbfINoKcTVWP4ejwR7Q==", + "requires": { + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + }, "@humanwhocodes/config-array": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", @@ -13699,6 +14387,11 @@ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" }, + "@supercharge/promise-pool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@supercharge/promise-pool/-/promise-pool-2.1.0.tgz", + "integrity": "sha512-YEKOfn4xF+DQ61UY5NwHNtr8hYjwchXjGTocVJDAHLQceIRZF8VECH7gumFbp+aGTfygPbMbEtBumXJ/mcJz+w==" + }, "@szmarczak/http-timer": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", @@ -14076,6 +14769,11 @@ "integrity": "sha512-s+3fXLkeeLjZ2kLjCBwQufpI5fuN+kIGBxu6530nVQZGVol0d7Y/M88/xw9HGGUcJjKf8LutN3VPRUBq6N7Ajg==", "dev": true }, + "aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=" + }, "agent-base": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", @@ -14101,15 +14799,14 @@ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", "dev": true, - "requires": { - "ajv": "^8.0.0" - }, + "requires": {}, "dependencies": { "ajv": { - "version": "8.11.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", + "version": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", "dev": true, + "optional": true, + "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -14121,7 +14818,9 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", - "dev": true + "dev": true, + "optional": true, + "peer": true } } }, @@ -14467,6 +15166,11 @@ "tweetnacl": "^0.14.3" } }, + "bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -16596,6 +17300,61 @@ } } }, + "ethers": { + "version": "5.6.5", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.6.5.tgz", + "integrity": "sha512-9CTmplO9bv0s/aPw3HB3txGzKz3tUSI2EfO4dJo0W2WvaEq1ArgsEX6obV+bj5X3yY+Zgb1kAux8TDtJKe1FaA==", + "requires": { + "@ethersproject/abi": "5.6.1", + "@ethersproject/abstract-provider": "5.6.0", + "@ethersproject/abstract-signer": "5.6.0", + "@ethersproject/address": "5.6.0", + "@ethersproject/base64": "5.6.0", + "@ethersproject/basex": "5.6.0", + "@ethersproject/bignumber": "5.6.0", + "@ethersproject/bytes": "5.6.1", + "@ethersproject/constants": "5.6.0", + "@ethersproject/contracts": "5.6.0", + "@ethersproject/hash": "5.6.0", + "@ethersproject/hdnode": "5.6.0", + "@ethersproject/json-wallets": "5.6.0", + "@ethersproject/keccak256": "5.6.0", + "@ethersproject/logger": "5.6.0", + "@ethersproject/networks": "5.6.2", + "@ethersproject/pbkdf2": "5.6.0", + "@ethersproject/properties": "5.6.0", + "@ethersproject/providers": "5.6.5", + "@ethersproject/random": "5.6.0", + "@ethersproject/rlp": "5.6.0", + "@ethersproject/sha2": "5.6.0", + "@ethersproject/signing-key": "5.6.1", + "@ethersproject/solidity": "5.6.0", + "@ethersproject/strings": "5.6.0", + "@ethersproject/transactions": "5.6.0", + "@ethersproject/units": "5.6.0", + "@ethersproject/wallet": "5.6.0", + "@ethersproject/web": "5.6.0", + "@ethersproject/wordlists": "5.6.0" + }, + "dependencies": { + "@ethersproject/abi": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.6.1.tgz", + "integrity": "sha512-0cqssYh6FXjlwKWBmLm3+zH2BNARoS5u/hxbz+LpQmcDB3w0W553h2btWui1/uZp2GBM/SI3KniTuMcYyHpA5w==", + "requires": { + "@ethersproject/address": "^5.6.0", + "@ethersproject/bignumber": "^5.6.0", + "@ethersproject/bytes": "^5.6.0", + "@ethersproject/constants": "^5.6.0", + "@ethersproject/hash": "^5.6.0", + "@ethersproject/keccak256": "^5.6.0", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/properties": "^5.6.0", + "@ethersproject/strings": "^5.6.0" + } + } + } + }, "ethjs-unit": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", @@ -18216,8 +18975,7 @@ "lodash": { "version": "4.17.21", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, "lodash.defaults": { "version": "4.2.0", @@ -20774,6 +21532,14 @@ "tweetnacl": "~0.14.0" } }, + "ssl-root-cas": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/ssl-root-cas/-/ssl-root-cas-1.3.1.tgz", + "integrity": "sha512-KR8J210Wfvjh+iNE9jcQEgbG0VG2713PHreItx6aNCPnkFO8XChz1cJ4iuCGeBj0+8wukLmgHgJqX+O5kRjPkQ==", + "requires": { + "@coolaj86/urequest": "^1.3.6" + } + }, "statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", diff --git a/package.json b/package.json index 7b76062c25..199619a6b0 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,8 @@ "author": "", "license": "ISC", "dependencies": { + "@defillama/sdk": "^2.3.61", + "bignumber.js": "^9.0.2", "date-fns": "^2.23.0", "dotenv": "^10.0.0", "graphql": "^15.5.1", diff --git a/src/adaptors/concentrator/abis/AladdinCRV.json b/src/adaptors/concentrator/abis/AladdinCRV.json new file mode 100644 index 0000000000..3219b9bef9 --- /dev/null +++ b/src/adaptors/concentrator/abis/AladdinCRV.json @@ -0,0 +1,28 @@ +{ + "totalUnderlying": { + "inputs": [], + "name": "totalUnderlying", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + "totalSupply": { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + } +} \ No newline at end of file diff --git a/src/adaptors/concentrator/abis/AladdinConvexVault.json b/src/adaptors/concentrator/abis/AladdinConvexVault.json new file mode 100644 index 0000000000..67b175e1af --- /dev/null +++ b/src/adaptors/concentrator/abis/AladdinConvexVault.json @@ -0,0 +1,71 @@ +{ + "poolInfo": { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "poolInfo", + "outputs": [ + { + "internalType": "uint128", + "name": "totalUnderlying", + "type": "uint128" + }, + { + "internalType": "uint128", + "name": "totalShare", + "type": "uint128" + }, + { + "internalType": "uint256", + "name": "accRewardPerShare", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "convexPoolId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "lpToken", + "type": "address" + }, + { + "internalType": "address", + "name": "crvRewards", + "type": "address" + }, + { + "internalType": "uint256", + "name": "withdrawFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "platformFeePercentage", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "harvestBountyPercentage", + "type": "uint256" + }, + { + "internalType": "bool", + "name": "pauseDeposit", + "type": "bool" + }, + { + "internalType": "bool", + "name": "pauseWithdraw", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } +} \ No newline at end of file diff --git a/src/adaptors/concentrator/abis/abi.json b/src/adaptors/concentrator/abis/abi.json new file mode 100644 index 0000000000..d72a2dd58f --- /dev/null +++ b/src/adaptors/concentrator/abis/abi.json @@ -0,0 +1,126 @@ +{ + "poolInfo": { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "poolInfo", + "outputs": [ + { + "internalType": "address", + "name": "lptoken", + "type": "address" + }, + { + "internalType": "address", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "gauge", + "type": "address" + }, + { + "internalType": "address", + "name": "crvRewards", + "type": "address" + }, + { + "internalType": "address", + "name": "stash", + "type": "address" + }, + { + "internalType": "bool", + "name": "shutdown", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + "poolLength": { + "inputs": [], + "name": "poolLength", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + "coinsUint": { + "name": "coins", + "outputs": [ + { + "type": "address", + "name": "" + } + ], + "inputs": [ + { + "type": "uint256", + "name": "arg0" + } + ], + "stateMutability": "view", + "type": "function", + "gas": 2280 + }, + "coinsInt": { + "name": "coins", + "outputs": [ + { + "type": "address", + "name": "out" + } + ], + "inputs": [ + { + "type": "int128", + "name": "arg0" + } + ], + "constant": true, + "payable": false, + "type": "function", + "gas": 2190 + }, + "underlying": { + "constant": true, + "inputs": [], + "name": "underlying", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + "exchangeRateStored": { + "constant": true, + "inputs": [], + "name": "exchangeRateStored", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + } +} \ No newline at end of file diff --git a/src/adaptors/concentrator/index.js b/src/adaptors/concentrator/index.js new file mode 100755 index 0000000000..90628ae520 --- /dev/null +++ b/src/adaptors/concentrator/index.js @@ -0,0 +1,253 @@ +const Web3 = require('web3'); +const sdk = require("@defillama/sdk"); +const { default: BigNumber } = require("bignumber.js"); +const utils = require('../utils'); +const abi = require('./abis/abi.json'); +const AladdinConvexVaultABI = require('./abis/AladdinConvexVault.json') +const AladdinCRVABI = require('./abis/AladdinCRV.json') +const curvePools = require('./pools.js'); + + +const convexVault = '0xc8fF37F7d057dF1BB9Ad681b53Fa4726f268E0e8'; +const convexVaultAcrv = '0x2b95A1Dcc3D405535f9ed33c219ab38E8d7e0884'; +const cvxcrvAddress = '0x62b9c7356a2dc64a1969e19c23e4f579f9810aa7'; + + +const crvAddress = '0xD533a949740bb3306d119CC777fa900bA034cd52'; +const cvxAddress = '0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B'; + +const replacements = [ + "0x99d1Fa417f94dcD62BfE781a1213c092a47041Bc", + "0x9777d7E2b60bB01759D0E2f8be2095df444cb07E", + "0x1bE5d71F2dA660BFdee8012dDc58D024448A0A59", + "0x16de59092dAE5CcF4A1E6439D611fd0653f0Bd01", + "0xd6aD7a6750A7593E092a9B218d66C0A814a3436e", + "0x83f798e925BcD4017Eb265844FDDAbb448f1707D", + "0x73a052500105205d34Daf004eAb301916DA8190f" +] +const replacePrice = [ + { address: '0x0000000000000000000000000000000000000000', token: 'ethereum' }, + { address: '0xFEEf77d3f69374f66429C91d732A244f074bdf74', token: 'frax-share' } +] +const getAllPools = async () => { + let dataApy = await utils.getData( + 'http://concentrator-api.aladdin.club/apy/' + ); + + const poolLength = (await sdk.api.abi.call({ + target: convexVault, + abi: abi.poolLength + })).output; + + + return await Promise.all([...Array(Number(poolLength)).keys()].map(async i => { + + const poolInfo = await sdk.api.abi.call({ + target: convexVault, + abi: AladdinConvexVaultABI.poolInfo, + params: [i] + }); + + const lpTokenSupply = await sdk.api.erc20.totalSupply({ + target: poolInfo.output.lpToken + }) + + const poolData = curvePools.find(crvPool => crvPool.addresses.lpToken.toLowerCase() === poolInfo.output.lpToken.toLowerCase()) + const swapAddress = poolData.addresses.swap + + const coinCalls = [...Array(Number(poolData.coins.length)).keys()].map(num => { + return { + target: swapAddress, + params: [num] + } + }); + + const coinsUint = sdk.api.abi.multiCall({ + abi: abi.coinsUint, + calls: coinCalls, + }) + + const coinsInt = sdk.api.abi.multiCall({ + abi: abi.coinsInt, + calls: coinCalls, + }) + + let coins = await coinsUint + if (!coins.output[0].success) { + coins = await coinsInt + } + + const coinBalances = await sdk.api.abi.multiCall({ + abi: 'erc20:balanceOf', + calls: coins.output.map(coin => ({ + target: coin.output, + params: [swapAddress] + })) + }) + + const resolvedLPSupply = lpTokenSupply.output; + const lpTvl = await getLpTvl(poolInfo, resolvedLPSupply, coinBalances, poolData, coins) + + const lpApy = await getLpApy(poolData, dataApy) + return { + lpTvl: lpTvl.toString(10), + lpApy: lpApy.toString(10), + poolData + } + })) +} + +const getLpTvl = async (poolInfo, resolvedLPSupply, coinBalances, poolData, coins) => { + let lpTvl = BigNumber(0); + await Promise.all(coinBalances.output.map(async (coinBalance, index) => { + let coinAddress = coins.output[index].output + if (replacements.includes(coinAddress)) { + coinAddress = "0x6b175474e89094c44da98b954eedeac495271d0f" // dai + } + if (coinBalance.input.target === "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE") { + coinBalance = await sdk.api.eth.getBalance({ + target: coinBalance.input.params[0] + }) + coinAddress = '0x0000000000000000000000000000000000000000' + } + const coinDecimals = poolData.coinDecimals[index] + + const isReplace = replacePrice.find(item => item.address.toLocaleLowerCase() == coinAddress.toLocaleLowerCase()) + let pricesUSD = 0; + if (isReplace && isReplace.token) { + pricesUSD = await utils.getCGpriceData( + isReplace.token, + true + ); + pricesUSD = pricesUSD[isReplace.token].usd + } else { + pricesUSD = await utils.getCGpriceData( + coinAddress, + false, + 'ethereum' + ); + pricesUSD = pricesUSD[coinAddress.toLocaleLowerCase()].usd + } + const balance = BigNumber(poolInfo.output.totalUnderlying).times(coinBalance.output).div(resolvedLPSupply); + let balancePrice = BigNumber(0) + if (!balance.isZero()) { + balancePrice = balance.times(pricesUSD).div(10 ** coinDecimals) + lpTvl = lpTvl.plus(balancePrice) + } + return balancePrice; + })) + return lpTvl +} + +const getLpApy = async (poolData, dataApy) => { + const convexApy = getConvexInfo('CRV', dataApy) ? getConvexInfo('CRV', dataApy).apy.project : 0 + const convexInfo = getConvexInfo(poolData.name, dataApy) + const baseApy = convexInfo ? convexInfo.apy.current : 0 + + const acrvApy = BigNumber(parseFloat(convexApy)) + .dividedBy(100) + .dividedBy(52) + .plus(1) + .pow(52) + .minus(1) + .shiftedBy(2) + + const compoundApy = acrvApy.multipliedBy(parseFloat(baseApy)).dividedBy(100) + let apy = compoundApy.plus(BigNumber(parseFloat(baseApy))) + let ethApy = BigNumber(1) + .plus(BigNumber(parseFloat(baseApy)).div(100)) + .plus(BigNumber(compoundApy).div(100)) + .times(BigNumber(0.045 * 0.85)) + .times(100) + if (poolData.isShowEthApy) { + apy = apy.plus(BigNumber(ethApy)) + } + return apy +} + +const getConvexInfo = (tokenName, dataApy) => { + let data = dataApy + try { + const info = + data.find(item => item.name === tokenName.toLocaleLowerCase() || item.name === tokenName) || + converWebsiteInfo.find(item => item.name === tokenName) + + if (BigNumber(parseFloat(info.apy.current)).isNaN()) { + return converWebsiteInfo.find(item => item.name === tokenName.toLocaleLowerCase()) + } + return info + } catch (error) { + return null + } +} + +const getAcrvPoolData = async () => { + let dataApy = await utils.getData( + 'http://concentrator-api.aladdin.club/apy/' + ); + let crvPrice = await utils.getCGpriceData( + 'convex-crv', + true + ); + crvPrice = crvPrice["convex-crv"].usd + const acrvTotalUnderlying = (await sdk.api.abi.call({ + target: convexVaultAcrv, + abi: AladdinCRVABI.totalUnderlying, + params: [] + })).output; + + const acrvTotalSupply = (await sdk.api.abi.call({ + target: convexVaultAcrv, + abi: AladdinCRVABI.totalSupply, + params: [] + })).output; + + const rate = acrvTotalSupply * 1 ? BigNumber(acrvTotalUnderlying).div(acrvTotalSupply) : 1 + + const cvxcrvBalance = BigNumber(acrvTotalUnderlying).multipliedBy(rate).times(crvPrice).div(10 ** 18).toString(10) + + const convexApy = getConvexInfo('CRV', dataApy)?.apy?.project || 0 + + const apy = BigNumber(parseFloat(convexApy)) + .dividedBy(100) + .dividedBy(365) + .plus(1) + .pow(365) + .minus(1) + .shiftedBy(2) + + const newObj = { + pool: '0x2b95A1Dcc3D405535f9ed33c219ab38E8d7e0884', + chain: utils.formatChain('ethereum'), + project: 'concentrator', + symbol: 'aCRV', + tvlUsd: parseInt(cvxcrvBalance, 10), + apy: parseFloat(apy.toString(10)), + }; + return newObj +} + +const buildPool = (entry, chainString) => { + const newObj = { + pool: `${entry.poolData.addresses.lpToken}-conentrator`, + chain: utils.formatChain(chainString), + project: 'concentrator', + symbol: utils.formatSymbol(entry.poolData.symbol), + tvlUsd: parseInt(entry.lpTvl, 10), + apy: parseFloat(entry.lpApy), + }; + return newObj; +}; + +const main = async () => { + const dataInfo = await getAllPools() + const acrvData = await getAcrvPoolData() + const data = dataInfo.map((el) => buildPool(el, 'ethereum')); + data.push(acrvData) + return data; +}; + +module.exports = { + timetravel: false, + apy: main, +}; diff --git a/src/adaptors/concentrator/pools.js b/src/adaptors/concentrator/pools.js new file mode 100644 index 0000000000..81e8471cad --- /dev/null +++ b/src/adaptors/concentrator/pools.js @@ -0,0 +1,181 @@ +const REFERENCE_ASSETS = {}; +const coins = { + eth: ['0x0000000000000000000000000000000000000000', 'ethereum'], + usdc: ['0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', 'usd-coin'], + usdt: ['0xdAC17F958D2ee523a2206206994597C13D831ec7', 'usd-coin'], + dai: ['0x6b175474e89094c44da98b954eedeac495271d0f', 'dai'], + wbtc: ['0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', 'bitcoin'], + steth: ['0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84', 'staked-ether'], + renBTC: ['0xEB4C2781e4ebA804CE9a9803C67d0893436bB27D', 'renbtc'], + + + crv: ['0xD533a949740bb3306d119CC777fa900bA034cd52', 'curve-dao-token'], + cvxcrv: ['0x62b9c7356a2dc64a1969e19c23e4f579f9810aa7', 'convex-crv'], + + frax: ['0x853d955aCEf822Db058eb8505911ED77F175b99e', 'frax'], + cvx: ['0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B', 'convex-finance'], + fxs: ['0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0', 'frax-share'], + crv3pool: ['0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', 'lp-3pool-curve'], + + reth: ['0xae78736cd615f374d3085123a210448e74fc6393', 'rocket-pool-eth'], + wstETH: ['0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0', 'wrapped-steth'], + "UST(Wormhole)": ['0xa693B19d2931d498c5B318dF961919BB4aee87a5', 'terrausd-wormhole'], + "UST(Terra)": ['0xa47c8bf37f92aBed4A126BDA807A7b7498661acD', 'terrausd-wormhole'], +} + +module.exports = [ + { + symbol: 'ETH-stETH', + name: 'steth', + coins: [ + coins.eth, + coins.steth, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0xDC24316b9AE028F1497c275EB9192a3Ea0f67022', + lpToken: '0x06325440D014e39736583c165C2963BA99fAf14E', + }, + }, + { + symbol: 'FRAX-3Crv', + name: 'frax', + coins: [ + coins.frax, + coins.crv3pool + ], + coinDecimals: [18, 18], + addresses: { + swap: '0xd632f22692FaC7611d2AA1C0D552930D43CAEd3B', + lpToken: '0xd632f22692FaC7611d2AA1C0D552930D43CAEd3B', + }, + }, + { + symbol: 'USDT-wBTC-WETH', + name: 'tricrypto2', + coins: [ + coins.usdt, + coins.wbtc, + coins.eth, + ], + coinDecimals: [6, 8, 18], + addresses: { + swap: '0xD51a44d3FaE010294C616388b506AcdA1bfAAE46', + lpToken: '0xc4AD29ba4B3c580e6D59105FFf484999997675Ff', + }, + }, + + { + symbol: 'cvxCRV-CRV', + name: 'cvxcrv', + coins: [ + coins.crv, + coins.cvxcrv, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0x9D0464996170c6B9e75eED71c68B99dDEDf279e8', + lpToken: '0x9D0464996170c6B9e75eED71c68B99dDEDf279e8' + } + }, + { + symbol: 'ETH-CRV', + name: 'crveth', + coins: [ + coins.eth, + coins.crv, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0x8301AE4fc9c624d1D396cbDAa1ed877821D7C511', + lpToken: '0xEd4064f376cB8d68F770FB1Ff088a3d0F3FF5c4d', + }, + }, + + { + symbol: 'ETH-CVX', + name: 'cvxeth', + coins: [ + coins.eth, + coins.cvx, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0xB576491F1E6e5E62f1d8F26062Ee822B40B0E0d4', + lpToken: '0x3A283D9c08E8b55966afb64C515f5143cf907611', + }, + }, + + { + symbol: 'FXS-cvxFXS', + name: 'cvxfxs', + coins: [ + coins.fxs, + coins.fxs, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0xd658A338613198204DCa1143Ac3F01A722b5d94A', + lpToken: '0xF3A43307DcAFa93275993862Aae628fCB50dC768' + } + }, + + { + symbol: 'DAI-USDC-USDT', + name: '3pool', + coins: [ + coins.dai, + coins.usdc, + coins.usdt, + ], + coinDecimals: [18, 6, 6], + addresses: { + swap: '0xbEbc44782C7dB0a1A60Cb6fe97d0b483032FF1C7', + lpToken: '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490', + }, + }, + + { + symbol: 'UST-3Crv', + name: 'ust-wormhole', + coins: [ + coins.ust, + coins.crv3pool + ], + coinDecimals: [6, 18], + addresses: { + swap: '0xCEAF7747579696A2F0bb206a14210e3c9e6fB269', + lpToken: '0xCEAF7747579696A2F0bb206a14210e3c9e6fB269', + }, + }, + + { + symbol: 'rETH-wstETH', + name: 'RocketPoolETH', + isShowEthApy: true, + coins: [ + coins.rETH, + coins.wstETH, + ], + coinDecimals: [18, 18], + addresses: { + swap: '0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08', + lpToken: '0x447Ddd4960d9fdBF6af9a790560d0AF76795CB08', + }, + }, + + { + symbol: 'renBTC-wBTC', + name: 'ren', + coins: [ + coins.renbtc, + coins.wbtc + ], + coinDecimals: [8, 8], + addresses: { + swap: '0x93054188d876f558f4a66B2EF1d97d16eDf0895B', + lpToken: '0x49849C98ae39Fff122806C06791Fa73784FB3675', + }, + }, + +]; \ No newline at end of file