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
Composable flash loan implementation #70
Conversation
}; | ||
|
||
let flash_loan_amount_decimal = Decimal::from(flash_loan_amount); | ||
let (origination_fee, host_fee) = reserve |
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.
I chose to carry over the same fee options that exist for the existing flash loans, but we could change this.
@@ -40,5 +40,5 @@ crates=( | |||
|
|||
set -x | |||
for crate in "${crates[@]}"; do | |||
sed -i'' -e "s#\(${crate} = \"\)\(=\?\).*\(\"\)#\1\2$solana_ver\3#g" "${tomls[@]}" | |||
sed -E -i'' -e "s#(${crate} = \")(=?).*#\1\2${solana_ver}\"#" "${tomls[@]}" |
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.
I found this change upstream in solana-program-library
and it allows this script to work on Macs.
3177861
to
b6105df
Compare
b6105df
to
7160c00
Compare
af477f0
to
4e5719c
Compare
2ae3a83
to
78028d5
Compare
78028d5
to
beb1e47
Compare
93f1a66
to
fd289bf
Compare
fd289bf
to
a14e6b3
Compare
c6a0bdf
to
aff68d4
Compare
let token_program_id = next_account_info(account_info_iter)?; | ||
let clock = &Clock::from_account_info(next_account_info(account_info_iter)?)?; | ||
|
||
_refresh_reserve_interest(program_id, reserve_info, clock)?; |
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.
Note: Modified this to always refresh the reserve
} | ||
|
||
#[tokio::test] | ||
async fn end_to_end_with_flash_borrow() { |
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.
I added this end-to-end test which verifies that the reserve has been force refreshed during flash borrow.
ceb8087
to
9d95e1a
Compare
9d95e1a
to
74a8d17
Compare
1bc509e
to
f8de57a
Compare
@0xkiplet When deploy? |
sadly not a priority at the moment ping me on discord to chat |
Just checking on the progress here. Thanks! |
Even though pull request is still open, it looks like the functionality was delivered |
@unordered-set true yeh will clean this up |
A port of Hana's flash loan implementation into the Solend protocol. This is a proof of concept for adding this composable flash loan functionality.
For now only a single happy path test is written. More tests are needed.