What triggers a paper trade sell at x.xx (quote, trade, etc?)

in a paper order, what determines when a sell at x.xx price on a long actually occurs? for example if a bid price in a quote comes by at x.xx does alpaca flag it as sold at that? or does it wait for a trade at x.xx and flag it as sold? or does it wait for either to happen first? what are the criteria it uses to determine the position sold in this example? im asking because what i see happen on alpaca differs from when i replay quotes trades and bars manually based on using either a quote or a trade to trigger the paper sell at x.xx.

say i have a paper trade stock ABC at a sell for 1.00? what will fill that sell: a quote with bid price at 1.00, a trade at 1.00, either, others?