Skip to content

feat(polymarket): expose edge + spread gate knobs via ChatUI#1000

Closed
jmoreira-valory wants to merge 1 commit into
mainfrom
feat/polymarket-gates-chatui
Closed

feat(polymarket): expose edge + spread gate knobs via ChatUI#1000
jmoreira-valory wants to merge 1 commit into
mainfrom
feat/polymarket-gates-chatui

Conversation

@jmoreira-valory

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #999. Makes the two Polymarket bet-selection gates tunable at runtime via the chat UI, in addition to env config. Both still default to no-op — nothing changes unless an operator sets a value.

Design

Both knobs become ChatuiConfig fields (None = keep the existing default), exposed in the chat LLM prompt and validated in the handler — gated on is_running_on_polymarket (the gates are CLOB-only, so they're offered only on the Polymarket trader; trader_pearl/Omen is untouched).

Each knob stays in its semantic home (deliberately not crammed into a shared strategies_kwargs):

Gate knob Nature How ChatUI reaches it
min_edge / max_edge strategy input (kelly reads it) bridged into strategies_kwargs in decision_maker_abci/behaviours/base.py::set_chatui_values — same path as max_bet_size
min_spread / max_spread post-strategy gate (decision_receive) read in decision_receive.py with fallback to the existing polymarket_spread_* params

So the operator tunes both the same way (one chat surface), while internally each lives where it belongs and no strategy contract is touched.

Changes

  • chatui_abci: models.py (+4 ChatuiConfig fields), prompts.py (Polymarket-only gate section in the LLM template), handlers.py (typed config + validation: numeric, 0 <= min <= max <= 1, clearable via removed_config_fields).
  • decision_maker_abci: base.py (edge bridge), decision_receive.py (spread chatui-with-fallback).
  • Tests added for the edge bridge, the spread fallback/override, and handler validation.

Testing

  • 4182 unit tests pass; lint green (isort/black/flake8/mypy/pylint/darglint); autonomy packages lock + check-hash clean.
  • No FSM change. Defaults unchanged (no-op).

Stacked on feat/polymarket-bet-selection-gates (#999).

🤖 Generated with Claude Code

Follow-up to #999. Makes the two Polymarket bet-selection gates tunable at
runtime via the chat UI, in addition to env config. Defaults unchanged (no-op).

Both knobs become ChatuiConfig fields (None = keep the existing default),
exposed in the chat LLM prompt and validated in the handler, gated on
is_running_on_polymarket (CLOB-only -> Polymarket trader only; Omen untouched).
Each stays in its semantic home:

- edge band (min_edge/max_edge): strategy input -> bridged into
  strategies_kwargs in decision_maker_abci base.set_chatui_values
- spread band (min_spread/max_spread): post-strategy gate -> read in
  decision_receive with fallback to the polymarket_spread_* params

No FSM change. 4182 tests pass; lint + packages lock + check-hash clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@jmoreira-valory jmoreira-valory marked this pull request as draft June 29, 2026 15:20
Base automatically changed from feat/polymarket-bet-selection-gates to main June 30, 2026 10:39
@jmoreira-valory

Copy link
Copy Markdown
Contributor Author

Deprioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant