PnL = Profit - Funding Costs
PnL = (Exit - Entry) - (50 * Capital - Capital) * Funding Rate
% Gain = PnL / Capital
Capital is how much you are investing (inclusive of margin). Your funding costs is 49 * Capital as that is how much you are borrowing to get to 50x leverage.