Repository navigation
Second opinion from free models, maker limit orders in the simulated portfolio - #22
Merged
Merged
Conversation
…portfolio - Second opinion: when a buy is possible, Gemini (then Groq) gets the same state as Jev (no price) and gives P(YES); buys need it on the same side of the price (blocking reason second_opinion). Stored with the forecast, shown in the explanation; SECOND_OPINION_* settings - Maker orders: automatic buys become limit orders one tick above the bid (no fee), filled when a sync shows the ask at the limit, expired after MAKER_ORDER_TTL_HOURS, replaced by new forecasts, cancelled by the guard's pause or exclusions. Their money is reserved (cash, exposure). Manual bets still take the book. PAPER_ORDER_MODE=taker restores the old behaviour - Orders API, portfolio card with fill rate and savings, export sheet, settings, docs (EN/IT), .env.example and tests Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
botta0oss
pushed a commit
that referenced
this pull request
Sep 26, 2026
…by text The assertion searched the text "0.3" in the state sent to Jev, which also matched timestamps such as 07:47:40.392993 depending on the clock: main failed after the merge of #22. It now checks that no number in the state equals the price and that no field is named after a price. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two more changes aimed at the losses of the first simulated portfolio.
Second opinion (
backend/ai/second_opinion.py)MIN_EVIDENCEand the calibrated Jev estimate is at leastMIN_EDGEfrom the price.SECOND_OPINION_PROVIDERS).SECOND_OPINION_MARGIN. Otherwise the economic assessment gets the blocking reasonsecond_opinion, and the plan says Avoid with the reason.SECOND_OPINION_REQUIRED=true.second_opinion,second_opinion_provider), shown in the explanation card, included in the export.Maker limit orders (
backend/betting/orders.py, newpaper_orderstable)PAPER_ORDER_MODE=maker(the default), automatic buys become a limit order instead of taking the ask. The order goes one tick above the side's best bid, stays below the ask, and never goes above the assessment's maximum price. No fee.entry = maker.MAKER_ORDER_TTL_HOURS(6);GET /portfolio/ordersandPOST /portfolio/orders/{id}/cancel(admin). The market economics response now includespending_ordersandmaker_price.entrycolumn;Tests
tests/test_orders.py, 12 new tests. Older tests run withPAPER_ORDER_MODE=taker, and without AI keys the second opinion is not asked. 226 passed..env.example.🤖 Generated with Claude Code
https://claude.ai/code/session_01JLWZrfy12imc6dQRsEtFjj
Generated by Claude Code