General agents
AuraScore 79/100

Virtual Power Plant Battery Arbitrage Agent Pipeline Script

Build an autonomous agent execution script for BESS dispatch and day-ahead wholesale electricity arbitrage.

Deploy this template to establish an agentic automation script that computes battery state-of-charge versus nodal pricing signals. Ideal for virtual power plant operators seeking deterministic market execution with safety guardrails.

Template

Role: Senior Energy Trading & Virtual Power Plant (VPP) Automation Engineer specializing in algorithmic battery energy storage system (BESS) dispatch.

Context

  • Fleet Identifier: {{asset_fleet_id}}
  • ISO Market Data Endpoint: {{iso_market_feed}}
  • Minimum State-of-Charge Floor: {{min_soc_threshold}}
  • Marginal Degradation Cost per MWh: {{degradation_cost_per_mwh}}
  • Settlement Integration URL: {{settlement_api_key}}
  • Telemetry Polling Interval: {{telemetry_poll_interval_sec}}

Task

Author a production-grade Python orchestration script for an autonomous market agent that polls Locational Marginal Pricing (LMP), assesses distributed battery storage telemetry across {{asset_fleet_id}}, runs profitability calculations against cycle degradation, and issues automated charge/discharge schedules.

Method

  1. Ingest five-minute LMP and ancillary service pricing arrays from {{iso_market_feed}}.
  2. Poll live telemetry across {{asset_fleet_id}} at intervals governed by {{telemetry_poll_interval_sec}}.
  3. Compute net arbitrage spreads by factoring in round-trip efficiency and {{degradation_cost_per_mwh}}.
  4. Calculate available inverter capacity while respecting {{min_soc_threshold}} safety boundaries.
  5. Generate optimal 15-minute dispatch setpoints using linear optimization logic.
  6. Execute validation routines to prevent thermal runaway risk or breach of local interconnection limits.
  7. Submit signed dispatch payloads to {{settlement_api_key}} using secure HMAC headers.
  8. Output structured performance metrics including estimated revenue and avoided carbon intensity.

Constraints

  • MUST abort automated discharge if asset state-of-charge approaches {{min_soc_threshold}}.
  • MUST NOT submit market bids when the price delta is lower than {{degradation_cost_per_mwh}}.
  • Include exponential backoff retry logic for all {{iso_market_feed}} polling operations.
  • The script must run without external runtime database dependencies using in-memory state tracking.

Output format

Provide a clean Python automation script containing:

  1. Configuration constants and typed payload schemas.
  2. Arbitrage mathematical optimization engine class.
  3. Fleet telemetry aggregation and dispatch execution handler.
  4. Main evaluation loop demonstrating a full 24-hour pricing cycle.

Self-review

  • Verify that battery degradation costs are subtracted prior to generating discharge triggers.
  • Confirm {{telemetry_poll_interval_sec}} properly sets asynchronous polling delays.
  • Ensure strict assertions prevent violation of {{min_soc_threshold}}.
AuraScore breakdown
79/100Provisional
Instruction clarity15/15 · Strong

Explicit role, a named task, and discrete steps the model can follow.

Context architecture12/12 · Strong

Background, inputs and variables the model needs before it starts.

Constraint engineering10/12 · Adequate

Hard boundaries — what the model must and must not do.

Output specification6/14 · Thin

A named, field-level shape for the response.

Reasoning structure10/10 · Strong

Ordered work items that force analysis before an answer.

Model compatibility10/10 · Strong

Length and structure that travel across frontier models.

Token efficiency5/10 · Thin

Signal density — instruction weight without padding.

Reusability7/7 · Strong

Documented variables so the scaffold adapts to new inputs.

Robustness3/5 · Adequate

Quality bar, assumptions and behaviour when inputs are thin.

Observed performance1/5 · Thin

How much real usage the template has behind it.

ai-agents
agents-general
energy-utilities
vpp
bess-dispatch
energy-trading