barter-data-rs
barter-data-rs copied to clipboard
`u64` or `DateTime<Utc>` for the data type of timestamps
Would it be better to use u64
datatype for timestamps because of better performance when serde
deserializes it?
Candle uses DateTime<Utc>
for start_time
and end_time
for now.
https://github.com/barter-rs/barter-data-rs/blob/f1afec3308e3351e3c155946c9f357be158fd0a5/src/model/mod.rs#L42-L53
Hey @seongs1024 , potentially!
However even with several of the most high volume markets (eg/ binance_futures btc_usdt) on the same thread, barter-data-rs is not bottle necked.
DateTime<Utc>
provides a more type safe way of representing time, as well as additional functionality.
It's definitely possible we'd want to adapt this in the future.
eg/
DateTime<Utc>
-> Time
where Time is a struct Time(u64)
eg/ end_time would actually become the delta between start_time
and end_time
, rather than a fully precise DateTime<Utc>
.
etc etc.
Out of interest, do you use the candles?
Yeah I'm using candles for backtesting!
I will be using candles for backtesting and hopefully also for live trading in the future.
Closing this now we've migrated this repo to the new barter-rs monorepo: https://github.com/barter-rs/barter-rs