# \[v2 API\] What is the timestamp in stream trade schema and how to filter late reported trades

**URL:** <https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839>\
**Category:** Alpaca Market Data\
**Created:** [March 8, 2021, 12:47am UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839 "2021-03-08T00:47:41Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Abh](https://forum.alpaca.markets/u/Abh)\
**Post date:** [March 8, 2021, 12:47am UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/1 "2021-03-08T00:47:41Z")

</div>

Reference: [https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/real-time/#data-points](https://alpaca.markets/docs/api-documentation/api-v2/market-data/alpaca-data-api-v2/real-time/#data-points)

I am using stream API to get real time trade data.  
What is the timestamp in trade schema?  
“t RFC-3339 formatted timestamp with nanosecond precision.”

Assuming it is SIP timestamp, how can we filter trades which are reported too late.  
Because if a trade was reported 10 second late, I simply want to ignore it.

Here is an example of trade which SIP feed report 5 second late (AAPL, 2021-02-26, data obtained from polygon APIs):

> > price: 122.6233  
> > size: 400  
> > trade\_id: “1060”  
> > exchange\_id: 4  
> > trf\_id: 10  
> > tape: 3  
> > sip\_timestamp {  
> > seconds: 1614349806  
> > nanos: 90977051  
> > }  
> > exchange\_timestamp {  
> > seconds: 1614349801  
> > nanos: 788000000  
> > }  
> > trf\_timestamp {  
> > seconds: 1614349806  
> > nanos: 90618064  
> > }  
> > sequence\_no: 195469

You can see that “sip\_timestamp” is 5 second after “exchange\_timestamp”, so it was reported 5 seconds after trade actually took place at exchange.  
Majority of trades (~95%) get reported within 100-200ms, but there are some which are reported too late and I want to ignore them.  
But without exchange timestamp in stream trade schema, it is impossible to do that.  
Can we please also have exchange timestamp?

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [March 8, 2021, 8:26pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/2 "2021-03-08T20:26:14Z")

</div>

The current timestamp is actually the ‘participant\_timestamp’ and not the ‘sip\_timestamp’. So that is the time which the trade took place. Alpaca is looking to maybe include both but that’s the current state.

The best way to filter ‘late’ data is to look at the trade condition. Trades which are reported ‘late’ will have an L as one of the trade conditions. This implies it was reported more than 10 seconds after the actual trade during market hours or 15 minutes after the trade during extended hours trading.

As an alternative, One could also just compare the current time to the timestamp. Consider using the `clock` API to get the current time synchronized with the markets.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![Abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Abh](https://forum.alpaca.markets/u/Abh)\
**Post date:** [March 12, 2021, 1:13am UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/3 "2021-03-12T01:13:16Z")

</div>

After running websocket for 1 day I could verify that it is indeed “participant\_timestamp”. It is sufficient for me.

Thanks for the response. And thanks for being so actively responding to everyone questions on slack and here. I learned a lot just by reading your responses to various questions. 😄

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [March 18, 2021, 2:43pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/4 "2021-03-18T14:43:29Z")

</div>

A quick update. Alpaca is looking into changing the way v2 data is presented and aggregate bars are calculated. First, both the `participant_timestamp` and the `sip_timestamp` will be surfaced. Additionally, aggregated bars will be available immediately after the minute. However, an additional check is made a bit later (we are thinking 30 seconds). If there were any late but still ‘valid’ trades which should have appeared in the original bar, we will send out an ‘updated bar’. There will be a field in a bar which indicates if it is an update or not. This is a way we can provide both timely ‘real time’ data but also balance that with more correct aggregates.

---

<div class="post-metadata">

**Author:** ![Abh](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@Abh](https://forum.alpaca.markets/u/Abh)\
**Post date:** [March 24, 2021, 5:43pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/5 "2021-03-24T17:43:33Z")

</div>

Thanks for the update. Providing both sip\_timestamp and participant\_timestamp will be super cool.

---

<div class="post-metadata">

**Author:** ![CapitalMastery](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/capitalmastery/32/1455_2.png) [@CapitalMastery](https://forum.alpaca.markets/u/CapitalMastery)\
**Post date:** [May 7, 2022, 1:25am UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/6 "2022-05-07T01:25:36Z")

</div>

Has this change been implemented yet? IS the SIP timestamp now available in the realtime stream?

---

<div class="post-metadata">

**Author:** ![jc\_trade](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/jc_trade/32/4220_2.png) [@jc\_trade](https://forum.alpaca.markets/u/jc_trade)\
**Post date:** [May 17, 2022, 12:17pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/7 "2022-05-17T12:17:43Z")

</div>

Hello @Dan_Whitnable_Alpaca ,  
is there an update on this? like @CapitalMastery, I would be very interested in being able to use the SIP timestamp.

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [May 17, 2022, 12:21pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/8 "2022-05-17T12:21:48Z")

</div>

@jc_trade The SIP timestamp hasn’t been made available. The other changes like bar updates have been implemented.

---

<div class="post-metadata">

**Author:** ![Dosis86](https://avatars.discourse-cdn.com/v4/letter/d/c5a1d2/32.png) [@Dosis86](https://forum.alpaca.markets/u/Dosis86)\
**Post date:** [September 3, 2022, 9:51pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/9 "2022-09-03T21:51:52Z")

</div>

@Dan_Whitnable_Alpaca Hi! Is there any update on the sip\_timestamp? Or was the choice made to not make the sip\_timestamp available (so also not in future)?

---

<div class="post-metadata">

**Author:** ![guillem](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/guillem/32/6835_2.png) [@guillem](https://forum.alpaca.markets/u/guillem)\
**Post date:** [August 9, 2025, 9:43am UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/10 "2025-08-09T09:43:03Z")

</div>

Hi! Without SIP timestamp is impossible to know in PM if a trade was reported late or not… conditions like ‘L’ does not filter all the trades… any news on this?

---

<div class="post-metadata">

**Author:** ![Dan\_Whitnable\_Alpaca](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/dan_whitnable_alpaca/32/1658_2.png) [@Dan\_Whitnable\_Alpaca](https://forum.alpaca.markets/u/Dan_Whitnable_Alpaca)\
**Post date:** [August 9, 2025, 12:56pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/11 "2025-08-09T12:56:18Z")

</div>

@guillem The timestamp Alpaca reports for trades is `Timestamp 1` from the SIP feed. This is typically referred to as the `participant timestamp` which, in most cases, is the trade execution time. However there is a one notable exception.

Below is the definition of `Timestamp 1 `from the [CTS Specification](https://www.ctaplan.com/publicdocs/ctaplan/CTS_Pillar_Output_Specification.pdf) (the [UTP Specification](https://utpplan.com/DOC/UtpBinaryOutputSpec.pdf) is similar).

> _ **Timestamp 1** _  
> _2 x Integer (pair of integers)._  
> _Timestamp 1 is a Participant-provided timestamp representing the number_  
> _of nanoseconds since Epoch. The first integer contains the number of seconds from epoch 1/1/1970,_  
> _00:00:00 UTC. The next integer contains the nanosecond portion of the time (e.g., 972402315). For any_  
> _messages generated by CTS, e.g., Messages generated on behalf of a Participant, Price Band messages,_  
> _Control messages and Market Status messages, the Timestamp 1 field will be set to current SIP time._
> 
> _If from an Exchange: Timestamp 1 denotes the Exchange Matching Engine Publication_  
> _timestamp for a transaction. Exchanges use a clock sync methodology ensuring that timestamps_  
> _are accurate within tolerances of 100 microseconds or less. Exchanges shall provide the_  
> _timestamp in terms of nanoseconds since Epoch._
> 
> _If from the FINRA Alternative Display Facility (ADF) or a FINRA Trade Reporting_  
> _Facility (TRF): Timestamp1 denotes the time of execution that a FINRA member reports to_  
> _the FINRA ADF or a FINRA TRF. FINRA shall provide such times to the Processor in_  
> _nanoseconds since Epoch._

We often generalize this timestamp to be the ‘_time the trade executed_’, however this isn’t exactly the definition. That is true for trades executed on an exchange. However, for trades not executed on an exchange and reported to a FINRA Alternative Display Facility (ADF) or a FINRA Trade Reporting Facility (TRF), it is the time which the trade was _reported_ to the reporting facility. (These trades have an exchange code of “D”.) This time is typically very very close to the execution time, however it really messes things up for trades executed after 20:00 ET. Why? The ADF and TRF facilities aren’t open. They don’t open until 8:00 ET the following morning. Therefore, execution platforms don’t report them until 8:00 AM ET (even though they may have executed the previous evening). The timestamp is the time the trade is _reported_ for those trades. If you look at trade volume between 8:00-8:15 AM ET you will often see a big spike along with swings in prices. That is because of trades from the previous evening all getting reported when the reporting facilities open.

Alpaca is currently looking into options for reporting overnight trades with the execution time and not the reporting time. Currently that information is simply not available in the SIP data which is received.

Is there a specific reason you are wanting the time a trade was reported to the SIP?

---

<div class="post-metadata">

**Author:** ![guillem](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.alpaca.markets/guillem/32/6835_2.png) [@guillem](https://forum.alpaca.markets/u/guillem)\
**Post date:** [August 9, 2025, 1:06pm UTC](https://forum.alpaca.markets/t/v2-api-what-is-the-timestamp-in-stream-trade-schema-and-how-to-filter-late-reported-trades/4839/12 "2025-08-09T13:06:31Z")

</div>

Hi @Dan_Whitnable_Alpaca thank you so much for your detailed answer! I actually don’t need “SIP timestamp” for any other reason than to “clean” those unreported overnight trades. I thought that timestamp would allow me to do so, but it seems it’s not that simple.

I’ve tried avoiding the “D” exchange as you mentioned, but it’s not always 100% accurate. In your experience, what would be the best way to handle this with Alpaca’s current data? It would be awesome if there were a way to mark those trades somehow to maintain a clean feed.

Thank you so much!
