Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Borrow & round up division #70

Merged
merged 1 commit into from
Dec 13, 2022
Merged

Borrow & round up division #70

merged 1 commit into from
Dec 13, 2022

Conversation

grod220
Copy link
Contributor

@grod220 grod220 commented Dec 12, 2022

At the moment, when an account borrows from Red Bank, given the nature of integers, the amount they owe is rounded down to the nearest unit. While this likely is not an issue (gas expense to exploit is too high), we should err on rounding in favor of the pool and not the individual.

This also is consistent to how it's handled in Red Bank: https://github.com/mars-protocol/outposts/blob/master/contracts/red-bank/src/interest_rates.rs#L60-L70

@grod220 grod220 changed the title Round up division Borrow & round up division Dec 12, 2022
@piobab
Copy link
Contributor

piobab commented Dec 13, 2022

LGTM

@grod220 grod220 merged commit 7506d1c into master Dec 13, 2022
@grod220 grod220 deleted the ceil-ratio branch December 13, 2022 09:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants