As per the law, you cannot surrender leave while you are in service, but it can be done at the time of leaving the company. However, many companies permit the accumulation of leave beyond the limit as permitted under the law and also allow the surrender of a certain number of leaves during service. In such scenarios, the management may determine the surrender value of leaves, which in practice is typically 100% of Basic pay and DA.
Leave encashment at the time of termination of employment should be based on the salary that is paid to an employee when they avail a leave. Normally, an employee on leave will not be paid only 5% or such other percentage of Basic and DA, but will receive their gross salary, which includes allowances like HRA, special allowances, etc. Therefore, 100% of that salary should be paid when unavailed leaves are surrendered.