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

program: add liquidation via fill #1106

Merged
merged 17 commits into from
Jul 30, 2024
Merged

Conversation

crispheaney
Copy link
Member

@crispheaney crispheaney commented Jun 19, 2024

todos:

  • [x ] sdk fn
  • cargo test
  • anchor test
  • program allows amm to fill

makers_and_referrer_stats,
slot,
)?;
// no referrer bonus for liquidations
Copy link
Member

Choose a reason for hiding this comment

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

👍

market_index,
existing_direction,
base_asset_amount,
oracle_price,
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible for this exhibit some auction behavior instead of deriving an order based on oracle_price? Something like "if the user has been in liquidation for x slots, make the order more aggressive by y bps (or in price terms)"

Calculating the effective liq price on oracle_price + liquidator_fee has the downside of favoring short liqs (buy to close) when oracle_price > drift_mark and favoring long liqs when oracle_price < drift_mark. Which is most problematic if all makers and the AMM are quoting wider (or AMM is unavailable) than oracle_price + liquidator_fee.

Copy link
Member

Choose a reason for hiding this comment

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

think this is a good follow up todo after merging this version

@crispheaney crispheaney merged commit a259778 into master Jul 30, 2024
10 of 11 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.

3 participants