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

Add anchor-build action #4119

Closed
wants to merge 129 commits into from
Closed

Conversation

DaSichuan
Copy link

nope-finance and others added 30 commits June 26, 2021 00:44
Add function to deposit reserve liquidity and collateral
Refresh reserve in between depositing liquidity and depositing collateral
Fix instruction comment for depositing liquidity
clean instructions account numbering
Add testing and instruction utils for combined deposit function
Merge WithdrawObligationCollateral and RedeemReserveCollateral
Add instruction to update reserve configs
Reserve Deposit Limit Implementation
nope-finance and others added 26 commits June 9, 2022 18:10
* 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
)

* 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
…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
)

* 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 (#99)

* make clock sysvar optional

* remove clock from instructions

* add stack height check

* fmt
#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 (#125)

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

* 0xripleys borrow coefficient (#127)

Add a borrow weight to the Reserve

* Two Prices PR (#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 (#133)
* div by zero fix

* fmt

* use cur slot instead of 0
@mergify mergify bot added the community Community contribution label Apr 14, 2023
@DaSichuan DaSichuan closed this Apr 14, 2023
@DaSichuan DaSichuan deleted the ds_build branch April 14, 2023 04:38
@DaSichuan DaSichuan restored the ds_build branch April 14, 2023 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants