Full scope of what you can do with Pragma
Network | Address | Explorer |
---|---|---|
Starknet Mainnet | 0x2a85bd616f912537c50a49a4076db02c00b29b2cdc8a197ce92ed1837fa875b | Starkscan Voyager |
Starknet Sepolia | 0x36031daa264c24520b11d93af622c848b2499b66b41d611bac95e13cfca131a | Starkscan Voyager |
Pair | Pair Id | Decimals |
---|---|---|
CONVERSION_XSTRK/USD | 384270964630611589151504336040175440891848512324 | 8 |
CONVERSION_SSTRK/USD | 384270964630611589151504335947941720523300754244 | 8 |
Median
aggregation mode.get_data_median
get_data_median
data_type
: enum of the data type you are requesting (See DataType structure). By providing the enum data type, you also provide the pair id (for spot entries), or the pair id and the expiration timestamp (for futures).PragmaPricesResponse
struct containing:price
: aggregation result using robust median algorithm (multiplied by 10**decimals
)decimals
: number of places value has been shiftedlast_updated_timestamp
: timestamp of most recent entrynum_sources_aggregated
: number of sources in final answerexpiration_timestamp
: expiration timestamp (futures only)get_data_median_for_sources
get_data_median_for_sources
data_type
: enum of data type requested (provides pair id or pair id + expiration timestamp)sources
: array of sources to aggregate (Span of felt252)PragmaPricesResponse
struct containing:price
: median aggregation result (multiplied by 10**decimals
)decimals
: decimal places shiftedlast_updated_timestamp
: most recent entry timestampnum_sources_aggregated
: source count in final resultexpiration_timestamp
: expiration time (futures only)get_data
get_data
data_type
: enum of requested data typeaggregation_mode
: mode for combining data sources (MEDIAN, MEAN, or CONVERSIONRATE)price
: aggregated result using specified mode (multiplied by 10**decimals
)decimals
: decimal places shiftedlast_updated_timestamp
: most recent entry timestampnum_sources_aggregated
: sources in final answerexpiration_timestamp
: expiration time (futures only)get_data_with_USD_hop
get_data_with_USD_hop
base_currency_id
: base currency felt252 (e.g., BTC)quote_currency_id
: quote currency felt252 (e.g., ETH)aggregation_mode
: combining mode (MEDIAN, MEAN, CONVERSIONRATE)typeof
: SimpleDataType enumexpiration_timestamp
: expiration time (futures only)price
: aggregated result (multiplied by 10**decimals
)decimals
: decimal shiftlast_updated_timestamp
: latest entry timenum_sources_aggregated
: source countexpiration_timestamp
: expiration (futures only)get_data_for_sources
get_data_for_sources
data_type
: data type enumaggregation_mode
: combining mode (MEDIAN, MEAN, CONVERSIONRATE)sources
: source array (Span of felt252)price
: aggregated result (multiplied by 10**decimals
)decimals
: decimal placeslast_updated_timestamp
: latest update timenum_sources_aggregated
: source countexpiration_timestamp
: expiration (futures only)get_data_entry
get_data_entry
data_type
: data type enumsource
: uppercased UTF8-encoded source (e.g., str_to_felt("GEMINI")
)publisher
: publisher to consider (e.g., str_to_felt("PRAGMA")
)possible_entry
: PossibleEntry enum containing base entry (timestamp, source, publisher) and additional data (type, price, volume)get_data_entries
get_data_entries_for_sources
get_last_checkpoint_before
get_latest_checkpoint_index