Fee Estimator Streaming
Using this method, you can enable the fee estimation stream. For requesting fee estimates without streaming, use get_eth_estimated_fee_per_gas.
Parameter | Type | Required | Description |
---|---|---|---|
client_id | integer | ✓ | This ID can be used to access data (e.g. via http://localhost:7783/event-stream?id=1) |
coin | string | ✓ | The coin or token to enable the fee estimation stream for. |
Parameter | Type | Description |
---|---|---|
streamer_id | string | An identifier for the data stream. This can be used later to disable streaming for the event with stream::disable. |
fee_estimator_enable
{
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::fee_estimator::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1,
"coin": "MATIC",
"config": {
"estimate_every": 33.4,
"estimator_type": "Provider"
}
}
}
Here is an example of the stream data you should be able to see in http://localhost:7783/event-stream?id=1 at each estimate interval:
data: {"_type":"FEE_ESTIMATION:MATIC","message":{"base_fee":"0.000000281","low":{"max_priority_fee_per_gas":"30","max_fee_per_gas":"30.000000309","min_wait_time":null,"max_wait_time":null},"medium":{"max_priority_fee_per_gas":"32.633147189","max_fee_per_gas":"32.633147519","min_wait_time":null,"max_wait_time":null},"high":{"max_priority_fee_per_gas":"38.9999999","max_fee_per_gas":"39.000000251","min_wait_time":null,"max_wait_time":null},"source":"simple","base_fee_trend":"","priority_fee_trend":"","units":"Gwei"}}
Parameter | Type | Description |
---|---|---|
CoinNotFound | string | The specified coin was not found or is not activated yet |
CoinNotSupported | string | Currently only EVM coins/tokens support fee estimation |
UnknownClient | string | No client has an open connection using this client_id |
ClientAlreadyListening | string | The requested events are already being sent to the client_id |
InvalidRequest | string | Error parsing request or invalid configuration parameters |