Skip to content

Add Redemption Orderbook (ROB) incentive rewards distribution#26

Merged
adacapo21 merged 5 commits intomainfrom
aggelos/rob-incentives
Feb 5, 2026
Merged

Add Redemption Orderbook (ROB) incentive rewards distribution#26
adacapo21 merged 5 commits intomainfrom
aggelos/rob-incentives

Conversation

@adacapo21
Copy link
Copy Markdown
Member

Summary

  • Introduces a new reward type — ROB (Redemption Orderbook) incentives — that distributes INDY to owners with in-range redemption positions
  • Each epoch (432,000 seconds) is divided into 480 periods of 15 minutes. For each period, the configured INDY amount is distributed pro-rata based on each owner's lovelaceAmount share of total in-range positions
  • Initial configuration: 500 INDY per epoch for iUSD; iBTC, iETH, iSOL are skipped (0 INDY)
  • Adds a new rob CLI command and integrates ROB into the existing all and summary commands
  • Produces one IndividualReward row per owner per epoch (like governance rewards), with purpose string "ROB reward for iUSD"

Changes

  • indy_rewards/rob/distribution.py (new) — Core distribution logic. Iterates 480 periods, calls the analytics API for in-range redemption orders at each timestamp, groups by owner, sums lovelaceAmount, and distributes INDY pro-rata. Handles multiple positions per owner and skips periods with no in-range orders.
  • indy_rewards/analytics_api/raw.py — Added redemption_orders() endpoint calling /api/v1/rewards/redemption-orders with timestamp and in_range params
  • indy_rewards/time_utils.py — Added get_epoch_start_date() (returns end of previous epoch)
  • indy_rewards/config.py — Added ROB_EPOCH_INDY per-iAsset configuration
  • indy_rewards/cli.py — New rob command with --pkh and --outfile support; updated all and summary commands to include ROB
  • indy_rewards/summary.py — Added rob_indy parameter to get_epoch_all_rewards() and get_day_all_rewards(); added "ROB reward for " handling in _split_purpose()
  • tests/test_summary.py — Added ROB mock to existing test fixture to prevent real API calls
  • README.md — Added ROB usage examples and updated all command description

Test plan

  • Run existing test suite: pytest tests/ — all 53 tests pass, no regressions
  • Manually test indy-rewards rob 608 against a completed epoch
  • Verify indy-rewards summary 608 shows ROB totals alongside SP/Gov
  • Verify indy-rewards all 608 includes ROB reward rows
  • Verify PKH filtering works: indy-rewards rob --pkh 608
  • Verify CSV output works: indy-rewards rob -o output.csv 608
  • Verify periods with no in-range orders are skipped (no INDY wasted)

@adacapo21 adacapo21 requested a review from codybutz January 30, 2026 14:35
@adacapo21 adacapo21 self-assigned this Jan 30, 2026
@adacapo21 adacapo21 merged commit fbe6754 into main Feb 5, 2026
2 of 3 checks passed
@adacapo21 adacapo21 deleted the aggelos/rob-incentives branch February 5, 2026 08:11
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.

2 participants