[#CFeeRate]
= CFeeRate
:mrdocs:

Fee rate in satoshis per virtualbyte&colon; CAmount &sol; vB the feerate is represented internally as FeeFrac

== Synopsis

Declared in `&lt;policy&sol;feerate&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class CFeeRate;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CFeeRate/2constructor-02.adoc[`CFeeRate`]         [.small]#[constructor]#
| Constructors
| xref:CFeeRate/GetFee.adoc[`GetFee`] 
| Return the fee in satoshis for the given vsize in vbytes&period; If the calculated fee would have fractional satoshis, then the returned fee will always be rounded up to the nearest satoshi&period;
| xref:CFeeRate/GetFeePerK.adoc[`GetFeePerK`] 
| Return the fee in satoshis for a vsize of 1000 vbytes
| xref:CFeeRate/GetFeePerVSize.adoc[`GetFeePerVSize`] 
| Return the fee rate as a fee&sol;vsize fraction&period;
| xref:CFeeRate/ToString.adoc[`ToString`] 
| Format the fee rate as a human&hyphen;readable string&period;
| xref:CFeeRate/operator_plus_eq.adoc[`operator&plus;&equals;`] 
| Add another fee rate to this one&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:operator_star-0e2.adoc[operator&ast;]`
| Scale a fee rate by an integer factor&period;
| `xref:operator_star-0b.adoc[operator&ast;]`
| Scale a fee rate by an integer factor&period;
| `xref:operator_eq-0ad.adoc[operator&equals;&equals;]`
| Test two fee rates for equality by their fee&sol;vsize ratio&period;
| `xref:operator_3way-08.adoc[operator&lt;&equals;&gt;]`
| Three&hyphen;way compare two fee rates by their fee&sol;vsize ratio&period;
|===

== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:ParseFeeRate.adoc[`ParseFeeRate`]
| Parse a json number or string, denoting BTC&sol;kvB, into a CFeeRate (sat&sol;kvB)&period; Reject negative values or rates larger than 1BTC&sol;kvB&period;
| xref:wallet/GetDiscardRate.adoc[`wallet&colon;&colon;GetDiscardRate`]
| Return the maximum feerate for discarding change&period;
| xref:wallet/GetRequiredFeeRate.adoc[`wallet&colon;&colon;GetRequiredFeeRate`]
| Return the minimum required feerate taking into account the minimum relay feerate and user set minimum transaction feerate
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
