Technical review
NFTs used as collateral are frozen in account, only when account takes out loan.
Frozen NFTs are unfrozen when full loan is paid back.
There is no interest rate for borrowing USDCa.
A 3% fee is paid to take out loan.
Lenders sign a delegated logic signature to allow any account to withdraw USDCa that fullfill the following:
Calls DeFi4NFT contract
Withdraws atmost staked amount
Any account that holds dUSD can claim 1:1 USDCa by sending the dUSD to DeFi4NFT contract.
Borrower can borrow from upto 4 lenders
Liquidation
How liquidation happens?
Specify the addresss to liquidate
Pay 95% of collateral’s value to DeFi4NFT contract
Set an account that will receive the liquidated asset
You’ll be sent the collateral to the address you specified
Smartcontract
There are three smartcontracts that power DeFi4NFT dapp.
DeFi4NFT Contract DeFi4NFT contract holds the state machine and locks/unlocks NFT in account (freezes/unfreezes NFT) . State machine, tracks:
xids
tracks which NFT is used as collateralcamt
tracks how much collateral is used for loanlamt
tracks how much loan is borrowedaamt
tracks how much loan is available from lender address
Liquidator Contract Liquidator contract reads current price of NFT from oracle and if loan is more than 90% of collateral it liquidates the NFT locked.
liquidator contract is the clawback address of leveragable NFTs on DeFi4NFT.
after liquidation completes the remainig asset is unfrozen. This is possible by AVM 1.1 (contract to contract call). Liquidator contract calls DeFi4NFT contract to unfreeze the asset.
Manager Contract Manager contract creates all other contracts on behalf of creator address. It also controls the NFTs that are configured to be borrowable in DeFi4NFT.
Notice
We have implemented here the Freeze admin and Clawback of algorand ASA. And IPFS for storing delegated LogicSig. We have also used Circle APIs for blockchain swap.