You can contribute up to the lessor or 25% of your self-employed "compensation", up to $61,000 for 2022. Your self-employed compensation is is your net earnings from self-employment, less the following deductions:
- one-half of your self-employment tax and
- contributions to your own SEP-IRA.
So, if your net earnings were negative, you cannot contribute to your SEP.