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>
25#include <boost/operators.hpp>
37struct Rate :
private boost::totally_ordered<Rate>
51 return lhs.value == rhs.value;
57 return lhs.value < rhs.value;
68multiply(STAmount
const& amount, Rate
const& rate);
71multiplyRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
75 STAmount
const& amount,
81divide(STAmount
const& amount, Rate
const& rate);
84divideRound(STAmount
const& amount, Rate
const& rate,
bool roundUp);
88 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.