Skip to content

program: isolation position init #1757

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

Open
wants to merge 31 commits into
base: crispheaney/rm-lp
Choose a base branch
from

Conversation

crispheaney
Copy link
Member

@crispheaney crispheaney commented Jul 20, 2025

No description provided.

Some(meets_margin_requirement) => meets_margin_requirement,
None => meets_settle_pnl_maintenance_margin_requirement(
Some(meets_margin_requirement) if !isolated_position_market_index.is_some() => meets_margin_requirement,
// TODO check margin for isolate position
Copy link
Member

Choose a reason for hiding this comment

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

need to redo margin check?

}

fn balance_type(&self) -> &SpotBalanceType {
&SpotBalanceType::Deposit
Copy link
Member

Choose a reason for hiding this comment

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

how does pnl settle if the position has negativepnl?

Copy link
Member

@wphan wphan Aug 1, 2025

Choose a reason for hiding this comment

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

oh i see, USDC gets deposited into the perp position, and that gets used as the margin for the perp position, and it's always a deposit never a borrow

total_withdraws_after,
market_index: spot_market_index,
explanation: DepositExplanation::None,
transfer_user: None,
Copy link
Member

Choose a reason for hiding this comment

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

are we planning on tracking isolated positions deposit/withdraws? might need something here

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.

3 participants