Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

program: add deposit into spot market vault #1159

Merged
merged 19 commits into from
Jul 30, 2024

Conversation

crispheaney
Copy link
Member

No description provided.

@crispheaney crispheaney changed the base branch from master to crispheaney/token-22 July 25, 2024 20:56
pub state: Box<Account<'info, State>>,
#[account(mut)]
pub spot_market: AccountLoader<'info, SpotMarket>,
pub admin: Signer<'info>,
Copy link
Member

@0xbigz 0xbigz Jul 29, 2024

Choose a reason for hiding this comment

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

why does this need to be admin only?

.safe_mul(SPOT_CUMULATIVE_INTEREST_PRECISION)?
.safe_div(spot_market.deposit_balance)?
.safe_mul(SPOT_BALANCE_PRECISION)?
.safe_div(token_precision.cast()?)?;
Copy link
Member

Choose a reason for hiding this comment

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

maybe good to enforce things to avoid large int changes like:

  1. maximum deposit amounts (based on current cumulative_deposit_interest)

also check if max deposits is violated

@crispheaney crispheaney changed the base branch from crispheaney/token-22 to master July 30, 2024 17:40
@crispheaney crispheaney merged commit bf1d2be into master Jul 30, 2024
8 of 9 checks passed
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