diff --git a/README.md b/README.md index 8216c0c..660ce3b 100644 --- a/README.md +++ b/README.md @@ -92,9 +92,17 @@ The idea is that markets on Manifold are mostly answered by real people, so the Bear in mind your LLM credits, Tavily credits or any other paid 3rd provider credits when running the benchmark, as it answers many markets in a single run, which can be very costly. +Run + +```bash +python trader/main.py +``` + +the script will place bets on random 10 markets from https://aiomen.eth.limo, these won't be used for the final evaluation, but you can double-check that all works as expected. + ### Submission -1. Run `python trader/main.py`, it will place bets on all markets that will be used for the evaluation. You can run the script multiple times, but we will always look only at the latest bet on the market from your public key. +1. Run `python trader/main.py --final`, it will place bets on all markets that will be used for the evaluation. You can run the script multiple times, but we will always look only at the latest bet on the market from your public key. If you get no markets found error, either we didn't open them yet, or they are already closed and it's too late for the submission. 2. Once you are happy with your agent's predictions, open a PR against this repository with your implementation and public key used for placing bets. This is your submission. 3. Make sure the CI pipeline is all green. diff --git a/trader/benchmark.py b/trader/benchmark.py index 8c82ea7..e877887 100644 --- a/trader/benchmark.py +++ b/trader/benchmark.py @@ -1,4 +1,5 @@ import typer +from dotenv import load_dotenv from prediction_market_agent_tooling.benchmark.agents import ( AbstractBenchmarkedAgent, RandomAgent, @@ -17,7 +18,7 @@ get_binary_markets, ) from prediction_prophet.benchmark.agents import _make_prediction -from dotenv import load_dotenv + from trader.prediction import DEFAULT_MODEL, predict diff --git a/trader/main.py b/trader/main.py index 9ab7e1e..fed0574 100644 --- a/trader/main.py +++ b/trader/main.py @@ -1,3 +1,5 @@ +import random + import pandas as pd import typer from dotenv import load_dotenv @@ -11,8 +13,12 @@ from trader.prediction import predict +MARKET_CREATOR_USED_FOR_EVALUATION = HexAddress( + HexStr("0xa7E93F5A0e718bDDC654e525ea668c64Fd572882") +) + -def main(creator: str = "0xa7E93F5A0e718bDDC654e525ea668c64Fd572882") -> None: +def main(final: bool = False) -> None: # Load the environment variables. load_dotenv() @@ -20,13 +26,18 @@ def main(creator: str = "0xa7E93F5A0e718bDDC654e525ea668c64Fd572882") -> None: markets = OmenSubgraphHandler().get_omen_binary_markets( limit=None, opened_after=utcnow(), - creator=HexAddress(HexStr(creator)), + # If `final` is True, get all markets created by the specified creator that will be used for the evaluation of the winner. + creator=MARKET_CREATOR_USED_FOR_EVALUATION if final else None, ) if not markets: logger.error("No markets found, please try again later.") return + # If this isn't for the final evaluation, just bet on random 10 markets. + if not final: + markets = random.sample(markets, k=min(10, len(markets))) + results: dict[str, list[str | bool | None]] = { "market_id": [], "question": [],