-
Notifications
You must be signed in to change notification settings - Fork 7
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
Pool Gulp #31
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks good, comments mostly about docs / variable names
pool/src/emissions/distributor.rs
Outdated
@@ -145,7 +145,7 @@ fn claim_emissions( | |||
/// | |||
/// ### Panics | |||
/// If the reserve update failed | |||
pub(super) fn update_emission_data( | |||
pub fn update_emission_data( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can remain pub(super)
pool/src/pool/gulp.rs
Outdated
|
||
#[cfg(test)] | ||
mod tests { | ||
use std::println; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused import
pool/src/contract.rs
Outdated
/// Updates the reserve's B token supply to match the pool's asset balance | ||
/// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a bit more color to this comment?
/// Update the reserve's bToken rate based on the pool's balance. This is useful for tokens where
/// a holder's balance can increase outside of a direct transfer.
pool/src/events.rs
Outdated
@@ -274,6 +274,20 @@ impl PoolEvents { | |||
e.events().publish(topics, (tokens_in, d_tokens_burnt)); | |||
} | |||
|
|||
/// Emitted when a reserve updates its supply to its token balance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updates its bToken rate.
pool/src/pool/reserve.rs
Outdated
@@ -128,6 +113,26 @@ impl Reserve { | |||
storage::set_res_data(e, &self.asset, &reserve_data); | |||
} | |||
|
|||
/// Update the reserve's b_rate and the pool's backstop rate based on the difference in the pools token balance and the reserves stored balance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit confusing, how about:
Accrue tokens to the reserve supply. This issues any `backstop_credit` required and updates the reserve's bRate to account for the additional tokens.
### Arguments
* bstop_rate - The backstop take rate for the pool
* accrued - The amount of additional underlying tokens
Implements Add "gulp" function #27