fix: resolve #455 #296 #355 #352 in contracts and backend indexer#704
Merged
ogazboiz merged 2 commits intoLabsCrypt:mainfrom Apr 26, 2026
Merged
fix: resolve #455 #296 #355 #352 in contracts and backend indexer#704ogazboiz merged 2 commits intoLabsCrypt:mainfrom
ogazboiz merged 2 commits intoLabsCrypt:mainfrom
Conversation
…dex/fix-455-296-355-352 # Conflicts: # contracts/lending_pool/src/lib.rs # contracts/loan_manager/src/lib.rs
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.
Description
This PR bundles fixes for loan approval liquidity accounting, lending pool share pricing query exposure, and backend multi-contract event indexing so pool/portfolio views stay accurate.
Closes #455
Closes #296
Closes #355
Closes #352
Changes proposed
What were you told to do?
Implement and submit one PR that addresses four open issues: the loan-manager outstanding liquidity check, RemittanceNFT cooldown cleanup on burn, lending-pool share-accounting gaps, and backend event indexing across LoanManager/LendingPool/RemittanceNFT.
What did I do?
LoanManager liquidity commitment tracking
DataKey::TotalOutstanding(token)tracking incontracts/loan_manager/src/lib.rs.approve_loan()to enforcepool_balance - total_outstanding >= loan.amountbefore approval.LendingPool/API surface and indexer coverage
get_share_price(token)incontracts/lending_pool/src/lib.rs(scaled fixed-point quote for share valuation).EventIndexerto accept multiple contracts (contractConfigs/contractIds) and fetch events across all configured contract IDs.indexerManagerto wireLOAN_MANAGER_CONTRACT_ID,LENDING_POOL_CONTRACT_ID, andREMITTANCE_NFT_CONTRACT_IDinto one multi-contract indexer configuration.RemittanceNFT burn cooldown issue
burn_internal()already removesDataKey::TransferCooldown(user)in current codebase, so no additional code change was required in this branch.Check List (Check all the applicable boxes)
Screenshots / Testing Evidence
Per request, tests were not run in this task. Formatting applied to touched backend TypeScript files via Prettier. Rust formatter (
cargo fmt) was unavailable in this shell environment.