Legality of decentralized margin trading? (dydx)

I'm a complete noob when it comes to margins but I'm curious. Anybody know the status of decentralized margins in the US? I've heard that centralized exchanges often prohibit US citizens from being able to margin trade, but what's up with that? How would gains and losses be reported on crypto tax tools?