Trade intervals determine how often your agent can place bets on the same market. This prevents overtrading, manages capital efficiently, and respects market dynamics.
Without trade intervals, an agent might continuously bet on the same market every time it runs, wasting gas fees and potentially moving the price against itself.
from datetime import timedeltaclass OneTimeBettingAgent(DeployableTraderAgent): # Set interval longer than any market's lifetime same_market_trade_interval = FixedInterval(timedelta(days=1995))
This pattern is useful for:
Agents that target initial mispricings
Strategies that bet on market creation
Capital-constrained agents that need to diversify
Example from SkewAgent:
class SkewAgent(DeployableTraderAgent): # Bet on many markets, but never the same one twice bet_on_n_markets_per_run = 1000 same_market_trade_interval = FixedInterval(timedelta(days=1995)) get_markets_sort_by = SortBy.NEWEST # Target fresh markets at 50/50
Trade multiple times, spaced evenly across market’s life:
class ProportionalTradingAgent(DeployableTraderAgent): # Trade up to 4 times per market, evenly spaced same_market_trade_interval = MarketLifetimeProportionalInterval(max_trades=4)
How it works:
Market open for 8 days → trade every ~2 days
Market open for 40 days → trade every ~10 days
Market open for 365 days → trade every ~91 days
Example from prophet agents:
class DeployableTraderAgentER(DeployableTraderAgent): bet_on_n_markets_per_run = 2 same_market_trade_interval = MarketLifetimeProportionalInterval(max_trades=4)
Proportional intervals are ideal for agents that want to:
class HighVolumeAgent(DeployableTraderAgent): """Trade on many markets once each""" bet_on_n_markets_per_run = 1000 same_market_trade_interval = FixedInterval(timedelta(days=1995)) get_markets_sort_by = SortBy.NEWEST
class FocusedAgent(DeployableTraderAgent): """Trade on few markets but update frequently""" bet_on_n_markets_per_run = 2 same_market_trade_interval = FixedInterval(timedelta(days=7)) get_markets_sort_by = SortBy.HIGHEST_LIQUIDITY
class AdaptiveAgent(DeployableTraderAgent): """Scale updates based on market lifetime""" bet_on_n_markets_per_run = 4 same_market_trade_interval = MarketLifetimeProportionalInterval(max_trades=4)
Targets specific market creators with moderate update frequency:
class MarketCreatorsStalkerAgent(DeployableTraderAgent): # Trade on all available markets from whitelisted creators bet_on_n_markets_per_run = MAX_AVAILABLE_MARKETS # But only update positions every 14 days same_market_trade_interval = FixedInterval(timedelta(days=14)) def get_markets(self, market_type: MarketType) -> Sequence[AgentMarket]: return [ OmenAgentMarket.from_data_model(m) for m in OmenSubgraphHandler().get_omen_markets_simple( limit=self.n_markets_to_fetch, creator_in=SPECIALIZED_FOR_MARKET_CREATORS, ) ]
class SkewAgent(DeployableTraderAgent): supported_markets = [MarketType.OMEN] # Process as many markets as possible n_markets_to_fetch = 1000 bet_on_n_markets_per_run = 1000 # Never re-bet (simple statistical strategy) same_market_trade_interval = FixedInterval(timedelta(days=1995)) # Target new markets at 50/50 starting prices get_markets_sort_by = SortBy.NEWEST def answer_binary_market(self, market: AgentMarket) -> ProbabilisticAnswer | None: # Simple statistical bet based on historical majority return ProbabilisticAnswer( p_yes=Probability(float(self.majority_resolution)), confidence=1.0, reasoning="Chosen based on majority resolution in recent history.", )
Gas Optimization: On Gnosis Chain (Omen), gas is cheap (~$0.01/transaction). You can afford more frequent updates.Capital Efficiency: Longer intervals allow capital to work across more markets simultaneously.Information Edge: If your agent incorporates new information, shorter intervals capture more value.