Skip to content

feat: weight allocations by apy and headroom#535

Closed
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:feature/weighted-allocation-473
Closed

feat: weight allocations by apy and headroom#535
dangelo352 wants to merge 1 commit into
Commitlabs-Org:masterfrom
dangelo352:feature/weighted-allocation-473

Conversation

@dangelo352

Copy link
Copy Markdown

Summary

  • weight allocation within eligible risk buckets by apy * available_headroom with checked arithmetic
  • fall back to headroom-only weights when every eligible pool has zero APY
  • assign integer-division dust by largest fractional remainder, then spill capped shortfalls in registry order
  • preserve strategy bucket splits and capacity/inactive-pool invariants
  • add formula docs and benchmark coverage

Fixes #473

Tests

  • CARGO_TARGET_DIR=/tmp/commitlabs-weighted-allocation-target cargo test -p allocation_logic weighted -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-weighted-allocation-target cargo test -p allocation_logic allocate -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-weighted-allocation-target cargo test -p allocation_logic rebalance -- --nocapture
  • CARGO_TARGET_DIR=/tmp/commitlabs-weighted-allocation-bench-target cargo test -p allocation_logic --features benchmark benchmark_allocate -- --nocapture

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.

Add weighted-APY pool selection to allocation_logic::allocate

2 participants