Borrow and Transferability
When claiming a token, a user must provide time duration and transfer listing amount; the internal smart contract constraint checks whether the provided parameter satisfies the requirement set by the owner and approve the borrowing.
Public links are the default for issuing tokens. It is posted on-chain when it is issued, and anybody can view and borrow it. Having public links allows for building a rental marketplace where you can list a token for a given price and duration, and anybody can borrow provided they pay the listed fee.
The basic issuance flow described in the initialize smart contract will result in an expiring NFT that can be transferred exclusively via the smart contract’s transfer method.
In the event of time or usage-based expiry, a permissionless call can terminate the token. It can be done by any public address else StreamMoney will manage a cron job that will run constantly to ensure that time-based tokens are withdrawn in a timely manner. The cron job will collect rewards from expiry by closing the PDAs. Once this happens, any necessary payments are settled, and its lifecycle is complete.
There are two mechanisms to withdraw assets from PDA
- An Issuer can set a duration, and if the current time is greater than the expiration, it can be withdrawn from PDA
- An Issuer can set a max number of usages; the holder can sign a transaction declaring a usage, and if the number of usages exceeds max usages, it can be withdrawn from PDA
The protocol also supports 3 different expiry types which specify what happens to assets following withdrawal from PDA
- Once expired, the token will be returned to the issuer
- Once expired, the token will remain marked as invalid and can no longer be used
- Once expired, the smart contract is canceled and thus the tokens are unfreeze
At successful borrowing, the rental fee gets deducted from the renter's wallet and it is sent to the owner's wallet after deducting platform fees in case of fixed-price rentals. For revenue share, the reward is collected by protocol, and then it gets distributed among participants as per defined constraints. The smart contract can optionally collect funds throughout its lifecycle and then pay out these funds either upfront or stream payment in cyclic duration. Payment streaming will provide better liquidity to lenders in the case of revenue-sharing rental agreements.