Discounting of loan with no fixed repayment ter

Hi, I would like some guidance on how to go about discounting a loan with no fixed repayment term (repayments are based on future dividend payments- these can be estimated using certain assumptions). The interest rate is linked to the prime interest rate. Can anyone assit with how to go about calculating this?