-
Notifications
You must be signed in to change notification settings - Fork 5
Clear supply position after withdrawal execution #29
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
Merged
peer2f00l
merged 2 commits into
dev/fresh_start
from
26-supply-position-not-updated-after-withdrawal-execution
Mar 3, 2025
Merged
Clear supply position after withdrawal execution #29
peer2f00l
merged 2 commits into
dev/fresh_start
from
26-supply-position-not-updated-after-withdrawal-execution
Mar 3, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
peer2f00l
added a commit
that referenced
this pull request
Mar 7, 2025
* withdrawal queue maybe working? * remove internal balance accounting, move some withdrawal queue logic * happy path test expansion * better tests * distribute rewards * use custom units for all asset operations * rename: rewards -> yield * improves yieldweights semantics * yield withdrawal * withdrawals + tests * addressing some comments from review * Start implementing maximum borrow asset usage ratio: - Everything is async, so we have to implement some asset locking (`borrow_asset_in_flight`, not yet implemented) - Some updates to requesting current balance: let's just go with making everything a return value. - Will also need to implement borrow record locking. * implements global borrow_asset_in_flight * locking half done, checkpoint to try in-flight approach * feat: partial balance locking on balance records completed * chore: tests for maximum_borrow_asset_usage_ratio * chore: few docs * feat: max duration * feat: borrow limits * chore: small renames + reorg * feat: liquidation + some tests * chore: more liquidation tests * chore: removes authorized liquidation * chore: liquidation spread tests * chore: remove debug logs * chore: resync with template * chore: adds clippy * chore: update gh action to run init method * chore: nextest + skip tests during actions testing * chore: fix after merge * chore: remove master account from testnet config * fix: maybe moving near-sdk unit-testing feature to dev-dependencies fixes docker build issue * chore: unused; maybe causing docker build issue? * fix: better conditions for init call and account creation * fix: exit code 1 is intentional here * chore: reenable testing * feat: reuse builds * chore: upgrade near cli version in ci * chore: fixing up native endpoints (#23) * Use a custom decimal representation (#28) * trying out bigdecimal * feat: custom decimal * chore: rm old files * chore: better string epsilon; tests * chore: add ceil and floor u128 fns * fix: broken withdrawal queue test * chore: reorganize * fix: update some paths * chore: trim trailing zeroes on decimal stringification * Clear supply position after withdrawal execution (#29) * fix: contract building + add test for supply position clearing * fix: write supply position back * fix: gh actions, cd to contract dir * Use Vector instead of TreeMap for yield calculations (#30) * feat: reduced gas usage attempt - Use a Vector with binary search instead of TreeMap. While the binary search is probably a little bit more expensive at first, subsequent element accesses should be a bit cheaper. Also, lower insertion complexity. - Epoch-based accounting for yield distribution rather than block-based. * chore: update more items to epoch accounting * fix: some zero cases * chore: chain time, using block height * chore: harvest yield gas check * Implement minimum initial collateral ratio (#31) * chore: minimum initial plus tests * fix: root dir without realpath * fix: install cargo near before tests * chore: minimum initial collateral ratio tests --------- Co-authored-by: peer2 <peer2@templarprotocol.com>
peer2f00l
added a commit
that referenced
this pull request
Mar 10, 2025
* withdrawal queue maybe working? * remove internal balance accounting, move some withdrawal queue logic * happy path test expansion * better tests * distribute rewards * use custom units for all asset operations * rename: rewards -> yield * improves yieldweights semantics * yield withdrawal * withdrawals + tests * addressing some comments from review * Start implementing maximum borrow asset usage ratio: - Everything is async, so we have to implement some asset locking (`borrow_asset_in_flight`, not yet implemented) - Some updates to requesting current balance: let's just go with making everything a return value. - Will also need to implement borrow record locking. * implements global borrow_asset_in_flight * locking half done, checkpoint to try in-flight approach * feat: partial balance locking on balance records completed * chore: tests for maximum_borrow_asset_usage_ratio * chore: few docs * feat: max duration * feat: borrow limits * chore: small renames + reorg * feat: liquidation + some tests * chore: more liquidation tests * chore: removes authorized liquidation * chore: liquidation spread tests * chore: remove debug logs * chore: resync with template * chore: adds clippy * chore: update gh action to run init method * chore: nextest + skip tests during actions testing * chore: fix after merge * chore: remove master account from testnet config * fix: maybe moving near-sdk unit-testing feature to dev-dependencies fixes docker build issue * chore: unused; maybe causing docker build issue? * fix: better conditions for init call and account creation * fix: exit code 1 is intentional here * chore: reenable testing * feat: reuse builds * chore: upgrade near cli version in ci * chore: fixing up native endpoints (#23) * Use a custom decimal representation (#28) * trying out bigdecimal * feat: custom decimal * chore: rm old files * chore: better string epsilon; tests * chore: add ceil and floor u128 fns * fix: broken withdrawal queue test * chore: reorganize * fix: update some paths * chore: trim trailing zeroes on decimal stringification * Clear supply position after withdrawal execution (#29) * fix: contract building + add test for supply position clearing * fix: write supply position back * fix: gh actions, cd to contract dir * Use Vector instead of TreeMap for yield calculations (#30) * feat: reduced gas usage attempt - Use a Vector with binary search instead of TreeMap. While the binary search is probably a little bit more expensive at first, subsequent element accesses should be a bit cheaper. Also, lower insertion complexity. - Epoch-based accounting for yield distribution rather than block-based. * chore: update more items to epoch accounting * fix: some zero cases * chore: chain time, using block height * chore: harvest yield gas check * Implement minimum initial collateral ratio (#31) * chore: minimum initial plus tests * fix: root dir without realpath * fix: install cargo near before tests * chore: minimum initial collateral ratio tests * feat: interest rate strategy * chore: Decimal +Copy, adds Linear IRS * chore: irs helper methods, fixing errors * feat: adds total asset borrowed tracking * feat: much simpler logs processing * fix: only subtract principal from borrowed accounting * chore: use store::Vector instead of collections::Vector for logs * chore: interest tests and many related bugfixes * chore: tests fixed * chore: remove balance_log.rs * chore: rename log -> snapshot * feat: adds get_last_interest_rate fn * feat: adds get_last_yield_rate fn * fix: broken test * chore: normalize and test asset accumulators for both yield and interest * chore: cleanup * feat: refund on over-repayment * fix: divzero issue * chore: cleanup some tests * fix: some div0s
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.