diff --git a/README.md b/README.md index ff728d0..f0877b7 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,20 @@ yarn install yarn codegen yarn deploy ``` + +## Deploying to Goldsky + +# to deploy on goldsky + +```bash +# use api key in login prompt +goldsky login + +yarn codegen +yarn build + +# change the version number otherwise it will overwrite existing subgraph +# current goldsky plan has 3 subgraph limit so may need to delete older version before deploying +goldsky subgraph deploy alchemix-mainnet/1.0.0 --path ./build + +``` diff --git a/deployments b/deployments index c87647e..4df6874 160000 --- a/deployments +++ b/deployments @@ -1 +1 @@ -Subproject commit c87647eda08751e4105f3c687eb33fd57b151206 +Subproject commit 4df687454de3aa373a691da24e789cdd6154cc3d diff --git a/package.json b/package.json index ee150c0..56e89a5 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "deploy-peg": "graph deploy alchemix-finance/alcx-curve-dev subgraph.js --product hosted-service --skip-migrations", "lint": "prettier --ignore-path .gitignore --list-different \"**/*.{ts,js,json,yaml}\"", "deploy-alchemy-dev": "graph deploy alchemix-dev subgraph.js --version-label v0.0.2 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $DEPLOY_KEY --ipfs https://ipfs.satsuma.xyz", - "deploy-alchemy-prod": "graph deploy alchemix-v2 subgraph.js --version-label v0.0.2 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $DEPLOY_KEY --ipfs https://ipfs.satsuma.xyz" + "deploy-alchemy-prod": "graph deploy alchemix-mainnet subgraph.js --version-label v0.0.3 --node https://subgraphs.alchemy.com/api/subgraphs/deploy --deploy-key $DEPLOY_KEY --ipfs https://ipfs.satsuma.xyz" }, "devDependencies": { "@graphprotocol/graph-cli": "0.60.0", diff --git a/subgraph/handlers/FactoryPool.ts b/subgraph/handlers/FactoryPool.ts index 1983116..9514ade 100644 --- a/subgraph/handlers/FactoryPool.ts +++ b/subgraph/handlers/FactoryPool.ts @@ -272,29 +272,29 @@ export function saveCoins(pool: Pool, poolAddress: Address, event: ethereum.Even BigInt.fromI32(1), Address.fromString(ALETH_PAIRED_ASSETS[0]), BigInt.fromI32(0), - BigInt.fromI32(500).times(BigInt.fromI32(10).pow(dec as u8)), + BigInt.fromI32(2).times(BigInt.fromI32(10).pow(dec as u8)), event, - ); // 1m - saveRate( - pool, - poolAddress, - alToken.address, - BigInt.fromI32(1), - Address.fromString(ALETH_PAIRED_ASSETS[0]), - BigInt.fromI32(0), - BigInt.fromI32(5000).times(BigInt.fromI32(10).pow(dec as u8)), - event, - ); // 10m - saveRate( - pool, - poolAddress, - alToken.address, - BigInt.fromI32(1), - Address.fromString(ALETH_PAIRED_ASSETS[0]), - BigInt.fromI32(0), - BigInt.fromI32(20000).times(BigInt.fromI32(10).pow(dec as u8)), - event, - ); // 50m + ); // 1 eth + // saveRate( + // pool, + // poolAddress, + // alToken.address, + // BigInt.fromI32(1), + // Address.fromString(ALETH_PAIRED_ASSETS[0]), + // BigInt.fromI32(0), + // BigInt.fromI32(5000).times(BigInt.fromI32(10).pow(dec as u8)), + // event, + // ); // 10m + // saveRate( + // pool, + // poolAddress, + // alToken.address, + // BigInt.fromI32(1), + // Address.fromString(ALETH_PAIRED_ASSETS[0]), + // BigInt.fromI32(0), + // BigInt.fromI32(20000).times(BigInt.fromI32(10).pow(dec as u8)), + // event, + // ); // 50m getOrCreateUnderlyingCoin(pool, token, 0, event); } diff --git a/subgraph/handlers/MetaPool.ts b/subgraph/handlers/MetaPool.ts index 856608e..24bc9e1 100644 --- a/subgraph/handlers/MetaPool.ts +++ b/subgraph/handlers/MetaPool.ts @@ -270,29 +270,29 @@ export function saveCoins(pool: Pool, poolAddress: Address, event: ethereum.Even BigInt.fromI32(0), Address.fromString(ALUSD_PAIRED_ASSETS[i]), BigInt.fromI32(i + 1), - BigInt.fromI32(1000000).times(BigInt.fromI32(10).pow(dec as u8)), + BigInt.fromI32(1000).times(BigInt.fromI32(10).pow(dec as u8)), event, - ); // 1m - saveRate( - pool, - poolAddress, - alToken.address, - BigInt.fromI32(0), - Address.fromString(ALUSD_PAIRED_ASSETS[i]), - BigInt.fromI32(i + 1), - BigInt.fromI32(10000000).times(BigInt.fromI32(10).pow(dec as u8)), - event, - ); // 10m - saveRate( - pool, - poolAddress, - alToken.address, - BigInt.fromI32(0), - Address.fromString(ALUSD_PAIRED_ASSETS[i]), - BigInt.fromI32(i + 1), - BigInt.fromI32(50000000).times(BigInt.fromI32(10).pow(dec as u8)), - event, - ); // 50m + ); // 1k + // saveRate( + // pool, + // poolAddress, + // alToken.address, + // BigInt.fromI32(0), + // Address.fromString(ALUSD_PAIRED_ASSETS[i]), + // BigInt.fromI32(i + 1), + // BigInt.fromI32(10000000).times(BigInt.fromI32(10).pow(dec as u8)), + // event, + // ); // 10m + // saveRate( + // pool, + // poolAddress, + // alToken.address, + // BigInt.fromI32(0), + // Address.fromString(ALUSD_PAIRED_ASSETS[i]), + // BigInt.fromI32(i + 1), + // BigInt.fromI32(50000000).times(BigInt.fromI32(10).pow(dec as u8)), + // event, + // ); // 50m getOrCreateUnderlyingCoin(pool, token, i, event); } } diff --git a/subgraph/utils/constants.ts b/subgraph/utils/constants.ts index 7768b17..918bddb 100644 --- a/subgraph/utils/constants.ts +++ b/subgraph/utils/constants.ts @@ -1,10 +1,10 @@ export const ALUSD_PAIRED_ASSETS = [ - '0x6B175474E89094C44Da98b954EedeAC495271d0F', - '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', - '0xdAC17F958D2ee523a2206206994597C13D831ec7', + '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI + '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC + '0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT ]; -export const ALETH_PAIRED_ASSETS = ['0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE']; +export const ALETH_PAIRED_ASSETS = ['0x5E8422345238F34275888049021821E8E08CAa1f']; // frxETH export const THREE_POOL_ASSETS = [ '0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI @@ -18,8 +18,8 @@ export const META_POOL_ASSETS = [ ]; export const ETH_META_POOL_ASSETS = [ - '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - '0x0100546F2cD4C9D97f798fFC9755E47865FF7Ee6', + '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH + '0x0100546F2cD4C9D97f798fFC9755E47865FF7Ee6', // alETH ]; export const CURVE_TOKEN = '0xd533a949740bb3306d119cc777fa900ba034cd52';