Skip to content

Commit

Permalink
add final flag to the main script
Browse files Browse the repository at this point in the history
  • Loading branch information
kongzii committed Jun 6, 2024
1 parent 351e05a commit abdd18e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
3 changes: 2 additions & 1 deletion trader/benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import typer
from dotenv import load_dotenv
from prediction_market_agent_tooling.benchmark.agents import (
AbstractBenchmarkedAgent,
RandomAgent,
Expand All @@ -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


Expand Down
15 changes: 13 additions & 2 deletions trader/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import random

import pandas as pd
import typer
from dotenv import load_dotenv
Expand All @@ -11,22 +13,31 @@

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()

# Get all markets created by the specified creator.
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": [],
Expand Down

0 comments on commit abdd18e

Please sign in to comment.