From 9acb0cf6db2f9fb7d2e97de3e8bc7b0f006b2d7d Mon Sep 17 00:00:00 2001 From: Lynn Yu Date: Tue, 13 Jun 2023 13:31:42 -0400 Subject: [PATCH 1/4] avax --- src/utils/constants.ts | 2 +- src/utils/pricing.ts | 49 ++++++++++---------------- src/utils/staticTokenDefinition.ts | 55 ------------------------------ subgraph.yaml | 17 ++++----- 4 files changed, 26 insertions(+), 97 deletions(-) diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 52a71a92..e1dcee9d 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -3,7 +3,7 @@ import { BigInt, BigDecimal, Address } from '@graphprotocol/graph-ts' import { Factory as FactoryContract } from '../types/templates/Pool/Factory' export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000' -export const FACTORY_ADDRESS = '0x1F98431c8aD98523631AE4a59f267346ea31F984' +export const FACTORY_ADDRESS = '0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD' export let ZERO_BI = BigInt.fromI32(0) export let ONE_BI = BigInt.fromI32(1) diff --git a/src/utils/pricing.ts b/src/utils/pricing.ts index 1a8a19cf..15c242c9 100644 --- a/src/utils/pricing.ts +++ b/src/utils/pricing.ts @@ -4,42 +4,29 @@ import { Bundle, Pool, Token } from './../types/schema' import { BigDecimal, BigInt } from '@graphprotocol/graph-ts' import { exponentToBigDecimal, safeDiv } from '../utils/index' -const WETH_ADDRESS = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' -const USDC_WETH_03_POOL = '0x8ad599c3a0ff1de082011efddc58f1908eb6e6d8' +const WAVAX_ADDRESS = '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7' +const WAVAX_USDC_03_POOL = '0x1b323f29f54461a7b61B7e66F1a93E4cDe032167' // token where amounts should contribute to tracked volume and liquidity // usually tokens that many tokens are paired with s export let WHITELIST_TOKENS: string[] = [ - WETH_ADDRESS, // WETH - '0x6b175474e89094c44da98b954eedeac495271d0f', // DAI - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // USDC - '0xdac17f958d2ee523a2206206994597c13d831ec7', // USDT - '0x0000000000085d4780b73119b644ae5ecd22b376', // TUSD - '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', // WBTC - '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643', // cDAI - '0x39aa39c021dfbae8fac545936693ac917d5e7563', // cUSDC - '0x86fadb80d8d2cff3c3680819e4da99c10232ba0f', // EBASE - '0x57ab1ec28d129707052df4df418d58a2d46d5f51', // sUSD - '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2', // MKR - '0xc00e94cb662c3520282e6f5717214004a7f26888', // COMP - '0x514910771af9ca656af840dff83e8264ecf986ca', // LINK - '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f', // SNX - '0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e', // YFI - '0x111111111117dc0aa78b770fa6a738034120c302', // 1INCH - '0xdf5e0e81dff6faf3a7e52ba697820c5e32d806a8', // yCurv - '0x956f47f50a910163d8bf957cf5846d573e7f87ca', // FEI - '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0', // MATIC - '0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9', // AAVE - '0xfe2e637202056d30016725477c5da089ab0a043a' // sETH2 + WAVAX_ADDRESS, // WAVAX + '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', // DAI.e + '0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a', // DAI + '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664', // USDC.e + '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC + '0xc7198437980c041c805A1EDcbA50c1Ce5db95118', // USDT.e + '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDt + '0x130966628846BFd36ff31a822705796e8cb8C18D', // MIM ] let STABLE_COINS: string[] = [ - '0x6b175474e89094c44da98b954eedeac495271d0f', - '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', - '0xdac17f958d2ee523a2206206994597c13d831ec7', - '0x0000000000085d4780b73119b644ae5ecd22b376', - '0x956f47f50a910163d8bf957cf5846d573e7f87ca', - '0x4dd28568d05f09b02220b09c2cb307bfd837cb95' + '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', // DAI.e + '0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a', // DAI + '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664', // USDC.e + '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC + '0xc7198437980c041c805A1EDcbA50c1Ce5db95118', // USDT.e + '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDt ] let MINIMUM_ETH_LOCKED = BigDecimal.fromString('60') @@ -59,7 +46,7 @@ export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, t export function getEthPriceInUSD(): BigDecimal { // fetch eth prices for each stablecoin - let usdcPool = Pool.load(USDC_WETH_03_POOL) // dai is token0 + let usdcPool = Pool.load(WAVAX_USDC_03_POOL) if (usdcPool !== null) { return usdcPool.token0Price } else { @@ -72,7 +59,7 @@ export function getEthPriceInUSD(): BigDecimal { * @todo update to be derived ETH (add stablecoin estimates) **/ export function findEthPerToken(token: Token): BigDecimal { - if (token.id == WETH_ADDRESS) { + if (token.id == WAVAX_ADDRESS) { return ONE_BD } let whiteList = token.whitelistPools diff --git a/src/utils/staticTokenDefinition.ts b/src/utils/staticTokenDefinition.ts index bb805f2d..c37befb7 100644 --- a/src/utils/staticTokenDefinition.ts +++ b/src/utils/staticTokenDefinition.ts @@ -21,61 +21,6 @@ export class StaticTokenDefinition { // Get all tokens with a static defintion static getStaticDefinitions(): Array { let staticDefinitions = new Array(6) - - // Add DGD - let tokenDGD = new StaticTokenDefinition( - Address.fromString('0xe0b7927c4af23765cb51314a0e0521a9645f0e2a'), - 'DGD', - 'DGD', - BigInt.fromI32(9) - ) - staticDefinitions.push(tokenDGD) - - // Add AAVE - let tokenAAVE = new StaticTokenDefinition( - Address.fromString('0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9'), - 'AAVE', - 'Aave Token', - BigInt.fromI32(18) - ) - staticDefinitions.push(tokenAAVE) - - // Add LIF - let tokenLIF = new StaticTokenDefinition( - Address.fromString('0xeb9951021698b42e4399f9cbb6267aa35f82d59d'), - 'LIF', - 'Lif', - BigInt.fromI32(18) - ) - staticDefinitions.push(tokenLIF) - - // Add SVD - let tokenSVD = new StaticTokenDefinition( - Address.fromString('0xbdeb4b83251fb146687fa19d1c660f99411eefe3'), - 'SVD', - 'savedroid', - BigInt.fromI32(18) - ) - staticDefinitions.push(tokenSVD) - - // Add TheDAO - let tokenTheDAO = new StaticTokenDefinition( - Address.fromString('0xbb9bc244d798123fde783fcc1c72d3bb8c189413'), - 'TheDAO', - 'TheDAO', - BigInt.fromI32(16) - ) - staticDefinitions.push(tokenTheDAO) - - // Add HPB - let tokenHPB = new StaticTokenDefinition( - Address.fromString('0x38c6a68304cdefb9bec48bbfaaba5c5b47818bb2'), - 'HPB', - 'HPBCoin', - BigInt.fromI32(18) - ) - staticDefinitions.push(tokenHPB) - return staticDefinitions } diff --git a/subgraph.yaml b/subgraph.yaml index ee6d649e..786c4976 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -3,19 +3,16 @@ description: Uniswap is a decentralized protocol for automated token exchange on repository: https://github.com/Uniswap/uniswap-v3-subgraph schema: file: ./schema.graphql -graft: - base: QmPrb5mvZj3ycUugZgwLWCvK93jfXfhvfjRXrFk4tRmyCX - block: 14292820 features: - nonFatalErrors dataSources: - kind: ethereum/contract name: Factory - network: mainnet + network: avalanche source: - address: '0x1F98431c8aD98523631AE4a59f267346ea31F984' + address: '0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD' abi: Factory - startBlock: 12369621 + startBlock: 27832971 mapping: kind: ethereum/events apiVersion: 0.0.4 @@ -40,11 +37,11 @@ dataSources: handler: handlePoolCreated - kind: ethereum/contract name: NonfungiblePositionManager - network: mainnet + network: avalanche source: - address: '0xC36442b4a4522E871399CD717aBDD847Ab11FE88' + address: '0x655C406EBFa14EE2006250925e54ec43AD184f8B' abi: NonfungiblePositionManager - startBlock: 12369651 + startBlock: 27833024 mapping: kind: ethereum/events apiVersion: 0.0.4 @@ -74,7 +71,7 @@ dataSources: templates: - kind: ethereum/contract name: Pool - network: mainnet + network: avalanche source: abi: Pool mapping: From aa96c41086e784add0daefe716c0ce6cdc2ca9bc Mon Sep 17 00:00:00 2001 From: Lynn Yu Date: Thu, 3 Aug 2023 14:20:39 -0400 Subject: [PATCH 2/4] init --- package.json | 5 +- src/utils/constants.ts | 2 +- src/utils/pricing.ts | 21 ++--- subgraph.yaml | 14 +-- yarn.lock | 197 ++++++++++++++++++++++++++++++++--------- 5 files changed, 171 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index 6c30ecac..0ce7dc52 100644 --- a/package.json +++ b/package.json @@ -8,10 +8,11 @@ "build": "graph build", "create-local": "graph create ianlapham/uniswap-v3 --node http://127.0.0.1:8020", "deploy-local": "graph deploy ianlapham/uniswap-v3 --debug --ipfs http://localhost:5001 --node http://127.0.0.1:8020", - "deploy": "graph deploy ianlapham/uniswap-v3-subgraph --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --debug", + "deploy": "graph deploy lynnshaoyu/uniswap-v3-base --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/ --debug", "deploy-dev": "graph deploy sommelier/uniswap-v3 --ipfs http://35.197.14.14:5000/ --node http://35.197.14.14:8020/ --debug", "deploy-staging": "graph deploy $THE_GRAPH_GITHUB_USER/$THE_GRAPH_SUBGRAPH_NAME /Uniswap --ipfs https://api.staging.thegraph.com/ipfs/ --node https://api.staging.thegraph.com/deploy/", - "watch-local": "graph deploy ianlapham/uniswap-v3 --watch --debug --node http://127.0.0.1:8020/ --ipfs http://localhost:5001" + "watch-local": "graph deploy ianlapham/uniswap-v3 --watch --debug --node http://127.0.0.1:8020/ --ipfs http://localhost:5001", + "deploy-to-new-chain": "graph deploy --access-token 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 lynnshaoyu/uniswap-v3-base --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/" }, "devDependencies": { "@graphprotocol/graph-cli": "^0.20.0", diff --git a/src/utils/constants.ts b/src/utils/constants.ts index e1dcee9d..f331a4d5 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -3,7 +3,7 @@ import { BigInt, BigDecimal, Address } from '@graphprotocol/graph-ts' import { Factory as FactoryContract } from '../types/templates/Pool/Factory' export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000' -export const FACTORY_ADDRESS = '0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD' +export const FACTORY_ADDRESS = '0x33128a8fC17869897dcE68Ed026d694621f6FDfD' export let ZERO_BI = BigInt.fromI32(0) export let ONE_BI = BigInt.fromI32(1) diff --git a/src/utils/pricing.ts b/src/utils/pricing.ts index 15c242c9..852d5bff 100644 --- a/src/utils/pricing.ts +++ b/src/utils/pricing.ts @@ -4,29 +4,18 @@ import { Bundle, Pool, Token } from './../types/schema' import { BigDecimal, BigInt } from '@graphprotocol/graph-ts' import { exponentToBigDecimal, safeDiv } from '../utils/index' -const WAVAX_ADDRESS = '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7' -const WAVAX_USDC_03_POOL = '0x1b323f29f54461a7b61B7e66F1a93E4cDe032167' +const WETH_ADDRESS = '0x4200000000000000000000000000000000000006' +const WETH_USDC_05_POOL = '0x4C36388bE6F416A29C8d8Eee81C771cE6bE14B18' // token where amounts should contribute to tracked volume and liquidity // usually tokens that many tokens are paired with s export let WHITELIST_TOKENS: string[] = [ - WAVAX_ADDRESS, // WAVAX - '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', // DAI.e - '0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a', // DAI - '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664', // USDC.e + WETH_ADDRESS, // WETH '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC - '0xc7198437980c041c805A1EDcbA50c1Ce5db95118', // USDT.e - '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDt - '0x130966628846BFd36ff31a822705796e8cb8C18D', // MIM ] let STABLE_COINS: string[] = [ - '0xd586E7F844cEa2F87f50152665BCbc2C279D8d70', // DAI.e - '0xbA7dEebBFC5fA1100Fb055a87773e1E99Cd3507a', // DAI - '0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664', // USDC.e '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC - '0xc7198437980c041c805A1EDcbA50c1Ce5db95118', // USDT.e - '0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7', // USDt ] let MINIMUM_ETH_LOCKED = BigDecimal.fromString('60') @@ -46,7 +35,7 @@ export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, t export function getEthPriceInUSD(): BigDecimal { // fetch eth prices for each stablecoin - let usdcPool = Pool.load(WAVAX_USDC_03_POOL) + let usdcPool = Pool.load(WETH_USDC_05_POOL) if (usdcPool !== null) { return usdcPool.token0Price } else { @@ -59,7 +48,7 @@ export function getEthPriceInUSD(): BigDecimal { * @todo update to be derived ETH (add stablecoin estimates) **/ export function findEthPerToken(token: Token): BigDecimal { - if (token.id == WAVAX_ADDRESS) { + if (token.id == WETH_ADDRESS) { return ONE_BD } let whiteList = token.whitelistPools diff --git a/subgraph.yaml b/subgraph.yaml index 786c4976..0df8907b 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -8,11 +8,11 @@ features: dataSources: - kind: ethereum/contract name: Factory - network: avalanche + network: base source: - address: '0x740b1c1de25031C31FF4fC9A62f554A55cdC1baD' + address: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD' abi: Factory - startBlock: 27832971 + startBlock: 2009445 mapping: kind: ethereum/events apiVersion: 0.0.4 @@ -37,11 +37,11 @@ dataSources: handler: handlePoolCreated - kind: ethereum/contract name: NonfungiblePositionManager - network: avalanche + network: base source: - address: '0x655C406EBFa14EE2006250925e54ec43AD184f8B' + address: '0x03a520b32C04BF3bEEf7BEb72E919cf822Ed34f1' abi: NonfungiblePositionManager - startBlock: 27833024 + startBlock: 1371713 mapping: kind: ethereum/events apiVersion: 0.0.4 @@ -71,7 +71,7 @@ dataSources: templates: - kind: ethereum/contract name: Pool - network: avalanche + network: base source: abi: Pool mapping: diff --git a/yarn.lock b/yarn.lock index 583865c2..641f11c3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -23,10 +23,10 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@graphprotocol/graph-cli@0.21.1": - version "0.21.1" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.21.1.tgz#06cc85f3b950c01ca12c87c1fa47cacf4deec078" - integrity sha512-bqHlHZTzfEJICUpGQQr4Pru07OiGiOpIiwkVSdQMJaiuwu+bflMmLJNYNbSRH2byqaWDZvc4MI3U9CwUYXdRRw== +"@graphprotocol/graph-cli@^0.20.0": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-cli/-/graph-cli-0.20.1.tgz#659459091821861987e6596b46e692ca4a3c2b3b" + integrity sha512-vT8pKz2OMyLcYGiFK8RVUk0HHYT9hYYdGwlYAOUON3HHIr51EjSbvTHW7ezBfneFurzj9z0Xdezwywf/N1ay0Q== dependencies: assemblyscript "git+https://github.com/AssemblyScript/assemblyscript.git#v0.6" chalk "^3.0.0" @@ -46,15 +46,17 @@ pkginfo "^0.4.1" prettier "^1.13.5" request "^2.88.0" - tmp-promise "^3.0.2" + tmp "^0.1.0" yaml "^1.5.1" + optionalDependencies: + keytar "^7.4.0" -"@graphprotocol/graph-ts@0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.20.0.tgz#ed31ffd59a6aa9703a1ec5079f137a81220443cb" - integrity sha512-+R0Tu/MD4Fiq0Fo+v1l+xznz+ZrciQKWlzMtXjDrhM70vlMNVL9wDmf90MVFYpslgqIfw024hT6XwlmyNyOWbQ== +"@graphprotocol/graph-ts@^0.20.0": + version "0.20.1" + resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.20.1.tgz#42a45158c5904224f28d3cf6c5d1ffc876720f81" + integrity sha512-JATb0tERXt+JZUYuW9rwfnLzIM4EOBHf/EEZir5JMiIVMP55CoOyQGAwH2dvKSm5O8WQ1BfdbnOvk7YNVMFHsg== dependencies: - assemblyscript "https://github.com/AssemblyScript/assemblyscript#36040d5b5312f19a025782b5e36663823494c2f3" + assemblyscript "git+https://github.com/AssemblyScript/assemblyscript.git#v0.6" "@protobufjs/utf8@^1.1.0": version "1.1.0" @@ -294,17 +296,6 @@ asn1@~0.2.3: dependencies: safer-buffer "~2.1.0" -"assemblyscript@git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3": - version "0.6.0" - resolved "git+https://github.com/AssemblyScript/assemblyscript.git#36040d5b5312f19a025782b5e36663823494c2f3" - dependencies: - "@protobufjs/utf8" "^1.1.0" - binaryen "77.0.0-nightly.20190407" - glob "^7.1.3" - long "^4.0.0" - opencollective-postinstall "^2.0.0" - source-map-support "^0.5.11" - "assemblyscript@git+https://github.com/AssemblyScript/assemblyscript.git#v0.6": version "0.6.0" resolved "git+https://github.com/AssemblyScript/assemblyscript.git#3ed76a97f05335504166fce1653da75f4face28f" @@ -616,7 +607,7 @@ chokidar@^3.0.2: optionalDependencies: fsevents "~2.3.1" -chownr@^1.0.1: +chownr@^1.0.1, chownr@^1.1.1: version "1.1.4" resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== @@ -836,6 +827,18 @@ decamelize@^1.2.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= +decompress-response@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc" + integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ== + dependencies: + mimic-response "^3.1.0" + +deep-extend@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" + integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA== + deep-is@~0.1.3: version "0.1.3" resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" @@ -858,6 +861,11 @@ delimit-stream@0.1.0: resolved "https://registry.yarnpkg.com/delimit-stream/-/delimit-stream-0.1.0.tgz#9b8319477c0e5f8aeb3ce357ae305fc25ea1cd2b" integrity sha1-m4MZR3wOX4rrPONXrjBfwl6hzSs= +detect-libc@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d" + integrity sha512-UX6sGumvvqSaXgdKGUsgZWqcUyIXZ/vZTrlRT/iobiKhGL0zL4d3osHj3uqllWJK+i+sixDS/3COVEOFbupFyw== + detect-node@^2.0.4: version "2.0.5" resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.0.5.tgz#9d270aa7eaa5af0b72c4c9d9b814e7f4ce738b79" @@ -1138,6 +1146,11 @@ execa@^3.0.0: signal-exit "^3.0.2" strip-final-newline "^2.0.0" +expand-template@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c" + integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg== + explain-error@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/explain-error/-/explain-error-1.0.4.tgz#a793d3ac0cad4c6ab571e9968fbbab6cb2532929" @@ -1322,6 +1335,11 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" +github-from-package@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce" + integrity sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw== + glob-parent@^5.0.0, glob-parent@~5.1.0: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -1523,6 +1541,11 @@ inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +ini@~1.3.0: + version "1.3.8" + resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" + integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== + inquirer@^7.0.0: version "7.3.3" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" @@ -1933,6 +1956,14 @@ keypair@^1.0.1: resolved "https://registry.yarnpkg.com/keypair/-/keypair-1.0.3.tgz#4314109d94052a0acfd6b885695026ad29529c80" integrity sha512-0wjZ2z/SfZZq01+3/8jYLd8aEShSa+aat1zyPGQY3IuKoEAp6DJGvu2zt6snELrQU9jbCkIlCyNOD7RdQbHhkQ== +keytar@^7.4.0: + version "7.9.0" + resolved "https://registry.yarnpkg.com/keytar/-/keytar-7.9.0.tgz#4c6225708f51b50cbf77c5aae81721964c2918cb" + integrity sha512-VPD8mtVtm5JNtA2AErl6Chp06JBfy7diFQ7TQQhdpWOl6MrCRB+eRbvAZUsbGQS9kiMq0coJsy0W0vHpDCkWsQ== + dependencies: + node-addon-api "^4.3.0" + prebuild-install "^7.0.1" + kind-of@^6.0.2: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -2154,6 +2185,11 @@ mimic-fn@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== +mimic-response@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" + integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== + minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" @@ -2176,6 +2212,16 @@ minimist@^1.2.0, minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== +minimist@^1.2.3: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + +mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + mkdirp@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -2340,6 +2386,11 @@ nan@^2.14.0, nan@^2.14.2: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== +napi-build-utils@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806" + integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -2359,6 +2410,18 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== +node-abi@^3.3.0: + version "3.45.0" + resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.45.0.tgz#f568f163a3bfca5aacfce1fbeee1fa2cc98441f5" + integrity sha512-iwXuFrMAcFVi/ZoZiqq8BzAdsLw9kxDfTC0HMyjXfSL/6CSDAGD5UmR7azrAgWV1zKYq7dUUMj4owusBWKLsiQ== + dependencies: + semver "^7.3.5" + +node-addon-api@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-4.3.0.tgz#52a1a0b475193e0928e98e0426a0d1254782b77f" + integrity sha512-73sE9+3UaLYYFmDsFZnqCInzPyh3MqIwZO9cw58yIqAZhONrrabrYyYe3TuIqtIiOuTXVhsGau8hcrhhwSsDIQ== + node-fetch@^2.3.0: version "2.6.1" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" @@ -2555,6 +2618,24 @@ pluralize@^8.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1" integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA== +prebuild-install@^7.0.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.1.1.tgz#de97d5b34a70a0c81334fd24641f2a1702352e45" + integrity sha512-jAXscXWMcCK8GgCoHOfIr0ODh5ai8mj63L2nWrjuAgXE6tDyYGnx4/8o/rCgU+B4JSyZBKbeZqzhtwtC3ovxjw== + dependencies: + detect-libc "^2.0.0" + expand-template "^2.0.3" + github-from-package "0.0.0" + minimist "^1.2.3" + mkdirp-classic "^0.5.3" + napi-build-utils "^1.0.1" + node-abi "^3.3.0" + pump "^3.0.0" + rc "^1.2.7" + simple-get "^4.0.0" + tar-fs "^2.0.0" + tunnel-agent "^0.6.0" + prelude-ls@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" @@ -2679,6 +2760,16 @@ ramdasauce@^2.1.0: dependencies: ramda "^0.24.1" +rc@^1.2.7: + version "1.2.8" + resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed" + integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw== + dependencies: + deep-extend "^0.6.0" + ini "~1.3.0" + minimist "^1.2.0" + strip-json-comments "~2.0.1" + "readable-stream@2 || 3", readable-stream@^3.0.0, readable-stream@^3.0.1, readable-stream@^3.0.2, readable-stream@^3.1.1, readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" @@ -2781,13 +2872,6 @@ rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@^3.0.0: - version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" - integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== - dependencies: - glob "^7.1.3" - ripemd160@^2.0.0, ripemd160@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c" @@ -2869,6 +2953,13 @@ semver@^7.0.0, semver@^7.3.2: dependencies: lru-cache "^6.0.0" +semver@^7.3.5: + version "7.5.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" + integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== + dependencies: + lru-cache "^6.0.0" + sha.js@^2.4.0, sha.js@^2.4.8: version "2.4.11" resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7" @@ -2922,6 +3013,20 @@ signed-varint@^2.0.1: dependencies: varint "~5.0.0" +simple-concat@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f" + integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q== + +simple-get@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.1.tgz#4a39db549287c979d352112fa03fd99fd6bc3543" + integrity sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA== + dependencies: + decompress-response "^6.0.0" + once "^1.3.1" + simple-concat "^1.0.0" + slice-ansi@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" @@ -3065,6 +3170,11 @@ strip-json-comments@^3.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== +strip-json-comments@~2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -3089,6 +3199,16 @@ table@^5.2.3: slice-ansi "^2.1.0" string-width "^3.0.0" +tar-fs@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" + integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.1.4" + tar-fs@~1.16.3: version "1.16.3" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.3.tgz#966a628841da2c4010406a82167cbd5e0c72d509" @@ -3112,7 +3232,7 @@ tar-stream@^1.1.2: to-buffer "^1.1.1" xtend "^4.0.0" -tar-stream@^2.0.1: +tar-stream@^2.0.1, tar-stream@^2.1.4: version "2.2.0" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== @@ -3141,13 +3261,6 @@ through2@^3.0.0, through2@^3.0.1: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -tmp-promise@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/tmp-promise/-/tmp-promise-3.0.2.tgz#6e933782abff8b00c3119d63589ca1fb9caaa62a" - integrity sha512-OyCLAKU1HzBjL6Ev3gxUeraJNlbNingmi8IrHHEsYH8LTmEuhvYfqvhn2F/je+mjf4N58UmZ96OMEy1JanSCpA== - dependencies: - tmp "^0.2.0" - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -3155,12 +3268,12 @@ tmp@^0.0.33: dependencies: os-tmpdir "~1.0.2" -tmp@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.2.1.tgz#8457fc3037dcf4719c251367a1af6500ee1ccf14" - integrity sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ== +tmp@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877" + integrity sha512-J7Z2K08jbGcdA1kkQpJSqLF6T0tdQqpR2pnSUXsIchbPdTI9v3e85cLW0d6WDhwuAleOV71j2xWs8qMPfK7nKw== dependencies: - rimraf "^3.0.0" + rimraf "^2.6.3" to-buffer@^1.1.1: version "1.1.1" From cffd6df34113a55936e4812c7c03460386204e7c Mon Sep 17 00:00:00 2001 From: Ian Lapham Date: Mon, 7 Aug 2023 18:31:14 +0200 Subject: [PATCH 3/4] update pricing min threshold --- src/utils/pricing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/pricing.ts b/src/utils/pricing.ts index 852d5bff..bc24bd73 100644 --- a/src/utils/pricing.ts +++ b/src/utils/pricing.ts @@ -18,7 +18,7 @@ let STABLE_COINS: string[] = [ '0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E', // USDC ] -let MINIMUM_ETH_LOCKED = BigDecimal.fromString('60') +let MINIMUM_ETH_LOCKED = BigDecimal.fromString('1') let Q192 = 2 ** 192 export function sqrtPriceX96ToTokenPrices(sqrtPriceX96: BigInt, token0: Token, token1: Token): BigDecimal[] { From 3599a99bb5e21675aa284b669b3638acb2ab979a Mon Sep 17 00:00:00 2001 From: Lynn Yu Date: Mon, 7 Aug 2023 12:33:34 -0400 Subject: [PATCH 4/4] subgraph.yaml --- subgraph.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/subgraph.yaml b/subgraph.yaml index 0df8907b..2b619ea3 100644 --- a/subgraph.yaml +++ b/subgraph.yaml @@ -1,4 +1,4 @@ -specVersion: 0.0.2 +specVersion: 0.0.4 description: Uniswap is a decentralized protocol for automated token exchange on Ethereum. repository: https://github.com/Uniswap/uniswap-v3-subgraph schema: @@ -12,10 +12,10 @@ dataSources: source: address: '0x33128a8fC17869897dcE68Ed026d694621f6FDfD' abi: Factory - startBlock: 2009445 + startBlock: 1371679 mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript file: ./src/mappings/factory.ts entities: @@ -44,7 +44,7 @@ dataSources: startBlock: 1371713 mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript file: ./src/mappings/position-manager.ts entities: @@ -76,7 +76,7 @@ templates: abi: Pool mapping: kind: ethereum/events - apiVersion: 0.0.4 + apiVersion: 0.0.5 language: wasm/assemblyscript file: ./src/mappings/core.ts entities: