diff --git a/deployment/deployment.json b/deployment/deployment.json index 777d32a942..fc9bf10513 100644 --- a/deployment/deployment.json +++ b/deployment/deployment.json @@ -7682,7 +7682,7 @@ "status": "prod", "versions": { "schema": "1.2.0", - "subgraph": "1.0.0", + "subgraph": "1.0.1", "methodology": "1.0.0" }, "services": { @@ -7704,7 +7704,7 @@ "status": "prod", "versions": { "schema": "1.2.0", - "subgraph": "1.0.0", + "subgraph": "1.0.1", "methodology": "1.0.0" }, "services": { @@ -7726,7 +7726,7 @@ "status": "prod", "versions": { "schema": "1.2.0", - "subgraph": "1.0.0", + "subgraph": "1.0.1", "methodology": "1.0.0" }, "services": { @@ -7748,7 +7748,7 @@ "status": "prod", "versions": { "schema": "1.2.0", - "subgraph": "1.0.0", + "subgraph": "1.0.1", "methodology": "1.0.0" }, "services": { @@ -7770,7 +7770,7 @@ "status": "prod", "versions": { "schema": "1.2.0", - "subgraph": "1.0.0", + "subgraph": "1.0.1", "methodology": "1.0.0" }, "services": { diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.json b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.json index b9de83778c..475924f690 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.json +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.json @@ -3,9 +3,9 @@ "isMainnet": false, "subgraphName": "hop-arbitrum", "deployment": "HOP_PROTOCOL_ARBITRUM", - "graftEnabled": true, - "subgraphId": "QmRkuASsskvysrucvDViRQHEbycKbk89r26BYfEufe7wgr", - "graftStartBlock": 51301700, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0, "amms": [ { "dataSourceName": "HopL2Amm", diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.ts b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.ts index ce0d34351a..d9d271c94c 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.ts +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-arbitrum/configurations.ts @@ -15,6 +15,7 @@ import { ArbitrumNovaToken, ArbitrumNovaAmm, ArbitrumNovaHtoken, + BaseToken, } from "../../../../../src/sdk/util/constants"; import { Network } from "../../../../../src/sdk/util/constants"; export class HopProtocolArbitrumConfigurations implements Configurations { @@ -73,6 +74,8 @@ export class HopProtocolArbitrumConfigurations implements Configurations { return this.getArbitrumNovaConfigFromTokenAddress(tokenAddress)[0]; else if (chainId == "1") return this.getMainnetCrossTokenFromTokenAddress(tokenAddress); + else if (chainId == "8453") + return this.getBaseCrossTokenFromTokenAddress(tokenAddress); else { log.critical("Chain not found", []); return ""; @@ -166,6 +169,15 @@ export class HopProtocolArbitrumConfigurations implements Configurations { return ""; } + getBaseCrossTokenFromTokenAddress(tokenAddress: string): string { + if (tokenAddress == ArbitrumToken.USDC) return BaseToken.USDC; + if (tokenAddress == ArbitrumToken.ETH) return BaseToken.ETH; + else { + log.critical("BaseCrossToken not found for token: {}", [tokenAddress]); + } + return ""; + } + getTokenAddressFromBridgeAddress(bridgeAddress: string): string[] { if (bridgeAddress == ArbitrumBridge.USDC) { return [ArbitrumToken.USDC, ArbitrumHtoken.USDC]; diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.json b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.json index 6317ee4570..0dcb283a30 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.json +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.json @@ -1,10 +1,10 @@ { "network": "mainnet", "isMainnet": true, - "graftEnabled": true, "deployment": "HOP_PROTOCOL_ETHEREUM", - "subgraphId": "QmTP91LxyZ8hxThCSsdNF8YsA7yZReRApQyijsNnkCf9m6", - "graftStartBlock": 16423244, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0, "bridges": [ { "dataSourceName": "Bridge", diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.ts b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.ts index e27260394e..97f8e60182 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.ts +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-ethereum/configurations.ts @@ -14,6 +14,8 @@ import { ArbitrumNovaHtoken, ArbitrumNovaToken, ArbitrumNovaAmm, + BaseToken, + BaseAmm, } from "../../../../../src/sdk/util/constants"; import { Network } from "../../../../../src/sdk/util/constants"; @@ -189,6 +191,16 @@ export class HopProtocolEthereumConfigurations implements Configurations { } } + getBasePoolAddressFromBridgeAddress(bridgeAddress: string): string { + if (bridgeAddress == MainnetBridge.USDC) return BaseAmm.USDC; + if (bridgeAddress == MainnetBridge.ETH) return BaseAmm.ETH; + else { + log.critical("BasePoolAddress not found for bridge: {}", [bridgeAddress]); + + return ""; + } + } + getPoolAddressFromChainId(chainId: string, bridgeAddress: string): string { if (chainId == "42161") { return this.getArbitrumPoolAddressFromBridgeAddress(bridgeAddress); //Arbitrum @@ -200,6 +212,8 @@ export class HopProtocolEthereumConfigurations implements Configurations { return this.getPolygonPoolAddressFromBridgeAddress(bridgeAddress); //Polygon } else if (chainId == "42170") { return this.getArbitrumNovaPoolAddressFromBridgeAddress(bridgeAddress); //Arbitrum Nova + } else if (chainId == "8453") { + return this.getBasePoolAddressFromBridgeAddress(bridgeAddress); //Base } else { log.critical("Chain not found", []); return ""; @@ -218,7 +232,13 @@ export class HopProtocolEthereumConfigurations implements Configurations { } getUsdcPools(): string[] { - return [PolygonAmm.USDC, XdaiAmm.USDC, ArbitrumAmm.USDC, OptimismAmm.USDC]; + return [ + PolygonAmm.USDC, + XdaiAmm.USDC, + ArbitrumAmm.USDC, + OptimismAmm.USDC, + BaseAmm.USDC, + ]; } getUsdcTokens(): string[] { @@ -228,6 +248,7 @@ export class HopProtocolEthereumConfigurations implements Configurations { ArbitrumToken.USDC, OptimismToken.USDC, MainnetToken.USDC, + BaseToken.USDC, ]; } getDaiPools(): string[] { @@ -263,6 +284,7 @@ export class HopProtocolEthereumConfigurations implements Configurations { ArbitrumAmm.ETH, PolygonAmm.ETH, OptimismAmm.ETH, + BaseAmm.ETH, ]; } @@ -274,6 +296,7 @@ export class HopProtocolEthereumConfigurations implements Configurations { PolygonToken.ETH, OptimismToken.ETH, ArbitrumNovaToken.ETH, + BaseToken.ETH, ]; } @@ -352,6 +375,8 @@ export class HopProtocolEthereumConfigurations implements Configurations { return this.getArbitrumNovaConfigFromTokenAddress(tokenAddress)[0]; else if (chainId == "1") return this.getMainnetCrossTokenFromTokenAddress(tokenAddress); + else if (chainId == "8453") + return this.getBaseCrossTokenFromTokenAddress(tokenAddress); else { log.critical("Chain not found", []); return ""; @@ -405,6 +430,14 @@ export class HopProtocolEthereumConfigurations implements Configurations { return ""; } } + getBaseCrossTokenFromTokenAddress(tokenAddress: string): string { + if (tokenAddress == MainnetToken.USDC) return BaseToken.USDC; + if (tokenAddress == MainnetToken.ETH) return BaseToken.ETH; + else { + log.critical("BaseCrossToken not found for token: {}", [tokenAddress]); + return ""; + } + } getMainnetCrossTokenFromTokenAddress(tokenAddress: string): string { log.critical("Mainnet cross token not found", []); diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.json b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.json index 0a34233b67..3700e36f00 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.json +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.json @@ -3,10 +3,9 @@ "isMainnet": false, "subgraphName": "hop-optimism", "deployment": "HOP_PROTOCOL_OPTIMISM", - "graftEnabled": true, - "subgraphId": "QmYSgs5XEqheZHtoQuYaTUPHAsZ2sG3UAm379EmwJrbw95", - "graftStartBlock": 106756936, - + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0, "amms": [ { "dataSourceName": "HopL2Amm", diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.ts b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.ts index b27014be8d..a74a0830ab 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.ts +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-optimism/configurations.ts @@ -15,6 +15,7 @@ import { ArbitrumNovaToken, ArbitrumNovaHtoken, ArbitrumNovaAmm, + BaseToken, } from "../../../../../src/sdk/util/constants"; import { Network } from "../../../../../src/sdk/util/constants"; export class HopProtocolOptimismConfigurations implements Configurations { @@ -107,6 +108,8 @@ export class HopProtocolOptimismConfigurations implements Configurations { return this.getMainnetCrossTokenFromTokenAddress(tokenAddress); else if (chainId == "42170") return this.getArbitrumNovaConfigFromTokenAddress(tokenAddress)[0]; + else if (chainId == "8453") + return this.getBaseCrossTokenFromTokenAddress(tokenAddress); else { log.critical("Chain not found", []); return ""; @@ -182,6 +185,15 @@ export class HopProtocolOptimismConfigurations implements Configurations { return ""; } + getBaseCrossTokenFromTokenAddress(tokenAddress: string): string { + if (tokenAddress == OptimismToken.USDC) return BaseToken.USDC; + if (tokenAddress == OptimismToken.ETH) return BaseToken.ETH; + else { + log.critical("BaseCrossToken not found for token: {}", [tokenAddress]); + } + return ""; + } + getArbitrumNovaPoolAddressFromBridgeAddress(bridgeAddress: string): string { return bridgeAddress; } diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.json b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.json index f9719fc8e5..5a10e8e2fe 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.json +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.json @@ -3,9 +3,9 @@ "isMainnet": false, "subgraphName": "hop-polygon", "deployment": "HOP_PROTOCOL_POLYGON", - "graftEnabled": true, - "subgraphId": "QmQhux3MYTgebT8HpxJeW9VtvpytByGujQ4umNVm2K5sDY", - "graftStartBlock": 37748303, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0, "amms": [ { "dataSourceName": "HopL2Amm", diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.ts b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.ts index 8f7e2ab846..4e358f0406 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.ts +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-polygon/configurations.ts @@ -15,6 +15,7 @@ import { ArbitrumNovaToken, ArbitrumNovaHtoken, ArbitrumNovaAmm, + BaseToken, } from "../../../../../src/sdk/util/constants"; import { Network } from "../../../../../src/sdk/util/constants"; export class HopProtocolPolygonConfigurations implements Configurations { @@ -134,10 +135,12 @@ export class HopProtocolPolygonConfigurations implements Configurations { return this.getXdaiCrossTokenFromTokenAddress(tokenAddress); //Xdai } else if (chainId == "137") { return this.getPolygonCrossTokenFromTokenAddress(tokenAddress); //Polygon - } else if (chainId == "42170") + } else if (chainId == "42170") { return this.getArbitrumNovaConfigFromTokenAddress(tokenAddress)[0]; - else if (chainId == "1") { + } else if (chainId == "1") { return this.getMainnetCrossTokenFromTokenAddress(tokenAddress); //Mainnet + } else if (chainId == "8453") { + return this.getBaseCrossTokenFromTokenAddress(tokenAddress); } else { log.critical("Chain not found", []); return ""; @@ -207,6 +210,15 @@ export class HopProtocolPolygonConfigurations implements Configurations { return ""; } + getBaseCrossTokenFromTokenAddress(tokenAddress: string): string { + if (tokenAddress == PolygonToken.USDC) return BaseToken.USDC; + if (tokenAddress == PolygonToken.ETH) return BaseToken.ETH; + else { + log.critical("BaseCrossToken not found for token: {}", [tokenAddress]); + } + return ""; + } + getTokenAddressFromPoolAddress(poolAddress: string): string[] { if (poolAddress == PolygonAmm.USDC) { return [PolygonToken.USDC, PolygonHtoken.USDC]; diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.json b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.json index 9cbc2abba9..2b725f4994 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.json +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.json @@ -3,9 +3,9 @@ "isMainnet": false, "subgraphName": "hop-xdai", "deployment": "HOP_PROTOCOL_XDAI", - "graftEnabled": true, - "subgraphId": "QmPFJhkC1S3assspxHkzuQTuonZJuGDQ43wsoUKofcoAkg", - "graftStartBlock": 25850672, + "graftEnabled": false, + "subgraphId": "", + "graftStartBlock": 0, "amms": [ { "dataSourceName": "HopL2Amm", diff --git a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.ts b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.ts index bf555aa6f0..78bbbe739f 100644 --- a/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.ts +++ b/subgraphs/hop-protocol/protocols/hop-protocol/config/deployments/hop-protocol-xdai/configurations.ts @@ -15,6 +15,7 @@ import { ArbitrumNovaToken, ArbitrumNovaHtoken, ArbitrumNovaAmm, + BaseToken, } from "../../../../../src/sdk/util/constants"; import { Network } from "../../../../../src/sdk/util/constants"; @@ -68,6 +69,8 @@ export class HopProtocolxDaiConfigurations implements Configurations { return this.getMainnetCrossTokenFromTokenAddress(tokenAddress); else if (chainId == "42170") return this.getArbitrumNovaConfigFromTokenAddress(tokenAddress)[0]; + else if (chainId == "8453") + return this.getBaseCrossTokenFromTokenAddress(tokenAddress); else { log.critical("Chain not found", []); return ""; @@ -155,6 +158,15 @@ export class HopProtocolxDaiConfigurations implements Configurations { return ""; } + getBaseCrossTokenFromTokenAddress(tokenAddress: string): string { + if (tokenAddress == XdaiToken.USDC) return BaseToken.USDC; + if (tokenAddress == XdaiToken.ETH) return BaseToken.ETH; + else { + log.critical("BaseCrossToken not found for token: {}", [tokenAddress]); + } + return ""; + } + getTokenAddressFromBridgeAddress(bridgeAddress: string): string[] { if (bridgeAddress == XdaiBridge.USDC) { return [XdaiToken.USDC, XdaiHtoken.USDC]; diff --git a/subgraphs/hop-protocol/src/sdk/util/constants.ts b/subgraphs/hop-protocol/src/sdk/util/constants.ts index 2d8c88ba06..d22026471e 100644 --- a/subgraphs/hop-protocol/src/sdk/util/constants.ts +++ b/subgraphs/hop-protocol/src/sdk/util/constants.ts @@ -271,6 +271,8 @@ export const LP_FEE_TO_OFF = BigDecimal.fromString("3"); export const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000"; +// source: https://github.com/hop-protocol/hop/blob/develop/packages/core/src/addresses/mainnet.ts + export namespace XdaiBridge { export const USDC = "0x25d8039bb044dc227f741a9e381ca4ceae2e6ae8"; export const USDT = "0xfd5a186a7e8453eb867a360526c5d987a00acac2"; @@ -486,6 +488,27 @@ export namespace PolygonRewardToken { export const ETH = "0xaa7b3a4a084e6461d486e53a03cf45004f0963b7"; } +export namespace BaseBridge { + export const USDC = "0x46ae9bab8cea96610807a275ebd36f8e916b5c61"; + export const ETH = "0x3666f603cc164936c1b87e207f36beba4ac5f18a"; +} +export namespace BaseAmm { + export const USDC = "0x022c5ce6f1add7423268d41e08df521d5527c2a0"; + export const ETH = "0x0ce6c85cf43553de10fc56ceca0aef6ff0dd444d"; +} +export namespace BaseToken { + export const USDC = "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca"; + export const ETH = "0x4200000000000000000000000000000000000006"; +} +export namespace BaseHToken { + export const USDC = "0x74fa978eaffa312bc92e76df40fcc1bfe7637aeb"; + export const ETH = "0xc1985d7a3429cdc85e59e2e4fcc805b857e6ee2e"; +} +export namespace BaseRewardToken { + export const USDC = "0x7ac115536fe3a185100b2c4de4cb328bf3a58ba6"; + export const ETH = "0x12e59c59d282d2c00f3166915bed6dc2f5e2b5c7"; +} + export const priceTokens = [ OptimismToken.USDC, OptimismToken.USDT, @@ -588,6 +611,8 @@ export const HOP_REWARDS = [ XdaiRewardToken.USDC_B, XdaiRewardToken.ETH_B, XdaiRewardToken.USDT_B, + BaseRewardToken.USDC, + BaseRewardToken.ETH, ]; export const SIX_DECIMAL_TOKENS = [