Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Add slippage constraint to borrow instruction #3423

Merged
merged 14 commits into from
Aug 17, 2022
Merged

Add slippage constraint to borrow instruction #3423

merged 14 commits into from
Aug 17, 2022

Conversation

jmalcic
Copy link
Contributor

@jmalcic jmalcic commented Aug 3, 2022

This PR resolves #988 by adding a slippage constraint to the borrow instruction. As outlined in #1441 this only applies if the borrow is 100% of available borrowing power (u64::MAX).

@mergify mergify bot added the community Community contribution label Aug 3, 2022
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

The logic and tests look great! Let me know what you think about separating into two instructions. I know it's a bit more work, but it'll be much clearer for users

This reverts commit 3eba494.

# Conflicts:
#	token-lending/program/tests/borrow_obligation_liquidity.rs
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

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

Just a couple of little bits, then this is good to go!

@joncinque
Copy link
Contributor

And thanks also for this one, nice job!

@joncinque joncinque merged commit 8d88fb6 into solana-labs:master Aug 17, 2022
@jmalcic jmalcic deleted the add-slippage-constraint-to-borrows branch August 17, 2022 14:18
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lending: Add slippage constraint for borrow instruction
3 participants