I would think that for a criminal defendant, assuming that they have money, it would be in their interest to pay much more for a result of acquittal, than for a conviction. For example, imagine an attorney tells his client: "I charge $10,000 retainer to get started and if it goes to trial it will probably cost you $35,000." The client might then say, "Fine, I will pay that, but if I am acquitted or the prosecution drops the charges, I will pay you a bonus of $150,000". So, in that case the attorney has a strong incentive to get the client acquitted.
Are such deals illegal or considered "unethical"? I.e., could an attorney get in trouble for accepting such a deal?