Ethereum
Block
Bases: APIResource
Source code in src/rated/ethereum/blocks.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 |
|
get(slot)
Get a block by consensus slot number
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> block = eth.block.get(500)
>>> print(f"{block.total_rewards = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
int
|
Consensus slot number |
required |
Returns:
Type | Description |
---|---|
Block
|
A single block |
Source code in src/rated/ethereum/blocks.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
|
Blocks
Bases: APIResource
Blocks allows one to dig into the individual slots and blocks in Ethereum since the Merge. Metrics include validator rewards from the consensus and execution layers, MEV data, and missed reward estimates.
Source code in src/rated/ethereum/blocks.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
all(*, from_slot=None, size=None, follow_next=False)
Get all blocks
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> blocks = eth.blocks.all(from_slot=500, size=10)
>>> for block in blocks:
>>> print(f"{block.total_rewards = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
from_slot |
int | None
|
Start slot |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
Block
|
An iterator over all blocks |
Source code in src/rated/ethereum/blocks.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|
Network
Bases: APIResource
Network allows querying into a collection of statistics that provide an overview of the whole network in historical states, which can be as recent as the last 24h.
Source code in src/rated/ethereum/network.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 87 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 |
|
capacity()
Summarizes activations and exits for all the whole network.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> capacity = eth.network.capacity()
>>> for cap in capacity:
>>> print(f"{cap.churn_limit = }")
Yields:
Type | Description |
---|---|
NetworkChurnCapacity
|
Activations and exits summary |
Source code in src/rated/ethereum/network.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
capacity_pool(*, stake_action=StakeAction.ACTIVATION, time_window=TimeWindow.ONE_DAY)
Summarizes activations and exits, broken down by staking pool.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> capacity_pool = eth.network.capacity_pool(time_window=TimeWindow.THIRTY_DAYS)
>>> for cap in capacity_pool:
>>> print(f"{cap.churn_limit = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
stake_action |
StakeAction
|
Direction of flow. This can be either of activation or exit. |
ACTIVATION
|
time_window |
TimeWindow
|
The time window of aggregation. You might ask for 1d, 7d, 30d or All-time data |
ONE_DAY
|
Yields:
Type | Description |
---|---|
NetworkChurnCapacityPool
|
An iterator over all results |
Source code in src/rated/ethereum/network.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 |
|
overview()
Summarizes key statistics for the whole network.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> overview = eth.network.overview()
>>> for values in overview:
>>> print(f"{values.activating_validators = }")
Yields:
Type | Description |
---|---|
NetworkOverview
|
Statistics summary |
Source code in src/rated/ethereum/network.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
|
stats()
Summarizes key performance statistics for all the whole network, for the current calendar day.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> network_stats = eth.network.stats()
>>> for stat in network_stats:
>>> print(f"{stat.avg_uptime = }")
Yields:
Type | Description |
---|---|
NetworkStats
|
Network performance stats |
Source code in src/rated/ethereum/network.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
Operator
Bases: APIResource
Querying into pre-materialized operator groupings.
Source code in src/rated/ethereum/operators.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 87 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 144 145 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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
apr(operator_id, id_type, *, time_window, apr_type=AprType.BACKWARD)
Retrieve historical data on the returns any of the entities supported have recorded.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> apr = eth.operator.apr("Lido", id_type=IdType.POOL, time_window=TimeWindow.ALL_TIME)
>>> print(f"{apr.percentage = }%")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
time_window |
TimeWindow
|
The time window of aggregation |
required |
apr_type |
AprType
|
Direction of flow |
BACKWARD
|
Returns:
Type | Description |
---|---|
OperatorApr
|
Entity APR % |
Source code in src/rated/ethereum/operators.py
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 |
|
clients(operator_id, id_type)
Consensus client distribution
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> clients = eth.operator.clients("Lido", id_type=IdType.POOL)
>>> for c in clients:
>>> print(f"{c.client = }, {c.percentage = }%")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
Yields:
Type | Description |
---|---|
ClientPercentage
|
Clients percentages |
Source code in src/rated/ethereum/operators.py
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 |
|
effectiveness(operator_id, id_type, *, from_day=None, size=None, granularity=Granularity.DAY, filter_type=FilterType.DAY, follow_next=False)
Historical performance of a single operator. This includes rewards (aggregate and granular), performance (effectiveness and its components), slashing history and much more.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> effectiveness = eth.operator.effectiveness("Lido", id_type=IdType.POOL, from_day=795, size=10)
>>> for eff in effectiveness:
>>> print(f"{eff.avg_validator_effectiveness = }, {eff.day = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
from_day |
int | date | None
|
Start day |
None
|
size |
int | None
|
Number of results included per page |
None
|
granularity |
Granularity
|
T he size of time increments you are looking to query |
DAY
|
filter_type |
FilterType
|
Hour, day and datetime |
DAY
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
OperatorEffectiveness
|
Operator Effectiveness |
Source code in src/rated/ethereum/operators.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 |
|
metadata(operator_id, id_type)
Retrieve profile information on specific operators.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> op = eth.operator.metadata("Lido", id_type=IdType.POOL)
>>> print(f"{op.node_operator_count = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
Returns:
Type | Description |
---|---|
Operator
|
Operator metadata. |
Source code in src/rated/ethereum/operators.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 |
|
relayers(operator_id, id_type, *, time_window=TimeWindow.THIRTY_DAYS)
Get information relating to an entity's historical distribution of relays they have procured blocks from.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> relayers = eth.operator.relayers("Lido", id_type=IdType.POOL, time_window=TimeWindow.ALL_TIME)
>>> for r in relayers:
>>> print(f"{r.relayer = }, {r.percentage = }%")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
time_window |
TimeWindow
|
The time window of aggregation |
THIRTY_DAYS
|
Yields:
Type | Description |
---|---|
RelayerPercentage
|
Relayer Percentages |
Source code in src/rated/ethereum/operators.py
142 143 144 145 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 |
|
stake_movement(operator_id, id_type, *, stake_action=StakeAction.ACTIVATION, time_window)
Retrieve data on the activation and exit activity of a specific pre-materialized view (e.g. operator, deposit address, etc.)
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> stake_movement = eth.operator.stake_movement("Lido", id_type=IdType.POOL, time_window=TimeWindow.THIRTY_DAYS)
>>> for mov in stake_movement:
>>> print(f"{mov.amount_gwei = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
stake_action |
StakeAction
|
Direction of flow |
ACTIVATION
|
time_window |
TimeWindow
|
The time window of aggregation |
required |
Yields:
Type | Description |
---|---|
OperatorStakeMovement
|
Activations and withdrawals state and status |
Source code in src/rated/ethereum/operators.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
|
summary(operator_id, id_type, *, time_window)
Retrieve summary statistics for a specific operator
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> summary = eth.operator.summary("Lido", id_type=IdType.POOL, time_window=TimeWindow.SEVEN_DAYS)
>>> print(f"{summary.avg_uptime = }%")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
id_type |
IdType
|
The type of entity class |
required |
time_window |
TimeWindow
|
The time window of aggregation |
required |
Returns:
Type | Description |
---|---|
OperatorSummary
|
Operator summary |
Source code in src/rated/ethereum/operators.py
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|
Operators
Bases: APIResource
Source code in src/rated/ethereum/operators.py
296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
|
percentiles(id_type, *, time_window)
Retrieve data of entities with their respective percentile rank score, according to their effectiveness rating.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> percentiles = eth.operators.percentiles(IdType.POOL, time_window=TimeWindow.SEVEN_DAYS)
>>> for percentile in percentiles:
>>> print(f"{percentile.rank = }, {percentile.value = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id_type |
IdType
|
The type of entity class |
required |
time_window |
TimeWindow
|
The time window of aggregation |
required |
Yields:
Type | Description |
---|---|
Percentile
|
Percentiles |
See Also
https://docs.rated.network/methodologies/ethereum-beacon-chain/rating-percentiles
Source code in src/rated/ethereum/operators.py
299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
summaries(*, time_window, pool_type=PoolType.ALL, id_type=IdType.DEPOSIT_ADDRESS, parent_id=None, from_day=None, size=None, follow_next=False)
Summarizes statistics for all the operators Rated has pre-materialized views on
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> summaries = eth.operators.summaries(time_window=TimeWindow.ALL_TIME, from_day=795, size=10)
>>> for summary in summaries:
>>> print(f"{summary.avg_uptime = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
time_window |
TimeWindow
|
The time window of aggregation |
required |
pool_type |
PoolType
|
Type of Pool |
ALL
|
id_type |
IdType
|
The type of entity class |
DEPOSIT_ADDRESS
|
parent_id |
str | None
|
Specifying a pool or node operator so that the response is focused on the Pool Shares of said entity |
None
|
from_day |
int | None
|
Start day |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Source code in src/rated/ethereum/operators.py
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 |
|
P2P
Bases: APIResource
Querying into aggregated stats on Ethereum's peer-to-peer networking layer
Source code in src/rated/ethereum/p2p.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 87 88 89 |
|
geographical_distribution(distribution_type=DistributionType.PROS)
Retrieves a list of countries and the respective share of the validator set based in those countries
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> geo_dist = eth.p2p.geographical_distribution()
>>> for dist in geo_dist:
>>> print(f"{dist.country = }, {dist.validator_share = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
distribution_type |
DistributionType
|
The type of distribution |
PROS
|
Yields:
Type | Description |
---|---|
P2PGeographicalDistribution
|
Geographical distribution |
Source code in src/rated/ethereum/p2p.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
hosting_provider_distribution(*, from_rank=None, size=None, distribution_type=DistributionType.PROS, follow_next=False)
Retrieves a list of hosting providers and their respective share of the validator set
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> provider_dist = eth.p2p.hosting_provider_distribution(size=5)
>>> for dist in provider_dist:
>>> print(f"{dist.hosting_provider = }, {dist.validator_share = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
from_rank |
int | None
|
|
None
|
size |
int | None
|
Number of results included per page |
None
|
distribution_type |
DistributionType
|
The type of distribution |
PROS
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
P2PHostingProviderDistribution
|
Hosting provider distribution |
Source code in src/rated/ethereum/p2p.py
51 52 53 54 55 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 86 87 88 89 |
|
Slashings
Bases: APIResource
Allows one to see every slashed validator in the Ethereum Beacon Chain whether individually or collectively. Pertinent metrics include their total penalties from being slashed, which epoch they were slashed, and when they will be withdrawable.
Source code in src/rated/ethereum/slashings.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 87 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 144 145 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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
cohorts()
Retrieves the frequency of slashing incidents for validators, grouped by different operator cohort sizes, from solo to professional operators with more than 5,000 validator keys.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> cohorts = eth.slashings.cohorts()
>>> for cohort in cohorts:
>>> print(f"{cohort.cohort = }, {cohort.last_six_months = }")
Yield
Cohorts
Source code in src/rated/ethereum/slashings.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
for_validator(validator_index_or_pubkey)
Information about a single slashed validator, queried either by the validator's index or their pubkey.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> penalties = eth.slashings.for_validator("0xb443c10134d35b2f2117b0cd499f0e1755a87329d573a680cec6830fa2f7032f8dc39be33dc75b7a83c2ae70651eb38b")
>>> print(f"{penalties.slashing_epoch = }, {penalties.slashing_penalties = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validator_index_or_pubkey |
int | str
|
Validator index or pubkey |
required |
Returns:
Type | Description |
---|---|
SlashingPenalty
|
Slashing penalty |
Source code in src/rated/ethereum/slashings.py
183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 |
|
leaderboard(*, from_rank=None, size=None, follow_next=False)
Depending on the slashing role specified, this endpoint returns a list of entities either (1) according to how many times their validators have been slashed or (2) how many times their validators have proposed a block that included slashing report (i.e. letting the network know a slashing incident has occurred)
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> leaderboard = eth.slashings.leaderboard(from_rank=1)
>>> for l in leaderboard:
>>> print(f"{l.id = }, {l.slashes = }, {l.validator_count = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
from_rank |
int | None
|
Start from ranking |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
SlashingLeaderboard
|
Slashing leaderboard |
Source code in src/rated/ethereum/slashings.py
50 51 52 53 54 55 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 86 87 88 89 |
|
overview()
Lists of all slashed validators, their index, pubkey, slashing epoch, withdrawable epoch, balance before slashing, balance before withdrawal, and the penalties incurred from getting slashed.
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> slashings_overview = eth.slashings.overview()
>>> for slashing in slashings_overview:
>>> print(f"{slashing.validators_slashed = }")
Yields:
Type | Description |
---|---|
SlashingOverview
|
Slashing overview |
Source code in src/rated/ethereum/slashings.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
penalties(*, from_day=None, size=None, follow_next=False)
All slashed validators, their index, pubkey, slashing epoch, withdrawable epoch, balance before slashing, balance before withdrawal, and the penalties incurred from getting slashed
Examples:
>>> from datetime import date
>>>
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> penalties = eth.slashings.penalties(from_day=date(2023, 10, 1), size=10)
>>> for penalty in penalties:
>>> print(f"{penalty.validator_pubkey = }, {penalty.slashing_penalties = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
from_day |
int | date | None
|
Starting day |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
SlashingPenalty
|
Slashing penalty |
Source code in src/rated/ethereum/slashings.py
138 139 140 141 142 143 144 145 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 |
|
timeseries()
Time series of slashing incidents
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> intervals = eth.slashings.timeseries()
>>> for interval in intervals:
>>> print(f"{interval.month = }, {interval.validators_slashed = }")
Yields:
Type | Description |
---|---|
SlashingTimeInterval
|
Slashing time series |
Source code in src/rated/ethereum/slashings.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
|
Validator
Bases: APIResource
Source code in src/rated/ethereum/validators.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 86 87 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 |
|
apr(index_or_pubkey, *, apr_type=AprType.BACKWARD, time_window=TimeWindow.ONE_DAY)
Historical data on the returns of a validator index
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> validator_apr = eth.validator.apr(560000, time_window=TimeWindow.THIRTY_DAYS)
>>> print(f"{validator_apr.validator_index = }, {validator_apr.percentage = }%")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_or_pubkey |
int | str
|
Validator index or pubkey |
required |
apr_type |
AprType
|
Direction of flow |
BACKWARD
|
time_window |
TimeWindow
|
The time window of aggregation |
ONE_DAY
|
Returns:
Type | Description |
---|---|
ValidatorAPR
|
APR % |
Source code in src/rated/ethereum/validators.py
49 50 51 52 53 54 55 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 |
|
effectiveness(index_or_pubkey, *, from_day=None, size=None, follow_next=False)
Historical performance of a single validator index
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> effectiveness = eth.validator.effectiveness(560000, from_day=795)
>>> for eff in effectiveness:
>>> print(f"{eff.validator_index = }, {eff.validator_effectiveness = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_or_pubkey |
int | str
|
Validator index or pubkey |
required |
from_day |
int | date | None
|
Starting day |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
ValidatorEffectiveness
|
Effectiveness metrics |
Source code in src/rated/ethereum/validators.py
84 85 86 87 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 |
|
metadata(index_or_pubkey)
Reverse lookup into the entity-to-validator index mappings that live in the RatedDB
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> metadata = eth.validator.metadata(560000)
>>> print(f"{metadata.validator_pubkey = }, {metadata.deposit_addresses = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
index_or_pubkey |
int | str
|
Validator index or pubkey |
required |
Returns:
Type | Description |
---|---|
ValidatorMetadata
|
Metadata about the validator |
Source code in src/rated/ethereum/validators.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
Validators
Bases: APIResource
Source code in src/rated/ethereum/validators.py
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 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 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
effectiveness(*, pubkeys=None, indices=None, from_day=None, to_day=None, filter_type=FilterType.DAY, size=10, granularity=None, group_by=ValidatorsEffectivenessGroupBy.VALIDATOR, follow_next=False)
Enables the aggregation of all the metrics that live under Validators across an arbitrary number of validator indices or pubkeys
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> effectiveness = eth.validators.effectiveness(indices=[500, 501, 502], from_day=795)
>>> for eff in effectiveness:
>>> print(f"{eff.validator_index = }, {eff.validator_effectiveness = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pubkeys |
List[str] | None
|
Array of pubkeys |
None
|
indices |
List[int] | None
|
Array of indices |
None
|
from_day |
int | date | None
|
Start day |
None
|
to_day |
Union[int, date] | None
|
End day |
None
|
filter_type |
FilterType
|
Type of filter to apply to from |
DAY
|
size |
int
|
Number of results included per page |
10
|
granularity |
Granularity | None
|
The size of time increments you are looking to query |
None
|
group_by |
ValidatorsEffectivenessGroupBy
|
Time window or validator; we either group by validator index or across time |
VALIDATOR
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
ValidatorEffectiveness
|
Effectiveness metrics |
Source code in src/rated/ethereum/validators.py
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 |
|
metadata(*, from_index=0, size=100, operators_ids=None, withdrawal_address=None, id_type=IdType.NODE_OPERATOR, follow_next=False)
Allows users to request metadata for a group of validators that map to the same operator or pool
Parameters:
Name | Type | Description | Default |
---|---|---|---|
from_index |
int
|
Starting validator index |
0
|
size |
int
|
Number of results included per page |
100
|
operators_ids |
List[str] | None
|
An array of entities names you want to filter by |
None
|
withdrawal_address |
str | None
|
Filter by the withdrawal address |
None
|
id_type |
IdType
|
The type of entity class you would like to filter by |
NODE_OPERATOR
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> metadata = eth.validators.metadata(operators_ids=["Lido", "Kiln"])
>>> for m in metadata:
>>> print(f"{m.validator_pubkey = }, {m.deposit_addresses = }, {m.node_operators = }")
Yields:
Type | Description |
---|---|
ValidatorMetadata
|
Validator metadata |
Source code in src/rated/ethereum/validators.py
132 133 134 135 136 137 138 139 140 141 142 143 144 145 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 |
|
report(validators, *, pool_tag=None)
Gateway for node operators to "upload" their sets
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> validator_count = eth.validators.report(["0x...", "0x...", ...], pool_tag="ACME")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
validators |
Sequence[str]
|
Array of validator pubkeys associated with the node operator |
required |
pool_tag |
str | None
|
Pool name as they appear in the Rated Explorer |
None
|
Returns:
Type | Description |
---|---|
int
|
Number of accepted validators |
Source code in src/rated/ethereum/validators.py
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
|
Withdrawals
Bases: APIResource
Offers a view into the future, relating to when a set of withdrawals are expected to land
Source code in src/rated/ethereum/withdrawals.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 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 |
|
by_operator(operator_id, *, from_day=None, size=None, follow_next=False)
Retrieve information about the expectation of a withdrawal fulfilment, on a per validator index level
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> withdrawals = eth.withdrawals.by_operator("Lido", from_day=795)
>>> for w in withdrawals:
>>> print(f"{w.withdrawal_slot = }, {w.withdrawable_amount = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
operator_id |
str
|
The name of the entity in question |
required |
from_day |
int | date | None
|
Starting day |
None
|
size |
int | None
|
Number of results included per page |
None
|
follow_next |
bool
|
Whether to follow pagination or not |
False
|
Yields:
Type | Description |
---|---|
Withdrawal
|
Withdrawal |
Source code in src/rated/ethereum/withdrawals.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
|
by_slot(slot)
Returns all the validators that are expected to withdraw by slot
Examples:
>>> from rated import Rated
>>> from rated.ethereum import MAINNET
>>>
>>> RATED_KEY = "ey..."
>>> r = Rated(RATED_KEY)
>>> eth = r.ethereum(network=MAINNET)
>>> withdrawals = eth.withdrawals.by_slot(5000)
>>> for w in withdrawals:
>>> print(f"{w.withdrawal_slot = }, {w.id = }, {w.withdrawable_amount = }")
Parameters:
Name | Type | Description | Default |
---|---|---|---|
slot |
int
|
Withdrawal slot number |
required |
Yields:
Type | Description |
---|---|
Withdrawal
|
Withdrawal |
Source code in src/rated/ethereum/withdrawals.py
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 |
|