You know if a server runs if it responds to your connection/discovery broadcast. You can never assume a server is always running (even if it should ideally).
Closing a server when the trade is gone is relative. I'd say, your clients have to leave it first, because if the server closes first your clients won't be gracefully kicked out (depends how you code this, though). Also, if you use a dedicated server or that, it could still be running all the time and handle trades by "sessions". It's up to you to decide which flow you want.
I'm new to networking in Godot as well, so I mostly know theory, sorry if I can't share actual code^^