Spreads and Intraday Analysis
fiat_comparison(currencies, root=None)
Build a comparison table across multiple fiat currencies (daily metrics).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currencies
|
sequence of str
|
List of fiat codes to include (e.g. ['ARS', 'BOB', 'EUR']). |
required |
root
|
path - like
|
Root of processed data. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per date per currency, with: - date - currency - avg_buy_price - avg_sell_price - spread_abs - spread_pct |
Source code in src\p2p_analytics\spreads.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 | |
intraday_profile(currency, start=None, end=None, root=None)
Intraday price profile for a given currency (average over all days).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currency
|
str
|
Fiat currency code. |
required |
start
|
str or Timestamp
|
Start date (inclusive). |
None
|
end
|
str or Timestamp
|
End date (inclusive). |
None
|
root
|
path - like
|
Root of processed data. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
One row per hour (0–23) with: - hour - currency - mean_buy_price - mean_sell_price |
Source code in src\p2p_analytics\spreads.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | |
p2p_spread(currency, by='day', root=None)
Compute BUY–SELL spread for a given currency using the Phase 1 parquet files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
currency
|
str
|
Fiat code, e.g. 'ARS', 'BOB', 'EUR'. |
required |
by
|
(day, hour)
|
Aggregation level for spreads. |
'day'
|
root
|
path - like
|
Root of processed data. If None, infer from project layout. |
None
|
Returns:
| Type | Description |
|---|---|
DataFrame
|
Columns include: - date (and hour if by='hour') - currency - avg_buy_price - avg_sell_price - spread_abs - spread_pct |
Source code in src\p2p_analytics\spreads.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |