Skip to content

chore: partial read for asset balances#129

Open
RoeeGross wants to merge 1 commit into
devfrom
RoeeGross/parital-reading-for-asset-balances
Open

chore: partial read for asset balances#129
RoeeGross wants to merge 1 commit into
devfrom
RoeeGross/parital-reading-for-asset-balances

Conversation

@RoeeGross

@RoeeGross RoeeGross commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Note

Introduce syscall-based partial read access for Option<AssetBalance> and switch get_synthetic_balance to use it for efficient balance retrieval.

  • Core types (core/types/position.cairo):
    • Add OptionAssetBalanceReadAccessTrait with syscall-based partial reads (read, is_some/is_none, get_balance, get_funding_index, get_version).
    • Define OptionAssetBalanceOffset enum with offset mapping for storage access.
    • Import low-level storage utilities to support direct field reads.
  • Positions component (core/components/positions/positions.cairo):
    • Refactor get_synthetic_balance to use OptionAssetBalanceReadAccessTrait::get_balance on the iterable map entry pointer instead of reading the full Option<AssetBalance>.
    • Update iterable map imports to include IterableMapTrait.

Written by Cursor Bugbot for commit ef5365e. This will update automatically on new commits. Configure here.


This change is Reviewable

@RoeeGross RoeeGross requested a review from remollemo November 19, 2025 09:48
@RoeeGross RoeeGross self-assigned this Nov 19, 2025
@RoeeGross RoeeGross force-pushed the RoeeGross/parital-reading-for-asset-balances branch from 86c720e to ddb1d9e Compare November 19, 2025 12:16

@MohammadNassar1 MohammadNassar1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MohammadNassar1 reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @remollemo)

@RoeeGross RoeeGross force-pushed the RoeeGross/parital-reading-for-asset-balances branch from ddb1d9e to ef5365e Compare November 20, 2025 10:31
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