Crypto Margin Trading: Mathematical Analysis and Data-Driven Strategies