I want to understand the concurrency protection provided for close-position or close-all-positions api calls.
The documentation says it closes positions in a given symbol or all symbols in the account. What happens if this api is invoked by two processes concurrently? Should I expect one of them to file, be no-op or can it put me on the opposite side of the trade?
For a concrete example,
I have 100 AAPL share in my account. I have two processes that call “DELETE/v2/positions/AAPL” or
“DELETE/v2/positions” at exactly the same time. What are possible outcomes of this?
The motivation here is to understand if the API provides database like guarantees to serialize the concurrent updates, or do I need to build it as a use of Alpaca api?