Skip to content

Commit

Permalink
Update gnosis config (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi authored Feb 22, 2022
1 parent 275d0fd commit 22c7c4f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
2 changes: 1 addition & 1 deletion deploy/gnosis/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GNOSIS_ETH2_ENDPOINT=http://eth2-node:5052
GNOSIS_AWS_ACCESS_KEY_ID=<access_id>
GNOSIS_AWS_SECRET_ACCESS_KEY=<secret_key>
GNOSIS_AWS_BUCKET_NAME=oracle-votes-gnosis
GNOSIS_AWS_REGION=us-east-2
GNOSIS_AWS_REGION=eu-north-1

##########
# Keeper #
Expand Down
37 changes: 25 additions & 12 deletions oracle/networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,31 +228,44 @@
default="https://api.thegraph.com/subgraphs/name/stakewise/ethereum-gnosis",
),
UNISWAP_V3_SUBGRAPH_URL=config(
f"{GNOSIS_CHAIN_UPPER}_UNISWAP_V3_SUBGRAPH_URL",
default="https://api.thegraph.com/subgraphs/name/stakewise/uniswap-v3-gnosis",
f"{GNOSIS_CHAIN_UPPER}_UNISWAP_V3_SUBGRAPH_URL", default=""
),
# TODO: update once rari fuse pools is deployed to gnosis chain
RARI_FUSE_SUBGRAPH_URL=config(
f"{GNOSIS_CHAIN_UPPER}_RARI_FUSE_SUBGRAPH_URL", default=""
f"{GNOSIS_CHAIN_UPPER}_RARI_FUSE_SUBGRAPH_URL",
default="",
),
ETH2_ENDPOINT=config(f"{GNOSIS_CHAIN_UPPER}_ETH2_ENDPOINT", default=""),
SLOTS_PER_EPOCH=16,
SECONDS_PER_SLOT=5,
ORACLES_CONTRACT_ADDRESS="",
MULTICALL_CONTRACT_ADDRESS="",
SWISE_TOKEN_CONTRACT_ADDRESS="",
REWARD_TOKEN_CONTRACT_ADDRESS="",
STAKED_TOKEN_CONTRACT_ADDRESS="",
DISTRIBUTOR_FALLBACK_ADDRESS="",
ORACLES_CONTRACT_ADDRESS=Web3.toChecksumAddress(
"0xd0f5ddaed2D8BaE1F451D2A11FFAe1806f2Ee1a5"
),
MULTICALL_CONTRACT_ADDRESS=Web3.toChecksumAddress(
"0xb5b692a88BDFc81ca69dcB1d924f59f0413A602a"
),
SWISE_TOKEN_CONTRACT_ADDRESS=Web3.toChecksumAddress(
"0xfdA94F056346d2320d4B5E468D6Ad099b2277746"
),
REWARD_TOKEN_CONTRACT_ADDRESS=Web3.toChecksumAddress(
"0x6FFa613eD41585B1c1e517A78d140cFBD68be639"
),
STAKED_TOKEN_CONTRACT_ADDRESS=Web3.toChecksumAddress(
"0x9AEBd2322D3D5fB69324a3cFE380DD11Bc3694D2"
),
DISTRIBUTOR_FALLBACK_ADDRESS=Web3.toChecksumAddress(
"0x8737f638E9af54e89ed9E1234dbC68B115CD169e"
),
RARI_FUSE_POOL_ADDRESSES=[],
WITHDRAWAL_CREDENTIALS="",
WITHDRAWAL_CREDENTIALS=HexStr(
"0x010000000000000000000000fc9b67b6034f6b306ea9bd8ec1baf3efa2490394"
),
ORACLE_PRIVATE_KEY=config(
f"{GNOSIS_CHAIN_UPPER}_ORACLE_PRIVATE_KEY", default=""
),
AWS_BUCKET_NAME=config(
f"{GNOSIS_CHAIN_UPPER}_AWS_BUCKET_NAME", default="oracle-votes-gnosis"
),
AWS_REGION=config(f"{GNOSIS_CHAIN_UPPER}_AWS_REGION", default=""),
AWS_REGION=config(f"{GNOSIS_CHAIN_UPPER}_AWS_REGION", default="eu-north-1"),
AWS_ACCESS_KEY_ID=config(f"{GNOSIS_CHAIN_UPPER}_AWS_ACCESS_KEY_ID", default=""),
AWS_SECRET_ACCESS_KEY=config(
f"{GNOSIS_CHAIN_UPPER}_AWS_SECRET_ACCESS_KEY", default=""
Expand Down
9 changes: 8 additions & 1 deletion oracle/oracle/distributor/uniswap_v3.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from eth_typing import BlockNumber, ChecksumAddress
from web3 import Web3

from oracle.networks import NETWORKS
from oracle.networks import GNOSIS_CHAIN, NETWORKS
from oracle.oracle.clients import execute_uniswap_v3_gql_query
from oracle.oracle.graphql_queries import (
UNISWAP_V3_CURRENT_TICK_POSITIONS_QUERY,
Expand Down Expand Up @@ -38,6 +38,13 @@ async def get_uniswap_v3_pools(
network: str, block_number: BlockNumber
) -> UniswapV3Pools:
"""Fetches Uniswap V3 pools."""
if network == GNOSIS_CHAIN:
return UniswapV3Pools(
staked_token_pools=set(),
reward_token_pools=set(),
swise_pools=set(),
)

network_config = NETWORKS[network]
last_id = ""
result: Dict = await execute_uniswap_v3_gql_query(
Expand Down

0 comments on commit 22c7c4f

Please sign in to comment.