Skip to content

Commit

Permalink
Maybe fix dune
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Dec 16, 2024
1 parent 60601b7 commit 3c0bbbc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions prediction_market_agent/db/blockchain_transaction_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ def fetch_unseen_transactions(
)
)
min_block_number = (
37554163 # Block at the time of starting agents.
37554165 # Block at the time of starting agents.
if not latest_blockchain_message
else latest_blockchain_message.block
)
# We order by block_time because it's used as partition on Dune.
# We use >= for block because we might have lost transactions from the same block.
# Additionally, processed tx_hashes are filtered out anyways.
query = f'select * from gnosis.transactions where "to" = {Web3.to_checksum_address(consumer_address)} AND block_number >= {min_block_number} and value >= {xdai_to_wei(MicrochainAgentKeys().RECEIVER_MINIMUM_AMOUNT)} order by block_time asc'
df = spice.query(query, api_key=keys.dune_api_key.get_secret_value())
df = spice.query(
query, api_key=keys.dune_api_key.get_secret_value(), cache=False
)

existing_hashes = self.blockchain_table_handler.fetch_all_transaction_hashes(
consumer_address=consumer_address
Expand Down

0 comments on commit 3c0bbbc

Please sign in to comment.