Skip to content

Commit

Permalink
Merge pull request #34 from cowprotocol/fix-key-name
Browse files Browse the repository at this point in the history
Fix key name and addressed comments
  • Loading branch information
shubhagarwal03 authored Aug 19, 2024
2 parents 44355a3 + c518972 commit d54e729
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ ETHEREUM_NODE_URL=
# Include these for fetching token prices
COINGECKO_API_KEY=
DUNE_API_KEY=
MORALIS_KEY=
MORALIS_API_KEY=
3 changes: 2 additions & 1 deletion src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"0x83F20F44975D03b1b09e64809B757c47f942BEeA"
)

# Time limit after which Coingecko Token List is re-fetched (in seconds)
# Time limit, currently set to 1 full day, after which Coingecko Token List is re-fetched (in seconds)
COINGECKO_TOKEN_LIST_RELOAD_TIME = 86400

# Time in seconds of 45 hours. Time limit after which 5-minute prices become unavailable.
Expand All @@ -27,4 +27,5 @@
DUNE_PRICE_QUERY_ID = 3935228

# Dune Query 3935228 uses an end_timestamp to limit results
# (Buffer time to return results between start_timstamp and end_timestamp only)
DUNE_QUERY_BUFFER_TIME = 100
2 changes: 2 additions & 0 deletions src/helpers/blockchain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


class BlockchainData:
"""Class provides functions for fetching blockchain data."""

def __init__(self, web3: Web3):
self.web3 = web3

Expand Down
5 changes: 5 additions & 0 deletions src/helpers/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@


class Database:
"""
Class is used to write data to appropriate tables for the slippage project
using a database connection.
"""

def __init__(self, engine: Engine, chain_name: str):
self.engine = engine
self.chain_name = chain_name
Expand Down
2 changes: 1 addition & 1 deletion src/price_providers/moralis_pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_price(self, price_params: dict) -> float | None:
"to_block": block_number,
}
result = evm_api.token.get_token_price(
api_key=os.getenv("MORALIS_KEY"),
api_key=os.getenv("MORALIS_API_KEY"),
params=params,
)
if "nativePrice" in result and "value" in result["nativePrice"]:
Expand Down

0 comments on commit d54e729

Please sign in to comment.