20#ifndef RIPPLE_PROTOCOL_RATE_H_INCLUDED
21#define RIPPLE_PROTOCOL_RATE_H_INCLUDED
23#include <xrpl/beast/utility/instrumentation.h>
24#include <xrpl/protocol/STAmount.h>
26#include <boost/operators.hpp>
39struct Rate :
private boost::totally_ordered<Rate>
53 return lhs.value == rhs.value;
59 return lhs.value < rhs.value;
70multiply(STAmount
const& amount, Rate
const& rate);
73multiplyRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
77 STAmount
const& amount,
83divide(STAmount
const& amount, Rate
const& rate);
86divideRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
90 STAmount
const& amount,
Rate transferFeeAsRate(std::uint16_t fee)
Given a transfer fee (in basis points) convert it to a transfer rate.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
STAmount divide(STAmount const &amount, Rate const &rate)
STAmount multiply(STAmount const &amount, Rate const &rate)
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
STAmount divideRound(STAmount const &amount, Rate const &rate, bool roundUp)
bool operator<(Slice const &lhs, Slice const &rhs) noexcept
STAmount multiplyRound(STAmount const &amount, Rate const &rate, bool roundUp)
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Rate const parityRate
A transfer rate signifying a 1:1 exchange.
Represents a transfer rate.