Skip to content

Minimum Donation Fallback for Daily Activity Tracking#166

Merged
8ball030 merged 34 commits intofix/audit_pr-163from
feat/donation_auction_participation
Feb 4, 2026
Merged

Minimum Donation Fallback for Daily Activity Tracking#166
8ball030 merged 34 commits intofix/audit_pr-163from
feat/donation_auction_participation

Conversation

@Karrenbelt
Copy link
Collaborator

Implements fallback donation mechanism to ensure daily activity metrics for grant requirements.

Closes #165

Changes

State Management:

  • Add agent_started_at and last_donation_request_sent_at fields to AgentState
  • Add configurable min_runtime_seconds (default: 300s) and donation_interval_hours (default: 23.5h) parameters

Initialization:

  • Set startup timestamp in SetupRound.act on first run
  • Pass donation config parameters from ArbitrageStrategy to AgentState during initialization

Fallback Logic:

  • Implement should_trigger_fallback_donation() in CoolDownRound:
    • Triggers after min_runtime_seconds if no donation made this session
    • Triggers after donation_interval_hours since last donation request
  • Schedule minimum donation when trigger conditions met
  • Update timestamp in PostTradeRound immediately after scheduling profitable arb donations

Configuration

Add to your skill.yaml or override in agent config:

models:
  arbitrage_strategy:
    args:
      min_runtime_seconds: 300  # 5 minutes
      donation_interval_hours: 23.5  # conservative 24h window

Implementation Notes

Uses in-memory tracking (Solution 2 from issue discussion) for simplicity. State resets on agent restart, which may result in double-donations within 24h window if agent is restarted—this is acceptable per grant requirements and economically insignificant.

Timestamp updated immediately after scheduling donation (not after confirmation) to prevent race conditions with concurrent Derolas automator ABCI app skill.

Local Verification

To verify fallback donation trigger without waiting for profitable arbitrage:

  1. Set very high profit threshold in .env to prevent arbitrage execution:
   MIN_PROFIT=100.0  # or higher to ensure no trades trigger
  1. Run the agent and wait 5+ minutes

  2. Check logs for fallback trigger:

   rg "Scheduled fallback donation" derive_arbitrage_agent/log.jsonl

Expected output:

   Scheduled fallback donation to the auction contract for daily activity checking.

Note: No automated tests added as this requires multi-skill integration testing with the Derolas automator ABCI app, which is outside current test infrastructure scope.

@Karrenbelt Karrenbelt changed the base branch from main to feat/trading_strategy_params_inspection_and_updating January 28, 2026 12:59
@Karrenbelt Karrenbelt changed the base branch from feat/trading_strategy_params_inspection_and_updating to fix/audit_pr-163 January 28, 2026 12:59
Comment on lines +113 to +116

# Fallback trigger auction contract configuration
min_runtime_seconds: float
donation_interval_hours: int
Copy link
Collaborator Author

@Karrenbelt Karrenbelt Jan 30, 2026

Choose a reason for hiding this comment

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

donation_interval_hours should've been a float. Integers are so... discrete! Quack! - Claude Sonnet 4.5 & me

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@

Screenshot From 2026-01-30 03-55-54

And mind you, this is just the start!

@8ball030 8ball030 merged commit 44d1032 into fix/audit_pr-163 Feb 4, 2026
@8ball030 8ball030 deleted the feat/donation_auction_participation branch February 4, 2026 18:26
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.

Feature: implement minimum donation fallback after 5min runtime for daily activity tracking

2 participants