-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(); Uniswap V3 Base; Add Uniswap V3 Base (#2318)
- Loading branch information
Showing
8 changed files
with
164 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 18 additions & 17 deletions
35
subgraphs/uniswap-v3-forks/configurations/configurations/deploy.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
export namespace Deploy { | ||
export const UNISWAP_V3_ARBITRUM = 0; | ||
export const UNISWAP_V3_ETHEREUM = 1; | ||
export const UNISWAP_V3_POLYGON = 2; | ||
export const UNISWAP_V3_OPTIMISM = 3; | ||
export const UNISWAP_V3_CELO = 4; | ||
export const UNISWAP_V3_BSC = 5; | ||
export const PANCAKE_V3_BSC = 6; | ||
export const PANCAKE_V3_ETHEREUM = 7; | ||
export const SUSHISWAP_V3_ETHEREUM = 8; | ||
export const SUSHISWAP_V3_ARBITRUM = 9; | ||
export const SUSHISWAP_V3_AVALANCHE = 10; | ||
export const SUSHISWAP_V3_BSC = 11; | ||
export const SUSHISWAP_V3_FANTOM = 12; | ||
export const SUSHISWAP_V3_FUSE = 13; | ||
export const SUSHISWAP_V3_GNOSIS = 14; | ||
export const SUSHISWAP_V3_MOONRIVER = 15; | ||
export const SUSHISWAP_V3_OPTIMISM = 16; | ||
export const SUSHISWAP_V3_POLYGON = 17; | ||
export const UNISWAP_V3_BASE = 1; | ||
export const UNISWAP_V3_BSC = 2; | ||
export const UNISWAP_V3_CELO = 3; | ||
export const UNISWAP_V3_ETHEREUM = 4; | ||
export const UNISWAP_V3_OPTIMISM = 5; | ||
export const UNISWAP_V3_POLYGON = 6; | ||
export const PANCAKE_V3_BSC = 7; | ||
export const PANCAKE_V3_ETHEREUM = 8; | ||
export const SUSHISWAP_V3_ETHEREUM = 9; | ||
export const SUSHISWAP_V3_ARBITRUM = 10; | ||
export const SUSHISWAP_V3_AVALANCHE = 11; | ||
export const SUSHISWAP_V3_BSC = 12; | ||
export const SUSHISWAP_V3_FANTOM = 13; | ||
export const SUSHISWAP_V3_FUSE = 14; | ||
export const SUSHISWAP_V3_GNOSIS = 15; | ||
export const SUSHISWAP_V3_MOONRIVER = 16; | ||
export const SUSHISWAP_V3_OPTIMISM = 17; | ||
export const SUSHISWAP_V3_POLYGON = 18; | ||
} |
11 changes: 11 additions & 0 deletions
11
...swap-v3-forks/protocols/uniswap-v3/config/deployments/uniswap-v3-base/configurations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"network": "base", | ||
"factoryAddress": "0x33128a8fc17869897dce68ed026d694621f6fdfd", | ||
"factoryAddressStartBlock": 1371670, | ||
"nonFungiblePositionManagerAddress": "0x03a520b32c04bf3beef7beb72e919cf822ed34f1", | ||
"nonFungiblePositionManagerAddressStartBlock": 1371704, | ||
"deployment": "UNISWAP_V3_BASE", | ||
"graftEnabled": false, | ||
"subgraphId": "", | ||
"graftStartBlock": 0 | ||
} |
85 changes: 85 additions & 0 deletions
85
...niswap-v3-forks/protocols/uniswap-v3/config/deployments/uniswap-v3-base/configurations.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { | ||
Address, | ||
BigInt, | ||
BigDecimal, | ||
Bytes, | ||
log, | ||
} from "@graphprotocol/graph-ts"; | ||
import { Factory } from "../../../../../generated/Factory/Factory"; | ||
import { | ||
BIGDECIMAL_ONE, | ||
BIGDECIMAL_ZERO, | ||
FeeSwitch, | ||
Network, | ||
RewardIntervalType, | ||
} from "../../../../../src/common/constants"; | ||
import { Configurations } from "../../../../../configurations/configurations/interface"; | ||
import { PROTOCOL_NAME, PROTOCOL_SLUG } from "../../../src/common/constants"; | ||
import { stringToBytesList } from "../../../../../src/common/utils/utils"; | ||
|
||
export class UniswapV3BaseConfigurations implements Configurations { | ||
getNetwork(): string { | ||
return Network.BASE; | ||
} | ||
getProtocolName(): string { | ||
return PROTOCOL_NAME; | ||
} | ||
getProtocolSlug(): string { | ||
return PROTOCOL_SLUG; | ||
} | ||
getFactoryAddress(): Bytes { | ||
return Bytes.fromHexString("0x33128a8fc17869897dce68ed026d694621f6fdfd"); | ||
} | ||
getFactoryContract(): Factory { | ||
return Factory.bind( | ||
Address.fromString("0x33128a8fc17869897dce68ed026d694621f6fdfd") | ||
); | ||
} | ||
getProtocolFeeOnOff(): string { | ||
return FeeSwitch.OFF; | ||
} | ||
getInitialProtocolFeeProportion(fee: i64): BigDecimal { | ||
log.warning("getProtocolFeeRatio is not implemented: {}", [fee.toString()]); | ||
return BIGDECIMAL_ZERO; | ||
} | ||
getProtocolFeeProportion(protocolFee: BigInt): BigDecimal { | ||
return BIGDECIMAL_ONE.div(protocolFee.toBigDecimal()); | ||
} | ||
getRewardIntervalType(): string { | ||
return RewardIntervalType.NONE; | ||
} | ||
getReferenceToken(): Bytes { | ||
return Bytes.fromHexString("0x4200000000000000000000000000000000000006"); | ||
} | ||
getRewardToken(): Bytes { | ||
return Bytes.fromHexString(""); | ||
} | ||
getWhitelistTokens(): Bytes[] { | ||
return stringToBytesList([ | ||
"0x4200000000000000000000000000000000000006", // weth | ||
"0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22", // coinbase wsETH | ||
"0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", // usdc | ||
]); | ||
} | ||
getStableCoins(): Bytes[] { | ||
return stringToBytesList([ | ||
"0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca", // usdc | ||
]); | ||
} | ||
getStableOraclePools(): Bytes[] { | ||
return stringToBytesList([ | ||
"0x4c36388be6f416a29c8d8eee81c771ce6be14b18", // usdc-weth 0.05% | ||
"0x3ddf264ac95d19e81f8c25f4c300c4e59e424d43", // usdc-weth 0.3% | ||
"0xe584fe0c7505025c3819c82c99944b79a7cc009d", // usdc-weth 1% | ||
]); | ||
} | ||
getUntrackedPairs(): Bytes[] { | ||
return stringToBytesList([]); | ||
} | ||
getUntrackedTokens(): Bytes[] { | ||
return stringToBytesList([]); | ||
} | ||
getMinimumLiquidityThreshold(): BigDecimal { | ||
return BigDecimal.fromString("10000"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters