Skip to content

[Service][Web] Add prediction market web distribution#3215

Merged
Herklos merged 1 commit into
devfrom
feature/add-prediction-market-web-distribution-tentacles
Feb 4, 2026
Merged

[Service][Web] Add prediction market web distribution#3215
Herklos merged 1 commit into
devfrom
feature/add-prediction-market-web-distribution-tentacles

Conversation

@Herklos
Copy link
Copy Markdown
Contributor

@Herklos Herklos commented Feb 3, 2026

@Herklos Herklos self-assigned this Feb 3, 2026
@Herklos Herklos force-pushed the feature/add-prediction-market-web-distribution-tentacles branch 7 times, most recently from cb0b9d1 to da21d34 Compare February 4, 2026 13:30
@Herklos Herklos marked this pull request as ready for review February 4, 2026 13:30
@Herklos Herklos requested a review from GuillaumeDSM as a code owner February 4, 2026 13:30
@Herklos
Copy link
Copy Markdown
Contributor Author

Herklos commented Feb 4, 2026

It's ready!

trading_mode_name: str,
trading_mode_configuration: dict,
) -> None:
models_configuration.save_distribution_configuration(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 great factorization 👍

self.allow_skip_asset = bool(self.UI.user_input(
IndexTradingModeProducer.ALLOW_SKIP_ASSET, commons_enums.UserInputTypes.BOOLEAN,
self.allow_skip_asset, inputs,
title="Allow skipping assets that don't meet minimum order size requirements instead of aborting portfolio rebalancing.",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

IndexTradingModeProducer.MIN_ORDER_SIZE_MARGIN, commons_enums.UserInputTypes.FLOAT,
float(self.min_order_size_margin), inputs,
min_val=1,
title="Min order size safety factor: ideal amount must be at least this multiple of the exchange min cost. "
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

# - in other words ideal_amount > min_cost * min_order_size_margin
# => ideal_amount / min_order_size_margin > min_cost
min_order_size_margin = self.trading_mode.min_order_size_margin
if min_order_size_margin <= trading_constants.ZERO:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shoud it be this? as I understand min_order_size_margin has a min of 1

Suggested change
if min_order_size_margin <= trading_constants.ZERO:
if min_order_size_margin <= trading_constants.ONE:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, it's up

Comment on lines +283 to +284
f"Skipping {symbol} buy: available funds are too low to buy {ratio*trading_constants.ONE_HUNDRED}% "
f"of {reference_market_to_split} holdings: {round(ideal_amount / min_order_size_margin, 9)} {coin}"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

with pytest.raises(trading_errors.MissingMinimalExchangeTradeVolume):
await consumer._get_symbols_and_amounts(["BTC"], {}, decimal.Decimal(0.0003))

# not enough funds but skipping allowed so it doesn't raise
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

Signed-off-by: Herklos <herklos@drakkar.software>
@Herklos Herklos force-pushed the feature/add-prediction-market-web-distribution-tentacles branch from da21d34 to e7c04f3 Compare February 4, 2026 14:39
@Herklos Herklos merged commit cdb0e38 into dev Feb 4, 2026
17 checks passed
@Herklos Herklos deleted the feature/add-prediction-market-web-distribution-tentacles branch February 4, 2026 14:47
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.

2 participants