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

sdk: fix liq price issue #522

Merged
merged 5 commits into from
Jul 19, 2023
Merged

sdk: fix liq price issue #522

merged 5 commits into from
Jul 19, 2023

Conversation

lowkeynicc
Copy link
Contributor

No description provided.

sdk/src/user.ts Outdated
@@ -318,7 +318,8 @@ export class User {
*/
public getPerpPositionWithLPSettle(
marketIndex: number,
originalPosition?: PerpPosition
originalPosition?: PerpPosition,
withWeightMarginCategory = undefined
Copy link
Member

Choose a reason for hiding this comment

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

why does withWeightMarginCategory cause the dust value to be added? why doesn't it always get added?

Copy link
Member

Choose a reason for hiding this comment

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

think if you dont use a weighting, it means you just want to see net usd value

so in that case you havent really lost anything unless you decide to remove shares

Copy link
Member

Choose a reason for hiding this comment

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

could we change it to just be burnLpShares or s.t. and cast it as a boolean? withWeightMarginCategory typically means we just weight the usd value, but it's different here

Copy link
Member

Choose a reason for hiding this comment

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

sure

@crispheaney crispheaney merged commit b9b2920 into master Jul 19, 2023
0xbigz added a commit that referenced this pull request Jul 24, 2023
* 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 added a commit that referenced this pull request Jul 31, 2023
…s 100% (#525)

* bigz/update-spot-tvl-invariant-check

* loosen check in update_spot_balances

* add tests/spotWithdrawUtil100.ts

* in fill spot order, account for tvl leaving system

* test for fulfill_spot_order_with_match with max utilization

* more debugging for test

* sdk: fix bug in transfer account creation (#532)

* sdk: release v2.34.1-beta.5

* sdk: event subscriber avoids web3.js to get performance boost (#542)

* sdk: create rpc method to get transactions to avoid some web3.js overhead

* sdk: custom parse logs logic

* sdk: release v2.34.1-beta.6

* sdk: remove extra console.log in fetchLogs

* sdk: release v2.34.1-beta.7

* program: add post only slide for perps (#541)

* program: add post only slide for perps

* tests

* add to ts types

* CHANGELOG

* sdk: release v2.34.1-beta.8

* program: add cancel_orders_by_ids (#540)

* program: add cancelOrdersByIds

* CHANGELOG

* sdk: release v2.34.1-beta.9

* v2.35.0

* sdk: release v2.35.1-beta.0

* sdk: fixes for lp (liq price and lp share burn) (#522)

* 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]>

* sdk: release v2.35.1-beta.1

* intermediate testing

* more test progress

* CHANGELOG fix

* fix use of is_leaving_drift

* more consistent naming

* more consistent naming

* revert test change

* CHANGELOG

---------

Co-authored-by: Chris Heaney <[email protected]>
Co-authored-by: Evan Pipta <[email protected]>
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: lowkeynicc <[email protected]>
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