Contribution-driven buy-only rebalancing with a minimal-sell fallback
Deploy a monthly contribution with buy-only rebalancing and fall back to minimal selling only when bands cannot be restored otherwise.
instruction.md
What the agent sees (CONVENTIONS.md is appended automatically)
Contribution-driven rebalancing
A 10,000 USD contribution has arrived in the account. First try to bring every sleeve within its IPS band using buys only, choosing buys that minimise the sum of |drift| after trading (whole shares, cash buffer). If that is infeasible, generate the minimal-notional set of sells that makes it feasible, then the buys.
Write trades.csv, post_trade.json and /app/output/decision.json {"mode": "buy_only" | "buy_and_sell", "reason"}.
Verification
reward.json metrics · weights sum to 1.00
| Metric | Weight | Check |
|---|---|---|
| mode_correct | 0.3 | Mode equals the oracle's feasibility determination. |
| feasibilitygate | 0.3 | Bands, whole shares, cash buffer. GATE at 0.2. |
| objective | 0.4 | buy_only: sum |drift| <= oracle + 1e-6; buy_and_sell: sell notional <= oracle + 1 USD. |
Gates: feasibility. A gate failure caps or zeroes the trial reward regardless of other metrics.
Harbor scaffold
Generated from this record — task.toml, Dockerfile, verifier, oracle stub
schema_version = "1.4" [task] name = "portfolio-agent-evals/pf-rb-cashflow-aware" version = "1.0.0" description = "Deploy a monthly contribution with buy-only rebalancing and fall back to minimal selling only when bands cannot be restored otherwise." keywords = ["etf", "portfolio", "rebalance", "trade-generation", "trade-generation", "feasibility-reasoning", "optimization"] [metadata] author_name = "portfolio-agent-evals" difficulty = "medium" category = "quant-finance" tags = ["trade-generation", "tier-2", "rebalance", "multi-metric"] theme = "Rebalancing & Trade Generation" tier = 2 reward_type = "multi-metric" [agent] timeout_sec = 1500.0 [verifier] timeout_sec = 180.0 [environment] # Offline by design: all data is synthetic and generated at build time. network_mode = "none" cpus = 2 memory_mb = 4096 storage_mb = 10240 build_timeout_sec = 900.0
Traps
Each must carry signal: a trap-blind solution must lose credit
- Buy-only feasibility hinges on whether the over-weight sleeve is diluted enough by the contribution.
- Half the seeds are buy-only feasible; the other half require a sell — no fixed answer.
- A greedy 'buy the most under-weight sleeve' loop is suboptimal on planted instances.
Inputs
Fixtures mounted in the environment
- /app/portfolio/holdings.csv, /app/portfolio/accounts.csv
- /app/data/prices/
- /app/policy/ips.yaml
Outputs
What the verifier reads from /app/output
- /app/output/trades.csvCSVTrades.
- /app/output/post_trade.jsonJSONPost-trade weights.
- /app/output/decision.jsonJSONMode and reason.
Anti-gaming
Feasibility is a seed-level coin flip with margin.
Oracle notes
solution/solve.sh must score 1.0 on five seeds
Two-stage MILP: feasibility with sells fixed to zero, then min-sell then min-drift.
Reviews (0)
Design review before a task is marked ready