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

Bump PMAT version to 0.9.3, simplify calculate_bet_amount for KnownOutcomeAgent #51

Merged
merged 4 commits into from
Apr 8, 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
16 changes: 8 additions & 8 deletions poetry.lock

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

15 changes: 2 additions & 13 deletions prediction_market_agent/agents/known_outcome_agent/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
from prediction_market_agent_tooling.deploy.constants import OWNER_KEY
from prediction_market_agent_tooling.gtypes import SecretStr, private_key_type
from prediction_market_agent_tooling.markets.agent_market import AgentMarket
from prediction_market_agent_tooling.markets.data_models import BetAmount, Currency
from prediction_market_agent_tooling.markets.data_models import BetAmount
from prediction_market_agent_tooling.markets.markets import MarketType
from prediction_market_agent_tooling.markets.omen.omen import OmenAgentMarket
from prediction_market_agent_tooling.tools.utils import (
check_not_none,
get_current_git_commit_sha,
get_current_git_url,
should_not_happen,
)

from prediction_market_agent.agents.known_outcome_agent.known_outcome_agent import (
Expand Down Expand Up @@ -83,17 +82,7 @@ def answer_binary_market(self, market: AgentMarket) -> bool | None:

def calculate_bet_amount(self, answer: bool, market: AgentMarket) -> BetAmount:
if isinstance(market, OmenAgentMarket):
if market.currency != Currency.xDai:
should_not_happen()
return BetAmount(
# On markets without liquidity, bet just a small amount for benchmarking.
amount=(
Decimal(1.0)
if market.get_liquidity_in_xdai() > 5
else market.get_tiny_bet_amount().amount
),
currency=Currency.xDai,
)
return BetAmount(amount=(Decimal(1.0)), currency=market.currency)
Copy link
Contributor

Choose a reason for hiding this comment

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

I know we now filtering for markets with liquidity, but people can still create markets with for example, $0.01 in liquidity and then it doesn't make much sense to me to bet more than the minimal bet. wdyt?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. In that case, I think it makes sense to filter the market at the pick_markets stage, so as not to waste openai API credits. I've made that change above

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you want to keep them for benchmark purposes?

If not, okay by me, just that

elif market.get_liquidity_in_xdai() > 5:
                print(
                    f"Skipping market {market.id=} {market.question=}, because it has insufficient liquidity."
                )

Should it be with the opposite sign, probably?

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! 😆

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't you want to keep them for benchmark purposes?

I'm not too concerned about that, more about trying to get the markets that should be p_yes/no==0.95 to that point

else:
raise NotImplementedError("This agent only supports xDai markets")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ poetry = "^1.7.1"
poetry-plugin-export = "^1.6.0"
functions-framework = "^3.5.0"
cron-validator = "^1.0.8"
prediction-market-agent-tooling = "^0.9.1"
prediction-market-agent-tooling = "^0.9.3"
pydantic-settings = "^2.1.0"
autoflake = "^2.2.1"
isort = "^5.13.2"
Expand Down
Loading