Skip to content

Conversation

@DeVikingMark
Copy link

Short Summary

Implements cross-shard liquidity borrowing functionality allowing users to borrow tokens from lending pools across different shards when their local shard has insufficient liquidity.

What Changes Were Made

  • Added lending pool deployment across all 4 shards instead of single shard
  • Implemented cross-shard liquidity checking mechanism to query available funds across shards
  • Added checkLiquidity() function for inter-shard liquidity verification
  • Added transferToBorrower() function for cross-shard token transfers
  • Implemented registerLendingPools() to establish cross-shard communication
  • Updated lending flow to automatically fallback to cross-shard borrowing when local liquidity is insufficient
  • Modified deployment script to deploy and register lending pools across all shards
  • Added recursive shard checking logic with proper context handling for async callbacks

Related Issue

Fixes #611

Breaking Changes (if any)

None. The changes are backward compatible and extend existing functionality.

Screenshots / Visual Changes

N/A - Backend smart contract functionality only.

Checklist

  • I have read and followed the Contributing Guide
  • I have tested the changes locally
  • I have added relevant tests (if applicable)
  • I have updated documentation/comments (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[academy] Implement a cross shard liquidity borrowing in the lending protocol example

1 participant