Skip to content

chore(multi-collateral): add time tick and apply interest abis#180

Merged
MohammadNassar1 merged 1 commit intodevfrom
mohammad/spec-update
Jan 14, 2026
Merged

chore(multi-collateral): add time tick and apply interest abis#180
MohammadNassar1 merged 1 commit intodevfrom
mohammad/spec-update

Conversation

@MohammadNassar1
Copy link
Collaborator

@MohammadNassar1 MohammadNassar1 commented Dec 30, 2025

Note

Adds core primitives for interest application and time management, updating storage, events, and multiple flows.

  • Introduces update_system_time (Time Tick) with monotonic checks; adds system_time to storage and TimeTick event; constructor initializes it
  • Adds apply_interests to batch-apply interest to positions; emits InterestApplied
  • Threads interest handling through flows: process_deposit, withdraw, transfer (sender/receiver amounts), trade, liquidate, deleverage, reduce_asset_position, redeem_from_vault, liquidate_vault_shares, invest_in_vault
  • Extends events and args to carry interest amounts: DepositProcessed, Transfer, AssetPositionReduced, vault-related functions; adds range validations and timestamp updates where interest is applied
  • Clarifies Position storage note on initial interest update behavior

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


This change is Reviewable

Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

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

@odednaor made 1 comment.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ishay-starkware and @MohammadNassar1).


docs/spec.md line 3360 at r1 (raw file):

6. Initialize forced action timelock with `forced_action_timelock`.
7. Initialize premium cost with `premium_cost`.
8. Initialize last system time to zero.

I suggest initializing it to the current block time.

Code quote:

Initialize last system time to zero.

Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

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

@odednaor made 1 comment.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ishay-starkware and @MohammadNassar1).


docs/spec.md line 3736 at r1 (raw file):

**Logic:**

1. Run validations

We still don't know if need to perform a health check or not.

Copy link
Collaborator Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

@MohammadNassar1 made 2 comments.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ishay-starkware and @odednaor).


docs/spec.md line 3360 at r1 (raw file):

Previously, odednaor wrote…

I suggest initializing it to the current block time.

Done.


docs/spec.md line 3736 at r1 (raw file):

Previously, odednaor wrote…

We still don't know if need to perform a health check or not.

Added a TODO.

@github-actions github-actions bot force-pushed the mohammad/spec-update branch 2 times, most recently from aa29588 to 0515883 Compare December 30, 2025 15:48
@github-actions github-actions bot force-pushed the mohammad/spec-update branch from 9c6c7fd to 0d0999e Compare January 1, 2026 09:02
Copy link
Collaborator

@ishay-starkware ishay-starkware left a comment

Choose a reason for hiding this comment

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

@ishay-starkware reviewed all commit messages and made 1 comment.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @MohammadNassar1 and @odednaor).


docs/spec.md line 3717 at r2 (raw file):

    ref self: ContractState,
    operator_nonce: u64,
    position_id: PositionId,

Let's do a list of positions?

Copy link
Collaborator Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

@MohammadNassar1 made 1 comment.
Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @ishay-starkware, @MohammadNassar1, and @odednaor).


docs/spec.md line 3717 at r2 (raw file):

Previously, ishay-starkware wrote…

Let's do a list of positions?

Done.

Copy link
Collaborator

@odednaor odednaor left a comment

Choose a reason for hiding this comment

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

@odednaor resolved 2 discussions.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ishay-starkware and @MohammadNassar1).

@github-actions github-actions bot force-pushed the mohammad/spec-update branch from e51c739 to 95f6b8f Compare January 6, 2026 11:19
@github-actions github-actions bot force-pushed the mohammad/spec-update branch from 95f6b8f to da677a4 Compare January 14, 2026 08:31
@github-actions github-actions bot force-pushed the mohammad/spec-update branch from da677a4 to 1dec30c Compare January 14, 2026 12:18
@MohammadNassar1 MohammadNassar1 force-pushed the mohammad/spec-update branch 2 times, most recently from 8bf966e to a13db2f Compare January 14, 2026 12:34
@github-actions github-actions bot force-pushed the mohammad/spec-update branch from a13db2f to 559a56b Compare January 14, 2026 12:35
Copy link
Collaborator Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

@MohammadNassar1 resolved 2 discussions.
Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ishay-starkware and @RoeeGross).

Copy link
Collaborator Author

@MohammadNassar1 MohammadNassar1 left a comment

Choose a reason for hiding this comment

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

@MohammadNassar1 resolved 1 discussion.
Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @ishay-starkware and @RoeeGross).

Copy link
Collaborator

@RoeeGross RoeeGross left a comment

Choose a reason for hiding this comment

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

@RoeeGross reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ishay-starkware).

Copy link
Collaborator

@ishay-starkware ishay-starkware left a comment

Choose a reason for hiding this comment

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

@ishay-starkware reviewed 1 file and all commit messages, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MohammadNassar1).

@MohammadNassar1 MohammadNassar1 merged commit ee8347e into dev Jan 14, 2026
4 checks passed
@MohammadNassar1 MohammadNassar1 deleted the mohammad/spec-update branch January 14, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants