Skip to main content
The program signs the vault with margin seeds, forwards route_data to Jupiter, then revalues the account. Token-2022 transfer fees: the client sizes amount_in so the received delta covers the route. Do not assume amount_in equals the Jupiter exact-in after fees. min_amount_out is the slippage bound. Failed health after a would-be swap aborts the whole transaction. Perps and Farm closes reuse this primitive (or the Lite unwind that embeds a route).