botwir3 Mechanic
Gate Function
A configurable validation checkpoint that evaluates every proposed action against the strategy's constraints before it reaches the adapter.
The gate sits between the strategy logic and the execution layer. Every cycle, the agent module proposes an action — buy, sell, hold, adjust. The gate evaluates the proposal: is this action type in the allowed set? Is the magnitude within the configured constraints? Would the result keep the portfolio within the tolerance band?
If the proposal passes all checks, it proceeds to the adapter. If any check fails, the gate rejects it. The rejection is recorded in the ledger with the reason code. The bot continues to the next cycle.
The gate is a configurable function in gate.ts. Its behavior is entirely determined by the parameters in the compiled config. The user configured those parameters in the builder. The gate does not make judgment calls, apply discretion, or override the config. It is a mechanical checkpoint — deterministic, auditable, and configurable by the user.