-
Notifications
You must be signed in to change notification settings - Fork 45
Feat/cross-shard-lending #650
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
base: main
Are you sure you want to change the base?
Conversation
gitshreevatsa
left a comment
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.
Thanks for opening the PR, there are some changes that have to be addressed.
gitshreevatsa
left a comment
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.
Please use rebasing, instead of merges. You can check how to do it here
b0e8a84 to
e21535a
Compare
|
Hey! Your implementation is very good. I tried to test the code. During borrowing, I don't see a change in the balance of the account 1. It stays the same before and after the borrow. Can you please check that once? |
gitshreevatsa
left a comment
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.
This implementation has the GlobalLedger as the owner/storage of funds and lending pool acting as proxies for interacting. The previous implementation was more accurate to the issue. I understahnd you had an issue of Cross shard transfer failure due to token balance. As discussed in the offfice hours, please change it to previous implementation and update it in the PR. I will take a look at why it is failing.
|
@gitshreevatsa @Supa-mega What is the status? Can we proceed with this patch or should close? |
Cross-Shard Liquidity Borrowing Implementation
Overview
This PR implements cross-shard liquidity borrowing functionality in the lending protocol example, allowing users to borrow tokens from lending pools across different shards when their local shard has insufficient liquidity.
Key Changes
Technical Implementation Details
Lending Pool Registration
registerLendingPool()function to register lending pools from different shardsCross-Shard Liquidity Management
checkCrossShardLiquidity()to query available liquidity across shardshandleLiquidityCheck()to process responses from liquidity queriestransferCrossShardLiquidity()to handle token transfers between shardsgetTokenBalance()utility function for querying pool balancesEnhanced Borrowing Flow
borrow()function to check local liquidity first, then query other shardsTesting
Security Considerations
Documentation
Related Issues
Closes #611