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

Feat/bypass liquidity check #30

Merged
merged 2 commits into from
Jun 4, 2024
Merged

Conversation

jackmellis
Copy link
Collaborator

@jackmellis jackmellis commented Jun 4, 2024

For some background, we currently have an issue with unstaking inventory where if there's no liquidity in the vault, we're unable to fetch a quote, but we need the quote data to actually handle the unstake (and determine if there are any fees or premiums to pay).
Unstaking inventory shouldn't care about whether there's enough liquidity or not, but all of the remaining quote logic that we actually need is too engrained in the quote system. The aim of this PR is to make it so we can grab all the quote data while specifying that we don't care whether there's actually enough liquidity for the buy/sell/swap action itself.

Commits:

feat(@nftx/trade): add option to soft fail out of amm quotes

By default if an amm quote fails or is invalid, it will throw an error
This commit adds the option to instead simply return an empty quote object

feat(@nftx/core): bypass liquidity check for vault buy/sell/swap

This commit adds a bypassLiquidityCheck parameter to the price and quote methods.
This allows us to get a quote for a trade without checking if there is enough liquidity,
and means we can still calculate premiums and vault fees for a trade.

By default if an amm quote fails or is invalid, it will throw an error
This commit adds the option to instead simply return an empty quote object
This commit adds a bypassLiquidityCheck parameter to the price and quote methods.
This allows us to get a quote for a trade without checking if there is enough liquidity,
and means we can still calculate premiums and vault fees for a trade.
@jackmellis jackmellis merged commit a739fe6 into main Jun 4, 2024
1 check passed
@jackmellis jackmellis deleted the feat/bypass-liquidity-check branch June 4, 2024 10:01
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