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

Add get_utilization_ratio to rust sdk #46

Open
DannyDelott opened this issue Mar 20, 2024 · 0 comments
Open

Add get_utilization_ratio to rust sdk #46

DannyDelott opened this issue Mar 20, 2024 · 0 comments

Comments

@DannyDelott
Copy link
Contributor

LPs want to know their ratio of idle capital to capital that is being used to back open positions. The calculation for this current lives in React and looks something like this:

// pseudo code
// grab the number of withdrawal shares received from a preview max remove liquidity call.
const { proceeds: unusedProceeds, withdrawalShares } = previewRemoveLp(balanceOfLpShares);
const utilizationRatio = (withdrawalShares / balanceOfLpShares) * 100;

https://github.com/delvtech/hyperdrive-frontend/blob/48280bb6a12528b11e17c45612fc1fdab3cdd4c2/apps/hyperdrive-trading/src/ui/hyperdrive/lp/hooks/useUtilizationRatio.ts#L7

@cashd cashd assigned cashd and unassigned cashd Mar 28, 2024
@ryangoree ryangoree transferred this issue from delvtech/hyperdrive May 1, 2024
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

No branches or pull requests

2 participants