Protocol

Distributions

Two independent engines turn accumulated BNB into authorized bStocks and deposit them directly into licensed Broker Accounts.

Two engines

MarketHours and AfterHours are thin deployments of the same DistributionEngine.

EngineIntended funding
Market HoursBroker Market and Margin Desk native fees
After HoursNFT royalties, BNB and unwrapped WBNB

Each engine has separate balances, round IDs, asset choices and payment history. Together they can use up to six distinct bStocks in a cycle without processing the entire collection in one transaction.

Starting a round

startRound(assetIds, minOuts) performs the following:

  1. verifies that no round is active;
  2. verifies keeper access, or that the public delay has expired;
  3. requires three distinct enabled assets;
  4. divides the engine's full BNB balance into three equal shares;
  5. snapshots the current license version and total weight;
  6. swaps each share through the authorized router; and
  7. stores the actual token balances purchased.

The public-start delay is one day and can be configured only before the engine configuration is frozen.

Processing

processRound(maxTokenIds) advances the cursor through at most 100 token IDs.

For every licensed Broker at the snapshotted version, the engine calculates:

reward = purchased asset × Broker weight ÷ total round weight

The result is transferred to accountOf(tokenId). The next call resumes at the saved cursor. Once the cursor passes token ID 4,444, the round closes and the public-start delay begins again.

Accounting and failures

The engine records purchased and distributed totals separately for each of the three assets.

It also records lastPaidRound[tokenId] before attempting transfers, which prevents a token ID from being paid twice in the same round.

Rounding leftovers and failed-transfer balances remain in the engine. They are not silently assigned to another Broker.

Asset registry

BStockRegistry stores the token address, encoded PancakeSwap V3 path, minimum output floor and enabled status for every asset ID.

The router accepts calls only from authorized protocol modules and executes only registered, enabled WBNB / USDT / bStock routes.

Assets without adequate liquidity can remain registered while disabled.