Who sent the sea monster to kill Perseus?

Poseidon did because Perseus was going to kill Medusa which Poseidon fell in love with before she was turned into a monster by Athena when Poseidon made love with Medusa in Athena's temple and that was very rude because Athena is a virgin.Actually Poseidon did not send out a sea monster to kill him a girl name Andromedea got chained to a rock and the sea monster was out to kill her and Perseus saved her by slaying the sea monster, and in the end they got married to each other.