Let's dispel a huge myth I keep seeing - from both writers asking about it and from those seeking writers, offering it: Ghostwriters should never work "for royalties" that authors expect to get from sales of the books they're writing. Never. It's a nice additional piece to add on to some packages, but it's a bonus you're unlikely to get. Here's why:
You can write the best book - an incredible, heart wrenching drama or an enlightening, historically accurate memoir, but it's not right for the market, or mistimed, or not promoted the way it needs to be (which is a huge part of successfully publishing a book, btw). And that's not your job. None of that is. That's the author's job.
They need to vet the market potential ahead of time and then promote the bejesus out of it to make sales. Also, just because something is well written and timed right for the market does not guarantee its success. It's unpredictable. Writing a story is precisely half of the project. Publishing and promotion are really THAT essential to success.
Your job, as ghostwriter, is to write an amazing story. Where it goes from there is entirely dependent upon too many factors that are out of your control.
Writing for royalties is the same as writing for free. Do it at your peril.
And check out my previous post to learn a bit about actual ghostwriting rates and standard practices you should keep in mind. You don't have to charge what I do, but you definitely shouldn't work for royalties/free.