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

Update solend v2 upcoming #2

Merged
merged 30 commits into from
Apr 11, 2023
Merged

Conversation

codewithgun
Copy link

No description provided.

nope-finance and others added 30 commits May 24, 2022 15:56
* high rate map

* prop test exception
* started take rate

cleaning up all the boilerplate adding reserve config take rate

claim fees

config check + fixing/adding tests

fix comment in instruction.rs

fixed tests for native token and added pr feedback

properly keeping track of availible amount when redeeming fees

add in fees when compounding

try other method

* change to accumulating and redeem when can also added staleness checks

* fixed tests

* cleanup
* sliding down borrow limit and 1 percent close factor

* fix tests

* final dates set
…olana-labs#88)

* only redeem as much collateral as liquidity allows

* added test for where not enough liquidity to fully redeem and liquidation

* ignore redeem if no collateral to withdraw

* rebase and fix tests
…olana-labs#92)

* undo borrow limit and close factor change, but keep caps on borrow limits

* fml changed the wrong variable

* add new liquidation value cap
* test coverage github action

* move actions to another job

* moving stuff around

* grr

* artifact error

* try cobertura format with codecov

* add decimal test

* formatting

* tests for decimal

* rate tests

* format

* tests for calculate liquidation
…olana-labs#100)

* turn on liquidation fees and deprecate old liquidation instruction

* fix tests

* clippy
* bump t o 1.9.18

* Solve clippy warnings after bump update

* bump solana version in script

* fixing various warnings

* fix all clippy warnings in the tests

* fmt

Co-authored-by: Andrei Hrs <andrei_hristescu@yahoo.com>
* copying kiplet's code

* make flash loans more conservative

* happy case test

* adding more tests, fixed a bug

* moar tests

* clippy lints

* fix assert

* remove clock

* remove old flash loan instruction, but keep the instruction packing code

* saner flash loan fee calculation

* add flash borrow ix arg to flash repay

* cargo fmt

* add cpi repay test

* bump compute units, no idea why github actions is failing

* test for malicious use case

* remove unused variable

* fix coverage, check reserve borrow limit in flash borrow

* mark reserves as stale in flash borrow and repay

* revert back to old nightly version, install grcov with stable

* fix for [repay, borrow, repay]

* refactor CPI

* recheck stuff in flash repay

* explicitly check for out of bounds in flash borrow loop

* 0xripleys remove clock (solana-labs#99)

* make clock sysvar optional

* remove clock from instructions

* add stack height check

* fmt
solana-labs#101)

* make cli update only update if actually changing something and add anchor.toml

* fix clippy
Issue: As in description `WithdrawObligationCollateralAndRedeemReserveCollateral` combines `WithdrawObligationCollateral` and `RedeemReserveCollateral`. While `obligation_owner` in `WithdrawObligationCollateral` is readonly, it is writable in `WithdrawObligationCollateralAndRedeemReserveCollateral` is writable. 

Solution: Update `obligation_owner` readonly in `WithdrawObligationCollateralAndRedeemReserveCollateral`
* oallow passing just pyth to save bytes

* fixing to check that there is a next account and 1 other check

* use option instead

* added a test
* kinda working cli liquidation

* dynamically create atas if they don't exist

* adding compute budget request

* fix clippy

* liquidate scripts

* withdraw ctokens command

* add redeem reserve collateral function
* (rfc) bump solana version to 1.14

* fix build

* remove flag

* update solana version

* fix clippy

* fix clippy

* pin serde version
- use Reserve, LendingMarket, Obligation types directly instead of TestReserve, TestLendingMarket, TestObligation
- more helper functions
- check account state after every successful program call
- check _all_ token accounts and mint accounts after every successful program call
* 0xripleys outflow limits (solana-labs#125)

Use a sliding window rate limiter to limit borrows and withdraws at the lending pool owner's discretion.

* 0xripleys borrow coefficient (solana-labs#127)

Add a borrow weight to the Reserve

* Two Prices PR (solana-labs#129)

- Add a smoothed_market_price to Reserve that is used to limit borrows and withdraws in cases where smoothed price and spot price diverge.
- allowed_borrow_value now uses the min(smoothed_market_price, current spot price)
- new field on obligation called borrowed_value_upper_bound that uses max(smoothed_market_price, current spot price)

* audit nits

* audit fixes pt 2

* disable rate limiter if window duration == 0

* cli changes for v2.0.1 (solana-labs#133)
* div by zero fix

* fmt

* use cur slot instead of 0
@codewithgun codewithgun merged commit 0430a4b into solend-protocol Apr 11, 2023
@codewithgun codewithgun deleted the update-solend-v2-upcoming branch April 11, 2023 11:45
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.

4 participants