Multiple Collateral Types & Cross-Asset Operations Testing#165
Open
UlyanaAndrukhiv wants to merge 14 commits intomainfrom
Open
Multiple Collateral Types & Cross-Asset Operations Testing#165UlyanaAndrukhiv wants to merge 14 commits intomainfrom
UlyanaAndrukhiv wants to merge 14 commits intomainfrom
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
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.
Closes: #148
Description
Adds comprehensive test coverage for positions using multiple collateral types and cross-asset borrowing.
Tests added (
fork_multi_collateral_position_test.cdc)test_multi_collateral_position—FLOW+USDF+WETHcollateral; weighted health calculation and max borrow capacitytest_cross_asset_flow_to_usdf_borrowing— depositFLOW, borrowUSDFtest_cross_asset_flow_usdf_weth_borrowing—FLOW→USDF→WETHchain; netting when borrowing same token held as collateraltest_cross_asset_chain— four-asset pathFLOW→USDF→WETH→WBTC, intermediate assets net to zerotest_multi_asset_uncorrelated_price_movements—FLOWprice +10%,USDFprice -5%,WETHprice +20% simultaneouslytest_multi_asset_partial_withdrawal— partial withdrawal from multi-asset position; verifies remaining balancestest_cross_collateral_borrowing_capacity— borrowing same token as collateral caps at credit amount; different token uses health-based formulatest_multi_asset_liquidation_collateral_selection— 3 collateral types + 2 debt types; liquidator selects which collateral to seizetest_multi_asset_complex_workflow— full lifecycle with price change and auto-rebalance; verifies exact MOET pushed to drawDownSink and health restored to target healthRefactoring
manualLiquidation,setupGenericVault,transferFungibleTokensand updatedcreatePosition,borrowFromPositiontest helperscreate_and_store_pool.cdctotests/transactions/folder cause pool setup depends on both mocks