GST, oil, midcaps: Why Sensex ended 521 points higher today