Neither of these sound natural to me.
Here are some suggestions for sentences that work:
Based on what, you did that? "What did you do that based on?"
On the basis of what, you did that? "On the basis of what did you do that?"
Or, if we change the words but keep the meaning:
What made you decide to do that?
What did you base your decision to do that on?