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

Move fee_receiver address to the Reserve Config #23

Merged
merged 1 commit into from
Jul 30, 2021
Merged

Conversation

DaSichuan
Copy link

Moves the fee receiver from the ReserveLiquidity struct to the ReserveConfig struct
so that it can be modified by the update-reserve-config command, and because it
makes more sense for it to be there.

@DaSichuan
Copy link
Author

DaSichuan commented Jul 27, 2021

Tbh this is a pretty ugly change. Some parts of the code are pretty annoying. For example,
there are functions that take in the ReserveConfig as a param (which holds the fee receiver pubkey), but also need the fee receiver Keypair (to create the fee receiver account), so that gets passed into the function as well, so the reserve pubkey is sort of passed in twice, which is pretty annoying. Maybe theres a nicer way to do this that I'm missing?

Also I think we'll need to change some front end deserialization code since I changed where the fee receiver address lives to keep things logically grouped together.

@@ -592,6 +603,8 @@ fn main() {
let borrow_fee_wad = (borrow_fee * WAD as f64) as u64;
let flash_loan_fee_wad = (flash_loan_fee * WAD as f64) as u64;

let liquidity_fee_receiver_keypair = Keypair::new();
Copy link
Member

Choose a reason for hiding this comment

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

this seems wrong shouldn't it be the thing you passed in?

Copy link
Author

Choose a reason for hiding this comment

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

For adding a new reserve, we just make a new one, because we also just make the fee receiver account. in this command.
The thing passed in is for updating the reserve

@DaSichuan DaSichuan merged commit dc0af8b into staging Jul 30, 2021
@DaSichuan DaSichuan deleted the fee_receiver branch July 30, 2021 19:43
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