Skip to content

Commit

Permalink
update network to optimism
Browse files Browse the repository at this point in the history
  • Loading branch information
mzywang committed Apr 17, 2024
1 parent 66cf4af commit da3b6ce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/mappings/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Factory as FactoryContract } from '../types/templates/Pair/Factory'
import { TokenDefinition } from './tokenDefinition'

export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000'
export const FACTORY_ADDRESS = '0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6'
export const FACTORY_ADDRESS = '0x0c3c1c532F1e39EdF36BE9Fe0bE1410313E074Bf'

export let ZERO_BI = BigInt.fromI32(0)
export let ONE_BI = BigInt.fromI32(1)
Expand Down
20 changes: 7 additions & 13 deletions src/mappings/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,22 @@ import { Bundle, Pair, Token } from '../types/schema'
import { ADDRESS_ZERO, factoryContract, ONE_BD, UNTRACKED_PAIRS, ZERO_BD } from './helpers'

const WETH_ADDRESS = '0x4200000000000000000000000000000000000006'
const USDC_WETH_PAIR = '0x88a43bbdf9d098eec7bceda4e2494615dfd9bb9c'
const USDC_ADDRESS = '0x0b2c639c533813f4aa9d7837caf62653d097ff85'
const USDC_WETH_PAIR = '0x4c43646304492a925e335f2b6d840c1489f17815'

export function getEthPriceInUSD(): BigDecimal {
let usdcPair = Pair.load(USDC_WETH_PAIR) // usdc is token1
let usdcPair = Pair.load(USDC_WETH_PAIR) // usdc is token0
if (usdcPair !== null) {
return usdcPair.token1Price
return usdcPair.token0Price
} else {
return ZERO_BD
}
}

// token where amounts should contribute to tracked volume and liquidity
let WHITELIST: string[] = [
'0x4200000000000000000000000000000000000006', // WETH
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
'0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca', // USDbC
]

const STABLECOINS: string[] = [
'0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC
'0xd9aaec86b65d86f6a7b5b1b0c42ffa531710b6ca', // USDbC
]
let WHITELIST: string[] = [WETH_ADDRESS, USDC_ADDRESS]

const STABLECOINS: string[] = [USDC_ADDRESS]

// minimum liquidity required to count towards tracked volume for pairs with small # of Lps
let MINIMUM_USD_THRESHOLD_NEW_PAIRS = BigDecimal.fromString('10000')
Expand Down
8 changes: 4 additions & 4 deletions 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: optimism
source:
address: '0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6'
address: '0x0c3c1c532F1e39EdF36BE9Fe0bE1410313E074Bf'
abi: Factory
startBlock: 6601915
startBlock: 112197986
mapping:
kind: ethereum/events
apiVersion: 0.0.7
Expand All @@ -34,7 +34,7 @@ dataSources:
templates:
- kind: ethereum/contract
name: Pair
network: base
network: optimism
source:
abi: Pair
mapping:
Expand Down

0 comments on commit da3b6ce

Please sign in to comment.