I've been using the listings package with the following setup to produce a compact layout of code samples:
\lstset{
basicstyle=\footnotesize\ttfamily,breaklines=true,
framextopmargin=50pt,framexleftmargin=30pt,framexbottommargin=-5pt
}
How would one control the top and bottom margins for minted? It doesn't have the same options.

mintedbasically uses a slightly modified version oftrivlist. By wrapping it withtcolorboxfeatures might be the simplest way to achieve your needs.