You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Builds on Issue #214 (NFT collateral minting). Add a function that allows a staker with an active debt NFT to swap their underlying collateral token for a different token without unstaking — useful when the staker wants to change their exposure while keeping the loan active.
Summary
Builds on Issue #214 (NFT collateral minting). Add a function that allows a staker with an active debt NFT to swap their underlying collateral token for a different token without unstaking — useful when the staker wants to change their exposure while keeping the loan active.
Acceptance Criteria
CollateralSwapConfigstored per user:{ debt_nft_id: u32, original_token: Address, swap_token: Address }initiate_collateral_swap(user, new_stake_token: Address, min_new_amount: i128)functionnew_stake_token, re-stakes resultmin_new_amountis slippage protection — revert withSlippageExceededif swap output below minimumface_valueupdated to reflect new position amountcollateral_swappedevent:(user, old_token, new_token, old_amount, new_amount, ledger)Notes