Help me understand, how can this loop be off by 1000 lamports?
const TRANSACTION_FEE = 5000;
const MINIMUM_SPLIT_SIZE = 1_000_000;
const DEFAULT_PRIORITY_TX_FEE = 100_000 ; // In microLamports
const MAX_COMPUTE_UNITS = 200_000;
const MAX_BLOCK_HEIGHT = 150; 
const PRIORITY_FEE_IN_LAMPORTS = Math.ceil((DEFAULT_PRIORITY_TX_FEE / 1_000_000) * MAX_COMPUTE_UNITS);
const PRIVACY_APPROXIMATION_FEE = (TRANSACTION_FEE + PRIORITY_FEE_IN_LAMPORTS) * max_hops * 2;
transactionQueue.process(4, async (job, done) => {
    const { destinationAddress, finalAmount, delay, currentHop } = job.data;
    let remainingAmount = finalAmount;
    
    if (remainingAmount <= (TRANSACTION_FEE + PRIORITY_FEE_IN_LAMPORTS)) {
        console.log('Processing completed or stopped due to constraints.');
        done();
        return;
    }

    const minPercentage = Math.max((MINIMUM_SPLIT_SIZE / remainingAmount) * 100, 5);
    const percentageToTransfer = Math.random() * (30 - minPercentage) + minPercentage;
    let amountToSend = Math.floor(remainingAmount * (percentageToTransfer / 100));

    let publicKey, secretKey;
    if (currentHop >= max_hops || amountToSend <= 2 * MINIMUM_SPLIT_SIZE) {
        publicKey = destinationAddress;
        amountToSend = remainingAmount; // Send the entire remaining amount
    } else {
        const newWallet = create_new_wallet();
        publicKey = newWallet.publicKey;
        secretKey = newWallet.secretKey;
    }


    amountToSend -= (TRANSACTION_FEE + PRIORITY_FEE_IN_LAMPORTS);

    try {
        const { secretKey: serverSecretKey } = await create_or_find_master_wallet();

        const signer = Keypair.fromSecretKey(new Uint8Array(serverSecretKey));
        
        const transaction = new Transaction().add(
            ComputeBudgetProgram.setComputeUnitPrice({
                microLamports: DEFAULT_PRIORITY_TX_FEE
            }),
            ComputeBudgetProgram.setComputeUnitLimit({
                units: MAX_COMPUTE_UNITS,
            }),
            SystemProgram.transfer({
                fromPubkey: signer.publicKey,
                toPubkey: new PublicKey(publicKey),
                lamports: amountToSend,
            }),
        );
        
        const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
        transaction.recentBlockhash = blockhash;
        transaction.sign(signer);
        
        const serializedTransaction = transaction.serialize();
        
        const signature = await connection.sendRawTransaction(serializedTransaction, { maxRetries: 0 });
        
        const result = await retryTransactionUntilConfirmed(signature, serializedTransaction, lastValidBlockHeight);

        if(result !== 'success') {
            throw new Error("Error transferring balance!");
        }

        const response = await fetch(`${loadbalancer_endpoint}/api/transfer_funds`, {
            method: 'POST',
            headers: {'Content-Type': 'application/json'},
            body: JSON.stringify({ publicKey, secretKey, destinationAddress, delay, signature })
        });

        if (!response.ok) {
            throw new Error(`Failed to send lamports: ${await response.text()}`);
        }

        console.log(`Sent ${amountToSend} lamports to ${publicKey}`);
        remainingAmount -= (amountToSend + TRANSACTION_FEE + PRIORITY_FEE_IN_LAMPORTS);

        // Requeue the job with updated data
        transactionQueue.add({
            destinationAddress,
            finalAmount: remainingAmount,
            delay,
            currentHop: currentHop + 1
        },
        {
            delay: 5000
        });

        done();

    } catch (error) {
        console.error('Error sending lamports:', error);
        done(new Error('Failed to send lamports, requeuing...'));
    }
});
the setComputeUnitPrice is in microLamports so I do the conversion to lamports in PRIORITY_FEE_IN_LAMPORTS. I cannot figure out why I get the rent error. I understand it is off by 1000lamports on the final tx, but how? And no, deduction and  readdition is required. Essentially, imagine you have 10000 lamports in your account. The base fee is 5000 lamports, but you need to add a 1000 lamport priority fee. So now your fees are 6000 lamports. Leaving you with 4000 in this loop to send. Now, if you scale this to larger numbers, its going to be several loop iterations before it hits your maximum balance and sends that. Solana does not charge rent on accounts that empty their balance. So the idea is we are wanting to empty that balance.