Skip to content

feat: export computeTargetBalances and prod-network for yds consumption#12679

Open
samsiegart wants to merge 1 commit into
masterfrom
sam/ago-573-make-computeweightedtargets-and-prod-networkts-quickly
Open

feat: export computeTargetBalances and prod-network for yds consumption#12679
samsiegart wants to merge 1 commit into
masterfrom
sam/ago-573-make-computeweightedtargets-and-prod-networkts-quickly

Conversation

@samsiegart
Copy link
Copy Markdown
Contributor

@samsiegart samsiegart commented May 21, 2026

fixes https://linear.app/agoric/issue/AGO-573/make-computeweightedtargets-and-prod-networkts-quickly-consumable-from

Summary

Implements AGO-573 by making the YMax target-balance logic and production network spec consumable outside this repo.

  • Extracts computeWeightedTargets from services/ymax-planner into @agoric/portfolio-api as computeTargetBalances
  • Moves prod-network.ts / network-spec.ts into @agoric/portfolio-api/src/network
  • Keeps packages/portfolio-contract/tools/network/prod-network.ts as a compatibility re-export
  • Adds packages/portfolio-contract/tools/target-balances.ts as a compatibility re-export
  • Updates internal consumers to import from @agoric/portfolio-api
  • Adds README notes for how YDS should consume the API next

Reviewer Notes

Most of the large diff is moved code, not new behavior:

  • prod-network.ts is copied from portfolio-contract/tools/network into portfolio-api/src/network
  • network-spec.ts is copied with import/type-source cleanup
  • computeTargetBalances is the former computeWeightedTargets, adapted from a planner-private helper into an exported API

The old behavior coverage remains in services/ymax-planner/test/deposit-tools.test.ts

@samsiegart samsiegart force-pushed the sam/ago-573-make-computeweightedtargets-and-prod-networkts-quickly branch from 3e40e08 to e86efd4 Compare May 22, 2026 20:50
@samsiegart samsiegart changed the title feat!: export computeTargetBalances and prod-network for yds consumption feat: export computeTargetBalances and prod-network for yds consumption May 22, 2026
@samsiegart samsiegart force-pushed the sam/ago-573-make-computeweightedtargets-and-prod-networkts-quickly branch from e86efd4 to aecd780 Compare May 22, 2026 21:12
@samsiegart samsiegart force-pushed the sam/ago-573-make-computeweightedtargets-and-prod-networkts-quickly branch from aecd780 to e3aef62 Compare May 22, 2026 21:27
@samsiegart samsiegart marked this pull request as ready for review May 22, 2026 21:32
@samsiegart samsiegart requested a review from gibson042 May 22, 2026 21:32
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.

1 participant