Skip to content

Commit

Permalink
fix(#patch); Uniswap Forks; Upgrade Pricing Mechanism (#2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
steegecs authored Apr 24, 2023
1 parent c674b8e commit 7369062
Show file tree
Hide file tree
Showing 37 changed files with 370 additions and 191 deletions.
58 changes: 29 additions & 29 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -1308,7 +1308,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4508,7 +4508,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4530,7 +4530,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4560,7 +4560,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.5",
"subgraph": "1.0.6",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4582,7 +4582,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.2",
"subgraph": "1.0.3",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4612,7 +4612,7 @@
"status": "dev",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.6",
"subgraph": "1.0.7",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4642,7 +4642,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.8",
"subgraph": "1.1.9",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4672,7 +4672,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.6",
"subgraph": "1.1.7",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4702,7 +4702,7 @@
"status": "dev",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.8",
"subgraph": "1.1.9",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -4732,7 +4732,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4754,7 +4754,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4776,7 +4776,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4798,7 +4798,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4824,7 +4824,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4846,7 +4846,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4868,7 +4868,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.2.0",
"subgraph": "1.2.1",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4894,7 +4894,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.11",
"subgraph": "1.1.12",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4916,7 +4916,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.11",
"subgraph": "1.1.12",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4938,7 +4938,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4960,7 +4960,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand All @@ -4982,7 +4982,7 @@
"status": "prod",
"versions": {
"schema": "1.3.1",
"subgraph": "1.1.11",
"subgraph": "1.1.12",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5016,7 +5016,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5046,7 +5046,7 @@
"status": "dev",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.5",
"subgraph": "1.0.6",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5076,7 +5076,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5110,7 +5110,7 @@
"status": "dev",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.6",
"subgraph": "1.1.7",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5140,7 +5140,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.10",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand Down Expand Up @@ -5170,7 +5170,7 @@
"status": "prod",
"versions": {
"schema": "1.3.1",
"subgraph": "1.0.8",
"subgraph": "1.0.9",
"methodology": "1.0.1"
},
"files": {
Expand All @@ -5196,7 +5196,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.6",
"subgraph": "1.0.7",
"methodology": "1.0.1"
},
"files": {
Expand Down Expand Up @@ -6936,7 +6936,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.4",
"subgraph": "1.0.5",
"methodology": "1.0.0"
},
"services": {
Expand Down
2 changes: 1 addition & 1 deletion subgraphs/uniswap-forks/configurations/configure.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getNetworkConfigurations } from "./configurations/configurations";
import { Deploy } from "./configurations/deploy";

// Select the deployment protocol and network
let deployment = Deploy.{{ deployment }};
const deployment = Deploy.{{ deployment }};

// export const NetworkConfigs = configurationsMap.get(deployment)!
export const NetworkConfigs = getNetworkConfigurations(deployment);
2 changes: 1 addition & 1 deletion subgraphs/uniswap-forks/configurations/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getNetworkConfigurations } from "./configurations/configurations";
import { Deploy } from "./configurations/deploy";

// Select the deployment protocol and network
const deployment = Deploy.PANGOLIN_AVALANCHE;
const deployment = Deploy.TRADER_JOE_AVALANCHE;

// export const NetworkConfigs = configurationsMap.get(deployment)!
export const NetworkConfigs = getNetworkConfigurations(deployment);
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.1.7",
"subgraph": "1.1.11",
"methodology": "1.0.0"
},
"files": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export function handleReward(
return;
}

const rewardToken = getOrCreateToken(NetworkConfigs.getRewardToken());
const rewardToken = getOrCreateToken(event, NetworkConfigs.getRewardToken());
pool.rewardTokens = [
getOrCreateRewardToken(NetworkConfigs.getRewardToken()).id,
getOrCreateRewardToken(event, NetworkConfigs.getRewardToken()).id,
];

// Update staked amounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export function updateMasterChef(
return;
}

const rewardToken = getOrCreateToken(NetworkConfigs.getRewardToken());
const rewardToken = getOrCreateToken(event, NetworkConfigs.getRewardToken());
pool.rewardTokens = [
getOrCreateRewardToken(NetworkConfigs.getRewardToken()).id,
getOrCreateRewardToken(event, NetworkConfigs.getRewardToken()).id,
];

// Get the amount of Banana tokens emitted for all pools per second.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ export function createLiquidityPool(
const protocol = getOrCreateProtocol();

// create the tokens and tokentracker
const token0 = getOrCreateToken(token0Address);
const token1 = getOrCreateToken(token1Address);
const token0 = getOrCreateToken(event, token0Address);
const token1 = getOrCreateToken(event, token1Address);
const LPtoken = getOrCreateLPToken(poolAddress, token0, token1);

updateTokenWhitelists(token0, token1, poolAddress);
Expand Down Expand Up @@ -136,13 +136,13 @@ export function createLiquidityPool(

// Add reward token to liquidity pool from HoneyFarm add contract call (PoolAdded event)
export function createPoolRewardToken(
poolAddress: string,
blockNumber: BigInt
event: ethereum.Event,
poolAddress: string
): void {
const pool = getLiquidityPool(poolAddress, blockNumber);
const pool = getLiquidityPool(poolAddress, event.block.number);

pool.rewardTokens = [
getOrCreateRewardToken(NetworkConfigs.getRewardToken()).id,
getOrCreateRewardToken(event, NetworkConfigs.getRewardToken()).id,
];

pool.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ import { handleReward } from "../common/handlers";
// WIP: HoneyFarm subgraph handlers currently not used in Honeyswap subgraph deployment
export function handlePoolAdded(event: PoolAddedEvent): void {
log.debug("poolToken added: {}", [event.params.poolToken.toHexString()]);
createPoolRewardToken(
event.params.poolToken.toHexString(),
event.block.number
);
createPoolRewardToken(event, event.params.poolToken.toHexString());
}

// WIP: HoneyFarm subgraph handlers currently not used in Honeyswap subgraph deployment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ export function handleReward(
return;
}

const rewardToken = getOrCreateToken(NetworkConfigs.getRewardToken());
const rewardToken = getOrCreateToken(event, NetworkConfigs.getRewardToken());
pool.rewardTokens = [
getOrCreateRewardToken(NetworkConfigs.getRewardToken()).id,
getOrCreateRewardToken(event, NetworkConfigs.getRewardToken()).id,
];

// Update staked amounts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"network": "avalanche",
"status": "dev",
"status": "prod",
"versions": {
"schema": "1.3.0",
"subgraph": "1.0.0",
"subgraph": "1.0.5",
"methodology": "1.0.0"
},
"services": {
"hosted-service": {
"slug": "pangolin-avalanche",
"query-id": "pangolin-avalanche"
}
},
"files": {
"template": "pangolin.template.yaml"
},
"options": {
"prepare:yaml": true,
"prepare:constants": true
},
"services": {
"hosted-service": {
"slug": "pangolin-avalanche",
"query-id": "pangolin-avalanche"
}
},
"protocol": "pangolin",
"base": "uniswap-forks",
"schema": "dex-amm",
Expand Down
Loading

0 comments on commit 7369062

Please sign in to comment.