No, it is not balanced, and probably not even playable
I'll go over the traits one by one.
Ability score increase: +2 to Intelligence and +2 to Wisdom
Pretty powerful, since most races get +2/+1, but nothing breaking if the other abilities are okay.
Speed: Your base walking speed is 30 feet. If you swim for more than 5 minutes, you are paralyzed. You recover from this paralysis after spending 30 minutes out of the water.
This basically says "cannot participate in underwater adventures, and needs to wait them out." That's either a strong restriction on the DM to not include too much water, or it means the player will be sitting out the entire part of the adventure that involves travelling under/through water.
Condition immunities: You cannot be charmed or poisoned.
This is very powerful. Poisoned is a very common and annoying ability, and Charmed is not very common but usually really debilitating. Note that both the Elf and the Dwarf get Advantage to one of these two; flat out being able to ignore both is probably too much.
Damage immunities: You are immune to psychic, poison, radiant, and necrotic damage.
No single race gets even 1 immunity to damage, and you give them 4. Including two pretty common ones. Both Poison immunity or Necrotic immunity makes a considerable number of monsters utterly non-threatening. This is definitely too much.
*There is an exception: Yuan-Ti get immunity to poison as well, but they are monstrous adventurers and the chapter they appear in already calls out that they can be unbalanced and should be used with care.
Living construct: You do not need to eat, drink, or breathe, and cannot be infected with diseases. Instead of sleeping, you only need to rest for 4 hours, during which you are alert and can speak. However, you are paralyzed while resting until the 4 hours are completed. In addition, you have disadvantage on saves against being frightened.
As mentioned in the comments, this is a death sentence. Being unable to wake up means that nightly ambushes, which are already dangerous, will have to be handled without you, and your party members need to protect you from taking random critical hits. This ability is going to be utterly un-fun for the player, as again they'll have to be sitting out entire encounters.
Also, what does having disadvantage on saves against being frightened have to do with being a Living Construct?
Damage vulnerability: You are vulnerable to acid, lightning, piercing, and slashing damage.
This one pretty much makes the race unplayable entirely. No other race has vulnerabilities, and you have them against 2 of the physical damage types and 2 of the magical ones. You are not going to survive to level 2, as a single Goblin arrow will likely kill you outright. Unless you play something with a high HD, except you will not be able to fight in close combat ever if you take double damage from just about every monster in the book.
Innate spellcasting: You know the shocking grasp cantrip, and can cast detect magic once per day.
This is fine. Interesting that you let them use a racial cantrip that will likely kill another member of their race because they are vulnerable to the damage it does.
At level 3, you can cast legend lore once per day.
You are giving your race access to a 5th level spell 6 levels earlier than a spellcaster would. This would be utterly overpowered except for the fact that you picked a spell with a 250gp consumed material component and 200gp of non-consumed components, so you probably won't be able to afford casting it anyway, making this feature almost meaningless when you get it.
At level 7, you learn the fire bolt cantrip.
This is okay, although I don't know why you'd need another cantrip. This race can essentially only play ranged spell-casters, so you'll have plenty of cantrips anyway.
At level 10, you can cast magic missile twice per day as a 1st-level spell.
At level 10, this is probably meaningless. (Besides, you won't live that long). Being able to cast 2 level 1 spells is nice, but the race doesn't really need this feature.
At level 20, you can cast etherealness once per day.
No other race gets a 7th level racial spell, or a new ability at this high a level. I'm not sure how it fits thematically with anything, or what the use of this is going to be. The main purpose seems to be sitting out even more encounters by travelling to the Border Ethereal so you can't be hurt.
:-)
Also, that reads as if the creature goes down for its rest and for 4 hours it can't arise no matter what. For an adventurer, that's a death sentence. For a race, that's a defining characteristic around which the whole culture is likely to be based. Can this question confirm that I'm reading that trait accurately? \$\endgroup\$