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

bigz/update-spot-tvl-invariant-check #525

Merged
merged 34 commits into from
Jul 31, 2023

Conversation

0xbigz
Copy link
Member

@0xbigz 0xbigz commented Jul 7, 2023

todo

add more tests for transfers/withdraw invariants

@0xbigz 0xbigz marked this pull request as ready for review July 12, 2023 16:16
Copy link
Member

@crispheaney crispheaney left a comment

Choose a reason for hiding this comment

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

are there any cargo tests we wanna write for this?

@@ -129,7 +129,12 @@ pub fn settle_pnl(
user_unsettled_pnl,
now,
)?;

crate::dlog!(
Copy link
Member

Choose a reason for hiding this comment

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

would be nice to remove if not intentional

@@ -252,7 +252,7 @@ pub fn update_spot_balances(
}
}

if let SpotBalanceType::Borrow = update_direction {
if force_round_up && update_direction == &SpotBalanceType::Borrow {
Copy link
Member

Choose a reason for hiding this comment

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

should we change the name for force_round_up to better capture when it should be on/off?

Copy link
Member

Choose a reason for hiding this comment

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

dont we need to change fulfill_with_external_market for spot to use this?

depositors_amount,
borrowers_amount
)?;
// validate!(
Copy link
Member

Choose a reason for hiding this comment

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

delete

crispheaney and others added 23 commits July 20, 2023 11:14
* sdk: create rpc method to get transactions to avoid some web3.js overhead

* sdk: custom parse logs logic
* program: add post only slide for perps

* tests

* add to ts types

* CHANGELOG
* program: add cancelOrdersByIds

* CHANGELOG
* sdk: fix liq price issue

* incorp getPerpPositionWithLPSettle across sdk/margin calc properly

* rename burnLpShares, in getPerpPositionWithLPSettle

* CHANGELOG

---------

Co-authored-by: 0xbigz <[email protected]>
Co-authored-by: Chris Heaney <[email protected]>
@crispheaney crispheaney merged commit 20f8f99 into master Jul 31, 2023
7 of 8 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.

None yet

4 participants