Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.
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
11 changes: 6 additions & 5 deletions run_service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -604,11 +604,6 @@ export CUSTOM_GNOSIS_SAFE_SAME_ADDRESS_MULTISIG_ADDRESS="0x6e7f594f680f7aBad18b7
export CUSTOM_MULTISEND_ADDRESS="0x40A2aCCbd92BCA938b02010E17A5b8929b49130D"
export WXDAI_ADDRESS="0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d"
export MECH_CONTRACT_ADDRESS="0x77af31De935740567Cf4fF1986D04B2c964A786a"
export MECH_WRAPPED_NATIVE_TOKEN_ADDRESS=$WXDAI_ADDRESS
export DISABLE_TRADING=false
export STOP_TRADING_IF_STAKING_KPI_MET=true
export RESET_PAUSE_DURATION=120
export MECH_CHAIN_ID=ethereum

# check if USE_NEVERMINED is set to true
if [ "$USE_NEVERMINED" == "true" ];
Expand Down Expand Up @@ -1065,6 +1060,12 @@ export BET_THRESHOLD=100000000000000000
export TRADING_STRATEGY=kelly_criterion
export PROMPT_TEMPLATE="Please take over the role of a Data Scientist to evaluate the given question. With the given question \"@{question}\" and the \`yes\` option represented by \`@{yes}\` and the \`no\` option represented by \`@{no}\`, what are the respective probabilities of \`p_yes\` and \`p_no\` occurring?"
export IRRELEVANT_TOOLS='["claude-prediction-online","prediction-request-reasoning","prediction-online","prediction-offline","prediction-offline-sme","deepmind-optimization", "deepmind-optimization-strong", "openai-gpt-3.5-turbo", "openai-gpt-3.5-turbo-instruct", "openai-gpt-4", "openai-text-davinci-002", "openai-text-davinci-003", "prediction-online-sum-url-content", "prediction-online-summarized-info", "stabilityai-stable-diffusion-512-v2-1", "stabilityai-stable-diffusion-768-v2-1", "stabilityai-stable-diffusion-v1-5", "stabilityai-stable-diffusion-xl-beta-v2-2-2"]'
export STAKING_CONTRACT_ADDRESS=$CUSTOM_STAKING_ADDRESS
export DISABLE_TRADING=false
export STOP_TRADING_IF_STAKING_KPI_MET=true
export RESET_PAUSE_DURATION=120
export MECH_WRAPPED_NATIVE_TOKEN_ADDRESS=$WXDAI_ADDRESS
export MECH_CHAIN_ID=ethereum

service_dir="trader_service"
build_dir="abci_build"
Expand Down
9 changes: 8 additions & 1 deletion scripts/mech_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import json
import os
import sys
import time
from dataclasses import dataclass
from pathlib import Path
Expand Down Expand Up @@ -166,6 +167,12 @@ def _read_mech_events_data_from_file() -> Dict[str, Any]:
except FileNotFoundError:
mech_events_data = {}
mech_events_data["db_version"] = MECH_EVENTS_DB_VERSION
except json.decoder.JSONDecodeError:
print(
f'\nERROR: The local Mech events database "{MECH_EVENTS_JSON_PATH.resolve()}" is corrupted. Please try delete or rename the file, and run the script again.'
)
sys.exit(1)

return mech_events_data


Expand Down Expand Up @@ -302,7 +309,7 @@ def get_mech_requests(
all_mech_events = _get_mech_events(sender, MechRequest)
filtered_mech_events = {}
for event_id, event_data in all_mech_events.items():
block_timestamp = event_data["block_timestamp"]
block_timestamp = int(event_data["block_timestamp"])
if from_timestamp <= block_timestamp <= to_timestamp:
filtered_mech_events[event_id] = event_data

Expand Down