ergoplatform / oracle-core

Core off-chain component of Oracle Pools
Apache License 2.0
62 stars 37 forks source link

Dynamic tx fee #265

Open greenhat opened 1 year ago

greenhat commented 1 year ago

Motivation

In times of mempool congestion, txs can get on-chain with a significant delay.

Implementation details

Use transactions/getFee node's endpoint to calculate the fee for a tx passing tx's size and time (1 minute) to get on-chain as parameters. Add max_tx_fee to the oracle config and use it as an upper limit for the suggested tx fee from the node. Set it to double the oracle config's base_fee initially. I suppose that 'base_fee' can be dropped and tx fee from node used everywhere.