Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add opbnb config #236

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions config/opbnb.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const WETH = "0x4200000000000000000000000000000000000006";
const USDT = "0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3";

/**
* @type import('./config').NetworkConfig
*/
module.exports = {
network: "opbnb-mainnet",
wNativeAddress: WETH,
v3: {
// WBNB-USDT 500
wNativeStablePoolAddress: "0xc4f981189558682f15f60513158b699354b30204",
stableIsToken0: false,
factoryAddress: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865",
startBlock: 1721753,
stableCoins: [USDT],
whitelistAddresses: [WETH, USDT],
nonfungiblePositionManagerAddress: "0x46a15b0b27311cedf172ab29e4f4766fbe7f4364",
nonfungiblePositionManagerStartBlock: 1730685,
minETHLocked: 1,
},
v2: {
factoryAddress: "0x02a84c1b3bbd7401a5f7fa98a384ebc70bb5749e",
startBlock: 1708914,
wNativeStablePair0: "0x0000000000000000000000000000000000000000", // WETH-USDC
wNativeStablePair1: "0x706f7257e78b6f2404a1afb5c480645a6f5be91d", // WETH-USDT
whitelistAddresses: [WETH, USDT],
},
};
4 changes: 2 additions & 2 deletions subgraphs/exchange-v2/mappings/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ADDRESS_ZERO, factoryContract, ONE_BD, ZERO_BD } from "./utils";
// prettier-ignore
let WETH_ADDRESS = "0x4200000000000000000000000000000000000006";
// prettier-ignore
let WETH_USDT_PAIR = "0x92363f9817f92a7ae0592a4cb29959a88d885cc8";
let WETH_USDT_PAIR = "0x706f7257e78b6f2404a1afb5c480645a6f5be91d";
// prettier-ignore
let WETH_USDC_PAIR = "0x0000000000000000000000000000000000000000";

Expand Down Expand Up @@ -35,7 +35,7 @@ export function getETHPriceInUSD(): BigDecimal {

// token where amounts should contribute to tracked volume and liquidity
// prettier-ignore
let WHITELIST: string[] = "0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22,0xb6fe221fe9eef5aba221c348ba20a1bf5e73624c,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0x417ac0e078398c154edfadd9ef675d30be60af93,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913".split(",");
let WHITELIST: string[] = "0x4200000000000000000000000000000000000006,0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3".split(",");

// minimum liquidity for price to get tracked
let MINIMUM_LIQUIDITY_THRESHOLD_ETH = BigDecimal.fromString("5");
Expand Down
3 changes: 2 additions & 1 deletion subgraphs/exchange-v2/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"build": "graph build subgraph.yaml",
"deploy": "graph deploy --product hosted-service pancakeswap/exhange-eth",
"deploy:polygon-zkevm": "graph deploy --studio exchange-v2-polygon-zkevm",
"deploy:zksync-goerli": "graph deploy --studio graph deploy --studio exchange-v2-zksync-testnet"
"deploy:zksync-goerli": "graph deploy --studio graph deploy --studio exchange-v2-zksync-testnet",
"deploy:opbnb": "graph deploy --node https://open-platform-ap.nodereal.io/$API_KEY/opbnb-mainnet-graph-indexer/ --ipfs https://api.thegraph.com/ipfs/ pancakeswap/exchange-v2"
}
}
6 changes: 3 additions & 3 deletions subgraphs/exchange-v2/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ schema:
dataSources:
- kind: ethereum/contract
name: Factory
network: base
network: opbnb-mainnet
source:
address: "0x02a84c1b3bbd7401a5f7fa98a384ebc70bb5749e"
abi: Factory
startBlock: 2910387
startBlock: 1708914
mapping:
kind: ethereum/events
apiVersion: 0.0.4
Expand All @@ -34,7 +34,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pair
network: base
network: opbnb-mainnet
source:
abi: Pair
mapping:
Expand Down
3 changes: 2 additions & 1 deletion subgraphs/exchange-v3/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"deploy:bsc": "graph deploy --product hosted-service --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ pancakeswap/exchange-v3-bsc subgraph.yaml",
"deploy:zksync-goerli": "graph deploy --product hosted-service --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ chef-jojo/exchange-v3-zksync-goerli subgraph.yaml",
"deploy:arb": "graph deploy --product hosted-service pancakeswap/exchange-v3-arb",
"deploy:polygon-zkevm-testnet": "graph deploy --studio exchange-v3-polygon-zkevm-test"
"deploy:polygon-zkevm-testnet": "graph deploy --studio exchange-v3-polygon-zkevm-test",
"deploy:opbnb": "graph deploy --node https://open-platform-ap.nodereal.io/$API_KEY/opbnb-mainnet-graph-indexer/ --ipfs https://api.thegraph.com/ipfs/ pancakeswap/exchange-v3"
}
}
10 changes: 5 additions & 5 deletions subgraphs/exchange-v3/template/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ features:
dataSources:
- kind: ethereum/contract
name: Factory
network: base
network: opbnb-mainnet
source:
address: "0x0bfbcf9fa4f9c56b0f40a671ad40e0805a091865"
abi: Factory
startBlock: 2912007
startBlock: 1721753
mapping:
kind: ethereum/events
apiVersion: 0.0.4
Expand All @@ -37,11 +37,11 @@ dataSources:
handler: handlePoolCreated
- kind: ethereum/contract
name: NonfungiblePositionManager
network: base
network: opbnb-mainnet
source:
address: "0x46a15b0b27311cedf172ab29e4f4766fbe7f4364"
abi: NonfungiblePositionManager
startBlock: 2912503
startBlock: 1730685
mapping:
kind: ethereum/events
apiVersion: 0.0.4
Expand Down Expand Up @@ -71,7 +71,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pool
network: base
network: opbnb-mainnet
source:
abi: Pool
mapping:
Expand Down
6 changes: 3 additions & 3 deletions subgraphs/exchange-v3/template/utils/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import { exponentToBigDecimal, safeDiv } from "./index";
// prettier-ignore
const WETH_ADDRESS = "0x4200000000000000000000000000000000000006";
// prettier-ignore
const USDC_WETH_03_POOL = "0xe58b73ff901325b8b2056b29712c50237242f520";
const USDC_WETH_03_POOL = "0xc4f981189558682f15f60513158b699354b30204";

const STABLE_IS_TOKEN0 = "false" as string;

// token where amounts should contribute to tracked volume and liquidity
// usually tokens that many tokens are paired with s
// prettier-ignore
export let WHITELIST_TOKENS: string[] = "0x4200000000000000000000000000000000000006,0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x2ae3f1ec7f1f5012cfeab0185bfc7aa3cf0dec22,0xb6fe221fe9eef5aba221c348ba20a1bf5e73624c,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0x417ac0e078398c154edfadd9ef675d30be60af93,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913".split(",");
export let WHITELIST_TOKENS: string[] = "0x4200000000000000000000000000000000000006,0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3".split(",");

// prettier-ignore
let STABLE_COINS: string[] = "0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca,0x50c5725949a6f0c72e6c4a641f24049a917db0cb,0x417ac0e078398c154edfadd9ef675d30be60af93,0x833589fcd6edb6e08f4c7c32d4f71b54bda02913".split(",");
let STABLE_COINS: string[] = "0x9e5aac1ba1a2e6aed6b32689dfcf62a509ca96f3".split(",");

let MINIMUM_ETH_LOCKED = BigDecimal.fromString("1");

Expand Down
Loading