The RAW file is just that, raw data from the sensor. The only real effect that camera settings can have on the sensor data is ISO, which is an electrical setting of increasing amplification of the signal from the sensor; along with exposure, which determines how much light reaches the sensor. Color balance and gamut are functions of software, determined by how that raw data are processed, either internally by the camera's processor or in externally in a computer. At least that is how I've always understood it.
Or to put it another way, the sensor has its own inherent color space in which it captures an image. Changing that color space to a standard one like sRGB or AdobeRGB takes place when the file is converted to a standard format like JPEG or TIFF.