Skip to content

Commit

Permalink
Check if question is invalid before looking for replicated answer (#530)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii authored Oct 24, 2024
1 parent 4d888e7 commit f4fb719
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
OmenSubgraphHandler,
)
from prediction_market_agent_tooling.tools.balances import get_balances
from prediction_market_agent_tooling.tools.is_invalid import is_invalid
from prediction_market_agent_tooling.tools.langfuse_ import observe
from prediction_market_agent_tooling.tools.utils import DatetimeUTC, utcnow
from pydantic import BaseModel
Expand Down Expand Up @@ -73,7 +74,15 @@ def omen_finalize_and_resolve_and_claim_back_all_markets_based_on_others_tx(
logger.info(f"Found {len(created_opened_markets)} markets to answer.")
# Finalize them (set answer on Realitio).
created_opened_markets_with_resolutions = [
(m, find_resolution_on_other_markets(m)) for m in created_opened_markets
(
m,
(
find_resolution_on_other_markets(m)
if not is_invalid(m.question_title)
else Resolution.CANCEL
),
)
for m in created_opened_markets
]
created_opened_markets_with_resolutions_to_answer = (
filter_replicated_markets_to_answer(
Expand Down

0 comments on commit f4fb719

Please sign in to comment.