diff --git a/filepathSlugs.json b/filepathSlugs.json index a528bb84..7e86ade3 100644 --- a/filepathSlugs.json +++ b/filepathSlugs.json @@ -2167,7 +2167,8 @@ "src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx": [ "wallet-operations-structures", "raw-tx-info", - "input-txns" + "input-txns", + "pay-for-gas" ], "src/pages/komodo-defi-framework/api/index.mdx": [ "komodo-de-fi-framework-rpc-methods" @@ -2825,6 +2826,36 @@ "token-protocol-parse-error-error", "unexpected-token-protocol-error" ], + "src/pages/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/index.mdx": [ + "get-eth-estimated-fee-per-gas", + "request", + "response" + ], + "src/pages/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/index.mdx": [ + "get-swap-transaction-fee-policy", + "request", + "response" + ], + "src/pages/komodo-defi-framework/api/v20/fee_management/index.mdx": [ + "evm-network-fee-management", + "fee-management-methods", + "fee-management-configuration", + "in-the-coins-file", + "in-the-mm-2-json-file" + ], + "src/pages/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/index.mdx": [ + "set-swap-transaction-fee-policy", + "request", + "response" + ], + "src/pages/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/index.mdx": [ + "start-eth-fee-estimator", + "response" + ], + "src/pages/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/index.mdx": [ + "stop-eth-fee-estimator", + "response" + ], "src/pages/komodo-defi-framework/api/v20/get_current_mtp/index.mdx": [ "get-current-mtp", "arguments", @@ -3667,6 +3698,7 @@ "configuration-parameters", "example-allowing-weak-password", "example-not-allowing-weak-password", + "example-using-gas-api", "example-wss-with-certificates", "example-for-hd-wallets", "coins-file-configuration", diff --git a/src/data/sidebar.json b/src/data/sidebar.json index 77f7efc5..8b6e2784 100644 --- a/src/data/sidebar.json +++ b/src/data/sidebar.json @@ -387,6 +387,35 @@ } ] }, + { + "title": "Fee Management", + "links": [ + { + "title": "Overview", + "href": "/komodo-defi-framework/api/v20/fee_management/" + }, + { + "title": "get_eth_estimated_fee_per_gas", + "href": "/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/" + }, + { + "title": "get_swap_transaction_fee_policy", + "href": "/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/" + }, + { + "title": "set_swap_transaction_fee_policy", + "href": "/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/" + }, + { + "title": "start_eth_fee_estimator", + "href": "/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/" + }, + { + "title": "stop_eth_fee_estimator", + "href": "/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/" + } + ] + }, { "title": "Market Maker Bot", "links": [ diff --git a/src/pages/komodo-defi-framework/api/common_structures/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/index.mdx index 6e72ddbb..c23ebe81 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/index.mdx @@ -438,23 +438,31 @@ The `WithdrawFee` object varies depending on the coin or token type. Refer to th ### FilterCriteria -The `FilterCriteria` object includes different criteria to filter from the different recent swaps: +The 'FilterCriteria' object allows you to filter the results based on specific parameters. + +| Parameter | Type | Description | +| --------------- | ------ | ---------------------------------------------- | +| status | string | Status of the transactions (e.g., "completed") | +| date\_from | string | \`Start date in ISO 8601 format | +| date\_to | string | End date in ISO 8601 format | +| my\_coin | string | Coin being used by you for the swap/trade. | +| other\_coin | string | Coin you are trading against | +| from\_timestamp | number | Start timestamp in UNIX format | +| to\_timestamp | number | End timestamp in UNIX format | -| Parameter | Type | Description | -| ---------- | ------------------------ | ---------------------------------------------------------------------- | -| status | object | Return only swaps that match the specified status (e.g., "completed"). | -| date\_from | string (ISO 8601 format) | Return only swaps that started on or after this date. | -| date\_to | string (ISO 8601 format) | Return only swaps that started before this date. | - - + #### Example ```json { "filter": { - "status": "completed", - "date_from": "2024-01-01T00:00:00Z", - "date_to": "2024-07-01T00:00:00Z" + "status": "completed", + "date_from": "2024-01-01T00:00:00Z", + "date_to": "2024-07-01T00:00:00Z", + "my_coin": "BTC", + "other_coin": "ETH", + "from_timestamp": 1672531200, + "to_timestamp": 1704067200 } } ``` @@ -476,9 +484,9 @@ The `PagingOptions` object includes options of page selection to consult when lo ```json { "paging_options": { - "from_uuid": null, - "limit": 10, - "page_number": 1 + "from_uuid": null, + "limit": 10, + "page_number": 1 } } ``` diff --git a/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx b/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx index a4ab83a2..41ee56bf 100644 --- a/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx +++ b/src/pages/komodo-defi-framework/api/common_structures/wallet/index.mdx @@ -7,13 +7,14 @@ export const description = "Starting with version beta-2.1.3434, the Komodo DeFi The `RawTxInfo` object includes the following items: -| Parameter | Type | Description | -| ---------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| tx\_hex | string | UTXO only. The raw unsigned hex of a proposed transaction. | -| prev\_txns | list | UTXO only. A list of standard [InputTxns objects](/komodo-defi-framework/api/common_structures/wallet/#input-txns). | -| to | string | ETH/EVM only. A destination address to send the funds to. | -| value | string | ETH/EVM only. The amount of funds to be sent as a string with a `0x` prefix, in [wei](https://ethereum.stackexchange.com/questions/253/the-ether-denominations-are-called-finney-szabo-and-wei-what-who-are-these-na) units. | -| gas\_limit | string | ETH/EVM only. The maximum gas to be used for sending the transaction, in [gwei](https://eth-converter.com/) units. | +| Parameter | Type | Description | +| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| tx\_hex | string | UTXO only. The raw unsigned hex of a proposed transaction. | +| prev\_txns | list | UTXO only. A list of standard [InputTxns objects](/komodo-defi-framework/api/common_structures/wallet/#input-txns). | +| to | string | ETH/EVM only. A destination address to send the funds to. | +| value | string | ETH/EVM only. The amount of funds to be sent as a string with a `0x` prefix, in [wei](https://ethereum.stackexchange.com/questions/253/the-ether-denominations-are-called-finney-szabo-and-wei-what-who-are-these-na) units. | +| gas\_limit | string | ETH/EVM only. The maximum gas to be used for sending the transaction, in [gwei](https://eth-converter.com/) units. | +| pay\_for\_gas | object | Optional, ETH/EVM only. Used for EIP-1559 fee policy config. A standard [PayForGas](/komodo-defi-framework/api/common_structures/wallet/#pay-for-gas) object. | TODO: Confirm units used in ETH/EVM transactions. @@ -35,7 +36,12 @@ The `RawTxInfo` object includes the following items: { "to": "0x927DaFDDa16F1742BeFcBEAE6798090354B294A9", "value": "0.85", - "gas_limit": "21000" + "gas_limit": "21000", + "pay_for_gas": { + "tx_type": "Eip1559", + "max_fee_per_gas": "1234.567", + "max_priority_fee_per_gas": "1.2" + } } ``` @@ -49,8 +55,7 @@ The `InputTxns` object includes the following items: | tx\_hash | string | The transaction id of an unspent transaction from the same wallet output. | | index | integer | The \[output index([https://bitcoin.stackexchange.com/questions/100765/what-does-the-index-of-an-utxo-stand-for](https://bitcoin.stackexchange.com/questions/100765/what-does-the-index-of-an-utxo-stand-for))] of this unspent transaction output. | | script\_pub\_key | string | The [scriptpubkey](https://learnmeabitcoin.com/technical/scriptPubKey) of this unspent transaction output. | -| amount | float | The value of this unspent transaction output. | -| amount | | | +| amount | decimal | The value of this unspent transaction output. | ```json @@ -62,3 +67,47 @@ The `InputTxns` object includes the following items: } ``` + +### PayForGas + +The `PayForGas` object includes the following items: + +| Parameter | Type | Description | +| ---------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| tx\_type | string | ETH/EVM coins and tokens only. Options are `Legacy` or `Eip1559`. The type of transaction values being configured. | +| gas\_price | decimal | Only used if tx\_type is `Legacy`. Values are in Gwei. The maximium price per gas unit the user is willing to pay for the transaction. | +| max\_fee\_per\_gas | decimal | Only used if tx\_type is `Eip1559`. Values are in Gwei. The maximum amount to pay per unit of gas to get your transaction included in a block. | +| max\_priority\_fee\_per\_gas | decimal | Only used if tx\_type is `Eip1559`. Values are in Gwei. This is paid directly to the miner, and can be set by the user to attract minimal delay in transaction confirmation. | +| min\_wait\_time | integer | Optional, only used if tx\_type is `Eip1559`. Estimated minimum transaction wait time in mempool (in ms) for this priority level. | +| max\_wait\_time | integer | Optional, only used if tx\_type is `Eip1559`. Estimated maximum transaction wait time in mempool (in ms) for this priority level. | + + + [Eip1559](https://www.coinbase.com/en-au/blog/the-technical-benefits-of-eip-1559) allows users to save on gas fees. To use this feature for a coin/token, its entry in your `coins` file must include fields for `chain_id` and `max_eth_tx_type`. To allow eip-1559 transactions, `max_eth_tx_type` should be set to `2`. To find the `chain_id` for an \[EVM network([https://blog.thirdweb.com/evm-compatible-blockchains-and-ethereum-virtual-machine/](https://blog.thirdweb.com/evm-compatible-blockchains-and-ethereum-virtual-machine/))], refer to [chainlist.org](https://chainlist.org). There is also a new `gas_fee_estimator` parameter in the coins file, which can be set to `provider` or `simple`. + + By default, `simple` gas fee estimation suggests a fee based on fee history. If set `gas_fee_estimator` is set to `provider`, users must set the `gas_api` setting in their [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/) to source recommended fee values from third party providers [Infura](https://www.infura.io/) or [Blocknative](https://www.blocknative.com/). + + Use the [start\_eth\_fee\_estimator](/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/) method to begin tracking the fee market for a coin (and its tokens). You can stop tracking the fee market with [stop\_eth\_fee\_estimator](/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/). + + To set or view the current swap transaction fee policy, use the [get\_swap\_transaction\_fee\_policy](/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/) and [set\_swap\_transaction\_fee\_policy](/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/) methods. + + For more information about EIP1559, refer to [https://www.blocknative.com/blog/eip-1559-fees](https://www.blocknative.com/blog/eip-1559-fees) + + + + ```json + { + "tx_type": "Legacy", + "gas_price": "1234.567" + } + ``` + + + + ```json + { + "tx_type": "Eip1559", + "max_fee_per_gas": "1234.567", + "max_priority_fee_per_gas": "1.2" + } + ``` + diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/index.mdx new file mode 100644 index 00000000..10e37b87 --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/index.mdx @@ -0,0 +1,61 @@ +export const title = "Komodo DeFi Framework Method: Get ETH Estimated Fee per Gas"; +export const description = + "The get_eth_estimated_fee_per_gas method allows you to get the gas priority fees from the estimator (started with the 'start_eth_fee_estimator') for an active coin of your choice."; + +# get\_eth\_estimated\_fee\_per\_gas + +The `get_eth_estimated_fee_per_gas` method allows you to get the estimated gas priority fee for an active coin of your choice. Before using this method, you first need to use the [start\_eth\_fee\_estimator](/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/) method. + +| parameter | Type | Description | +| --------- | ------ | ---------------------------------------------------------------------------- | +| coin | string | Ticker of the coin/asset for which we want to start the grass fee estimator. | + +## Request + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "method": "get_eth_estimated_fee_per_gas", + "mmrpc": "2.0", + "params": { + "coin": "ETH" + } + } + ``` + + +## Response + +```json +{ + "mmrpc": "2.0", + "result": { + "base_fee": "10.890879158", + "low": { + "max_priority_fee_per_gas": "0.1101", + "max_fee_per_gas": "11.949818698", + "min_wait_time": null, + "max_wait_time": null + }, + "medium": { + "max_priority_fee_per_gas": "1.258084291", + "max_fee_per_gas": "13.905056537", + "min_wait_time": null, + "max_wait_time": null + }, + "high": { + "max_priority_fee_per_gas": "2.495532249", + "max_fee_per_gas": "15.949758042", + "min_wait_time": null, + "max_wait_time": null + }, + "source": "simple", + "base_fee_trend": "", + "priority_fee_trend": "", + "units": "Gwei" + }, + "id": null +} + +``` diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/index.mdx new file mode 100644 index 00000000..6df76652 --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/index.mdx @@ -0,0 +1,37 @@ +export const title = "Komodo DeFi Framework Method: Get Swap Transaction Fee Policy"; +export const description = + "The get_swap_transaction_fee_policy method allows you to get the current gas fees policy used when estimating swap transaction fees for supported for ETH/EVM coins/tokens.."; + +# get\_swap\_transaction\_fee\_policy + +The `get_swap_transaction_fee_policy` method allows you to get the current gas fees policy used when estimating swap transaction fees for supported for ETH/EVM coins/tokens. + +| parameter | Type | Description | +| --------- | ------ | ---------------------------------------------------------------------------------------- | +| coin | string | Ticker of the supported ETH/EVM coin/asset for which we want to view the fee policy for. | + +## Request + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "method": "get_swap_transaction_fee_policy", + "mmrpc": "2.0", + "params": { + "coin": "ETH" + } + } + ``` + + +## Response + +```json +{ + "mmrpc": "2.0", + "result": "High", + "id": null +} + +``` diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/index.mdx new file mode 100644 index 00000000..42fbe0f0 --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/index.mdx @@ -0,0 +1,89 @@ +export const title = "Komodo DeFi Framework Method: EVM Fee Management"; +export const description = + "This document describes all the available methods for the EVM Network Fee Management on the Komodo DeFi Framework."; + +# EVM Network Fee Management + +[Ethereum Improvement Proposal 1559 (EIP-1559)](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md) was introduced to enhance Ethereum's transaction fee structure, aiming to stabilize transaction costs and improve network efficiency. Implemented as part of the London Hard Fork in August 2021, EIP-1559 revamped the traditional auction-style gas fee model, replacing it with a base fee mechanism that adjusts dynamically based on network demand. This base fee is burned (removed from circulation), reducing ETH supply and introducing a deflationary effect, while an optional "tip" incentivizes miners. + +For decentralized finance (DeFi) software, EIP-1559 has provided more predictable transaction fees, improving user experience and enabling more efficient budgeting for gas costs across DeFi protocols. This update is instrumental in reducing fee volatility, encouraging broader adoption, and laying groundwork for Ethereum's scalability roadmap. + +The Komodo Defi Framework allows users to benefit from this improvement with cheaper fees on EMV networks like Ethereum and Polygon. + + + For more information about EIP1559, refer to [https://www.blocknative.com/blog/eip-1559-fees](https://www.blocknative.com/blog/eip-1559-fees) + + +## Fee Management Methods + +* Get estimated fee per gas for an EVM coin/token [get\_eth\_estimated\_fee\_per\_gas](/komodo-defi-framework/api/v20/fee_management/get_eth_estimated_fee_per_gas/). + +* Get swap transaction fee policy for an EVM coin/token [get\_swap\_transaction\_fee\_policy](/komodo-defi-framework/api/v20/fee_management/get_swap_transaction_fee_policy/). + +* Set swap transaction fee policy for an EVM coin/token [set\_swap\_transaction\_fee\_policy](/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/). + +* Start tracking the fee market for an EVM coin/token [start\_eth\_fee\_estimator](/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/). + +* Stop tracking the fee market for an EVM coin/token [stop\_eth\_fee\_estimator](/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/). + +## Fee Management Configuration + +There is also a new `gas_fee_estimator` parameter in the coins file, which can be set to `provider` or `simple`. + +By default, `simple` gas fee estimation suggests a fee based on fee history. If set `gas_fee_estimator` is set to `provider`, users must set the `gas_api` setting in their [MM2.json file](/komodo-defi-framework/setup/configure-mm2-json/) to source recommended fee values from third party providers [Infura](https://www.infura.io/) or [Blocknative](https://www.blocknative.com/). + +### In the coins file + +Below is an example of the information required in EVM token configurations in your [`coins` file](/komodo-defi-framework/tutorials/listing-a-new-coin/#erc-20-token-example). + +```json +{ + "coin": "1INCH-BEP20", + "name": "1inch_bep20", + "fname": "1Inch", + "rpcport": 80, + "mm2": 1, + "chain_id": 56, + "avg_blocktime": 3, + "required_confirmations": 3, + "protocol": { + "type": "ERC20", + "protocol_data": { + "platform": "BNB", + "contract_address": "0x111111111117dC0aa78b770fA6A738034120C302" + } + }, + "derivation_path": "m/44'/60'", + "use_access_list": true, + "max_eth_tx_type": 2, + "gas_fee_estimator": "provider", + "gas_limit": { + "eth_send_erc20": 60000, + "erc20_payment": 110000, + "erc20_receiver_spend": 85000, + "erc20_sender_refund": 85000 + } +} +``` + +For EIP1559 features, a coin/token's config needs to include the `chain_id` (sourced from [chainlist.org](https://chainlist.org)) and `max_eth_tx_type` (set to `2` if compatible) fields. + +The [`gas_limit` object](/komodo-defi-framework/tutorials/listing-a-new-coin/) values in your `coins` file will set the default limits in both `Legacy` and `Eip1559` fee configs. + +### In the MM2.json file + +If `gas_fee_estimator` is set to `provider`, you'll also need to add the `gas_api` parameter to your [MM2.json configuration file](/komodo-defi-framework/setup/configure-mm2-json/): + +```json +{ + "netid": 8762, + "rpcport": 8777, + ... + "gas_api": { + "provider": "blocknative", + "url": https://your-provider-url.com + } +} +``` + +The currently available third party providers [Infura](https://www.infura.io/) or [Blocknative](https://www.blocknative.com/). diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/index.mdx new file mode 100644 index 00000000..6d8e5c30 --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/set_swap_transaction_fee_policy/index.mdx @@ -0,0 +1,38 @@ +export const title = "Komodo DeFi Framework Method: Set Swap Transaction Fee Policy"; +export const description = + "The set_swap_transaction_fee_policy method allows you to set the gas fee policy used by supported ETH/EVM coins or tokens when estimating swap transaction fees."; + +# set\_swap\_transaction\_fee\_policy + +The `set_swap_transaction_fee_policy` method allows you to set the gas fee policy used by supported ETH/EVM coins or tokens when estimating swap transaction fees. + +| parameter | Type | Description | +| --------------------- | ------ | ------------------------------------------------------------------------------------------- | +| coin | string | Ticker of the supported ETH/EVM coin or tokens for which we want to set the fee policy for. | +| swap\_tx\_fee\_policy | string | Possible values: `Low`, `Medium`, `High`, `Internal`. | + +## Request + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "method": "set_swap_transaction_fee_policy", + "mmrpc": "2.0", + "params": { + "coin": "ETH", + "swap_tx_fee_policy": "High" + } + } + ``` + + +## Response + +```json +{ + "mmrpc": "2.0", + "result": "High", + "id": null +} +``` diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/index.mdx new file mode 100644 index 00000000..3e9f221a --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/index.mdx @@ -0,0 +1,36 @@ +export const title = "Komodo DeFi Framework Method: Start ETH Fee Estimator"; +export const description = + "The start_eth_fee_estimator method allows you to start the gas priority fee estimator loop for an active coin of your choice."; + +# start\_eth\_fee\_estimator + +The `start_eth_fee_estimator` method allows you to to start the gas priority fee estimator loop for an active coin of your choice. Before using this method, you first need to use the [enable\_eth\_with\_tokens](/komodo-defi-framework/api/v20/enable_eth_with_tokens/) method. For the gas fee estimator to work you also need to [configure your MM2.json and coins files](/komodo-defi-framework/api/v20/fee_management/#fee-management-configuration) with some extra parameters. + +| parameter | Type | Description | +| --------- | ------ | -------------------------------------------------------------------------- | +| coin | string | Ticker of the coin/asset for which we want to start the gas fee estimator. | + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "method": "start_eth_fee_estimator", + "mmrpc": "2.0", + "params": { + "coin": "ETH" + } + } + ``` + + +## Response + +```json +{ + "mmrpc": "2.0", + "result": { + "result": "Success" + }, + "id": null +} +``` diff --git a/src/pages/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/index.mdx b/src/pages/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/index.mdx new file mode 100644 index 00000000..7408f75c --- /dev/null +++ b/src/pages/komodo-defi-framework/api/v20/fee_management/stop_eth_fee_estimator/index.mdx @@ -0,0 +1,37 @@ +export const title = "Komodo DeFi Framework Method: Stop ETH Fee Estimator"; +export const description = + "The start_eth_fee_estimator method allows you to stop the gas priority fee estimator loop for an active coin of your choice."; + +# stop\_eth\_fee\_estimator + +The `stop_eth_fee_estimator` method allows you to to stop the gas priority fee estimator loop for an active coin of your choice. Before using this method, you first need to use the [enable\_eth\_with\_tokens](/komodo-defi-framework/api/v20/fee_management/start_eth_fee_estimator/) method. + +| parameter | Type | Description | +| --------- | ------ | -------------------------------------------------------------------------- | +| coin | string | Ticker of the coin/asset for which we want to start the gas fee estimator. | + + + ```json + { + "userpass": "RPC_UserP@SSW0RD", + "method": "stop_eth_fee_estimator", + "mmrpc": "2.0", + "params": { + "coin": "ETH" + } + } + ``` + + +## Response + +```json +{ + "mmrpc": "2.0", + "result": { + "result": "Success" + }, + "id": null +} + +``` diff --git a/src/pages/komodo-defi-framework/api/v20/sign_raw_transaction/index.mdx b/src/pages/komodo-defi-framework/api/v20/sign_raw_transaction/index.mdx index 94c8a9f4..126ef83e 100644 --- a/src/pages/komodo-defi-framework/api/v20/sign_raw_transaction/index.mdx +++ b/src/pages/komodo-defi-framework/api/v20/sign_raw_transaction/index.mdx @@ -120,8 +120,13 @@ The transaction can then be broadcasted to the network using the [`send_raw_tran "type": "ETH", "tx": { "to": "0x927DaFDDa16F1742BeFcBEAE6798090354B294A9", - "value": "1.4", - "gas_limit": "21000" + "value": "0.85", + "gas_limit": "21000", + "pay_for_gas": { + "tx_type": "Eip1559", + "max_fee_per_gas": "1234.567", + "max_priority_fee_per_gas": "1.2" + } } } } diff --git a/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx b/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx index 060c63cb..f6933fca 100644 --- a/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx +++ b/src/pages/komodo-defi-framework/setup/configure-mm2-json/index.mdx @@ -26,6 +26,7 @@ When running the Komodo DeFi API via commandline with the `mm2` binary, some bas | i\_am\_seed | boolean | Optional, defaults to `false`. Runs Komodo DeFi Framework API as a seed node mode (acting as a relay for Komodo DeFi Framework API clients). Use of this mode is not reccomended on the main network (8762) as it could result in a pubkey ban if non-compliant. On alternative testing or private networks, at least one seed node is required to relay information to other Komodo DeFi Framework API clients using the same netID. | | seednodes | list of strings | Optional. If operating on a test or private netID, the IP address of at least one seed node is required (on the main network, these are already hardcoded) | | enable\_hd | boolean | Optional. If `true`, the Komodo DeFi-API will work in only the [HD mode](/komodo-defi-framework/api/v20-dev/hd_wallets_overview/), and coins will need to have a coin derivation path entry in the `coins` file for activation. Defaults to `false`. | +| gas\_api | object | Optional, Used for [EVM gas fee management](/komodo-defi-framework/api/v20/fee_management/). Contains fields for `provider` and `url` to source third party fee market information. | | message\_service\_cfg | object | Optional. This data is used to configure [Telegram](https://telegram.org/) messenger alerts for swap events when running using the [makerbot functionality](/komodo-defi-framework/api/v20/start_simple_market_maker_bot/). For more information check out the [telegram alerts guide](/komodo-defi-framework/api/v20/telegram_alerts/) | | metrics | integer | Optional, defaults to `300`. The interval in seconds which metrics are logged. Set to `0` to disable metrics. | | prometheusport | integer | Optional. Only used if you are logging metrics in [Prometheus](https://prometheus.io/) and [Grafana](https://grafana.com/). For more information check out the [Komodo DeFi metrics guide](/komodo-defi-framework/tutorials/api-metrics/) | @@ -60,6 +61,21 @@ When running the Komodo DeFi API via commandline with the `mm2` binary, some bas } ``` +#### Example (using gas api): + +```json +{ + "gui": "DEVDOCS_CLI", + "netid": 8762, + "rpc_password": "Ent3r_Un1Qu3_Pa$$w0rd", + "passphrase": "ENTER_UNIQUE_SEED_PHRASE_DONT_USE_THIS_CHANGE_IT_OR_FUNDS_NOT_SAFU", + "gas_api": { + "provider": "infura", + "url": https://your-provider-url.com + } +} +``` + #### Example (WSS with certificates): ```json diff --git a/src/pages/komodo-defi-framework/tutorials/listing-a-new-coin/index.mdx b/src/pages/komodo-defi-framework/tutorials/listing-a-new-coin/index.mdx index 44d6d459..2aa2067c 100644 --- a/src/pages/komodo-defi-framework/tutorials/listing-a-new-coin/index.mdx +++ b/src/pages/komodo-defi-framework/tutorials/listing-a-new-coin/index.mdx @@ -60,7 +60,7 @@ sendrawtransaction | txfee | integer | The default transaction fee (in satoshi). Komodo DeFi Framework uses this as the default transaction fee value when making atomic swap transactions. If set to `0`, Komodo DeFi Framework will use a dynamic fee based on output from `estimatesmartfee`. | | overwintered | integer | Must be `1` if Overwinter upgrade was activated for the coin. Defaults to `0`. | | taddr | integer | Optional. Is only relevant for coins that forked the Zcash protocol and have both transparent addresses and z-addresses. The value to be set for this key can be found from the file `src/chainparams.cpp` of the coin's source code and it is the first value present in both `base58Prefixes[PUBKEY_ADDRESS]` and `base58Prefixes[SCRIPT_ADDRESS]`. But it has to be converted to decimal from HEX. So if `base58Prefixes[PUBKEY_ADDRESS]` = `{0x1C,0xB8}` , the `taddr` is `0x1C` coverted to decimal. As 0x1C in HEX = 28 in decimal, the entry in the json would be `"taddr" : 28` | -| force\_min\_relay\_fee | boolean | If `true` for coins with dynamic fees, when a new transaction is generated, Komodo DeFi Framework will check whether the total fee set (`sat * tx size`) is lower than relay fee and will use the relay fee instead. Defaults to `false` | +| force\_min\_relay\_fee | boolean | If `true` for coins with dynamic fees, when a new transaction is generated, Komodo DeFi Framework will check whether the total fee set (`sat * tx size`) is lower than relay fee and will use the relay fee instead. Defaults to `false`. | | mtp\_block\_count | integer | Optional. Number of blocks to be used for the calculation of `median time past`. Must be greater than `0`. Default value is `11`. While this parameter is applicable only in the case of KMD reward calculation for now, it will be used for calculating locktimes to be set for the atomic swap refund transactions. | | estimate\_fee\_mode | string | Sets the fee mode for the `estimatesmartfee` call. Supported values are: `ECONOMICAL`,`CONSERVATIVE`, `UNSET`. Please note that some coins may not support some of these modes. Makes no effect for coins that do not have the `estimatesmartfee` RPC. | | address\_format | object | Optional. Overwrites the address format from coins file, if set. A standard [AddressFormat](/komodo-defi-framework/api/common_structures/#address-format) object. | @@ -69,6 +69,7 @@ sendrawtransaction | version\_group\_id | integer | Optional, used by Zcash (and its forks') transactions. | | consensus\_branch\_id | integer | Optional, used in Zcash (and its forks') transactions' signature hash calculation. | | mature\_confirmations | integer | Number of blockchain confirmations required for coinbase output to be considered mature (spendable). | +| gas\_fee\_estimator | string | Optional. Set as `provider` to source fee market information via [Infura](https://www.infura.io/) or [Blocknative](https://www.blocknative.com/). Set to `simple` to source fee information from native nodes on the network. Refer to the [EVM fee mManagement](/komodo-defi-framework/api/v20/fee_management/) section for more information. | ### UTXO coin example @@ -168,6 +169,7 @@ The token's contract **must** have `approve` and `transferFrom` methods. Additio "contract_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" } }, + "gas_fee_estimator": "provider", "gas_limit": { "eth_send_coins": 21000, "eth_send_erc20": 65000,