Total volume is volumes of both square pyramids.
Volume of a tetrahedron is 1/3 times corresponding prism, and a square pyramid has two tetrahedrons.
Thus, volume of on square pyramid:
[tex]= (\frac{1}{3}\times \frac{a^2\times b}{2})\times 2\\
=\frac{1}{3}a^2b[/tex]
Since there are two of them, total volume is:
$\boxed{\frac{2a^2b}{3}}$