It sounds like you're doing really well, scorow! Happy Three Week Anniversary!
I am sorry you're finding it difficult to get the restorative rest we all want post op.
Have you tried laying on your side with a lengthy pillow between your legs? That's where an inexpensive Body Pillow (about $10 from Target) came in handy for me initially. Actually, still to this day, over seven years post joint replacement.
Pillows certainly help me get comfortable in bed, making it easier to fall asleep. You can experiment with different arrangements to find what works for you. I surrounded myself with them so I could rest a leg, or arm easily enough, whatever felt comfortable. I felt swaddled and it helped me drift off. Doing whatever you can to basically "set the scene" for sleep may be worthwhile. Make up the bed with your most comfortable bedding / blankets along with a few extra bed pillows of different degrees of firmness. Try to block out the light if it's daytime. Minimize noise unless you feel listening to calming relaxation music, a fan, or white noise may help lull you to sleep. Make sure the room temperature is not too hot or too cold. Try to disconnect from the devices at least an hour before the targeted nap or bed time, so it's easier to wind down. Limit caffeine throughout the day and consider natural sleep aids such as Valerian, Chamomile or, Magnesium, my personal favorite, which can assist in muscle relaxation and nerves and promote healthy sleep (falling asleep and staying asleep)
Apply ice for a time before bed to reduce swelling and numb the discomfort. Try some relaxation techniques if you feel they may work for you such as deep breathing, prayer or meditation or even some gentle stretching may help relax your body and mind.
An article on Magnesium from our Library -
https://bonesmart.org/forum/threads/magnesium-is-a-star.20301/
Most large grocers carry a variety of teas such as Celestial Seasonings - Sleepytime Herb Tea,
Yogi Teas, Bedtime, Bigelow Cozy Chamomile, all of which may help you relax...at least worth a try.
Time will also help, but that takes patience, especially when you're restless and tossing and turning all night.
Wishing you many nights of peaceful sleep soon!
@scorow