Conversation
gitshreevatsa
left a comment
There was a problem hiding this comment.
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.
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.
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