Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose more DeployablePredictionAgent.get_markets args as properties #533

Merged
merged 4 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
22 changes: 6 additions & 16 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 13 additions & 2 deletions prediction_market_agent_tooling/deploy/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,18 @@ def get_gcloud_fname(self, market_type: MarketType) -> str:

class DeployablePredictionAgent(DeployableAgent):
bet_on_n_markets_per_run: int = 1

# Agent behaviour when fetching markets
n_markets_to_fetch: int = MAX_AVAILABLE_MARKETS
min_balance_to_keep_in_native_currency: xDai | None = xdai_type(0.1)
trade_on_markets_created_after: DatetimeUTC | None = None
get_markets_sort_by: SortBy = SortBy.CLOSING_SOONEST

# Agent behaviour when filtering fetched markets
allow_invalid_questions: bool = False
same_market_trade_interval: TradeInterval = FixedInterval(timedelta(hours=24))

min_balance_to_keep_in_native_currency: xDai | None = xdai_type(0.1)

# Only Metaculus allows to post predictions without trading (buying/selling of outcome tokens).
supported_markets: t.Sequence[MarketType] = [MarketType.METACULUS]

Expand Down Expand Up @@ -383,7 +391,10 @@ def get_markets(
cls = market_type.market_class
# Fetch the soonest closing markets to choose from
available_markets = cls.get_binary_markets(
limit=self.n_markets_to_fetch, sort_by=sort_by, filter_by=filter_by
limit=self.n_markets_to_fetch,
sort_by=sort_by,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you unify this, please:

n_markets_to_fetch is currently taken from the class' variable, get_markets_sort_by is defined as class' variable but it's used from this function arguments instead, and filter_by is only in this function arguments

Screenshot by Dropbox Capture

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops fixed. Have left filter_by as hard-coded FilterBy.OPEN (since there's not a use-case atm for having a different value)

filter_by=filter_by,
created_after=self.trade_on_markets_created_after,
)
return available_markets

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "prediction-market-agent-tooling"
version = "0.55.1"
version = "0.55.2"
description = "Tools to benchmark, deploy and monitor prediction market agents."
authors = ["Gnosis"]
readme = "README.md"
Expand Down
Loading